- fixed black rendered sectors in Exhumed/Polymost.

More a hack than a fix, thanks to Polymost's poor state handling
This commit is contained in:
Christoph Oelckers 2021-10-16 15:35:08 +02:00
parent 7eaff41b9a
commit 86c58649ba
3 changed files with 11 additions and 5 deletions

View file

@ -2897,6 +2897,7 @@ void polymost_drawsprite(int32_t snum)
vec2_16_t tempsiz = { (int16_t)tsiz.x, (int16_t)tsiz.y };
pow2xsplit = 0;
if (globalshade > 63) globalshade = 63; // debug
polymost_drawpoly(pxy, 4, method, tempsiz);
drawpoly_srepeat = 0;

View file

@ -159,6 +159,15 @@ void GLInstance::SetFade(int index)
renderState.FogColor = lookups.getFade(index);
}
extern int globalpal;
void GLInstance::SetShade(int32_t shade, int numshades)
{
// Ugh... This particular palette does not fade to black. Should be handled better.
// It's really too bad that everything runs through here without being able to identify it anymore.
renderState.drawblack = (!(g_gameType & GAMEFLAG_PSEXHUMED) || globalpal != 4) ? shade > numshades : false;
renderState.Shade = std::min(shade, numshades - 1);
}
bool PolymostRenderState::Apply(FRenderState& state, GLState& oldState)
{
// Fog must be done before the texture so that the texture selector can override it.

View file

@ -113,11 +113,7 @@ public:
void SetPalswap(int index);
void SetFade(int palette);
void SetShade(int32_t shade, int numshades)
{
renderState.drawblack = shade > numshades;
renderState.Shade = std::min(shade, numshades-1);
}
void SetShade(int32_t shade, int numshades);
void SetVisibility(float visibility)
{