external mip texture loading

This commit is contained in:
Seth Galbraith 2002-01-16 01:02:50 +00:00
parent 9c1969146c
commit 93116bc827
6 changed files with 46 additions and 0 deletions

View file

@ -455,6 +455,7 @@ mleaf_t *Mod_PointInLeaf (const vec3_t p, model_t *model);
byte *Mod_LeafPVS (mleaf_t *leaf, model_t *model);
model_t *Mod_FindName (const char *name);
void Mod_ProcessTexture(miptex_t *mt, texture_t *tx);
void Mod_LoadExternalTextures (model_t * mod);
void Mod_LoadLighting (lump_t *l);
int Mod_CalcFullbright (byte *in, byte *out, int pixels);
int Mod_Fullbright (byte * skin, int width, int height, char *name);

View file

@ -43,6 +43,8 @@ static const char rcsid[] =
#include "QF/model.h"
#include "QF/qendian.h"
#include "QF/sys.h"
#include "QF/texture.h"
#include "QF/tga.h"
#include "QF/vfs.h"
#include "QF/GL/qf_textures.h"
@ -63,6 +65,33 @@ Mod_ProcessTexture (miptex_t *mt, texture_t *tx)
true, false, 1);
}
void
Mod_LoadExternalTextures (model_t *mod)
{
texture_t *tx;
char filename[MAX_QPATH + 4];
VFile *f;
tex_t *targa;
int i;
for (i = 0; i < mod->numtextures; i++)
{
tx = mod->textures[i];
snprintf (filename, sizeof (filename), "maps/%s.tga", tx->name);
COM_FOpenFile (filename, &f);
if (f) {
targa = LoadTGA (f);
Qclose (f);
if (targa->format < 4)
tx->gl_texturenum = GL_LoadTexture (tx->name, targa->width,
targa->height, targa->data, true, false, 3);
else
tx->gl_texturenum = GL_LoadTexture (tx->name, targa->width,
targa->height, targa->data, true, true, 4);
}
}
}
void
Mod_LoadLighting (lump_t *l)
{

View file

@ -56,6 +56,11 @@ Mod_ProcessTexture (miptex_t *mt, texture_t *tx)
{
}
void
Mod_LoadExternalTextures (model_t *mod)
{
}
void
Mod_LoadLighting (lump_t *l)
{

View file

@ -225,6 +225,7 @@ Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator)
default:
Mod_LoadBrushModel (mod, buf);
Mod_LoadExternalTextures (mod);
break;
}

View file

@ -67,6 +67,11 @@ Mod_ProcessTexture (miptex_t *mx, texture_t *tx)
{
}
void
Mod_LoadExternalTextures (model_t *mod)
{
}
void
GL_SubdivideSurface (msurface_t *fa)
{

View file

@ -67,6 +67,11 @@ Mod_ProcessTexture (miptex_t *mx, texture_t *tx)
{
}
void
Mod_LoadExternalTextures (model_t *mod)
{
}
void
GL_SubdivideSurface (msurface_t *fa)
{