mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-23 02:41:30 +00:00
[model] Make the miptex toupper clearer
That bit of code got me every time I looked at it.
This commit is contained in:
parent
0ba8d44654
commit
ee19a928a0
1 changed files with 6 additions and 2 deletions
|
@ -322,9 +322,13 @@ Mod_LoadTextures (model_t *mod, bsp_t *bsp)
|
|||
memset (anims, 0, sizeof (anims));
|
||||
memset (altanims, 0, sizeof (altanims));
|
||||
|
||||
// convert to uppercase, avoiding toupper (table lookup,
|
||||
// localization issues, etc)
|
||||
#define QTOUPPER(x) ((x) - ('a' - 'A'))
|
||||
|
||||
max = tx->name[1];
|
||||
if (max >= 'a' && max <= 'z')
|
||||
max -= 'a' - 'A';
|
||||
max = QTOUPPER (max);
|
||||
if (max >= '0' && max <= '9') {
|
||||
max -= '0';
|
||||
altmax = 0;
|
||||
|
@ -347,7 +351,7 @@ Mod_LoadTextures (model_t *mod, bsp_t *bsp)
|
|||
|
||||
num = tx2->name[1];
|
||||
if (num >= 'a' && num <= 'z')
|
||||
num -= 'a' - 'A';
|
||||
num = QTOUPPER (num);
|
||||
if (num >= '0' && num <= '9') {
|
||||
num -= '0';
|
||||
anims[num] = tx2;
|
||||
|
|
Loading…
Reference in a new issue