aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-12-09 12:25:20 +0100
committerEinar Johan Trøan Sømåen2012-12-09 12:25:20 +0100
commit233ca0be4ad72b3b262f207ec0eef1d551b93184 (patch)
tree7809765c62667865aa3f988cf9d447fec4726307 /engines
parent32e63091d6842e2ca769733c5cfcc518b212270b (diff)
downloadscummvm-rg350-233ca0be4ad72b3b262f207ec0eef1d551b93184.tar.gz
scummvm-rg350-233ca0be4ad72b3b262f207ec0eef1d551b93184.tar.bz2
scummvm-rg350-233ca0be4ad72b3b262f207ec0eef1d551b93184.zip
WINTERMUTE: Privatize members in AdEntity
Diffstat (limited to 'engines')
-rw-r--r--engines/wintermute/ad/ad_actor.cpp4
-rw-r--r--engines/wintermute/ad/ad_entity.cpp15
-rw-r--r--engines/wintermute/ad/ad_entity.h17
-rw-r--r--engines/wintermute/ad/ad_scene.cpp4
4 files changed, 30 insertions, 10 deletions
diff --git a/engines/wintermute/ad/ad_actor.cpp b/engines/wintermute/ad/ad_actor.cpp
index d175855d1e..916ffbbdc3 100644
--- a/engines/wintermute/ad/ad_actor.cpp
+++ b/engines/wintermute/ad/ad_actor.cpp
@@ -969,10 +969,10 @@ bool AdActor::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
return STATUS_OK;
}
AdEntity *ent = (AdEntity *)obj;
- if (ent->_walkToX == 0 && ent->_walkToY == 0) {
+ if (ent->getWalkToX() == 0 && ent->getWalkToY() == 0) {
goTo(ent->_posX, ent->_posY);
} else {
- goTo(ent->_walkToX, ent->_walkToY, ent->_walkToDir);
+ goTo(ent->getWalkToX(), ent->getWalkToY(), ent->getWalkToDir());
}
if (strcmp(name, "GoToObjectAsync") != 0) {
script->waitForExclusive(this);
diff --git a/engines/wintermute/ad/ad_entity.cpp b/engines/wintermute/ad/ad_entity.cpp
index 9af7e034ca..2c331de964 100644
--- a/engines/wintermute/ad/ad_entity.cpp
+++ b/engines/wintermute/ad/ad_entity.cpp
@@ -82,6 +82,21 @@ AdEntity::~AdEntity() {
_item = NULL;
}
+int32 AdEntity::getWalkToX() const {
+ return _walkToX;
+}
+
+int32 AdEntity::getWalkToY() const {
+ return _walkToY;
+}
+
+TDirection AdEntity::getWalkToDir() const {
+ return _walkToDir;
+}
+
+const char *AdEntity::getItemName() const {
+ return _item;
+}
//////////////////////////////////////////////////////////////////////////
bool AdEntity::loadFile(const char *filename) {
diff --git a/engines/wintermute/ad/ad_entity.h b/engines/wintermute/ad/ad_entity.h
index 415987e50a..94921aaa27 100644
--- a/engines/wintermute/ad/ad_entity.h
+++ b/engines/wintermute/ad/ad_entity.h
@@ -37,11 +37,7 @@ class AdEntity : public AdTalkHolder {
public:
VideoTheoraPlayer *_theora;
bool setSprite(const char *filename);
- int _walkToX;
- int _walkToY;
- TDirection _walkToDir;
void setItem(const char *itemName);
- char *_item;
DECLARE_PERSISTENT(AdEntity, AdTalkHolder)
void updatePosition();
virtual int getHeight();
@@ -53,14 +49,23 @@ public:
virtual ~AdEntity();
bool loadFile(const char *filename);
bool loadBuffer(byte *buffer, bool complete = true);
- TEntityType _subtype;
+
+ int32 getWalkToX() const;
+ int32 getWalkToY() const;
+ TDirection getWalkToDir() const;
+ const char* getItemName() const;
// scripting interface
virtual ScValue *scGetProperty(const Common::String &name);
virtual bool scSetProperty(const char *name, ScValue *value);
virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
-
+private:
+ int32 _walkToX;
+ int32 _walkToY;
+ TDirection _walkToDir;
+ char *_item;
+ TEntityType _subtype;
};
} // end of namespace Wintermute
diff --git a/engines/wintermute/ad/ad_scene.cpp b/engines/wintermute/ad/ad_scene.cpp
index 7cdc70e00e..816232c1d6 100644
--- a/engines/wintermute/ad/ad_scene.cpp
+++ b/engines/wintermute/ad/ad_scene.cpp
@@ -2780,7 +2780,7 @@ bool AdScene::handleItemAssociations(const char *itemName, bool show) {
if (layer->_nodes[j]->_type == OBJECT_ENTITY) {
AdEntity *ent = layer->_nodes[j]->_entity;
- if (ent->_item && strcmp(ent->_item, itemName) == 0) {
+ if (ent->getItemName() && strcmp(ent->getItemName(), itemName) == 0) {
ent->_active = show;
}
}
@@ -2790,7 +2790,7 @@ bool AdScene::handleItemAssociations(const char *itemName, bool show) {
for (uint32 i = 0; i < _objects.size(); i++) {
if (_objects[i]->_type == OBJECT_ENTITY) {
AdEntity *ent = (AdEntity *)_objects[i];
- if (ent->_item && strcmp(ent->_item, itemName) == 0) {
+ if (ent->getItemName() && strcmp(ent->getItemName(), itemName) == 0) {
ent->_active = show;
}
}