mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
effect_context: Make use of explicit where applicable
While we're at it we can make the destructor of the base class virtual to ensure that any polymorphism issues never occur.
This commit is contained in:
parent
4d4afc1502
commit
111852a983
1 changed files with 12 additions and 13 deletions
|
@ -166,13 +166,13 @@ public:
|
||||||
std::array<u8, 0xa0> raw;
|
std::array<u8, 0xa0> raw;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
static_assert(sizeof(EffectInfo::InParams) == 0xc0, "InParams is an invalid size");
|
static_assert(sizeof(InParams) == 0xc0, "InParams is an invalid size");
|
||||||
|
|
||||||
struct OutParams {
|
struct OutParams {
|
||||||
UsageStatus status{};
|
UsageStatus status{};
|
||||||
INSERT_PADDING_BYTES(15);
|
INSERT_PADDING_BYTES(15);
|
||||||
};
|
};
|
||||||
static_assert(sizeof(EffectInfo::OutParams) == 0x10, "OutParams is an invalid size");
|
static_assert(sizeof(OutParams) == 0x10, "OutParams is an invalid size");
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AuxAddress {
|
struct AuxAddress {
|
||||||
|
@ -184,8 +184,8 @@ struct AuxAddress {
|
||||||
|
|
||||||
class EffectBase {
|
class EffectBase {
|
||||||
public:
|
public:
|
||||||
EffectBase(EffectType effect_type);
|
explicit EffectBase(EffectType effect_type);
|
||||||
~EffectBase();
|
virtual ~EffectBase();
|
||||||
|
|
||||||
virtual void Update(EffectInfo::InParams& in_params) = 0;
|
virtual void Update(EffectInfo::InParams& in_params) = 0;
|
||||||
virtual void UpdateForCommandGeneration() = 0;
|
virtual void UpdateForCommandGeneration() = 0;
|
||||||
|
@ -206,8 +206,7 @@ protected:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class EffectGeneric : public EffectBase {
|
class EffectGeneric : public EffectBase {
|
||||||
public:
|
public:
|
||||||
EffectGeneric(EffectType effect_type) : EffectBase::EffectBase(effect_type) {}
|
explicit EffectGeneric(EffectType effect_type) : EffectBase(effect_type) {}
|
||||||
~EffectGeneric() = default;
|
|
||||||
|
|
||||||
T& GetParams() {
|
T& GetParams() {
|
||||||
return internal_params;
|
return internal_params;
|
||||||
|
@ -224,7 +223,7 @@ private:
|
||||||
class EffectStubbed : public EffectBase {
|
class EffectStubbed : public EffectBase {
|
||||||
public:
|
public:
|
||||||
explicit EffectStubbed();
|
explicit EffectStubbed();
|
||||||
~EffectStubbed();
|
~EffectStubbed() override;
|
||||||
|
|
||||||
void Update(EffectInfo::InParams& in_params) override;
|
void Update(EffectInfo::InParams& in_params) override;
|
||||||
void UpdateForCommandGeneration() override;
|
void UpdateForCommandGeneration() override;
|
||||||
|
@ -233,7 +232,7 @@ public:
|
||||||
class EffectI3dl2Reverb : public EffectGeneric<I3dl2ReverbParams> {
|
class EffectI3dl2Reverb : public EffectGeneric<I3dl2ReverbParams> {
|
||||||
public:
|
public:
|
||||||
explicit EffectI3dl2Reverb();
|
explicit EffectI3dl2Reverb();
|
||||||
~EffectI3dl2Reverb();
|
~EffectI3dl2Reverb() override;
|
||||||
|
|
||||||
void Update(EffectInfo::InParams& in_params) override;
|
void Update(EffectInfo::InParams& in_params) override;
|
||||||
void UpdateForCommandGeneration() override;
|
void UpdateForCommandGeneration() override;
|
||||||
|
@ -245,7 +244,7 @@ private:
|
||||||
class EffectBiquadFilter : public EffectGeneric<BiquadFilterParams> {
|
class EffectBiquadFilter : public EffectGeneric<BiquadFilterParams> {
|
||||||
public:
|
public:
|
||||||
explicit EffectBiquadFilter();
|
explicit EffectBiquadFilter();
|
||||||
~EffectBiquadFilter();
|
~EffectBiquadFilter() override;
|
||||||
|
|
||||||
void Update(EffectInfo::InParams& in_params) override;
|
void Update(EffectInfo::InParams& in_params) override;
|
||||||
void UpdateForCommandGeneration() override;
|
void UpdateForCommandGeneration() override;
|
||||||
|
@ -254,7 +253,7 @@ public:
|
||||||
class EffectAuxInfo : public EffectGeneric<AuxInfo> {
|
class EffectAuxInfo : public EffectGeneric<AuxInfo> {
|
||||||
public:
|
public:
|
||||||
explicit EffectAuxInfo();
|
explicit EffectAuxInfo();
|
||||||
~EffectAuxInfo();
|
~EffectAuxInfo() override;
|
||||||
|
|
||||||
void Update(EffectInfo::InParams& in_params) override;
|
void Update(EffectInfo::InParams& in_params) override;
|
||||||
void UpdateForCommandGeneration() override;
|
void UpdateForCommandGeneration() override;
|
||||||
|
@ -275,7 +274,7 @@ private:
|
||||||
class EffectDelay : public EffectGeneric<DelayParams> {
|
class EffectDelay : public EffectGeneric<DelayParams> {
|
||||||
public:
|
public:
|
||||||
explicit EffectDelay();
|
explicit EffectDelay();
|
||||||
~EffectDelay();
|
~EffectDelay() override;
|
||||||
|
|
||||||
void Update(EffectInfo::InParams& in_params) override;
|
void Update(EffectInfo::InParams& in_params) override;
|
||||||
void UpdateForCommandGeneration() override;
|
void UpdateForCommandGeneration() override;
|
||||||
|
@ -287,7 +286,7 @@ private:
|
||||||
class EffectBufferMixer : public EffectGeneric<BufferMixerParams> {
|
class EffectBufferMixer : public EffectGeneric<BufferMixerParams> {
|
||||||
public:
|
public:
|
||||||
explicit EffectBufferMixer();
|
explicit EffectBufferMixer();
|
||||||
~EffectBufferMixer();
|
~EffectBufferMixer() override;
|
||||||
|
|
||||||
void Update(EffectInfo::InParams& in_params) override;
|
void Update(EffectInfo::InParams& in_params) override;
|
||||||
void UpdateForCommandGeneration() override;
|
void UpdateForCommandGeneration() override;
|
||||||
|
@ -296,7 +295,7 @@ public:
|
||||||
class EffectReverb : public EffectGeneric<ReverbParams> {
|
class EffectReverb : public EffectGeneric<ReverbParams> {
|
||||||
public:
|
public:
|
||||||
explicit EffectReverb();
|
explicit EffectReverb();
|
||||||
~EffectReverb();
|
~EffectReverb() override;
|
||||||
|
|
||||||
void Update(EffectInfo::InParams& in_params) override;
|
void Update(EffectInfo::InParams& in_params) override;
|
||||||
void UpdateForCommandGeneration() override;
|
void UpdateForCommandGeneration() override;
|
||||||
|
|
Loading…
Reference in a new issue