mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
pretty 32 bit color sprite tga loading - e.g progs/s_light.spr_0.tga
This commit is contained in:
parent
5f4c7ee7bd
commit
3b6c2c8d0d
1 changed files with 25 additions and 0 deletions
|
@ -37,7 +37,11 @@ static const char rcsid[] =
|
|||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "QF/console.h"
|
||||
#include "QF/model.h"
|
||||
#include "QF/texture.h"
|
||||
#include "QF/tga.h"
|
||||
#include "QF/vfs.h"
|
||||
#include "QF/GL/qf_textures.h"
|
||||
|
||||
#include "compat.h"
|
||||
|
@ -46,6 +50,27 @@ void
|
|||
Mod_SpriteLoadTexture (mspriteframe_t *pspriteframe, int framenum)
|
||||
{
|
||||
char name[64];
|
||||
qboolean loaded = true;
|
||||
VFile *f;
|
||||
tex_t *targa;
|
||||
|
||||
snprintf (name, sizeof (name), "%s_%i.tga", loadmodel->name, framenum);
|
||||
COM_FOpenFile (name, &f);
|
||||
if (f) {
|
||||
targa = LoadTGA (f);
|
||||
Qclose (f);
|
||||
if (targa->format < 4)
|
||||
pspriteframe->gl_texturenum =
|
||||
GL_LoadTexture (name, targa->width,
|
||||
targa->height, targa->data, true, false, 3);
|
||||
else
|
||||
pspriteframe->gl_texturenum =
|
||||
GL_LoadTexture (name, targa->width,
|
||||
targa->height, targa->data, true, true, 4);
|
||||
return;
|
||||
}
|
||||
Con_DPrintf ("Couldn't load %s\n", name);
|
||||
loaded = false;
|
||||
|
||||
snprintf (name, sizeof (name), "%s_%i", loadmodel->name, framenum);
|
||||
pspriteframe->gl_texturenum =
|
||||
|
|
Loading…
Reference in a new issue