Graphics: Fix viewport color/flash effectiveness calculation
Fixes #121.
This commit is contained in:
		
							parent
							
								
									61849a9158
								
							
						
					
					
						commit
						afab51279e
					
				
					 1 changed files with 8 additions and 8 deletions
				
			
		| 
						 | 
					@ -174,7 +174,12 @@ public:
 | 
				
			||||||
		const IntRect &viewpRect = glState.scissorBox.get();
 | 
							const IntRect &viewpRect = glState.scissorBox.get();
 | 
				
			||||||
		const IntRect &screenRect = geometry.rect;
 | 
							const IntRect &screenRect = geometry.rect;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (t.w != 0.0)
 | 
							bool toneRGBEffect  = t.xyzHasEffect();
 | 
				
			||||||
 | 
							bool toneGrayEffect = t.w != 0;
 | 
				
			||||||
 | 
							bool colorEffect    = c.w > 0;
 | 
				
			||||||
 | 
							bool flashEffect    = f.w > 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (toneGrayEffect)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			pp.swapRender();
 | 
								pp.swapRender();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -206,19 +211,14 @@ public:
 | 
				
			||||||
			glState.blend.pop();
 | 
								glState.blend.pop();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		bool toneEffect = t.xyzHasEffect();
 | 
							if (!toneRGBEffect && !colorEffect && !flashEffect)
 | 
				
			||||||
		bool colorEffect = c.xyzHasEffect();
 | 
					 | 
				
			||||||
		bool flashEffect = f.xyzHasEffect();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (!toneEffect && !colorEffect && !flashEffect)
 | 
					 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		FlatColorShader &shader = shState->shaders().flatColor;
 | 
							FlatColorShader &shader = shState->shaders().flatColor;
 | 
				
			||||||
		shader.bind();
 | 
							shader.bind();
 | 
				
			||||||
		shader.applyViewportProj();
 | 
							shader.applyViewportProj();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* Apply tone */
 | 
							if (toneRGBEffect)
 | 
				
			||||||
		if (toneEffect)
 | 
					 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			/* First split up additive / substractive components */
 | 
								/* First split up additive / substractive components */
 | 
				
			||||||
			Vec4 add, sub;
 | 
								Vec4 add, sub;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue