summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-08-09 19:51:16 +0200
committeraap <aap@papnet.eu>2020-08-09 19:51:16 +0200
commite57d4508098a9a930724d018a2132a4e704b1cf1 (patch)
treeff4e5daa2dc6978e429cf82ca376642dacdeb786 /src/render
parenttimecycle done (diff)
downloadre3-e57d4508098a9a930724d018a2132a4e704b1cf1.tar
re3-e57d4508098a9a930724d018a2132a4e704b1cf1.tar.gz
re3-e57d4508098a9a930724d018a2132a4e704b1cf1.tar.bz2
re3-e57d4508098a9a930724d018a2132a4e704b1cf1.tar.lz
re3-e57d4508098a9a930724d018a2132a4e704b1cf1.tar.xz
re3-e57d4508098a9a930724d018a2132a4e704b1cf1.tar.zst
re3-e57d4508098a9a930724d018a2132a4e704b1cf1.zip
Diffstat (limited to 'src/render')
-rw-r--r--src/render/MBlur.cpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/render/MBlur.cpp b/src/render/MBlur.cpp
index 568a0bc1..4c805d25 100644
--- a/src/render/MBlur.cpp
+++ b/src/render/MBlur.cpp
@@ -255,6 +255,11 @@ CMBlur::MotionBlurRender(RwCamera *cam, uint32 red, uint32 green, uint32 blue, u
#endif
}
+static uint8 DrunkBlurRed = 128;
+static uint8 DrunkBlurGreen = 128;
+static uint8 DrunkBlurBlue = 128;
+static int32 DrunkBlurIncrement = 1;
+
void
CMBlur::OverlayRender(RwCamera *cam, RwRaster *raster, RwRGBA color, int32 type, int32 bluralpha)
{
@@ -367,7 +372,36 @@ CMBlur::OverlayRender(RwCamera *cam, RwRaster *raster, RwRGBA color, int32 type,
}
}
- // TODO(MIAMI): drunkness
+ int DrunkBlurAlpha = 175.0f * Drunkness;
+ if(DrunkBlurAlpha != 0){
+ RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
+ RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
+ if(BlurOn){
+ RwIm2DVertexSetIntRGBA(&Vertex[0], 255, 255, 255, DrunkBlurAlpha);
+ RwIm2DVertexSetIntRGBA(&Vertex[1], 255, 255, 255, DrunkBlurAlpha);
+ RwIm2DVertexSetIntRGBA(&Vertex[2], 255, 255, 255, DrunkBlurAlpha);
+ RwIm2DVertexSetIntRGBA(&Vertex[3], 255, 255, 255, DrunkBlurAlpha);
+ }else{
+ RwIm2DVertexSetIntRGBA(&Vertex[0], DrunkBlurRed, DrunkBlurGreen, DrunkBlurBlue, DrunkBlurAlpha);
+ RwIm2DVertexSetIntRGBA(&Vertex[1], DrunkBlurRed, DrunkBlurGreen, DrunkBlurBlue, DrunkBlurAlpha);
+ RwIm2DVertexSetIntRGBA(&Vertex[2], DrunkBlurRed, DrunkBlurGreen, DrunkBlurBlue, DrunkBlurAlpha);
+ RwIm2DVertexSetIntRGBA(&Vertex[3], DrunkBlurRed, DrunkBlurGreen, DrunkBlurBlue, DrunkBlurAlpha);
+ if(DrunkBlurIncrement){
+ if(DrunkBlurRed < 255) DrunkBlurRed++;
+ if(DrunkBlurGreen < 255) DrunkBlurGreen++;
+ if(DrunkBlurBlue < 255) DrunkBlurBlue++;
+ if(DrunkBlurRed == 255)
+ DrunkBlurIncrement = 0;
+ }else{
+ if(DrunkBlurRed > 128) DrunkBlurRed--;
+ if(DrunkBlurGreen > 128) DrunkBlurGreen--;
+ if(DrunkBlurBlue > 128) DrunkBlurBlue--;
+ if(DrunkBlurRed == 128)
+ DrunkBlurIncrement = 1;
+ }
+ }
+ RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, Vertex, 4, Index, 6);
+ }
// TODO(MIAMI): OverlayRenderFx