Compilation error repair

The compiler is just not smart enough to see that program flow is completely under order, so make sure every variable is initialised
(also change some variable types here and there)
This commit is contained in:
toaster 2024-09-28 20:27:50 +01:00
parent 71588f490f
commit af5a65440d

View file

@ -2602,7 +2602,7 @@ void V_DrawStringScaled(
boolean uppercase; boolean uppercase;
boolean notcolored; boolean notcolored;
int boxed = 0; UINT8 boxed = 0;
boolean descriptive = false; boolean descriptive = false;
boolean debugalternation = false; boolean debugalternation = false;
@ -2631,7 +2631,6 @@ void V_DrawStringScaled(
uppercase = ((flags & V_FORCEUPPERCASE) == V_FORCEUPPERCASE); uppercase = ((flags & V_FORCEUPPERCASE) == V_FORCEUPPERCASE);
flags &= ~(V_FLIP);/* These two (V_FORCEUPPERCASE) share a bit. */ flags &= ~(V_FLIP);/* These two (V_FORCEUPPERCASE) share a bit. */
boxed = false;
dance = (flags & V_STRINGDANCE) != 0; dance = (flags & V_STRINGDANCE) != 0;
nodanceoverride = !dance; nodanceoverride = !dance;
@ -2698,7 +2697,8 @@ void V_DrawStringScaled(
right <<= FRACBITS; right <<= FRACBITS;
bot = vid.height << FRACBITS; bot = vid.height << FRACBITS;
cx = x; ssave = s;
cx = cxsave = x;
cy = y; cy = y;
cyoff = 0; cyoff = 0;
@ -2726,11 +2726,12 @@ void V_DrawStringScaled(
case '\xEC': case '\xEC':
{ {
UINT8 anim_duration = 16; UINT8 anim_duration = 16;
boolean anim = ((I_GetTime() % (anim_duration * 2)) < anim_duration); UINT8 anim = 0;
if (c == '\xEE')
anim = false; if (c == '\xEC') // Pressed
else if (c == '\xEC') anim = 1;
anim = true; else if (c != '\xEE') // Not lifted..?
anim = ((I_GetTime() % (anim_duration * 2)) < anim_duration) ? 1 : 0;
// For bullshit text outlining reasons, we cannot draw this background character-by-character. // For bullshit text outlining reasons, we cannot draw this background character-by-character.
// Thinking about doing string manipulation and calling out to V_StringWidth made me drink water. // Thinking about doing string manipulation and calling out to V_StringWidth made me drink water.