From 96b3d0beed9419c8c21a09515168a04432297143 Mon Sep 17 00:00:00 2001 From: bitplane Date: Thu, 12 Jun 2008 03:15:59 +0000 Subject: [PATCH] Fixed bug with Maya cam animator absorbing all wheel events (1983850) OpenGL render target flip now works with texture clamping (assuming tcoords are 0.0 to 1.0) Quick fix for crash when removing old hardware buffers. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1366 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/CNullDriver.cpp | 3 +++ source/Irrlicht/COpenGLDriver.cpp | 9 +++++++-- source/Irrlicht/COpenGLDriver.h | 2 ++ source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/source/Irrlicht/CNullDriver.cpp b/source/Irrlicht/CNullDriver.cpp index ff3a031c..7d07c3f1 100644 --- a/source/Irrlicht/CNullDriver.cpp +++ b/source/Irrlicht/CNullDriver.cpp @@ -1277,6 +1277,9 @@ void CNullDriver::updateAllHardwareBuffers() if (Link->LastUsed>20000) { deleteHardwareBuffer(Link); + + // todo: needs better fix + Iterator = HWBufferMap.getParentFirstIterator(); } } } diff --git a/source/Irrlicht/COpenGLDriver.cpp b/source/Irrlicht/COpenGLDriver.cpp index 00fb469f..cee91daf 100644 --- a/source/Irrlicht/COpenGLDriver.cpp +++ b/source/Irrlicht/COpenGLDriver.cpp @@ -348,6 +348,9 @@ bool COpenGLDriver::genericDriverInit(const core::dimension2d& screenSize, // set fog mode setFog(FogColor, LinearFog, FogStart, FogEnd, FogDensity, PixelFog, RangeFog); + // create matrix for flipping textures + TextureFlipMatrix.buildTextureTransform(0.0f, core::vector2df(0,0), core::vector2df(0,1.0f), core::vector2df(1.0f,-1.0f)); + return true; } @@ -509,9 +512,11 @@ void COpenGLDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matri glLoadIdentity(); else { - createGLTextureMatrix(glmat, mat); if (isRTT) - glmat[5] *= -1.0f; + createGLTextureMatrix(glmat, mat * TextureFlipMatrix); + else + createGLTextureMatrix(glmat, mat); + glLoadMatrixf(glmat); } break; diff --git a/source/Irrlicht/COpenGLDriver.h b/source/Irrlicht/COpenGLDriver.h index 15f60dc8..61b1f6c8 100644 --- a/source/Irrlicht/COpenGLDriver.h +++ b/source/Irrlicht/COpenGLDriver.h @@ -389,6 +389,8 @@ namespace video core::stringc vendorName; + core::matrix4 TextureFlipMatrix; + #ifdef _IRR_WINDOWS_API_ HDC HDc; // Private GDI Device Context HWND Window; diff --git a/source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp b/source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp index 9be07a6e..73b9058f 100644 --- a/source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp +++ b/source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp @@ -73,7 +73,7 @@ bool CSceneNodeAnimatorCameraMaya::OnEvent(const SEvent& event) break; case EMIE_MOUSE_WHEEL: case EMIE_COUNT: - break; + return false; } return true; }