From b10d22daeb5f8b5465c90ac8dca47cfe294cc21c Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Mon, 21 May 2018 12:15:05 +0200 Subject: [PATCH] Graphics: Fix transition when new scene has gray tone effect Rendering the scene may cause PingPong swaps of front / backbuffer, so don't take references to those buffers until after rendering. Fixes #199 --- src/graphics.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graphics.cpp b/src/graphics.cpp index 3220c5e..6b4c9f0 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -714,6 +714,9 @@ void Graphics::transition(int duration, setBrightness(255); + /* Capture new scene */ + p->screen.composite(); + /* The PP frontbuffer will hold the current scene after the * composition step. Since the backbuffer is unused during * the transition, we can reuse it as the target buffer for @@ -721,9 +724,6 @@ void Graphics::transition(int duration, TEXFBO ¤tScene = p->screen.getPP().frontBuffer(); TEXFBO &transBuffer = p->screen.getPP().backBuffer(); - /* Capture new scene */ - p->screen.composite(); - /* If no transition bitmap is provided, * we can use a simplified shader */ TransShader &transShader = shState->shaders().trans;