diff options
Diffstat (limited to 'src/object')
-rw-r--r-- | src/object/robotmain.cpp | 46 | ||||
-rw-r--r-- | src/object/robotmain.h | 9 |
2 files changed, 50 insertions, 5 deletions
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index b1cbe52..e66e2c6 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -647,6 +647,10 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile) m_visitArrow = 0; m_audioTrack = ""; m_audioRepeat = true; + m_satcomTrack = ""; + m_satcomRepeat = true; + m_editorTrack = ""; + m_editorRepeat = true; m_delayWriteMessage = 0; m_selectObject = 0; m_infoUsed = 0; @@ -3923,6 +3927,10 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) m_terrain->FlushMaterials(); m_audioTrack = ""; m_audioRepeat = true; + m_satcomTrack = ""; + m_satcomRepeat = true; + m_editorTrack = ""; + m_editorRepeat = true; m_displayText->SetDelay(1.0f); m_displayText->SetEnable(true); m_immediatSatCom = false; @@ -4028,8 +4036,10 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) } } - if (Cmd(line, "MissionFile") && !resetObject) + if (Cmd(line, "MissionFile") && !resetObject) { m_version = OpInt(line, "version", 1); + continue; + } // TODO: Fallback to an non-localized entry sprintf(op, "Title.%c", m_app->GetLanguageChar()); @@ -4165,15 +4175,27 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) filenameStr << "music" << std::setfill('0') << std::setw(3) << trackid << ".ogg"; m_audioTrack = filenameStr.str(); } + m_audioRepeat = OpInt(line, "repeat", 1); } else { char trackname[100]; - OpString(line, "filename", trackname); + + OpString(line, "main", trackname); m_audioTrack = trackname; + m_audioRepeat = OpInt(line, "mainRepeat", 1); + + OpString(line, "satcom", trackname); + m_satcomTrack = trackname; + m_satcomRepeat = OpInt(line, "satcomRepeat", 1); + + OpString(line, "editor", trackname); + m_editorTrack = trackname; + m_editorRepeat = OpInt(line, "editorRepeat", 1); } - m_audioRepeat = OpInt(line, "repeat", 1); if (m_audioTrack != "") m_sound->CacheMusic(m_audioTrack); + if (m_satcomTrack != "") m_sound->CacheMusic(m_satcomTrack); + if (m_editorTrack != "") m_sound->CacheMusic(m_editorTrack); continue; } @@ -7220,6 +7242,24 @@ void CRobotMain::StartMusic() } } +//! Starts pause music +void CRobotMain::StartPauseMusic(PauseType pause) +{ + switch(pause) { + case PAUSE_EDITOR: + m_sound->PlayPauseMusic(m_editorTrack, m_editorRepeat); + break; + + case PAUSE_SATCOM: + m_sound->PlayPauseMusic(m_satcomTrack, m_satcomRepeat); + break; + + default: + // Don't change music + break; + } +} + //! Removes hilite and tooltip void CRobotMain::ClearInterface() { diff --git a/src/object/robotmain.h b/src/object/robotmain.h index 4fa842a..71ad455 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -340,6 +340,7 @@ public: float GetPersoAngle(); void StartMusic(); + void StartPauseMusic(PauseType pause); void ClearInterface(); void ChangeColor(); @@ -474,15 +475,19 @@ protected: bool m_showSoluce; bool m_showAll; bool m_cheatRadar; - bool m_audioRepeat; bool m_shortCut; std::string m_audioTrack; + bool m_audioRepeat; + std::string m_satcomTrack; + bool m_satcomRepeat; + std::string m_editorTrack; + bool m_editorRepeat; int m_delayWriteMessage; int m_movieInfoIndex; CObject* m_controller; - //Level Checker flags + // Level Checker flags bool m_beginObject; bool m_terrainGenerate; bool m_terrainInitTextures; |