Runtime/Input: Replace bitfield unions with constructor initializers

This commit is contained in:
Luke Street 2020-04-10 15:12:46 -04:00
parent e38a7f97bd
commit d23e76db54
1 changed files with 6 additions and 12 deletions

View File

@ -32,15 +32,10 @@ struct SAdsrData {
float xc_decayDur = 0.f;
float x10_sustainGain = 0.f;
float x14_releaseDur = 0.f;
union {
struct {
bool x18_24_hasSustain : 1;
bool x18_25_autoRelease : 1;
};
u32 dummy = 0;
};
constexpr SAdsrData() noexcept { x18_24_hasSustain = false; x18_25_autoRelease = false; };
constexpr SAdsrData() noexcept : x18_24_hasSustain(false), x18_25_autoRelease(false) {}
constexpr SAdsrData(float attackGain, float autoReleaseDur, float attackDur, float decayDur, float sustainGain,
float releaseDur, bool hasSustain, bool autoRelease) noexcept
: x0_attackGain(attackGain)
@ -48,10 +43,9 @@ struct SAdsrData {
, x8_attackDur(attackDur)
, xc_decayDur(decayDur)
, x10_sustainGain(sustainGain)
, x14_releaseDur(releaseDur) {
x18_24_hasSustain = hasSustain;
x18_25_autoRelease = autoRelease;
}
, x14_releaseDur(releaseDur)
, x18_24_hasSustain(hasSustain)
, x18_25_autoRelease(autoRelease) {}
};
struct SAdsrDelta {