diff options
author | Colin Snover | 2017-11-14 16:51:17 -0600 |
---|---|---|
committer | Eugene Sandulenko | 2017-11-18 22:35:12 +0100 |
commit | d07e9a0cf108cfc1525060e9d1b2260c26b901df (patch) | |
tree | e915336e7d40de7e14d82fbf79bf69aa21804487 /engines/fullpipe/behavior.h | |
parent | 384d68b679de37c906c8cac250fe2bb407c1ecb3 (diff) | |
download | scummvm-rg350-d07e9a0cf108cfc1525060e9d1b2260c26b901df.tar.gz scummvm-rg350-d07e9a0cf108cfc1525060e9d1b2260c26b901df.tar.bz2 scummvm-rg350-d07e9a0cf108cfc1525060e9d1b2260c26b901df.zip |
FULLPIPE: Fix memory leaks and ownership problems with Behavior objects
Diffstat (limited to 'engines/fullpipe/behavior.h')
-rw-r--r-- | engines/fullpipe/behavior.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/engines/fullpipe/behavior.h b/engines/fullpipe/behavior.h index e534371442..b20a42cb71 100644 --- a/engines/fullpipe/behavior.h +++ b/engines/fullpipe/behavior.h @@ -36,9 +36,8 @@ struct BehaviorMove { struct BehaviorAnim { int _staticsId; - int _movesCount; int _flags; - BehaviorMove **_behaviorMoves; + Common::Array<BehaviorMove> _behaviorMoves; BehaviorAnim(); BehaviorAnim(GameVar *var, Scene *sc, StaticANIObject *ani, int *minDelay); @@ -52,7 +51,7 @@ struct BehaviorInfo { int _flags; int _subIndex; int _animsCount; - Common::Array<BehaviorAnim *> _behaviorAnims; + Common::Array<BehaviorAnim> _behaviorAnims; BehaviorInfo() { clear(); } @@ -62,7 +61,7 @@ struct BehaviorInfo { }; class BehaviorManager : public CObject { - Common::Array<BehaviorInfo *> _behaviors; + Common::Array<BehaviorInfo> _behaviors; Scene *_scene; bool _isActive; @@ -75,8 +74,8 @@ class BehaviorManager : public CObject { void initBehavior(Scene *scene, GameVar *var); void updateBehaviors(); - void updateBehavior(BehaviorInfo *behaviorInfo, BehaviorAnim *entry); - void updateStaticAniBehavior(StaticANIObject *ani, int delay, BehaviorAnim *beh); + void updateBehavior(BehaviorInfo &behaviorInfo, BehaviorAnim &entry); + void updateStaticAniBehavior(StaticANIObject &ani, int delay, const BehaviorAnim &beh); bool setBehaviorEnabled(StaticANIObject *obj, int aniId, int quId, int flag); |