Merge branch 'linkdraw-scale-fix' into 'next'

Fix thing scale mismatch in R_DrawVisSprite. (Fixes #458)

Closes #458

See merge request STJr/SRB2!1420
This commit is contained in:
Lachlan Wright 2021-03-01 16:49:10 -05:00
commit 588a40453b
2 changed files with 5 additions and 4 deletions

View file

@ -796,7 +796,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
INT32 pwidth;
fixed_t frac;
patch_t *patch = vis->patch;
fixed_t this_scale = vis->mobj->scale;
fixed_t this_scale = vis->thingscale;
INT32 x1, x2;
INT64 overflow_test;
@ -1332,6 +1332,7 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
shadow->xscale = FixedMul(xscale, shadowxscale); //SoM: 4/17/2000
shadow->scale = FixedMul(yscale, shadowyscale);
shadow->thingscale = thing->scale;
shadow->sector = vis->sector;
shadow->szt = (INT16)((centeryfrac - FixedMul(shadow->gzt - viewz, yscale))>>FRACBITS);
shadow->sz = (INT16)((centeryfrac - FixedMul(shadow->gz - viewz, yscale))>>FRACBITS);
@ -1975,6 +1976,7 @@ static void R_ProjectSprite(mobj_t *thing)
vis->xscale = FixedMul(spritexscale, xscale); //SoM: 4/17/2000
vis->scale = FixedMul(spriteyscale, yscale); //<<detailshift;
vis->thingscale = oldthing->scale;
vis->spritexscale = spritexscale;
vis->spriteyscale = spriteyscale;

View file

@ -155,7 +155,8 @@ typedef struct vissprite_s
fixed_t pz, pzt; // physical bottom/top for sorting with 3D floors
fixed_t startfrac; // horizontal position of x1
fixed_t scale;
fixed_t xscale, scale; // projected horizontal and vertical scales
fixed_t thingscale; // the object's scale
fixed_t sortscale; // sortscale only differs from scale for paper sprites, floor sprites, and MF2_LINKDRAW
fixed_t sortsplat; // the sortscale from behind the floor sprite
fixed_t scalestep; // only for paper sprites, 0 otherwise
@ -183,8 +184,6 @@ typedef struct vissprite_s
extracolormap_t *extra_colormap; // global colormaps
fixed_t xscale;
// Precalculated top and bottom screen coords for the sprite.
fixed_t thingheight; // The actual height of the thing (for 3D floors)
sector_t *sector; // The sector containing the thing.