summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorkrzys-h <krzys_h@interia.pl>2013-12-31 12:58:45 +0100
committerkrzys-h <krzys_h@interia.pl>2013-12-31 13:24:09 +0100
commit4a237f5925eb0d371e097416b17dd5e919cd2258 (patch)
tree9ce5e9347d0e0a655b247c530c8264581f19036a /src/script
parent3536f1c7cc52792a7d833b4f823aa515dc00d933 (diff)
downloadcolobot-4a237f5925eb0d371e097416b17dd5e919cd2258.tar.gz
colobot-4a237f5925eb0d371e097416b17dd5e919cd2258.tar.bz2
colobot-4a237f5925eb0d371e097416b17dd5e919cd2258.zip
CPauseManager
Diffstat (limited to 'src/script')
-rw-r--r--src/script/script.cpp11
-rw-r--r--src/script/script.h3
2 files changed, 9 insertions, 5 deletions
diff --git a/src/script/script.cpp b/src/script/script.cpp
index 0518479..0b3eec4 100644
--- a/src/script/script.cpp
+++ b/src/script/script.cpp
@@ -3423,6 +3423,7 @@ CScript::CScript(CObject* object, CTaskManager** secondaryTask)
m_secondaryTask = secondaryTask;
m_interface = m_main->GetInterface();
+ m_pause = CPauseManager::GetInstancePointer();
m_ipf = CBOT_IPF;
m_errMode = ERM_STOP;
@@ -3821,12 +3822,12 @@ bool CScript::Continue(const Event &event)
GetError(s);
m_main->GetDisplayText()->DisplayText(s.c_str(), m_object, 10.0f, Ui::TT_ERROR);
}
- m_engine->SetPause(true); // gives pause
+ m_pause->SetPause(PAUSE_EDITOR); // gives pause
return true;
}
if ( !m_bContinue )
{
- m_engine->SetPause(true); // gives pause
+ m_pause->SetPause(PAUSE_EDITOR); // gives pause
}
}
@@ -3869,9 +3870,9 @@ bool CScript::Step(const Event &event)
if ( !m_bRun ) return true;
if ( !m_bStepMode ) return false;
- m_engine->SetPause(false);
+ // ??? m_engine->SetPause(false);
// TODO: m_app StepSimulation??? m_engine->StepSimulation(0.01f); // advance of 10ms
- m_engine->SetPause(true);
+ // ??? m_engine->SetPause(true);
m_event = event;
@@ -3901,7 +3902,7 @@ bool CScript::Step(const Event &event)
if ( m_bContinue ) // instuction "move", "goto", etc. ?
{
- m_engine->SetPause(false); // removes the pause
+ m_pause->ClearPause(); // removes the pause
}
return false;
}
diff --git a/src/script/script.h b/src/script/script.h
index 9d8d372..177d40a 100644
--- a/src/script/script.h
+++ b/src/script/script.h
@@ -24,6 +24,8 @@
#include "common/event.h"
+#include "app/pausemanager.h"
+
#include "CBot/CBotDll.h"
#include <stdio.h>
@@ -217,6 +219,7 @@ protected:
CTaskManager* m_primaryTask;
CTaskManager** m_secondaryTask;
CObject* m_object;
+ CPauseManager* m_pause;
int m_ipf; // number of instructions/second
int m_errMode; // what to do in case of error