1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef GLK_FROTZ_FROTZ
24 #define GLK_FROTZ_FROTZ
25 
26 #include "glk/frotz/processor.h"
27 
28 namespace Glk {
29 namespace Frotz {
30 
31 class FrotzScreen;
32 
33 /**
34  * Frotz interpreter for Z-code games
35  */
36 class Frotz : public Processor {
37 	friend class FrotzScreen;
38 protected:
39 	/**
40 	 * Setup the video mode
41 	 */
42 	virtual void initGraphicsMode();
43 
44 	/**
45 	 * Create the screen class
46 	 */
47 	virtual Screen *createScreen() override;
48 public:
49 	/**
50 	 * Constructor
51 	 */
52 	Frotz(OSystem *syst, const GlkGameDescription &gameDesc);
53 
54 	/**
55 	 * Destructor
56 	 */
57 	virtual ~Frotz();
58 
59 	/**
60 	 * Initialization
61 	 */
62 	void initialize();
63 
64 	/**
65 	 * Returns the running interpreter type
66 	 */
getInterpreterType()67 	virtual InterpreterType getInterpreterType() const override { return INTERPRETER_FROTZ; }
68 
69 	/**
70 	 * Execute the game
71 	 */
72 	virtual void runGame() override;
73 
74 	/**
75 	 * Load a savegame from a given slot
76 	 */
77 	virtual Common::Error loadGameState(int slot) override;
78 
79 	/**
80 	 * Save the game to a given slot
81 	 */
82 	virtual Common::Error saveGameState(int slot, const Common::String &desc) override;
83 
84 	/**
85 	 * Loading method not used for Frotz sub-engine
86 	 */
readSaveData(Common::SeekableReadStream * rs)87 	virtual Common::Error readSaveData(Common::SeekableReadStream *rs) override { return Common::kReadingFailed; }
88 
89 	/**
90 	 * Saving method not used for Frotz sub-engine
91 	 */
writeGameData(Common::WriteStream * ws)92 	virtual Common::Error writeGameData(Common::WriteStream *ws) override { return Common::kWritingFailed; }
93 
94 };
95 
96 extern Frotz *g_vm;
97 
98 } // End of namespace Frotz
99 } // End of namespace Glk
100 
101 #endif
102