mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-14 08:31:23 +00:00
Fix tonemap palette not being rebuilt on palette change
This commit is contained in:
parent
c9578ae72d
commit
b1a0108a96
4 changed files with 11 additions and 0 deletions
|
@ -278,6 +278,12 @@ void FGLRenderer::BindTonemapPalette(int texunit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FGLRenderer::ClearTonemapPalette()
|
||||||
|
{
|
||||||
|
delete mTonemapPalette;
|
||||||
|
mTonemapPalette = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Apply lens distortion and place the result in the HUD/2D texture
|
// Apply lens distortion and place the result in the HUD/2D texture
|
||||||
|
|
|
@ -111,6 +111,7 @@ FGLRenderer::FGLRenderer(OpenGLFrameBuffer *fb)
|
||||||
gllight = glpart2 = glpart = mirrortexture = NULL;
|
gllight = glpart2 = glpart = mirrortexture = NULL;
|
||||||
mLights = NULL;
|
mLights = NULL;
|
||||||
m2DDrawer = nullptr;
|
m2DDrawer = nullptr;
|
||||||
|
mTonemapPalette = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gl_LoadModels();
|
void gl_LoadModels();
|
||||||
|
|
|
@ -167,6 +167,7 @@ public:
|
||||||
void BloomScene();
|
void BloomScene();
|
||||||
void TonemapScene();
|
void TonemapScene();
|
||||||
void BindTonemapPalette(int texunit);
|
void BindTonemapPalette(int texunit);
|
||||||
|
void ClearTonemapPalette();
|
||||||
void LensDistortScene();
|
void LensDistortScene();
|
||||||
void CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma);
|
void CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma);
|
||||||
void Flush() { CopyToBackbuffer(nullptr, true); }
|
void Flush() { CopyToBackbuffer(nullptr, true); }
|
||||||
|
|
|
@ -310,6 +310,9 @@ void OpenGLFrameBuffer::UpdatePalette()
|
||||||
bb>>=8;
|
bb>>=8;
|
||||||
|
|
||||||
palette_brightness = (rr*77 + gg*143 + bb*35)/255;
|
palette_brightness = (rr*77 + gg*143 + bb*35)/255;
|
||||||
|
|
||||||
|
if (GLRenderer)
|
||||||
|
GLRenderer->ClearTonemapPalette();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLFrameBuffer::GetFlashedPalette (PalEntry pal[256])
|
void OpenGLFrameBuffer::GetFlashedPalette (PalEntry pal[256])
|
||||||
|
|
Loading…
Reference in a new issue