aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorrichiesams2013-09-03 23:57:19 -0500
committerrichiesams2013-09-04 00:16:44 -0500
commitac578bf9b7b9c58dbaad58c874517b7af45dfa3f (patch)
tree9c80b6f9736eb1ce7cf26c2becc70fe6e2ce3342 /engines
parent11bf2405f80378dd49d539d61384bad7b32daad0 (diff)
downloadscummvm-rg350-ac578bf9b7b9c58dbaad58c874517b7af45dfa3f.tar.gz
scummvm-rg350-ac578bf9b7b9c58dbaad58c874517b7af45dfa3f.tar.bz2
scummvm-rg350-ac578bf9b7b9c58dbaad58c874517b7af45dfa3f.zip
ZVISION: Implement TimerNode serialization
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/timer_node.cpp11
-rw-r--r--engines/zvision/timer_node.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/engines/zvision/timer_node.cpp b/engines/zvision/timer_node.cpp
index c9ef9d29d1..81468dbb0b 100644
--- a/engines/zvision/timer_node.cpp
+++ b/engines/zvision/timer_node.cpp
@@ -22,6 +22,8 @@
#include "common/scummsys.h"
+#include "common/stream.h"
+
#include "zvision/timer_node.h"
#include "zvision/zvision.h"
#include "zvision/script_manager.h"
@@ -43,4 +45,13 @@ bool TimerNode::process(uint32 deltaTimeInMillis) {
return false;
}
+void TimerNode::serialize(Common::WriteStream *stream) {
+ stream->writeUint32LE(_key);
+ stream->writeUint32LE(_timeLeft);
+}
+
+void TimerNode::deserialize(Common::SeekableReadStream *stream) {
+ _timeLeft = stream->readUint32LE();
+}
+
} // End of namespace ZVision
diff --git a/engines/zvision/timer_node.h b/engines/zvision/timer_node.h
index d692f1f0ca..21c344bb15 100644
--- a/engines/zvision/timer_node.h
+++ b/engines/zvision/timer_node.h
@@ -43,6 +43,9 @@ public:
* @return If true, the node can be deleted after process() finishes
*/
bool process(uint32 deltaTimeInMillis);
+ void serialize(Common::WriteStream *stream);
+ void deserialize(Common::SeekableReadStream *stream);
+ inline bool needsSerialization() { return true; }
private:
uint32 _timeLeft;