ScummVM
adrift.cpp
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 #include "glk/adrift/adrift.h"
24 #include "glk/adrift/os_glk.h"
25 #include "glk/adrift/scprotos.h"
27 
28 namespace Glk {
29 namespace Adrift {
30 
31 Adrift *g_vm = nullptr;
32 
33 Adrift::Adrift(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, gameDesc) {
34  g_vm = this;
35 }
36 
39  adrift_main();
40 }
41 
42 Common::Error Adrift::readSaveData(Common::SeekableReadStream *rs) {
45 }
46 
47 Common::Error Adrift::writeGameData(Common::WriteStream *ws) {
49  return Common::kNoError;
50 }
51 
54  return rs->read(buffer, length);
55 }
56 
59  ws->write(buffer, length);
60 }
61 
62 } // End of namespace Adrift
63 } // End of namespace Glk
Common::SeekableReadStream
Interface for a seekable & readable data stream.
Definition: stream.h:569
Glk::Adrift::if_write_saved_game
void if_write_saved_game(void *opaque, const sc_byte *buffer, sc_int length)
Definition: scinterf.cpp:224
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
Glk::Adrift::adrift_startup_code
bool adrift_startup_code(Common::SeekableReadStream *gameFile)
Definition: os_glk.cpp:3083
Glk::Adrift::LoadSerializer
Loading serializer class.
Definition: serialization.h:101
Glk::Adrift::LoadSerializer::load
bool load()
Does the loading.
Definition: serialization.cpp:236
Common::Error
An Error instance pairs an error code with string description providing more details about the error.
Definition: error.h:77
Common::kReadingFailed
Failed to read a file (permission denied?)
Definition: error.h:59
Glk::GlkEngine::_gameFile
Common::File _gameFile
Definition: glk.h:80
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
scprotos.h
Glk::Adrift::sc_byte
unsigned char sc_byte
Definition: scare.h:45
Common::ReadStream::read
virtual uint32 read(void *dataPtr, uint32 dataSize)=0
Read data from the stream.
runGame
static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common::String &edebuglevels)
Definition: main.cpp:155
Common::WriteStream::write
virtual uint32 write(const void *dataPtr, uint32 dataSize)=0
Write data into the stream.
Common::WriteStream
Generic interface for a writable data stream.
Definition: stream.h:65
Glk::Adrift::adrift_main
void adrift_main()
Definition: os_glk.cpp:3030
adrift.h
Glk::Adrift::SaveSerializer
Saving serializer class.
Definition: serialization.h:37
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
Common::kNoError
No error occurred.
Definition: error.h:45
Glk::Adrift::if_read_saved_game
sc_int if_read_saved_game(void *opaque, sc_byte *buffer, sc_int length)
Definition: scinterf.cpp:230
serialization.h
Glk::Adrift::gsc_game
sc_game gsc_game
Definition: os_glk.cpp:82
Glk::Adrift::g_vm
Adrift * g_vm
Definition: adrift.cpp:31
Glk::GlkGameDescription
Definition: glk.h:58
os_glk.h
Glk::Adrift::sc_game_s
Definition: scgamest.h:112