mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
external mip texture loading
This commit is contained in:
parent
9c1969146c
commit
93116bc827
6 changed files with 46 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -56,6 +56,11 @@ Mod_ProcessTexture (miptex_t *mt, texture_t *tx)
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
Mod_LoadExternalTextures (model_t *mod)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Mod_LoadLighting (lump_t *l)
|
||||
{
|
||||
|
|
|
@ -225,6 +225,7 @@ Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator)
|
|||
|
||||
default:
|
||||
Mod_LoadBrushModel (mod, buf);
|
||||
Mod_LoadExternalTextures (mod);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,6 +67,11 @@ Mod_ProcessTexture (miptex_t *mx, texture_t *tx)
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
Mod_LoadExternalTextures (model_t *mod)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
GL_SubdivideSurface (msurface_t *fa)
|
||||
{
|
||||
|
|
|
@ -67,6 +67,11 @@ Mod_ProcessTexture (miptex_t *mx, texture_t *tx)
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
Mod_LoadExternalTextures (model_t *mod)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
GL_SubdivideSurface (msurface_t *fa)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue