ScummVM API documentation
ultima_early.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 ULTIMA_SHARED_EARLY_ULTIMA_EARLY_H
23 #define ULTIMA_SHARED_EARLY_ULTIMA_EARLY_H
24 
25 #include "common/scummsys.h"
26 #include "common/array.h"
27 #include "common/endian.h"
28 #include "common/hash-str.h"
29 #include "common/serializer.h"
30 #include "common/random.h"
31 #include "common/savefile.h"
32 #include "common/util.h"
33 #include "graphics/surface.h"
34 #include "engines/engine.h"
35 #include "ultima/detection.h"
36 
37 #include "ultima/shared/engine/events.h"
38 #include "ultima/shared/engine/ultima.h"
39 
40 namespace Ultima {
41 
42 struct UltimaGameDescription;
43 
44 namespace Shared {
45 
47  uint8 _version;
48  uint8 _gameId;
49  uint8 _language;
50  uint8 _videoMode;
51  Common::String _saveName;
52  Graphics::Surface *_thumbnail;
53  int _year, _month, _day;
54  int _hour, _minute;
55  int _totalFrames;
56 };
57 
58 class Debugger;
59 class Events;
60 class Game;
61 class GameBase;
62 class MouseCursor;
63 class Resources;
64 
65 namespace Gfx {
66 class Screen;
67 }
68 
70 private:
74  bool initialize() override;
75 
80  void deinitialize() override;
81 
85  bool isDataRequired(Common::Path &folder, int &majorVersion, int &minorVersion) override;
86 public:
87  GameBase *_game;
88  MouseCursor *_mouseCursor;
89  Gfx::Screen *_screen;
90  EventsManager *_events;
91 public:
92  UltimaEarlyEngine(OSystem *syst, const UltimaGameDescription *gameDesc);
93  ~UltimaEarlyEngine() override;
94 
98  Common::Error run() override;
99 
103  void playGame();
104 
108  Graphics::Screen *getScreen() const override;
113  bool canLoadGameStateCurrently(bool isAutosave) override;
114 
119  bool canSaveGameStateCurrently(bool isAutosave) override;
120 
124  Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
125 
129  Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
130 
131  /*
132  * Creates a new hierarchy for the game, that contains all the logic for playing that particular game.
133  */
134  Game *createGame() const;
135 };
136 
137 } // End of namespace Shared
138 
139 extern Shared::UltimaEarlyEngine *g_vm;
140 
141 } // End of namespace Ultima
142 
143 #endif
Definition: str.h:59
Definition: surface.h:66
Definition: game.h:42
Definition: stream.h:77
Definition: error.h:84
Definition: debugger.h:36
Definition: default_display_client.h:78
Definition: resources.h:128
Definition: path.h:52
Definition: mouse_cursor.h:60
Definition: stream.h:745
Definition: detection.h:65
Definition: ultima.h:33
Definition: screen.h:50
Definition: detection.h:27
Definition: screen.h:60
Definition: game_base.h:53
Definition: ultima_early.h:69
Definition: events.h:139
Definition: ultima_early.h:46
Definition: system.h:175
Definition: events.h:124