From 41fa8458c2e28f05a610bfc3119f86b8dc85542a Mon Sep 17 00:00:00 2001 From: erihel Date: Mon, 24 Jun 2013 22:09:39 +0200 Subject: Some Ui refactoring --- src/object/robotmain.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/object/robotmain.cpp') diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index b58e5f8..ddee0ff 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -7520,3 +7520,12 @@ void CRobotMain::RestoreNumericLocale() setlocale(LC_NUMERIC, m_oldLocale.c_str()); } +void CRobotMain::DisplayError(Error err, CObject* pObj, float time) +{ + m_displayText->DisplayError(err, pObj, time); +} + +void CRobotMain::DisplayError(Error err, Math::Vector goal, float height, float dist, float time) +{ + m_displayText->DisplayError(err, goal, height, dist, time); +} -- cgit v1.2.3-1-g7c22 From 5d0d9b5aa5cf19aff9edb42701d38b5096fce3aa Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sat, 12 Oct 2013 18:48:28 +0200 Subject: Fixed some CBot-related memory leaks * fixed leaks in CScript::CheckToken() * fixed leaks in CInterface * commented out unused function in robotmain.cpp --- src/object/robotmain.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/object/robotmain.cpp') diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index ddee0ff..1748c57 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -107,7 +107,7 @@ float g_unit; // conversion factor // Static variables static CBotClass* m_pClassFILE; -static CBotProgram* m_pFuncFile; +//static CBotProgram* m_pFuncFile; static int m_CompteurFileOpen = 0; static std::string m_filesDir; @@ -503,10 +503,10 @@ void InitClassFILE() m_pClassFILE->AddFunction("readln", rfread, cfread ); m_pClassFILE->AddFunction("eof", rfeof, cfeof ); - m_pFuncFile = new CBotProgram( ); - CBotStringArray ListFonctions; - m_pFuncFile->Compile( "public file openfile(string name, string mode) {return new file(name, mode);}", ListFonctions); - m_pFuncFile->SetIdent(-2); // restoreState in special identifier for this function + //m_pFuncFile = new CBotProgram( ); + //CBotStringArray ListFonctions; + //m_pFuncFile->Compile( "public file openfile(string name, string mode) {return new file(name, mode);}", ListFonctions); + //m_pFuncFile->SetIdent(-2); // restoreState in special identifier for this function } -- cgit v1.2.3-1-g7c22 From 9017dbbbdb1f59971b17976d7cf95fe39469d82a Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sun, 13 Oct 2013 14:44:12 +0200 Subject: Fixed CTerrain-related memory leaks --- src/object/robotmain.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/object/robotmain.cpp') diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index 1748c57..6fe85d3 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -1104,6 +1104,7 @@ void CRobotMain::ChangePhase(Phase phase) ChangePause(false); FlushDisplayInfo(); m_engine->SetRankView(0); + m_terrain->FlushRelief(); m_engine->DeleteAllObjects(); Gfx::CModelManager::GetInstancePointer()->DeleteAllModelCopies(); m_engine->SetWaterAddColor(Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f)); @@ -3842,9 +3843,9 @@ void CRobotMain::Convert() void CRobotMain::ScenePerso() { DeleteAllObjects(); // removes all the current 3D Scene + m_terrain->FlushRelief(); m_engine->DeleteAllObjects(); Gfx::CModelManager::GetInstancePointer()->DeleteAllModelCopies(); - m_terrain->FlushRelief(); // all flat m_terrain->FlushBuildingLevel(); m_terrain->FlushFlyingLimit(); m_lightMan->FlushLights(); -- cgit v1.2.3-1-g7c22