ScummVM API documentation
chamber.h
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 modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (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, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef CHAMBER_H
23 #define CHAMBER_H
24 #define RUNCOMMAND_RESTART 1337
25 
26 #include "common/random.h"
27 #include "common/serializer.h"
28 #include "common/rendermode.h"
29 #include "engines/engine.h"
30 #include "gui/debugger.h"
31 
32 namespace Audio {
33 class SoundHandle;
34 class PCSpeaker;
35 }
36 
37 struct ADGameDescription;
38 
39 namespace Chamber {
40 
41 class ChamberEngine : public Engine {
42 private:
43  // We need random numbers
45 
46 public:
47  ChamberEngine(OSystem *syst, const ADGameDescription *desc);
48  ~ChamberEngine();
49 
50  Common::Language getLanguage() const;
51 
52  Common::Error run() override;
53  Common::Error init();
54  Common::Error execute();
55  bool hasFeature(EngineFeature f) const override;
56  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override { return true; }
57  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override { return true; }
58  Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
59  Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
60  void syncGameStream(Common::Serializer &s);
61 
62  byte readKeyboardChar();
63 
64  void initSound();
65  void deinitSound();
66 
67 public:
68  bool _shouldQuit;
69  bool _shouldRestart;
70  bool _prioritycommand_1;
71  bool _prioritycommand_2;
72 
73  Common::RenderMode _videoMode;
74 
75  byte *_pxiData;
76 
77  uint16 _screenW;
78  uint16 _screenH;
79  uint8 _screenBits;
80  uint16 _line_offset;
81  uint16 _line_offset2;
82  uint8 _screenPPB;
83  uint16 _screenBPL;
84  uint8 _fontHeight;
85  uint8 _fontWidth;
86 
87 
88  Audio::PCSpeaker *_speakerStream;
89  Audio::SoundHandle *_speakerHandle;
90 
91 private:
92  const ADGameDescription *_gameDescription;
93 };
94 
95 void init(void);
96 
97 extern ChamberEngine *g_vm;
98 
99 } // End of namespace Chamber
100 
101 #endif
uint8 _screenPPB
Pixels per byte.
Definition: chamber.h:82
EngineFeature
Definition: engine.h:253
Definition: stream.h:77
Definition: error.h:84
Definition: advancedDetector.h:163
uint8 _fontWidth
Font height.
Definition: chamber.h:85
Definition: random.h:44
uint16 _screenW
Screen Width.
Definition: chamber.h:77
RenderMode
Definition: rendermode.h:48
Definition: chamber.h:41
Definition: stream.h:745
Definition: serializer.h:79
Definition: mixer.h:49
uint16 _line_offset2
Memory offset of blanks.
Definition: chamber.h:81
Definition: anim.h:25
Definition: ustr.h:57
uint8 _fontHeight
Font height.
Definition: chamber.h:84
uint16 _line_offset
Memory offset of blanks.
Definition: chamber.h:80
uint16 _screenBPL
Bytes per line.
Definition: chamber.h:83
uint8 _screenBits
Bits per pixel.
Definition: chamber.h:79
uint16 _screenH
Screen Height.
Definition: chamber.h:78
Definition: system.h:161
Definition: engine.h:144
Definition: pcspk.h:31
Definition: system.h:38
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: chamber.h:57
Language
Definition: language.h:45
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: chamber.h:56