8#include <entt/locator/locator.hpp>
15#ifdef GALAXY_WIN_PLATFORM
25 auto& config = entt::locator<Config>::value();
27 config.restore<
int>(
"width", 1920,
"window");
28 config.restore<
int>(
"height", 1080,
"window");
29 config.restore<std::string>(
"title",
"game",
"window");
30 config.restore<
bool>(
"vsync",
false,
"window");
31 config.restore<
bool>(
"resizable",
true,
"window");
32 config.restore<
bool>(
"decoration",
true,
"window");
33 config.restore<
bool>(
"fullscreen",
false,
"window");
34 config.restore<
bool>(
"maximized",
false,
"window");
35 config.restore<
bool>(
"minimized",
false,
"window");
36 config.restore<
bool>(
"borderless_fullscreen",
false,
"window");
37 config.restore<std::string>(
"icon",
"",
"window");
38 config.restore<
bool>(
"on_top",
false,
"window");
40 config.restore<std::string>(
"assets_dir",
"assets/",
"fs");
41 config.restore<std::string>(
"asset_pack",
"assets.galaxy",
"fs");
42 config.restore<
bool>(
"use_loose_assets",
true,
"fs");
43 config.restore<std::string>(
"assets_music",
"music/",
"fs");
44 config.restore<std::string>(
"assets_sfx",
"sfx/",
"fs");
45 config.restore<std::string>(
"assets_voice",
"voice/",
"fs");
46 config.restore<std::string>(
"assets_font",
"fonts/",
"fs");
47 config.restore<std::string>(
"assets_script",
"scripts/",
"fs");
48 config.restore<std::string>(
"assets_shaders",
"shaders/",
"fs");
49 config.restore<std::string>(
"assets_animation",
"animations/",
"fs");
50 config.restore<std::string>(
"assets_texture",
"textures/",
"fs");
51 config.restore<std::string>(
"assets_prefabs",
"prefabs/",
"fs");
52 config.restore<std::string>(
"assets_maps",
"maps/",
"fs");
53 config.restore<std::string>(
"assets_video",
"video/",
"fs");
54 config.restore<std::string>(
"assets_ui",
"ui/",
"fs");
56 config.restore<
bool>(
"cursor_locked",
false,
"mouse");
57 config.restore<
bool>(
"cursor_show",
true,
"mouse");
82 auto& config = entt::locator<Config>::value();
86 s_title = *config.get<std::string>(
"title",
"window");
87 s_vsync = *config.get<
bool>(
"vsync",
"window");
88 s_resizable = *config.get<
bool>(
"resizable",
"window");
89 s_decoration = *config.get<
bool>(
"decoration",
"window");
90 s_fullscreen = *config.get<
bool>(
"fullscreen",
"window");
91 s_maximized = *config.get<
bool>(
"maximized",
"window");
92 s_minimized = *config.get<
bool>(
"minimized",
"window");
93 s_borderless = *config.get<
bool>(
"borderless_fullscreen",
"window");
95 s_ontop = *config.get<
bool>(
"on_top",
"window");
97 s_assets_dir = *config.get<std::string>(
"assets_dir",
"fs");
98 s_asset_pack = *config.get<std::string>(
"asset_pack",
"fs");
101 s_assets_sfx = *config.get<std::string>(
"assets_sfx",
"fs");
103 s_assets_font = *config.get<std::string>(
"assets_font",
"fs");
109 s_assets_maps = *config.get<std::string>(
"assets_maps",
"fs");
111 s_assets_ui = *config.get<std::string>(
"assets_ui",
"fs");
139 static std::string
log_dir =
"logs/";
205 return std::filesystem::current_path();
294#ifdef GALAXY_WIN_PLATFORM
#define GALAXY_DISABLE_WARNING_POP
#define GALAXY_DISABLE_WARNING(x)
#define GALAXY_DISABLE_WARNING_PUSH
Macro for windows platform detection.
static auto window_icon() noexcept -> const std::string &
Window icon file in vfs.
static std::string s_asset_pack
static auto root_dir() noexcept -> std::filesystem::path
Current root directory of application, unless it has been changed.
static std::string s_title
static std::string s_assets_video
static std::string s_assets_prefabs
static std::string s_assets_music
static auto window_height() noexcept -> int
Window creation height.
static auto log_dir() noexcept -> const std::string &
Current root directory of application, unless it has been changed.
static auto fullscreen() noexcept -> bool
Is window started fullscreen.
static auto assets_dir_prefabs() noexcept -> const std::string &
Prefab asset location.
static auto assets_dir_texture() noexcept -> const std::string &
Textures asset location.
static auto vsync() noexcept -> bool
Vsync control.
static auto minimized() noexcept -> bool
Is window started minimized?
static auto assets_dir_voice() noexcept -> const std::string &
Voice asset location.
static auto cursor_locked() noexcept -> bool
Is the cursor grabbed.
static int s_window_height
static auto window_width() noexcept -> int
Window creation width.
static bool s_use_loose_assets
static auto assets_dir_shaders() noexcept -> const std::string &
Shaders asset location.
static std::string s_assets_sfx
static bool s_cursor_locked
static std::string s_assets_script
static auto assets_dir_ui() noexcept -> const std::string &
UI asset location.
static auto set_settings_from_config() -> void
Set all our settings using the provided config file.
static auto use_loose_assets() noexcept -> bool
Should asset data be read from pack or assets dir.
static std::string s_assets_texture
static auto assets_dir_animation() noexcept -> const std::string &
Animation data location.
static auto assets_dir_script() noexcept -> const std::string &
Scripts asset location.
static auto assets_dir_music() noexcept -> const std::string &
Music asset location.
static int s_window_width
static auto window_resizable() noexcept -> bool
Is the window resizable.
static auto maximized() noexcept -> bool
Is window started maximized?
static auto title() noexcept -> const std::string &
Game title.
static std::string s_assets_voice
static auto cursor_show() noexcept -> bool
Is the mouse cursor visible or not.
static auto assets_dir() noexcept -> std::filesystem::path
Main data directory.
static auto ontop() noexcept -> bool
Should the window always be on top.
static auto asset_pack() noexcept -> const std::string &
Name of packed assets file.
static std::filesystem::path s_assets_dir
static auto borderless_fullscreen() noexcept -> bool
Is window in borderless fullscreen?
static std::string s_assets_maps
static auto assets_dir_sfx() noexcept -> const std::string &
SFX asset location.
static auto assets_dir_maps() noexcept -> const std::string &
Maps asset location.
static std::string s_assets_shaders
static bool s_cursor_show
static std::string s_assets_animation
static auto set_config_to_default() -> void
Restore all config settings to default.
static std::string s_assets_font
static std::string s_assets_ui
static auto assets_dir_video() noexcept -> const std::string &
Video asset location.
static auto assets_dir_font() noexcept -> const std::string &
Font asset location.
static auto decoration() noexcept -> bool
Controls if a window has a border around it (including titlebar).
static std::string s_window_icon