(svn r4793) - Replace list of magic numbers (characters that don't exist) with a call to SpriteExists(), when building the character width cache.

This commit is contained in:
peter1138 2006-05-09 11:42:51 +00:00
parent 0d6c71fc38
commit 52bab5e9bd

9
gfx.c
View File

@ -1611,16 +1611,19 @@ void LoadStringWidthTable(void)
uint i;
// 2 equals space.
/* Normal font */
for (i = 2; i != 226; i++) {
*b++ = i != 97 && (i < 99 || i > 113) && i != 116 && i != 117 && (i < 123 || i > 129) && (i < 151 || i > 153) && i != 155 ? GetSprite(i)->width : 0;
*b++ = SpriteExists(i) ? GetSprite(i)->width : 0;
}
/* Small font */
for (i = 226; i != 450; i++) {
*b++ = i != 321 && (i < 323 || i > 353) && i != 367 && (i < 375 || i > 377) && i != 379 ? GetSprite(i)->width + 1 : 0;
*b++ = SpriteExists(i) ? GetSprite(i)->width + 1 : 0;
}
/* Large font */
for (i = 450; i != 674; i++) {
*b++ = (i < 545 || i > 577) && i != 588 && i != 590 && i != 591 && i != 593 && (i < 599 || i > 601) && i != 603 ? GetSprite(i)->width + 1 : 0;
*b++ = SpriteExists(i) ? GetSprite(i)->width + 1 : 0;
}
}