mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
- fixed: Software renderer's colormap variables should not be accessed from common renderer interface code.
This commit is contained in:
parent
c1bbd81762
commit
ae3b52a68a
2 changed files with 7 additions and 11 deletions
|
@ -267,6 +267,11 @@ void FSoftwareRenderer::RenderTextureView (FCanvasTexture *tex, AActor *viewpoin
|
|||
BYTE *Pixels = const_cast<BYTE*>(tex->GetPixels());
|
||||
DSimpleCanvas *Canvas = tex->GetCanvas();
|
||||
|
||||
// curse Doom's overuse of global variables in the renderer.
|
||||
// These get clobbered by rendering to a camera texture but they need to be preserved so the final rendering can be done with the correct palette.
|
||||
unsigned char *savecolormap = fixedcolormap;
|
||||
FSpecialColormap *savecm = realfixedcolormap;
|
||||
|
||||
float savedfov = LastFOV;
|
||||
R_SetFOV ((float)fov);
|
||||
R_RenderViewToCanvas (viewpoint, Canvas, 0, 0, tex->GetWidth(), tex->GetHeight(), tex->bFirstUpdate);
|
||||
|
@ -280,6 +285,8 @@ void FSoftwareRenderer::RenderTextureView (FCanvasTexture *tex, AActor *viewpoin
|
|||
FTexture::FlipNonSquareBlockRemap (Pixels, Canvas->GetBuffer(), tex->GetWidth(), tex->GetHeight(), Canvas->GetPitch(), GPalette.Remap);
|
||||
}
|
||||
tex->SetUpdated();
|
||||
fixedcolormap = savecolormap;
|
||||
realfixedcolormap = savecm;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -62,9 +62,6 @@
|
|||
extern bool DrawFSHUD; // [RH] Defined in d_main.cpp
|
||||
EXTERN_CVAR (Bool, cl_capfps)
|
||||
|
||||
extern lighttable_t* fixedcolormap;
|
||||
extern FSpecialColormap*realfixedcolormap;
|
||||
|
||||
// TYPES -------------------------------------------------------------------
|
||||
|
||||
struct InterpolationViewer
|
||||
|
@ -1101,11 +1098,6 @@ void FCanvasTextureInfo::UpdateAll ()
|
|||
{
|
||||
FCanvasTextureInfo *probe;
|
||||
|
||||
// curse Doom's overuse of global variables in the renderer.
|
||||
// These get clobbered by rendering to a camera texture but they need to be preserved so the final rendering can be done with the correct palette.
|
||||
unsigned char *savecolormap = fixedcolormap;
|
||||
FSpecialColormap *savecm = realfixedcolormap;
|
||||
|
||||
for (probe = List; probe != NULL; probe = probe->Next)
|
||||
{
|
||||
if (probe->Viewpoint != NULL && probe->Texture->bNeedsUpdate)
|
||||
|
@ -1113,9 +1105,6 @@ void FCanvasTextureInfo::UpdateAll ()
|
|||
Renderer->RenderTextureView(probe->Texture, probe->Viewpoint, probe->FOV);
|
||||
}
|
||||
}
|
||||
|
||||
fixedcolormap = savecolormap;
|
||||
realfixedcolormap = savecm;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
Loading…
Reference in a new issue