From 45b86e8ccb2035235f79888a209899267cbcf76f Mon Sep 17 00:00:00 2001 From: Peter Courtemanche Date: Mon, 13 Jan 2014 15:16:30 -0800 Subject: [PATCH] Temporary fix to stop the app from crashing when it runs the texture resize routine with a size of 1024 for 2 minutes. Take a look at the FINDME comment. --HG-- branch : nfb --- KREngine/kraken/KRTextureManager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/KREngine/kraken/KRTextureManager.cpp b/KREngine/kraken/KRTextureManager.cpp index 2f554c8..0e02202 100644 --- a/KREngine/kraken/KRTextureManager.cpp +++ b/KREngine/kraken/KRTextureManager.cpp @@ -329,6 +329,10 @@ void KRTextureManager::balanceTextureMemory() } } + if (maxDimActive > 512) maxDimActive = 512; // FINDME - hack to stop the texture resizer from blowing out its brains .. + // when the texture quality goes up to 1024, the app runs for about 2 mins and then + // runs out of memory. + // Resize active textures to balance the memory usage and mipmap levels for(std::set::iterator itr=m_activeTextures_streamer.begin(); itr != m_activeTextures_streamer.end() && memory_available > 0; itr++) { KRTexture *activeTexture = *itr;