[Scummvm-cvs-logs] SF.net SVN: scummvm:[53880] scummvm/trunk/engines/lastexpress

littleboy at users.sourceforge.net littleboy at users.sourceforge.net
Wed Oct 27 21:19:22 CEST 2010


Revision: 53880
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53880&view=rev
Author:   littleboy
Date:     2010-10-27 19:19:22 +0000 (Wed, 27 Oct 2010)

Log Message:
-----------
LASTEXPRESS: Add some missing casts and const qualifiers

Modified Paths:
--------------
    scummvm/trunk/engines/lastexpress/debug.cpp
    scummvm/trunk/engines/lastexpress/entities/abbot.cpp
    scummvm/trunk/engines/lastexpress/entities/alexei.cpp
    scummvm/trunk/engines/lastexpress/entities/alouan.cpp
    scummvm/trunk/engines/lastexpress/entities/anna.cpp
    scummvm/trunk/engines/lastexpress/entities/august.cpp
    scummvm/trunk/engines/lastexpress/entities/boutarel.cpp
    scummvm/trunk/engines/lastexpress/entities/coudert.cpp
    scummvm/trunk/engines/lastexpress/entities/entity_intern.h
    scummvm/trunk/engines/lastexpress/entities/francois.cpp
    scummvm/trunk/engines/lastexpress/entities/hadija.cpp
    scummvm/trunk/engines/lastexpress/entities/kahina.cpp
    scummvm/trunk/engines/lastexpress/entities/kronos.cpp
    scummvm/trunk/engines/lastexpress/entities/max.cpp
    scummvm/trunk/engines/lastexpress/entities/mertens.cpp
    scummvm/trunk/engines/lastexpress/entities/milos.cpp
    scummvm/trunk/engines/lastexpress/entities/mmeboutarel.cpp
    scummvm/trunk/engines/lastexpress/entities/pascale.cpp
    scummvm/trunk/engines/lastexpress/entities/rebecca.cpp
    scummvm/trunk/engines/lastexpress/entities/tatiana.cpp
    scummvm/trunk/engines/lastexpress/entities/train.cpp
    scummvm/trunk/engines/lastexpress/entities/vassili.cpp
    scummvm/trunk/engines/lastexpress/entities/verges.cpp
    scummvm/trunk/engines/lastexpress/entities/vesna.cpp
    scummvm/trunk/engines/lastexpress/game/action.cpp
    scummvm/trunk/engines/lastexpress/game/entities.cpp
    scummvm/trunk/engines/lastexpress/game/entities.h
    scummvm/trunk/engines/lastexpress/game/logic.cpp
    scummvm/trunk/engines/lastexpress/game/menu.cpp
    scummvm/trunk/engines/lastexpress/game/menu.h
    scummvm/trunk/engines/lastexpress/game/savegame.h
    scummvm/trunk/engines/lastexpress/game/scenes.cpp
    scummvm/trunk/engines/lastexpress/game/sound.cpp

Modified: scummvm/trunk/engines/lastexpress/debug.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/debug.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/debug.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -103,6 +103,9 @@
 	delete _soundStream;
 	resetCommand();
 
+	_command = NULL;
+	_commandParams = NULL;
+
 	// Zero passed pointers
 	_engine = NULL;
 }
@@ -116,9 +119,11 @@
 
 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;
 	_numParams = 0;
@@ -129,7 +134,7 @@
 }
 
 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 @@
  *
  * @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 @@
 			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 @@
  */
 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 @@
 		// 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 {

Modified: scummvm/trunk/engines/lastexpress/entities/abbot.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/abbot.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/abbot.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -850,7 +850,7 @@
 				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 @@
 		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 @@
 		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 @@
 
 		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 @@
 
 	case kActionDefault:
 		getEntities()->drawSequenceLeft(kEntityAbbot, "115B");
-		params->param1 = getState()->time + 9000;
+		params->param1 = (uint)getState()->time + 9000;
 		break;
 
 	case kActionCallback:
@@ -1152,7 +1152,7 @@
 			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 @@
 		break;
 
 	case kActionDefault:
-		params->param1 = getState()->time + 4500;
+		params->param1 = (uint)getState()->time + 4500;
 		getEntities()->drawSequenceLeft(kEntityAbbot, "121B");
 		break;
 
@@ -1413,7 +1413,7 @@
 				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;

Modified: scummvm/trunk/engines/lastexpress/entities/alexei.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/alexei.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/alexei.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -771,7 +771,7 @@
 			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 @@
 			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 @@
 	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 @@
 		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;

Modified: scummvm/trunk/engines/lastexpress/entities/alouan.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/alouan.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/alouan.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -209,7 +209,7 @@
 
 		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;

Modified: scummvm/trunk/engines/lastexpress/entities/anna.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/anna.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/anna.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -1085,7 +1085,7 @@
 		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 @@
 				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 @@
 			}
 
 			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 @@
 	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 @@
 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 @@
 			 && !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 @@
 
 		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 @@
 		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:

Modified: scummvm/trunk/engines/lastexpress/entities/august.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/august.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/august.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -1431,7 +1431,7 @@
 
 			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 @@
 
 		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 @@
 		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 @@
 
 	case kActionNone:
 		if (!params->param1)
-			params->param1 = getState()->time + 1800;
+			params->param1 = (uint)getState()->time + 1800;
 
 		if (params->param1 >= getState()->time)
 			break;

Modified: scummvm/trunk/engines/lastexpress/entities/boutarel.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/boutarel.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/boutarel.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -949,7 +949,7 @@
 
 			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;

Modified: scummvm/trunk/engines/lastexpress/entities/coudert.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/coudert.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/coudert.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -3539,7 +3539,7 @@
 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)

Modified: scummvm/trunk/engines/lastexpress/entities/entity_intern.h
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/entity_intern.h	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/entity_intern.h	2010-10-27 19:19:22 UTC (rev 53880)
@@ -400,7 +400,7 @@
 
 #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 @@
 //////////////////////////////////////////////////////////////////////////
 #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 @@
 // 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 @@
 // 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 @@
 #define UPDATE_PARAM_CHECK(parameter, type, value) \
 	if (!parameter || parameter < type) { \
 		if (!parameter) \
-			parameter = type + value;
+			parameter = (uint)(type + value);
 
 //////////////////////////////////////////////////////////////////////////
 // Compartments

Modified: scummvm/trunk/engines/lastexpress/entities/francois.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/francois.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/francois.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -1119,7 +1119,7 @@
 			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;

Modified: scummvm/trunk/engines/lastexpress/entities/hadija.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/hadija.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/hadija.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -146,7 +146,7 @@
 			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 @@
 			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 @@
 		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);

Modified: scummvm/trunk/engines/lastexpress/entities/kahina.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/kahina.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/kahina.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -336,7 +336,7 @@
 
 		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 @@
 
 		getObjects()->update(kObjectCompartmentKronos, kEntityPlayer, kObjectLocation1, kCursorHandKnock, kCursorHand);
 
-		params->param1 = getState()->time + 1800;
+		params->param1 = (uint)getState()->time + 1800;
 		break;
 	}
 }
@@ -479,7 +479,7 @@
 
 		case 8:
 			getEntities()->clearSequences(kEntityKahina);
-			params->param1 = getState()->time + 4500;
+			params->param1 = (uint)getState()->time + 4500;
 			break;
 
 		case 9:
@@ -926,7 +926,7 @@
 	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 @@
 		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 @@
 
 		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 @@
 				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;
 			}

Modified: scummvm/trunk/engines/lastexpress/entities/kronos.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/kronos.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/kronos.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -305,7 +305,7 @@
 		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 @@
 		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) {

Modified: scummvm/trunk/engines/lastexpress/entities/max.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/max.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/max.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -283,7 +283,7 @@
 		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 @@
 		getEntities()->drawSequenceLeft(kEntityMax, "630Af");
 		getEntities()->enterCompartment(kEntityMax, kObjectCompartmentF, true);
 
-		params->param1 = getState()->time + 2700;
+		params->param1 = (uint)(getState()->time + 2700);
 		break;
 	}
 }

Modified: scummvm/trunk/engines/lastexpress/entities/mertens.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/mertens.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/mertens.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -3024,7 +3024,7 @@
 					  || 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 @@
 		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 @@
 
 		getObjects()->update(kObjectCompartmentD, kEntityPlayer, kObjectLocation3, kCursorHandKnock, kCursorHand);
 
-		params->param1 = getState()->time + 4500;
+		params->param1 = (uint)(getState()->time + 4500);
 		break;
 
 	case kActionCallback:

Modified: scummvm/trunk/engines/lastexpress/entities/milos.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/milos.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/milos.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -210,12 +210,12 @@
 		}
 
 		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 @@
 
 	case kActionNone:
 		if (!params->param4)
-			params->param4 = getState()->time + 4500;
+			params->param4 = (uint)getState()->time + 4500;
 
 		if (params->param4 < getState()->time) {
 			params->param4 = kTimeInvalid;

Modified: scummvm/trunk/engines/lastexpress/entities/mmeboutarel.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/mmeboutarel.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/mmeboutarel.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -275,7 +275,7 @@
 
 		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 @@
 		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 @@
 		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 @@
 				 || getSound()->isBuffered("FRA2012")
 				 || getSound()->isBuffered("FRA2010")
 				 ||!params->param2)
-					params->param2 = getState()->time;
+					params->param2 = (uint)getState()->time;
 
 				if (params->param2 >= getState()->time)
 					break;

Modified: scummvm/trunk/engines/lastexpress/entities/pascale.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/pascale.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/pascale.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -816,7 +816,7 @@
 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 @@
 					}
 
 					if (!getEntities()->isInRestaurant(kEntityPlayer) || !params->param5)
-						params->param5 = getState()->time;
+						params->param5 = (uint)getState()->time;
 
 					if (params->param5 < getState()->time) {
 						params->param5 = kTimeInvalid;

Modified: scummvm/trunk/engines/lastexpress/entities/rebecca.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/rebecca.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/rebecca.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -515,7 +515,7 @@
 			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 @@
 		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 @@
 			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 @@
 		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 @@
 
 			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 @@
 
 			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 @@
 		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 @@
 
 	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 @@
 			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 @@
 		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 @@
 		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;

Modified: scummvm/trunk/engines/lastexpress/entities/tatiana.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/tatiana.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/tatiana.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -593,7 +593,7 @@
 		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 @@
 	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 @@
 			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;

Modified: scummvm/trunk/engines/lastexpress/entities/train.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/train.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/train.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -290,7 +290,7 @@
 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;

Modified: scummvm/trunk/engines/lastexpress/entities/vassili.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/vassili.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/vassili.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -110,7 +110,7 @@
 			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 @@
 
 				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 @@
 
 			 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;

Modified: scummvm/trunk/engines/lastexpress/entities/verges.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/verges.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/verges.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -1098,7 +1098,7 @@
 		}
 
 		if (!getEntities()->isPlayerInCar(kCarRedSleeping) || !params->param2) {
-			params->param2 = getState()->time;
+			params->param2 = (uint)getState()->time;
 
 			if (!params->param2) {
 				setCallback(3);

Modified: scummvm/trunk/engines/lastexpress/entities/vesna.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/entities/vesna.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/entities/vesna.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -505,7 +505,7 @@
 			}
 
 			if (!getEntities()->isPlayerInCar(kCarRedSleeping) || !parameters->param7)
-				parameters->param7 = getState()->time;
+				parameters->param7 = (uint)getState()->time;
 
 			if (parameters->param7 < getState()->time) {
 				parameters->param7 = kTimeInvalid;

Modified: scummvm/trunk/engines/lastexpress/game/action.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/game/action.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/game/action.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -1960,7 +1960,7 @@
 
 	// 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

Modified: scummvm/trunk/engines/lastexpress/game/entities.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/game/entities.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/game/entities.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -215,7 +215,7 @@
 	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 @@
 	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 @@
 	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 @@
 	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;

Modified: scummvm/trunk/engines/lastexpress/game/entities.h
===================================================================
--- scummvm/trunk/engines/lastexpress/game/entities.h	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/game/entities.h	2010-10-27 19:19:22 UTC (rev 53880)
@@ -74,7 +74,7 @@
 	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 @@
 	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;

Modified: scummvm/trunk/engines/lastexpress/game/logic.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/game/logic.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/game/logic.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -316,7 +316,7 @@
 	// 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) {
 

Modified: scummvm/trunk/engines/lastexpress/game/menu.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/game/menu.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/game/menu.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -360,7 +360,7 @@
 	_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 @@
 	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 @@
 				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 @@
 				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;

Modified: scummvm/trunk/engines/lastexpress/game/menu.h
===================================================================
--- scummvm/trunk/engines/lastexpress/game/menu.h	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/game/menu.h	2010-10-27 19:19:22 UTC (rev 53880)
@@ -177,17 +177,17 @@
 
 	//////////////////////////////////////////////////////////////////////////
 	// 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);

Modified: scummvm/trunk/engines/lastexpress/game/savegame.h
===================================================================
--- scummvm/trunk/engines/lastexpress/game/savegame.h	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/game/savegame.h	2010-10-27 19:19:22 UTC (rev 53880)
@@ -111,7 +111,7 @@
 	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 @@
 	struct SavegameEntryHeader : Common::Serializable {
 		uint32 signature;
 		SavegameType type;
-		TimeValue time;
+		uint32 time;
 		int offset;
 		ChapterIndex chapter;
 		uint32 value;

Modified: scummvm/trunk/engines/lastexpress/game/scenes.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/game/scenes.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/game/scenes.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -612,9 +612,9 @@
 		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 @@
 	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

Modified: scummvm/trunk/engines/lastexpress/game/sound.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/game/sound.cpp	2010-10-27 17:34:16 UTC (rev 53879)
+++ scummvm/trunk/engines/lastexpress/game/sound.cpp	2010-10-27 19:19:22 UTC (rev 53880)
@@ -187,10 +187,10 @@
 	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 @@
 				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;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list