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
This commit is contained in:
		
							parent
							
								
									b5e5a26d8b
								
							
						
					
					
						commit
						ae59fcd112
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -708,6 +708,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
 | 
			
		||||
| 
						 | 
				
			
			@ -715,9 +718,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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue