1
0
Fork 0
forked from fte/fteqw

Tweeked some image uploading. The code is cleaner.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1995 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2006-02-22 23:34:08 +00:00
parent bc9a0a4963
commit e7e0f052f0

View file

@ -1903,10 +1903,11 @@ int Mod_LoadHiResTexture(char *name, char *subpath, qboolean mipmap, qboolean al
};
static char *path[] ={
"%s%s",
"textures/%s/%s%s", //this is special... It uses the subpath parameter. Note references to (i == 1)
"textures/%s%s",
"override/%s%s"
"2%s%s",
"3textures/%s/%s%s", //this is special... It uses the subpath parameter. Note references to (i == 1)
"3%s/%s%s",
"2textures/%s%s",
"2override/%s%s"
};
int i, e;
@ -1939,14 +1940,14 @@ int Mod_LoadHiResTexture(char *name, char *subpath, qboolean mipmap, qboolean al
for (; i < sizeof(path)/sizeof(char *); i++)
{
#ifdef DDS
if (i == 1)
if (path[i][0] >= '3')
{
if (!subpath)
continue;
_snprintf(fname, sizeof(fname)-1, path[i], subpath, /*COM_SkipPath*/(nicename), ".dds");
_snprintf(fname, sizeof(fname)-1, path[i]+1, subpath, /*COM_SkipPath*/(nicename), ".dds");
}
else
_snprintf(fname, sizeof(fname)-1, path[i], nicename, ".dds");
_snprintf(fname, sizeof(fname)-1, path[i]+1, nicename, ".dds");
if ((buf = COM_LoadFile (fname, 5)))
{
len = GL_LoadTextureDDS(buf, com_filesize);
@ -1958,14 +1959,14 @@ int Mod_LoadHiResTexture(char *name, char *subpath, qboolean mipmap, qboolean al
for (e = sizeof(extensions)/sizeof(char *)-1; e >=0 ; e--)
{
if (i == 1)
if (path[i][0] >= '3')
{
if (!subpath)
continue;
_snprintf(fname, sizeof(fname)-1, path[i], subpath, /*COM_SkipPath*/(nicename), extensions[e]);
_snprintf(fname, sizeof(fname)-1, path[i]+1, subpath, /*COM_SkipPath*/(nicename), extensions[e]);
}
else
_snprintf(fname, sizeof(fname)-1, path[i], nicename, extensions[e]);
_snprintf(fname, sizeof(fname)-1, path[i]+1, nicename, extensions[e]);
TRACE(("dbg: Mod_LoadHiResTexture: trying %s\n", fname));
if ((buf = COM_LoadFile (fname, 5)))
{