- fixed: voxel culling must take sprite flipping into account.

This commit is contained in:
Christoph Oelckers 2021-12-14 13:43:24 +01:00
parent 0c83d299f2
commit 8cb871e5ff

View file

@ -153,7 +153,8 @@ void HWSprite::DrawSprite(HWDrawInfo* di, FRenderState& state, bool translucent)
state.SetDepthFunc(DF_LEqual);
state.EnableTexture(true);
model->BuildVertexBuffer(&mr);
mr.BeginDrawModel(RenderStyle, nullptr, rotmat, portalState.isMirrored());
bool mirrored = ((Sprite->cstat & CSTAT_SECTOR_XFLIP) != 0) ^ ((Sprite->cstat & CSTAT_SECTOR_YFLIP) != 0) ^ portalState.isMirrored();
mr.BeginDrawModel(RenderStyle, nullptr, rotmat, mirrored);
mr.SetupFrame(model, 0, 0, 0);
model->RenderFrame(&mr, TexMan.GetGameTexture(model->GetPaletteTexture()), 0, 0, 0.f, TRANSLATION(Translation_Remap + curbasepal, palette));
mr.EndDrawModel(RenderStyle, nullptr);