aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/game
diff options
context:
space:
mode:
authorLittleboy2013-11-23 19:07:15 -0500
committerLittleboy2013-12-10 01:54:56 -0500
commit1314c5c128873804446d10edaaf2f2bb4fbe1def (patch)
treee6ee641caabd52ac0810a88ca033cb98883277b6 /engines/lastexpress/game
parentf8c45b93a3e972ab728e1e15a38ec78e05147e79 (diff)
downloadscummvm-rg350-1314c5c128873804446d10edaaf2f2bb4fbe1def.tar.gz
scummvm-rg350-1314c5c128873804446d10edaaf2f2bb4fbe1def.tar.bz2
scummvm-rg350-1314c5c128873804446d10edaaf2f2bb4fbe1def.zip
LASTEXPRESS: Rename Object properties
Diffstat (limited to 'engines/lastexpress/game')
-rw-r--r--engines/lastexpress/game/action.cpp38
-rw-r--r--engines/lastexpress/game/object.cpp24
-rw-r--r--engines/lastexpress/game/object.h28
-rw-r--r--engines/lastexpress/game/scenes.cpp12
4 files changed, 51 insertions, 51 deletions
diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp
index 19c3f45114..dcb421c979 100644
--- a/engines/lastexpress/game/action.cpp
+++ b/engines/lastexpress/game/action.cpp
@@ -521,7 +521,7 @@ IMPLEMENT_ACTION(compartment)
return kSceneNone;
}
- ObjectLocation location = getObjects()->get(compartment).location;
+ ObjectLocation location = getObjects()->get(compartment).status;
if (location == kObjectLocation1 || location == kObjectLocation3 || getEntities()->checkFields2(compartment)) {
if (location != kObjectLocation1 || getEntities()->checkFields2(compartment)
@@ -627,12 +627,12 @@ IMPLEMENT_ACTION(openCloseObject)
// Action 10
IMPLEMENT_ACTION(setModel)
ObjectIndex object = (ObjectIndex)hotspot.param1;
- ObjectLocation location = (ObjectLocation)hotspot.param2;
+ ObjectModel model = (ObjectModel)hotspot.param2;
if (object >= kObjectMax)
return kSceneInvalid;
- getObjects()->updateLocation2(object, location);
+ getObjects()->updateModel(object, model);
if (object != kObject112 || getSoundQueue()->isBuffered("LIB096")) {
if (object == 1)
@@ -808,7 +808,7 @@ IMPLEMENT_ACTION(dropItem)
//////////////////////////////////////////////////////////////////////////
// Action 16
IMPLEMENT_ACTION(enterCompartment)
- if (getObjects()->get(kObjectCompartment1).location == kObjectLocation1 || getObjects()->get(kObjectCompartment1).location == kObjectLocation3 || getInventory()->getSelectedItem() == kItemKey)
+ if (getObjects()->get(kObjectCompartment1).status == kObjectLocation1 || getObjects()->get(kObjectCompartment1).status == kObjectLocation3 || getInventory()->getSelectedItem() == kItemKey)
return action_compartment(hotspot);
if (getProgress().eventCorpseFound) {
@@ -845,9 +845,9 @@ IMPLEMENT_ACTION(enterCompartment)
IMPLEMENT_ACTION(leanOutWindow)
ObjectIndex object = (ObjectIndex)hotspot.param1;
- if ((getEvent(kEventCathLookOutsideWindowDay) || getEvent(kEventCathLookOutsideWindowNight) || getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1)
+ if ((getEvent(kEventCathLookOutsideWindowDay) || getEvent(kEventCathLookOutsideWindowNight) || getObjects()->get(kObjectCompartment1).model == kObjectModel1)
&& getProgress().isTrainRunning
- && (object != kObjectOutsideAnnaCompartment || (!getEntities()->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840) && getObjects()->get(kObjectOutsideBetweenCompartments).location == kObjectLocation2))
+ && (object != kObjectOutsideAnnaCompartment || (!getEntities()->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840) && getObjects()->get(kObjectOutsideBetweenCompartments).status == kObjectLocation2))
&& getInventory()->getSelectedItem() != kItemFirebird
&& getInventory()->getSelectedItem() != kItemBriefcase) {
@@ -1224,7 +1224,7 @@ IMPLEMENT_ACTION(exitCompartment)
getProgress().field_30 = 1;
}
- getObjects()->updateLocation2(kObjectCompartment1, (ObjectLocation)hotspot.param2);
+ getObjects()->updateModel(kObjectCompartment1, (ObjectModel)hotspot.param2);
// fall to case enterCompartment action
return action_enterCompartment(hotspot);
@@ -1724,7 +1724,7 @@ bool Action::handleOtherCompartment(ObjectIndex object, bool doPlaySound, bool d
}
void Action::playCompartmentSoundEvents(ObjectIndex object) const {
- if (getObjects()->get(object).location == kObjectLocation1 || getObjects()->get(object).location == kObjectLocation3 || getEntities()->checkFields2(object)) {
+ if (getObjects()->get(object).status == kObjectLocation1 || getObjects()->get(object).status == kObjectLocation3 || getEntities()->checkFields2(object)) {
getSound()->playSoundEvent(kEntityPlayer, 13);
} else {
getSound()->playSoundEvent(kEntityPlayer, 14);
@@ -1757,7 +1757,7 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const {
if (object >= kObjectMax)
return kCursorNormal;
else
- return (CursorStyle)getObjects()->get(object).cursor;
+ return (CursorStyle)getObjects()->get(object).windowCursor;
case SceneHotspot::kAction12:
debugC(2, kLastExpressDebugScenes, "================================= OBJECT %03d =================================", object);
@@ -1765,7 +1765,7 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const {
return kCursorNormal;
if (getObjects()->get(object).entity)
- return (CursorStyle)getObjects()->get(object).cursor;
+ return (CursorStyle)getObjects()->get(object).windowCursor;
else
return kCursorNormal;
@@ -1806,8 +1806,8 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const {
return kCursorNormal;
case SceneHotspot::kActionEnterCompartment:
- if ((getInventory()->getSelectedItem() != kItemKey || getObjects()->get(kObjectCompartment1).location)
- && (getObjects()->get(kObjectCompartment1).location != 1 || !getInventory()->hasItem(kItemKey)
+ if ((getInventory()->getSelectedItem() != kItemKey || getObjects()->get(kObjectCompartment1).status)
+ && (getObjects()->get(kObjectCompartment1).status != 1 || !getInventory()->hasItem(kItemKey)
|| (getInventory()->getSelectedItem() != kItemFirebird && getInventory()->getSelectedItem() != kItemBriefcase)))
goto LABEL_KEY;
@@ -1817,13 +1817,13 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const {
if (getProgress().jacket != kJacketGreen)
return kCursorNormal;
- if ((getEvent(kEventCathLookOutsideWindowDay) || getEvent(kEventCathLookOutsideWindowNight) || getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1)
+ if ((getEvent(kEventCathLookOutsideWindowDay) || getEvent(kEventCathLookOutsideWindowNight) || getObjects()->get(kObjectCompartment1).model == kObjectModel1)
&& getProgress().isTrainRunning
- && (object != kObjectOutsideAnnaCompartment || (getEntities()->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840) && getObjects()->get(kObjectOutsideBetweenCompartments).location == 2))
+ && (object != kObjectOutsideAnnaCompartment || (getEntities()->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840) && getObjects()->get(kObjectOutsideBetweenCompartments).status == 2))
&& getInventory()->getSelectedItem() != kItemBriefcase && getInventory()->getSelectedItem() != kItemFirebird)
return kCursorForward;
- return (getObjects()->get(kObjectCompartment1).location2 < kObjectLocation2) ? kCursorNormal : kCursorMagnifier;
+ return (getObjects()->get(kObjectCompartment1).model < kObjectModel2) ? kCursorNormal : kCursorMagnifier;
case SceneHotspot::kActionSlip:
return (getProgress().field_C8 < 1) ? kCursorNormal : kCursorLeft;
@@ -1841,7 +1841,7 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const {
if (object != kObjectCompartment1)
return kCursorNormal;
- return (getObjects()->get(kObjectCeiling).location < kObjectLocation1) ? kCursorHand : kCursorNormal;
+ return (getObjects()->get(kObjectCeiling).status < kObjectLocation1) ? kCursorHand : kCursorNormal;
case SceneHotspot::kActionUnbound:
if (hotspot.param2 != 2)
@@ -1904,11 +1904,11 @@ LABEL_KEY:
if (getInventory()->getSelectedItem() != kItemKey
|| getObjects()->get(object).entity
- || getObjects()->get(object).location != 1
- || !getObjects()->get(object).cursor2
+ || getObjects()->get(object).status != 1
+ || !getObjects()->get(object).handleCursor
|| getEntities()->isInsideCompartments(kEntityPlayer)
|| getEntities()->checkFields2(object))
- return (CursorStyle)getObjects()->get(object).cursor2;
+ return (CursorStyle)getObjects()->get(object).handleCursor;
else
return (CursorStyle)getInventory()->get(kItemKey)->cursor;
}
diff --git a/engines/lastexpress/game/object.cpp b/engines/lastexpress/game/object.cpp
index 2fcdde12b9..ad13a65199 100644
--- a/engines/lastexpress/game/object.cpp
+++ b/engines/lastexpress/game/object.cpp
@@ -32,7 +32,7 @@
namespace LastExpress {
Common::String Objects::Object::toString() {
- return Common::String::format("{ %s - %d - %d - %d - %d }", ENTITY_NAME(entity), location, cursor, cursor2, location2);
+ return Common::String::format("{ %s - %d - %d - %d - %d }", ENTITY_NAME(entity), status, windowCursor, handleCursor, model);
}
Objects::Objects(LastExpressEngine *engine) : _engine(engine) {}
@@ -44,24 +44,24 @@ const Objects::Object Objects::get(ObjectIndex index) const {
return _objects[index];
}
-void Objects::update(ObjectIndex index, EntityIndex entity, ObjectLocation location, CursorStyle cursor, CursorStyle cursor2) {
+void Objects::update(ObjectIndex index, EntityIndex entity, ObjectLocation status, CursorStyle windowCursor, CursorStyle handleCursor) {
if (index >= kObjectMax)
return;
Object *object = &_objects[index];
// Store original location
- ObjectLocation original_location = object->location;
+ ObjectLocation original_status = object->status;
// Update entity
object->entity = entity;
- object->location = location;
+ object->status = status;
- if (cursor != kCursorKeepValue || cursor2 != kCursorKeepValue) {
- if (cursor != kCursorKeepValue)
- object->cursor = cursor;
- if (cursor2 != kCursorKeepValue)
- object->cursor2 = cursor2;
+ if (windowCursor != kCursorKeepValue || handleCursor != kCursorKeepValue) {
+ if (windowCursor != kCursorKeepValue)
+ object->windowCursor = windowCursor;
+ if (handleCursor != kCursorKeepValue)
+ object->handleCursor = handleCursor;
getLogic()->updateCursor();
}
@@ -69,7 +69,7 @@ void Objects::update(ObjectIndex index, EntityIndex entity, ObjectLocation locat
getFlags()->flag_3 = true;
// Compartments
- if (original_location != location && (original_location == kObjectLocation2 || location == kObjectLocation2)) {
+ if (original_status != status && (original_status == kObjectLocation2 || status == kObjectLocation2)) {
if ((index >= kObjectCompartment1 && index <= kObjectCompartment8)
|| (index >= kObjectCompartmentA && index <= kObjectCompartmentF)) {
getScenes()->updateDoorsAndClock();
@@ -77,11 +77,11 @@ void Objects::update(ObjectIndex index, EntityIndex entity, ObjectLocation locat
}
}
-void Objects::updateLocation2(ObjectIndex index, ObjectLocation location2) {
+void Objects::updateModel(ObjectIndex index, ObjectModel model) {
if (index >= kObjectMax)
return;
- _objects[index].location2 = location2;
+ _objects[index].model = model;
}
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/lastexpress/game/object.h b/engines/lastexpress/game/object.h
index 87c9d7d407..be9d63d6c5 100644
--- a/engines/lastexpress/game/object.h
+++ b/engines/lastexpress/game/object.h
@@ -37,17 +37,17 @@ public:
struct Object : Common::Serializable { // All fields should be saved as bytes
EntityIndex entity;
- ObjectLocation location;
- CursorStyle cursor;
- CursorStyle cursor2;
- ObjectLocation location2;
+ ObjectLocation status;
+ CursorStyle windowCursor;
+ CursorStyle handleCursor;
+ ObjectModel model;
Object() {
entity = kEntityPlayer;
- location = kObjectLocationNone;
- cursor = kCursorHandKnock;
- cursor2 = kCursorHandKnock;
- location2 = kObjectLocationNone;
+ status = kObjectLocationNone;
+ windowCursor = kCursorHandKnock;
+ handleCursor = kCursorHandKnock;
+ model = kObjectModelNone;
}
Common::String toString();
@@ -55,18 +55,18 @@ public:
// Serializable
void saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsByte(entity);
- s.syncAsByte(location);
- s.syncAsByte(cursor);
- s.syncAsByte(cursor2);
- s.syncAsByte(location2);
+ s.syncAsByte(status);
+ s.syncAsByte(windowCursor);
+ s.syncAsByte(handleCursor);
+ s.syncAsByte(model);
}
};
Objects(LastExpressEngine *engine);
const Object get(ObjectIndex index) const;
- void update(ObjectIndex index, EntityIndex entity, ObjectLocation location, CursorStyle cursor, CursorStyle cursor2);
- void updateLocation2(ObjectIndex index, ObjectLocation location2);
+ void update(ObjectIndex index, EntityIndex entity, ObjectLocation status, CursorStyle cursor, CursorStyle cursor2);
+ void updateModel(ObjectIndex index, ObjectModel model);
// Serializable
void saveLoadWithSerializer(Common::Serializer &s);
diff --git a/engines/lastexpress/game/scenes.cpp b/engines/lastexpress/game/scenes.cpp
index 82688fff2e..0d8f51af6e 100644
--- a/engines/lastexpress/game/scenes.cpp
+++ b/engines/lastexpress/game/scenes.cpp
@@ -579,7 +579,7 @@ void SceneManager::updateDoorsAndClock() {
for (ObjectIndex index = firstIndex; index < (ObjectIndex)(firstIndex + 8); index = (ObjectIndex)(index + 1)) {
// Doors is not open, nothing to do
- if (getObjects()->get(index).location != kObjectLocation2)
+ if (getObjects()->get(index).status != kObjectLocation2)
continue;
// Load door sequence
@@ -842,11 +842,11 @@ void SceneManager::preProcessScene(SceneIndex *index) {
if (object >= kObjectMax)
break;
- if (getObjects()->get(object).location == kObjectLocationNone)
+ if (getObjects()->get(object).status == kObjectLocationNone)
break;
for (Common::Array<SceneHotspot *>::iterator it = scene->getHotspots()->begin(); it != scene->getHotspots()->end(); ++it) {
- if (getObjects()->get(object).location != (*it)->location)
+ if (getObjects()->get(object).status != (*it)->location)
continue;
PROCESS_HOTSPOT_SCENE(*it, index);
@@ -920,7 +920,7 @@ void SceneManager::preProcessScene(SceneIndex *index) {
int location = kObjectLocationNone;
- if (getObjects()->get(object).location == kObjectLocation2)
+ if (getObjects()->get(object).status == kObjectLocation2)
location = kObjectLocation1;
if (getInventory()->get(item)->location != kObjectLocationNone)
@@ -933,7 +933,7 @@ void SceneManager::preProcessScene(SceneIndex *index) {
if (location != (*it)->location)
continue;
- if (getObjects()->get(object).location != (*it)->param1)
+ if (getObjects()->get(object).status != (*it)->param1)
continue;
if (getInventory()->get(item)->location != (*it)->param2)
@@ -994,7 +994,7 @@ void SceneManager::preProcessScene(SceneIndex *index) {
bool found = false;
for (Common::Array<SceneHotspot *>::iterator it = scene->getHotspots()->begin(); it != scene->getHotspots()->end(); ++it) {
- if (getObjects()->get(object).location2 != (*it)->location)
+ if (getObjects()->get(object).model != (*it)->location)
continue;
PROCESS_HOTSPOT_SCENE(*it, index);