8#ifndef GALAXY_CORE_SETTINGS_HPP_
9#define GALAXY_CORE_SETTINGS_HPP_
11#include <SFML/System/Vector2.hpp>
50 static auto dt()
noexcept -> double;
56 static auto ups()
noexcept -> double;
74 static auto window_title()
noexcept ->
const std::string&;
80 static auto window_icon()
noexcept ->
const std::string&;
98 static auto vsync()
noexcept -> bool;
104 static auto msaa()
noexcept -> bool;
122 static auto cursor_icon()
noexcept ->
const std::string&;
140 static auto root_dir()
noexcept -> std::filesystem::path;
146 static auto assets_dir()
noexcept -> std::filesystem::path;
152 static auto editor_dir()
noexcept -> std::filesystem::path;
158 static auto asset_pack()
noexcept ->
const std::string&;
280#define GALAXY_ZLIB_COMPLETE_CHUNK 16384
285#define GALAXY_UNUSED(var) ((void)(var))
287#if defined(_DEBUG) || defined(DEBUG)
291#define GALAXY_DEBUG_BUILD true
292#elif defined(_NDEBUG) || defined(NDEBUG)
296#define GALAXY_DEBUG_BUILD false
321 // static auto flag_bitset_count() noexcept -> int;
327 // static auto world_to_box2d() noexcept -> float;
333 // static auto box2d_to_world() noexcept -> float;
339 // static auto ansio_level() noexcept -> int;
345 // static auto highdpi() noexcept -> bool;
347// inline static int s_flag_bitset_count;
349 // inline static float s_world_to_box2d;
350 // inline static float s_box2d_to_world;
351 // inline static int s_ansio_filtering;
352 // inline static bool s_highdpi;
354config.restore<float>("ui_font_size", 14.0f);
355config.restore<std::string>("default_lang", "en_au");
357config.restore<float>("sfx_volume", 1.0f, "audio");
358config.restore<float>("music_volume", 1.0f, "audio");
359config.restore<float>("dialogue_volume", 1.0f, "audio");
360config.restore<int>("listener_count", 1, "audio");
362config.restore<bool>("trilinear_filtering", false, "graphics");
363config.restore<int>("ansiotrophic_filtering", 2, "graphics");
364config.restore<bool>("smaa", false, "graphics.effects");
365config.restore<bool>("sharpen", false, "graphics.effects");
366config.restore<bool>("gamma_correction", false, "graphics.effects");
367config.restore<bool>("chromatic_abberation", false, "graphics.effects");
368config.restore<bool>("gaussian_blur", false, "graphics.effects");
369config.restore<bool>("film_grain", false, "graphics.effects");
371config.restore<int>("camera_foward", input::key_to_int(input::Keys::KEY_W), "input");
372config.restore<int>("camera_backward", input::key_to_int(input::Keys::KEY_S), "input");
373config.restore<int>("camera_left", input::key_to_int(input::Keys::KEY_A), "input");
374config.restore<int>("camera_right", input::key_to_int(input::Keys::KEY_D), "input");
375config.restore<int>("camera_rotate_left", input::key_to_int(input::Keys::KEY_Q), "input");
376config.restore<int>("camera_rotate_right", input::key_to_int(input::Keys::KEY_E), "input");
381// #define GALAXY_ENTITY_SIZE std::uint64_t
Allows you to read, write and manipulate JSON config files.
Helper class to encapsulate our global settings we want to quickly access across app.
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