8#ifndef GALAXY_CORE_SETTINGS_HPP_
9#define GALAXY_CORE_SETTINGS_HPP_
13#include <glm/vec2.hpp>
14#include <SDL3/SDL_scancode.h>
114 static auto vsync()
noexcept -> bool;
122 static auto icon()
noexcept ->
const std::string&;
138 static auto title()
noexcept ->
const std::string&;
146 static auto version()
noexcept ->
const std::string&;
154 static auto identifier()
noexcept ->
const std::string&;
162 static auto creator()
noexcept ->
const std::string&;
170 static auto copyright()
noexcept ->
const std::string&;
178 static auto website()
noexcept ->
const std::string&;
194 static auto cursor_icon()
noexcept ->
const std::string&;
210 static auto logs_dir()
noexcept ->
const std::string&;
218 static auto base_data()
noexcept ->
const std::string&;
226 static auto root_dir()
noexcept -> std::filesystem::path;
234 static auto assets_dir()
noexcept -> std::filesystem::path;
242 static auto asset_pack()
noexcept ->
const std::string&;
362 static auto editor_key()
noexcept -> SDL_Scancode;
420 static auto ansiotrophy() noexcept -> int;
428 static auto mipmap() noexcept -> bool;
436 static auto texture_filter() noexcept -> GLTextureFilter;
444 static auto max_quads() noexcept -> int;
446 inline static int s_ansio;
447 inline static bool s_mipmap;
448 inline static GLTextureFilter s_filtering;
449 inline static int s_max_quads;
452// config.restore<int>("flag_bitset_count", 8, "misc");
454// config.restore<float>("world_to_box2d", 0.01f, "physics");
455// config.restore<float>("box2d_to_world", 100.0f, "physics");
456// config.restore<int>("flag_bitset_count", 8, "misc");
458// config.restore<float>("world_to_box2d", 0.01f, "physics");
459// config.restore<float>("box2d_to_world", 100.0f, "physics");
461// config.restore<int>("ansiotrophic_filtering", 16, "window");
462// config.restore<bool>("highdpi", false, "window");
463// s_flag_bitset_count = config.get<int>("flag_bitset_count", "misc");
464config.restore<int>("window_width", 1920, "window");
465config.restore<int>("window_height", 1080, "window");
466config.restore<int>("frame_width", 640, "window");
467config.restore<int>("frame_height", 360, "window");
469// s_world_to_box2d = config.get<float>("world_to_box2d", "physics");
470// s_box2d_to_world = config.get<float>("box2d_to_world", "physics");
471// s_ansio_filtering = config.get<int>("ansiotrophic_filtering", "window");
472// s_highdpi = config.get<bool>("highdpi", "window");
477// static auto flag_bitset_count() noexcept -> int;
483// static auto world_to_box2d() noexcept -> float;
489// static auto box2d_to_world() noexcept -> float;
497// static auto highdpi() noexcept -> bool;
499// inline static int s_flag_bitset_count;
501// inline static float s_world_to_box2d;
502// inline static float s_box2d_to_world;
504// inline static bool s_highdpi;
506config.restore<float>("ui_font_size", 14.0f);
507config.restore<std::string>("default_lang", "en_au");
509config.restore<float>("sfx_volume", 1.0f, "audio");
510config.restore<float>("music_volume", 1.0f, "audio");
511config.restore<float>("dialogue_volume", 1.0f, "audio");
512config.restore<int>("listener_count", 1, "audio");
515config.restore<bool>("smaa", false, "graphics.effects");
516config.restore<bool>("sharpen", false, "graphics.effects");
517config.restore<bool>("gamma_correction", false, "graphics.effects");
518config.restore<bool>("chromatic_abberation", false, "graphics.effects");
519config.restore<bool>("gaussian_blur", false, "graphics.effects");
520config.restore<bool>("film_grain", false, "graphics.effects");
522config.restore<int>("camera_foward", input::key_to_int(input::Keys::KEY_W), "input");
523config.restore<int>("camera_backward", input::key_to_int(input::Keys::KEY_S), "input");
524config.restore<int>("camera_left", input::key_to_int(input::Keys::KEY_A), "input");
525config.restore<int>("camera_right", input::key_to_int(input::Keys::KEY_D), "input");
526config.restore<int>("camera_rotate_left", input::key_to_int(input::Keys::KEY_Q), "input");
527config.restore<int>("camera_rotate_right", input::key_to_int(input::Keys::KEY_E), "input");
532// #define GALAXY_ENTITY_SIZE std::uint64_t
Helper class to encapsulate our global settings we want to quickly access across app.
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 int s_virtual_height
static auto icon() noexcept -> const std::string &
Window icon file in vfs.
static auto fullscreen() noexcept -> bool
Is window started fullscreen.
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 requested_height() noexcept -> int
Window requested height.
static auto assets_dir_voice() noexcept -> const std::string &
Voice asset location.
static int s_requested_width
static std::string s_cursor_icon
static auto editor_key() noexcept -> SDL_Scancode
Editor debug toggle key.
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 int s_requested_height
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 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 virtual_width() noexcept -> int
Window virtual width.
static auto cursor_offset() noexcept -> const glm::ivec2 &
Cursor selector point (offset).
static auto maximized() noexcept -> bool
Is window started maximized?
static auto virtual_height() noexcept -> int
Window virtual height.
static auto title() noexcept -> const std::string &
Game title.
static bool s_enable_editor
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 glm::ivec2 s_cursor_offset
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 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 std::string s_website
static auto enable_editor() noexcept -> bool
Enable the debug editor UI.
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 std::string s_base_data
static auto assets_dir_font() noexcept -> const std::string &
Font asset location.
static auto creator() noexcept -> const std::string &
Owner.
static auto requested_width() noexcept -> int
Window requested width.
static std::string s_window_icon
static auto base_data() noexcept -> const std::string &
Current root directory of application, unless it has been changed.
static int s_virtual_width
static std::string s_identifier