qbsp: ignore leading path in texture names for Quake 2 compatibility

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-10-01 12:41:49 +09:30
parent 1196dd8a82
commit f972f19f39
1 changed files with 6 additions and 0 deletions

View File

@ -75,8 +75,14 @@ AddAnimTex(const char *name)
int
FindMiptex(const char *name)
{
const char *pathsep;
int i;
/* Ignore leading path in texture names (Q2 map compatibility) */
pathsep = strrchr(name, '/');
if (pathsep)
name = pathsep + 1;
for (i = 0; i < map.nummiptex; i++) {
if (!strcasecmp(name, map.miptex[i]))
return i;