diff --git a/include/Kyoto/Graphics/CColor.hpp b/include/Kyoto/Graphics/CColor.hpp index b34c5ceb..8cb8a748 100644 --- a/include/Kyoto/Graphics/CColor.hpp +++ b/include/Kyoto/Graphics/CColor.hpp @@ -35,7 +35,7 @@ public: } void Get(float& r, float& g, float& b, float& a) const; void Get(float& r, float& g, float& b) const; - // TODO check + // TODO check. Maybe this calls SetAlpha(uchar)? void SetAlpha(float a) { mA = CCast::ToUint8(a * 255.f); } void SetAlpha(uchar a) { mRgba = (mRgba & ~0xff) | a; } diff --git a/src/MetroidPrime/Player/CFaceplateDecoration.cpp b/src/MetroidPrime/Player/CFaceplateDecoration.cpp index ef9913d0..7c2784e6 100644 --- a/src/MetroidPrime/Player/CFaceplateDecoration.cpp +++ b/src/MetroidPrime/Player/CFaceplateDecoration.cpp @@ -24,14 +24,20 @@ void CFaceplateDecoration::Update(float dt, const CStateManager& stateMgr) { } } +// fake but close +static inline CColor ChangeAlpha(CColor color, float alpha) { + color.SetAlpha(CCast::ToUint8(alpha * 255.f)); + return color; +} + void CFaceplateDecoration::Draw(const CStateManager& stateMgr) const { if (x4_tex.valid() && x4_tex->IsLoaded()) { CTexture* texture = TToken< CTexture >(*x4_tex).GetT(); float alpha = stateMgr.GetPlayer()->GetVisorSteam().GetAlpha(); if (!close_enough(alpha, 0.f)) { - CColor color(CColor::White(), alpha); CCameraFilterPass::DrawFilter(CCameraFilterPass::kFT_Blend, - CCameraFilterPass::kFS_FullscreenQuarters, color, texture, 1.f); + CCameraFilterPass::kFS_FullscreenQuarters, + ChangeAlpha(CColor::White(), alpha), texture, 1.f); } } }