aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/entities
diff options
context:
space:
mode:
authorLittleboy2012-08-21 23:00:29 -0400
committerLittleboy2012-08-27 21:49:38 -0400
commit2c0033c7bad5b15c9bcccbce804e244a17a7f891 (patch)
treee61114b12c7e9512b7153360d9d68798bbfedd36 /engines/lastexpress/entities
parentab4c47c584b0451a30bc5239a66cc8649aa66682 (diff)
downloadscummvm-rg350-2c0033c7bad5b15c9bcccbce804e244a17a7f891.tar.gz
scummvm-rg350-2c0033c7bad5b15c9bcccbce804e244a17a7f891.tar.bz2
scummvm-rg350-2c0033c7bad5b15c9bcccbce804e244a17a7f891.zip
LASTEXPRESS: Add const modifiers
Diffstat (limited to 'engines/lastexpress/entities')
-rw-r--r--engines/lastexpress/entities/chapters.cpp2
-rw-r--r--engines/lastexpress/entities/chapters.h2
-rw-r--r--engines/lastexpress/entities/entity.cpp14
-rw-r--r--engines/lastexpress/entities/entity.h14
4 files changed, 16 insertions, 16 deletions
diff --git a/engines/lastexpress/entities/chapters.cpp b/engines/lastexpress/entities/chapters.cpp
index a2f3a3d871..d373432710 100644
--- a/engines/lastexpress/entities/chapters.cpp
+++ b/engines/lastexpress/entities/chapters.cpp
@@ -1851,7 +1851,7 @@ void Chapters::enterExitHelper(bool isEnteringStation) {
callbackAction();
}
-void Chapters::playSteam() {
+void Chapters::playSteam() const {
getSoundQueue()->resetState();
getSound()->playSteam((CityIndex)ENTITY_PARAM(0, 4));
ENTITY_PARAM(0, 2) = 0;
diff --git a/engines/lastexpress/entities/chapters.h b/engines/lastexpress/entities/chapters.h
index ddb3de3bea..fb52ea3ee4 100644
--- a/engines/lastexpress/entities/chapters.h
+++ b/engines/lastexpress/entities/chapters.h
@@ -157,7 +157,7 @@ private:
bool timeCheckExitStation(TimeValue timeValue, uint &parameter, byte callback, const char *sequence);
void enterExitStation(const SavePoint &savepoint, bool isEnteringStation);
void enterExitHelper(bool isEnteringStation);
- void playSteam();
+ void playSteam() const;
};
} // End of namespace LastExpress
diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp
index 552e1a8a82..88b2ada185 100644
--- a/engines/lastexpress/entities/entity.cpp
+++ b/engines/lastexpress/entities/entity.cpp
@@ -50,7 +50,7 @@ EntityData::EntityCallData::~EntityCallData() {
SAFE_DELETE(sequence3);
}
-void EntityData::EntityCallData::syncString(Common::Serializer &s, Common::String &string, int length) {
+void EntityData::EntityCallData::syncString(Common::Serializer &s, Common::String &string, int length) const {
char seqName[13];
memset(&seqName, 0, length);
@@ -825,7 +825,7 @@ void Entity::setupIISS(const char *name, uint index, uint param1, uint param2, c
// Helper functions
//////////////////////////////////////////////////////////////////////////
-bool Entity::updateParameter(uint &parameter, uint timeType, uint delta) {
+bool Entity::updateParameter(uint &parameter, uint timeType, uint delta) const {
if (!parameter)
parameter = (uint)(timeType + delta);
@@ -837,7 +837,7 @@ bool Entity::updateParameter(uint &parameter, uint timeType, uint delta) {
return true;
}
-bool Entity::updateParameterTime(TimeValue timeValue, bool check, uint &parameter, uint delta) {
+bool Entity::updateParameterTime(TimeValue timeValue, bool check, uint &parameter, uint delta) const {
if (getState()->time <= timeValue) {
if (check || !parameter)
parameter = (uint)(getState()->time + delta);
@@ -851,7 +851,7 @@ bool Entity::updateParameterTime(TimeValue timeValue, bool check, uint &paramete
return true;
}
-bool Entity::updateParameterCheck(uint &parameter, uint timeType, uint delta) {
+bool Entity::updateParameterCheck(uint &parameter, uint timeType, uint delta) const {
if (parameter && parameter >= timeType)
return false;
@@ -861,7 +861,7 @@ bool Entity::updateParameterCheck(uint &parameter, uint timeType, uint delta) {
return true;
}
-bool Entity::timeCheck(TimeValue timeValue, uint &parameter, Common::Functor0<void> *function) {
+bool Entity::timeCheck(TimeValue timeValue, uint &parameter, Common::Functor0<void> *function) const {
if (getState()->time > timeValue && !parameter) {
parameter = 1;
(*function)();
@@ -936,14 +936,14 @@ bool Entity::timeCheckCar(TimeValue timeValue, uint &parameter, byte callback, C
return false;
}
-void Entity::timeCheckSavepoint(TimeValue timeValue, uint &parameter, EntityIndex entity1, EntityIndex entity2, ActionIndex action) {
+void Entity::timeCheckSavepoint(TimeValue timeValue, uint &parameter, EntityIndex entity1, EntityIndex entity2, ActionIndex action) const {
if (getState()->time > timeValue && !parameter) {
parameter = 1;
getSavePoints()->push(entity1, entity2, action);
}
}
-void Entity::timeCheckObject(TimeValue timeValue, uint &parameter, ObjectIndex object, ObjectLocation location) {
+void Entity::timeCheckObject(TimeValue timeValue, uint &parameter, ObjectIndex object, ObjectLocation location) const {
if (getState()->time > timeValue && !parameter) {
parameter = 1;
getObjects()->updateLocation2(object, location);
diff --git a/engines/lastexpress/entities/entity.h b/engines/lastexpress/entities/entity.h
index e5c097b50a..c45367c43c 100644
--- a/engines/lastexpress/entities/entity.h
+++ b/engines/lastexpress/entities/entity.h
@@ -822,7 +822,7 @@ public:
* @param string The string.
* @param length Length of the string.
*/
- void syncString(Common::Serializer &s, Common::String &string, int length);
+ void syncString(Common::Serializer &s, Common::String &string, int length) const;
// Serializable
void saveLoadWithSerializer(Common::Serializer &s);
@@ -1084,18 +1084,18 @@ protected:
// Helper functions
//////////////////////////////////////////////////////////////////////////
- bool updateParameter(uint &parameter, uint timeType, uint delta);
- bool updateParameterCheck(uint &parameter, uint timeType, uint delta);
- bool updateParameterTime(TimeValue timeValue, bool check, uint &parameter, uint delta);
+ bool updateParameter(uint &parameter, uint timeType, uint delta) const;
+ bool updateParameterCheck(uint &parameter, uint timeType, uint delta) const;
+ bool updateParameterTime(TimeValue timeValue, bool check, uint &parameter, uint delta) const;
- bool timeCheck(TimeValue timeValue, uint &parameter, Common::Functor0<void> *function);
+ bool timeCheck(TimeValue timeValue, uint &parameter, Common::Functor0<void> *function) const;
bool timeCheckCallback(TimeValue timeValue, uint &parameter, byte callback, Common::Functor0<void> *function);
bool timeCheckCallback(TimeValue timeValue, uint &parameter, byte callback, const char *str, Common::Functor1<const char *, void> *function);
bool timeCheckCallback(TimeValue timeValue, uint &parameter, byte callback, bool check, Common::Functor1<bool, void> *function);
bool timeCheckCallbackInventory(TimeValue timeValue, uint &parameter, byte callback, Common::Functor0<void> *function);
bool timeCheckCar(TimeValue timeValue, uint &parameter, byte callback, Common::Functor0<void> *function);
- void timeCheckSavepoint(TimeValue timeValue, uint &parameter, EntityIndex entity1, EntityIndex entity2, ActionIndex action);
- void timeCheckObject(TimeValue timeValue, uint &parameter, ObjectIndex index, ObjectLocation location);
+ void timeCheckSavepoint(TimeValue timeValue, uint &parameter, EntityIndex entity1, EntityIndex entity2, ActionIndex action) const;
+ void timeCheckObject(TimeValue timeValue, uint &parameter, ObjectIndex index, ObjectLocation location) const;
bool timeCheckCallbackAction(TimeValue timeValue, uint &parameter);
bool timeCheckPlaySoundUpdatePosition(TimeValue timeValue, uint &parameter, byte callback, const char* sound, EntityPosition position);