- allow FORCEBACKCULLFACES to work with hud models

This commit is contained in:
Rachael Alexanderson 2023-10-25 10:57:35 -04:00
commit 6d1ebf5f27
4 changed files with 10 additions and 10 deletions

View file

@ -79,7 +79,7 @@ void FHWModelRenderer::EndDrawModel(FRenderStyle style, FSpriteModelFrame *smf)
state.SetCulling(Cull_None);
}
void FHWModelRenderer::BeginDrawHUDModel(FRenderStyle style, const VSMatrix &objectToWorldMatrix, bool mirrored)
void FHWModelRenderer::BeginDrawHUDModel(FRenderStyle style, const VSMatrix &objectToWorldMatrix, bool mirrored, FSpriteModelFrame *smf)
{
state.SetDepthFunc(DF_LEqual);
state.SetDepthClamp(true);
@ -87,7 +87,7 @@ void FHWModelRenderer::BeginDrawHUDModel(FRenderStyle style, const VSMatrix &obj
// [BB] In case the model should be rendered translucent, do back face culling.
// This solves a few of the problems caused by the lack of depth sorting.
// TO-DO: Implement proper depth sorting.
if (!(style == DefaultRenderStyle()))
if (!(style == DefaultRenderStyle()) || (smf->flags & MDL_FORCECULLBACKFACES))
{
state.SetCulling((mirrored ^ portalState.isMirrored()) ? Cull_CW : Cull_CCW);
}
@ -96,13 +96,13 @@ void FHWModelRenderer::BeginDrawHUDModel(FRenderStyle style, const VSMatrix &obj
state.EnableModelMatrix(true);
}
void FHWModelRenderer::EndDrawHUDModel(FRenderStyle style)
void FHWModelRenderer::EndDrawHUDModel(FRenderStyle style, FSpriteModelFrame *smf)
{
state.SetBoneIndexBase(-1);
state.EnableModelMatrix(false);
state.SetDepthFunc(DF_Less);
if (!(style == DefaultRenderStyle()))
if (!(style == DefaultRenderStyle()) || (smf->flags & MDL_FORCECULLBACKFACES))
state.SetCulling(Cull_None);
}