diff options
author | whiterandrek | 2018-05-21 21:38:02 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | 37574a3bcf2a85e0faf23b0278b560ab1a36086e (patch) | |
tree | 86f5dc81516c1251fd9f76cb2bc377fc7e7ed2ff /engines/pink/objects | |
parent | d8e42e739547868f61efd5818133b2045c89d77a (diff) | |
download | scummvm-rg350-37574a3bcf2a85e0faf23b0278b560ab1a36086e.tar.gz scummvm-rg350-37574a3bcf2a85e0faf23b0278b560ab1a36086e.tar.bz2 scummvm-rg350-37574a3bcf2a85e0faf23b0278b560ab1a36086e.zip |
PINK: remove >> << operators
Diffstat (limited to 'engines/pink/objects')
41 files changed, 103 insertions, 92 deletions
diff --git a/engines/pink/objects/actions/action_cel.cpp b/engines/pink/objects/actions/action_cel.cpp index e878c3e0ae..1b33fd737e 100644 --- a/engines/pink/objects/actions/action_cel.cpp +++ b/engines/pink/objects/actions/action_cel.cpp @@ -38,7 +38,8 @@ ActionCEL::ActionCEL() void ActionCEL::deserialize(Archive &archive) { Action::deserialize(archive); - archive >> _fileName >> _z; + _fileName = archive.readString(); + _z = archive.readDWORD(); } void ActionCEL::start(bool unk) { diff --git a/engines/pink/objects/actions/action_loop.cpp b/engines/pink/objects/actions/action_loop.cpp index 45a1b08e0f..03c04f9dee 100644 --- a/engines/pink/objects/actions/action_loop.cpp +++ b/engines/pink/objects/actions/action_loop.cpp @@ -30,7 +30,8 @@ namespace Pink { void ActionLoop::deserialize(Archive &archive) { ActionPlay::deserialize(archive); uint16 style; - archive >> _intro >> style; + _intro = archive.readDWORD(); + style = archive.readWORD(); switch (style) { case kPingPong: _style = kPingPong; diff --git a/engines/pink/objects/actions/action_play.cpp b/engines/pink/objects/actions/action_play.cpp index d8172a729d..6ab21db32e 100644 --- a/engines/pink/objects/actions/action_play.cpp +++ b/engines/pink/objects/actions/action_play.cpp @@ -31,7 +31,7 @@ namespace Pink { void ActionPlay::deserialize(Archive &archive) { ActionStill::deserialize(archive); - archive >> _stopFrame; + _stopFrame = archive.readDWORD(); } void ActionPlay::toConsole() { diff --git a/engines/pink/objects/actions/action_play_with_sfx.cpp b/engines/pink/objects/actions/action_play_with_sfx.cpp index 2c23fa0903..f54d81c66e 100644 --- a/engines/pink/objects/actions/action_play_with_sfx.cpp +++ b/engines/pink/objects/actions/action_play_with_sfx.cpp @@ -30,7 +30,8 @@ namespace Pink { void ActionPlayWithSfx::deserialize(Pink::Archive &archive) { ActionPlay::deserialize(archive); - archive >> _isLoop >> _sfxArray; + _isLoop = archive.readDWORD(); + _sfxArray.deserialize(archive); } void ActionPlayWithSfx::toConsole() { @@ -79,8 +80,10 @@ ActionPlayWithSfx::~ActionPlayWithSfx() { } void ActionSfx::deserialize(Pink::Archive &archive) { - archive >> _frame >> _volume >> _sfxName; - archive.readObject(); + _frame = archive.readDWORD(); + _volume = archive.readDWORD(); + _sfxName = archive.readString(); + archive.readObject(); // pointer of ActionPlayWithSfx } void ActionSfx::toConsole() { diff --git a/engines/pink/objects/actions/action_play_with_sfx.h b/engines/pink/objects/actions/action_play_with_sfx.h index 44b33420c7..865f3685cc 100644 --- a/engines/pink/objects/actions/action_play_with_sfx.h +++ b/engines/pink/objects/actions/action_play_with_sfx.h @@ -23,8 +23,6 @@ #ifndef PINK_ACTION_PLAY_WITH_SFX_H #define PINK_ACTION_PLAY_WITH_SFX_H -#include "common/array.h" - #include "pink/objects/actions/action_play.h" namespace Pink { @@ -44,7 +42,7 @@ protected: private: void updateSound(); uint32 _isLoop; - Common::Array<ActionSfx*> _sfxArray; + Array<ActionSfx*> _sfxArray; }; class Sound; diff --git a/engines/pink/objects/actions/action_sound.cpp b/engines/pink/objects/actions/action_sound.cpp index a125ec0a2e..196ae61076 100644 --- a/engines/pink/objects/actions/action_sound.cpp +++ b/engines/pink/objects/actions/action_sound.cpp @@ -41,7 +41,7 @@ ActionSound::~ActionSound(){ void ActionSound::deserialize(Archive &archive) { Action::deserialize(archive); - archive >> _fileName; + _fileName = archive.readString(); _volume = archive.readDWORD(); _isLoop = (bool) archive.readDWORD(); _isBackground = (bool) archive.readDWORD(); diff --git a/engines/pink/objects/actions/action_still.cpp b/engines/pink/objects/actions/action_still.cpp index 0bcfcebf3b..6afa2df5aa 100644 --- a/engines/pink/objects/actions/action_still.cpp +++ b/engines/pink/objects/actions/action_still.cpp @@ -31,7 +31,7 @@ namespace Pink { void ActionStill::deserialize(Archive &archive) { ActionCEL::deserialize(archive); - archive >> _startFrame; + _startFrame = archive.readDWORD(); } void ActionStill::toConsole() { diff --git a/engines/pink/objects/actions/action_talk.cpp b/engines/pink/objects/actions/action_talk.cpp index 20abdc00f1..ab15aedfa4 100644 --- a/engines/pink/objects/actions/action_talk.cpp +++ b/engines/pink/objects/actions/action_talk.cpp @@ -31,7 +31,7 @@ namespace Pink { void ActionTalk::deserialize(Archive &archive) { ActionLoop::deserialize(archive); - archive >> _vox; + _vox = archive.readString(); } void ActionTalk::toConsole() { diff --git a/engines/pink/objects/actions/action_text.cpp b/engines/pink/objects/actions/action_text.cpp index 034aa1da1e..27bcafec47 100644 --- a/engines/pink/objects/actions/action_text.cpp +++ b/engines/pink/objects/actions/action_text.cpp @@ -29,10 +29,12 @@ namespace Pink { void ActionText::deserialize(Archive &archive) { for (int i = 0; i < 4 ; ++i) { - archive >> _bounds[i]; + _bounds[i] = archive.readDWORD(); } - archive >> _centered >> _scrollBar - >> _textColor >> _backgroundColor; + _centered = archive.readDWORD(); + _scrollBar = archive.readDWORD(); + _textColor = archive.readDWORD(); + _backgroundColor = archive.readDWORD(); } void ActionText::toConsole() { diff --git a/engines/pink/objects/actors/actor.cpp b/engines/pink/objects/actors/actor.cpp index 67e0b2a7bd..c8079375ab 100644 --- a/engines/pink/objects/actors/actor.cpp +++ b/engines/pink/objects/actors/actor.cpp @@ -32,7 +32,7 @@ namespace Pink { void Actor::deserialize(Archive &archive) { NamedObject::deserialize(archive); _page = static_cast<GamePage*>(archive.readObject()); - archive >> _actions; + _actions.deserialize(archive); } void Actor::toConsole() { @@ -135,7 +135,7 @@ Actor::~Actor() { void Actor::loadState(Archive &archive) { Common::String actionName; - archive >> actionName; + actionName = archive.readString(); _action = findAction(actionName); } diff --git a/engines/pink/objects/actors/actor.h b/engines/pink/objects/actors/actor.h index 4992a75194..b7650a20d0 100644 --- a/engines/pink/objects/actors/actor.h +++ b/engines/pink/objects/actors/actor.h @@ -23,10 +23,9 @@ #ifndef PINK_ACTOR_H #define PINK_ACTOR_H -#include "common/array.h" #include "common/rect.h" -#include "pink/objects/object.h" +#include "pink/utils.h" namespace Pink { @@ -81,7 +80,7 @@ public: protected: GamePage *_page; Action *_action; - Common::Array<Action*> _actions; + Array<Action*> _actions; bool _isActionEnded; }; diff --git a/engines/pink/objects/actors/pda_button_actor.cpp b/engines/pink/objects/actors/pda_button_actor.cpp index 18e29a617c..d1bd63cee1 100644 --- a/engines/pink/objects/actors/pda_button_actor.cpp +++ b/engines/pink/objects/actors/pda_button_actor.cpp @@ -20,7 +20,6 @@ * */ -#include "pink/archive.h" #include "pink/objects/actors/pda_button_actor.h" namespace Pink { diff --git a/engines/pink/objects/actors/supporting_actor.cpp b/engines/pink/objects/actors/supporting_actor.cpp index 4971cca7c8..04fbb8b18f 100644 --- a/engines/pink/objects/actors/supporting_actor.cpp +++ b/engines/pink/objects/actors/supporting_actor.cpp @@ -20,7 +20,7 @@ * */ -#include "pink/archive.h" +#include "pink/utils.h" #include "pink/constants.h" #include "pink/cursor_mgr.h" #include "pink/objects/inventory.h" @@ -31,7 +31,9 @@ namespace Pink { void SupportingActor::deserialize(Archive &archive) { Actor::deserialize(archive); - archive >> _location >> _pdaLink >> _cursor; + _location = archive.readString(); + _pdaLink = archive.readString(); + _cursor = archive.readString(); _handlerMgr.deserialize(archive); } diff --git a/engines/pink/objects/condition.cpp b/engines/pink/objects/condition.cpp index 3de8605060..be127305a0 100644 --- a/engines/pink/objects/condition.cpp +++ b/engines/pink/objects/condition.cpp @@ -29,7 +29,8 @@ namespace Pink { void Pink::ConditionVariable::deserialize(Archive &archive) { - archive >> _name >> _value; + _name = archive.readString(); + _value = archive.readString(); } bool Pink::ConditionGameVariable::evaluate(Actor *actor) { @@ -73,7 +74,8 @@ void ConditionNotPageVariable::toConsole() { } void ConditionInventoryItemOwner::deserialize(Archive &archive) { - archive >> _item >> _owner; + _item = archive.readString(); + _owner = archive.readString(); } bool ConditionInventoryItemOwner::evaluate(Actor *actor) { diff --git a/engines/pink/objects/handlers/handler.cpp b/engines/pink/objects/handlers/handler.cpp index 4c302224e8..8833153e0c 100644 --- a/engines/pink/objects/handlers/handler.cpp +++ b/engines/pink/objects/handlers/handler.cpp @@ -33,8 +33,8 @@ namespace Pink { void Handler::deserialize(Archive &archive) { - archive >> _conditions; - archive >> _sideEffects; + _conditions.deserialize(archive); + _sideEffects.deserialize(archive); } bool Handler::isSuitable(Actor *actor) { @@ -67,7 +67,7 @@ Handler::~Handler() { void HandlerSequences::deserialize(Archive &archive) { Handler::deserialize(archive); - archive >> _sequences; + _sequences.deserialize(archive); } void HandlerSequences::handle(Actor *actor) { @@ -131,7 +131,8 @@ void HandlerLeftClick::toConsole() { void HandlerUseClick::deserialize(Archive &archive) { HandlerSequences::deserialize(archive); - archive >> _inventoryItem >> _recepient; + _inventoryItem = archive.readString(); + _recepient = archive.readString(); } void HandlerUseClick::toConsole() { diff --git a/engines/pink/objects/handlers/handler.h b/engines/pink/objects/handlers/handler.h index 769a4c3c6a..9d0d29833e 100644 --- a/engines/pink/objects/handlers/handler.h +++ b/engines/pink/objects/handlers/handler.h @@ -44,8 +44,8 @@ public: protected: void executeSideEffects(Actor *actor); - Common::Array<Condition*> _conditions; - Common::Array<SideEffect*> _sideEffects; + Array<Condition*> _conditions; + Array<SideEffect*> _sideEffects; }; class Sequence; @@ -58,7 +58,7 @@ public: protected: virtual void execute(Sequence *sequence) = 0; - Common::StringArray _sequences; + StringArray _sequences; }; class HandlerStartPage : public HandlerSequences { diff --git a/engines/pink/objects/handlers/handler_mgr.cpp b/engines/pink/objects/handlers/handler_mgr.cpp index c326ae8aab..2c5230eaeb 100644 --- a/engines/pink/objects/handlers/handler_mgr.cpp +++ b/engines/pink/objects/handlers/handler_mgr.cpp @@ -28,7 +28,9 @@ namespace Pink { void HandlerMgr::deserialize(Archive &archive) { - archive >> _leftClickHandlers >> _useClickHandlers >> _timerHandlers; + _leftClickHandlers.deserialize(archive); + _useClickHandlers.deserialize(archive); + _timerHandlers.deserialize(archive); } void HandlerMgr::toConsole() { diff --git a/engines/pink/objects/handlers/handler_mgr.h b/engines/pink/objects/handlers/handler_mgr.h index f9a073916d..36e2b05513 100644 --- a/engines/pink/objects/handlers/handler_mgr.h +++ b/engines/pink/objects/handlers/handler_mgr.h @@ -23,8 +23,6 @@ #ifndef PINK_HANDLER_MGR_H #define PINK_HANDLER_MGR_H -#include "common/array.h" - #include "pink/objects/object.h" namespace Pink { @@ -58,9 +56,9 @@ private: HandlerLeftClick *findSuitableHandlerLeftClick(Actor *actor); HandlerUseClick *findSuitableHandlerUseClick(Actor *actor, InventoryItem *item); - Common::Array<HandlerLeftClick*> _leftClickHandlers; - Common::Array<HandlerUseClick*> _useClickHandlers; - Common::Array<Handler*> _timerHandlers; + Array<HandlerLeftClick*> _leftClickHandlers; + Array<HandlerUseClick*> _useClickHandlers; + Array<Handler*> _timerHandlers; }; } diff --git a/engines/pink/objects/handlers/handler_timer.cpp b/engines/pink/objects/handlers/handler_timer.cpp index e9af952ad1..469b6f9a69 100644 --- a/engines/pink/objects/handlers/handler_timer.cpp +++ b/engines/pink/objects/handlers/handler_timer.cpp @@ -37,7 +37,7 @@ namespace Pink { void HandlerTimerActions::deserialize(Archive &archive) { Handler::deserialize(archive); - archive >> _actions; + _actions.deserialize(archive); } void HandlerTimerActions::toConsole() { diff --git a/engines/pink/objects/handlers/handler_timer.h b/engines/pink/objects/handlers/handler_timer.h index 737804f4ff..b0fb4bc453 100644 --- a/engines/pink/objects/handlers/handler_timer.h +++ b/engines/pink/objects/handlers/handler_timer.h @@ -23,8 +23,6 @@ #ifndef PINK_HANDLER_TIMER_H #define PINK_HANDLER_TIMER_H -#include "common/str-array.h" - #include "pink/objects/handlers/handler.h" namespace Pink { @@ -46,7 +44,7 @@ public: virtual void handle(Actor *actor); private: - Common::StringArray _actions; + StringArray _actions; }; //appear in HokusPokus diff --git a/engines/pink/objects/inventory.cpp b/engines/pink/objects/inventory.cpp index c2607bed74..4280cd5a48 100644 --- a/engines/pink/objects/inventory.cpp +++ b/engines/pink/objects/inventory.cpp @@ -23,7 +23,6 @@ #include "common/debug.h" -#include "pink/archive.h" #include "pink/director.h" #include "pink/pink.h" #include "pink/objects/inventory.h" @@ -59,7 +58,7 @@ InventoryMgr::~InventoryMgr() { } void InventoryMgr::deserialize(Archive &archive) { - archive >> _items; + _items.deserialize(archive); } InventoryItem *InventoryMgr::findInventoryItem(const Common::String &name) { diff --git a/engines/pink/objects/inventory.h b/engines/pink/objects/inventory.h index 8cb4f0aba9..b8de36b8b4 100644 --- a/engines/pink/objects/inventory.h +++ b/engines/pink/objects/inventory.h @@ -23,14 +23,12 @@ #ifndef PINK_INVENTORY_H #define PINK_INVENTORY_H -#include "common/array.h" #include "common/rect.h" -#include "pink/objects/object.h" +#include "pink/utils.h" namespace Pink { - class InventoryItem : public NamedObject { public: virtual void deserialize(Archive &archive); @@ -77,8 +75,7 @@ private: void showNextItem(bool direction); - InventoryItem *_item; - Common::Array<InventoryItem*> _items; + LeadActor *_lead; Actor *_window; @@ -86,6 +83,9 @@ private: Actor *_rightArrow; Actor *_leftArrow; + InventoryItem *_item; + Array<InventoryItem*> _items; + enum State { kIdle = 0, kOpening = 1, diff --git a/engines/pink/objects/module.cpp b/engines/pink/objects/module.cpp index 2b1518704a..6f9fab06dc 100644 --- a/engines/pink/objects/module.cpp +++ b/engines/pink/objects/module.cpp @@ -49,7 +49,7 @@ void Module::load(Archive &archive){ archive.readString(); // skip directory _invMgr.deserialize(archive); - archive >> _pages; + _pages.deserialize(archive); } void Module::init(bool isLoadingSave, const Common::String &pageName) { diff --git a/engines/pink/objects/module.h b/engines/pink/objects/module.h index c19571bd1c..622381d8a3 100644 --- a/engines/pink/objects/module.h +++ b/engines/pink/objects/module.h @@ -65,7 +65,7 @@ private: PinkEngine *_game; GamePage *_page; - Common::Array<GamePage*> _pages; + Array<GamePage*> _pages; InventoryMgr _invMgr; Common::StringMap _variables; }; diff --git a/engines/pink/objects/object.cpp b/engines/pink/objects/object.cpp index d123aaf473..796b356a6c 100644 --- a/engines/pink/objects/object.cpp +++ b/engines/pink/objects/object.cpp @@ -23,7 +23,6 @@ #include "common/debug.h" #include "pink/archive.h" -#include "pink/objects/object.h" namespace Pink { diff --git a/engines/pink/objects/pages/game_page.cpp b/engines/pink/objects/pages/game_page.cpp index bdfb92bef6..ca9f304225 100644 --- a/engines/pink/objects/pages/game_page.cpp +++ b/engines/pink/objects/pages/game_page.cpp @@ -65,7 +65,7 @@ void GamePage::load(Archive &archive) { _walkMgr->deserialize(archive); _sequencer->deserialize(archive); - archive >> _handlers; + _handlers.deserialize(archive); } void GamePage::init(bool isLoadingSave) { @@ -153,11 +153,17 @@ void GamePage::loadState() { //_variables.clear(1); Common::StringMap mapTest; // HACK. Without it isn't working //archive >> _variables; - archive >> mapTest; + + uint size = archive.readCount(); + for (uint i = 0; i < size; ++i) { + Common::String key = archive.readString(); + Common::String val = archive.readString(); + mapTest.setVal(key, val); + } + _variables = mapTest; - uint16 actorCount; - archive >> actorCount; + uint16 actorCount = archive.readWORD(); Common::String actorName; for (int i = 0; i < actorCount; ++i) { @@ -170,7 +176,10 @@ void GamePage::saveState() { _memFile = new Common::MemoryReadWriteStream(DisposeAfterUse::YES); Archive archive(static_cast<Common::WriteStream*>(_memFile)); - archive << _variables; + for (Common::StringMap::const_iterator it = _variables.begin(); it != _variables.end(); ++it) { + archive.writeString(it->_key); + archive.writeString(it->_value); + } archive.writeWORD(_actors.size()); for (uint i = 0; i < _actors.size(); ++i) { diff --git a/engines/pink/objects/pages/game_page.h b/engines/pink/objects/pages/game_page.h index 9aa5422981..37584ee3fb 100644 --- a/engines/pink/objects/pages/game_page.h +++ b/engines/pink/objects/pages/game_page.h @@ -67,7 +67,7 @@ private: CursorMgr *_cursorMgr; WalkMgr *_walkMgr; Sequencer *_sequencer; - Common::Array<HandlerStartPage*> _handlers; + Array<HandlerStartPage*> _handlers; Common::StringMap _variables; }; diff --git a/engines/pink/objects/pages/page.cpp b/engines/pink/objects/pages/page.cpp index cf2d3a01be..3c46d19b0f 100644 --- a/engines/pink/objects/pages/page.cpp +++ b/engines/pink/objects/pages/page.cpp @@ -34,7 +34,7 @@ void Page::load(Archive &archive) { archive.mapObject(this); NamedObject::deserialize(archive); archive.readString(); //skip directory - archive >> _actors; + _actors.deserialize(archive); } Actor *Page::findActor(const Common::String &name) { diff --git a/engines/pink/objects/pages/page.h b/engines/pink/objects/pages/page.h index c6d82209c5..2d1990c76f 100644 --- a/engines/pink/objects/pages/page.h +++ b/engines/pink/objects/pages/page.h @@ -51,7 +51,7 @@ public: protected: void init(); - Common::Array<Actor*> _actors; + Array<Actor*> _actors; ResourceMgr _resMgr; LeadActor *_leadActor; }; diff --git a/engines/pink/objects/sequences/seq_timer.cpp b/engines/pink/objects/sequences/seq_timer.cpp index c8d166a0cd..e661308c56 100644 --- a/engines/pink/objects/sequences/seq_timer.cpp +++ b/engines/pink/objects/sequences/seq_timer.cpp @@ -35,7 +35,7 @@ SeqTimer::SeqTimer() : _updatesToMessage(0) {} void SeqTimer::deserialize(Archive &archive) { - archive >> _actor; + _actor = archive.readString(); _period = archive.readDWORD(); _range = archive.readDWORD(); _sequencer = static_cast<Sequencer*>(archive.readObject()); diff --git a/engines/pink/objects/sequences/sequence.cpp b/engines/pink/objects/sequences/sequence.cpp index ae979658f2..4cd041b087 100644 --- a/engines/pink/objects/sequences/sequence.cpp +++ b/engines/pink/objects/sequences/sequence.cpp @@ -46,7 +46,7 @@ Sequence::~Sequence() { void Sequence::deserialize(Archive &archive) { NamedObject::deserialize(archive); _sequencer = static_cast<Sequencer*>(archive.readObject()); - archive >> _items; + _items.deserialize(archive); } void Sequence::toConsole() { @@ -138,7 +138,7 @@ void Sequence::skipSubSequence() { void SequenceAudio::deserialize(Archive &archive) { Sequence::deserialize(archive); - archive >> _soundName; + _soundName = archive.readString(); } void SequenceAudio::toConsole() { diff --git a/engines/pink/objects/sequences/sequence.h b/engines/pink/objects/sequences/sequence.h index ba6d3be35a..e40b0160e2 100644 --- a/engines/pink/objects/sequences/sequence.h +++ b/engines/pink/objects/sequences/sequence.h @@ -23,8 +23,6 @@ #ifndef PINK_SEQUENCE_H #define PINK_SEQUENCE_H -#include "common/array.h" - #include "pink/objects/object.h" namespace Pink { @@ -58,7 +56,7 @@ public: public: SequenceContext *_context; Sequencer *_sequencer; - Common::Array<SequenceItem*> _items; + Array<SequenceItem*> _items; int _unk; }; diff --git a/engines/pink/objects/sequences/sequence_item.cpp b/engines/pink/objects/sequences/sequence_item.cpp index a6574b15de..07c708baf5 100644 --- a/engines/pink/objects/sequences/sequence_item.cpp +++ b/engines/pink/objects/sequences/sequence_item.cpp @@ -34,7 +34,8 @@ namespace Pink { void SequenceItem::deserialize(Archive &archive) { - archive >> _actor >> _action; + _actor = archive.readString(); + _action = archive.readString(); } void SequenceItem::toConsole() { diff --git a/engines/pink/objects/sequences/sequencer.cpp b/engines/pink/objects/sequences/sequencer.cpp index b8628193ff..852011cce7 100644 --- a/engines/pink/objects/sequences/sequencer.cpp +++ b/engines/pink/objects/sequences/sequencer.cpp @@ -44,7 +44,8 @@ Sequencer::~Sequencer() { } void Sequencer::deserialize(Archive &archive) { - archive >> _sequences >> _timers; + _sequences.deserialize(archive); + _timers.deserialize(archive); } Sequence *Sequencer::findSequence(const Common::String &name) { diff --git a/engines/pink/objects/sequences/sequencer.h b/engines/pink/objects/sequences/sequencer.h index 850649d23e..a48439768b 100644 --- a/engines/pink/objects/sequences/sequencer.h +++ b/engines/pink/objects/sequences/sequencer.h @@ -23,8 +23,6 @@ #ifndef PINK_SEQUENCER_H #define PINK_SEQUENCER_H -#include "common/array.h" - #include "pink/objects/object.h" namespace Pink { @@ -62,10 +60,10 @@ public: SequenceContext *_context; // context array - Common::Array<Sequence*> _sequences; - Common::String _currentSequenceName; - Common::Array<SeqTimer*> _timers; - GamePage *_page; + Array<Sequence*> _sequences; + Array<SeqTimer*> _timers; + Common::String _currentSequenceName; + GamePage *_page; uint _time; }; diff --git a/engines/pink/objects/side_effect.cpp b/engines/pink/objects/side_effect.cpp index cbd8291498..79d1c7fb2f 100644 --- a/engines/pink/objects/side_effect.cpp +++ b/engines/pink/objects/side_effect.cpp @@ -33,7 +33,8 @@ namespace Pink { void SideEffectExit::deserialize(Archive &archive) { - archive >> _nextModule >> _nextPage; + _nextModule = archive.readString(); + _nextPage = archive.readString(); } void SideEffectExit::execute(Actor *actor) { @@ -45,7 +46,7 @@ void SideEffectExit::toConsole() { } void SideEffectLocation::deserialize(Archive &archive) { - archive >> _location; + _location = archive.readString(); } void SideEffectLocation::execute(Actor *actor) { @@ -60,7 +61,8 @@ void SideEffectLocation::toConsole() { } void SideEffectInventoryItemOwner::deserialize(Archive &archive) { - archive >> _item >> _owner; + _item = archive.readString(); + _owner = archive.readString(); } void SideEffectInventoryItemOwner::execute(Actor *actor) { @@ -74,7 +76,8 @@ void SideEffectInventoryItemOwner::toConsole() { } void SideEffectVariable::deserialize(Pink::Archive &archive) { - archive >> _name >> _value; + _name = archive.readString(); + _value = archive.readString(); } void SideEffectGameVariable::execute(Actor *actor) { @@ -102,7 +105,8 @@ void SideEffectPageVariable::toConsole() { } void SideEffectRandomPageVariable::deserialize(Archive &archive) { - archive >> _name >> _values; + _name = archive.readString(); + _values.deserialize(archive); } void SideEffectRandomPageVariable::execute(Actor *actor) { diff --git a/engines/pink/objects/side_effect.h b/engines/pink/objects/side_effect.h index da6d548753..1a08d854e5 100644 --- a/engines/pink/objects/side_effect.h +++ b/engines/pink/objects/side_effect.h @@ -23,8 +23,7 @@ #ifndef PINK_SIDE_EFFECT_H #define PINK_SIDE_EFFECT_H -#include "common/str-array.h" - +#include "pink/utils.h" #include "pink/objects/object.h" namespace Pink { @@ -46,6 +45,7 @@ public: private: Common::String _nextModule; Common::String _nextPage; + Common::StringMap map; }; class SideEffectLocation : public SideEffect { @@ -106,9 +106,9 @@ public: private: Common::String _name; - Common::StringArray _values; + StringArray _values; }; -} +} // End of namespace Pink #endif diff --git a/engines/pink/objects/walk/walk_location.cpp b/engines/pink/objects/walk/walk_location.cpp index da5718f3d9..e3998daeb5 100644 --- a/engines/pink/objects/walk/walk_location.cpp +++ b/engines/pink/objects/walk/walk_location.cpp @@ -29,7 +29,7 @@ namespace Pink { void WalkLocation::deserialize(Pink::Archive &archive) { NamedObject::deserialize(archive); - archive >> _neighbors; + _neighbors.deserialize(archive); } void WalkLocation::toConsole() { diff --git a/engines/pink/objects/walk/walk_location.h b/engines/pink/objects/walk/walk_location.h index 3de039002d..b9b2a0abae 100644 --- a/engines/pink/objects/walk/walk_location.h +++ b/engines/pink/objects/walk/walk_location.h @@ -22,9 +22,7 @@ #ifndef PINK_WALK_LOCATION_H #define PINK_WALK_LOCATION_H -#include "common/str-array.h" - -#include "pink/objects/object.h" +#include "pink/utils.h" namespace Pink { @@ -35,7 +33,7 @@ public: Common::StringArray &getNeigbors() { return _neighbors;} private: - Common::StringArray _neighbors; + StringArray _neighbors; }; } // End of namespace Pink diff --git a/engines/pink/objects/walk/walk_mgr.cpp b/engines/pink/objects/walk/walk_mgr.cpp index ad447a94bf..4c0b120918 100644 --- a/engines/pink/objects/walk/walk_mgr.cpp +++ b/engines/pink/objects/walk/walk_mgr.cpp @@ -37,7 +37,7 @@ WalkMgr::WalkMgr() void WalkMgr::deserialize(Pink::Archive &archive) { _leadActor = static_cast<LeadActor *>(archive.readObject()); - archive >> _locations; + _locations.deserialize(archive); } WalkLocation *WalkMgr::findLocation(const Common::String &name) { diff --git a/engines/pink/objects/walk/walk_mgr.h b/engines/pink/objects/walk/walk_mgr.h index 522dcf884c..994796942b 100644 --- a/engines/pink/objects/walk/walk_mgr.h +++ b/engines/pink/objects/walk/walk_mgr.h @@ -23,8 +23,6 @@ #ifndef PINK_WALK_MGR_H #define PINK_WALK_MGR_H -#include "common/array.h" - #include "pink/objects/object.h" #include "pink/objects/walk/walk_shortest_path.h" @@ -65,7 +63,7 @@ private: LeadActor *_leadActor; WalkLocation *_destination; - Common::Array<WalkLocation*> _locations; + Array<WalkLocation*> _locations; WayPoint _current; WayPoint _next; bool _isWalking; |