scummvm/engines/chamber/chamber.h

102 lines
2.7 KiB
C
Raw Normal View History

2021-09-13 00:35:17 +02:00
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
2023-02-14 15:56:06 +01:00
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
2021-09-13 00:35:17 +02:00
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2023-02-14 15:56:06 +01:00
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2021-09-13 00:35:17 +02:00
*
*/
#ifndef CHAMBER_H
#define CHAMBER_H
#define RUNCOMMAND_RESTART 1337
2021-09-13 00:35:17 +02:00
#include "common/random.h"
#include "common/serializer.h"
#include "common/rendermode.h"
2021-09-13 00:35:17 +02:00
#include "engines/engine.h"
#include "gui/debugger.h"
namespace Audio {
class SoundHandle;
class PCSpeaker;
}
2021-09-13 00:35:17 +02:00
2021-10-06 17:34:13 +03:00
struct ADGameDescription;
namespace Chamber {
2021-09-13 00:35:17 +02:00
class ChamberEngine : public Engine {
private:
// We need random numbers
Common::RandomSource *_rnd;
2021-09-16 23:45:50 +02:00
2021-09-13 00:35:17 +02:00
public:
2021-10-06 17:34:13 +03:00
ChamberEngine(OSystem *syst, const ADGameDescription *desc);
2021-09-13 00:35:17 +02:00
~ChamberEngine();
2021-10-06 17:34:13 +03:00
Common::Language getLanguage() const;
2021-09-13 00:35:17 +02:00
Common::Error run() override;
Common::Error init();
Common::Error execute();
2021-09-13 00:35:17 +02:00
bool hasFeature(EngineFeature f) const override;
bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override { return true; }
bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override { return true; }
2021-09-13 00:35:17 +02:00
Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
void syncGameStream(Common::Serializer &s);
2021-09-16 23:45:50 +02:00
byte readKeyboardChar();
void initSound();
void deinitSound();
public:
bool _shouldQuit;
bool _shouldRestart;
bool _prioritycommand_1;
bool _prioritycommand_2;
Common::RenderMode _videoMode;
byte *_pxiData;
uint16 _screenW; ///< Screen Width
uint16 _screenH; ///< Screen Height
uint8 _screenBits; ///< Bits per pixel
uint16 _line_offset; ///< Memory offset of blanks
uint16 _line_offset2; ///< Memory offset of blanks
uint8 _screenPPB; ///< Pixels per byte
uint16 _screenBPL; ///< Bytes per line
uint8 _fontHeight; ///< Font height
uint8 _fontWidth; ///< Font height
Audio::PCSpeaker *_speakerStream;
Audio::SoundHandle *_speakerHandle;
2021-10-06 17:34:13 +03:00
private:
const ADGameDescription *_gameDescription;
2021-09-13 00:35:17 +02:00
};
2021-09-16 14:22:18 +02:00
void init(void);
2021-09-16 13:48:50 +02:00
extern ChamberEngine *g_vm;
2021-09-13 00:35:17 +02:00
} // End of namespace Chamber
#endif