mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 13:31:37 +00:00
Add PSPF_PLAYERTRANSLATED flag (makes a PSprite layer translated to the user's color)
This commit is contained in:
parent
55e482d0fc
commit
7fd27bc925
6 changed files with 7 additions and 3 deletions
|
@ -140,6 +140,7 @@ DEFINE_FIELD_BIT(DPSprite, Flags, bPowDouble, PSPF_POWDOUBLE)
|
|||
DEFINE_FIELD_BIT(DPSprite, Flags, bCVarFast, PSPF_CVARFAST)
|
||||
DEFINE_FIELD_BIT(DPSprite, Flags, bFlip, PSPF_FLIP)
|
||||
DEFINE_FIELD_BIT(DPSprite, Flags, bMirror, PSPF_MIRROR)
|
||||
DEFINE_FIELD_BIT(DPSprite, Flags, bPlayerTranslated, PSPF_PLAYERTRANSLATED)
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
//
|
||||
|
|
|
@ -68,6 +68,7 @@ enum PSPFlags
|
|||
PSPF_FORCEALPHA = 1 << 7,
|
||||
PSPF_FORCESTYLE = 1 << 8,
|
||||
PSPF_MIRROR = 1 << 9,
|
||||
PSPF_PLAYERTRANSLATED = 1 << 10
|
||||
};
|
||||
|
||||
class DPSprite : public DObject
|
||||
|
|
|
@ -211,7 +211,7 @@ void FModelRenderer::RenderHUDModel(DPSprite *psp, float ofsX, float ofsY)
|
|||
float orientation = smf->xscale * smf->yscale * smf->zscale;
|
||||
|
||||
BeginDrawHUDModel(playermo, objectToWorldMatrix, orientation < 0);
|
||||
RenderFrameModels(playermo->Level, smf, psp->GetState(), psp->GetTics(), playermo->player->ReadyWeapon->GetClass(), 0);
|
||||
RenderFrameModels(playermo->Level, smf, psp->GetState(), psp->GetTics(), playermo->player->ReadyWeapon->GetClass(), psp->Flags & PSPF_PLAYERTRANSLATED ? psp->Owner->mo->Translation : 0);
|
||||
EndDrawHUDModel(playermo);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -2543,7 +2543,8 @@ class PSprite : Object native play
|
|||
native bool bCVarFast;
|
||||
native bool bFlip;
|
||||
native bool bMirror;
|
||||
|
||||
native bool bPlayerTranslated;
|
||||
|
||||
native void SetState(State newstate, bool pending = false);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
|
|
@ -748,6 +748,7 @@ enum EPSpriteFlags
|
|||
PSPF_FORCEALPHA = 1 << 7,
|
||||
PSPF_FORCESTYLE = 1 << 8,
|
||||
PSPF_MIRROR = 1 << 9,
|
||||
PSPF_PLAYERTRANSLATED = 1 << 10
|
||||
};
|
||||
|
||||
// Default psprite layers
|
||||
|
|
Loading…
Reference in a new issue