aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress
diff options
context:
space:
mode:
Diffstat (limited to 'engines/lastexpress')
-rw-r--r--engines/lastexpress/data/archive.cpp6
-rw-r--r--engines/lastexpress/data/archive.h6
-rw-r--r--engines/lastexpress/data/scene.h4
-rw-r--r--engines/lastexpress/detection.cpp18
-rw-r--r--engines/lastexpress/entities/abbot.cpp2
-rw-r--r--engines/lastexpress/entities/alexei.cpp2
-rw-r--r--engines/lastexpress/entities/august.cpp2
-rw-r--r--engines/lastexpress/entities/entity_intern.h4
-rw-r--r--engines/lastexpress/entities/francois.cpp2
-rw-r--r--engines/lastexpress/entities/mertens.cpp2
-rw-r--r--engines/lastexpress/game/action.cpp2
-rw-r--r--engines/lastexpress/game/entities.cpp27
-rw-r--r--engines/lastexpress/game/savegame.cpp4
-rw-r--r--engines/lastexpress/resource.cpp10
-rw-r--r--engines/lastexpress/resource.h6
15 files changed, 46 insertions, 51 deletions
diff --git a/engines/lastexpress/data/archive.cpp b/engines/lastexpress/data/archive.cpp
index 3aa5584ca4..908d58254a 100644
--- a/engines/lastexpress/data/archive.cpp
+++ b/engines/lastexpress/data/archive.cpp
@@ -74,11 +74,11 @@ HPFArchive::HPFArchive(const Common::String &path) {
delete archive;
}
-bool HPFArchive::hasFile(const Common::String &name) {
+bool HPFArchive::hasFile(const Common::String &name) const {
return (_files.find(name) != _files.end());
}
-int HPFArchive::listMembers(Common::ArchiveMemberList &list) {
+int HPFArchive::listMembers(Common::ArchiveMemberList &list) const {
int numMembers = 0;
for (FileMap::const_iterator i = _files.begin(); i != _files.end(); ++i) {
@@ -89,7 +89,7 @@ int HPFArchive::listMembers(Common::ArchiveMemberList &list) {
return numMembers;
}
-Common::ArchiveMemberPtr HPFArchive::getMember(const Common::String &name) {
+const Common::ArchiveMemberPtr HPFArchive::getMember(const Common::String &name) const {
if (!hasFile(name))
return Common::ArchiveMemberPtr();
diff --git a/engines/lastexpress/data/archive.h b/engines/lastexpress/data/archive.h
index 8e0c46f183..011c830668 100644
--- a/engines/lastexpress/data/archive.h
+++ b/engines/lastexpress/data/archive.h
@@ -46,9 +46,9 @@ class HPFArchive : public Common::Archive {
public:
HPFArchive(const Common::String &path);
- bool hasFile(const Common::String &name);
- int listMembers(Common::ArchiveMemberList &list);
- Common::ArchiveMemberPtr getMember(const Common::String &name);
+ bool hasFile(const Common::String &name) const;
+ int listMembers(Common::ArchiveMemberList &list) const;
+ const Common::ArchiveMemberPtr getMember(const Common::String &name) const;
Common::SeekableReadStream *createReadStreamForMember(const Common::String &name) const;
int count() { return _files.size(); }
diff --git a/engines/lastexpress/data/scene.h b/engines/lastexpress/data/scene.h
index 0c0d12b9c0..69a1417459 100644
--- a/engines/lastexpress/data/scene.h
+++ b/engines/lastexpress/data/scene.h
@@ -76,10 +76,6 @@ class SeekableReadStream;
class String;
}
-namespace Graphics {
-struct Surface;
-}
-
namespace LastExpress {
class Scene;
diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp
index e2133c0929..82a6520522 100644
--- a/engines/lastexpress/detection.cpp
+++ b/engines/lastexpress/detection.cpp
@@ -48,7 +48,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformUnknown,
ADGF_UNSTABLE,
- GUIO1(GUIO_NONE)
+ GUIO1(GUIO_NOASPECT)
},
// The Last Express (English) - UK Broderbund Release
@@ -66,7 +66,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformUnknown,
ADGF_UNSTABLE,
- GUIO1(GUIO_NONE)
+ GUIO1(GUIO_NOASPECT)
},
// The Last Express (English) - Interplay Release
@@ -84,7 +84,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformUnknown,
ADGF_UNSTABLE,
- GUIO1(GUIO_NONE)
+ GUIO1(GUIO_NOASPECT)
},
// The Last Express (Demo - English) - Broderbund
@@ -99,7 +99,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformUnknown,
ADGF_DEMO | ADGF_UNSTABLE,
- GUIO1(GUIO_NONE)
+ GUIO1(GUIO_NOASPECT)
},
// The Last Express (French) - Broderbund Release
@@ -117,7 +117,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformUnknown,
ADGF_UNSTABLE,
- GUIO1(GUIO_NONE)
+ GUIO1(GUIO_NOASPECT)
},
// The Last Express (German)
@@ -135,7 +135,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformUnknown,
ADGF_UNSTABLE,
- GUIO1(GUIO_NONE)
+ GUIO1(GUIO_NOASPECT)
},
// The Last Express (Spanish)
@@ -153,7 +153,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformUnknown,
ADGF_UNSTABLE,
- GUIO1(GUIO_NONE)
+ GUIO1(GUIO_NOASPECT)
},
// The Last Express (Italian)
@@ -171,7 +171,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::IT_ITA,
Common::kPlatformUnknown,
ADGF_UNSTABLE,
- GUIO1(GUIO_NONE)
+ GUIO1(GUIO_NOASPECT)
},
// The Last Express (Russian)
@@ -189,7 +189,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::RU_RUS,
Common::kPlatformUnknown,
ADGF_UNSTABLE,
- GUIO1(GUIO_NONE)
+ GUIO1(GUIO_NOASPECT)
},
AD_TABLE_END_MARKER
diff --git a/engines/lastexpress/entities/abbot.cpp b/engines/lastexpress/entities/abbot.cpp
index c5c6f2a44d..301c52e142 100644
--- a/engines/lastexpress/entities/abbot.cpp
+++ b/engines/lastexpress/entities/abbot.cpp
@@ -841,7 +841,7 @@ IMPLEMENT_FUNCTION(31, Abbot, function31)
case kActionNone:
if (params->param4 != kTimeInvalid && params->param2 < getState()->time) {
- if (getState()->time < getState()->time) {
+ if (params->param3 < getState()->time) {
params->param4 = kTimeInvalid;
setCallback(1);
diff --git a/engines/lastexpress/entities/alexei.cpp b/engines/lastexpress/entities/alexei.cpp
index 073ca3f175..54c2d87b89 100644
--- a/engines/lastexpress/entities/alexei.cpp
+++ b/engines/lastexpress/entities/alexei.cpp
@@ -355,7 +355,7 @@ IMPLEMENT_FUNCTION_IS(16, Alexei, function16, TimeValue)
break;
case kActionDefault:
- getEntities()->drawSequenceLeft(kEntityAlexei, (char*)&params->seq);
+ getEntities()->drawSequenceLeft(kEntityAlexei, (char *)&params->seq);
getObjects()->update(kObjectCompartment2, kEntityAlexei, kObjectLocation1, kCursorHandKnock, kCursorHand);
getObjects()->update(kObjectHandleInsideBathroom, kEntityAlexei, kObjectLocation1, kCursorHandKnock, kCursorHand);
break;
diff --git a/engines/lastexpress/entities/august.cpp b/engines/lastexpress/entities/august.cpp
index eb3b09af59..cfde8a2d6f 100644
--- a/engines/lastexpress/entities/august.cpp
+++ b/engines/lastexpress/entities/august.cpp
@@ -2118,7 +2118,7 @@ IMPLEMENT_FUNCTION_II(41, August, function41, CarIndex, EntityPosition)
&& getEntities()->isDistanceBetweenEntities(kEntityAugust, kEntityPlayer, 1000)
&& !getEntities()->isInsideCompartments(kEntityPlayer)
&& !getEntities()->checkFields10(kEntityPlayer)) {
- if (getData()->car == kCarGreenSleeping || getData()->car == kCarGreenSleeping) {
+ if (getData()->car == kCarGreenSleeping || getData()->car == kCarRedSleeping) {
getAction()->playAnimation(kEventAugustMerchandise);
getEntities()->loadSceneFromEntityPosition(getData()->car, (EntityPosition)(getData()->entityPosition + (750 * (getData()->direction == kDirectionUp ? -1 : 1))), getData()->direction == kDirectionUp);
diff --git a/engines/lastexpress/entities/entity_intern.h b/engines/lastexpress/entities/entity_intern.h
index bf75e022de..2da0da15b3 100644
--- a/engines/lastexpress/entities/entity_intern.h
+++ b/engines/lastexpress/entities/entity_intern.h
@@ -94,7 +94,7 @@ void class::setup_##name() { \
// Expose parameters and check validity
#define EXPOSE_PARAMS(type) \
- type *params = (type*)_data->getCurrentParameters(); \
+ type *params = (type *)_data->getCurrentParameters(); \
if (!params) \
error("[EXPOSE_PARAMS] Trying to call an entity function with invalid parameters"); \
@@ -307,7 +307,7 @@ void class::setup_##name() { \
//////////////////////////////////////////////////////////////////////////
#define RESET_ENTITY_STATE(entity, class, function) \
getEntities()->resetState(entity); \
- ((class*)getEntities()->get(entity))->function();
+ ((class *)getEntities()->get(entity))->function();
//////////////////////////////////////////////////////////////////////////
// Parameters macros (for default IIII parameters)
diff --git a/engines/lastexpress/entities/francois.cpp b/engines/lastexpress/entities/francois.cpp
index 2b170d93a3..46cd790ffb 100644
--- a/engines/lastexpress/entities/francois.cpp
+++ b/engines/lastexpress/entities/francois.cpp
@@ -450,7 +450,7 @@ label_callback:
if (isNight())
getAction()->playAnimation(getData()->entityPosition <= getEntityData(kEntityPlayer)->entityPosition ? kEventFrancoisWhistleNightD : kEventFrancoisWhistleNight);
else
- getAction()->playAnimation(getData()->entityPosition <= getEntityData(kEntityPlayer)->entityPosition ? kEventFrancoisWhistleD : kEventFrancoisWhistleD);
+ getAction()->playAnimation(getData()->entityPosition <= getEntityData(kEntityPlayer)->entityPosition ? kEventFrancoisWhistleD : kEventFrancoisWhistle);
}
getEntities()->loadSceneFromEntityPosition(getData()->car, (EntityPosition)(getData()->entityPosition + 750 * (getData()->direction == kDirectionUp ? -1 : 1)), getData()->direction == kDirectionUp);
break;
diff --git a/engines/lastexpress/entities/mertens.cpp b/engines/lastexpress/entities/mertens.cpp
index e222af4805..d88962fce2 100644
--- a/engines/lastexpress/entities/mertens.cpp
+++ b/engines/lastexpress/entities/mertens.cpp
@@ -390,7 +390,7 @@ IMPLEMENT_FUNCTION_II(10, Mertens, updateEntity, CarIndex, EntityPosition)
break;
case kActionDefault:
- if ((!getProgress().eventCorpseFound && !getEvent(kEventMertensAskTylerCompartment) && !getEvent(kEventMertensAskTylerCompartment))
+ if ((!getProgress().eventCorpseFound && !getEvent(kEventMertensAskTylerCompartment) && !getEvent(kEventMertensAskTylerCompartmentD))
|| (ENTITY_PARAM(0, 4) && getProgress().jacket == kJacketGreen && !getEvent(kEventMertensDontMakeBed) && !getProgress().eventCorpseThrown))
params->param3 = 1;
diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp
index 2ef4c20d70..98d74dd1a7 100644
--- a/engines/lastexpress/game/action.cpp
+++ b/engines/lastexpress/game/action.cpp
@@ -1806,7 +1806,7 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const {
if (getProgress().jacket != kJacketGreen)
return kCursorNormal;
- if ((getEvent(kEventCathLookOutsideWindowDay) || getEvent(kEventCathLookOutsideWindowDay) || getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1)
+ if ((getEvent(kEventCathLookOutsideWindowDay) || getEvent(kEventCathLookOutsideWindowNight) || getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1)
&& getProgress().isTrainRunning
&& (object != kObjectOutsideAnnaCompartment || (getEntities()->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840) && getObjects()->get(kObjectOutsideBetweenCompartments).location == 2))
&& getInventory()->getSelectedItem() != kItemBriefcase && getInventory()->getSelectedItem() != kItemFirebird)
diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp
index 1b31339b7b..f27087a609 100644
--- a/engines/lastexpress/game/entities.cpp
+++ b/engines/lastexpress/game/entities.cpp
@@ -87,16 +87,15 @@ static const EntityPosition objectsPosition[8] = {kPosition_8200, kPosition_7500
kPosition_4840, kPosition_4070,
kPosition_3050, kPosition_2740};
-static const EntityPosition entityPositions[41] = {
- kPositionNone, kPosition_851, kPosition_1430, kPosition_2110, kPositionNone,
- kPosition_2410, kPosition_2980, kPosition_3450, kPosition_3760, kPosition_4100,
- kPosition_4680, kPosition_5140, kPosition_5440, kPosition_5810, kPosition_6410,
- kPosition_6850, kPosition_7160, kPosition_7510, kPosition_8514, kPositionNone,
- kPositionNone, kPositionNone, kPosition_2086, kPosition_2690, kPositionNone,
- kPosition_3110, kPosition_3390, kPosition_3890, kPosition_4460, kPosition_4770,
- kPosition_5090, kPosition_5610, kPosition_6160, kPosition_6460, kPosition_6800,
- kPosition_7320, kPosition_7870, kPosition_8160, kPosition_8500, kPosition_9020,
- kPosition_9269};
+static const EntityPosition entityPositions[41] = {kPositionNone, kPosition_851, kPosition_1430, kPosition_2110, kPositionNone,
+ kPosition_2410, kPosition_2980, kPosition_3450, kPosition_3760, kPosition_4100,
+ kPosition_4680, kPosition_5140, kPosition_5440, kPosition_5810, kPosition_6410,
+ kPosition_6850, kPosition_7160, kPosition_7510, kPosition_8514, kPositionNone,
+ kPositionNone, kPositionNone, kPosition_2086, kPosition_2690, kPositionNone,
+ kPosition_3110, kPosition_3390, kPosition_3890, kPosition_4460, kPosition_4770,
+ kPosition_5090, kPosition_5610, kPosition_6160, kPosition_6460, kPosition_6800,
+ kPosition_7320, kPosition_7870, kPosition_8160, kPosition_8500, kPosition_9020,
+ kPosition_9269};
#define ADD_ENTITY(class) \
_entities.push_back(new class(engine));
@@ -105,7 +104,7 @@ static const EntityPosition entityPositions[41] = {
sequenceTo = sequenceFrom; \
for (int seqIdx = 0; seqIdx < 7; seqIdx++) \
sequenceTo.deleteLastChar(); \
- if (isInsideTrainCar(entityIndex, kCarGreenSleeping) || isInsideTrainCar(entityIndex, kCarGreenSleeping)) { \
+ if (isInsideTrainCar(entityIndex, kCarGreenSleeping) || isInsideTrainCar(entityIndex, kCarRedSleeping)) { \
if (data->car < getData(kEntityPlayer)->car || (data->car == getData(kEntityPlayer)->car && data->entityPosition < getData(kEntityPlayer)->entityPosition)) \
sequenceTo += "R.SEQ"; \
else \
@@ -616,9 +615,9 @@ void Entities::resetSequences(EntityIndex entityIndex) const {
getData(entityIndex)->field_4A9 = false;
getData(entityIndex)->field_4AA = false;
- strcpy((char*)&getData(entityIndex)->sequenceNameCopy, "");
- strcpy((char*)&getData(entityIndex)->sequenceName, "");
- strcpy((char*)&getData(entityIndex)->sequenceName2, "");
+ strcpy((char *)&getData(entityIndex)->sequenceNameCopy, "");
+ strcpy((char *)&getData(entityIndex)->sequenceName, "");
+ strcpy((char *)&getData(entityIndex)->sequenceName2, "");
getScenes()->resetQueue();
}
diff --git a/engines/lastexpress/game/savegame.cpp b/engines/lastexpress/game/savegame.cpp
index 57c18b5697..9c464feb6e 100644
--- a/engines/lastexpress/game/savegame.cpp
+++ b/engines/lastexpress/game/savegame.cpp
@@ -154,11 +154,11 @@ void SaveLoad::loadStream(GameId id) {
error("[SaveLoad::loadStream] Savegame stream is invalid");
// Load all savegame data
- uint8* buf = new uint8[8192];
+ uint8 *buf = new uint8[8192];
while (!save->eos() && !save->err()) {
_engine->pollEvents();
- uint32 count = save->read(buf, sizeof(buf));
+ uint32 count = save->read(buf, 8192);
if (count) {
uint32 w = _savegame->write(buf, count);
assert (w == count);
diff --git a/engines/lastexpress/resource.cpp b/engines/lastexpress/resource.cpp
index 3910aaa010..ee4885e34e 100644
--- a/engines/lastexpress/resource.cpp
+++ b/engines/lastexpress/resource.cpp
@@ -148,8 +148,8 @@ Common::SeekableReadStream *ResourceManager::getFileStream(const Common::String
//////////////////////////////////////////////////////////////////////////
// Archive functions
//////////////////////////////////////////////////////////////////////////
-bool ResourceManager::hasFile(const Common::String &name) {
- for (Common::Array<HPFArchive *>::iterator it = _archives.begin(); it != _archives.end(); ++it) {
+bool ResourceManager::hasFile(const Common::String &name) const {
+ for (Common::Array<HPFArchive *>::const_iterator it = _archives.begin(); it != _archives.end(); ++it) {
if ((*it)->hasFile(name))
return true;
}
@@ -157,10 +157,10 @@ bool ResourceManager::hasFile(const Common::String &name) {
return false;
}
-int ResourceManager::listMembers(Common::ArchiveMemberList &list) {
+int ResourceManager::listMembers(Common::ArchiveMemberList &list) const {
int count = 0;
- for (Common::Array<HPFArchive *>::iterator it = _archives.begin(); it != _archives.end(); ++it) {
+ for (Common::Array<HPFArchive *>::const_iterator it = _archives.begin(); it != _archives.end(); ++it) {
Common::ArchiveMemberList members;
count += (*it)->listMembers(members);
@@ -171,7 +171,7 @@ int ResourceManager::listMembers(Common::ArchiveMemberList &list) {
return count;
}
-Common::ArchiveMemberPtr ResourceManager::getMember(const Common::String &name) {
+const Common::ArchiveMemberPtr ResourceManager::getMember(const Common::String &name) const {
if (!hasFile(name))
return Common::ArchiveMemberPtr();
diff --git a/engines/lastexpress/resource.h b/engines/lastexpress/resource.h
index 9e05a90399..f2f5d63bce 100644
--- a/engines/lastexpress/resource.h
+++ b/engines/lastexpress/resource.h
@@ -45,9 +45,9 @@ public:
Common::SeekableReadStream *getFileStream(const Common::String &name);
// Archive functions
- bool hasFile(const Common::String &name);
- int listMembers(Common::ArchiveMemberList &list);
- Common::ArchiveMemberPtr getMember(const Common::String &name);
+ bool hasFile(const Common::String &name) const;
+ int listMembers(Common::ArchiveMemberList &list) const;
+ const Common::ArchiveMemberPtr getMember(const Common::String &name) const;
Common::SeekableReadStream *createReadStreamForMember(const Common::String &name) const;
// Resource loading