ScummVM API documentation
game_setup.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 AGS_ENGINE_AC_GAME_SETUP_H
23#define AGS_ENGINE_AC_GAME_SETUP_H
24
25#include "ags/engine/main/graphics_mode.h"
26#include "ags/shared/ac/game_version.h"
27#include "ags/shared/util/string.h"
28
29namespace AGS3 {
30
31// Mouse control activation type
32enum MouseControlWhen {
33 kMouseCtrl_Never, // never control mouse (track system mouse position)
34 kMouseCtrl_Fullscreen, // control mouse in fullscreen only
35 kMouseCtrl_Always, // always control mouse (fullscreen and windowed)
36 kNumMouseCtrlOptions
37};
38
39// Mouse speed definition, specifies how the speed setting is applied to the mouse movement
40enum MouseSpeedDef {
41 kMouseSpeed_Absolute, // apply speed multiplier directly
42 kMouseSpeed_CurrentDisplay, // keep speed/resolution relation based on current system display mode
43 kNumMouseSpeedDefs
44};
45
46// Screen rotation mode on supported platforms and devices
47enum ScreenRotation {
48 kScreenRotation_Unlocked = 0, // player can freely rotate the screen if possible
49 kScreenRotation_Portrait, // screen can only be in portrait orientation
50 kScreenRotation_Landscape, // screen can only be in landscape orientation
51 kNumScreenRotationOptions
52};
53
54using AGS::Shared::String;
55
56// TODO: reconsider the purpose of this struct in the future.
57 // Currently it's been used as both initial storage for config options
58 // before they are used to initialize engine, and as persistent storage
59 // for options that may be changed at runtime (and later written back
60 // to the config file).
61struct GameSetup {
62 static const size_t DefSpriteCacheSize = (128 * 1024); // 128 MB
63 static const size_t DefTexCacheSize = (128 * 1024); // 128 MB
64
65 bool audio_enabled;
66 String audio_driver;
67 int textheight; // text height used on the certain built-in GUI // TODO: move out to game class?
68 bool no_speech_pack;
69 bool enable_antialiasing;
70 bool disable_exception_handling;
71 String startup_dir; // directory where the default game config is located (usually same as main_data_dir)
72 String main_data_dir; // main data directory
73 String main_data_file; // full path to main data file
74 // Following 4 optional dirs are currently for compatibility with Editor only (debug runs)
75 // This is bit ugly, but remain so until more flexible configuration is designed
76 String install_dir; // optional custom install dir path (also used as extra data dir)
77 String opt_data_dir; // optional data dir number 2
78 String opt_audio_dir; // optional custom install audio dir path
79 String opt_voice_dir; // optional custom install voice-over dir path
80 //
81 String conf_path; // a read-only config path (if set the regular config is ignored)
82 bool local_user_conf; // search for user config in the game directory
83 String user_conf_dir; // directory to read and write user config in
84 String user_data_dir; // directory to write savedgames and user files to
85 String shared_data_dir; // directory to write shared game files to
86 String translation;
87 bool mouse_auto_lock;
88 float mouse_speed;
89 MouseControlWhen mouse_ctrl_when;
90 bool mouse_ctrl_enabled;
91 MouseSpeedDef mouse_speed_def;
92 bool RenderAtScreenRes; // render sprites at screen resolution, as opposed to native one
93 size_t SpriteCacheSize = DefSpriteCacheSize; // in KB
94 size_t TextureCacheSize = DefTexCacheSize; // in KB
95 bool clear_cache_on_room_change; // for low-end devices: clear resource caches on room change
96 bool load_latest_save; // load latest saved game on launch
97 ScreenRotation rotation;
98 bool show_fps;
99 bool multitasking = false; // whether run on background, when game is switched out
100
102 String software_render_driver;
103
104 // User's overrides and hacks
105 int override_script_os; // pretend engine is running on this eScriptSystemOSID
106 signed char override_multitasking; // -1 for none, 0 or 1 to lock in the on/off mode
107 bool override_upscale; // whether upscale old games that supported that
108 // assume game data version when restoring legacy save format
109 GameDataVersion legacysave_assume_dataver = kGameVersion_Undefined;
110 // allow to read mismatching number of guis from legacy save file
111 bool legacysave_let_gui_diff = false;
112 // Optional keys for calling built-in save/restore dialogs;
113 // primarily meant for the test runs of the games where save functionality
114 // is not implemented (or does not work correctly).
115 int key_save_game = 0;
116 int key_restore_game = 0;
117
118 GameSetup();
119};
120
121} // namespace AGS3
122
123#endif
Definition: string.h:60
Definition: graphics_mode.h:87
Definition: game_setup.h:61
Definition: atari-screen.h:58