diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index 70a1a688..05b95156 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -1683,6 +1683,7 @@ void Game::render2d(){ str+= "Render FPS: " + intToStr(lastRenderFps) + "[" + intToStr(avgRenderFps) + "]\n"; str+= "Update FPS: " + intToStr(lastUpdateFps) + "[" + intToStr(avgUpdateFps) + "]\n"; str+= "GameCamera pos: " + floatToStr(gameCamera.getPos().x)+","+floatToStr(gameCamera.getPos().y)+","+floatToStr(gameCamera.getPos().z)+"\n"; + str+= "Cached surfacedata: " + intToStr(renderer.getCachedSurfaceDataSize()); str+= "Time: " + floatToStr(world.getTimeFlow()->getTime(),2)+"\n"; if(SystemFlags::getThreadedLoggerRunning() == true) { str+= "Log buffer count: " + intToStr(SystemFlags::getLogEntryBufferCount())+"\n"; diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index fef4eff5..b86ba246 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -154,6 +154,7 @@ Renderer::Renderer() { textRenderer = NULL; particleRenderer = NULL; saveScreenShotThread = NULL; + mapSurfaceData.clear(); lastRenderFps=MIN_FPS_NORMAL_RENDERING; shadowsOffDueToMinRender=false; @@ -231,6 +232,7 @@ Renderer::~Renderer() { } } + mapSurfaceData.clear(); this->menu = NULL; this->game = NULL; } @@ -310,6 +312,7 @@ void Renderer::initGame(const Game *game){ SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); SurfaceData::nextUniqueId = 1; + mapSurfaceData.clear(); this->game= game; worldToScreenPosCache.clear(); @@ -430,6 +433,8 @@ void Renderer::end() { //delete 2d list glDeleteLists(list2d, 1); + + mapSurfaceData.clear(); } void Renderer::endGame() { @@ -449,6 +454,7 @@ void Renderer::endGame() { worldToScreenPosCache.clear(); ReleaseSurfaceVBOs(); + mapSurfaceData.clear(); } void Renderer::endMenu() { diff --git a/source/glest_game/graphics/renderer.h b/source/glest_game/graphics/renderer.h index f212a18c..1bf7d2af 100644 --- a/source/glest_game/graphics/renderer.h +++ b/source/glest_game/graphics/renderer.h @@ -428,6 +428,7 @@ public: void renderProgressBar(int size, int x, int y, Font2D *font,int customWidth=-1, string prefixLabel=""); static Texture2D * findFactionLogoTexture(string logoFilename); + int getCachedSurfaceDataSize() const { return mapSurfaceData.size(); } private: //private misc