Merge branch 'fix-gl-wiggle' into 'master'

Fix OpenGL underwater/heatwave effect

See merge request KartKrew/Kart!523
This commit is contained in:
Sal 2022-01-12 23:01:03 +00:00
commit 19ee219bd7

View file

@ -6751,7 +6751,6 @@ void HWR_DoPostProcessor(player_t *player)
// 10 by 10 grid. 2 coordinates (xy) // 10 by 10 grid. 2 coordinates (xy)
float v[SCREENVERTS][SCREENVERTS][2]; float v[SCREENVERTS][SCREENVERTS][2];
static double disStart = 0; static double disStart = 0;
static fixed_t last_fractime = 0;
UINT8 x, y; UINT8 x, y;
INT32 WAVELENGTH; INT32 WAVELENGTH;
@ -6761,15 +6760,15 @@ void HWR_DoPostProcessor(player_t *player)
// Modifies the wave. // Modifies the wave.
if (*type == postimg_water) if (*type == postimg_water)
{ {
WAVELENGTH = 20; // Lower is longer WAVELENGTH = 5;
AMPLITUDE = 20; // Lower is bigger AMPLITUDE = 20;
FREQUENCY = 16; // Lower is faster FREQUENCY = 8;
} }
else else
{ {
WAVELENGTH = 10; // Lower is longer WAVELENGTH = 10;
AMPLITUDE = 30; // Lower is bigger AMPLITUDE = 60;
FREQUENCY = 4; // Lower is faster FREQUENCY = 4;
} }
for (x = 0; x < SCREENVERTS; x++) for (x = 0; x < SCREENVERTS; x++)
@ -6783,16 +6782,7 @@ void HWR_DoPostProcessor(player_t *player)
} }
HWD.pfnPostImgRedraw(v); HWD.pfnPostImgRedraw(v);
if (!(paused || P_AutoPause())) if (!(paused || P_AutoPause()))
disStart += 1; disStart += FIXED_TO_FLOAT(renderdeltatics);
if (renderdeltatics > FRACUNIT)
{
disStart = disStart - FIXED_TO_FLOAT(last_fractime) + 1 + FIXED_TO_FLOAT(rendertimefrac);
}
else
{
disStart = disStart - FIXED_TO_FLOAT(last_fractime) + FIXED_TO_FLOAT(rendertimefrac);
}
last_fractime = rendertimefrac;
// Capture the screen again for screen waving on the intermission // Capture the screen again for screen waving on the intermission
if(gamestate != GS_INTERMISSION) if(gamestate != GS_INTERMISSION)