mirror of https://github.com/PrimeDecomp/prime.git
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) 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; }
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue