summaryrefslogtreecommitdiffstats
path: root/src/object/robotmain.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2013-03-31 13:06:38 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2013-03-31 13:06:38 +0200
commitff97de547799a60a2121008e9da5793d2ab1581f (patch)
treea4b2bd37da23c01d0b9c54c976e0c4079257951f /src/object/robotmain.cpp
parent0d70b6e2f874d9adeb6528df355d3271c3943845 (diff)
downloadcolobot-ff97de547799a60a2121008e9da5793d2ab1581f.tar.gz
colobot-ff97de547799a60a2121008e9da5793d2ab1581f.tar.bz2
colobot-ff97de547799a60a2121008e9da5793d2ab1581f.zip
Fixed graphics objects after reset
Should fix #120 and perhaps some other bugs as well
Diffstat (limited to 'src/object/robotmain.cpp')
-rw-r--r--src/object/robotmain.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index e14af78..733bf6b 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -34,7 +34,7 @@
#include "graphics/engine/engine.h"
#include "graphics/engine/lightman.h"
#include "graphics/engine/lightning.h"
-#include "graphics/engine/modelfile.h"
+#include "graphics/engine/modelmanager.h"
#include "graphics/engine/particle.h"
#include "graphics/engine/planet.h"
#include "graphics/engine/pyro.h"
@@ -1047,6 +1047,7 @@ void CRobotMain::ChangePhase(Phase phase)
FlushDisplayInfo();
m_engine->SetRankView(0);
m_engine->DeleteAllObjects();
+ Gfx::CModelManager::GetInstancePointer()->DeleteAllModelCopies();
m_engine->SetWaterAddColor(Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f));
m_engine->SetBackground("");
m_engine->SetBackForce(false);
@@ -3736,6 +3737,7 @@ void CRobotMain::ScenePerso()
{
DeleteAllObjects(); // removes all the current 3D Scene
m_engine->DeleteAllObjects();
+ Gfx::CModelManager::GetInstancePointer()->DeleteAllModelCopies();
m_terrain->FlushRelief(); // all flat
m_terrain->FlushBuildingLevel();
m_terrain->FlushFlyingLimit();