Match CScriptActor::PreRender

This commit is contained in:
Luke Street 2022-11-04 01:39:14 -04:00
parent febfd1faae
commit b17f7014c9
3 changed files with 15 additions and 10 deletions

View File

@ -61,7 +61,7 @@ public:
return CColor((mRgba & ~0xff) | CCast::ToUint8(a * static_cast< float >(mA)));
}
bool operator==(const CColor& other) { return mRgba == other.mRgba; }
bool operator==(const CColor& other) const { return mRgba == other.mRgba; }
// TODO check
static GXColor ToGX(uint c) { return *reinterpret_cast< const GXColor* >(&c); }

View File

@ -56,8 +56,11 @@ public:
, x2_flags(flags.x2_flags)
, x4_color(color) {}
// CModelFlags(const CModelFlags& other) : x0_blendMode(other.x0_blendMode),
// x1_matSetIdx(other.x1_matSetIdx), x2_flags(other.x2_flags), x4_color(other.x4_color) {}
// CModelFlags(const CModelFlags& other)
// : x0_blendMode(other.x0_blendMode)
// , x1_matSetIdx(other.x1_matSetIdx)
// , x2_flags(other.x2_flags)
// , x4_color(other.x4_color) {}
CModelFlags& operator=(const CModelFlags& other) {
x0_blendMode = other.x0_blendMode;
x1_matSetIdx = other.x1_matSetIdx;
@ -89,6 +92,13 @@ public:
uint GetOtherFlags() const { return x2_flags; }
CColor GetColor() const { return x4_color; }
bool operator==(const CModelFlags& other) const {
// TODO: cast to char for extsb; see CScriptActor::PreRender
return static_cast< char >(x0_blendMode) == static_cast< char >(other.x0_blendMode) &&
static_cast< char >(x1_matSetIdx) == static_cast< char >(other.x1_matSetIdx) &&
x2_flags == other.x2_flags && x4_color == other.x4_color;
}
static CModelFlags Normal() { return CModelFlags(kT_Opaque, 1.f); }
static CModelFlags AlphaBlended(float alpha) { return CModelFlags(kT_Blend, alpha); }
static CModelFlags AlphaBlended(const CColor& color) { return CModelFlags(kT_Blend, color); }
@ -105,9 +115,4 @@ private:
};
CHECK_SIZEOF(CModelFlags, 0x8)
static inline bool operator==(const CModelFlags& lhs, const CModelFlags& rhs) {
return lhs.GetTrans() == rhs.GetTrans() && lhs.GetShaderSet() == rhs.GetShaderSet() &&
lhs.GetOtherFlags() == rhs.GetOtherFlags() && lhs.GetColor() == rhs.GetColor();
}
#endif // _CMODELFLAGS

View File

@ -22,8 +22,8 @@ class CStateManager;
class CCameraManager {
public:
CGameCamera* GetCurrentCamera(CStateManager& mgr) const /* map */;
const CGameCamera* GetCurrentCamera(const CStateManager& mgr) const;
CGameCamera& CurrentCamera(CStateManager& mgr) const;
const CGameCamera& GetCurrentCamera(const CStateManager& mgr) const;
CFirstPersonCamera* FirstPersonCamera() const /* map */ { return x7c_fpCamera; }
const CFirstPersonCamera* GetFirstPersonCamera() const { return x7c_fpCamera; }
void SetPlayerCamera(CStateManager& mgr, TUniqueId newCamId);