Added videos as textures

This commit is contained in:
cholleme 2003-03-15 19:34:28 +00:00
parent 9ec55a59b9
commit c3dc3c5f87
2 changed files with 26 additions and 6 deletions

View file

@ -345,6 +345,7 @@ extern cvar_t sh_lightmapbright; //PENTA:
extern cvar_t sh_radiusscale;
extern cvar_t sh_visiblevolumes;
extern cvar_t sh_entityshadows;
extern cvar_t sh_meshshadows;
extern cvar_t sh_worldshadows;
extern cvar_t sh_showlightnum;
extern cvar_t sh_glows;
@ -1459,4 +1460,8 @@ extern cvar_t willi_gray_colormaps;
gltexture_t *GL_CacheTexture (char *filename, qboolean mipmap, int type);
shader_t *GL_ShaderForName(char *name);
qboolean IsShaderBlended(shader_t *s);
qboolean IsShaderBlended(shader_t *s);
void Roq_Info_f(void);
void Roq_SetupTexture(gltexture_t *tex,char *filename);
void Roq_FreeTexture(gltexture_t *tex);

View file

@ -986,7 +986,7 @@ GL_Upload8
===============
*/
//XYZ
static unsigned trans[1024*1024]; // FIXME, temporary
unsigned trans[1024*1024]; // FIXME, temporary
static unsigned char glosspix[1024*1024];
#define RED_MASK 0x00FF0000
@ -1241,7 +1241,9 @@ gltexture_t *GL_CacheTexture (char *filename, qboolean mipmap, int type)
strncpy (glt->identifier, filename, sizeof(glt->identifier));
glt->texnum = texture_extension_number;
texture_extension_number++;
glt->mipmap = mipmap;
glt->dynamic = NULL;
if (!strcmp(filename,"$white")) {
//a uniform white texture
@ -1251,6 +1253,10 @@ gltexture_t *GL_CacheTexture (char *filename, qboolean mipmap, int type)
//a flat normal map with no gloss
trans[0] = LittleLong ((0 << 24)|(127 << 16)|(255 << 8)|(127));
width = height = 1;
} else if (!strcmp(COM_FileExtension(filename),"roq")) {
Con_Printf("Loading video texture from %s\n",filename);
Roq_SetupTexture(glt, filename) ;
return glt;
} else {
int rez;
qboolean hasgloss = false;
@ -1289,10 +1295,7 @@ gltexture_t *GL_CacheTexture (char *filename, qboolean mipmap, int type)
}
}
GL_Bind(texture_extension_number );
texture_extension_number++;
//
GL_Bind(glt->texnum);
glt->width = width;
glt->height = height;
@ -1309,6 +1312,18 @@ gltexture_t *GL_CacheTexture (char *filename, qboolean mipmap, int type)
return glt;
}
void GL_ShutdownTextures(void) {
int i;
gltexture_t *glt;
for (i=0, glt=gltextures ; i<numgltextures ; i++, glt++)
{
//found one, return it...
if (gltextures[i].dynamic) {
Roq_FreeTexture(&gltextures[i]);
}
}
}
int GL_LoadLuma(char *identifier, qboolean mipmap)
{