diff --git a/src/r_main.cpp b/src/r_main.cpp index 9e3a23a026..226480009b 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -113,6 +113,7 @@ CVAR (String, r_viewsize, "", CVAR_NOSET) CVAR (Int, r_polymost, 0, 0) CVAR (Bool, r_deathcamera, false, CVAR_ARCHIVE) CVAR (Int, r_clearbuffer, 0, 0) +CVAR (Bool, r_shadercolormaps, true, CVAR_ARCHIVE) fixed_t r_BaseVisibility; fixed_t r_WallVisibility; @@ -1259,7 +1260,7 @@ void R_SetupFrame (AActor *actor) if (player->fixedcolormap >= 0 && player->fixedcolormap < (int)SpecialColormaps.Size()) { realfixedcolormap = &SpecialColormaps[player->fixedcolormap]; - if (RenderTarget == screen && (DFrameBuffer *)screen->Accel2D) + if (RenderTarget == screen && (DFrameBuffer *)screen->Accel2D && r_shadercolormaps) { // Render everything fullbright. The copy to video memory will // apply the special colormap, so it won't be restricted to the @@ -1649,6 +1650,13 @@ void R_RenderActorView (AActor *actor, bool dontmaplines) WallMirrors.Clear (); interpolator.RestoreInterpolations (); R_SetupBuffer (); + + // If we don't want shadered colormaps, NULL it now so that the + // copy to the screen does not use a special colormap shader. + if (!r_shadercolormaps) + { + realfixedcolormap = NULL; + } } //========================================================================== diff --git a/src/r_things.cpp b/src/r_things.cpp index e07cfd25f0..bd2122ebd7 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -68,7 +68,7 @@ extern fixed_t globaluclip, globaldclip; EXTERN_CVAR (Bool, st_scale) CVAR (Int, r_drawfuzz, 1, CVAR_ARCHIVE) - +EXTERN_CVAR(Bool, r_shadercolormaps) // // Sprite rotation 0 is facing the viewer, @@ -2288,7 +2288,7 @@ void R_DrawPSprite (pspdef_t* psp, int pspnum, AActor *owner, fixed_t sx, fixed_ // If not, then don't bother trying to identify it for // hardware accelerated drawing. if (vis->colormap < SpecialColormaps[0].Colormap || - vis->colormap >= SpecialColormaps[SpecialColormaps.Size()].Colormap) + vis->colormap > SpecialColormaps.Last().Colormap) { noaccel = true; } @@ -2301,6 +2301,13 @@ void R_DrawPSprite (pspdef_t* psp, int pspnum, AActor *owner, fixed_t sx, fixed_ } } } + // If we're drawing with a special colormap, but shaders for them are disabled, do + // not accelerate. + if (!r_shadercolormaps && (vis->colormap >= SpecialColormaps[0].Colormap && + vis->colormap <= SpecialColormaps.Last().Colormap)) + { + noaccel = true; + } // If the main colormap has fixed lights, and this sprite is being drawn with that // colormap, disable acceleration so that the lights can remain fixed. if (!noaccel &&