mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-14 17:46:03 +00:00
V_StringScaledWidth fixes
- Don't calculate a cy that's not actually needed - Ignore colorcodes - Update `right` when space characters are printed, too
This commit is contained in:
parent
fd4c1aeec3
commit
fb0fa9ac53
1 changed files with 6 additions and 4 deletions
|
|
@ -2583,7 +2583,7 @@ fixed_t V_StringScaledWidth(
|
|||
|
||||
boolean uppercase;
|
||||
|
||||
fixed_t cx, cy;
|
||||
fixed_t cx;
|
||||
fixed_t right;
|
||||
|
||||
fixed_t cw;
|
||||
|
|
@ -2630,7 +2630,7 @@ fixed_t V_StringScaledWidth(
|
|||
dupx = 1;
|
||||
}
|
||||
|
||||
cx = cy = 0;
|
||||
cx = 0;
|
||||
right = 0;
|
||||
|
||||
for (; ( c = *s ); ++s)
|
||||
|
|
@ -2638,10 +2638,12 @@ fixed_t V_StringScaledWidth(
|
|||
switch (c)
|
||||
{
|
||||
case '\n':
|
||||
cy += fontspec.lfh;
|
||||
cx = 0;
|
||||
break;
|
||||
default:
|
||||
if (( c & 0x80 ))
|
||||
continue;
|
||||
|
||||
if (uppercase)
|
||||
{
|
||||
c = toupper(c);
|
||||
|
|
@ -2673,7 +2675,7 @@ fixed_t V_StringScaledWidth(
|
|||
cx += cw;
|
||||
}
|
||||
else
|
||||
cx += fontspec.spacew;
|
||||
right = (cx += fontspec.spacew);
|
||||
}
|
||||
|
||||
fullwidth = std::max(right, std::max(cx, fullwidth));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue