- Add missing screenshot sRGB gamma when vid_hdr is active

# Conflicts:
#	src/gl/system/gl_framebuffer.cpp

# Conflicts:
#	src/gl/system/gl_framebuffer.cpp
This commit is contained in:
Magnus Norddahl 2019-01-03 03:48:47 +01:00 committed by drfrag
parent b359b65f35
commit 011176668a

View file

@ -64,6 +64,8 @@ FGLRenderer *GLRenderer;
void gl_LoadExtensions();
void gl_PrintStartupLog();
extern bool vid_hdr_active;
CUSTOM_CVAR(Int, vid_hwgamma, 2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
{
if (self < 0 || self > 2) self = 2;
@ -524,6 +526,8 @@ void OpenGLFrameBuffer::GetScreenshotBuffer(const uint8_t *&buffer, int &pitch,
// Screenshot should not use gamma correction if it was already applied to rendered image
EXTERN_CVAR(Bool, fullscreen);
gamma = 1 == vid_hwgamma || (2 == vid_hwgamma && !fullscreen) ? 1.0f : Gamma;
if (vid_hdr_active && fullscreen)
gamma *= 2.2f;
}
//===========================================================================