mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-07 08:33:47 +00:00
Merge branch 'small-video-errors' into 'master'
Fix small errors with scaled patch and aligned string drawing See merge request KartKrew/Kart!1195
This commit is contained in:
commit
62ae3409ec
1 changed files with 10 additions and 4 deletions
|
|
@ -886,12 +886,10 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
|
||||||
else
|
else
|
||||||
pwidth = patch->width * dupx;
|
pwidth = patch->width * dupx;
|
||||||
|
|
||||||
float fdupy = FIXED_TO_FLOAT(vdup);
|
|
||||||
|
|
||||||
float fx = x;
|
float fx = x;
|
||||||
float fy = y;
|
float fy = y;
|
||||||
float fx2 = fx + pwidth;
|
float fx2 = fx + pwidth;
|
||||||
float fy2 = fy + static_cast<float>(patch->height) * fdupy;
|
float fy2 = fy + ((patch->height * vdup) / FRACUNIT);
|
||||||
float falpha = 1.f;
|
float falpha = 1.f;
|
||||||
float umin = 0.f;
|
float umin = 0.f;
|
||||||
float umax = 1.f;
|
float umax = 1.f;
|
||||||
|
|
@ -2497,6 +2495,7 @@ fixed_t V_StringScaledWidth(
|
||||||
boolean uppercase;
|
boolean uppercase;
|
||||||
|
|
||||||
fixed_t cx, cy;
|
fixed_t cx, cy;
|
||||||
|
fixed_t right;
|
||||||
|
|
||||||
fixed_t cw;
|
fixed_t cw;
|
||||||
|
|
||||||
|
|
@ -2699,6 +2698,7 @@ fixed_t V_StringScaledWidth(
|
||||||
}
|
}
|
||||||
|
|
||||||
cx = cy = 0;
|
cx = cy = 0;
|
||||||
|
right = 0;
|
||||||
|
|
||||||
for (; ( c = *s ); ++s)
|
for (; ( c = *s ); ++s)
|
||||||
{
|
{
|
||||||
|
|
@ -2716,6 +2716,12 @@ fixed_t V_StringScaledWidth(
|
||||||
if (c >= 0 && c < font->size && font->font[c])
|
if (c >= 0 && c < font->size && font->font[c])
|
||||||
{
|
{
|
||||||
cw = SHORT (font->font[c]->width) * dupx;
|
cw = SHORT (font->font[c]->width) * dupx;
|
||||||
|
|
||||||
|
// How bunched dims work is by incrementing cx slightly less than a full character width.
|
||||||
|
// This causes the next character to be drawn overlapping the previous.
|
||||||
|
// We need to count the full width to get the rightmost edge of the string though.
|
||||||
|
right = cx + (cw * scale);
|
||||||
|
|
||||||
(*dim_fn)(scale, chw, hchw, dupx, &cw);
|
(*dim_fn)(scale, chw, hchw, dupx, &cw);
|
||||||
cx += cw;
|
cx += cw;
|
||||||
}
|
}
|
||||||
|
|
@ -2723,7 +2729,7 @@ fixed_t V_StringScaledWidth(
|
||||||
cx += spacew;
|
cx += spacew;
|
||||||
}
|
}
|
||||||
|
|
||||||
fullwidth = std::max(cx, fullwidth);
|
fullwidth = std::max(right, std::max(cx, fullwidth));
|
||||||
}
|
}
|
||||||
|
|
||||||
return fullwidth;
|
return fullwidth;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue