Add PSPF_PLAYERTRANSLATED flag (makes a PSprite layer translated to the user's color)

This commit is contained in:
Cacodemon345 2019-09-01 14:04:53 +06:00 committed by Christoph Oelckers
commit 7fd27bc925
6 changed files with 7 additions and 3 deletions

View file

@ -95,7 +95,7 @@ void HWDrawInfo::DrawPSprite(HUDSprite *huds, FRenderState &state)
{
float thresh = (huds->tex->tex->GetTranslucency() || huds->OverrideShader != -1) ? 0.f : gl_mask_sprite_threshold;
state.AlphaFunc(Alpha_GEqual, thresh);
state.SetMaterial(huds->tex, CLAMP_XY_NOMIP, 0, huds->OverrideShader);
state.SetMaterial(huds->tex, CLAMP_XY_NOMIP, (huds->weapon->Flags & PSPF_PLAYERTRANSLATED) ? huds->owner->Translation : 0, huds->OverrideShader);
state.Draw(DT_TriangleStrip, huds->mx, 4);
}