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/math/rect32.h" 38 #include "engines/wintermute/debugger.h" 39 #include "common/events.h" 40 #include "common/random.h" 41 #if EXTENDED_DEBUGGER_ENABLED 42 #include "engines/wintermute/base/scriptables/debuggable/debuggable_script_engine.h" 47 typedef void (*ENGINE_LOG_CALLBACK)(
char *text,
bool result,
void *data);
52 class BaseFileManager;
53 class BaseTransitionMgr;
54 class BaseFontStorage;
60 class BaseSurfaceStorage;
61 class BaseKeyboardState;
62 class BaseGameSettings;
68 class VideoTheoraPlayer;
69 class SaveThumbHelper;
80 virtual bool getLayerSize(
int *LayerWidth,
int *LayerHeight,
Rect32 *viewport,
bool *customViewport);
82 virtual uint32 getAmbientLightColor();
83 virtual bool getFogParams(
bool *fogEnabled, uint32 *fogColor,
float *start,
float *end);
86 virtual bool onScriptShutdown(
ScScript *script);
88 virtual bool onActivate(
bool activate,
bool refreshMouse);
89 virtual bool onMouseLeftDown();
90 virtual bool onMouseLeftUp();
91 virtual bool onMouseLeftDblClick();
92 virtual bool onMouseRightDblClick();
93 virtual bool onMouseRightDown();
94 virtual bool onMouseRightUp();
95 virtual bool onMouseMiddleDown();
96 virtual bool onMouseMiddleUp();
97 virtual bool onPaint();
98 virtual bool onWindowClose();
100 bool isLeftDoubleClick();
101 bool isRightDoubleClick();
103 bool _autorunDisabled;
105 uint32 _lastMiniUpdate;
106 bool _miniUpdateEnabled;
108 virtual void miniUpdate();
110 void getMousePos(
Point32 *Pos);
115 virtual bool displayDebugInfo();
117 void setShowFPS(
bool enabled) { _debugShowFPS = enabled; }
118 bool getBilinearFiltering() {
return _bilinearFiltering; }
119 bool getSuspendedRendering()
const {
return _suspendedRendering; }
120 virtual bool renderShadowGeometry();
122 TTextEncoding _textEncoding;
125 virtual bool resetContent();
127 void DEBUG_DumpClassRegistry();
128 bool setWaitCursor(
const char *filename);
131 bool _supportsRealTimeShadows;
132 TShadowType _maxShadowType;
134 bool setMaxShadowType(TShadowType maxShadowType);
135 virtual TShadowType getMaxShadowType(
BaseObject *
object =
nullptr);
137 int32 _editorResolutionWidth;
138 int32 _editorResolutionHeight;
141 uint32 getSaveThumbWidth()
const {
return _thumbnailWidth; }
142 uint32 getSaveThumbHeight()
const {
return _thumbnailHeight; }
145 void getOffset(
int *offsetX,
int *offsetY)
const;
146 void setOffset(int32 offsetX, int32 offsetY);
151 float _offsetPercentX;
152 float _offsetPercentY;
154 inline BaseObject *getMainObject() {
return _mainObject; }
155 inline BaseFont *getSystemFont() {
return _systemFont; }
156 inline BaseFont *getVideoFont() {
return _videoFont; }
164 bool initConfManSettings();
166 bool loadGameSettingsFile();
173 void expandStringByStringTable(
char **str)
const;
175 char *getKeyFromStringTable(
const char *str)
const;
177 void LOG(
bool res,
const char *fmt, ...);
186 #if EXTENDED_DEBUGGER_ENABLED 198 bool _debugDebugMode;
201 virtual bool loadFile(
const char *filename);
202 virtual bool loadBuffer(
char *buffer,
bool complete =
true);
206 bool _suppressScriptErrors;
212 bool scSetProperty(
const char *name,
ScValue *value)
override;
214 const char *scToString()
override;
216 bool _compatKillMethodThreads;
218 const char* getGameTargetName()
const {
return _targetName.c_str(); }
219 void setGameTargetName(
const Common::String& targetName) { _targetName = targetName; }
220 uint32 _surfaceGCCycleTime;
224 int32 _scheduledLoadSlot;
226 bool getIsLoading()
const {
return _loading; }
228 bool handleMouseWheel(int32 delta)
override;
230 virtual bool getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor)
const;
232 bool handleKeypress(
Common::Event *event,
bool printable =
false)
override;
234 virtual bool handleCustomActionStart(BaseGameCustomAction action);
235 virtual bool handleCustomActionEnd(BaseGameCustomAction action);
238 bool freeze(
bool includingMusic =
true);
240 bool _loadInProgress;
242 bool _editorForceScripts;
244 static void invalidateValues(
void *value,
void *data);
246 bool loadSettings(
const char *filename);
248 bool displayWindows(
bool inGame =
false);
250 virtual bool cleanup();
251 bool loadGame(uint32 slot);
252 bool loadGame(
const char *filename);
253 bool saveGame(int32 slot,
const char *desc,
bool quickSave =
false);
254 bool showCursor()
override;
260 TGameState _origState;
261 bool _origInteractive;
263 const Timer *getTimer()
const {
return &_timerNormal; }
264 const Timer *getLiveTimer()
const {
return &_timerLive; }
274 void quickMessage(
const char *text);
275 void quickMessageForm(
char *fmt, ...);
276 bool displayQuickMsg();
278 virtual bool displayContent(
bool update =
true,
bool displayAll =
false);
279 virtual bool displayContentSimple();
280 bool _forceNonStreamedSounds;
281 void resetMousePos();
282 int32 _subtitlesSpeed;
283 void setInteractive(
bool state);
284 virtual bool windowLoadHook(
UIWindow *win,
char **buf,
char **params);
286 bool getCurrentViewportOffset(
int *offsetX =
nullptr,
int *offsetY =
nullptr)
const;
287 bool getCurrentViewportRect(
Rect32 *rect,
bool *custom =
nullptr)
const;
293 bool storeSaveThumbnail();
294 void deleteSaveThumbnail();
297 void addMem(int32 bytes);
298 bool _touchInterface;
299 bool _constrainedMemory;
309 int32 _loadingIconPersistent;
318 bool _bilinearFiltering;
320 bool _force2dRenderer;
323 void DEBUG_DebugDisable();
324 void DEBUG_DebugEnable(
const char *filename =
nullptr);
328 bool _mouseRightDown;
329 bool _mouseMidlleDown;
333 int32 _soundBufferSizeSec;
335 bool invalidateDeviceObjects()
override;
336 bool restoreDeviceObjects()
override;
339 bool _saveDirChecked;
344 bool _reportTextureFormat;
349 uint32 _framesRendered;
352 void setEngineLogCallback(ENGINE_LOG_CALLBACK callback =
nullptr,
void *data =
nullptr);
353 ENGINE_LOG_CALLBACK _engineLogCallback;
354 void *_engineLogCallbackData;
356 bool _videoSubtitles;
358 bool _personalizedSave;
360 uint32 _thumbnailWidth;
361 uint32 _thumbnailHeight;
363 void setWindowTitle();
365 bool _suspendedRendering;
373 bool isVideoPlaying();
382 struct LastClickInfo {
393 LastClickInfo _lastClick[2];
394 bool isDoubleClick(int32 buttonIndex);
403 bool _autoSaveOnExit;
404 uint32 _autoSaveSlot;
408 void autoSaveOnExit();
409 PluginEvent &pluginEvents() {
return _pluginEvents; }
411 #ifdef ENABLE_HEROCRAFT 417 uint8 getFilePartChecksumHc(
const char *filename, uint32 begin, uint32 end);
Definition: save_thumb_helper.h:35
Definition: base_game.h:76
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:38
Definition: script_stack.h:41
Definition: video_player.h:41
Definition: plugin_event.h:48
Definition: base_renderer3d.h:62
Definition: base_fader.h:36
Definition: debuggable_script_engine.h:93
Definition: coll_templ.h:63
Definition: base_font.h:37
Definition: base_game_music.h:42
Definition: base_renderer.h:53
Definition: base_viewport.h:38
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