Skip to content

Commit

Permalink
Graphics: Fix transition when new scene has gray tone effect
Browse files Browse the repository at this point in the history
Rendering the scene may cause PingPong swaps of front / backbuffer,
so don't take references to those buffers until after rendering.

Fixes #199
  • Loading branch information
Ancurio committed May 21, 2018
1 parent b5e5a26 commit ae59fcd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,16 +708,16 @@ 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
* the final rendered image. */
TEXFBO &currentScene = 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;
Expand Down

0 comments on commit ae59fcd

Please sign in to comment.