aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/lastexpress/debug.cpp19
-rw-r--r--engines/lastexpress/entities/abbot.cpp18
-rw-r--r--engines/lastexpress/entities/alexei.cpp12
-rw-r--r--engines/lastexpress/entities/alouan.cpp2
-rw-r--r--engines/lastexpress/entities/anna.cpp20
-rw-r--r--engines/lastexpress/entities/august.cpp10
-rw-r--r--engines/lastexpress/entities/boutarel.cpp2
-rw-r--r--engines/lastexpress/entities/coudert.cpp2
-rw-r--r--engines/lastexpress/entities/entity_intern.h12
-rw-r--r--engines/lastexpress/entities/francois.cpp2
-rw-r--r--engines/lastexpress/entities/hadija.cpp6
-rw-r--r--engines/lastexpress/entities/kahina.cpp14
-rw-r--r--engines/lastexpress/entities/kronos.cpp6
-rw-r--r--engines/lastexpress/entities/max.cpp4
-rw-r--r--engines/lastexpress/entities/mertens.cpp6
-rw-r--r--engines/lastexpress/entities/milos.cpp6
-rw-r--r--engines/lastexpress/entities/mmeboutarel.cpp8
-rw-r--r--engines/lastexpress/entities/pascale.cpp4
-rw-r--r--engines/lastexpress/entities/rebecca.cpp26
-rw-r--r--engines/lastexpress/entities/tatiana.cpp6
-rw-r--r--engines/lastexpress/entities/train.cpp2
-rw-r--r--engines/lastexpress/entities/vassili.cpp6
-rw-r--r--engines/lastexpress/entities/verges.cpp2
-rw-r--r--engines/lastexpress/entities/vesna.cpp2
-rw-r--r--engines/lastexpress/game/action.cpp2
-rw-r--r--engines/lastexpress/game/entities.cpp10
-rw-r--r--engines/lastexpress/game/entities.h10
-rw-r--r--engines/lastexpress/game/logic.cpp2
-rw-r--r--engines/lastexpress/game/menu.cpp12
-rw-r--r--engines/lastexpress/game/menu.h6
-rw-r--r--engines/lastexpress/game/savegame.h4
-rw-r--r--engines/lastexpress/game/scenes.cpp6
-rw-r--r--engines/lastexpress/game/sound.cpp6
33 files changed, 130 insertions, 125 deletions
diff --git a/engines/lastexpress/debug.cpp b/engines/lastexpress/debug.cpp
index 6e561aa3d6..87daad2760 100644
--- a/engines/lastexpress/debug.cpp
+++ b/engines/lastexpress/debug.cpp
@@ -103,6 +103,9 @@ Debugger::~Debugger() {
delete _soundStream;
resetCommand();
+ _command = NULL;
+ _commandParams = NULL;
+
// Zero passed pointers
_engine = NULL;
}
@@ -116,8 +119,10 @@ bool Debugger::hasCommand() const {
void Debugger::resetCommand() {
SAFE_DELETE(_command);
- for (int i = 0; i < _numParams; i++)
- free(_commandParams[i]);
+
+ if (_commandParams)
+ for (int i = 0; i < _numParams; i++)
+ free(_commandParams[i]);
free(_commandParams);
_commandParams = NULL;
@@ -129,7 +134,7 @@ int Debugger::getNumber(const char *arg) const {
}
void Debugger::copyCommand(int argc, const char **argv) {
- _commandParams = (char **)malloc(sizeof(char *) * argc);
+ _commandParams = (char **)malloc(sizeof(char *) * (uint)argc);
if (!_commandParams)
return;
@@ -259,7 +264,7 @@ bool Debugger::cmdListFiles(int argc, const char **argv) {
*
* @return true if it was handled, false otherwise
*/
-bool Debugger::cmdDumpFiles(int argc, const char **argv) {
+bool Debugger::cmdDumpFiles(int argc, const char **) {
#define OUTPUT_ARCHIVE_FILES(name, filename) { \
_engine->getResourceManager()->reset(); \
_engine->getResourceManager()->loadArchive(filename); \
@@ -277,7 +282,7 @@ bool Debugger::cmdDumpFiles(int argc, const char **argv) {
return true; \
} \
char md5str[32+1]; \
- Common::md5_file_string(*stream, md5str, stream->size()); \
+ Common::md5_file_string(*stream, md5str, (uint32)stream->size()); \
debugC(1, kLastExpressDebugResource, "%s, %d, %s", (*it)->getName().c_str(), stream->size(), (char *)&md5str); \
delete stream; \
} \
@@ -976,7 +981,7 @@ label_error:
*/
bool Debugger::cmdTime(int argc, const char **argv) {
if (argc == 2) {
- int time = getNumber(argv[1]);
+ int32 time = getNumber(argv[1]);
if (time < 0)
goto label_error;
@@ -984,7 +989,7 @@ bool Debugger::cmdTime(int argc, const char **argv) {
// Convert to human-readable form
uint8 hours = 0;
uint8 minutes = 0;
- State::getHourMinutes(time, &hours, &minutes);
+ State::getHourMinutes((uint32)time, &hours, &minutes);
DebugPrintf("%02d:%02d\n", hours, minutes);
} else {
diff --git a/engines/lastexpress/entities/abbot.cpp b/engines/lastexpress/entities/abbot.cpp
index 90d447fca6..777767600f 100644
--- a/engines/lastexpress/entities/abbot.cpp
+++ b/engines/lastexpress/entities/abbot.cpp
@@ -850,7 +850,7 @@ IMPLEMENT_FUNCTION(31, Abbot, function31)
break;
} else {
if (!getEntities()->isInSalon(kEntityPlayer) || !params->param4)
- params->param4 = getState()->time + 450;
+ params->param4 = (uint)getState()->time + 450;
if (params->param4 < getState()->time) {
params->param4 = kTimeInvalid;
@@ -872,8 +872,8 @@ IMPLEMENT_FUNCTION(31, Abbot, function31)
break;
case kActionDefault:
- params->param2 = getState()->time + 4500;
- params->param3 = getState()->time + 18000;
+ params->param2 = (uint)getState()->time + 4500;
+ params->param3 = (uint)getState()->time + 18000;
getEntities()->drawSequenceLeft(kEntityAbbot, "115B");
break;
@@ -988,7 +988,7 @@ IMPLEMENT_FUNCTION(33, Abbot, function33)
if (params->param1 != kTimeInvalid && getState()->time > kTime2115000) {
if (getState()->time <= kTime2124000) {
if (!getEntities()->isDistanceBetweenEntities(kEntityAbbot, kEntityPlayer, 2000) || !params->param1)
- params->param1 = getState()->time;
+ params->param1 = (uint)getState()->time;
if (params->param1 >= getState()->time)
break;
@@ -1084,7 +1084,7 @@ IMPLEMENT_FUNCTION(35, Abbot, function35)
if (params->param1 >= getState()->time) {
if (!getEntities()->isInSalon(kEntityPlayer) || !params->param2)
- params->param2 = getState()->time + 450;
+ params->param2 = (uint)getState()->time + 450;
if (params->param2 >= getState()->time)
break;
@@ -1100,7 +1100,7 @@ IMPLEMENT_FUNCTION(35, Abbot, function35)
case kActionDefault:
getEntities()->drawSequenceLeft(kEntityAbbot, "115B");
- params->param1 = getState()->time + 9000;
+ params->param1 = (uint)getState()->time + 9000;
break;
case kActionCallback:
@@ -1152,7 +1152,7 @@ IMPLEMENT_FUNCTION(36, Abbot, function36)
if (params->param1 >= getState()->time) {
if (!getEntities()->isInSalon(kEntityPlayer) || !params->param3)
- params->param3 = getState()->time + 675;
+ params->param3 = (uint)getState()->time + 675;
if (params->param3 >= getState()->time)
break;
@@ -1184,7 +1184,7 @@ IMPLEMENT_FUNCTION(36, Abbot, function36)
break;
case kActionDefault:
- params->param1 = getState()->time + 4500;
+ params->param1 = (uint)getState()->time + 4500;
getEntities()->drawSequenceLeft(kEntityAbbot, "121B");
break;
@@ -1413,7 +1413,7 @@ IMPLEMENT_FUNCTION(43, Abbot, function43)
break;
} else {
if (!getEntities()->isDistanceBetweenEntities(kEntityAbbot, kEntityPlayer, 1000) || getSound()->isBuffered(kEntityBoutarel) || !params->param4)
- params->param4 = getState()->time + 450;
+ params->param4 = (uint)getState()->time + 450;
if (params->param4 < getState()->time) {
params->param4 = kTimeInvalid;
diff --git a/engines/lastexpress/entities/alexei.cpp b/engines/lastexpress/entities/alexei.cpp
index 3409b045ef..59b99fe968 100644
--- a/engines/lastexpress/entities/alexei.cpp
+++ b/engines/lastexpress/entities/alexei.cpp
@@ -771,7 +771,7 @@ IMPLEMENT_FUNCTION(22, Alexei, function22)
params->param3 = kTimeInvalid;
} else {
if (!getEntities()->isInSalon(kEntityPlayer) || getEntities()->isInSalon(kEntityPlayer) || !params->param3)
- params->param3 = getState()->time;
+ params->param3 = (uint)getState()->time;
if (params->param3 >= getState()->time)
break;
@@ -1521,15 +1521,15 @@ IMPLEMENT_FUNCTION(39, Alexei, function39)
break;
if (!params->param4) {
- params->param3 = getState()->time + 4500;
- params->param4 = getState()->time + 9000;
+ params->param3 = (uint)getState()->time + 4500;
+ params->param4 = (uint)getState()->time + 9000;
}
if (params->param5 != kTimeInvalid && params->param3 < getState()->time) {
if (params->param4 >= getState()->time) {
if (getEntities()->isInGreenCarEntrance(kEntityPlayer) || !params->param5)
- params->param5 = getState()->time;
+ params->param5 = (uint)getState()->time;
if (params->param5 >= getState()->time)
break;
@@ -1727,7 +1727,7 @@ IMPLEMENT_FUNCTION(43, Alexei, function43)
case kActionNone:
if (getState()->time < kTime1806300 && params->param2 < getState()->time) {
if (!params->param2)
- params->param2 = getState()->time + params->param1;
+ params->param2 = (uint)getState()->time + params->param1;
if (getEntities()->isSomebodyInsideRestaurantOrSalon()) {
setCallback(1);
@@ -1882,7 +1882,7 @@ IMPLEMENT_FUNCTION(46, Alexei, function46)
if (getState()->time <= kTime2493000) {
if (getEntities()->isInSalon(kEntityPlayer) || getEntities()->isInSalon(kEntityAugust) || !params->param1)
- params->param1 = getState()->time;
+ params->param1 = (uint)getState()->time;
if (params->param1 >= getState()->time)
break;
diff --git a/engines/lastexpress/entities/alouan.cpp b/engines/lastexpress/entities/alouan.cpp
index 6225fb28cf..2867fa726b 100644
--- a/engines/lastexpress/entities/alouan.cpp
+++ b/engines/lastexpress/entities/alouan.cpp
@@ -209,7 +209,7 @@ IMPLEMENT_FUNCTION(14, Alouan, chapter2Handler)
if (getState()->time <= kTime1777500) {
if (!getEntities()->isPlayerInCar(kCarGreenSleeping) || !params->param2)
- params->param2 = getState()->time + 75;
+ params->param2 = (uint)getState()->time + 75;
if (params->param2 >= getState()->time)
break;
diff --git a/engines/lastexpress/entities/anna.cpp b/engines/lastexpress/entities/anna.cpp
index 2126c1b499..e6752dad48 100644
--- a/engines/lastexpress/entities/anna.cpp
+++ b/engines/lastexpress/entities/anna.cpp
@@ -1085,7 +1085,7 @@ IMPLEMENT_FUNCTION(27, Anna, function27)
case 1:
case 2:
if (getProgress().field_14 == 29) {
- params->param1 = getState()->time + 900;
+ params->param1 = (uint)(getState()->time + 900);
setCallback(2);
setup_function15((TimeValue)params->param1, "NONE");
} else {
@@ -1253,7 +1253,7 @@ IMPLEMENT_FUNCTION(30, Anna, function30)
getSound()->playSound(kEntityAnna, "AUG1004");
} else {
if (!getEntities()->isInSalon(kEntityPlayer) || !params->param3)
- params->param3 = getState()->time + 450;
+ params->param3 = (uint)(getState()->time + 450);
if (params->param3 < getState()->time) {
params->param3 = kTimeInvalid;
@@ -1271,7 +1271,7 @@ IMPLEMENT_FUNCTION(30, Anna, function30)
}
if (!getEntities()->isInSalon(kEntityPlayer) || !params->param4)
- params->param4 = getState()->time + 150;
+ params->param4 = (uint)(getState()->time + 150);
if (params->param4 < getState()->time) {
params->param4 = kTimeInvalid;
@@ -1389,7 +1389,7 @@ IMPLEMENT_FUNCTION(33, Anna, function33)
case kActionDefault:
getSavePoints()->push(kEntityAnna, kEntityMax, kAction101687594);
- params->param1 = getState()->time + 4500;
+ params->param1 = (uint)(getState()->time + 4500);
setCallback(1);
setup_function15((TimeValue)params->param1, "NONE");
break;
@@ -2102,12 +2102,12 @@ IMPLEMENT_FUNCTION(48, Anna, function48)
label_callback_4:
if (ENTITY_PARAM(0, 2)) {
if (!params->param2)
- params->param2 = getState()->time + 4500;
+ params->param2 = (uint)(getState()->time + 4500);
if (params->param4 != kTimeInvalid) {
if (params->param2 >= getState()->time) {
if (!getEntities()->isInRestaurant(kEntityPlayer) || !params->param4)
- params->param4 = getState()->time + 450;
+ params->param4 = (uint)(getState()->time + 450);
if (params->param4 >= getState()->time)
break;
@@ -2884,7 +2884,7 @@ IMPLEMENT_FUNCTION(59, Anna, function59)
&& !getEntities()->isInSalon(kEntityPlayer)
&& !getEntities()->isInRestaurant(kEntityPlayer))
|| !params->param4)
- params->param4 = getState()->time;
+ params->param4 = (uint)getState()->time;
if (params->param4 < getState()->time) {
params->param4 = kTimeInvalid;
@@ -3629,7 +3629,7 @@ IMPLEMENT_FUNCTION(73, Anna, function73)
if (params->param2 >= getState()->time) {
if (!((getEntities()->isPlayerInCar(kCarGreenSleeping) || getEntities()->isPlayerInCar(kCarRedSleeping)) && params->param3))
- params->param3 = getState()->time;
+ params->param3 = (uint)getState()->time;
if (params->param3 >= getState()->time)
break;
@@ -3660,8 +3660,8 @@ IMPLEMENT_FUNCTION(73, Anna, function73)
getObjects()->update(kObjectCompartmentF, kEntityAnna, kObjectLocationNone, kCursorHandKnock, kCursorHand);
getState()->timeDelta = 1;
- params->param1 = getState()->time + 4500;
- params->param2 = getState()->time + 9000;
+ params->param1 = (uint)(getState()->time + 4500);
+ params->param2 = (uint)(getState()->time + 9000);
break;
case kActionCallback:
diff --git a/engines/lastexpress/entities/august.cpp b/engines/lastexpress/entities/august.cpp
index b642c019eb..36d8ed4fe4 100644
--- a/engines/lastexpress/entities/august.cpp
+++ b/engines/lastexpress/entities/august.cpp
@@ -1431,7 +1431,7 @@ IMPLEMENT_FUNCTION(29, August, function29)
if (!getEntities()->isInRestaurant(kEntityPlayer)
|| getSound()->isBuffered("MRB1076") || getSound()->isBuffered("MRB1078") || getSound()->isBuffered("MRB1078A"))
- params->param3 = getState()->time + 225;
+ params->param3 = (uint)getState()->time + 225;
if (params->param3 > getState()->time)
break;
@@ -1641,8 +1641,8 @@ IMPLEMENT_FUNCTION(32, August, function32)
if (params->param1 && getEntities()->isSomebodyInsideRestaurantOrSalon()) {
if (!params->param4) {
- params->param4 = getState()->time + 1800;
- params->param5 = getState()->time + 9000;
+ params->param4 = (uint)getState()->time + 1800;
+ params->param5 = (uint)getState()->time + 9000;
}
if (params->param7 != kTimeInvalid && params->param4 < getState()->time) {
@@ -3033,7 +3033,7 @@ IMPLEMENT_FUNCTION(60, August, function60)
bool pushSavepoint = false;
if (!params->param2) {
pushSavepoint = true;
- params->param2 = getState()->time + 450;
+ params->param2 = (uint)getState()->time + 450;
}
if (params->param2 < getState()->time) {
@@ -3281,7 +3281,7 @@ IMPLEMENT_FUNCTION(64, August, function64)
case kActionNone:
if (!params->param1)
- params->param1 = getState()->time + 1800;
+ params->param1 = (uint)getState()->time + 1800;
if (params->param1 >= getState()->time)
break;
diff --git a/engines/lastexpress/entities/boutarel.cpp b/engines/lastexpress/entities/boutarel.cpp
index b82eeb047f..b4378c95c4 100644
--- a/engines/lastexpress/entities/boutarel.cpp
+++ b/engines/lastexpress/entities/boutarel.cpp
@@ -949,7 +949,7 @@ IMPLEMENT_FUNCTION(29, Boutarel, function29)
if (getState()->time <= kTime1998000)
if (!getEntities()->isInRestaurant(kEntityPlayer) || !params->param3)
- params->param3 = getState()->time + 450;
+ params->param3 = (uint)(getState()->time + 450);
if (params->param3 < getState()->time || getState()->time > kTime1998000) {
params->param3 = kTimeInvalid;
diff --git a/engines/lastexpress/entities/coudert.cpp b/engines/lastexpress/entities/coudert.cpp
index 5bea475d0c..6dece39161 100644
--- a/engines/lastexpress/entities/coudert.cpp
+++ b/engines/lastexpress/entities/coudert.cpp
@@ -3539,7 +3539,7 @@ IMPLEMENT_FUNCTION(53, Coudert, function53)
label_callback_1:
if (ENTITY_PARAM(1, 2)) {
if (!params->param2)
- params->param2 = getState()->time + 4500;
+ params->param2 = (uint)(getState()->time + 4500);
if (params->param3 != kTimeInvalid) {
UPDATE_PARAM_PROC_TIME(params->param2, !getEntities()->isPlayerInCar(kCarRedSleeping), params->param3, 0)
diff --git a/engines/lastexpress/entities/entity_intern.h b/engines/lastexpress/entities/entity_intern.h
index a410796a61..71607ed511 100644
--- a/engines/lastexpress/entities/entity_intern.h
+++ b/engines/lastexpress/entities/entity_intern.h
@@ -400,7 +400,7 @@ void class::setup_##name() { \
#define TIME_CHECK_CAR(timeValue, parameter, callback, function) {\
if ((getState()->time <= timeValue && !getEntities()->isPlayerInCar(kCarGreenSleeping)) || !parameter) \
- parameter = getState()->time + 75; \
+ parameter = (uint)getState()->time + 75; \
if (getState()->time > timeValue || parameter < getState()->time) { \
parameter = kTimeInvalid; \
setCallback(callback); \
@@ -425,7 +425,7 @@ void class::setup_##name() { \
//////////////////////////////////////////////////////////////////////////
#define UPDATE_PARAM(parameter, type, value) { \
if (!parameter) \
- parameter = type + value; \
+ parameter = (uint)(type + value); \
if (parameter >= type) \
break; \
parameter = kTimeInvalid; \
@@ -434,7 +434,7 @@ void class::setup_##name() { \
// Todo: replace with UPDATE_PARAM_PROC as appropriate
#define UPDATE_PARAM_GOTO(parameter, type, value, label) { \
if (!parameter) \
- parameter = type + value; \
+ parameter = (uint)(type + value); \
if (parameter >= type) \
goto label; \
parameter = kTimeInvalid; \
@@ -443,14 +443,14 @@ void class::setup_##name() { \
// Updating parameter with code inside the check
#define UPDATE_PARAM_PROC(parameter, type, value) \
if (!parameter) \
- parameter = type + value; \
+ parameter = (uint)(type + value); \
if (parameter < type) { \
parameter = kTimeInvalid;
#define UPDATE_PARAM_PROC_TIME(timeValue, test, parameter, value) \
if (getState()->time <= timeValue) { \
if (test || !parameter) \
- parameter = getState()->time + value; \
+ parameter = (uint)(getState()->time + value); \
} \
if (parameter < getState()->time || getState()->time > timeValue) { \
parameter = kTimeInvalid;
@@ -461,7 +461,7 @@ void class::setup_##name() { \
#define UPDATE_PARAM_CHECK(parameter, type, value) \
if (!parameter || parameter < type) { \
if (!parameter) \
- parameter = type + value;
+ parameter = (uint)(type + value);
//////////////////////////////////////////////////////////////////////////
// Compartments
diff --git a/engines/lastexpress/entities/francois.cpp b/engines/lastexpress/entities/francois.cpp
index 33f7526f5b..bec164e116 100644
--- a/engines/lastexpress/entities/francois.cpp
+++ b/engines/lastexpress/entities/francois.cpp
@@ -1119,7 +1119,7 @@ label_callback_11:
if (getInventory()->get(kItemWhistle)->location == kObjectLocation3) {
if (getState()->time <= kTimeEnd)
if (!getEntities()->isDistanceBetweenEntities(kEntityFrancois, kEntityPlayer, 2000) || !params->param4)
- params->param4 = getState()->time + 75;
+ params->param4 = (uint)(getState()->time + 75);
if (params->param4 < getState()->time || getState()->time > kTimeEnd) {
params->param4 = kTimeInvalid;
diff --git a/engines/lastexpress/entities/hadija.cpp b/engines/lastexpress/entities/hadija.cpp
index 1bd3238d4d..5590c1b6fe 100644
--- a/engines/lastexpress/entities/hadija.cpp
+++ b/engines/lastexpress/entities/hadija.cpp
@@ -146,7 +146,7 @@ label_callback2:
if (getState()->time <= kTime1134000) {
if (!getEntities()->isPlayerInCar(kCarGreenSleeping) || !getEntities()->isInsideCompartment(kEntityMahmud, kCarGreenSleeping, kPosition_5790) || !params->param3) {
- params->param3 = getState()->time + 75;
+ params->param3 = (uint)getState()->time + 75;
if (!params->param3) {
setCallback(3);
@@ -173,7 +173,7 @@ label_callback4:
if (getState()->time <= kTime1188000) {
if (!getEntities()->isPlayerInCar(kCarGreenSleeping) || !getEntities()->isInsideCompartment(kEntityMahmud, kCarGreenSleeping, kPosition_5790) || !params->param5) {
- params->param5 = getState()->time + 75;
+ params->param5 = (uint)getState()->time + 75;
if (!params->param5) {
setCallback(5);
@@ -263,7 +263,7 @@ IMPLEMENT_FUNCTION(14, Hadija, chapter2Handler)
if (getState()->time <= kTime1818000) {
if (!getEntities()->isPlayerInCar(kCarGreenSleeping) || !params->param2)
- params->param2 = getState()->time + 75;
+ params->param2 = (uint)getState()->time + 75;
if (params->param2 >= getState()->time) {
TIME_CHECK_CALLBACK(kTime1822500, params->param3, 2, setup_compartment8to6);
diff --git a/engines/lastexpress/entities/kahina.cpp b/engines/lastexpress/entities/kahina.cpp
index d6619e9d4f..89c685cfe9 100644
--- a/engines/lastexpress/entities/kahina.cpp
+++ b/engines/lastexpress/entities/kahina.cpp
@@ -336,7 +336,7 @@ IMPLEMENT_FUNCTION(13, Kahina, function13)
if (getState()->time <= kTime1197000) {
if (!getEntities()->isPlayerInCar(kCarGreenSleeping) || !params->param2) {
- params->param2 = getState()->time;
+ params->param2 = (uint)getState()->time;
if (!getState()->time)
goto label_callback;
@@ -360,7 +360,7 @@ label_callback:
getObjects()->update(kObjectCompartmentKronos, kEntityPlayer, kObjectLocation1, kCursorHandKnock, kCursorHand);
- params->param1 = getState()->time + 1800;
+ params->param1 = (uint)getState()->time + 1800;
break;
}
}
@@ -479,7 +479,7 @@ IMPLEMENT_FUNCTION(15, Kahina, function15)
case 8:
getEntities()->clearSequences(kEntityKahina);
- params->param1 = getState()->time + 4500;
+ params->param1 = (uint)getState()->time + 4500;
break;
case 9:
@@ -926,7 +926,7 @@ IMPLEMENT_FUNCTION(21, Kahina, function21)
case kActionNone:
if (params->param1) {
if (!params->param3)
- params->param3 = getState()->time + 4500;
+ params->param3 = (uint)getState()->time + 4500;
if (params->param6 != kTimeInvalid) {
UPDATE_PARAM_PROC_TIME(params->param3, (getEntities()->isPlayerPosition(kCarKronos, 80) || getEntities()->isPlayerPosition(kCarKronos, 88)), params->param5, 0)
@@ -941,7 +941,7 @@ label_callback_2:
if (params->param2) {
if (!params->param4)
- params->param4 = getState()->time + 4500;
+ params->param4 = (uint)getState()->time + 4500;
if (params->param6 != kTimeInvalid) {
UPDATE_PARAM_PROC_TIME(params->param3, (getEntities()->isPlayerPosition(kCarKronos, 80) || getEntities()->isPlayerPosition(kCarKronos, 88)), params->param6, 0)
@@ -1223,7 +1223,7 @@ IMPLEMENT_FUNCTION(25, Kahina, function25)
if (getState()->time <= kTime2263500) {
if (!getEntities()->isPlayerInCar(kCarGreenSleeping) || !params->param1)
- params->param1 = getState()->time;
+ params->param1 = (uint)getState()->time;
if (params->param1 >= getState()->time)
break;
@@ -1343,7 +1343,7 @@ IMPLEMENT_FUNCTION(25, Kahina, function25)
getInventory()->get(kItemFirebird)->location = kObjectLocation5;
getSavePoints()->push(kEntityKahina, kEntityKronos, kAction138085344);
getInventory()->setLocationAndProcess(kItemBriefcase, kObjectLocation2);
- getProgress().field_C0 = getState()->time;
+ getProgress().field_C0 = (uint)getState()->time;
getProgress().field_78 = 1;
break;
}
diff --git a/engines/lastexpress/entities/kronos.cpp b/engines/lastexpress/entities/kronos.cpp
index db4ebb9e72..3335edb2fb 100644
--- a/engines/lastexpress/entities/kronos.cpp
+++ b/engines/lastexpress/entities/kronos.cpp
@@ -305,7 +305,7 @@ IMPLEMENT_FUNCTION(15, Kronos, function15)
if (params->param3 != kTimeInvalid && getState()->time > kTime2002500) {
if (getState()->time <= kTime2052000) {
if (!getEntities()->isInSalon(kEntityPlayer) || getEntities()->isInSalon(kEntityPlayer) || !params->param3)
- params->param3 = getState()->time + 900;
+ params->param3 = (uint)getState()->time + 900;
if (params->param3 >= getState()->time)
break;
@@ -524,8 +524,8 @@ IMPLEMENT_FUNCTION(20, Kronos, function20)
getObjects()->update(kObject76, kEntityKronos, kObjectLocationNone, kCursorNormal, getInventory()->hasItem(kItemBriefcase) ? kCursorHand : kCursorNormal);
if (!params->param7) {
- params->param7 = getState()->time + 2700;
- params->param8 = getState()->time + 13500;
+ params->param7 = (uint)getState()->time + 2700;
+ params->param8 = (uint)getState()->time + 13500;
}
if (CURRENT_PARAM(1, 2) != kTimeInvalid && params->param7 < getState()->time) {
diff --git a/engines/lastexpress/entities/max.cpp b/engines/lastexpress/entities/max.cpp
index 67b0be7958..a846f7b6dd 100644
--- a/engines/lastexpress/entities/max.cpp
+++ b/engines/lastexpress/entities/max.cpp
@@ -283,7 +283,7 @@ IMPLEMENT_FUNCTION(9, Max, function9)
if (params->param1 >= getState()->time) {
if (!getEntities()->hasValidFrame(kEntityMax) || !params->param2) {
- params->param2 = getState()->time;
+ params->param2 = (uint)getState()->time;
if (!params->param2)
goto setup_functions;
}
@@ -312,7 +312,7 @@ setup_functions:
getEntities()->drawSequenceLeft(kEntityMax, "630Af");
getEntities()->enterCompartment(kEntityMax, kObjectCompartmentF, true);
- params->param1 = getState()->time + 2700;
+ params->param1 = (uint)(getState()->time + 2700);
break;
}
}
diff --git a/engines/lastexpress/entities/mertens.cpp b/engines/lastexpress/entities/mertens.cpp
index 4e9be7e5e3..3088ffd1c3 100644
--- a/engines/lastexpress/entities/mertens.cpp
+++ b/engines/lastexpress/entities/mertens.cpp
@@ -3024,7 +3024,7 @@ IMPLEMENT_FUNCTION(42, Mertens, function42)
|| getSound()->isBuffered("REB1205")
|| !getEntities()->isInsideCompartment(kEntityMmeBoutarel, kCarRedSleeping, kPosition_5790)
|| !params->param4) {
- params->param4 = getState()->time;
+ params->param4 = (uint)getState()->time;
}
if (params->param4 >= getState()->time)
@@ -3962,7 +3962,7 @@ IMPLEMENT_FUNCTION(52, Mertens, function52)
if (params->param1 >= getState()->time) {
if (!getEntities()->isPlayerInCar(kCarRedSleeping) || !params->param2)
- params->param2 = getState()->time;
+ params->param2 = (uint)getState()->time;
if (params->param2 >= getState()->time)
break;
@@ -3981,7 +3981,7 @@ IMPLEMENT_FUNCTION(52, Mertens, function52)
getObjects()->update(kObjectCompartmentD, kEntityPlayer, kObjectLocation3, kCursorHandKnock, kCursorHand);
- params->param1 = getState()->time + 4500;
+ params->param1 = (uint)(getState()->time + 4500);
break;
case kActionCallback:
diff --git a/engines/lastexpress/entities/milos.cpp b/engines/lastexpress/entities/milos.cpp
index 6783ae7416..50b0c04f45 100644
--- a/engines/lastexpress/entities/milos.cpp
+++ b/engines/lastexpress/entities/milos.cpp
@@ -210,12 +210,12 @@ IMPLEMENT_FUNCTION_I(11, Milos, function11, TimeValue)
}
if (!params->param4)
- params->param4 = getState()->time + 18000;
+ params->param4 = (uint)getState()->time + 18000;
if (CURRENT_PARAM(1, 2) != kTimeInvalid) {
if (params->param4 >= getState()->time) {
if (!getEntities()->isDistanceBetweenEntities(kEntityPlayer, kEntityMilos, 2000) || !CURRENT_PARAM(1, 2))
- CURRENT_PARAM(1, 2) = getState()->time + 150;
+ CURRENT_PARAM(1, 2) = (uint)getState()->time + 150;
if (CURRENT_PARAM(1, 2) >= getState()->time)
break;
@@ -1105,7 +1105,7 @@ IMPLEMENT_FUNCTION(24, Milos, function24)
case kActionNone:
if (!params->param4)
- params->param4 = getState()->time + 4500;
+ params->param4 = (uint)getState()->time + 4500;
if (params->param4 < getState()->time) {
params->param4 = kTimeInvalid;
diff --git a/engines/lastexpress/entities/mmeboutarel.cpp b/engines/lastexpress/entities/mmeboutarel.cpp
index 203732129f..aeaa1e631e 100644
--- a/engines/lastexpress/entities/mmeboutarel.cpp
+++ b/engines/lastexpress/entities/mmeboutarel.cpp
@@ -275,7 +275,7 @@ IMPLEMENT_FUNCTION(11, MmeBoutarel, function11)
if (params->param1 >= getState()->time) {
if (!getEntities()->isDistanceBetweenEntities(kEntityMmeBoutarel, kEntityPlayer, 1000) || !params->param2)
- params->param2 = getState()->time + 150;
+ params->param2 = (uint)getState()->time + 150;
if (params->param2 >= getState()->time)
break;
@@ -288,7 +288,7 @@ IMPLEMENT_FUNCTION(11, MmeBoutarel, function11)
break;
case kActionDefault:
- params->param1 = getState()->time + 1800;
+ params->param1 = (uint)getState()->time + 1800;
getObjects()->update(kObjectCompartmentD, kEntityMmeBoutarel, kObjectLocation1, kCursorNormal, kCursorNormal);
break;
@@ -464,7 +464,7 @@ label_callback_1:
break;
case kActionDefault:
- params->param1 = getState()->time + 900;
+ params->param1 = (uint)getState()->time + 900;
getData()->entityPosition = kPosition_5790;
getObjects()->update(kObjectCompartmentD, kEntityMmeBoutarel, kObjectLocation1, kCursorHandKnock, kCursorHand);
@@ -889,7 +889,7 @@ IMPLEMENT_FUNCTION(21, MmeBoutarel, chapter3Handler)
|| getSound()->isBuffered("FRA2012")
|| getSound()->isBuffered("FRA2010")
||!params->param2)
- params->param2 = getState()->time;
+ params->param2 = (uint)getState()->time;
if (params->param2 >= getState()->time)
break;
diff --git a/engines/lastexpress/entities/pascale.cpp b/engines/lastexpress/entities/pascale.cpp
index dfb0854eda..2c8c29177b 100644
--- a/engines/lastexpress/entities/pascale.cpp
+++ b/engines/lastexpress/entities/pascale.cpp
@@ -816,7 +816,7 @@ IMPLEMENT_FUNCTION(26, Pascale, chapter4Handler)
label_callback1:
if (ENTITY_PARAM(1, 2) && ENTITY_PARAM(1, 4)) {
if (!params->param3)
- params->param3 = getState()->time + 9000;
+ params->param3 = (uint)(getState()->time + 9000);
if (params->param5 != kTimeInvalid) {
@@ -828,7 +828,7 @@ label_callback1:
}
if (!getEntities()->isInRestaurant(kEntityPlayer) || !params->param5)
- params->param5 = getState()->time;
+ params->param5 = (uint)getState()->time;
if (params->param5 < getState()->time) {
params->param5 = kTimeInvalid;
diff --git a/engines/lastexpress/entities/rebecca.cpp b/engines/lastexpress/entities/rebecca.cpp
index 07f28b1719..e902c5f37b 100644
--- a/engines/lastexpress/entities/rebecca.cpp
+++ b/engines/lastexpress/entities/rebecca.cpp
@@ -515,7 +515,7 @@ IMPLEMENT_FUNCTION_I(20, Rebecca, function20, TimeValue)
if (params->param7 != kTimeInvalid && getState()->time > kTime1174500) {
if (getState()->time <= kTime1183500) {
if (!getEntities()->isDistanceBetweenEntities(kEntityRebecca, kEntityPlayer, 2000) || getSound()->isBuffered("CON1210") || !params->param7)
- params->param7 = getState()->time;
+ params->param7 = (uint)(getState()->time);
if (params->param7 >= getState()->time)
goto label_callback;
@@ -537,7 +537,7 @@ IMPLEMENT_FUNCTION_I(20, Rebecca, function20, TimeValue)
if (getProgress().chapter == kChapter3 && !ENTITY_PARAM(0, 4) && params->param8 != kTimeInvalid && getState()->time > kTime2097000) {
if (getState()->time <= kTime2106000) {
if (!getEntities()->isDistanceBetweenEntities(kEntityRebecca, kEntityPlayer, 1000) || !params->param8)
- params->param8 = getState()->time;
+ params->param8 = (uint)getState()->time;
if (params->param8 >= getState()->time)
goto label_callback;
@@ -695,7 +695,7 @@ IMPLEMENT_FUNCTION(22, Rebecca, chapter1Handler)
goto label_playConversation;
if (!getEntities()->isInSalon(kEntityPlayer) || !params->param4)
- params->param4 = getState()->time + 150;
+ params->param4 = (uint)(getState()->time + 150);
if (params->param4 >= getState()->time) {
label_callback_4:
@@ -854,7 +854,7 @@ IMPLEMENT_FUNCTION(24, Rebecca, function24)
if (params->param4 != kTimeInvalid) {
if (getState()->time <= kTime1161000) {
if (!getEntities()->isInRestaurant(kEntityPlayer) || !params->param4)
- params->param4 = getState()->time + 150;
+ params->param4 = (uint)getState()->time + 150;
if (params->param4 >= getState()->time)
break;
@@ -1085,7 +1085,7 @@ IMPLEMENT_FUNCTION(30, Rebecca, function30)
if (getState()->time <= kTimeEnd)
if (!getEntities()->isInSalon(kEntityPlayer) || !params->param4)
- params->param4 = getState()->time + 450;
+ params->param4 = (uint)getState()->time + 450;
if (params->param4 < getState()->time || getState()->time > kTimeEnd) {
params->param4 = kTimeInvalid;
@@ -1100,7 +1100,7 @@ IMPLEMENT_FUNCTION(30, Rebecca, function30)
if (getState()->time <= kTime10881000) {
if (!getEntities()->isInSalon(kEntityPlayer) || !params->param5)
- params->param5 = getState()->time + 450;
+ params->param5 = (uint)getState()->time + 450;
if (params->param5 >= getState()->time)
break;
@@ -1221,7 +1221,7 @@ IMPLEMENT_FUNCTION(34, Rebecca, function34)
if (params->param2 == kTimeInvalid) {
if (getState()->time <= kTime1386000) {
if (!getEntities()->isInRestaurant(kEntityPlayer) || !params->param2)
- params->param2 = getState()->time;
+ params->param2 = (uint)getState()->time;
if (params->param2 >= getState()->time) {
TIME_CHECK_CALLBACK(kTime2052000, params->param3, 1, setup_function19);
@@ -1310,13 +1310,13 @@ IMPLEMENT_FUNCTION(36, Rebecca, function36)
case kActionNone:
if (!params->param2)
- params->param2 = getState()->time + 1800;
+ params->param2 = (uint)getState()->time + 1800;
if (params->param4 != kTimeInvalid && params->param2 < getState()->time) {
if (getState()->time <= kTime2083500) {
if (!getEntities()->isInSalon(kEntityPlayer) || !params->param4)
- params->param4 = getState()->time + 300;
+ params->param4 = (uint)getState()->time + 300;
}
if (params->param4 < getState()->time || getState()->time > kTime2083500) {
@@ -1335,14 +1335,14 @@ label_callback_2:
goto label_callback_3;
if (!params->param3)
- params->param3 = getState()->time + 9000;
+ params->param3 = (uint)getState()->time + 9000;
if (params->param5 == kTimeInvalid || params->param3 >= getState()->time)
goto label_callback_3;
if (getState()->time <= kTime2092500) {
if (!getEntities()->isInSalon(kEntityPlayer) || !params->param5)
- params->param5 = getState()->time + 300;
+ params->param5 = (uint)getState()->time + 300;
if (params->param5 >= getState()->time) {
label_callback_3:
@@ -1603,7 +1603,7 @@ IMPLEMENT_FUNCTION(44, Rebecca, function44)
if (params->param3 != kTimeInvalid) {
if (getState()->time <= kTime2412000) {
if (!getEntities()->isInRestaurant(kEntityPlayer) || !params->param3)
- params->param3 = getState()->time;
+ params->param3 = (uint)getState()->time;
if (params->param3 >= getState()->time)
goto label_next;
@@ -1618,7 +1618,7 @@ label_next:
if (params->param1 && params->param4 != kTimeInvalid) {
if (getState()->time <= kTime2430000) {
if (!getEntities()->isInRestaurant(kEntityPlayer) || !params->param4)
- params->param4 = getState()->time + 150;
+ params->param4 = (uint)getState()->time + 150;
if (params->param4 >= getState()->time)
goto label_callback_2;
diff --git a/engines/lastexpress/entities/tatiana.cpp b/engines/lastexpress/entities/tatiana.cpp
index bd91525c22..8e6be41ad4 100644
--- a/engines/lastexpress/entities/tatiana.cpp
+++ b/engines/lastexpress/entities/tatiana.cpp
@@ -593,7 +593,7 @@ IMPLEMENT_FUNCTION(21, Tatiana, function21)
case 6:
if (getProgress().field_14 == 29) {
setCallback(6);
- setup_function16(getState()->time + 900);
+ setup_function16((uint)getState()->time + 900);
} else {
getObjects()->update(kObject49, kEntityPlayer, kObjectLocation1, kCursorHandKnock, kCursorHand);
@@ -1281,7 +1281,7 @@ IMPLEMENT_FUNCTION(37, Tatiana, function37)
case kActionNone:
if (getInventory()->get(kItemFirebird)->location != kObjectLocation1 && getInventory()->get(kItemFirebird)->location != kObjectLocation2) {
if(!params->param3)
- params->param3 = getState()->time + 900;
+ params->param3 = (uint)getState()->time + 900;
if (params->param4 != kTimeInvalid && params->param3 < getState()->time) {
UPDATE_PARAM_PROC_TIME(kTime2227500, !getEntities()->isPlayerInCar(kCarRedSleeping), params->param4, 450)
@@ -1784,7 +1784,7 @@ IMPLEMENT_FUNCTION(46, Tatiana, function46)
CURRENT_PARAM(1, 1) = kTimeInvalid;
} else {
if (getEntities()->isInGreenCarEntrance(kEntityPlayer) || !CURRENT_PARAM(1, 1))
- CURRENT_PARAM(1, 1) = getState()->time;
+ CURRENT_PARAM(1, 1) = (uint)getState()->time;
if (CURRENT_PARAM(1, 1) >= getState()->time)
break;
diff --git a/engines/lastexpress/entities/train.cpp b/engines/lastexpress/entities/train.cpp
index 53f19b1a30..b3aa6e9a66 100644
--- a/engines/lastexpress/entities/train.cpp
+++ b/engines/lastexpress/entities/train.cpp
@@ -290,7 +290,7 @@ IMPLEMENT_FUNCTION(8, Train, process)
label_process:
if (params->param7) {
if (!params1->param8) {
- params1->param8 = getState()->time + 4500;
+ params1->param8 = (uint)(getState()->time + 4500);
if (!params1->param8)
params->param7 = 0;
diff --git a/engines/lastexpress/entities/vassili.cpp b/engines/lastexpress/entities/vassili.cpp
index ce74aaa6d0..64327c2534 100644
--- a/engines/lastexpress/entities/vassili.cpp
+++ b/engines/lastexpress/entities/vassili.cpp
@@ -110,7 +110,7 @@ IMPLEMENT_FUNCTION(5, Vassili, chapter1Handler)
if (params->param3 && params->param3 >= getState()->time) {
break;
}else {
- params->param3 = getState()->time + 450;
+ params->param3 = (uint)getState()->time + 450;
if (params->param3 == 0)
break;
}
@@ -166,7 +166,7 @@ label_function7:
if (getEntities()->isInsideCompartment(kEntityPlayer, kCarRedSleeping, kPosition_8200) || !params->param4) {
- params->param4 = getState()->time;
+ params->param4 = (uint)getState()->time;
if (!params->param4) {
setup_function7();
break;
@@ -218,7 +218,7 @@ IMPLEMENT_FUNCTION(7, Vassili, function7)
if (getState()->time <= kTime1512000) {
if (getEntities()->isPlayerInCar(kCarRedSleeping) || !params->param1) {
- params->param1 = getState()->time + 150;
+ params->param1 = (uint)getState()->time + 150;
if (params->param1) {
setup_function8();
break;
diff --git a/engines/lastexpress/entities/verges.cpp b/engines/lastexpress/entities/verges.cpp
index 6455827d6b..76bf646113 100644
--- a/engines/lastexpress/entities/verges.cpp
+++ b/engines/lastexpress/entities/verges.cpp
@@ -1098,7 +1098,7 @@ label_callback_2:
}
if (!getEntities()->isPlayerInCar(kCarRedSleeping) || !params->param2) {
- params->param2 = getState()->time;
+ params->param2 = (uint)getState()->time;
if (!params->param2) {
setCallback(3);
diff --git a/engines/lastexpress/entities/vesna.cpp b/engines/lastexpress/entities/vesna.cpp
index 531c74b1d7..0e8d3bda12 100644
--- a/engines/lastexpress/entities/vesna.cpp
+++ b/engines/lastexpress/entities/vesna.cpp
@@ -505,7 +505,7 @@ IMPLEMENT_FUNCTION(20, Vesna, chapter3Handler)
}
if (!getEntities()->isPlayerInCar(kCarRedSleeping) || !parameters->param7)
- parameters->param7 = getState()->time;
+ parameters->param7 = (uint)getState()->time;
if (parameters->param7 < getState()->time) {
parameters->param7 = kTimeInvalid;
diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp
index 139033b6c8..84f406931d 100644
--- a/engines/lastexpress/game/action.cpp
+++ b/engines/lastexpress/game/action.cpp
@@ -1960,7 +1960,7 @@ void Action::playAnimation(EventIndex index, bool debugMode) const {
// Adjust game time
getState()->timeTicks += _animationList[index].time;
- getState()->time = (TimeValue)(getState()->time + _animationList[index].time * getState()->timeDelta);
+ getState()->time = (TimeValue)(getState()->time + (TimeValue)(_animationList[index].time * getState()->timeDelta));
}
} // End of namespace LastExpress
diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp
index feb9057161..40fae3ae9b 100644
--- a/engines/lastexpress/game/entities.cpp
+++ b/engines/lastexpress/game/entities.cpp
@@ -215,7 +215,7 @@ EntityData::EntityCallData *Entities::getData(EntityIndex entity) const {
return _entities[entity]->getData();
}
-int Entities::getPosition(CarIndex car, Position position) {
+int Entities::getPosition(CarIndex car, Position position) const {
int index = 100 * car + position;
if (car > 10)
@@ -227,14 +227,14 @@ int Entities::getPosition(CarIndex car, Position position) {
return _positions[index];
}
-int Entities::getCompartments(int index) {
+int Entities::getCompartments(int index) const {
if (index >= _compartmentsCount)
error("Entities::getCompartments: trying to access an invalid compartment (was: %d, valid:0-15)", index);
return _compartments[index];
}
-int Entities::getCompartments1(int index) {
+int Entities::getCompartments1(int index) const {
if (index >= _compartmentsCount)
error("Entities::getCompartments: trying to access an invalid compartment (was: %d, valid:0-15)", index);
@@ -1993,7 +1993,7 @@ bool Entities::hasValidFrame(EntityIndex entity) const {
return (getData(entity)->frame && (getData(entity)->frame->getInfo()->subType != kFrameType3));
}
-bool Entities::compare(EntityIndex entity1, EntityIndex entity2) {
+bool Entities::compare(EntityIndex entity1, EntityIndex entity2) const {
EntityData::EntityCallData *data1 = getData(entity1);
EntityData::EntityCallData *data2 = getData(entity2);
@@ -2051,7 +2051,7 @@ bool Entities::compare(EntityIndex entity1, EntityIndex entity2) {
return false;
}
-bool Entities::updateEntity(EntityIndex entity, CarIndex car, EntityPosition position) {
+bool Entities::updateEntity(EntityIndex entity, CarIndex car, EntityPosition position) const {
EntityData::EntityCallData *data = getData(entity);
EntityDirection direction = kDirectionNone;
int delta = 0;
diff --git a/engines/lastexpress/game/entities.h b/engines/lastexpress/game/entities.h
index 731577d356..8cc2072c42 100644
--- a/engines/lastexpress/game/entities.h
+++ b/engines/lastexpress/game/entities.h
@@ -74,7 +74,7 @@ public:
void updateCallbacks();
EntityIndex canInteractWith(const Common::Point &point) const;
- bool compare(EntityIndex entity1, EntityIndex entity2);
+ bool compare(EntityIndex entity1, EntityIndex entity2) const;
/**
* Update an entity current sequence frame (and related fields)
@@ -92,15 +92,15 @@ public:
void drawSequenceRight(EntityIndex index, const char *sequence) const;
void clearSequences(EntityIndex index) const;
- bool updateEntity(EntityIndex entity, CarIndex car, EntityPosition position);
+ bool updateEntity(EntityIndex entity, CarIndex car, EntityPosition position) const;
bool hasValidFrame(EntityIndex entity) const;
// Accessors
Entity *get(EntityIndex entity);
EntityData::EntityCallData *getData(EntityIndex entity) const;
- int getPosition(CarIndex car, Position position);
- int getCompartments(int index);
- int getCompartments1(int index);
+ int getPosition(CarIndex car, Position position) const;
+ int getCompartments(int index) const;
+ int getCompartments1(int index) const;
// Scene
void loadSceneFromEntityPosition(CarIndex car, EntityPosition position, bool alternate = false) const;
diff --git a/engines/lastexpress/game/logic.cpp b/engines/lastexpress/game/logic.cpp
index 75e237df4a..3ef710a324 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 = (TimeValue)(getState()->time + ticks * getState()->timeDelta);
+ getState()->time = (TimeValue)(getState()->time + (TimeValue)(ticks * getState()->timeDelta));
if (getState()->timeDelta) {
diff --git a/engines/lastexpress/game/menu.cpp b/engines/lastexpress/game/menu.cpp
index a3604acf5a..a0d498fa1d 100644
--- a/engines/lastexpress/game/menu.cpp
+++ b/engines/lastexpress/game/menu.cpp
@@ -360,7 +360,7 @@ Menu::Menu(LastExpressEngine *engine) : _engine(engine),
_gameId(kGameBlue), _hasShownStartScreen(false), _hasShownIntro(false),
_isShowingCredits(false), _isGameStarted(false), _isShowingMenu(false),
_creditsSequenceIndex(0), _checkHotspotsTicks(15), _mouseFlags(Common::EVENT_INVALID), _lastHotspot(NULL),
- _currentIndex(0), _currentTime(0), _lowerTime(0), _index(0), _savegameIndex(0), _time(0), _delta(0), _handleTimeDelta(false) {
+ _currentTime(kTimeNone), _lowerTime(kTimeNone), _time(kTimeNone), _currentIndex(0), _index(0), _savegameIndex(0), _delta(0), _handleTimeDelta(false) {
_clock = new Clock(_engine);
_trainLine = new TrainLine(_engine);
@@ -1097,12 +1097,12 @@ void Menu::init(bool doSavegame, SavegameType type, uint32 value) {
if (!getProgress().chapter)
getProgress().chapter = kChapter1;
- getState()->time = getSaveLoad()->getTime(_index);
+ getState()->time = (TimeValue)getSaveLoad()->getTime(_index);
getProgress().chapter = getSaveLoad()->getChapter(_index);
if (_lowerTime >= kTimeStartGame) {
- _currentTime = getState()->time;
- _time = getState()->time;
+ _currentTime = (uint32)getState()->time;
+ _time = (uint32)getState()->time;
_clock->draw(_time);
_trainLine->draw(_time);
@@ -1348,7 +1348,7 @@ void Menu::adjustIndex(uint32 time1, uint32 time2, bool searchEntry) {
if ((int32)_index >= 0) {
do {
// Calculate new delta
- int32 newDelta = time1 - getSaveLoad()->getTime(currentIndex);
+ int32 newDelta = time1 - (uint32)getSaveLoad()->getTime(currentIndex);
if (newDelta >= 0 && timeDelta >= newDelta) {
timeDelta = newDelta;
@@ -1368,7 +1368,7 @@ void Menu::adjustIndex(uint32 time1, uint32 time2, bool searchEntry) {
if (_savegameIndex >= _index) {
do {
// Calculate new delta
- int32 newDelta = getSaveLoad()->getTime(currentIndex) - time1;
+ int32 newDelta = (uint32)getSaveLoad()->getTime(currentIndex) - time1;
if (newDelta >= 0 && timeDelta > newDelta) {
timeDelta = newDelta;
diff --git a/engines/lastexpress/game/menu.h b/engines/lastexpress/game/menu.h
index f6bcb05959..086e7fd5df 100644
--- a/engines/lastexpress/game/menu.h
+++ b/engines/lastexpress/game/menu.h
@@ -177,17 +177,17 @@ private:
//////////////////////////////////////////////////////////////////////////
// Time
- uint32 _currentIndex; // current savegame entry
uint32 _currentTime; // current game time
uint32 _lowerTime; // lower time value
+ uint32 _time;
+ uint32 _currentIndex; // current savegame entry
uint32 _index;
uint32 _savegameIndex;
- uint32 _time;
uint32 _delta;
bool _handleTimeDelta;
- void initTime(SavegameType type, uint32 time);
+ void initTime(SavegameType type, uint32 val);
void updateTime(uint32 time);
void adjustTime();
void adjustIndex(uint32 time1, uint32 time2, bool searchEntry);
diff --git a/engines/lastexpress/game/savegame.h b/engines/lastexpress/game/savegame.h
index e5cb940c0b..01b2542d12 100644
--- a/engines/lastexpress/game/savegame.h
+++ b/engines/lastexpress/game/savegame.h
@@ -111,7 +111,7 @@ public:
bool isGameFinished(uint32 menuIndex, uint32 savegameIndex);
// Accessors
- TimeValue getTime(uint32 index) { return getEntry(index)->time; }
+ uint32 getTime(uint32 index) { return getEntry(index)->time; }
ChapterIndex getChapter(uint32 index) { return getEntry(index)->chapter; }
uint32 getValue(uint32 index) { return getEntry(index)->value; }
uint32 getLastSavegameTicks() const { return _gameTicksLastSavegame; }
@@ -208,7 +208,7 @@ private:
struct SavegameEntryHeader : Common::Serializable {
uint32 signature;
SavegameType type;
- TimeValue time;
+ uint32 time;
int offset;
ChapterIndex chapter;
uint32 value;
diff --git a/engines/lastexpress/game/scenes.cpp b/engines/lastexpress/game/scenes.cpp
index 7a601b504b..7fd0a3f0ac 100644
--- a/engines/lastexpress/game/scenes.cpp
+++ b/engines/lastexpress/game/scenes.cpp
@@ -612,9 +612,9 @@ void SceneManager::updateDoorsAndClock() {
Sequence *sequenceMinutes = loadSequence1("SCLKM-81.seq", 255);
// Compute hours and minutes indexes
- uint16 hoursIndex = getState()->time % 1296000 % 54000 / 900;
+ uint16 hoursIndex = (uint)getState()->time % 1296000 % 54000 / 900;
- uint hours = (getState()->time % 1296000) / 54000;
+ uint hours = ((uint)getState()->time % 1296000) / 54000;
if (hours >= 12)
hours -= 12;
@@ -1077,7 +1077,7 @@ void SceneManager::postProcessScene() {
case Scene::kTypeList: {
// Adjust time
- getState()->time = (TimeValue)(getState()->time + (scene->param1 + 10) * getState()->timeDelta);
+ getState()->time = (TimeValue)(getState()->time + (TimeValue)((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/sound.cpp b/engines/lastexpress/game/sound.cpp
index 50004bc001..1bfba0ca4b 100644
--- a/engines/lastexpress/game/sound.cpp
+++ b/engines/lastexpress/game/sound.cpp
@@ -187,10 +187,10 @@ void SoundManager::clearQueue() {
for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) {
SoundEntry *entry = (*i);
+ // Delete entry
removeEntry(entry);
+ delete entry;
- // Delete entry
- SAFE_DELETE(entry);
i = _cache.reverse_erase(i);
}
@@ -530,7 +530,7 @@ void SoundManager::saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsUint32LE(entry->field_38); // field_14;
s.syncAsUint32LE(entry->entity); // entity;
- uint32 field_1C = entry->field_48 - _data2;
+ uint32 field_1C = (uint32)entry->field_48 - _data2;
if (field_1C > kFlag8)
field_1C = 0;
s.syncAsUint32LE(field_1C); // field_1C;