Explorar o código

Minor code cleanup.

Lasse Öörni %!s(int64=14) %!d(string=hai) anos
pai
achega
5cb3afdbc7
Modificáronse 1 ficheiros con 2 adicións e 7 borrados
  1. 2 7
      Engine/Graphics/Graphics.cpp

+ 2 - 7
Engine/Graphics/Graphics.cpp

@@ -1199,7 +1199,6 @@ void Graphics::ResetRenderTargets()
     for (unsigned i = 0; i < MAX_RENDERTARGETS; ++i)
     for (unsigned i = 0; i < MAX_RENDERTARGETS; ++i)
         SetRenderTarget(i, (RenderSurface*)0);
         SetRenderTarget(i, (RenderSurface*)0);
     SetDepthStencil((RenderSurface*)0);
     SetDepthStencil((RenderSurface*)0);
-    SetViewport(IntRect(0, 0, width_, height_));
 }
 }
 
 
 void Graphics::ResetRenderTarget(unsigned index)
 void Graphics::ResetRenderTarget(unsigned index)
@@ -1361,11 +1360,7 @@ void Graphics::SetAlphaTest(bool enable, CompareMode mode, float alphaRef)
             alphaTestMode_ = mode;
             alphaTestMode_ = mode;
         }
         }
         
         
-        if (alphaRef < 0.0f)
-            alphaRef = 0.0f;
-        if (alphaRef > 1.0f) 
-            alphaRef = 1.0f;
-        
+        alphaRef = Clamp(alphaRef, 0.0f, 1.0f);
         if (alphaRef != alphaRef_)
         if (alphaRef != alphaRef_)
         {
         {
             impl_->device_->SetRenderState(D3DRS_ALPHAREF, (DWORD)(alphaRef * 255.0f));
             impl_->device_->SetRenderState(D3DRS_ALPHAREF, (DWORD)(alphaRef * 255.0f));
@@ -1478,7 +1473,7 @@ void Graphics::SetFillMode(FillMode mode)
 
 
 void Graphics::SetScissorTest(bool enable, const Rect& rect, bool borderInclusive)
 void Graphics::SetScissorTest(bool enable, const Rect& rect, bool borderInclusive)
 {
 {
-    // During some light rendering loops, a full rect is Toggled on/off repeatedly.
+    // During some light rendering loops, a full rect is toggled on/off repeatedly.
     // Disable scissor in that case to reduce state changes
     // Disable scissor in that case to reduce state changes
     if (rect == Rect::FULL)
     if (rect == Rect::FULL)
         enable = false;
         enable = false;