mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
load tga versions of .lmp files if present
This commit is contained in:
parent
93116bc827
commit
0dcfc6dfb4
1 changed files with 18 additions and 1 deletions
|
@ -149,6 +149,9 @@ Draw_CachePic (const char *path, qboolean alpha)
|
|||
int i;
|
||||
glpic_t *gl;
|
||||
qpic_t *dat;
|
||||
char filename[MAX_QPATH + 4];
|
||||
VFile *f;
|
||||
tex_t *targa;
|
||||
|
||||
// First, check if its cached..
|
||||
for (pic = cachepics, i = 0; i < numcachepics; pic++, i++)
|
||||
|
@ -178,7 +181,21 @@ Draw_CachePic (const char *path, qboolean alpha)
|
|||
|
||||
// Now feed it to the GL stuff and get a texture number..
|
||||
gl = (glpic_t *) pic->pic.data;
|
||||
gl->texnum = GL_LoadTexture ("", dat->width, dat->height, dat->data,
|
||||
|
||||
snprintf (filename, sizeof (filename), "%s.tga", path);
|
||||
COM_FOpenFile (filename, &f);
|
||||
if (f) {
|
||||
targa = LoadTGA (f);
|
||||
Qclose (f);
|
||||
if (targa->format < 4)
|
||||
gl->texnum = GL_LoadTexture ("", targa->width, targa->height,
|
||||
targa->data, false, alpha, 3);
|
||||
else
|
||||
gl->texnum = GL_LoadTexture ("", targa->width, targa->height,
|
||||
targa->data, false, alpha, 4);
|
||||
}
|
||||
else
|
||||
gl->texnum = GL_LoadTexture ("", dat->width, dat->height, dat->data,
|
||||
false, alpha, 1);
|
||||
|
||||
// Now lets mark this cache entry as used..
|
||||
|
|
Loading…
Reference in a new issue