LASTEXPRESS: Make GameState::time of type TimeValue

svn-id: r53844
This commit is contained in:
Julien Templier 2010-10-26 06:55:17 +00:00
parent f663a736dd
commit fd8af7ba6e
10 changed files with 13 additions and 14 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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 {

View File

@ -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);

View File

@ -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

View File

@ -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) {

View File

@ -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();

View File

@ -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

View File

@ -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;