ScummVM API documentation
wintermute.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 WINTERMUTE_WINTERMUTE_H
23 #define WINTERMUTE_WINTERMUTE_H
24 
25 #include "engines/engine.h"
26 #include "gui/debugger.h"
27 #include "common/fs.h"
28 #include "wintermute/detection.h"
29 
30 namespace Wintermute {
31 
32 class Console;
33 class BaseGame;
34 class SystemClassRegistry;
35 class DebuggerController;
36 
37 const int INT_MAX_VALUE = 0x7fffffff;
38 const int INT_MIN_VALUE = -INT_MAX_VALUE - 1;
39 const uint UINT_MAX_VALUE = 0xffffffff;
40 
41 // our engine debug channels
42 enum {
43  kWintermuteDebugLog = 1 << 0, // The debug-logs from the original engine
44  kWintermuteDebugSaveGame = 1 << 1,
45  kWintermuteDebugFont = 1 << 2, // next new channel must be 1 << 2 (4)
46  kWintermuteDebugFileAccess = 1 << 3, // the current limitation is 32 debug channels (1 << 31 is the last one)
47  kWintermuteDebugAudio = 1 << 4,
48  kWintermuteDebugGeneral = 1 << 5
49 };
50 
51 class WintermuteEngine : public Engine {
52 public:
53  WintermuteEngine(OSystem *syst, const WMEGameDescription *desc);
55  ~WintermuteEngine() override;
56 
57  virtual Wintermute::Console *getConsole() { return _debugger; }
58 
59  Common::Error run() override;
60  bool hasFeature(EngineFeature f) const override;
61  Common::SaveFileManager *getSaveFileMan() { return _saveFileMan; }
62  Common::Error loadGameState(int slot) override;
63  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
64  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
65  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
66  // For detection-purposes:
67  static bool getGameInfo(const Common::FSList &fslist, Common::String &name, Common::String &caption);
68 private:
69  int init();
70  void deinit();
71  int messageLoop();
72  Wintermute::Console *_debugger;
73  BaseGame *_game;
74  Wintermute::DebuggerController *_dbgController;
75  const WMEGameDescription *_gameDescription;
76 
77  friend class Console;
78  friend class DebuggerController;
79 };
80 
81 } // End of namespace Wintermute
82 
83 #endif
Definition: base_game.h:75
Definition: str.h:59
Definition: debugger.h:62
EngineFeature
Definition: engine.h:250
Definition: error.h:84
Common::Error loadGameState(int slot) override
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
Definition: debugger_controller.h:59
Common::Error run() override
Definition: wintermute.h:51
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: ustr.h:57
Definition: fs.h:57
Definition: detection.h:131
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: savefile.h:142
Definition: system.h:167
Definition: engine.h:143
bool hasFeature(EngineFeature f) const override
Common::SaveFileManager * _saveFileMan
Definition: engine.h:166
Definition: achievements_tables.h:27