diff options
author | Paul Gilbert | 2014-03-11 23:42:20 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-03-11 23:42:20 -0400 |
commit | 709fcc6fac4e1449064c4ddd5de3c443d0290c93 (patch) | |
tree | e2ef6eabfb8bc82faffa847f26953524bf2c8fb7 /engines/mads | |
parent | 2d99f761f0bb0a8db4468846f0643fbdc4da450a (diff) | |
download | scummvm-rg350-709fcc6fac4e1449064c4ddd5de3c443d0290c93.tar.gz scummvm-rg350-709fcc6fac4e1449064c4ddd5de3c443d0290c93.tar.bz2 scummvm-rg350-709fcc6fac4e1449064c4ddd5de3c443d0290c93.zip |
MADS: Fix inter-frame wait loop
Diffstat (limited to 'engines/mads')
-rw-r--r-- | engines/mads/events.cpp | 5 | ||||
-rw-r--r-- | engines/mads/events.h | 1 | ||||
-rw-r--r-- | engines/mads/nebular/game_nebular.cpp | 22 | ||||
-rw-r--r-- | engines/mads/nebular/globals_nebular.h | 4 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes8.cpp | 2 |
5 files changed, 16 insertions, 18 deletions
diff --git a/engines/mads/events.cpp b/engines/mads/events.cpp index 59cdfbfffb..182d6cbea7 100644 --- a/engines/mads/events.cpp +++ b/engines/mads/events.cpp @@ -36,7 +36,6 @@ EventsManager::EventsManager(MADSEngine *vm) { _vm = vm; _cursorSprites = nullptr; _frameCounter = 0; - _frameNumber = 0; _priorFrameTime = 0; _keyPressed = false; _mouseClicked = false; @@ -166,8 +165,8 @@ void EventsManager::delay(int cycles) { } void EventsManager::waitForNextFrame() { - uint32 frameNum = getFrameCounter(); - while (!_vm->shouldQuit() && !_vm->_game->_abortTimers && frameNum == _frameNumber) + uint32 frameCtr = getFrameCounter(); + while (!_vm->shouldQuit() && frameCtr == _frameCounter) delay(1); } diff --git a/engines/mads/events.h b/engines/mads/events.h index 6f716d8083..17224227c6 100644 --- a/engines/mads/events.h +++ b/engines/mads/events.h @@ -38,7 +38,6 @@ class EventsManager { private: MADSEngine *_vm; uint32 _frameCounter; - uint32 _frameNumber; uint32 _priorFrameTime; Common::Point _mousePos; Common::Point _currentPos; diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index c2a23b607b..65abb40f1e 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -41,7 +41,7 @@ GameNebular::GameNebular(MADSEngine *vm): Game(vm) { int GameNebular::checkCopyProtection() { // DEBUG: Flag copy protection failure - _globals[5] = 0xFFFF; + _globals[5] = -1; if (!ConfMan.getBool("copy_protection")) return true; @@ -60,13 +60,13 @@ void GameNebular::initialiseGlobals() { // Set specific values needed by the game _globals[4] = 8; _globals[33] = 1; - _globals[10] = 0xFFFF; - _globals[13] = 0xFFFF; - _globals[15] = 0xFFFF; - _globals[19] = 0xFFFF; - _globals[20] = 0xFFFF; - _globals[21] = 0xFFFF; - _globals[95] = 0xFFFF; + _globals[10] = -1; + _globals[13] = -1; + _globals[15] = -1; + _globals[19] = -1; + _globals[20] = -1; + _globals[21] = -1; + _globals[95] = -1; _objects.setData(3, 17, nullptr); @@ -101,8 +101,8 @@ void GameNebular::initialiseGlobals() { } _globals[120] = 501; - _globals[121] = 0xFFFF; - _globals[55] = 0xFFFF; + _globals[121] = -1; + _globals[55] = -1; _globals[119] = 1; _globals[134] = 4; @@ -133,7 +133,7 @@ void GameNebular::initialiseGlobals() { case DIFFICULTY_MEDIUM: _globals[35] = 0; _objects.setRoom(8, 1); - _globals[137] = 0xFFFF; + _globals[137] = -1; _globals[136] = 6; break; case DIFFICULTY_EASY: diff --git a/engines/mads/nebular/globals_nebular.h b/engines/mads/nebular/globals_nebular.h index daa384f88f..31340446d2 100644 --- a/engines/mads/nebular/globals_nebular.h +++ b/engines/mads/nebular/globals_nebular.h @@ -33,7 +33,7 @@ namespace Nebular { class Globals { private: - Common::Array<uint16> _flags; + Common::Array<int16> _flags; public: Common::Array<int> _spriteIndexes; @@ -55,7 +55,7 @@ public: /** * Square brackets operator for accessing flags */ - uint16 &operator[](int idx) { return _flags[idx]; } + int16 &operator[](int idx) { return _flags[idx]; } }; } // End of namespace Nebular diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index c912d32eed..ac3f029cc9 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -88,7 +88,7 @@ void Scene804::enter() { _globals._v8 = 0; if (_globals[5]) { // Copy protection failed - _globals[165] = 0xFFFF; + _globals[165] = -1; _globals[164] = 0; } |