From 8a4f16739ae44c96568a0efae9f668c46bcf8035 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Fri, 8 Jun 2012 19:57:28 +0000 Subject: Fixing a BGE bug where textures could get loaded into VRAM twice. --- source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/gameengine/Ketsji/KX_BlenderMaterial.cpp') diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 018a8d44cc1..939f0693161 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -175,8 +175,8 @@ void KX_BlenderMaterial::OnConstruction(int layer) spit("unable to initialize image("<matname<< ", image will not be available"); } - - else { + // If we're using glsl materials, the textures are handled by bf_gpu, so don't load them twice! + else if (!mMaterial->glslmat) { if ( mMaterial->img[i] ) { if ( ! mTextures[i].InitFromImage(i, mMaterial->img[i], (mMaterial->flag[i] &MIPMAP)!=0 )) spit("unable to initialize image("<