Fixed crash on accessing player sprite's state in software renderer

https://forum.zdoom.org/viewtopic.php?t=60034
This commit is contained in:
alexey.lysiuk 2018-03-30 16:40:31 +03:00
parent 408a2f6dab
commit 709bbe3db0
2 changed files with 4 additions and 2 deletions

View file

@ -354,7 +354,8 @@ void RenderPolyPlayerSprites::RenderSprite(PolyRenderThread *thread, DPSprite *p
invertcolormap = !invertcolormap;
}
bool fullbright = !foggy && pspr->GetState()->GetFullbright();
const FState* const psprState = pspr->GetState();
bool fullbright = !foggy && (psprState == nullptr ? false : psprState->GetFullbright());
bool fadeToBlack = (vis.RenderStyle.Flags & STYLEF_FadeToBlack) != 0;
vis.Light.SetColormap(0, spriteshade, basecolormap, fullbright, invertcolormap, fadeToBlack);

View file

@ -357,7 +357,8 @@ namespace swrenderer
invertcolormap = !invertcolormap;
}
bool fullbright = !foggy && pspr->GetState()->GetFullbright();
const FState* const psprState = pspr->GetState();
bool fullbright = !foggy && (psprState == nullptr ? false : psprState->GetFullbright());
bool fadeToBlack = (vis.RenderStyle.Flags & STYLEF_FadeToBlack) != 0;
vis.Light.SetColormap(0, spriteshade, basecolormap, fullbright, invertcolormap, fadeToBlack);