summaryrefslogtreecommitdiffstats
path: root/src/object
diff options
context:
space:
mode:
Diffstat (limited to 'src/object')
-rw-r--r--src/object/robotmain.cpp23
-rw-r--r--src/object/robotmain.h5
2 files changed, 21 insertions, 7 deletions
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index 9b37a84..23f5a28 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -940,6 +940,14 @@ Ui::CDisplayText* CRobotMain::GetDisplayText()
return m_displayText;
}
+void CRobotMain::LoadSceneOnStart(const std::string& name, int rank)
+{
+ // TODO: fix this ugly dependency :(
+ m_dialog->SetSceneName(name.c_str());
+ m_dialog->SetSceneRank(rank);
+ ChangePhase(PHASE_LOADING);
+}
+
//! Creates the file colobot.ini at the first time
void CRobotMain::CreateIni()
@@ -1010,28 +1018,24 @@ void CRobotMain::SetDefaultInputBindings()
void CRobotMain::SetInputBinding(InputSlot slot, InputBinding binding)
{
unsigned int index = static_cast<unsigned int>(slot);
- assert(index >= 0 && index < INPUT_SLOT_MAX);
m_inputBindings[index] = binding;
}
const InputBinding& CRobotMain::GetInputBinding(InputSlot slot)
{
unsigned int index = static_cast<unsigned int>(slot);
- assert(index >= 0 && index < INPUT_SLOT_MAX);
return m_inputBindings[index];
}
void CRobotMain::SetJoyAxisBinding(JoyAxisSlot slot, JoyAxisBinding binding)
{
unsigned int index = static_cast<unsigned int>(slot);
- assert(index >= 0 && index < JOY_AXIS_SLOT_MAX);
m_joyAxisBindings[index] = binding;
}
const JoyAxisBinding& CRobotMain::GetJoyAxisBinding(JoyAxisSlot slot)
{
unsigned int index = static_cast<unsigned int>(slot);
- assert(index >= 0 && index < JOY_AXIS_SLOT_MAX);
return m_joyAxisBindings[index];
}
@@ -1300,7 +1304,7 @@ void CRobotMain::ChangePhase(Phase phase)
}
//! Processes an event
-bool CRobotMain::EventProcess(Event &event)
+bool CRobotMain::ProcessEvent(Event &event)
{
/* Motion vector management */
@@ -1997,7 +2001,14 @@ void CRobotMain::ExecuteCmd(char *cmd)
if (strcmp(cmd, "debugmode") == 0)
{
- m_app->SetDebugMode(!m_app->GetDebugMode());
+ if (m_app->IsDebugModeActive(DEBUG_ALL))
+ {
+ m_app->SetDebugModeActive(DEBUG_ALL, false);
+ }
+ else
+ {
+ m_app->SetDebugModeActive(DEBUG_ALL, true);
+ }
return;
}
diff --git a/src/object/robotmain.h b/src/object/robotmain.h
index a75509d..04efea7 100644
--- a/src/object/robotmain.h
+++ b/src/object/robotmain.h
@@ -199,6 +199,9 @@ public:
Ui::CInterface* GetInterface();
Ui::CDisplayText* GetDisplayText();
+ //! Caused the given mission to be loaded immediately after start
+ void LoadSceneOnStart(const std::string& name, int rank);
+
void CreateIni();
//! Sets the default input bindings (key and axes)
@@ -226,7 +229,7 @@ public:
void ResetKeyStates();
void ChangePhase(Phase phase);
- bool EventProcess(Event &event);
+ bool ProcessEvent(Event &event);
bool CreateShortcuts();
void ScenePerso();