mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-12-06 03:26:41 -08:00
clean up screen resize
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
3d530bfee0
commit
69585ac43d
5 files changed
+207
-219
No files matched your search
@@ -22,13 +22,28 @@ namespace cfg {
|
||||
};
|
||||
|
||||
struct split_region_setting {
|
||||
static constexpr double min_scale = 0.6;
|
||||
static constexpr double max_scale = 3.0;
|
||||
static constexpr float default_scale = 1.0f;
|
||||
|
||||
int offset_x = 0;
|
||||
int offset_y = 0;
|
||||
float scale_x = 1.0f;
|
||||
float scale_y = 1.0f;
|
||||
float scale_x = default_scale;
|
||||
float scale_y = default_scale;
|
||||
bool keep_aspect_ratio = true;
|
||||
};
|
||||
|
||||
struct split_screen_setting {
|
||||
static constexpr double min_ratio = 0.1;
|
||||
static constexpr double max_ratio = 0.9;
|
||||
|
||||
bool enabled = false;
|
||||
float ratio = 0.5f;
|
||||
bool swap_sides = false;
|
||||
split_region_setting left;
|
||||
split_region_setting right;
|
||||
};
|
||||
|
||||
struct fullscreen_setting {
|
||||
int offset_x = 0;
|
||||
int offset_y = 0;
|
||||
@@ -37,12 +52,7 @@ namespace cfg {
|
||||
bool keep_aspect_ratio = true;
|
||||
ScreenDuplicateMode duplicate = ScreenDuplicateMode::None;
|
||||
|
||||
// dual-playfield / split-screen zoom settings (e.g. battle mode)
|
||||
bool split_mode = false;
|
||||
float split_ratio = 0.5f;
|
||||
bool split_swap_sides = false;
|
||||
split_region_setting split_left;
|
||||
split_region_setting split_right;
|
||||
split_screen_setting split;
|
||||
};
|
||||
|
||||
extern std::optional<std::string> SCREEN_RESIZE_CFG_PATH_OVERRIDE;
|
||||
@@ -56,6 +66,10 @@ namespace cfg {
|
||||
bool load_int_value(rapidjson::Document& doc, std::string path, int& value);
|
||||
bool load_uint32_value(rapidjson::Document& doc, std::string path, uint32_t& value);
|
||||
bool load_float_value(rapidjson::Document& doc, std::string path, float& value);
|
||||
void load_split_config(
|
||||
rapidjson::Document &doc, const std::string &path, split_screen_setting &split);
|
||||
void load_split_region(
|
||||
rapidjson::Document &doc, const std::string &path, split_region_setting ®ion);
|
||||
|
||||
public:
|
||||
ScreenResize();
|
||||
|
||||
Reference in new issue
Block a user