From: <jww...@us...> - 2014-03-18 22:56:52
|
Revision: 3315 http://sourceforge.net/p/quesa/code/3315 Author: jwwalker Date: 2014-03-18 22:56:50 +0000 (Tue, 18 Mar 2014) Log Message: ----------- Several minor optimizations. Modified Paths: -------------- trunk/quesa/Development/Source/Renderers/Common/GLTextureManager.c trunk/quesa/Development/Source/Renderers/OpenGL/QOGLShadingLanguage.cpp trunk/quesa/Development/Source/Renderers/OpenGL/QOGLShadingLanguage.h Modified: trunk/quesa/Development/Source/Renderers/Common/GLTextureManager.c =================================================================== --- trunk/quesa/Development/Source/Renderers/Common/GLTextureManager.c 2014-03-18 22:49:23 UTC (rev 3314) +++ trunk/quesa/Development/Source/Renderers/Common/GLTextureManager.c 2014-03-18 22:56:50 UTC (rev 3315) @@ -13,7 +13,7 @@ performance optimization. COPYRIGHT: - Copyright (c) 1999-2012, Quesa Developers. All rights reserved. + Copyright (c) 1999-2014, Quesa Developers. All rights reserved. For the current release of Quesa, please see: @@ -54,6 +54,7 @@ //----------------------------------------------------------------------------- #include "GLTextureManager.h" #include "GLGPUSharing.h" +#include "E3Texture.h" #ifndef __cplusplus #error This file must be compiled as C++. @@ -143,7 +144,7 @@ { TQ3Object imageStorage = NULL; TQ3StoragePixmap dataRec; - if (kQ3Success == Q3PixmapTexture_GetPixmap( inTexture, &dataRec )) + if (kQ3Success == E3PixmapTexture_GetPixmap( inTexture, &dataRec )) { imageStorage = dataRec.image; } @@ -161,7 +162,7 @@ TQ3Object imageStorage = NULL; TQ3Mipmap dataRec; - if (kQ3Success == Q3MipmapTexture_GetMipmap( inTexture, &dataRec )) + if (kQ3Success == E3MipmapTexture_GetMipmap( inTexture, &dataRec )) { imageStorage = dataRec.image; } Modified: trunk/quesa/Development/Source/Renderers/OpenGL/QOGLShadingLanguage.cpp =================================================================== --- trunk/quesa/Development/Source/Renderers/OpenGL/QOGLShadingLanguage.cpp 2014-03-18 22:49:23 UTC (rev 3314) +++ trunk/quesa/Development/Source/Renderers/OpenGL/QOGLShadingLanguage.cpp 2014-03-18 22:56:50 UTC (rev 3315) @@ -1113,8 +1113,8 @@ // Retrieve hot angles, cutoff angles for any spot lights. const int kNumLights = static_cast<int>(mLights.size()); - std::vector<GLfloat> hotAngles( kNumLights ); - std::vector<GLfloat> cutoffAngles( kNumLights ); + mHotAngles.resize( kNumLights ); + mCutoffAngles.resize( kNumLights ); for (int i = 0; i < kNumLights; ++i) { float theHotAngle = 0.0f; @@ -1124,17 +1124,17 @@ Q3SpotLight_GetHotAngle( mLights[i].get(), &theHotAngle ); Q3SpotLight_GetOuterAngle( mLights[i].get(), &theCutoffAngle ); } - hotAngles[ i ] = theHotAngle; - cutoffAngles[ i ] = theCutoffAngle; + mHotAngles[ i ] = theHotAngle; + mCutoffAngles[ i ] = theCutoffAngle; } // Set hot angle, cutoff angle uniform arrays. if (kNumLights > 0) { mFuncs.glUniform1fv( ioProgram.mSpotHotAngleUniformLoc, kNumLights, - &hotAngles[0] ); + &mHotAngles[0] ); mFuncs.glUniform1fv( ioProgram.mSpotCutoffAngleUniformLoc, kNumLights, - &cutoffAngles[0] ); + &mCutoffAngles[0] ); } } Modified: trunk/quesa/Development/Source/Renderers/OpenGL/QOGLShadingLanguage.h =================================================================== --- trunk/quesa/Development/Source/Renderers/OpenGL/QOGLShadingLanguage.h 2014-03-18 22:49:23 UTC (rev 3314) +++ trunk/quesa/Development/Source/Renderers/OpenGL/QOGLShadingLanguage.h 2014-03-18 22:56:50 UTC (rev 3315) @@ -11,7 +11,7 @@ Header for Quesa OpenGL renderer class. COPYRIGHT: - Copyright (c) 2007-2013, Quesa Developers. All rights reserved. + Copyright (c) 2007-2014, Quesa Developers. All rights reserved. For the current release of Quesa, please see: @@ -301,6 +301,8 @@ bool mIsSpecularMapped; TQ3Float32 mQuantization; TQ3Float32 mLightNearEdge; + std::vector<GLfloat> mHotAngles; + std::vector<GLfloat> mCutoffAngles; ProgramCharacteristic mProgramCharacteristic; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |