move sprite mobj checks first

This commit is contained in:
Alug committed 2024-03-02 22:12:40 +01:00
1 parent bfddbcde6d
commit a4f52ebd10
1 file changed
+7 -7
+7 -7
View File
@@ -4198,12 +4198,6 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
FSurfaceInfo Surf;
INT32 shader = SHADER_NONE;
const boolean hires = (spr->mobj && spr->mobj->skin && ((skin_t *)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ))->flags & SF_HIRES);
if (spr->mobj)
this_scale = FIXED_TO_FLOAT(spr->mobj->scale);
if (hires)
this_scale = this_scale * FIXED_TO_FLOAT(((skin_t *)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ))->highresscale);
if (!spr->mobj)
return;
@@ -4217,6 +4211,12 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
return;
}
const boolean hires = (spr->mobj && spr->mobj->skin && ((skin_t *)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ))->flags & SF_HIRES);
if (spr->mobj)
this_scale = FIXED_TO_FLOAT(spr->mobj->scale);
if (hires)
this_scale = this_scale * FIXED_TO_FLOAT(((skin_t *)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ))->highresscale);
// cache sprite graphics
//12/12/99: Hurdler:
// OK, I don't change anything for MD2 support because I want to be
@@ -4342,7 +4342,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
shader = SHADER_SPRITE; // sprite shader
blend |= PF_ColorMapped;
}
HWR_ProcessPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, shader, false);
}
}