Some small things to support the new rendering system
This commit is contained in:
parent
2758179d5a
commit
493fa4de6c
3 changed files with 29 additions and 29 deletions
12
gl_rlight.c
12
gl_rlight.c
|
@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "quakedef.h"
|
#include "quakedef.h"
|
||||||
|
|
||||||
int r_dlightframecount;
|
int r_dlightframecount;
|
||||||
|
int d_lightstylevalue[256]; // 8.8 fraction of base light value
|
||||||
|
|
||||||
//PENTA: Math utitity's
|
//PENTA: Math utitity's
|
||||||
void ProjectVector(const vec3_t b,const vec3_t a,vec3_t c) {
|
void ProjectVector(const vec3_t b,const vec3_t a,vec3_t c) {
|
||||||
|
@ -79,7 +80,7 @@ void R_AnimateLight (void)
|
||||||
LIGHT SAMPLING
|
LIGHT SAMPLING
|
||||||
|
|
||||||
=============================================================================
|
=============================================================================
|
||||||
*/
|
*//*
|
||||||
|
|
||||||
mplane_t *lightplane;
|
mplane_t *lightplane;
|
||||||
vec3_t lightspot;
|
vec3_t lightspot;
|
||||||
|
@ -182,10 +183,13 @@ int RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
||||||
// go down back side
|
// go down back side
|
||||||
return RecursiveLightPoint (node->children[!side], mid, end);
|
return RecursiveLightPoint (node->children[!side], mid, end);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
int R_LightPoint (vec3_t p)
|
int R_LightPoint (vec3_t p)
|
||||||
{
|
{
|
||||||
vec3_t end;
|
//PENTA: use the lightgrid for this
|
||||||
|
return 255;
|
||||||
|
|
||||||
|
/* vec3_t end;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (!cl.worldmodel->lightdata)
|
if (!cl.worldmodel->lightdata)
|
||||||
|
@ -200,6 +204,6 @@ int R_LightPoint (vec3_t p)
|
||||||
if (r == -1)
|
if (r == -1)
|
||||||
r = 0;
|
r = 0;
|
||||||
|
|
||||||
return r;
|
return r;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
21
gl_rmisc.c
21
gl_rmisc.c
|
@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
==================
|
==================
|
||||||
R_InitTextures
|
R_InitTextures
|
||||||
==================
|
==================
|
||||||
*/
|
*//*
|
||||||
void R_InitTextures (void)
|
void R_InitTextures (void)
|
||||||
{
|
{
|
||||||
int x,y, m;
|
int x,y, m;
|
||||||
|
@ -55,7 +55,7 @@ void R_InitTextures (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
byte dottexture[8][8] =
|
byte dottexture[8][8] =
|
||||||
{
|
{
|
||||||
{0,1,1,0,0,0,0,0},
|
{0,1,1,0,0,0,0,0},
|
||||||
|
@ -464,20 +464,16 @@ void R_NewMap (void)
|
||||||
R_CopyVerticesToHunk();
|
R_CopyVerticesToHunk();
|
||||||
|
|
||||||
// identify sky texture
|
// identify sky texture
|
||||||
skytexturenum = -1;
|
skyshadernum = -1;
|
||||||
mirrortexturenum = -1;
|
mirrortexturenum = -1;
|
||||||
for (i=0 ; i<cl.worldmodel->numtextures ; i++)
|
for (i=0 ; i<cl.worldmodel->nummapshaders ; i++)
|
||||||
{
|
{
|
||||||
if (!cl.worldmodel->textures[i])
|
if (!Q_strncmp(cl.worldmodel->mapshaders[i].shader->name,"sky",3) )
|
||||||
continue;
|
skyshadernum = i;
|
||||||
if (!Q_strncmp(cl.worldmodel->textures[i]->name,"sky",3) )
|
cl.worldmodel->mapshaders[i].texturechain = NULL;
|
||||||
skytexturenum = i;
|
|
||||||
if (!Q_strncmp(cl.worldmodel->textures[i]->name,"window02_1",10) )
|
|
||||||
mirrortexturenum = i;
|
|
||||||
cl.worldmodel->textures[i]->texturechain = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skytexturenum < 0) {
|
if (skyshadernum < 0) {
|
||||||
//Con_Printf("No sky texture found");
|
//Con_Printf("No sky texture found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -496,7 +492,6 @@ void R_NewMap (void)
|
||||||
R_ClearInstantCaches();
|
R_ClearInstantCaches();
|
||||||
R_ClearBrushInstantCaches();
|
R_ClearBrushInstantCaches();
|
||||||
R_NewMirrorChains();
|
R_NewMirrorChains();
|
||||||
curvechain = NULL;
|
|
||||||
causticschain = NULL;
|
causticschain = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
25
gl_warp.c
25
gl_warp.c
|
@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
extern model_t *loadmodel;
|
extern model_t *loadmodel;
|
||||||
|
|
||||||
int skytexturenum;
|
int skyshadernum;
|
||||||
|
|
||||||
int solidskytexture;
|
int solidskytexture;
|
||||||
int alphaskytexture;
|
int alphaskytexture;
|
||||||
|
@ -141,8 +141,8 @@ void SubdividePolygon (int numverts, float *verts)
|
||||||
|
|
||||||
for (i=0 ; i<numverts ; i++, verts+= 3)
|
for (i=0 ; i<numverts ; i++, verts+= 3)
|
||||||
{
|
{
|
||||||
tex[0] = DotProduct (verts, warpface->texinfo->vecs[0]);
|
//tex[0] = DotProduct (verts, warpface->texinfo->vecs[0]);
|
||||||
tex[1] = DotProduct (verts, warpface->texinfo->vecs[1]);
|
//tex[1] = DotProduct (verts, warpface->texinfo->vecs[1]);
|
||||||
//Penta: lighmap coords are ignored...
|
//Penta: lighmap coords are ignored...
|
||||||
R_AllocateVertexInTemp(verts,tex,tex,color);
|
R_AllocateVertexInTemp(verts,tex,tex,color);
|
||||||
}
|
}
|
||||||
|
@ -1063,7 +1063,7 @@ void LoadColorTGA (FILE *fin, byte *pixels, int *width, int *height)
|
||||||
|
|
||||||
if (targa_header.image_type!=2
|
if (targa_header.image_type!=2
|
||||||
&& targa_header.image_type!=10 && targa_header.image_type!=1)
|
&& targa_header.image_type!=10 && targa_header.image_type!=1)
|
||||||
Sys_Error ("LoadTGA: Only type 1, 2 and 10 targa images supported\n");
|
Sys_Error ("LoadColorTGA: Only type 1, 2 and 10 targa images supported, type was %i\n",targa_header.image_type);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (targa_header.colormap_type !=0
|
if (targa_header.colormap_type !=0
|
||||||
|
@ -1680,7 +1680,7 @@ R_DrawSkyChain
|
||||||
*/
|
*/
|
||||||
void R_DrawSkyChain (msurface_t *s)
|
void R_DrawSkyChain (msurface_t *s)
|
||||||
{
|
{
|
||||||
msurface_t *fa;
|
/* msurface_t *fa;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
vec3_t verts[MAX_CLIP_VERTS];
|
vec3_t verts[MAX_CLIP_VERTS];
|
||||||
|
@ -1689,10 +1689,10 @@ void R_DrawSkyChain (msurface_t *s)
|
||||||
|
|
||||||
c_sky = 0;
|
c_sky = 0;
|
||||||
GL_Bind(solidskytexture);
|
GL_Bind(solidskytexture);
|
||||||
|
*/
|
||||||
// calculate vertex values for sky box
|
// calculate vertex values for sky box
|
||||||
|
|
||||||
|
/*
|
||||||
for (fa=s ; fa ; fa=fa->texturechain)
|
for (fa=s ; fa ; fa=fa->texturechain)
|
||||||
{
|
{
|
||||||
for (p=fa->polys ; p ; p=p->next)
|
for (p=fa->polys ; p ; p=p->next)
|
||||||
|
@ -1705,7 +1705,7 @@ void R_DrawSkyChain (msurface_t *s)
|
||||||
}
|
}
|
||||||
ClipSkyPolygon (p->numverts, v, 0);
|
ClipSkyPolygon (p->numverts, v, 0);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1775,11 +1775,11 @@ void R_DrawSkyBox (void)
|
||||||
vec3_t v;
|
vec3_t v;
|
||||||
float s, t;
|
float s, t;
|
||||||
|
|
||||||
if (skytexturenum >= 0) {
|
if (skyshadernum >= 0) {
|
||||||
// glColor3f(1,1,1);
|
// glColor3f(1,1,1);
|
||||||
if (!cl.worldmodel->textures[skytexturenum]->texturechain) return;
|
if (!cl.worldmodel->mapshaders[skyshadernum].texturechain) return;
|
||||||
// R_DrawSkyChain (cl.worldmodel->textures[skytexturenum]->texturechain);
|
// R_DrawSkyChain (cl.worldmodel->textures[skytexturenum]->texturechain);
|
||||||
cl.worldmodel->textures[skytexturenum]->texturechain = NULL;
|
cl.worldmodel->mapshaders[skyshadernum].texturechain = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
glDepthMask(0);
|
glDepthMask(0);
|
||||||
|
@ -1883,7 +1883,7 @@ R_InitSky
|
||||||
|
|
||||||
A sky texture is 256*128, with the right side being a masked overlay
|
A sky texture is 256*128, with the right side being a masked overlay
|
||||||
==============
|
==============
|
||||||
*/
|
*//*
|
||||||
void R_InitSky (texture_t *mt)
|
void R_InitSky (texture_t *mt)
|
||||||
{
|
{
|
||||||
int i, j, p;
|
int i, j, p;
|
||||||
|
@ -1942,3 +1942,4 @@ void R_InitSky (texture_t *mt)
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
Loading…
Reference in a new issue