mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-08-12 08:19:06 +00:00
Fix CFaceplateDecoration::Draw build
Former-commit-id: b9f422978bafde39a5c0e3131935fb9e0b7e3994
This commit is contained in:
parent
aae314dca7
commit
6d7d4674a3
@ -35,7 +35,7 @@ public:
|
|||||||
}
|
}
|
||||||
void Get(float& r, float& g, float& b, float& a) const;
|
void Get(float& r, float& g, float& b, float& a) const;
|
||||||
void Get(float& r, float& g, float& b) 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(float a) { mA = CCast::ToUint8(a * 255.f); }
|
||||||
void SetAlpha(uchar a) { mRgba = (mRgba & ~0xff) | a; }
|
void SetAlpha(uchar a) { mRgba = (mRgba & ~0xff) | a; }
|
||||||
|
|
||||||
|
@ -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 {
|
void CFaceplateDecoration::Draw(const CStateManager& stateMgr) const {
|
||||||
if (x4_tex.valid() && x4_tex->IsLoaded()) {
|
if (x4_tex.valid() && x4_tex->IsLoaded()) {
|
||||||
CTexture* texture = TToken< CTexture >(*x4_tex).GetT();
|
CTexture* texture = TToken< CTexture >(*x4_tex).GetT();
|
||||||
float alpha = stateMgr.GetPlayer()->GetVisorSteam().GetAlpha();
|
float alpha = stateMgr.GetPlayer()->GetVisorSteam().GetAlpha();
|
||||||
if (!close_enough(alpha, 0.f)) {
|
if (!close_enough(alpha, 0.f)) {
|
||||||
CColor color(CColor::White(), alpha);
|
|
||||||
CCameraFilterPass::DrawFilter(CCameraFilterPass::kFT_Blend,
|
CCameraFilterPass::DrawFilter(CCameraFilterPass::kFT_Blend,
|
||||||
CCameraFilterPass::kFS_FullscreenQuarters, color, texture, 1.f);
|
CCameraFilterPass::kFS_FullscreenQuarters,
|
||||||
|
ChangeAlpha(CColor::White(), alpha), texture, 1.f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user