diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index c0131ba93..a1bd98a62 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -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; diff --git a/src/r_main.c b/src/r_main.c index 5a686fb3b..ba2c3551e 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -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); diff --git a/src/r_main.h b/src/r_main.h index dbf1a141b..34fe686b5 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -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); diff --git a/src/r_plane.c b/src/r_plane.c index ec5aa90eb..208478440 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -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