diff options
-rw-r--r-- | engines/pink/objects/sequences/seq_timer.cpp | 46 | ||||
-rw-r--r-- | engines/pink/objects/sequences/seq_timer.h | 48 | ||||
-rw-r--r-- | engines/pink/objects/sequences/sequence.cpp | 1 | ||||
-rw-r--r-- | engines/pink/objects/sequences/sequence.h | 2 | ||||
-rw-r--r-- | engines/pink/objects/sequences/sequence_item.h | 5 | ||||
-rw-r--r-- | engines/pink/objects/sequences/sequencer.cpp | 4 | ||||
-rw-r--r-- | engines/pink/objects/sequences/sequencer.h | 3 |
7 files changed, 101 insertions, 8 deletions
diff --git a/engines/pink/objects/sequences/seq_timer.cpp b/engines/pink/objects/sequences/seq_timer.cpp new file mode 100644 index 0000000000..d2b761cfed --- /dev/null +++ b/engines/pink/objects/sequences/seq_timer.cpp @@ -0,0 +1,46 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "seq_timer.h" +#include <engines/pink/archive.h> +#include "./sequencer.h" +#include <common/debug.h> + +namespace Pink { + +SeqTimer::SeqTimer() + : _unk(0) { + +} + +void SeqTimer::deserialize(Archive &archive) { + archive >> _actor; + _period = archive.readDWORD(); + _range = archive.readDWORD(); + _sequencer = static_cast<Sequencer*>(archive.readObject()); +} + +void SeqTimer::toConsole() { + debug("\tSeqTimer: _actor=%s _period=%u _range=%u", _actor.c_str(), _period, _range); +} + +} // End of namespace Pink
\ No newline at end of file diff --git a/engines/pink/objects/sequences/seq_timer.h b/engines/pink/objects/sequences/seq_timer.h new file mode 100644 index 0000000000..4319b9279a --- /dev/null +++ b/engines/pink/objects/sequences/seq_timer.h @@ -0,0 +1,48 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef PINK_SEQ_TIMER_H +#define PINK_SEQ_TIMER_H + +#include <engines/pink/objects/object.h> + +namespace Pink { + +class Sequencer; + +class SeqTimer : public Object { +public: + SeqTimer(); + virtual void deserialize(Archive &archive); + virtual void toConsole(); + +private: + Common::String _actor; + int _period; + int _range; + int _unk; + Sequencer *_sequencer; +}; + +} // End of namespace Pink + +#endif diff --git a/engines/pink/objects/sequences/sequence.cpp b/engines/pink/objects/sequences/sequence.cpp index 0af8f1a3fa..bad96213c6 100644 --- a/engines/pink/objects/sequences/sequence.cpp +++ b/engines/pink/objects/sequences/sequence.cpp @@ -114,6 +114,7 @@ SequenceContext::SequenceContext(Sequence *sequence, Sequencer *sequencer) sequence->setContext(this); Common::Array<SequenceItem*> &items = sequence->getItems(); debug("SequenceContext for %s", _sequence->getName().c_str()); + for (uint i = 0; i < items.size(); ++i) { bool found = 0; for (uint j = 0; j < _states.size(); ++j) { diff --git a/engines/pink/objects/sequences/sequence.h b/engines/pink/objects/sequences/sequence.h index f2f324b8ca..bdf11b2f4f 100644 --- a/engines/pink/objects/sequences/sequence.h +++ b/engines/pink/objects/sequences/sequence.h @@ -62,7 +62,7 @@ public: public: Common::String _actorName; - Common::String _actionName; // ?state + Common::String _actionName; int _unk; }; diff --git a/engines/pink/objects/sequences/sequence_item.h b/engines/pink/objects/sequences/sequence_item.h index 70fc68d9c7..1507aa8890 100644 --- a/engines/pink/objects/sequences/sequence_item.h +++ b/engines/pink/objects/sequences/sequence_item.h @@ -49,14 +49,13 @@ protected: class SequenceItemLeader : public SequenceItem { public: virtual void toConsole(); - virtual bool isLeader(); }; +// behaviour is identical to SequenceItemLeader class SequenceItemLeaderAudio : public SequenceItemLeader { - virtual void deserialize(Archive &archive); - public: + virtual void deserialize(Archive &archive); virtual void toConsole(); private: diff --git a/engines/pink/objects/sequences/sequencer.cpp b/engines/pink/objects/sequences/sequencer.cpp index d97e8f504b..1f667cf3cc 100644 --- a/engines/pink/objects/sequences/sequencer.cpp +++ b/engines/pink/objects/sequences/sequencer.cpp @@ -39,9 +39,7 @@ Sequencer::~Sequencer() { } void Sequencer::deserialize(Archive &archive) { - archive >> _sequences; - archive.readCount();// intro have 0 timers; - //serialize timers; + archive >> _sequences >> _timers; } Sequence *Sequencer::findSequence(const Common::String &name) { diff --git a/engines/pink/objects/sequences/sequencer.h b/engines/pink/objects/sequences/sequencer.h index d292346314..36e9ba0c74 100644 --- a/engines/pink/objects/sequences/sequencer.h +++ b/engines/pink/objects/sequences/sequencer.h @@ -32,6 +32,7 @@ namespace Pink { class Sequence; class SequenceContext; class GamePage; +class SeqTimer; class Sequencer : public Object { public: @@ -49,7 +50,7 @@ public: // unknown objects array Common::Array<Sequence*> _sequences; Common::String _currentSequenceName; - //timers + Common::Array<SeqTimer*> _timers; GamePage *_page; int unk; }; |