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 enum CHAMBERActions {
42  kActionNone,
43  kActionInteract,
44  kActionQuit,
45  kActionYes,
46  kActionNo,
47 };
48 
49 class ChamberEngine : public Engine {
50 private:
51  // We need random numbers
53 
54 public:
55  ChamberEngine(OSystem *syst, const ADGameDescription *desc);
56  ~ChamberEngine();
57 
58  Common::Language getLanguage() const;
59 
60  Common::Error run() override;
61  Common::Error init();
62  Common::Error execute();
63  bool hasFeature(EngineFeature f) const override;
64  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override { return true; }
65  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override { return true; }
66  Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
67  Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
68  void syncGameStream(Common::Serializer &s);
69 
70  byte readKeyboardChar();
71 
72  void initSound();
73  void deinitSound();
74 
75 public:
76  bool _shouldQuit;
77  bool _shouldRestart;
78  bool _prioritycommand_1;
79  bool _prioritycommand_2;
80 
81  Common::RenderMode _videoMode;
82 
83  byte *_pxiData;
84 
85  uint16 _screenW;
86  uint16 _screenH;
87  uint8 _screenBits;
88  uint16 _line_offset;
89  uint16 _line_offset2;
90  uint8 _screenPPB;
91  uint16 _screenBPL;
92  uint8 _fontHeight;
93  uint8 _fontWidth;
94 
95 
96  Audio::PCSpeaker *_speaker;
97 
98 private:
99  const ADGameDescription *_gameDescription;
100 };
101 
102 void init(void);
103 
104 extern ChamberEngine *g_vm;
105 
106 } // End of namespace Chamber
107 
108 #endif
uint8 _screenPPB
Pixels per byte.
Definition: chamber.h:90
EngineFeature
Definition: engine.h:260
Definition: stream.h:77
Definition: error.h:81
Definition: advancedDetector.h:164
uint8 _fontWidth
Font height.
Definition: chamber.h:93
Definition: random.h:44
uint16 _screenW
Screen Width.
Definition: chamber.h:85
RenderMode
Definition: rendermode.h:48
Definition: chamber.h:49
Definition: stream.h:745
Definition: serializer.h:79
uint16 _line_offset2
Memory offset of blanks.
Definition: chamber.h:89
Definition: anim.h:25
Definition: ustr.h:57
uint8 _fontHeight
Font height.
Definition: chamber.h:92
uint16 _line_offset
Memory offset of blanks.
Definition: chamber.h:88
uint16 _screenBPL
Bytes per line.
Definition: chamber.h:91
uint8 _screenBits
Bits per pixel.
Definition: chamber.h:87
uint16 _screenH
Screen Height.
Definition: chamber.h:86
Definition: system.h:163
Definition: engine.h:146
Definition: pcspk.h:34
Definition: system.h:38
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: chamber.h:65
Language
Definition: language.h:45
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: chamber.h:64