Strip all extensions before trying to add new ones to image file names.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3097 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2009-01-14 16:08:57 +00:00
parent 45692d1d1e
commit 7f90f66bfc
2 changed files with 21 additions and 1 deletions

View file

@ -1973,7 +1973,7 @@ int Mod_LoadHiResTexture(char *name, char *subpath, qboolean mipmap, qboolean al
int i, e;
COM_StripExtension(name, nicename, sizeof(nicename));
COM_StripAllExtensions(name, nicename, sizeof(nicename));
while((data = strchr(nicename, '*')))
{

View file

@ -1469,6 +1469,26 @@ void COM_StripExtension (char *in, char *out, int outlen)
}
}
void COM_StripAllExtensions (char *in, char *out, int outlen)
{
char *s;
if (out != in)
Q_strncpyz(out, in, outlen);
s = out+strlen(out);
while(*s != '/' && s != out)
{
if (*s == '.')
{
*s = 0;
}
s--;
}
}
/*
============
COM_FileExtension