28 #ifndef WINTERMUTE_BASE_GAME_H 29 #define WINTERMUTE_BASE_GAME_H 31 #include "engines/wintermute/base/base_object.h" 32 #include "engines/wintermute/base/base_game_custom_actions.h" 33 #include "engines/wintermute/base/timer.h" 34 #include "engines/wintermute/ext/plugin_event.h" 35 #include "engines/wintermute/persistent.h" 36 #include "engines/wintermute/coll_templ.h" 37 #include "engines/wintermute/debugger.h" 38 #include "common/events.h" 39 #include "common/random.h" 40 #if EXTENDED_DEBUGGER_ENABLED 41 #include "engines/wintermute/base/scriptables/debuggable/debuggable_script_engine.h" 46 typedef void (*ENGINE_LOG_CALLBACK)(
char *text,
bool result,
void *data);
51 class BaseFileManager;
52 class BaseTransitionMgr;
53 class BaseFontStorage;
59 class BaseSurfaceStorage;
60 class BaseKeyboardState;
61 class BaseGameSettings;
67 class VideoTheoraPlayer;
68 class SaveThumbHelper;
81 virtual bool onScriptShutdown(
ScScript *script);
83 virtual bool getLayerSize(
int *LayerWidth,
int *LayerHeight,
Common::Rect32 *viewport,
bool *customViewport);
85 virtual uint32 getAmbientLightColor();
86 virtual bool getFogParams(
bool *fogEnabled, uint32 *fogColor,
float *start,
float *end);
91 virtual bool onActivate(
bool activate,
bool refreshMouse);
92 virtual bool onMouseLeftDown();
93 virtual bool onMouseLeftUp();
94 virtual bool onMouseLeftDblClick();
95 virtual bool onMouseRightDblClick();
96 virtual bool onMouseRightDown();
97 virtual bool onMouseRightUp();
98 virtual bool onMouseMiddleDown();
99 virtual bool onMouseMiddleUp();
100 virtual bool onPaint();
101 virtual bool onWindowClose();
103 bool isLeftDoubleClick();
104 bool isRightDoubleClick();
106 bool _autorunDisabled;
107 uint32 _lastMiniUpdate;
108 bool _miniUpdateEnabled;
109 virtual void miniUpdate();
116 virtual bool displayDebugInfo();
119 bool _suspendedRendering;
120 int32 _soundBufferSizeSec;
121 virtual bool renderShadowGeometry();
123 TTextEncoding _textEncoding;
129 int32 _loadingIconPersistent;
131 virtual bool resetContent();
133 void DEBUG_DumpClassRegistry();
134 bool setWaitCursor(
const char *filename);
138 bool _saveDirChecked;
141 bool _supportsRealTimeShadows;
142 TShadowType _maxShadowType;
143 bool setMaxShadowType(TShadowType maxShadowType);
144 virtual TShadowType getMaxShadowType(
BaseObject *
object =
nullptr);
146 int32 _editorResolutionWidth;
147 int32 _editorResolutionHeight;
150 uint32 _thumbnailWidth;
151 uint32 _thumbnailHeight;
153 bool _reportTextureFormat;
155 void setEngineLogCallback(ENGINE_LOG_CALLBACK callback =
nullptr,
void *data =
nullptr);
156 ENGINE_LOG_CALLBACK _engineLogCallback;
157 void *_engineLogCallbackData;
160 void getOffset(
int *offsetX,
int *offsetY)
const;
161 void setOffset(int32 offsetX, int32 offsetY);
165 float _offsetPercentX;
166 float _offsetPercentY;
170 uint32 _currentTime{};
176 bool initConfManSettings();
178 bool loadGameSettingsFile();
185 void LOG(
bool res,
const char *fmt, ...);
192 #if EXTENDED_DEBUGGER_ENABLED 203 void DEBUG_DebugDisable();
204 void DEBUG_DebugEnable(
const char *filename =
nullptr);
205 bool _debugDebugMode;
208 virtual bool loadFile(
const char *filename);
209 virtual bool loadBuffer(
char *buffer,
bool complete =
true);
215 bool _mouseRightDown;
216 bool _mouseMidlleDown;
218 void expandStringByStringTable(
char **str)
const;
220 char *getKeyFromStringTable(
const char *str)
const;
225 bool _suppressScriptErrors;
227 bool invalidateDeviceObjects()
override;
228 bool restoreDeviceObjects()
override;
234 bool scSetProperty(
const char *name,
ScValue *value)
override;
236 const char *scToString()
override;
239 bool _compatKillMethodThreads;
245 uint32 _framesRendered;
248 uint32 _surfaceGCCycleTime;
250 bool _videoSubtitles;
253 int32 _scheduledLoadSlot;
255 bool _personalizedSave;
257 void setWindowTitle();
258 bool handleMouseWheel(int32 delta)
override;
260 virtual bool getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor)
const;
261 bool handleKeypress(
Common::Event *event,
bool printable =
false)
override;
264 virtual bool handleCustomActionStart(BaseGameCustomAction action);
265 virtual bool handleCustomActionEnd(BaseGameCustomAction action);
268 bool freeze(
bool includingMusic =
true);
272 bool _loadInProgress;
274 bool _editorForceScripts;
276 static void invalidateValues(
void *value,
void *data);
277 bool loadSettings(
const char *filename);
279 bool displayWindows(
bool inGame =
false);
283 virtual bool cleanup();
284 bool loadGame(uint32 slot);
285 bool loadGame(
const char *filename);
286 bool saveGame(int32 slot,
const char *desc,
bool quickSave =
false);
287 bool showCursor()
override;
293 TGameState _origState;
294 bool _origInteractive;
303 void quickMessage(
const char *text);
304 void quickMessageForm(
char *fmt, ...);
305 bool displayQuickMsg();
308 bool isVideoPlaying();
329 virtual bool displayContent(
bool update =
true,
bool displayAll =
false);
330 virtual bool displayContentSimple();
331 bool _forceNonStreamedSounds;
332 void resetMousePos();
333 int32 _subtitlesSpeed;
334 void setInteractive(
bool state);
335 virtual bool windowLoadHook(
UIWindow *win,
char **buf,
char **params);
337 bool getCurrentViewportOffset(
int *offsetX =
nullptr,
int *offsetY =
nullptr)
const;
338 bool getCurrentViewportRect(
Common::Rect32 *rect,
bool *custom =
nullptr)
const;
345 bool storeSaveThumbnail();
346 void deleteSaveThumbnail();
351 bool _bilinearFiltering{};
353 bool _force2dRenderer{};
358 struct LastClickInfo {
369 LastClickInfo _lastClick[2];
370 bool isDoubleClick(int32 buttonIndex);
377 bool _autoSaveOnExit;
378 uint32 _autoSaveSlot;
385 bool getBilinearFiltering() {
return _bilinearFiltering; }
386 void addMem(int32 bytes);
387 const Timer *getTimer()
const {
return &_timerNormal; }
388 const Timer *getLiveTimer()
const {
return &_timerLive; }
390 void autoSaveOnExit();
391 PluginEvent &pluginEvents() {
return _pluginEvents; }
393 #ifdef ENABLE_HEROCRAFT 399 uint8 getFilePartChecksumHc(
const char *filename, uint32 begin, uint32 end);
Definition: save_thumb_helper.h:35
Definition: base_game.h:75
Definition: script_value.h:42
Definition: base_font_storage.h:40
Definition: base_keyboard_state.h:44
Definition: video_theora_player.h:41
Definition: base_scriptable.h:41
Definition: base_transition_manager.h:35
Definition: atari-cursor.h:35
Definition: script_stack.h:41
Definition: video_player.h:45
Definition: plugin_event.h:48
Definition: base_renderer3d.h:61
Definition: base_fader.h:36
Definition: debuggable_script_engine.h:93
Definition: coll_templ.h:347
Definition: base_font.h:37
Definition: base_game_music.h:42
Definition: base_renderer.h:53
Definition: base_viewport.h:37
Definition: ui_window.h:39
Definition: base_surface_storage.h:36
Definition: base_sprite.h:40
Definition: base_sound_manager.h:38
Definition: script_engine.h:42
Definition: base_game_settings.h:37
Definition: base_object.h:49
Definition: achievements_tables.h:27