aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Bouclet2018-06-11 20:01:12 +0200
committerBastien Bouclet2018-06-13 08:00:29 +0200
commit2de359f23de43db2ab3e46f55c0bb5a880ea8441 (patch)
tree077da0f05a50cab73ff65607f6f8d94e81237328
parent47ddd9c2144c236e2b3bc0dd0f8349ae8657efb7 (diff)
downloadscummvm-rg350-2de359f23de43db2ab3e46f55c0bb5a880ea8441.tar.gz
scummvm-rg350-2de359f23de43db2ab3e46f55c0bb5a880ea8441.tar.bz2
scummvm-rg350-2de359f23de43db2ab3e46f55c0bb5a880ea8441.zip
MOHAWK: MYST: Make the scripts time accounting pause safe
-rw-r--r--engines/mohawk/myst_stacks/credits.cpp6
-rw-r--r--engines/mohawk/myst_stacks/demo.cpp4
-rw-r--r--engines/mohawk/myst_stacks/dni.cpp4
-rw-r--r--engines/mohawk/myst_stacks/mechanical.cpp10
-rw-r--r--engines/mohawk/myst_stacks/myst.cpp80
-rw-r--r--engines/mohawk/myst_stacks/preview.cpp2
-rw-r--r--engines/mohawk/myst_stacks/selenitic.cpp4
-rw-r--r--engines/mohawk/myst_stacks/slides.cpp4
-rw-r--r--engines/mohawk/myst_stacks/stoneship.cpp22
9 files changed, 68 insertions, 68 deletions
diff --git a/engines/mohawk/myst_stacks/credits.cpp b/engines/mohawk/myst_stacks/credits.cpp
index 423dc9c216..2b8cbd0db4 100644
--- a/engines/mohawk/myst_stacks/credits.cpp
+++ b/engines/mohawk/myst_stacks/credits.cpp
@@ -62,7 +62,7 @@ void Credits::runPersistentScripts() {
if (!_creditsRunning)
return;
- if (_vm->_system->getMillis() - _startTime >= 7 * 1000) {
+ if (_vm->getTotalPlayTime() - _startTime >= 7 * 1000) {
_curImage++;
// After the 6th image has shown, it's time to quit
@@ -75,7 +75,7 @@ void Credits::runPersistentScripts() {
_vm->getCard()->drawBackground();
_vm->_gfx->copyBackBufferToScreen(Common::Rect(544, 333));
- _startTime = _vm->_system->getMillis();
+ _startTime = _vm->getTotalPlayTime();
}
}
@@ -98,7 +98,7 @@ void Credits::o_runCredits(uint16 var, const ArgumentsArray &args) {
// Activate the credits
_creditsRunning = true;
_curImage = 0;
- _startTime = _vm->_system->getMillis();
+ _startTime = _vm->getTotalPlayTime();
}
} // End of namespace MystStacks
diff --git a/engines/mohawk/myst_stacks/demo.cpp b/engines/mohawk/myst_stacks/demo.cpp
index b98a16d73e..400ab13595 100644
--- a/engines/mohawk/myst_stacks/demo.cpp
+++ b/engines/mohawk/myst_stacks/demo.cpp
@@ -81,7 +81,7 @@ void Demo::o_fadeToBlack(uint16 var, const ArgumentsArray &args) {
}
void Demo::returnToMenu_run() {
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time < _returnToMenuNextTime)
return;
@@ -109,7 +109,7 @@ void Demo::returnToMenu_run() {
void Demo::o_returnToMenu_init(uint16 var, const ArgumentsArray &args) {
// Used on Card 2001, 2002 and 2003
- _returnToMenuNextTime = _vm->_system->getMillis() + 5000;
+ _returnToMenuNextTime = _vm->getTotalPlayTime() + 5000;
_returnToMenuRunning = true;
}
diff --git a/engines/mohawk/myst_stacks/dni.cpp b/engines/mohawk/myst_stacks/dni.cpp
index bb1adf2353..0678f20e3a 100644
--- a/engines/mohawk/myst_stacks/dni.cpp
+++ b/engines/mohawk/myst_stacks/dni.cpp
@@ -115,12 +115,12 @@ void Dni::o_handPage(uint16 var, const ArgumentsArray &args) {
_atrusLeft = true;
_waitForLoop = false;
- _atrusLeftTime = _vm->_system->getMillis();
+ _atrusLeftTime = _vm->getTotalPlayTime();
}
}
void Dni::atrusLeft_run() {
- if (_vm->_system->getMillis() > _atrusLeftTime + 63333) {
+ if (_vm->getTotalPlayTime() > _atrusLeftTime + 63333) {
_video = "atrus2";
_videoPos = Common::Point(215, 77);
VideoEntryPtr atrus = _vm->playMovie(_video, kDniStack);
diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp
index 5c0e273913..2481ca66e7 100644
--- a/engines/mohawk/myst_stacks/mechanical.cpp
+++ b/engines/mohawk/myst_stacks/mechanical.cpp
@@ -309,7 +309,7 @@ void Mechanical::o_birdCrankStart(uint16 var, const ArgumentsArray &args) {
_vm->_sound->playEffect(crankSoundId, true);
_birdSingEndTime = 0;
- _birdCrankStartTime = _vm->_system->getMillis();
+ _birdCrankStartTime = _vm->getTotalPlayTime();
MystAreaVideo *crankMovie = static_cast<MystAreaVideo *>(crank->getSubResource(0));
crankMovie->playMovie();
@@ -324,7 +324,7 @@ void Mechanical::o_birdCrankStop(uint16 var, const ArgumentsArray &args) {
uint16 crankSoundId = crank->getList2(1);
_vm->_sound->playEffect(crankSoundId);
- _birdSingEndTime = 2 * _vm->_system->getMillis() - _birdCrankStartTime;
+ _birdSingEndTime = 2 * _vm->getTotalPlayTime() - _birdCrankStartTime;
_birdSinging = true;
_bird->playMovie();
@@ -572,11 +572,11 @@ void Mechanical::o_elevatorGoMiddle(uint16 var, const ArgumentsArray &args) {
_elevatorTopCounter = 5;
_elevatorGoingMiddle = true;
_elevatorInCabin = true;
- _elevatorNextTime = _vm->_system->getMillis() + 1000;
+ _elevatorNextTime = _vm->getTotalPlayTime() + 1000;
}
void Mechanical::elevatorGoMiddle_run() {
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (_elevatorNextTime < time) {
_elevatorNextTime = time + 1000;
_elevatorTopCounter--;
@@ -706,7 +706,7 @@ void Mechanical::o_fortressStaircase_init(uint16 var, const ArgumentsArray &args
void Mechanical::birdSing_run() {
// Used for Card 6220 (Sirrus' Mechanical Bird)
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (_birdSingEndTime < time) {
_bird->pauseMovie(true);
_vm->_sound->stopEffect();
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index 03f4a3faf7..5a64b8fb60 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -108,7 +108,7 @@ Myst::Myst(MohawkEngine_Myst *vm, MystStack stackId) :
}
_butterfliesMoviePlayed = false;
- _state.treeLastMoveTime = _vm->_system->getMillis();
+ _state.treeLastMoveTime = _vm->getTotalPlayTime();
_rocketPianoSound = 0;
_rocketSlider1 = nullptr;
@@ -1342,7 +1342,7 @@ void Myst::o_imagerEraseButton(uint16 var, const ArgumentsArray &args) {
if (_imagerValidationStep == 0) {
// Validation script is not running, run it
- _startTime = _vm->_system->getMillis() + 100;
+ _startTime = _vm->getTotalPlayTime() + 100;
_imagerValidationRunning = true;
return;
} else if (_imagerValidationStep < 7) {
@@ -1380,7 +1380,7 @@ void Myst::o_imagerEraseButton(uint16 var, const ArgumentsArray &args) {
}
void Myst::imagerValidation_run() {
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time > _startTime) {
_imagerRedButton->drawConditionalDataToScreen(1);
@@ -1620,7 +1620,7 @@ void Myst::observatoryMonthChangeStart(bool increase) {
observatoryIncrementMonth(_observatoryIncrement);
// Start persistent script
- _startTime = _vm->_system->getMillis();
+ _startTime = _vm->getTotalPlayTime();
_observatoryMonthChanging = true;
}
@@ -1645,7 +1645,7 @@ void Myst::observatoryIncrementMonth(int16 increment) {
}
void Myst::observatoryMonthChange_run() {
- if (_startTime + 500 < _vm->_system->getMillis())
+ if (_startTime + 500 < _vm->getTotalPlayTime())
observatoryIncrementMonth(_observatoryIncrement);
}
@@ -1686,7 +1686,7 @@ void Myst::observatoryDayChangeStart(bool increase) {
observatoryIncrementDay(_observatoryIncrement);
// Start persistent script
- _startTime = _vm->_system->getMillis();
+ _startTime = _vm->getTotalPlayTime();
_observatoryDayChanging = true;
}
@@ -1712,7 +1712,7 @@ void Myst::observatoryIncrementDay(int16 increment) {
}
void Myst::observatoryDayChange_run() {
- if (_startTime + 500 < _vm->_system->getMillis())
+ if (_startTime + 500 < _vm->getTotalPlayTime())
observatoryIncrementDay(_observatoryIncrement);
}
@@ -1745,7 +1745,7 @@ void Myst::observatoryYearChangeStart(bool increase) {
observatoryIncrementYear(_observatoryIncrement);
// Start persistent script
- _startTime = _vm->_system->getMillis();
+ _startTime = _vm->getTotalPlayTime();
_observatoryYearChanging = true;
}
@@ -1773,7 +1773,7 @@ void Myst::observatoryIncrementYear(int16 increment) {
}
void Myst::observatoryYearChange_run() {
- if (_startTime + 500 < _vm->_system->getMillis())
+ if (_startTime + 500 < _vm->getTotalPlayTime())
observatoryIncrementYear(_observatoryIncrement);
}
@@ -1806,7 +1806,7 @@ void Myst::observatoryTimeChangeStart(bool increase) {
observatoryIncrementTime(_observatoryIncrement);
// Start persistent script
- _startTime = _vm->_system->getMillis();
+ _startTime = _vm->getTotalPlayTime();
_observatoryTimeChanging = true;
}
@@ -1839,7 +1839,7 @@ void Myst::observatoryIncrementTime(int16 increment) {
}
void Myst::observatoryTimeChange_run() {
- if (_startTime + 500 < _vm->_system->getMillis())
+ if (_startTime + 500 < _vm->getTotalPlayTime())
observatoryIncrementTime(_observatoryIncrement);
}
@@ -1853,9 +1853,9 @@ void Myst::o_observatoryGoButton(uint16 var, const ArgumentsArray &args) {
_vm->_sound->playEffect(soundId);
int16 distance = _state.observatoryYearTarget - _state.observatoryYearSetting;
- uint32 end = _vm->_system->getMillis() + 32 * ABS(distance) / 50 + 800;
+ uint32 end = _vm->getTotalPlayTime() + 32 * ABS(distance) / 50 + 800;
- while (end > _vm->_system->getMillis()) {
+ while (end > _vm->getTotalPlayTime()) {
_vm->wait(50);
observatoryUpdateVisualizer(_vm->_rnd->getRandomNumber(409), _vm->_rnd->getRandomNumber(409));
@@ -1970,7 +1970,7 @@ void Myst::o_boilerLightPilot(uint16 var, const ArgumentsArray &args) {
boilerFireUpdate(false);
// Put out match
- _matchGoOutTime = _vm->_system->getMillis();
+ _matchGoOutTime = _vm->getTotalPlayTime();
if (_state.cabinValvePosition > 0)
_vm->_sound->playBackground(8098, 49152);
@@ -1981,7 +1981,7 @@ void Myst::o_boilerLightPilot(uint16 var, const ArgumentsArray &args) {
Common::Rational rate = boilerComputeGaugeRate(_state.cabinValvePosition, delay);
boilerResetGauge(rate);
- _state.treeLastMoveTime = _vm->_system->getMillis();
+ _state.treeLastMoveTime = _vm->getTotalPlayTime();
}
}
}
@@ -2018,7 +2018,7 @@ void Myst::boilerResetGauge(const Common::Rational &rate) {
void Myst::o_boilerIncreasePressureStop(uint16 var, const ArgumentsArray &args) {
_treeStopped = false;
_boilerPressureIncreasing = false;
- _state.treeLastMoveTime = _vm->_system->getMillis();
+ _state.treeLastMoveTime = _vm->getTotalPlayTime();
if (_state.cabinPilotLightLit == 1) {
if (_state.cabinValvePosition > 0)
@@ -2089,7 +2089,7 @@ void Myst::o_boilerDecreasePressureStart(uint16 var, const ArgumentsArray &args)
void Myst::o_boilerDecreasePressureStop(uint16 var, const ArgumentsArray &args) {
_treeStopped = false;
_boilerPressureDecreasing = false;
- _state.treeLastMoveTime = _vm->_system->getMillis();
+ _state.treeLastMoveTime = _vm->getTotalPlayTime();
if (_state.cabinPilotLightLit == 1) {
if (_state.cabinValvePosition > 0)
@@ -2115,7 +2115,7 @@ void Myst::o_basementIncreasePressureStart(uint16 var, const ArgumentsArray &arg
void Myst::o_basementIncreasePressureStop(uint16 var, const ArgumentsArray &args) {
_treeStopped = false;
_basementPressureIncreasing = false;
- _state.treeLastMoveTime = _vm->_system->getMillis();
+ _state.treeLastMoveTime = _vm->getTotalPlayTime();
}
void Myst::basementPressureIncrease_run() {
@@ -2152,7 +2152,7 @@ void Myst::o_basementDecreasePressureStart(uint16 var, const ArgumentsArray &arg
void Myst::o_basementDecreasePressureStop(uint16 var, const ArgumentsArray &args) {
_treeStopped = false;
_basementPressureDecreasing = false;
- _state.treeLastMoveTime = _vm->_system->getMillis();
+ _state.treeLastMoveTime = _vm->getTotalPlayTime();
}
void Myst::tree_run() {
@@ -2172,7 +2172,7 @@ void Myst::tree_run() {
if ((_state.treePosition < 12 && !goingDown)
|| (_state.treePosition > _treeMinPosition && goingDown)) {
uint16 delay = treeNextMoveDelay(pressure);
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (delay < time - _state.treeLastMoveTime) {
// Tree movement
@@ -2481,7 +2481,7 @@ void Myst::o_rocketLeverEndMove(uint16 var, const ArgumentsArray &args) {
void Myst::o_cabinLeave(uint16 var, const ArgumentsArray &args) {
// If match is lit, put out
if (_cabinMatchState == 1) {
- _matchGoOutTime = _vm->_system->getMillis();
+ _matchGoOutTime = _vm->getTotalPlayTime();
} else if (_cabinMatchState == 0) {
_vm->setMainCursor(_savedCursorId);
_cabinMatchState = 2;
@@ -2636,19 +2636,19 @@ void Myst::observatoryUpdateTime() {
void Myst::o_libraryBookPageTurnStartLeft(uint16 var, const ArgumentsArray &args) {
_tempVar = -1;
libraryBookPageTurnLeft();
- _startTime = _vm->_system->getMillis();
+ _startTime = _vm->getTotalPlayTime();
_libraryBookPagesTurning = true;
}
void Myst::o_libraryBookPageTurnStartRight(uint16 var, const ArgumentsArray &args) {
_tempVar = 1;
libraryBookPageTurnRight();
- _startTime = _vm->_system->getMillis();
+ _startTime = _vm->getTotalPlayTime();
_libraryBookPagesTurning = true;
}
void Myst::libraryBook_run() {
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time >= _startTime + 500) {
if (_tempVar > 0) {
libraryBookPageTurnRight();
@@ -2676,12 +2676,12 @@ void Myst::o_cabinMatchLight(uint16 var, const ArgumentsArray &args) {
_vm->setMainCursor(kLitMatchCursor);
// Match will stay lit for one minute
- _matchGoOutTime = _vm->_system->getMillis() + 60 * 1000;
+ _matchGoOutTime = _vm->getTotalPlayTime() + 60 * 1000;
}
}
void Myst::matchBurn_run() {
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time > _matchGoOutTime) {
_matchGoOutTime = time + 150;
@@ -2732,7 +2732,7 @@ void Myst::o_clockHourWheelStartTurn(uint16 var, const ArgumentsArray &args) {
void Myst::clockWheel_run() {
// Turn wheel one step each second
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time > _startTime + 1000) {
_startTime = time;
@@ -2763,7 +2763,7 @@ void Myst::clockWheelStartTurn(uint16 wheel) {
// Continue turning wheel until mouse button is released
_clockTurningWheel = wheel;
- _startTime = _vm->_system->getMillis();
+ _startTime = _vm->getTotalPlayTime();
}
void Myst::clockWheelTurn(uint16 var) {
@@ -2779,14 +2779,14 @@ void Myst::clockWheelTurn(uint16 var) {
void Myst::o_libraryCombinationBookStartRight(uint16 var, const ArgumentsArray &args) {
_tempVar = 0;
libraryCombinationBookTurnRight();
- _startTime = _vm->_system->getMillis();
+ _startTime = _vm->getTotalPlayTime();
_libraryCombinationBookPagesTurning = true;
}
void Myst::o_libraryCombinationBookStartLeft(uint16 var, const ArgumentsArray &args) {
_tempVar = 0;
libraryCombinationBookTurnLeft();
- _startTime = _vm->_system->getMillis();
+ _startTime = _vm->getTotalPlayTime();
_libraryCombinationBookPagesTurning = true;
}
@@ -2839,7 +2839,7 @@ void Myst::libraryCombinationBookTurnRight() {
}
void Myst::libraryCombinationBook_run() {
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time >= _startTime + 500) {
if (_tempVar > 0) {
libraryCombinationBookTurnRight();
@@ -3158,7 +3158,7 @@ void Myst::towerRotationMap_run() {
_vm->_gfx->copyBackBufferToScreen(Common::Rect(106, 42, 459, 273));
}
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time > _startTime) {
if (_towerRotationMapClicked) {
towerRotationMapRotate();
@@ -3428,14 +3428,14 @@ void Myst::o_clockGears_init(uint16 var, const ArgumentsArray &args) {
void Myst::o_gulls1_init(uint16 var, const ArgumentsArray &args) {
if (!_state.shipFloating) {
- _gullsNextTime = _vm->_system->getMillis() + 2000;
+ _gullsNextTime = _vm->getTotalPlayTime() + 2000;
_gullsFlying1 = true;
}
}
void Myst::gullsFly1_run() {
static const char* gulls[] = { "birds1", "birds2", "birds3" };
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time > _gullsNextTime) {
uint16 video = _vm->_rnd->getRandomNumber(3);
@@ -3475,7 +3475,7 @@ void Myst::o_observatory_init(uint16 var, const ArgumentsArray &args) {
_observatoryYearSlider->setPosition(_state.observatoryYearSlider);
_observatoryTimeSlider->setPosition(_state.observatoryTimeSlider);
- _observatoryLastTime = _vm->_system->getMillis();
+ _observatoryLastTime = _vm->getTotalPlayTime();
observatorySetTargetToSetting();
@@ -3562,7 +3562,7 @@ void Myst::observatory_run() {
|| _state.observatoryTimeTarget != _state.observatoryTimeSetting) {
// Blink the go button
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time > _observatoryLastTime + 250) {
_tempVar = (_tempVar + 1) % 2;
_observatoryGoButton->drawConditionalDataToScreen(_tempVar);
@@ -3573,14 +3573,14 @@ void Myst::observatory_run() {
void Myst::o_gulls2_init(uint16 var, const ArgumentsArray &args) {
if (!_state.shipFloating) {
- _gullsNextTime = _vm->_system->getMillis() + 2000;
+ _gullsNextTime = _vm->getTotalPlayTime() + 2000;
_gullsFlying2 = true;
}
}
void Myst::gullsFly2_run() {
static const char* gulls[] = { "birds1", "birds2", "birds3" };
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time > _gullsNextTime) {
uint16 video = _vm->_rnd->getRandomNumber(3);
@@ -3738,14 +3738,14 @@ void Myst::greenBook_run() {
void Myst::o_gulls3_init(uint16 var, const ArgumentsArray &args) {
if (!_state.shipFloating) {
- _gullsNextTime = _vm->_system->getMillis() + 2000;
+ _gullsNextTime = _vm->getTotalPlayTime() + 2000;
_gullsFlying3 = true;
}
}
void Myst::gullsFly3_run() {
static const char* gulls[] = { "birds1", "birds2", "birds3" };
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time > _gullsNextTime) {
uint16 video = _vm->_rnd->getRandomNumber(3);
diff --git a/engines/mohawk/myst_stacks/preview.cpp b/engines/mohawk/myst_stacks/preview.cpp
index 8348c45478..eaa311b75b 100644
--- a/engines/mohawk/myst_stacks/preview.cpp
+++ b/engines/mohawk/myst_stacks/preview.cpp
@@ -114,7 +114,7 @@ void Preview::speechUpdateCue() {
}
void Preview::speech_run() {
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
// Update current speech sound cue
speechUpdateCue();
diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp
index 4ef7828a69..bcc16dc150 100644
--- a/engines/mohawk/myst_stacks/selenitic.cpp
+++ b/engines/mohawk/myst_stacks/selenitic.cpp
@@ -671,7 +671,7 @@ void Selenitic::soundReceiverLeftRight(uint direction) {
_soundReceiverDirection = direction;
_soundReceiverSpeed = kSoundReceiverSpeedSlow;
- _soundReceiverStartTime = _vm->_system->getMillis();
+ _soundReceiverStartTime = _vm->getTotalPlayTime();
soundReceiverUpdate();
}
@@ -950,7 +950,7 @@ void Selenitic::o_mazeRunnerLight_init(uint16 var, const ArgumentsArray &args) {
void Selenitic::soundReceiver_run() {
if (_soundReceiverStartTime) {
if (_soundReceiverDirection) {
- uint32 currentTime = _vm->_system->getMillis();
+ uint32 currentTime = _vm->getTotalPlayTime();
if (_soundReceiverSpeed == kSoundReceiverSpeedFast && currentTime > _soundReceiverStartTime + 500) {
soundReceiverIncreaseSpeed();
diff --git a/engines/mohawk/myst_stacks/slides.cpp b/engines/mohawk/myst_stacks/slides.cpp
index 7524dde77d..aa339bd611 100644
--- a/engines/mohawk/myst_stacks/slides.cpp
+++ b/engines/mohawk/myst_stacks/slides.cpp
@@ -62,7 +62,7 @@ void Slides::disablePersistentScripts() {
void Slides::runPersistentScripts() {
if (_cardSwapEnabled) {
// Used on Cards...
- if (_vm->_system->getMillis() > _nextCardTime) {
+ if (_vm->getTotalPlayTime() > _nextCardTime) {
_vm->_gfx->fadeToBlack();
_vm->changeToCard(_nextCardID, kNoTransition);
_vm->_gfx->fadeFromBlack();
@@ -78,7 +78,7 @@ void Slides::o_returnToMenu(uint16 var, const ArgumentsArray &args) {
void Slides::o_setCardSwap(uint16 var, const ArgumentsArray &args) {
_nextCardID = args[0];
- _nextCardTime = _vm->_system->getMillis() + 5000;
+ _nextCardTime = _vm->getTotalPlayTime() + 5000;
_cardSwapEnabled = true;
}
diff --git a/engines/mohawk/myst_stacks/stoneship.cpp b/engines/mohawk/myst_stacks/stoneship.cpp
index 3791972325..e60090ceee 100644
--- a/engines/mohawk/myst_stacks/stoneship.cpp
+++ b/engines/mohawk/myst_stacks/stoneship.cpp
@@ -508,12 +508,12 @@ void Stoneship::o_generatorStart(uint16 var, const ArgumentsArray &args) {
_vm->_sound->playEffect(soundId);
if (_state.generatorDuration)
- _state.generatorDuration -= _vm->_system->getMillis() - _state.generatorDepletionTime;
+ _state.generatorDuration -= _vm->getTotalPlayTime() - _state.generatorDepletionTime;
// Start charging the battery
_batteryDepleting = false;
_batteryCharging = true;
- _batteryNextTime = _vm->_system->getMillis() + 1000;
+ _batteryNextTime = _vm->getTotalPlayTime() + 1000;
// Start handle movie
MystAreaVideo *movie = static_cast<MystAreaVideo *>(handle->getSubResource(0));
@@ -533,10 +533,10 @@ void Stoneship::o_generatorStop(uint16 var, const ArgumentsArray &args) {
_state.generatorDuration = 600000;
// Start depleting power
- _state.generatorDepletionTime = _vm->_system->getMillis() + _state.generatorDuration;
+ _state.generatorDepletionTime = _vm->getTotalPlayTime() + _state.generatorDuration;
_state.generatorPowerAvailable = 1;
_batteryDepleting = true;
- _batteryNextTime = _vm->_system->getMillis() + 60000;
+ _batteryNextTime = _vm->getTotalPlayTime() + 60000;
}
// Pause handle movie
@@ -550,7 +550,7 @@ void Stoneship::o_generatorStop(uint16 var, const ArgumentsArray &args) {
}
void Stoneship::chargeBattery_run() {
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time > _batteryNextTime) {
_batteryNextTime = time + 1000;
@@ -559,7 +559,7 @@ void Stoneship::chargeBattery_run() {
}
uint16 Stoneship::batteryRemainingCharge() {
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (_state.generatorDepletionTime > time) {
return (_state.generatorDepletionTime - time) / 7500;
@@ -569,7 +569,7 @@ uint16 Stoneship::batteryRemainingCharge() {
}
void Stoneship::batteryDeplete_run() {
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time > _batteryNextTime) {
if (_state.generatorDuration > 60000) {
@@ -828,7 +828,7 @@ void Stoneship::o_tunnelEnter_init(uint16 var, const ArgumentsArray &args) {
o_tunnel_init(var, args);
_tunnelRunning = true;
- _tunnelNextTime = _vm->_system->getMillis() + 1500;
+ _tunnelNextTime = _vm->getTotalPlayTime() + 1500;
}
void Stoneship::o_batteryGauge_init(uint16 var, const ArgumentsArray &args) {
@@ -867,7 +867,7 @@ void Stoneship::o_tunnel_init(uint16 var, const ArgumentsArray &args) {
}
void Stoneship::tunnel_run() {
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time > _tunnelNextTime) {
_tunnelNextTime = time + 1500;
@@ -904,11 +904,11 @@ void Stoneship::o_telescope_init(uint16 var, const ArgumentsArray &args) {
_telescopeRunning = true;
_telescopeLighthouseState = false;
- _telescopeNexTime = _vm->_system->getMillis() + 1000;
+ _telescopeNexTime = _vm->getTotalPlayTime() + 1000;
}
void Stoneship::telescope_run() {
- uint32 time = _vm->_system->getMillis();
+ uint32 time = _vm->getTotalPlayTime();
if (time > _telescopeNexTime) {