mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-19 16:01:35 +00:00
Fix HWR_DrawCroppedPatch scaling a patch when cropping the top and left sides.
This commit is contained in:
parent
d004515d6a
commit
6546fc8ce7
1 changed files with 2 additions and 2 deletions
|
@ -506,13 +506,13 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
||||||
|
|
||||||
v[0].s = v[3].s = ((sx)/(float)(gpatch->width))*hwrPatch->max_s;
|
v[0].s = v[3].s = ((sx)/(float)(gpatch->width))*hwrPatch->max_s;
|
||||||
if (sx + w > gpatch->width)
|
if (sx + w > gpatch->width)
|
||||||
v[2].s = v[1].s = hwrPatch->max_s;
|
v[2].s = v[1].s = hwrPatch->max_s - ((sx+w)/(float)(gpatch->width))*hwrPatch->max_s;
|
||||||
else
|
else
|
||||||
v[2].s = v[1].s = ((sx+w)/(float)(gpatch->width))*hwrPatch->max_s;
|
v[2].s = v[1].s = ((sx+w)/(float)(gpatch->width))*hwrPatch->max_s;
|
||||||
|
|
||||||
v[0].t = v[1].t = ((sy)/(float)(gpatch->height))*hwrPatch->max_t;
|
v[0].t = v[1].t = ((sy)/(float)(gpatch->height))*hwrPatch->max_t;
|
||||||
if (sy + h > gpatch->height)
|
if (sy + h > gpatch->height)
|
||||||
v[2].t = v[3].t = hwrPatch->max_t;
|
v[2].t = v[3].t = hwrPatch->max_t - ((sy+h)/(float)(gpatch->height))*hwrPatch->max_t;
|
||||||
else
|
else
|
||||||
v[2].t = v[3].t = ((sy+h)/(float)(gpatch->height))*hwrPatch->max_t;
|
v[2].t = v[3].t = ((sy+h)/(float)(gpatch->height))*hwrPatch->max_t;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue