From 3d1a2e2049d599d88dc834a05dd25978f8a0f8f7 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Sun, 6 Apr 2008 05:40:02 +0000 Subject: Replaced custom ManagedList with Common::SharedPtr. svn-id: r31415 --- engines/parallaction/objects.h | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) (limited to 'engines/parallaction/objects.h') diff --git a/engines/parallaction/objects.h b/engines/parallaction/objects.h index d1ad943625..eb7a1445b3 100644 --- a/engines/parallaction/objects.h +++ b/engines/parallaction/objects.h @@ -27,8 +27,7 @@ #define PARALLACTION_ZONE_H #include "common/list.h" - -#include "parallaction/defs.h" +#include "common/ptr.h" #include "parallaction/graphics.h" @@ -43,6 +42,19 @@ struct Answer; struct Instruction; struct Program; +typedef Common::SharedPtr ZonePtr; +typedef Common::List ZoneList; +extern ZonePtr nullZonePtr; + +typedef Common::SharedPtr AnimationPtr; +typedef Common::List AnimationList; +extern AnimationPtr nullAnimationPtr; + +typedef Common::SharedPtr InstructionPtr; +typedef Common::List InstructionList; +extern InstructionPtr nullInstructionPtr; + + enum ZoneTypes { kZoneExamine = 1, // zone displays comment if activated kZoneDoor = 2, // zone activated on click (after some walk if needed) @@ -91,9 +103,11 @@ enum CommandFlags { kFlagsTestTrue = 2 }; + + struct CommandData { uint32 _flags; - Zone* _zone; + ZonePtr _zone; char* _string; uint16 _callable; uint16 _object; @@ -133,7 +147,8 @@ struct Command { ~Command(); }; -typedef ManagedList CommandList; +typedef Common::SharedPtr CommandPtr; +typedef Common::List CommandList; #define NUM_QUESTIONS 20 @@ -278,7 +293,7 @@ struct Zone { // BRA specific uint _index; char *_linkedName; - Animation *_linkedAnim; + AnimationPtr _linkedAnim; Zone(); virtual ~Zone(); @@ -289,8 +304,6 @@ struct Zone { virtual uint16 height() const; }; -typedef Zone* ZonePointer; -typedef ManagedList ZoneList; struct LocalVariable { int16 _value; @@ -336,15 +349,14 @@ enum InstructionFlags { kInstUnk20 = 0x20 }; -typedef ManagedList InstructionList; struct Instruction { uint32 _index; uint32 _flags; // common - Animation *_a; - Zone *_z; + AnimationPtr _a; + ZonePtr _z; int16 _immediate; ScriptVar _opA; ScriptVar _opB; @@ -369,7 +381,7 @@ enum { }; struct Program { - Animation *_anim; + AnimationPtr _anim; LocalVariable *_locals; @@ -390,7 +402,8 @@ struct Program { int16 addLocal(const char *name, int16 value = 0, int16 min = -10000, int16 max = 10000); }; -typedef ManagedList ProgramList; +typedef Common::SharedPtr ProgramPtr; +typedef Common::List ProgramList; struct Animation : public Zone { @@ -415,10 +428,6 @@ struct Animation : public Zone { byte* getFrameData(uint32 index) const; }; -typedef Animation* AnimationPointer; -typedef ManagedList AnimationList; - - class Table { protected: -- cgit v1.2.3