aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/gamestate.h
diff options
context:
space:
mode:
authorjohndoe1232015-12-04 23:20:22 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commitaed38527010e7b155af469d0521aa07e7fd7d12e (patch)
tree95a5ce5eb4ce90fe1500a6265090a5292c5faf17 /engines/illusions/gamestate.h
parent6b36b750c2567c32d20f8f7868a8b664baac5cde (diff)
downloadscummvm-rg350-aed38527010e7b155af469d0521aa07e7fd7d12e.tar.gz
scummvm-rg350-aed38527010e7b155af469d0521aa07e7fd7d12e.tar.bz2
scummvm-rg350-aed38527010e7b155af469d0521aa07e7fd7d12e.zip
ILLUSIONS: Implement save/load functionality
- Only works in Duckman at the moment - Only via the ScummVM main menu for now, save/load via the game's menu to be implemented
Diffstat (limited to 'engines/illusions/gamestate.h')
-rw-r--r--engines/illusions/gamestate.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/engines/illusions/gamestate.h b/engines/illusions/gamestate.h
new file mode 100644
index 0000000000..5f279ff0c3
--- /dev/null
+++ b/engines/illusions/gamestate.h
@@ -0,0 +1,53 @@
+/* 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 ILLUSIONS_GAMESTATE_H
+#define ILLUSIONS_GAMESTATE_H
+
+#include "common/file.h"
+#include "common/memstream.h"
+
+namespace Illusions {
+
+class GameState {
+public:
+ GameState();
+ virtual ~GameState();
+ bool readState(uint32 &sceneId, uint32 &threadId);
+ void writeState(uint32 sceneId, uint32 threadId);
+ void read(Common::ReadStream *in);
+ void write(Common::WriteStream *out);
+ void deleteReadStream();
+protected:
+ uint32 _writeBufferSize;
+ byte *_writeBuffer;
+ Common::SeekableReadStream *_readStream;
+ Common::WriteStream *newWriteStream();
+ uint32 calcWriteBufferSize();
+ virtual uint32 calcWriteBufferSizeInternal() = 0;
+ virtual bool readStateInternal(Common::ReadStream *in) = 0;
+ virtual void writeStateInternal(Common::WriteStream *out) = 0;
+};
+
+} // End of namespace Illusions
+
+#endif // ILLUSIONS_GAMESTATE_H