aboutsummaryrefslogtreecommitdiff
path: root/sword1/sword1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sword1/sword1.cpp')
-rw-r--r--sword1/sword1.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/sword1/sword1.cpp b/sword1/sword1.cpp
index ae33153869..025ff7aeb0 100644
--- a/sword1/sword1.cpp
+++ b/sword1/sword1.cpp
@@ -1065,16 +1065,27 @@ void SwordEngine::go(void) {
} while (true);
}
+void SwordEngine::checkCd(void) {
+ uint8 needCd = _cdList[SwordLogic::_scriptVars[NEW_SCREEN]];
+ if (needCd == 0) {
+ if (_systemVars.currentCD == 0)
+ _systemVars.currentCD = 1;
+ } else
+ _systemVars.currentCD = needCd;
+}
+
void SwordEngine::mainLoop(void) {
uint32 newTime, frameTime;
bool wantControlPanel = false;
do {
// do we need the section45-hack from sword.c here?
- // todo: ensure right cd is inserted
+ checkCd();
+
_screen->newScreen(SwordLogic::_scriptVars[NEW_SCREEN]);
_logic->newScreen(SwordLogic::_scriptVars[NEW_SCREEN]);
+ _sound->newScreen(SwordLogic::_scriptVars[NEW_SCREEN]);
SwordLogic::_scriptVars[SCREEN] = SwordLogic::_scriptVars[NEW_SCREEN];
- // let swordSound start room sfx
+
do {
_music->stream();
frameTime = _system->get_msecs();