BGE: Fixing a performance regression with 2D filters. My changes caused a check to...
authorMitchell Stokes <mogurijin@gmail.com>
Sat, 28 Jul 2012 09:45:39 +0000 (09:45 +0000)
committerMitchell Stokes <mogurijin@gmail.com>
Sat, 28 Jul 2012 09:45:39 +0000 (09:45 +0000)
source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
source/gameengine/Rasterizer/RAS_2DFilterManager.h

index 097c2a9c824120f99c8d62b4ff1ecc74fae55aac..92c390efd39ccca5ca1b149771d072c89d7551bb 100644 (file)
@@ -52,7 +52,6 @@
 
 RAS_2DFilterManager::RAS_2DFilterManager():
 texturewidth(-1), textureheight(-1),
-canvaswidth(-1), canvasheight(-1),
 /* numberoffilters(0), */ /* UNUSED */ need_tex_update(true)
 {
        isshadersupported = GLEW_ARB_shader_objects &&
@@ -404,7 +403,7 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas)
        RAS_Rect rect = canvas->GetWindowArea();
        int rect_width = rect.GetWidth()+1, rect_height = rect.GetHeight()+1;
 
-       if (canvaswidth != canvas->GetWidth() || canvasheight != canvas->GetHeight())
+       if (texturewidth != rect_width || textureheight != rect_height)
        {
                UpdateOffsetMatrix(canvas);
                UpdateCanvasTextureCoord((unsigned int*)viewport);
index 93d143dd3ced3feae27ff58c5560a7f50e9fc0bb..ba74018d36bce54881781e87a84ea99347e1e07b 100644 (file)
@@ -62,8 +62,6 @@ private:
        unsigned int    texname[3]; 
        int                             texturewidth;
        int                             textureheight;
-       int                             canvaswidth;
-       int                             canvasheight;
        /* int                          numberoffilters; */ /* UNUSED */
        /* bit 0: enable/disable depth texture
         * bit 1: enable/disable luminance texture*/