8#ifndef GALAXY_CORE_SETTINGS_HPP_
9#define GALAXY_CORE_SETTINGS_HPP_
13#include <glm/vec2.hpp>
55 static auto window_icon()
noexcept ->
const std::string&;
81 static auto vsync()
noexcept -> bool;
121 static auto cursor_icon()
noexcept ->
const std::string&;
145 static auto title()
noexcept ->
const std::string&;
153 static auto version()
noexcept ->
const std::string&;
161 static auto identifier()
noexcept ->
const std::string&;
169 static auto creator()
noexcept ->
const std::string&;
177 static auto copyright()
noexcept ->
const std::string&;
185 static auto website()
noexcept ->
const std::string&;
193 static auto log_dir()
noexcept ->
const std::string&;
201 static auto root_dir()
noexcept -> std::filesystem::path;
209 static auto assets_dir()
noexcept -> std::filesystem::path;
217 static auto editor_dir()
noexcept -> std::filesystem::path;
225 static auto asset_pack()
noexcept ->
const std::string&;
396// static auto flag_bitset_count() noexcept -> int;
402// static auto world_to_box2d() noexcept -> float;
408// static auto box2d_to_world() noexcept -> float;
414// static auto ansio_level() noexcept -> int;
420// static auto highdpi() noexcept -> bool;
422// inline static int s_flag_bitset_count;
424// inline static float s_world_to_box2d;
425// inline static float s_box2d_to_world;
426// inline static int s_ansio_filtering;
427// inline static bool s_highdpi;
429config.restore<float>("ui_font_size", 14.0f);
430config.restore<std::string>("default_lang", "en_au");
432config.restore<float>("sfx_volume", 1.0f, "audio");
433config.restore<float>("music_volume", 1.0f, "audio");
434config.restore<float>("dialogue_volume", 1.0f, "audio");
435config.restore<int>("listener_count", 1, "audio");
437config.restore<bool>("trilinear_filtering", false, "graphics");
438config.restore<int>("ansiotrophic_filtering", 2, "graphics");
439config.restore<bool>("smaa", false, "graphics.effects");
440config.restore<bool>("sharpen", false, "graphics.effects");
441config.restore<bool>("gamma_correction", false, "graphics.effects");
442config.restore<bool>("chromatic_abberation", false, "graphics.effects");
443config.restore<bool>("gaussian_blur", false, "graphics.effects");
444config.restore<bool>("film_grain", false, "graphics.effects");
446config.restore<int>("camera_foward", input::key_to_int(input::Keys::KEY_W), "input");
447config.restore<int>("camera_backward", input::key_to_int(input::Keys::KEY_S), "input");
448config.restore<int>("camera_left", input::key_to_int(input::Keys::KEY_A), "input");
449config.restore<int>("camera_right", input::key_to_int(input::Keys::KEY_D), "input");
450config.restore<int>("camera_rotate_left", input::key_to_int(input::Keys::KEY_Q), "input");
451config.restore<int>("camera_rotate_right", input::key_to_int(input::Keys::KEY_E), "input");
456// #define GALAXY_ENTITY_SIZE std::uint64_t
Helper class to encapsulate our global settings we want to quickly access across app.
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 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 std::string s_cursor_icon
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 std::string s_copyright
static auto window_border() noexcept -> bool
Controls if a window has a border around it (including titlebar).
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 identifier() noexcept -> const std::string &
Game identifier i.e. com.galaxy.app.
static auto maximized() noexcept -> bool
Is window started maximized?
static auto title() noexcept -> const std::string &
Game title.
static std::string s_creator
static std::string s_assets_voice
static auto cursor_show() noexcept -> bool
Is the mouse cursor visible or not.
static bool s_mouse_grabbed
static auto assets_dir() noexcept -> std::filesystem::path
Main data directory.
static auto cursor_hotspot() noexcept -> const glm::ivec2 &
Cursor selector point (hotspot).
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 auto mouse_grabbed() noexcept -> bool
Is the cursor grabbed.
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 bool s_cursor_show
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 cursor_icon() noexcept -> const std::string &
Cursor texture file in vfs.
static glm::ivec2 s_cursor_hotspot
static auto assets_dir_font() noexcept -> const std::string &
Font asset location.
static auto creator() noexcept -> const std::string &
Owner.
static std::string s_window_icon
static std::string s_identifier