aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/ad
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-12-09 18:10:07 +0100
committerEinar Johan Trøan Sømåen2012-12-09 18:10:07 +0100
commitc9c90e925ac6913d2ed49a2ab78047b510a8b78b (patch)
treec2a20a1fc8a88960474b3a56fff93ad1fe72c93b /engines/wintermute/ad
parent8f33a2ea0b807df5075b078877f2a83bb0fdb114 (diff)
downloadscummvm-rg350-c9c90e925ac6913d2ed49a2ab78047b510a8b78b.tar.gz
scummvm-rg350-c9c90e925ac6913d2ed49a2ab78047b510a8b78b.tar.bz2
scummvm-rg350-c9c90e925ac6913d2ed49a2ab78047b510a8b78b.zip
WINTERMUTE: Privatize members in AdObject.
Diffstat (limited to 'engines/wintermute/ad')
-rw-r--r--engines/wintermute/ad/ad_actor.cpp2
-rw-r--r--engines/wintermute/ad/ad_object.cpp3
-rw-r--r--engines/wintermute/ad/ad_object.h66
-rw-r--r--engines/wintermute/ad/ad_scene.cpp8
4 files changed, 43 insertions, 36 deletions
diff --git a/engines/wintermute/ad/ad_actor.cpp b/engines/wintermute/ad/ad_actor.cpp
index 916ffbbdc3..74fb4a5ae2 100644
--- a/engines/wintermute/ad/ad_actor.cpp
+++ b/engines/wintermute/ad/ad_actor.cpp
@@ -963,7 +963,7 @@ bool AdActor::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
return STATUS_OK;
}
AdObject *obj = (AdObject *)val->getNative();
- if (!obj || obj->_type != OBJECT_ENTITY) {
+ if (!obj || obj->getType() != OBJECT_ENTITY) {
script->runtimeError("actor.%s method accepts an entity refrence only", name);
stack->pushNULL();
return STATUS_OK;
diff --git a/engines/wintermute/ad/ad_object.cpp b/engines/wintermute/ad/ad_object.cpp
index 7b91daab2e..a940b33805 100644
--- a/engines/wintermute/ad/ad_object.cpp
+++ b/engines/wintermute/ad/ad_object.cpp
@@ -878,6 +878,9 @@ int AdObject::getHeight() {
}
}
+TObjectType AdObject::getType() const {
+ return _type;
+}
//////////////////////////////////////////////////////////////////////////
void AdObject::talk(const char *text, const char *sound, uint32 duration, const char *stances, TTextAlign Align) {
diff --git a/engines/wintermute/ad/ad_object.h b/engines/wintermute/ad/ad_object.h
index d1a20908e1..2a437c7e09 100644
--- a/engines/wintermute/ad/ad_object.h
+++ b/engines/wintermute/ad/ad_object.h
@@ -46,25 +46,15 @@ class PartEmitter;
class AdObject : public BaseObject {
public:
- PartEmitter *_partEmitter;
virtual PartEmitter *createParticleEmitter(bool followParent = false, int offsetX = 0, int offsetY = 0);
virtual bool updatePartEmitter();
- bool _partFollowParent;
- int _partOffsetX;
- int _partOffsetY;
bool invalidateCurrRegions();
- bool _subtitlesModRelative;
- bool _subtitlesModXCenter;
- int _subtitlesModX;
- int _subtitlesModY;
- int _subtitlesWidth;
AdRegion *_stickRegion;
bool _sceneIndependent;
- bool _ignoreItems;
+
bool updateBlockRegion();
- bool _forcedTalkAnimUsed;
- char *_forcedTalkAnimName;
+
virtual bool getExtendedFlag(const char *flagName);
virtual bool resetSoundPan();
virtual bool updateSounds();
@@ -72,51 +62,65 @@ public:
DECLARE_PERSISTENT(AdObject, BaseObject)
virtual void talk(const char *text, const char *sound = NULL, uint32 duration = 0, const char *stances = NULL, TTextAlign align = TAL_CENTER);
virtual int getHeight();
- AdSentence *_sentence;
+
bool setFont(const char *filename);
virtual bool update();
virtual bool display();
+
bool _drawn;
bool _active;
virtual bool playAnim(const char *filename);
- BaseSprite *_animSprite;
- BaseSprite *_currentSprite;
- TObjectState _state;
- TObjectState _nextState;
- TObjectType _type;
+
+ TObjectType getType() const;
AdObject(BaseGame *inGame);
virtual ~AdObject();
- BaseFont *_font;
- BaseSprite *_tempSprite2;
- BaseRegion *_blockRegion;
- AdWaypointGroup *_wptGroup;
+
BaseRegion *_currentBlockRegion;
AdWaypointGroup *_currentWptGroup;
AdInventory *getInventory();
virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent);
-
virtual bool afterMove();
- AdRegion *_currentRegions[MAX_NUM_REGIONS];
// 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();
-
- BaseArray<AdObject *> _attachmentsPre;
- BaseArray<AdObject *> _attachmentsPost;
-
bool updateSpriteAttachments();
bool displaySpriteAttachments(bool preDisplay);
+
+protected:
+ PartEmitter *_partEmitter;
+ bool _ignoreItems;
+ bool _forcedTalkAnimUsed;
+ char *_forcedTalkAnimName;
+ BaseSprite *_animSprite;
+ BaseSprite *_currentSprite;
+ AdSentence *_sentence;
+ TObjectState _state;
+ TObjectState _nextState;
+ TObjectType _type;
+ BaseFont *_font;
+ BaseSprite *_tempSprite2;
+ BaseRegion *_blockRegion;
+ AdWaypointGroup *_wptGroup;
AdObject *_registerAlias;
+ bool getScale(float *scaleX, float *scaleY);
private:
+ bool _partFollowParent;
+ int _partOffsetX;
+ int _partOffsetY;
+ bool _subtitlesModRelative;
+ bool _subtitlesModXCenter;
+ int _subtitlesModX;
+ int _subtitlesModY;
+ int _subtitlesWidth;
+ AdRegion *_currentRegions[MAX_NUM_REGIONS];
+ BaseArray<AdObject *> _attachmentsPre;
+ BaseArray<AdObject *> _attachmentsPost;
bool displaySpriteAttachment(AdObject *attachment);
AdInventory *_inventory;
-
-protected:
- bool getScale(float *scaleX, float *scaleY);
};
} // end of namespace Wintermute
diff --git a/engines/wintermute/ad/ad_scene.cpp b/engines/wintermute/ad/ad_scene.cpp
index 816232c1d6..a985c517e2 100644
--- a/engines/wintermute/ad/ad_scene.cpp
+++ b/engines/wintermute/ad/ad_scene.cpp
@@ -2197,7 +2197,7 @@ bool AdScene::saveAsText(BaseDynamicBuffer *buffer, int indent) {
// free entities
buffer->putTextIndent(indent + 2, "; ----- free entities\n");
for (uint32 i = 0; i < _objects.size(); i++) {
- if (_objects[i]->_type == OBJECT_ENTITY) {
+ if (_objects[i]->getType() == OBJECT_ENTITY) {
_objects[i]->saveAsText(buffer, indent + 2);
}
@@ -2633,7 +2633,7 @@ BaseObject *AdScene::getNodeByName(const char *name) {
// free entities
for (uint32 i = 0; i < _objects.size(); i++) {
- if (_objects[i]->_type == OBJECT_ENTITY && !scumm_stricmp(name, _objects[i]->getName())) {
+ if (_objects[i]->getType() == OBJECT_ENTITY && !scumm_stricmp(name, _objects[i]->getName())) {
return _objects[i];
}
}
@@ -2717,7 +2717,7 @@ bool AdScene::persistState(bool saving) {
if (!_objects[i]->_saveState) {
continue;
}
- if (_objects[i]->_type == OBJECT_ENTITY) {
+ if (_objects[i]->getType() == OBJECT_ENTITY) {
nodeState = state->getNodeState(_objects[i]->getName(), saving);
if (nodeState) {
nodeState->transferEntity((AdEntity *)_objects[i], _persistentStateSprites, saving);
@@ -2788,7 +2788,7 @@ bool AdScene::handleItemAssociations(const char *itemName, bool show) {
}
for (uint32 i = 0; i < _objects.size(); i++) {
- if (_objects[i]->_type == OBJECT_ENTITY) {
+ if (_objects[i]->getType() == OBJECT_ENTITY) {
AdEntity *ent = (AdEntity *)_objects[i];
if (ent->getItemName() && strcmp(ent->getItemName(), itemName) == 0) {
ent->_active = show;