aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorLittleboy2012-07-15 19:24:11 -0400
committerLittleboy2012-07-16 23:51:26 -0400
commitd4f7c0232380b94b42d280c3680e473cd0c2d9b5 (patch)
tree407953c043ac975cf3b4cebec40b2c8690ef8ac3 /engines
parent96d0aedba93e4ba2691a5ee1eba24a1f07539c96 (diff)
downloadscummvm-rg350-d4f7c0232380b94b42d280c3680e473cd0c2d9b5.tar.gz
scummvm-rg350-d4f7c0232380b94b42d280c3680e473cd0c2d9b5.tar.bz2
scummvm-rg350-d4f7c0232380b94b42d280c3680e473cd0c2d9b5.zip
LASTEXPRESS: Replace PLAY_STEAM macro by function
Diffstat (limited to 'engines')
-rw-r--r--engines/lastexpress/entities/chapters.cpp40
-rw-r--r--engines/lastexpress/entities/chapters.h1
2 files changed, 21 insertions, 20 deletions
diff --git a/engines/lastexpress/entities/chapters.cpp b/engines/lastexpress/entities/chapters.cpp
index eab4dfe2c1..b4978165b9 100644
--- a/engines/lastexpress/entities/chapters.cpp
+++ b/engines/lastexpress/entities/chapters.cpp
@@ -384,12 +384,6 @@ IMPLEMENT_FUNCTION(7, Chapters, chapter1Init)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-#define PLAY_STEAM() { \
- getSoundQueue()->resetState(); \
- getSound()->playSteam((CityIndex)ENTITY_PARAM(0, 4)); \
- ENTITY_PARAM(0, 2) = 0; \
- }
-
IMPLEMENT_FUNCTION(8, Chapters, chapter1Handler)
switch (savepoint.action) {
default:
@@ -522,43 +516,43 @@ label_chapter1_next:
getSavePoints()->push(kEntityChapters, kEntityTrain, kActionTrainStopRunning);
if (getEntityData(kEntityPlayer)->location != kLocationOutsideTrain) {
- PLAY_STEAM();
+ playSteam();
break;
}
if (getEntities()->isOutsideAlexeiWindow()) {
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49);
- PLAY_STEAM();
+ playSteam();
break;
}
if (getEntities()->isOutsideAnnaWindow()) {
getScenes()->loadSceneFromPosition(kCarRedSleeping, 49);
- PLAY_STEAM();
+ playSteam();
break;
}
CarIndex car = getEntityData(kEntityPlayer)->car;
if (car < kCarRedSleeping || car > kCarCoalTender) {
if (car < kCarBaggageRear || car > kCarGreenSleeping) {
- PLAY_STEAM();
+ playSteam();
break;
}
if (getEntities()->isPlayerPosition(kCarGreenSleeping, 98)) {
getSound()->playSound(kEntityPlayer, "LIB015");
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 71);
- PLAY_STEAM();
+ playSteam();
break;
}
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 82);
- PLAY_STEAM();
+ playSteam();
break;
}
getScenes()->loadSceneFromPosition(kCarRestaurant, 82);
- PLAY_STEAM();
+ playSteam();
break;
}
@@ -1278,43 +1272,43 @@ label_callback_4:
getSavePoints()->push(kEntityChapters, kEntityTrain, kActionTrainStopRunning);
if (getEntityData(kEntityPlayer)->location != kLocationOutsideTrain) {
- PLAY_STEAM();
+ playSteam();
break;
}
if (getEntities()->isOutsideAlexeiWindow()) {
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49);
- PLAY_STEAM();
+ playSteam();
break;
}
if (getEntities()->isOutsideAnnaWindow()) {
getScenes()->loadSceneFromPosition(kCarRedSleeping, 49);
- PLAY_STEAM();
+ playSteam();
break;
}
CarIndex car = getEntityData(kEntityPlayer)->car;
if (car < kCarRedSleeping || car > kCarCoalTender) {
if (car < kCarBaggageRear || car > kCarGreenSleeping) {
- PLAY_STEAM();
+ playSteam();
break;
}
if (getEntities()->isPlayerPosition(kCarGreenSleeping, 98)) {
getSound()->playSound(kEntityPlayer, "LIB015");
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 71);
- PLAY_STEAM();
+ playSteam();
break;
}
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 82);
- PLAY_STEAM();
+ playSteam();
break;
}
getScenes()->loadSceneFromPosition(kCarRestaurant, 82);
- PLAY_STEAM();
+ playSteam();
break;
}
@@ -1816,4 +1810,10 @@ void Chapters::enterExitHelper(bool isEnteringStation) {
callbackAction();
}
+void Chapters::playSteam() {
+ getSoundQueue()->resetState();
+ getSound()->playSteam((CityIndex)ENTITY_PARAM(0, 4));
+ ENTITY_PARAM(0, 2) = 0;
+}
+
} // End of namespace LastExpress
diff --git a/engines/lastexpress/entities/chapters.h b/engines/lastexpress/entities/chapters.h
index 353d3a6b5b..62b8af9270 100644
--- a/engines/lastexpress/entities/chapters.h
+++ b/engines/lastexpress/entities/chapters.h
@@ -156,6 +156,7 @@ public:
private:
void enterExitStation(const SavePoint &savepoint, bool isEnteringStation);
void enterExitHelper(bool isEnteringStation);
+ void playSteam();
};
} // End of namespace LastExpress