2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-16 06:17:02 +00:00

GCC 9 fixes: Replace all default equality operators

This commit is contained in:
2022-06-13 02:26:18 -04:00
parent c9e3065d12
commit 22417bcd75
7 changed files with 57 additions and 27 deletions

View File

@@ -43,7 +43,9 @@ struct CTevOp {
, xc_scale(static_cast<GX::TevScale>(compressedDesc >> 6 & 3))
, x10_regId(static_cast<GX::TevRegID>(compressedDesc >> 9 & 3)) {}
bool operator==(const CTevOp&) const = default;
bool operator==(const CTevOp& rhs) const {
return x0_clamp == rhs.x0_clamp && x4_op == rhs.x4_op && x8_bias == rhs.x8_bias && xc_scale == rhs.xc_scale;
}
};
struct ColorPass {
GX::TevColorArg x0_a;
@@ -59,7 +61,7 @@ struct ColorPass {
, x8_c(static_cast<GX::TevColorArg>(compressedDesc >> 10 & 0x1F))
, xc_d(static_cast<GX::TevColorArg>(compressedDesc >> 15 & 0x1F)) {}
bool operator==(const ColorPass&) const = default;
bool operator==(const ColorPass& rhs) const { return memcmp(this, &rhs, sizeof(*this)) == 0; }
};
struct AlphaPass {
GX::TevAlphaArg x0_a;
@@ -75,7 +77,7 @@ struct AlphaPass {
, x8_c(static_cast<GX::TevAlphaArg>(compressedDesc >> 10 & 0x1F))
, xc_d(static_cast<GX::TevAlphaArg>(compressedDesc >> 15 & 0x1F)) {}
bool operator==(const AlphaPass&) const = default;
bool operator==(const AlphaPass& rhs) const { return memcmp(this, &rhs, sizeof(*this)) == 0; }
};
class CTevPass {
u32 x0_id;
@@ -96,7 +98,10 @@ public:
void Execute(ERglTevStage stage) const;
bool operator==(const CTevPass&) const = default;
bool operator==(const CTevPass& rhs) const {
return x0_id == rhs.x0_id && x4_colorPass == rhs.x4_colorPass && x14_alphaPass == rhs.x14_alphaPass &&
x24_colorOp == rhs.x24_colorOp && x38_alphaOp == rhs.x38_alphaOp;
}
};
extern const CTevPass skPassThru;