Revert "- Fully implemented Graf's level.PreserveSectorColor() changes into the software renderers."

This reverts commit 2f9453bc86.

# Conflicts:
#	src/swrenderer/line/r_line.cpp
#	src/swrenderer/line/r_renderdrawsegment.cpp
#	src/swrenderer/things/r_decal.cpp
#	src/swrenderer/things/r_wallsprite.cpp
This commit is contained in:
Rachael Alexanderson 2017-01-28 17:37:57 -05:00
parent 4afac0f2cc
commit 2fb82aaa9f
13 changed files with 34 additions and 18 deletions

View file

@ -30,11 +30,11 @@
#include "d_player.h" #include "d_player.h"
#include "swrenderer/scene/r_viewport.h" #include "swrenderer/scene/r_viewport.h"
#include "swrenderer/scene/r_light.h" #include "swrenderer/scene/r_light.h"
#include "g_levellocals.h"
EXTERN_CVAR(Bool, r_drawplayersprites) EXTERN_CVAR(Bool, r_drawplayersprites)
EXTERN_CVAR(Bool, r_deathcamera) EXTERN_CVAR(Bool, r_deathcamera)
EXTERN_CVAR(Bool, st_scale) EXTERN_CVAR(Bool, st_scale)
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor)
EXTERN_CVAR(Bool, r_shadercolormaps) EXTERN_CVAR(Bool, r_shadercolormaps)
void RenderPolyPlayerSprites::Render() void RenderPolyPlayerSprites::Render()
@ -269,12 +269,12 @@ void RenderPolyPlayerSprites::RenderSprite(DPSprite *sprite, AActor *owner, floa
} }
if (swrenderer::fixedlightlev >= 0) if (swrenderer::fixedlightlev >= 0)
{ {
BaseColormap = (!level.PreserveSectorColor()) ? &FullNormalLight : mybasecolormap; BaseColormap = (r_fullbrightignoresectorcolor) ? &FullNormalLight : mybasecolormap;
ColormapNum = swrenderer::fixedlightlev >> COLORMAPSHIFT; ColormapNum = swrenderer::fixedlightlev >> COLORMAPSHIFT;
} }
else if (!foggy && sprite->GetState()->GetFullbright()) else if (!foggy && sprite->GetState()->GetFullbright())
{ // full bright { // full bright
BaseColormap = (!level.PreserveSectorColor()) ? &FullNormalLight : mybasecolormap; // [RH] use basecolormap BaseColormap = (r_fullbrightignoresectorcolor) ? &FullNormalLight : mybasecolormap; // [RH] use basecolormap
ColormapNum = 0; ColormapNum = 0;
} }
else else
@ -334,9 +334,9 @@ void RenderPolyPlayerSprites::RenderSprite(DPSprite *sprite, AActor *owner, floa
noaccel = true; noaccel = true;
} }
// [SP] If emulating GZDoom fullbright, disable acceleration // [SP] If emulating GZDoom fullbright, disable acceleration
if (!level.PreserveSectorColor() && cameraLight->fixedlightlev >= 0) if (r_fullbrightignoresectorcolor && cameraLight->fixedlightlev >= 0)
mybasecolormap = &FullNormalLight; mybasecolormap = &FullNormalLight;
if (!level.PreserveSectorColor() && !foggy && sprite->GetState()->GetFullbright()) if (r_fullbrightignoresectorcolor && !foggy && sprite->GetState()->GetFullbright())
mybasecolormap = &FullNormalLight; mybasecolormap = &FullNormalLight;
colormap_to_use = mybasecolormap; colormap_to_use = mybasecolormap;
} }

View file

@ -52,6 +52,7 @@
CVAR(Bool, r_fogboundary, true, 0) CVAR(Bool, r_fogboundary, true, 0)
CVAR(Bool, r_drawmirrors, true, 0) CVAR(Bool, r_drawmirrors, true, 0)
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor);
namespace swrenderer namespace swrenderer
{ {
@ -936,7 +937,7 @@ namespace swrenderer
CameraLight *cameraLight = CameraLight::Instance(); CameraLight *cameraLight = CameraLight::Instance();
if (cameraLight->fixedlightlev >= 0) if (cameraLight->fixedlightlev >= 0)
drawerstyle.SetColorMapLight((!level.PreserveSectorColor()) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); drawerstyle.SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev));
else if (cameraLight->fixedcolormap != nullptr) else if (cameraLight->fixedcolormap != nullptr)
drawerstyle.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); drawerstyle.SetColorMapLight(cameraLight->fixedcolormap, 0, 0);

View file

@ -41,7 +41,8 @@
#include "swrenderer/things/r_visiblesprite.h" #include "swrenderer/things/r_visiblesprite.h"
#include "swrenderer/scene/r_light.h" #include "swrenderer/scene/r_light.h"
#include "swrenderer/scene/r_viewport.h" #include "swrenderer/scene/r_viewport.h"
#include "g_levellocals.h"
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor);
namespace swrenderer namespace swrenderer
{ {
@ -141,7 +142,7 @@ namespace swrenderer
rw_scalestep = ds->iscalestep; rw_scalestep = ds->iscalestep;
if (cameraLight->fixedlightlev >= 0) if (cameraLight->fixedlightlev >= 0)
drawerstyle.SetColorMapLight((!level.PreserveSectorColor()) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); drawerstyle.SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev));
else if (cameraLight->fixedcolormap != nullptr) else if (cameraLight->fixedcolormap != nullptr)
drawerstyle.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); drawerstyle.SetColorMapLight(cameraLight->fixedcolormap, 0, 0);
@ -444,7 +445,7 @@ namespace swrenderer
CameraLight *cameraLight = CameraLight::Instance(); CameraLight *cameraLight = CameraLight::Instance();
if (cameraLight->fixedlightlev >= 0) if (cameraLight->fixedlightlev >= 0)
drawerstyle.SetColorMapLight((!level.PreserveSectorColor()) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); drawerstyle.SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev));
else if (cameraLight->fixedcolormap != nullptr) else if (cameraLight->fixedcolormap != nullptr)
drawerstyle.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); drawerstyle.SetColorMapLight(cameraLight->fixedcolormap, 0, 0);

View file

@ -32,9 +32,9 @@
#include "d_player.h" #include "d_player.h"
#include "swrenderer/scene/r_light.h" #include "swrenderer/scene/r_light.h"
#include "swrenderer/scene/r_viewport.h" #include "swrenderer/scene/r_viewport.h"
#include "g_levellocals.h"
CVAR(Bool, r_shadercolormaps, true, CVAR_ARCHIVE) CVAR(Bool, r_shadercolormaps, true, CVAR_ARCHIVE)
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor)
namespace swrenderer namespace swrenderer
{ {
@ -75,7 +75,7 @@ namespace swrenderer
{ {
fixedlightlev = player->fixedlightlevel * 256; fixedlightlev = player->fixedlightlevel * 256;
// [SP] Emulate GZDoom's light-amp goggles. // [SP] Emulate GZDoom's light-amp goggles.
if (!level.PreserveSectorColor() && fixedlightlev >= 0) if (r_fullbrightignoresectorcolor && fixedlightlev >= 0)
{ {
fixedcolormap = &FullNormalLight; fixedcolormap = &FullNormalLight;
} }
@ -194,12 +194,12 @@ namespace swrenderer
} }
else if (cameraLight->fixedlightlev >= 0) else if (cameraLight->fixedlightlev >= 0)
{ {
BaseColormap = (!level.PreserveSectorColor()) ? &FullNormalLight : basecolormap; BaseColormap = (r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap;
ColormapNum = cameraLight->fixedlightlev >> COLORMAPSHIFT; ColormapNum = cameraLight->fixedlightlev >> COLORMAPSHIFT;
} }
else if (fullbright) else if (fullbright)
{ {
BaseColormap = (!level.PreserveSectorColor()) ? &FullNormalLight : basecolormap; BaseColormap = (r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap;
ColormapNum = 0; ColormapNum = 0;
} }
else else

View file

@ -62,6 +62,7 @@
#include "r_data/colormaps.h" #include "r_data/colormaps.h"
#include "g_levellocals.h" #include "g_levellocals.h"
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor);
EXTERN_CVAR(Bool, r_drawvoxels); EXTERN_CVAR(Bool, r_drawvoxels);
namespace swrenderer namespace swrenderer
@ -493,7 +494,7 @@ namespace swrenderer
} }
else else
{ {
basecolormap = (!level.PreserveSectorColor() && cameraLight->fixedlightlev >= 0) ? &FullNormalLight : frontsector->ColorMap; basecolormap = (r_fullbrightignoresectorcolor && cameraLight->fixedlightlev >= 0) ? &FullNormalLight : frontsector->ColorMap;
} }
portal = frontsector->ValidatePortal(sector_t::ceiling); portal = frontsector->ValidatePortal(sector_t::ceiling);
@ -531,7 +532,7 @@ namespace swrenderer
} }
else else
{ {
basecolormap = (!level.PreserveSectorColor() && cameraLight->fixedlightlev >= 0) ? &FullNormalLight : frontsector->ColorMap; basecolormap = (r_fullbrightignoresectorcolor && cameraLight->fixedlightlev >= 0) ? &FullNormalLight : frontsector->ColorMap;
} }
// killough 3/7/98: Add (x,y) offsets to flats, add deep water check // killough 3/7/98: Add (x,y) offsets to flats, add deep water check

View file

@ -43,6 +43,8 @@ EXTERN_CVAR(Int, r_drawfuzz)
EXTERN_CVAR(Bool, r_drawvoxels) EXTERN_CVAR(Bool, r_drawvoxels)
EXTERN_CVAR(Bool, r_blendmethod) EXTERN_CVAR(Bool, r_blendmethod)
CVAR(Bool, r_fullbrightignoresectorcolor, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
namespace swrenderer namespace swrenderer
{ {
RenderTranslucentPass *RenderTranslucentPass::Instance() RenderTranslucentPass *RenderTranslucentPass::Instance()

View file

@ -42,7 +42,8 @@
#include "swrenderer/scene/r_light.h" #include "swrenderer/scene/r_light.h"
#include "swrenderer/things/r_wallsprite.h" #include "swrenderer/things/r_wallsprite.h"
#include "swrenderer/r_memory.h" #include "swrenderer/r_memory.h"
#include "g_levellocals.h"
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor);
namespace swrenderer namespace swrenderer
{ {

View file

@ -56,6 +56,8 @@
#include "swrenderer/drawers/r_draw_pal.h" #include "swrenderer/drawers/r_draw_pal.h"
#include "swrenderer/r_memory.h" #include "swrenderer/r_memory.h"
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor);
namespace swrenderer namespace swrenderer
{ {
void RenderParticle::Project(particle_t *particle, const sector_t *sector, int shade, WaterFakeSide fakeside, bool foggy) void RenderParticle::Project(particle_t *particle, const sector_t *sector, int shade, WaterFakeSide fakeside, bool foggy)

View file

@ -61,6 +61,7 @@ EXTERN_CVAR(Bool, st_scale)
EXTERN_CVAR(Bool, r_drawplayersprites) EXTERN_CVAR(Bool, r_drawplayersprites)
EXTERN_CVAR(Bool, r_deathcamera) EXTERN_CVAR(Bool, r_deathcamera)
EXTERN_CVAR(Bool, r_shadercolormaps) EXTERN_CVAR(Bool, r_shadercolormaps)
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor)
namespace swrenderer namespace swrenderer
{ {

View file

@ -56,6 +56,8 @@
#include "swrenderer/things/r_sprite.h" #include "swrenderer/things/r_sprite.h"
#include "swrenderer/r_memory.h" #include "swrenderer/r_memory.h"
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor)
namespace swrenderer namespace swrenderer
{ {
void RenderSprite::Project(AActor *thing, const DVector3 &pos, FTexture *tex, const DVector2 &spriteScale, int renderflags, WaterFakeSide fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector, int spriteshade, bool foggy, FDynamicColormap *basecolormap) void RenderSprite::Project(AActor *thing, const DVector3 &pos, FTexture *tex, const DVector2 &spriteScale, int renderflags, WaterFakeSide fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector, int spriteshade, bool foggy, FDynamicColormap *basecolormap)

View file

@ -36,6 +36,8 @@
#include "swrenderer/scene/r_viewport.h" #include "swrenderer/scene/r_viewport.h"
#include "swrenderer/r_memory.h" #include "swrenderer/r_memory.h"
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor);
namespace swrenderer namespace swrenderer
{ {
void VisibleSprite::Render() void VisibleSprite::Render()

View file

@ -43,6 +43,8 @@
#include "swrenderer/scene/r_light.h" #include "swrenderer/scene/r_light.h"
#include "swrenderer/r_memory.h" #include "swrenderer/r_memory.h"
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor)
namespace swrenderer namespace swrenderer
{ {
void RenderVoxel::Project(AActor *thing, DVector3 pos, FVoxelDef *voxel, const DVector2 &spriteScale, int renderflags, WaterFakeSide fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector, int spriteshade, bool foggy, FDynamicColormap *basecolormap) void RenderVoxel::Project(AActor *thing, DVector3 pos, FVoxelDef *voxel, const DVector2 &spriteScale, int renderflags, WaterFakeSide fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector, int spriteshade, bool foggy, FDynamicColormap *basecolormap)

View file

@ -57,7 +57,8 @@
#include "swrenderer/line/r_wallsetup.h" #include "swrenderer/line/r_wallsetup.h"
#include "swrenderer/line/r_walldraw.h" #include "swrenderer/line/r_walldraw.h"
#include "swrenderer/r_memory.h" #include "swrenderer/r_memory.h"
#include "g_levellocals.h"
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor);
namespace swrenderer namespace swrenderer
{ {
@ -191,7 +192,7 @@ namespace swrenderer
else if (cameraLight->fixedcolormap != NULL) else if (cameraLight->fixedcolormap != NULL)
drawerstyle.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); drawerstyle.SetColorMapLight(cameraLight->fixedcolormap, 0, 0);
else if (!spr->foggy && (spr->renderflags & RF_FULLBRIGHT)) else if (!spr->foggy && (spr->renderflags & RF_FULLBRIGHT))
drawerstyle.SetColorMapLight((!level.PreserveSectorColor()) ? &FullNormalLight : usecolormap, 0, 0); drawerstyle.SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : usecolormap, 0, 0);
else else
calclighting = true; calclighting = true;