Added videos as textures
This commit is contained in:
parent
9ec55a59b9
commit
c3dc3c5f87
2 changed files with 26 additions and 6 deletions
|
@ -345,6 +345,7 @@ extern cvar_t sh_lightmapbright; //PENTA:
|
||||||
extern cvar_t sh_radiusscale;
|
extern cvar_t sh_radiusscale;
|
||||||
extern cvar_t sh_visiblevolumes;
|
extern cvar_t sh_visiblevolumes;
|
||||||
extern cvar_t sh_entityshadows;
|
extern cvar_t sh_entityshadows;
|
||||||
|
extern cvar_t sh_meshshadows;
|
||||||
extern cvar_t sh_worldshadows;
|
extern cvar_t sh_worldshadows;
|
||||||
extern cvar_t sh_showlightnum;
|
extern cvar_t sh_showlightnum;
|
||||||
extern cvar_t sh_glows;
|
extern cvar_t sh_glows;
|
||||||
|
@ -1460,3 +1461,7 @@ extern cvar_t willi_gray_colormaps;
|
||||||
gltexture_t *GL_CacheTexture (char *filename, qboolean mipmap, int type);
|
gltexture_t *GL_CacheTexture (char *filename, qboolean mipmap, int type);
|
||||||
shader_t *GL_ShaderForName(char *name);
|
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);
|
25
textures.c
25
textures.c
|
@ -986,7 +986,7 @@ GL_Upload8
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
//XYZ
|
//XYZ
|
||||||
static unsigned trans[1024*1024]; // FIXME, temporary
|
unsigned trans[1024*1024]; // FIXME, temporary
|
||||||
static unsigned char glosspix[1024*1024];
|
static unsigned char glosspix[1024*1024];
|
||||||
|
|
||||||
#define RED_MASK 0x00FF0000
|
#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));
|
strncpy (glt->identifier, filename, sizeof(glt->identifier));
|
||||||
glt->texnum = texture_extension_number;
|
glt->texnum = texture_extension_number;
|
||||||
|
texture_extension_number++;
|
||||||
glt->mipmap = mipmap;
|
glt->mipmap = mipmap;
|
||||||
|
glt->dynamic = NULL;
|
||||||
|
|
||||||
if (!strcmp(filename,"$white")) {
|
if (!strcmp(filename,"$white")) {
|
||||||
//a uniform white texture
|
//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
|
//a flat normal map with no gloss
|
||||||
trans[0] = LittleLong ((0 << 24)|(127 << 16)|(255 << 8)|(127));
|
trans[0] = LittleLong ((0 << 24)|(127 << 16)|(255 << 8)|(127));
|
||||||
width = height = 1;
|
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 {
|
} else {
|
||||||
int rez;
|
int rez;
|
||||||
qboolean hasgloss = false;
|
qboolean hasgloss = false;
|
||||||
|
@ -1289,10 +1295,7 @@ gltexture_t *GL_CacheTexture (char *filename, qboolean mipmap, int type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_Bind(texture_extension_number );
|
GL_Bind(glt->texnum);
|
||||||
texture_extension_number++;
|
|
||||||
|
|
||||||
//
|
|
||||||
glt->width = width;
|
glt->width = width;
|
||||||
glt->height = height;
|
glt->height = height;
|
||||||
|
|
||||||
|
@ -1309,6 +1312,18 @@ gltexture_t *GL_CacheTexture (char *filename, qboolean mipmap, int type)
|
||||||
return glt;
|
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)
|
int GL_LoadLuma(char *identifier, qboolean mipmap)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue