fix 3d model offsets when flipped

This commit is contained in:
Alug committed 2024-01-06 01:07:48 +01:00
1 parent d81640c57e
commit 26938c20db
1 file changed
+4 -2
+4 -2
View File
@@ -1460,13 +1460,15 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
HWD.pfnSetShader(4); // model shader
{
SINT8 flipfactor = flip ? -1 : 1;
float this_scale = FIXED_TO_FLOAT(interp.scale);
float xs = this_scale * FIXED_TO_FLOAT(interp.spritexscale);
float ys = this_scale * FIXED_TO_FLOAT(interp.spriteyscale);
float ox = xs * FIXED_TO_FLOAT(interp.spritexoffset);
float oy = ys * FIXED_TO_FLOAT(interp.spriteyoffset);
float ox = xs * flipfactor*FIXED_TO_FLOAT(interp.spritexoffset);
float oy = ys * flipfactor*FIXED_TO_FLOAT(interp.spriteyoffset);
// offset perpendicular to the camera angle
p.x -= ox * gr_viewsin;