mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
M_StringHeight: Guarantee that there will be enough vertical space in a Menu Message for the relevant lines
This commit is contained in:
parent
d0ce442850
commit
3cbbcfd253
1 changed files with 7 additions and 4 deletions
|
|
@ -14,11 +14,14 @@ struct menumessage_s menumessage;
|
||||||
//
|
//
|
||||||
static inline size_t M_StringHeight(const char *string)
|
static inline size_t M_StringHeight(const char *string)
|
||||||
{
|
{
|
||||||
size_t h = 8, i;
|
size_t h = 8, i, len = strlen(string);
|
||||||
|
|
||||||
for (i = 0; i < strlen(string); i++)
|
for (i = 0; i < len; i++)
|
||||||
if (string[i] == '\n')
|
{
|
||||||
h += 8;
|
if (string[i] != '\n' && i != len-1)
|
||||||
|
continue;
|
||||||
|
h += 8;
|
||||||
|
}
|
||||||
|
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue