add toggle for water ripples Zzz...

This commit is contained in:
Alug committed 2024-09-24 22:18:27 +02:00
1 parent da769ce524
commit 0137f2254d
4 files changed
+36 -24

No files matched your search

+1 -1
View File
@@ -846,7 +846,7 @@ void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, boolean isc
{
if (PolyFlags & PF_Fog)
shader = SHADER_FOG;
else if (PolyFlags & PF_Ripple)
else if (cv_ripplewater.value && (PolyFlags & PF_Ripple))
shader = SHADER_WATER;
else
shader = SHADER_FLOOR;
+4
View File
@@ -213,6 +213,8 @@ consvar_t cv_mobjscaleprecip = {"scaleprecipmobjscale", "Off", CV_SAVE|CV_CALL|C
consvar_t cv_grmaxinterpdist = {"gr_maxinterpdist", "Infinite", CV_SAVE, maxinterpdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_ripplewater = {"waterripples", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// cap fov, fov too high tears software apart.
consvar_t cv_fov = {"fov", "90", CV_FLOAT|CV_CALL|CV_SAVE, fov_cons_t, Fov_OnChange, 0, NULL, NULL, 0, 0, NULL};
@@ -1889,6 +1891,8 @@ void R_RegisterEngineStuff(void)
CV_RegisterVar(&cv_grmaxinterpdist);
CV_RegisterVar(&cv_ripplewater);
// Default viewheight is changeable,
// initialized to standard viewheight
//CV_RegisterVar(&cv_viewheight);
+1
View File
@@ -124,6 +124,7 @@ extern consvar_t cv_fov;
extern consvar_t cv_skybox;
extern consvar_t cv_tailspickup;
extern consvar_t cv_grmaxinterpdist;
extern consvar_t cv_ripplewater;
// Called by startup code.
void R_Init(void);
+30 -23
View File
@@ -910,34 +910,41 @@ void R_DrawSinglePlane(visplane_t *pl)
INT32 top, bottom;
UINT8 *scr;
planeripple.active = true;
if (spanfunc == R_DrawTranslucentSpan_8)
if (cv_ripplewater.value)
{
spanfunc = R_DrawTranslucentWaterSpan_8;
planeripple.active = true;
// Copy the current scene, ugh
top = pl->high-8;
bottom = pl->low+8;
if (spanfunc == R_DrawTranslucentSpan_8)
{
spanfunc = R_DrawTranslucentWaterSpan_8;
if (top < 0)
top = 0;
if (bottom > vid.height)
bottom = vid.height;
// Copy the current scene, ugh
top = pl->high-8;
bottom = pl->low+8;
if (splitscreen > 2 && viewplayer == &players[displayplayers[3]]) // Only copy the part of the screen we need
scr = (screens[0] + (top+(viewheight))*vid.width + viewwidth);
else if ((splitscreen == 1 && viewplayer == &players[displayplayers[1]])
|| (splitscreen > 1 && viewplayer == &players[displayplayers[2]]))
scr = (screens[0] + (top+(viewheight))*vid.width);
else if (splitscreen > 1 && viewplayer == &players[displayplayers[1]])
scr = (screens[0] + ((top)*vid.width) + viewwidth);
else
scr = (screens[0] + ((top)*vid.width));
if (top < 0)
top = 0;
if (bottom > vid.height)
bottom = vid.height;
VID_BlitLinearScreen(scr, screens[1]+((top)*vid.width),
vid.width, bottom-top,
vid.width, vid.width);
if (splitscreen > 2 && viewplayer == &players[displayplayers[3]]) // Only copy the part of the screen we need
scr = (screens[0] + (top+(viewheight))*vid.width + viewwidth);
else if ((splitscreen == 1 && viewplayer == &players[displayplayers[1]])
|| (splitscreen > 1 && viewplayer == &players[displayplayers[2]]))
scr = (screens[0] + (top+(viewheight))*vid.width);
else if (splitscreen > 1 && viewplayer == &players[displayplayers[1]])
scr = (screens[0] + ((top)*vid.width) + viewwidth);
else
scr = (screens[0] + ((top)*vid.width));
VID_BlitLinearScreen(scr, screens[1]+((top)*vid.width),
vid.width, bottom-top,
vid.width, vid.width);
}
}
else
{
planeripple.active = false;
}
}
#endif