mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
Fix not copying the shade variable first
This commit is contained in:
parent
8e72e094ce
commit
cc0c0f0236
1 changed files with 5 additions and 4 deletions
|
@ -873,24 +873,25 @@ namespace swrenderer
|
|||
if (GetThingSprite(thing, sprite))
|
||||
{
|
||||
FDynamicColormap *thingColormap = basecolormap;
|
||||
int thingShade = spriteshade;
|
||||
if (sec->sectornum != thing->Sector->sectornum) // compare sectornums to account for R_FakeFlat copies.
|
||||
{
|
||||
int lightlevel = thing->Sector->GetTexture(sector_t::ceiling) == skyflatnum ? thing->Sector->GetCeilingLight() : thing->Sector->GetFloorLight();
|
||||
spriteshade = LIGHT2SHADE(lightlevel + R_ActualExtraLight(foggy));
|
||||
thingShade = LIGHT2SHADE(lightlevel + R_ActualExtraLight(foggy));
|
||||
thingColormap = thing->Sector->ColorMap;
|
||||
}
|
||||
|
||||
if ((sprite.renderflags & RF_SPRITETYPEMASK) == RF_WALLSPRITE)
|
||||
{
|
||||
RenderWallSprite::Project(thing, sprite.pos, sprite.picnum, sprite.spriteScale, sprite.renderflags, spriteshade, foggy, thingColormap);
|
||||
RenderWallSprite::Project(thing, sprite.pos, sprite.picnum, sprite.spriteScale, sprite.renderflags, thingShade, foggy, thingColormap);
|
||||
}
|
||||
else if (sprite.voxel)
|
||||
{
|
||||
RenderVoxel::Project(thing, sprite.pos, sprite.voxel, sprite.spriteScale, sprite.renderflags, fakeside, fakefloor, fakeceiling, sec, spriteshade, foggy, thingColormap);
|
||||
RenderVoxel::Project(thing, sprite.pos, sprite.voxel, sprite.spriteScale, sprite.renderflags, fakeside, fakefloor, fakeceiling, sec, thingShade, foggy, thingColormap);
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderSprite::Project(thing, sprite.pos, sprite.tex, sprite.spriteScale, sprite.renderflags, fakeside, fakefloor, fakeceiling, sec, spriteshade, foggy, thingColormap);
|
||||
RenderSprite::Project(thing, sprite.pos, sprite.tex, sprite.spriteScale, sprite.renderflags, fakeside, fakefloor, fakeceiling, sec, thingShade, foggy, thingColormap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue