Browse Source

- Fixed scene color-clear clipping bug.
- Added a reference to the GUI control in SceneRenderState.

MelvMay-GG 12 years ago
parent
commit
3e74e7c

+ 2 - 1
engine/source/2d/gui/SceneWindow.cc

@@ -1612,7 +1612,8 @@ void SceneWindow::onRender( Point2I offset, const RectI& updateRect )
         mRenderLayerMask,
         mRenderGroupMask,
         Vector2( mCameraCurrent.mSceneWindowScale ),
-        &debugStats );
+        &debugStats,
+        this );
 
     // Render View.
     pScene->sceneRender( &sceneRenderState );

+ 2 - 1
engine/source/2d/gui/guiSceneObjectCtrl.cc

@@ -434,7 +434,8 @@ void GuiSceneObjectCtrl::onRender(Point2I offset, const RectI& updateRect)
           MASK_ALL,
           MASK_ALL,
           Vector2::getOne(),
-          &debugStats );
+          &debugStats,
+          this );
 
       SceneRenderRequest guiSceneRenderRequest;
       guiSceneRenderRequest.set(

+ 1 - 1
engine/source/2d/scene/Scene.cc

@@ -1084,7 +1084,7 @@ void Scene::sceneRender( const SceneRenderState* pSceneRenderState )
         // Enable the scissor.
         const RectI& clipRect = dglGetClipRect();
         glEnable(GL_SCISSOR_TEST );
-        glScissor( clipRect.point.x, clipRect.point.y, clipRect.len_x(), clipRect.len_y() );
+        glScissor( clipRect.point.x, Platform::getWindowSize().y - (clipRect.point.y + clipRect.extent.y), clipRect.len_x(), clipRect.len_y() );
 
         // Clear the background.
         glClearColor( mBackgroundColor.red, mBackgroundColor.green, mBackgroundColor.blue, mBackgroundColor.alpha );

+ 6 - 1
engine/source/2d/scene/SceneRenderState.h

@@ -29,6 +29,7 @@
 
 //-----------------------------------------------------------------------------
 
+class GuiControl;
 class RectF;
 class DebugStats;
 struct b2AABB;
@@ -44,7 +45,8 @@ struct SceneRenderState
         U32 renderLayerMask,
         U32 renderGroupMask,
         const Vector2& renderScale,
-        DebugStats* pDebugStats )
+        DebugStats* pDebugStats,
+        GuiControl* pGuiControl )
     {
         mRenderArea       = renderArea;
         mRenderAABB       = CoreMath::mRectFtoAABB( renderArea );
@@ -54,6 +56,7 @@ struct SceneRenderState
         mRenderLayerMask  = renderLayerMask;
         mRenderGroupMask  = renderGroupMask;
         mpDebugStats      = pDebugStats;
+        mpGuiControl      = pGuiControl;
     }
 
     RectF           mRenderArea;
@@ -64,6 +67,8 @@ struct SceneRenderState
     U32             mRenderGroupMask;
     Vector2         mRenderScale;
     DebugStats*     mpDebugStats;
+    GuiControl*     mpGuiControl;
+
 
 };