ScummVM
adrift.h
Go to the documentation of this file.
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 /* Based on Scare interpreter 1.3.10 */
24 
25 #ifndef GLK_ADRIFT_ADRIFT
26 #define GLK_ADRIFT_ADRIFT
27 
28 #include "common/scummsys.h"
29 #include "common/serializer.h"
30 #include "common/stack.h"
31 #include "glk/glk_api.h"
32 #include "glk/adrift/scare.h"
33 
34 namespace Glk {
35 namespace Adrift {
36 
40 class Adrift : public GlkAPI {
41 private:
42  static void if_write_saved_game(void *opaque, const sc_byte *buffer, sc_int length);
43  static sc_int if_read_saved_game(void *opaque, sc_byte *buffer, sc_int length);
44 public:
48  Adrift(OSystem *syst, const GlkGameDescription &gameDesc);
49 
53  void runGame() override;
54 
59  return INTERPRETER_ADRIFT;
60  }
61 
66 
72 };
73 
74 extern Adrift *g_vm;
75 
76 } // End of namespace Alan2
77 } // End of namespace Glk
78 
79 #endif
Common::SeekableReadStream
Interface for a seekable & readable data stream.
Definition: stream.h:569
length
uint32 length
Definition: voc.cpp:106
Glk
Contains the necessary data structures andfunctions for adding to andreferring to the ID table(a very...
Definition: adrift.cpp:28
scummsys.h
Common::Error
An Error instance pairs an error code with string description providing more details about the error.
Definition: error.h:77
glk_api.h
Glk::AGT::buffer
static uchar * buffer
Definition: util.cpp:518
Glk::Adrift::Adrift::if_read_saved_game
static sc_int if_read_saved_game(void *opaque, sc_byte *buffer, sc_int length)
Definition: adrift.cpp:52
stack.h
Glk::Adrift::Adrift::writeGameData
Common::Error writeGameData(Common::WriteStream *ws) override
Save the game.
Definition: adrift.cpp:47
Glk::Adrift::sc_byte
unsigned char sc_byte
Definition: scare.h:45
Glk::Adrift::Adrift::getInterpreterType
InterpreterType getInterpreterType() const override
Returns the running interpreter type.
Definition: adrift.h:58
Glk::Adrift::Adrift::Adrift
Adrift(OSystem *syst, const GlkGameDescription &gameDesc)
Constructor.
Definition: adrift.cpp:33
serializer.h
Glk::InterpreterType
InterpreterType
List of the different sub-engines the engine will likely eventually support.
Definition: glk_types.h:37
Common::WriteStream
Generic interface for a writable data stream.
Definition: stream.h:65
Glk::Adrift::Adrift::if_write_saved_game
static void if_write_saved_game(void *opaque, const sc_byte *buffer, sc_int length)
Definition: adrift.cpp:57
Glk::GlkAPI
Implements the GLK interface.
Definition: glk_api.h:50
Glk::Adrift::Adrift
Adrift game interpreter.
Definition: adrift.h:40
Glk::Adrift::sc_int
long sc_int
Definition: scare.h:46
OSystem
Interface for ScummVM backends.
Definition: system.h:114
Glk::INTERPRETER_ADRIFT
Definition: glk_types.h:38
Glk::Adrift::Adrift::runGame
void runGame() override
Run the game.
Definition: adrift.cpp:37
Glk::Adrift::Adrift::readSaveData
Common::Error readSaveData(Common::SeekableReadStream *rs) override
Load a savegame from the passed Quetzal file chunk stream.
Definition: adrift.cpp:42
Glk::Adrift::g_vm
Adrift * g_vm
Definition: adrift.cpp:31
Glk::GlkGameDescription
Definition: glk.h:58
scare.h