From c3dc3c5f8721c9938b07d203457744be4e9482b1 Mon Sep 17 00:00:00 2001 From: cholleme <> Date: Sat, 15 Mar 2003 19:34:28 +0000 Subject: [PATCH] Added videos as textures --- glquake.h | 7 ++++++- textures.c | 25 ++++++++++++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/glquake.h b/glquake.h index 1c63bd0..193db9a 100644 --- a/glquake.h +++ b/glquake.h @@ -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); \ No newline at end of file +qboolean IsShaderBlended(shader_t *s); + +void Roq_Info_f(void); +void Roq_SetupTexture(gltexture_t *tex,char *filename); +void Roq_FreeTexture(gltexture_t *tex); \ No newline at end of file diff --git a/textures.c b/textures.c index e60b35d..3ded36d 100644 --- a/textures.c +++ b/textures.c @@ -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