qbsp: fix adding animated textures for alt-anim textured brushes

If brushes in the map are textured with alt-animations, and the second
character (i.e. the 'a' in +abutton) is lower case then we have the
lowercase texture name in the miptex list, but when we add alt textures we
use the uppercase, so it gets duplicated.  Duplicated animating textures
cause most engines to exit with an error.

Since the map file could use uppercase texture names as well, really we
should either be normalizing texture names to upper or lower case, or we
need to do case-insensitive matching - so I just changed to
case-insensitive matching.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-04-25 21:43:59 +09:30
parent 59f53cf2fa
commit 8939d1f6db
3 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
Unreleased
*
* qbsp: Fix animating texture bug when brushes are textured with alt-animations
2013-04-25 TyrUtils v0.10

View File

@ -37,7 +37,7 @@ FindMiptex(const char *name)
int i;
for (i = 0; i < map.nummiptex; i++) {
if (!strcmp(name, map.miptex[i]))
if (!strcasecmp(name, map.miptex[i]))
return i;
}
if (map.nummiptex == map.maxmiptex)

View File

@ -254,7 +254,7 @@ WADList_AddAnimatingTextures(const wad_t *wadlist)
/* Search for all animations (0-9) and alt-animations (A-J) */
for (j = 0; j < 20; j++) {
name[1] = (j < 10) ? '0' + j : 'A' + j - 10;
name[1] = (j < 10) ? '0' + j : 'a' + j - 10;
if (WADList_FindTexture(wadlist, name))
FindMiptex(name);
}