diff options
author | Julien Templier | 2010-10-26 06:55:17 +0000 |
---|---|---|
committer | Julien Templier | 2010-10-26 06:55:17 +0000 |
commit | fd8af7ba6ed6753f4b8a656b26d6092c824fc844 (patch) | |
tree | b3f813c209bf4816cd0480bf9278b54e5add7c28 /engines/lastexpress | |
parent | f663a736dd1d7b8bed0b25e94269f1c4e329ae73 (diff) | |
download | scummvm-rg350-fd8af7ba6ed6753f4b8a656b26d6092c824fc844.tar.gz scummvm-rg350-fd8af7ba6ed6753f4b8a656b26d6092c824fc844.tar.bz2 scummvm-rg350-fd8af7ba6ed6753f4b8a656b26d6092c824fc844.zip |
LASTEXPRESS: Make GameState::time of type TimeValue
svn-id: r53844
Diffstat (limited to 'engines/lastexpress')
-rw-r--r-- | engines/lastexpress/entities/anna.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/entities/ivo.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/entities/milos.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/entities/salko.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/entities/vesna.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/game/action.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/game/logic.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/game/menu.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/game/scenes.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/game/state.h | 9 |
10 files changed, 13 insertions, 14 deletions
diff --git a/engines/lastexpress/entities/anna.cpp b/engines/lastexpress/entities/anna.cpp index 784a985b45..2126c1b499 100644 --- a/engines/lastexpress/entities/anna.cpp +++ b/engines/lastexpress/entities/anna.cpp @@ -3200,7 +3200,7 @@ IMPLEMENT_FUNCTION(64, Anna, baggage) if (params->param1) getLogic()->gameOver(kSavegameTypeIndex, 0, kSceneNone, params->param1 == Fight::kFightEndLost); else { - getState()->time += 1800; + getState()->time = (TimeValue)(getState()->time + 1800); setCallback(3); setup_savegame(kSavegameTypeEvent, kEventAnnaBagagePart2); diff --git a/engines/lastexpress/entities/ivo.cpp b/engines/lastexpress/entities/ivo.cpp index f689a1c2ca..6bee62f003 100644 --- a/engines/lastexpress/entities/ivo.cpp +++ b/engines/lastexpress/entities/ivo.cpp @@ -802,7 +802,7 @@ IMPLEMENT_FUNCTION(33, Ivo, function33) break; case kActionDefault: - getState()->time += 1800; + getState()->time = (TimeValue)(getState()->time + 1800); setCallback(1); setup_savegame(kSavegameTypeTime, kTimeNone); diff --git a/engines/lastexpress/entities/milos.cpp b/engines/lastexpress/entities/milos.cpp index fd99084cf8..6783ae7416 100644 --- a/engines/lastexpress/entities/milos.cpp +++ b/engines/lastexpress/entities/milos.cpp @@ -618,7 +618,7 @@ label_callback_12: if (params->param8) { getLogic()->gameOver(kSavegameTypeIndex, 0, kSceneNone, params->param8 == Fight::kFightEndLost); } else { - getState()->time += 1800; + getState()->time = (TimeValue)(getState()->time + 1800); getProgress().field_CC = 1; setCallback(getCallback() + 1); diff --git a/engines/lastexpress/entities/salko.cpp b/engines/lastexpress/entities/salko.cpp index 27538ae15c..cddbc9005d 100644 --- a/engines/lastexpress/entities/salko.cpp +++ b/engines/lastexpress/entities/salko.cpp @@ -611,7 +611,7 @@ IMPLEMENT_FUNCTION(24, Salko, chapter5Handler) params->param1 = getFight()->setup(kFightSalko); if (params->param1 == Fight::kFightEndWin) { - getState()->time += 1800; + getState()->time = (TimeValue)(getState()->time + 1800); setCallback(3); setup_savegame(kSavegameTypeEvent, kEventCathSalkoTrainTopWin); } else { diff --git a/engines/lastexpress/entities/vesna.cpp b/engines/lastexpress/entities/vesna.cpp index fecf322a51..531c74b1d7 100644 --- a/engines/lastexpress/entities/vesna.cpp +++ b/engines/lastexpress/entities/vesna.cpp @@ -1122,7 +1122,7 @@ IMPLEMENT_FUNCTION(30, Vesna, function30) } else { getSound()->playSound(kEntityPlayer, "TUNNEL"); - getState()->time += 1800; + getState()->time = (TimeValue)(getState()->time + 1800); setCallback(5); setup_savegame(kSavegameTypeEvent, kEventCathVesnaTrainTopWin); diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index ade2619185..e98a1dc276 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -1958,7 +1958,7 @@ void Action::playAnimation(EventIndex index, bool debugMode) const { // Adjust game time getState()->timeTicks += _animationList[index].time; - getState()->time += _animationList[index].time * getState()->timeDelta; + getState()->time = (TimeValue)(getState()->time + _animationList[index].time * getState()->timeDelta); } } // End of namespace LastExpress diff --git a/engines/lastexpress/game/logic.cpp b/engines/lastexpress/game/logic.cpp index 87cf2b54e3..75e237df4a 100644 --- a/engines/lastexpress/game/logic.cpp +++ b/engines/lastexpress/game/logic.cpp @@ -316,7 +316,7 @@ void Logic::eventTick(const Common::Event &) { // Adjust time and save game if needed if (getFlags()->isGameRunning) { getState()->timeTicks += ticks; - getState()->time += ticks * getState()->timeDelta; + getState()->time = (TimeValue)(getState()->time + ticks * getState()->timeDelta); if (getState()->timeDelta) { diff --git a/engines/lastexpress/game/menu.cpp b/engines/lastexpress/game/menu.cpp index ab95fd30c4..dd59f0384c 100644 --- a/engines/lastexpress/game/menu.cpp +++ b/engines/lastexpress/game/menu.cpp @@ -1143,7 +1143,7 @@ void Menu::switchGame() { if (!SaveLoad::isSavegamePresent(_gameId)) getSaveLoad()->create(_gameId); - getState()->time = 0; + getState()->time = kTimeNone; // Clear menu elements _clock->clear(); diff --git a/engines/lastexpress/game/scenes.cpp b/engines/lastexpress/game/scenes.cpp index 57578645d0..7a601b504b 100644 --- a/engines/lastexpress/game/scenes.cpp +++ b/engines/lastexpress/game/scenes.cpp @@ -1077,7 +1077,7 @@ void SceneManager::postProcessScene() { case Scene::kTypeList: { // Adjust time - getState()->time += (scene->param1 + 10) * getState()->timeDelta; + getState()->time = (TimeValue)(getState()->time + (scene->param1 + 10) * getState()->timeDelta); getState()->timeTicks += (scene->param1 + 10); // Wait for a number of frames unless right mouse is clicked diff --git a/engines/lastexpress/game/state.h b/engines/lastexpress/game/state.h index a1b67df476..07c1844efa 100644 --- a/engines/lastexpress/game/state.h +++ b/engines/lastexpress/game/state.h @@ -596,7 +596,7 @@ public: // Game data uint32 field_0; - uint32 time; + TimeValue time; uint32 timeDelta; uint32 timeTicks; bool sceneUseBackup; // byte @@ -612,7 +612,7 @@ public: volume = _defaultVolume; //Game data - time = _defaultTime; + time = kTimeCityParis; timeDelta = _defaultTimeDelta; timeTicks = 0; sceneUseBackup = false; @@ -728,9 +728,8 @@ public: static void getHourMinutes(uint32 time, uint8 *hours, uint8 *minutes); private: - static const uint32 _defaultBrigthness = 0x3; - static const uint32 _defaultVolume = 0x7; - static const uint32 _defaultTime = 1037700; + static const uint32 _defaultBrigthness = 3; + static const uint32 _defaultVolume = 7; static const uint32 _defaultTimeDelta = 3; static const uint32 _defaultPortrait = 32; |