8#include <entt/locator/locator.hpp>
15#ifdef GALAXY_WIN_PLATFORM
25 auto& config = entt::locator<Config>::value();
46 config.restore<
bool>(
"vsync",
false,
"window");
47 config.restore<
int>(
"audio_freq", 44100,
"audio");
49 config.restore<std::string>(
"title",
"galaxy app",
"meta");
50 config.restore<std::string>(
"version",
"1.0",
"meta");
51 config.restore<std::string>(
"identifier",
"com.galaxy.app",
"meta");
52 config.restore<std::string>(
"creator",
"reworks",
"meta");
53 config.restore<std::string>(
"copyright",
"2025+ reworks",
"meta");
54 config.restore<std::string>(
"website",
"https://reworks-org.github.io/galaxy/",
"meta");
56 config.restore<std::string>(
"logs_dir",
"logs/",
"fs");
57 config.restore<std::string>(
"assets_dir",
"assets/",
"fs");
58 config.restore<std::string>(
"editor_dir",
"editor/",
"fs");
59 config.restore<std::string>(
"asset_pack",
"assets.galaxy",
"fs");
60 config.restore<
bool>(
"use_loose_assets",
true,
"fs");
61 config.restore<std::string>(
"assets_music",
"music/",
"fs");
62 config.restore<std::string>(
"assets_sfx",
"sfx/",
"fs");
63 config.restore<std::string>(
"assets_voice",
"voice/",
"fs");
64 config.restore<std::string>(
"assets_font",
"fonts/",
"fs");
65 config.restore<std::string>(
"assets_script",
"scripts/",
"fs");
66 config.restore<std::string>(
"assets_shaders",
"shaders/",
"fs");
67 config.restore<std::string>(
"assets_animation",
"animations/",
"fs");
68 config.restore<std::string>(
"assets_texture",
"textures/",
"fs");
69 config.restore<std::string>(
"assets_prefabs",
"prefabs/",
"fs");
70 config.restore<std::string>(
"assets_maps",
"maps/",
"fs");
71 config.restore<std::string>(
"assets_video",
"video/",
"fs");
72 config.restore<std::string>(
"assets_ui",
"ui/",
"fs");
79 auto& config = entt::locator<Config>::value();
102 s_vsync = *config.get<
bool>(
"vsync",
"window");
105 s_title = *config.get<std::string>(
"title",
"meta");
106 s_version = *config.get<std::string>(
"version",
"meta");
107 s_identifier = *config.get<std::string>(
"identifier",
"meta");
108 s_creator = *config.get<std::string>(
"creator",
"meta");
109 s_copyright = *config.get<std::string>(
"copyright",
"meta");
110 s_website = *config.get<std::string>(
"website",
"meta");
112 s_logs_dir = *config.get<std::string>(
"logs_dir",
"fs");
113 s_assets_dir = *config.get<std::string>(
"assets_dir",
"fs");
114 s_editor_dir = *config.get<std::string>(
"editor_dir",
"fs");
115 s_asset_pack = *config.get<std::string>(
"asset_pack",
"fs");
118 s_assets_sfx = *config.get<std::string>(
"assets_sfx",
"fs");
120 s_assets_font = *config.get<std::string>(
"assets_font",
"fs");
126 s_assets_maps = *config.get<std::string>(
"assets_maps",
"fs");
128 s_assets_ui = *config.get<std::string>(
"assets_ui",
"fs");
178 return std::filesystem::current_path();
262#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 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 logs_dir() noexcept -> const std::string &
Current root directory of application, unless it has been changed.
static auto assets_dir_prefabs() noexcept -> const std::string &
Prefab asset location.
static std::string s_logs_dir
static auto copyright() noexcept -> const std::string &
Copyright message.
static auto assets_dir_texture() noexcept -> const std::string &
Textures asset location.
static auto vsync() noexcept -> bool
Vsync control.
static auto assets_dir_voice() noexcept -> const std::string &
Voice asset location.
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 std::string s_copyright
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 auto identifier() noexcept -> const std::string &
Game identifier i.e. com.galaxy.app.
static auto title() noexcept -> const std::string &
Game title.
static std::string s_creator
static std::string s_assets_voice
static auto assets_dir() noexcept -> std::filesystem::path
Main data directory.
static auto asset_pack() noexcept -> const std::string &
Name of packed assets file.
static std::filesystem::path s_assets_dir
static auto version() noexcept -> const std::string &
Game semver.
static auto audio_freq() noexcept -> int
Set audio frequency to use with SDL.
static std::string s_assets_maps
static auto website() noexcept -> const std::string &
Website URL.
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 std::string s_assets_animation
static std::filesystem::path s_editor_dir
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 editor_dir() noexcept -> std::filesystem::path
Directory for editor specific stuff.
static std::string s_website
static auto assets_dir_video() noexcept -> const std::string &
Video asset location.
static std::string s_version
static auto assets_dir_font() noexcept -> const std::string &
Font asset location.
static auto creator() noexcept -> const std::string &
Owner.
static std::string s_identifier