14 config.restore<
double>(
"ups", 60.0f,
"physics");
16 config.restore<
int>(
"width", 1920,
"window");
17 config.restore<
int>(
"height", 1080,
"window");
18 config.restore<std::string>(
"title",
"galaxy",
"window");
19 config.restore<std::string>(
"icon",
"",
"window");
20 config.restore<
bool>(
"fullscreen",
false,
"window");
21 config.restore<
bool>(
"key_repeat",
true,
"window");
22 config.restore<
bool>(
"vsync",
false,
"window");
23 config.restore<
bool>(
"msaa",
false,
"window");
25 config.restore<
bool>(
"visible",
true,
"cursor");
26 config.restore<
bool>(
"grab",
false,
"cursor");
27 config.restore<std::string>(
"icon",
"",
"cursor");
28 config.restore<
int>(
"x", 0,
"cursor.icon_size");
29 config.restore<
int>(
"y", 0,
"cursor.icon_size");
30 config.restore<
int>(
"x", 0,
"cursor.hotspot");
31 config.restore<
int>(
"y", 0,
"cursor.hotspot");
33 config.restore<std::string>(
"assets_dir",
"assets/",
"fs");
34 config.restore<std::string>(
"editor_dir",
"editor/",
"fs");
35 config.restore<std::string>(
"asset_pack",
"assets.galaxy",
"fs");
36 config.restore<
bool>(
"use_loose_assets",
true,
"fs");
37 config.restore<std::string>(
"assets_music",
"music/",
"fs");
38 config.restore<std::string>(
"assets_sfx",
"sfx/",
"fs");
39 config.restore<std::string>(
"assets_voice",
"voice/",
"fs");
40 config.restore<std::string>(
"assets_font",
"fonts/",
"fs");
41 config.restore<std::string>(
"assets_script",
"scripts/",
"fs");
42 config.restore<std::string>(
"assets_shaders",
"shaders/",
"fs");
43 config.restore<std::string>(
"assets_animation",
"animations/",
"fs");
44 config.restore<std::string>(
"assets_texture",
"textures/",
"fs");
45 config.restore<std::string>(
"assets_prefabs",
"prefabs/",
"fs");
46 config.restore<std::string>(
"assets_maps",
"maps/",
"fs");
47 config.restore<std::string>(
"assets_video",
"video/",
"fs");
48 config.restore<std::string>(
"assets_ui",
"ui/",
"fs");
55 s_ups = config.get<
double>(
"ups",
"physics");
57 s_window_width = config.get<
int>(
"width",
"window");
58 s_window_height = config.get<
int>(
"height",
"window");
59 s_title = config.get<std::string>(
"title",
"window");
60 s_icon = config.get<std::string>(
"icon",
"window");
61 s_fullscreen = config.get<
bool>(
"fullscreen",
"window");
62 s_key_repeat = config.get<
bool>(
"key_repeat",
"window");
63 s_vsync = config.get<
bool>(
"vsync",
"window");
64 s_msaa = config.get<
bool>(
"msaa",
"window");
66 s_cursor_visible = config.get<
bool>(
"visible",
"cursor");
67 s_cursor_grabbed = config.get<
bool>(
"grab",
"cursor");
68 s_cursor_icon = config.get<std::string>(
"icon",
"cursor");
69 s_cursor_icon_size.x = config.get<
int>(
"x",
"cursor.icon_size");
70 s_cursor_icon_size.y = config.get<
int>(
"y",
"cursor.icon_size");
71 s_cursor_hotspot.x = config.get<
int>(
"x",
"cursor.hotspot");
72 s_cursor_hotspot.y = config.get<
int>(
"y",
"cursor.hotspot");
74 s_assets_dir = config.get<std::string>(
"assets_dir",
"fs");
75 s_editor_dir = config.get<std::string>(
"editor_dir",
"fs");
76 s_asset_pack = config.get<std::string>(
"asset_pack",
"fs");
77 s_use_loose_assets = config.get<
bool>(
"use_loose_assets",
"fs");
78 s_assets_music = config.get<std::string>(
"assets_music",
"fs");
79 s_assets_sfx = config.get<std::string>(
"assets_sfx",
"fs");
80 s_assets_voice = config.get<std::string>(
"assets_voice",
"fs");
81 s_assets_font = config.get<std::string>(
"assets_font",
"fs");
82 s_assets_script = config.get<std::string>(
"assets_script",
"fs");
83 s_assets_shaders = config.get<std::string>(
"assets_shaders",
"fs");
84 s_assets_animation = config.get<std::string>(
"assets_animation",
"fs");
85 s_assets_texture = config.get<std::string>(
"assets_texture",
"fs");
86 s_assets_prefabs = config.get<std::string>(
"assets_prefabs",
"fs");
87 s_assets_maps = config.get<std::string>(
"assets_maps",
"fs");
88 s_assets_video = config.get<std::string>(
"assets_video",
"fs");
89 s_assets_ui = config.get<std::string>(
"assets_ui",
"fs");
174 return std::filesystem::current_path();
Allows you to read, write and manipulate JSON config files.
static auto cursor_icon() noexcept -> const std::string &
Cursor texture file in vfs.
static std::string s_title
static std::filesystem::path s_assets_dir
static auto assets_dir_video() noexcept -> const std::string &
Video asset location.
static std::string s_cursor_icon
static auto assets_dir_voice() noexcept -> const std::string &
Voice asset location.
static std::string s_icon
static bool s_use_loose_assets
static auto dt() noexcept -> double
Get galaxy delta time.
static sf::Vector2u s_cursor_hotspot
static auto window_icon() noexcept -> const std::string &
Window icon file in vfs.
static auto assets_dir_script() noexcept -> const std::string &
Scripts asset location.
static auto msaa() noexcept -> bool
Enable MSAA.
static auto vsync() noexcept -> bool
Vsync control.
static auto window_width() noexcept -> int
Window creation width.
static std::string s_assets_animation
static std::string s_assets_voice
static std::filesystem::path s_editor_dir
static auto asset_pack() noexcept -> const std::string &
Name of packed assets file.
static double s_delta_time
static auto window_height() noexcept -> int
Window creation height.
static auto root_dir() noexcept -> std::filesystem::path
Current root directory of application, unless it has been changed.
static int s_window_width
static auto cursor_hotspot() noexcept -> const sf::Vector2u &
Cursor selector point (hotspot).
static auto assets_dir_prefabs() noexcept -> const std::string &
Prefab asset location.
static int s_window_height
static auto assets_dir_shaders() noexcept -> const std::string &
Shaders asset location.
static auto cursor_visible() noexcept -> bool
Show/hide mouse cursor.
static auto assets_dir_animation() noexcept -> const std::string &
Animation data location.
static std::string s_assets_prefabs
static auto set_config_to_default(core::Config &config) -> void
Restore all config settings to default.
static std::string s_assets_texture
static auto editor_dir() noexcept -> std::filesystem::path
Directory for editor specific stuff.
static auto set_delta_time(const double dt) noexcept -> void
Set galaxy delta time.
static auto window_title() noexcept -> const std::string &
Window title.
static bool s_cursor_grabbed
static std::string s_assets_music
static std::string s_assets_sfx
static auto assets_dir_font() noexcept -> const std::string &
Font asset location.
static auto cursor_grabbed() noexcept -> bool
Grab/release mouse cursor.
static auto assets_dir_maps() noexcept -> const std::string &
Maps asset location.
static std::string s_assets_video
static std::string s_assets_ui
static auto ups() noexcept -> double
Game updates per second, independant of FPS, see "fixed timestep gameloop".
static auto assets_dir() noexcept -> std::filesystem::path
Main data directory.
static std::string s_asset_pack
static auto key_repeat() noexcept -> bool
Enable if a keypress will dispatch a single or repeating events.
static auto assets_dir_texture() noexcept -> const std::string &
Textures asset location.
static bool s_cursor_visible
static auto use_loose_assets() noexcept -> bool
Should asset data be read from pack or assets dir.
static auto assets_dir_music() noexcept -> const std::string &
Music asset location.
static auto cursor_icon_size() noexcept -> const sf::Vector2u &
Cursor icon texture size.
static auto assets_dir_sfx() noexcept -> const std::string &
SFX asset location.
static auto set_settings_from_config(core::Config &config) -> void
Set all our settings using the provided config file.
static sf::Vector2u s_cursor_icon_size
static std::string s_assets_maps
static std::string s_assets_shaders
static auto assets_dir_ui() noexcept -> const std::string &
UI asset location.
static auto fullscreen() noexcept -> bool
Window maximized state.
static std::string s_assets_font
static std::string s_assets_script