No gamma and player sprites on screenshots

This commit is contained in:
Magnus Norddahl 2016-07-31 16:56:41 +02:00
parent 7709db4bb0
commit e8c98a5901
3 changed files with 6 additions and 6 deletions

View File

@ -260,7 +260,7 @@ void FGLRenderer::TonemapScene()
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void FGLRenderer::CopyToBackbuffer(const GL_IRECT *bounds) void FGLRenderer::CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma)
{ {
if (FGLRenderBuffers::IsEnabled()) if (FGLRenderBuffers::IsEnabled())
{ {
@ -338,7 +338,7 @@ void FGLRenderer::CopyToBackbuffer(const GL_IRECT *bounds)
mPresentShader->Bind(); mPresentShader->Bind();
mPresentShader->InputTexture.Set(0); mPresentShader->InputTexture.Set(0);
if (framebuffer->IsHWGammaActive()) if (!applyGamma || framebuffer->IsHWGammaActive())
{ {
mPresentShader->Gamma.Set(1.0f); mPresentShader->Gamma.Set(1.0f);
mPresentShader->Contrast.Set(1.0f); mPresentShader->Contrast.Set(1.0f);

View File

@ -160,8 +160,8 @@ public:
void EndDrawScene(sector_t * viewsector); void EndDrawScene(sector_t * viewsector);
void BloomScene(); void BloomScene();
void TonemapScene(); void TonemapScene();
void CopyToBackbuffer(const GL_IRECT *bounds); void CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma);
void Flush() { CopyToBackbuffer(nullptr); } void Flush() { CopyToBackbuffer(nullptr, true); }
void SetProjection(float fov, float ratio, float fovratio); void SetProjection(float fov, float ratio, float fovratio);
void SetProjection(VSMatrix matrix); // raw matrix input from stereo 3d modes void SetProjection(VSMatrix matrix); // raw matrix input from stereo 3d modes

View File

@ -858,7 +858,7 @@ sector_t * FGLRenderer::RenderViewpoint (AActor * camera, GL_IRECT * bounds, flo
clipper.SafeAddClipRangeRealAngles(ViewAngle.BAMs() + a1, ViewAngle.BAMs() - a1); clipper.SafeAddClipRangeRealAngles(ViewAngle.BAMs() + a1, ViewAngle.BAMs() - a1);
ProcessScene(toscreen); ProcessScene(toscreen);
if (mainview) EndDrawScene(retval); // do not call this for camera textures. if (mainview && toscreen) EndDrawScene(retval); // do not call this for camera textures.
if (mainview) if (mainview)
{ {
if (FGLRenderBuffers::IsEnabled()) mBuffers->BlitSceneToTexture(); if (FGLRenderBuffers::IsEnabled()) mBuffers->BlitSceneToTexture();
@ -976,7 +976,7 @@ void FGLRenderer::WriteSavePic (player_t *player, FILE *file, int width, int hei
gl_RenderState.SetSoftLightLevel(-1); gl_RenderState.SetSoftLightLevel(-1);
screen->Begin2D(false); screen->Begin2D(false);
DrawBlend(viewsector); DrawBlend(viewsector);
CopyToBackbuffer(&bounds); CopyToBackbuffer(&bounds, false);
glFlush(); glFlush();
byte * scr = (byte *)M_Malloc(width * height * 3); byte * scr = (byte *)M_Malloc(width * height * 3);