mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-15 06:20:06 +00:00
Merge pull request #4161 from FearlessTobi/port-1139
Port #1139 from yuzu: "bit_field: Convert ToBool() into explicit operator bool"
This commit is contained in:
commit
b130dd6842
@ -119,8 +119,8 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config,
|
||||
|
||||
if (config.filters_enabled_dirty) {
|
||||
config.filters_enabled_dirty.Assign(0);
|
||||
state.filters.Enable(config.simple_filter_enabled.ToBool(),
|
||||
config.biquad_filter_enabled.ToBool());
|
||||
state.filters.Enable(static_cast<bool>(config.simple_filter_enabled),
|
||||
static_cast<bool>(config.biquad_filter_enabled));
|
||||
LOG_TRACE(Audio_DSP, "source_id={} enable_simple={} enable_biquad={}", source_id,
|
||||
config.simple_filter_enabled.Value(), config.biquad_filter_enabled.Value());
|
||||
}
|
||||
@ -173,8 +173,8 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config,
|
||||
config.length,
|
||||
static_cast<u8>(config.adpcm_ps),
|
||||
{config.adpcm_yn[0], config.adpcm_yn[1]},
|
||||
config.adpcm_dirty.ToBool(),
|
||||
config.is_looping.ToBool(),
|
||||
static_cast<bool>(config.adpcm_dirty),
|
||||
static_cast<bool>(config.is_looping),
|
||||
config.buffer_id,
|
||||
state.mono_or_stereo,
|
||||
state.format,
|
||||
|
@ -178,8 +178,7 @@ public:
|
||||
return ExtractValue(storage);
|
||||
}
|
||||
|
||||
// TODO: we may want to change this to explicit operator bool() if it's bug-free in VS2015
|
||||
FORCE_INLINE bool ToBool() const {
|
||||
constexpr explicit operator bool() const {
|
||||
return Value() != 0;
|
||||
}
|
||||
|
||||
|
@ -181,9 +181,9 @@ struct TexturingRegs {
|
||||
};
|
||||
const std::array<FullTextureConfig, 3> GetTextures() const {
|
||||
return {{
|
||||
{main_config.texture0_enable.ToBool(), texture0, texture0_format},
|
||||
{main_config.texture1_enable.ToBool(), texture1, texture1_format},
|
||||
{main_config.texture2_enable.ToBool(), texture2, texture2_format},
|
||||
{static_cast<bool>(main_config.texture0_enable), texture0, texture0_format},
|
||||
{static_cast<bool>(main_config.texture1_enable), texture1, texture1_format},
|
||||
{static_cast<bool>(main_config.texture2_enable), texture2, texture2_format},
|
||||
}};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user