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