Settings: Slightly reduce struct size

This commit is contained in:
Stenzek
2025-11-23 00:22:24 +10:00
parent 795e2d2735
commit b5316239b0
3 changed files with 25 additions and 22 deletions

View File

@@ -878,13 +878,7 @@ void Settings::Clear(SettingsInterface& si)
bool Settings::TextureReplacementSettings::Configuration::operator==(const Configuration& rhs) const
{
return (dump_texture_pages == rhs.dump_texture_pages && dump_full_texture_pages == rhs.dump_full_texture_pages &&
dump_texture_force_alpha_channel == rhs.dump_texture_force_alpha_channel &&
dump_vram_write_force_alpha_channel == rhs.dump_vram_write_force_alpha_channel &&
dump_c16_textures == rhs.dump_c16_textures && reduce_palette_range == rhs.reduce_palette_range &&
convert_copies_to_writes == rhs.convert_copies_to_writes &&
replacement_scale_linear_filter == rhs.replacement_scale_linear_filter &&
max_hash_cache_entries == rhs.max_hash_cache_entries &&
return (max_hash_cache_entries == rhs.max_hash_cache_entries &&
max_hash_cache_vram_usage_mb == rhs.max_hash_cache_vram_usage_mb &&
max_replacement_cache_vram_usage_mb == rhs.max_replacement_cache_vram_usage_mb &&
max_vram_write_splits == rhs.max_vram_write_splits &&
@@ -893,7 +887,13 @@ bool Settings::TextureReplacementSettings::Configuration::operator==(const Confi
texture_dump_width_threshold == rhs.texture_dump_width_threshold &&
texture_dump_height_threshold == rhs.texture_dump_height_threshold &&
vram_write_dump_width_threshold == rhs.vram_write_dump_width_threshold &&
vram_write_dump_height_threshold == rhs.vram_write_dump_height_threshold);
vram_write_dump_height_threshold == rhs.vram_write_dump_height_threshold &&
dump_texture_pages == rhs.dump_texture_pages && dump_full_texture_pages == rhs.dump_full_texture_pages &&
dump_texture_force_alpha_channel == rhs.dump_texture_force_alpha_channel &&
dump_vram_write_force_alpha_channel == rhs.dump_vram_write_force_alpha_channel &&
dump_c16_textures == rhs.dump_c16_textures && reduce_palette_range == rhs.reduce_palette_range &&
convert_copies_to_writes == rhs.convert_copies_to_writes &&
replacement_scale_linear_filter == rhs.replacement_scale_linear_filter);
}
bool Settings::TextureReplacementSettings::Configuration::operator!=(const Configuration& rhs) const

View File

@@ -114,12 +114,13 @@ struct GPUSettings
bool display_show_inputs : 1 = false;
bool display_show_enhancements : 1 = false;
bool display_auto_resize_window : 1 = false;
float display_pre_frame_sleep_buffer = DEFAULT_DISPLAY_PRE_FRAME_SLEEP_BUFFER;
float display_osd_scale = DEFAULT_OSD_SCALE;
float display_osd_margin = 0.0f;
float gpu_pgxp_tolerance = -1.0f;
float gpu_pgxp_depth_clear_threshold = 0.0f;
float display_osd_scale = DEFAULT_OSD_SCALE;
float display_osd_margin = 0.0f;
// texture replacements
struct TextureReplacementSettings
{
@@ -131,15 +132,6 @@ struct GPUSettings
constexpr Configuration() = default;
bool dump_texture_pages : 1 = false;
bool dump_full_texture_pages : 1 = false;
bool dump_texture_force_alpha_channel : 1 = false;
bool dump_vram_write_force_alpha_channel : 1 = true;
bool dump_c16_textures : 1 = false;
bool reduce_palette_range : 1 = true;
bool convert_copies_to_writes : 1 = false;
bool replacement_scale_linear_filter : 1 = false;
u32 max_hash_cache_entries = DEFAULT_MAX_HASH_CACHE_ENTRIES;
u32 max_hash_cache_vram_usage_mb = DEFAULT_MAX_HASH_CACHE_VRAM_USAGE_MB;
u32 max_replacement_cache_vram_usage_mb = DEFAULT_MAX_REPLACEMENT_CACHE_VRAM_USAGE_MB;
@@ -153,6 +145,15 @@ struct GPUSettings
u16 vram_write_dump_width_threshold = 128;
u16 vram_write_dump_height_threshold = 128;
bool dump_texture_pages : 1 = false;
bool dump_full_texture_pages : 1 = false;
bool dump_texture_force_alpha_channel : 1 = false;
bool dump_vram_write_force_alpha_channel : 1 = true;
bool dump_c16_textures : 1 = false;
bool reduce_palette_range : 1 = true;
bool convert_copies_to_writes : 1 = false;
bool replacement_scale_linear_filter : 1 = false;
bool operator==(const Configuration& rhs) const;
bool operator!=(const Configuration& rhs) const;
@@ -343,6 +344,8 @@ struct Settings : public GPUSettings
float rewind_save_frequency = 10.0f;
float display_pre_frame_sleep_buffer = DEFAULT_DISPLAY_PRE_FRAME_SLEEP_BUFFER;
std::array<ControllerType, NUM_CONTROLLER_AND_CARD_PORTS> controller_types{};
std::array<MemoryCardType, NUM_CONTROLLER_AND_CARD_PORTS> memory_card_types{};
std::array<std::string, NUM_CONTROLLER_AND_CARD_PORTS> memory_card_paths{};

View File

@@ -243,7 +243,7 @@ enum class ControllerType : u8
Count
};
enum class MemoryCardType
enum class MemoryCardType : u8
{
None,
Shared,
@@ -254,7 +254,7 @@ enum class MemoryCardType
Count
};
enum class MultitapMode
enum class MultitapMode : u8
{
Disabled,
Port1Only,