diff options
Diffstat (limited to 'engines/illusions/gamestate.h')
-rw-r--r-- | engines/illusions/gamestate.h | 53 |
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 |