diff --git a/src/refresh/opengl/gl_rmisc.c b/src/refresh/opengl/gl_rmisc.c index 2ee56e5d..3cee589c 100644 --- a/src/refresh/opengl/gl_rmisc.c +++ b/src/refresh/opengl/gl_rmisc.c @@ -109,9 +109,9 @@ void GL_ScreenShot_f (void) Com_sprintf (checkname, sizeof(checkname), "%s/scrnshot", ri.FS_Gamedir()); Sys_Mkdir (checkname); -// -// find a file name to save it to -// + // + // find a file name to save it to + // strcpy(picname,"quake00.tga"); for (i=0 ; i<=99 ; i++) @@ -244,3 +244,4 @@ void GL_UpdateSwapInterval( void ) } } } + diff --git a/src/refresh/opengl/gl_rsurf.c b/src/refresh/opengl/gl_rsurf.c index 933c91dc..6c906355 100644 --- a/src/refresh/opengl/gl_rsurf.c +++ b/src/refresh/opengl/gl_rsurf.c @@ -17,9 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// GL_RSURF.C: surface-related refresh code -#include +#include #include "header/local.h" static vec3_t modelorg; // relative to viewpoint @@ -97,81 +96,6 @@ image_t *R_TextureAnimation (mtexinfo_t *tex) return tex->image; } -#if 0 -/* -================= -WaterWarpPolyVerts - -Mangles the x and y coordinates in a copy of the poly -so that any drawing routine can be water warped -================= -*/ -glpoly_t *WaterWarpPolyVerts (glpoly_t *p) -{ - int i; - float *v, *nv; - static byte buffer[1024]; - glpoly_t *out; - - out = (glpoly_t *)buffer; - - out->numverts = p->numverts; - v = p->verts[0]; - nv = out->verts[0]; - for (i=0 ; inumverts ; i++, v+= VERTEXSIZE, nv+=VERTEXSIZE) - { - nv[0] = v[0] + 4*sin(v[1]*0.05+r_newrefdef.time)*sin(v[2]*0.05+r_newrefdef.time); - nv[1] = v[1] + 4*sin(v[0]*0.05+r_newrefdef.time)*sin(v[2]*0.05+r_newrefdef.time); - - nv[2] = v[2]; - nv[3] = v[3]; - nv[4] = v[4]; - nv[5] = v[5]; - nv[6] = v[6]; - } - - return out; -} - -/* -================ -DrawGLWaterPoly - -Warp the vertex coordinates -================ -*/ -void DrawGLWaterPoly (glpoly_t *p) -{ - int i; - float *v; - - p = WaterWarpPolyVerts (p); - qglBegin (GL_TRIANGLE_FAN); - v = p->verts[0]; - for (i=0 ; inumverts ; i++, v+= VERTEXSIZE) - { - qglTexCoord2f (v[3], v[4]); - qglVertex3fv (v); - } - qglEnd (); -} -void DrawGLWaterPolyLightmap (glpoly_t *p) -{ - int i; - float *v; - - p = WaterWarpPolyVerts (p); - qglBegin (GL_TRIANGLE_FAN); - v = p->verts[0]; - for (i=0 ; inumverts ; i++, v+= VERTEXSIZE) - { - qglTexCoord2f (v[5], v[6]); - qglVertex3fv (v); - } - qglEnd (); -} -#endif - /* ================ DrawGLPoly @@ -514,14 +438,14 @@ void R_RenderBrushPoly (msurface_t *fa) GL_TexEnv( GL_REPLACE ); } -//====== -//PGM + //====== + //PGM if(fa->texinfo->flags & SURF_FLOWING) DrawGLFlowingPoly (fa); else DrawGLPoly (fa->polys); -//PGM -//====== + //PGM + //====== /* ** check for lightmap modification @@ -647,8 +571,6 @@ void DrawTextureChains (void) c_visible_textures = 0; -// GL_TexEnv( GL_REPLACE ); - if ( !qglSelectTextureSGIS && !qglActiveTextureARB ) { for ( i = 0, image=gltextures ; itexturechain = NULL; } -// GL_EnableMultitexture( true ); } GL_TexEnv( GL_REPLACE ); @@ -784,8 +705,8 @@ dynamic: GL_MBind( QGL_TEXTURE0, image->texnum ); GL_MBind( QGL_TEXTURE1, gl_state.lightmap_textures + lmtex ); -//========== -//PGM + //========== + //PGM if (surf->texinfo->flags & SURF_FLOWING) { float scroll; @@ -822,8 +743,8 @@ dynamic: qglEnd (); } } -//PGM -//========== + //PGM + //========== } else { @@ -832,8 +753,8 @@ dynamic: GL_MBind( QGL_TEXTURE0, image->texnum ); GL_MBind( QGL_TEXTURE1, gl_state.lightmap_textures + lmtex ); -//========== -//PGM + //========== + //PGM if (surf->texinfo->flags & SURF_FLOWING) { float scroll; @@ -857,8 +778,8 @@ dynamic: } else { -//PGM -//========== + //PGM + //========== for ( p = surf->polys; p; p = p->chain ) { v = p->verts[0]; @@ -871,11 +792,11 @@ dynamic: } qglEnd (); } -//========== -//PGM + //========== + //PGM } -//PGM -//========== + //PGM + //========== } } @@ -921,7 +842,7 @@ void R_DrawInlineBModel (void) dot = DotProduct (modelorg, pplane->normal) - pplane->dist; - // draw the polygon + // draw the polygon if (((psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) || (!(psurf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON))) { @@ -1057,7 +978,7 @@ void R_RecursiveWorldNode (mnode_t *node) if (R_CullBox (node->minmaxs, node->minmaxs+3)) return; -// if a leaf node, draw stuff + // if a leaf node, draw stuff if (node->contents != -1) { pleaf = (mleaf_t *)node; @@ -1084,9 +1005,8 @@ void R_RecursiveWorldNode (mnode_t *node) return; } -// node is just a decision point, so go down the apropriate sides - -// find which side of the node we are on + // node is just a decision point, so go down the apropriate sides + // find which side of the node we are on plane = node->plane; switch (plane->type) @@ -1116,7 +1036,7 @@ void R_RecursiveWorldNode (mnode_t *node) sidebit = SURF_PLANEBACK; } -// recurse down the children, front side first + // recurse down the children, front side first R_RecursiveWorldNode (node->children[side]); // draw stuff @@ -1157,42 +1077,6 @@ void R_RecursiveWorldNode (mnode_t *node) // recurse down the back side R_RecursiveWorldNode (node->children[!side]); -/* - for ( ; c ; c--, surf++) - { - if (surf->visframe != r_framecount) - continue; - - if ( (surf->flags & SURF_PLANEBACK) != sidebit ) - continue; // wrong side - - if (surf->texinfo->flags & SURF_SKY) - { // just adds to visible sky bounds - R_AddSkySurface (surf); - } - else if (surf->texinfo->flags & (SURF_TRANS33|SURF_TRANS66)) - { // add to the translucent chain -// surf->texturechain = alpha_surfaces; -// alpha_surfaces = surf; - } - else - { - if ( qglMTexCoord2fSGIS && !( surf->flags & SURF_DRAWTURB ) ) - { - GL_RenderLightmappedPoly( surf ); - } - else - { - // the polygon is visible, so add it to the texture - // sorted chain - // FIXME: this is a hack for animation - image = R_TextureAnimation (surf->texinfo); - surf->texturechain = image->texturechain; - image->texturechain = surf; - } - } - } -*/ } @@ -1329,23 +1213,6 @@ void R_MarkLeaves (void) } while (node); } } - -#if 0 - for (i=0 ; ivis->numclusters ; i++) - { - if (vis[i>>3] & (1<<(i&7))) - { - node = (mnode_t *)&r_worldmodel->leafs[i]; // FIXME: cluster - do - { - if (node->visframe == r_visframecount) - break; - node->visframe = r_visframecount; - node = node->parent; - } while (node); - } - } -#endif } @@ -1464,7 +1331,7 @@ void GL_BuildPolygonFromSurface(msurface_t *fa) glpoly_t *poly; vec3_t total; -// reconstruct the polygon + // reconstruct the polygon pedges = currentmodel->edges; lnumverts = fa->numedges; vertpage = 0; @@ -1598,8 +1465,6 @@ void GL_BeginBuildingLightmaps (model_t *m) if (!gl_state.lightmap_textures) { gl_state.lightmap_textures = TEXNUM_LIGHTMAPS; -// gl_state.lightmap_textures = gl_state.texture_extension_number; -// gl_state.texture_extension_number = gl_state.lightmap_textures + MAX_LIGHTMAPS; } gl_lms.current_lightmap_texture = 1; diff --git a/src/refresh/opengl/gl_warp.c b/src/refresh/opengl/gl_warp.c index 7bbd185c..0e6091cf 100644 --- a/src/refresh/opengl/gl_warp.c +++ b/src/refresh/opengl/gl_warp.c @@ -17,7 +17,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// gl_warp.c -- sky and water polygons #include "header/local.h" @@ -231,19 +230,11 @@ void EmitWaterPolys (msurface_t *fa) os = v[3]; ot = v[4]; -#if !id386 s = os + r_turbsin[(int)((ot*0.125+r_newrefdef.time) * TURBSCALE) & 255]; -#else - s = os + r_turbsin[Q_ftol( ((ot*0.125+rdt) * TURBSCALE) ) & 255]; -#endif s += scroll; s *= (1.0/64); -#if !id386 t = ot + r_turbsin[(int)((os*0.125+rdt) * TURBSCALE) & 255]; -#else - t = ot + r_turbsin[Q_ftol( ((os*0.125+rdt) * TURBSCALE) ) & 255]; -#endif t *= (1.0/64); qglTexCoord2f (s, t); @@ -267,7 +258,6 @@ vec3_t skyclip[6] = { }; int c_sky; -// 1 = s, 2 = t, 3 = 2048 int st_to_vec[6][3] = { {3,-1,2}, @@ -279,11 +269,8 @@ int st_to_vec[6][3] = {-2,-1,3}, // 0 degrees yaw, look straight up {2,-1,-3} // look straight down -// {-1,2,3}, -// {1,2,-3} }; -// s = [0]/[2], t = [1]/[2] int vec_to_st[6][3] = { {-2,3,1}, @@ -294,9 +281,6 @@ int vec_to_st[6][3] = {-2,-1,3}, {-2,1,-3} - -// {-1,2,3}, -// {1,2,-3} }; float skymins[2][6], skymaxs[2][6]; @@ -311,16 +295,7 @@ void DrawSkyPolygon (int nump, vec3_t vecs) float *vp; c_sky++; -#if 0 -glBegin (GL_POLYGON); -for (i=0 ; i #include -#ifndef SOLARIS -//#include -#else -#include #ifndef GL_COLOR_INDEX8_EXT #define GL_COLOR_INDEX8_EXT GL_COLOR_INDEX #endif -#endif + #include #ifndef _WIN32 @@ -68,7 +64,6 @@ typedef struct extern viddef_t vid; - /* skins will be outline flood filled and mip mapped @@ -142,12 +137,9 @@ typedef struct float r, g, b; } glvert_t; - #define MAX_LBM_HEIGHT 480 - #define BACKFACE_EPSILON 0.01 - //==================================================== extern image_t gltextures[MAX_GLTEXTURES]; @@ -306,16 +298,6 @@ void R_ClearSkyBox (void); void R_DrawSkyBox (void); void R_MarkLights (dlight_t *light, int bit, mnode_t *node); -#if 0 -short LittleShort (short l); -short BigShort (short l); -int LittleLong (int l); -float LittleFloat (float f); - -char *va(char *format, ...); -// does a varargs printf into a temp buffer -#endif - void COM_StripExtension (char *in, char *out); void Draw_GetPicSize (int *w, int *h, char *name); @@ -449,7 +431,6 @@ IMPORTED FUNCTIONS extern refimport_t ri; - /* ==================================================================== diff --git a/src/refresh/opengl/header/model.h b/src/refresh/opengl/header/model.h index 7316cfbf..fc5f1cb0 100644 --- a/src/refresh/opengl/header/model.h +++ b/src/refresh/opengl/header/model.h @@ -36,8 +36,6 @@ BRUSH MODELS // // in memory representation -// -// !!! if this is changed, it must be changed in asm_draw.h too !!! typedef struct { vec3_t position; @@ -53,19 +51,16 @@ typedef struct int firstface, numfaces; } mmodel_t; - #define SIDE_FRONT 0 #define SIDE_BACK 1 #define SIDE_ON 2 - #define SURF_PLANEBACK 2 #define SURF_DRAWSKY 4 #define SURF_DRAWTURB 0x10 #define SURF_DRAWBACKGROUND 0x40 #define SURF_UNDERWATER 0x80 -// !!! if this is changed, it must be changed in asm_draw.h too !!! typedef struct { unsigned short v[2]; @@ -114,7 +109,7 @@ typedef struct msurface_s mtexinfo_t *texinfo; -// lighting info + // lighting info int dlightframe; int dlightbits; @@ -126,7 +121,7 @@ typedef struct msurface_s typedef struct mnode_s { -// common with leaf + // common with leaf int contents; // -1, to differentiate from leafs int visframe; // node needs to be traversed if current @@ -134,7 +129,7 @@ typedef struct mnode_s struct mnode_s *parent; -// node specific + // node specific cplane_t *plane; struct mnode_s *children[2]; @@ -146,7 +141,7 @@ typedef struct mnode_s typedef struct mleaf_s { -// common with node + // common with node int contents; // wil be a negative contents number int visframe; // node needs to be traversed if current @@ -154,7 +149,7 @@ typedef struct mleaf_s struct mnode_s *parent; -// leaf specific + // leaf specific int cluster; int area; @@ -182,21 +177,21 @@ typedef struct model_s int flags; -// -// volume occupied by the model graphics -// + // + // volume occupied by the model graphics + // vec3_t mins, maxs; float radius; -// -// solid volume for clipping -// + // + // solid volume for clipping + // qboolean clipbox; vec3_t clipmins, clipmaxs; -// -// brush model -// + // + // brush model + // int firstmodelsurface, nummodelsurfaces; int lightmap; // only for submodels diff --git a/src/refresh/opengl/header/qgl.h b/src/refresh/opengl/header/qgl.h index bfeb6027..422e17e8 100644 --- a/src/refresh/opengl/header/qgl.h +++ b/src/refresh/opengl/header/qgl.h @@ -17,6 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + /* ** QGL.H */ @@ -29,9 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #endif #include -#ifndef SOLARIS -//#include -#endif qboolean QGL_Init( const char *dllname ); void QGL_Shutdown( void ); @@ -428,18 +426,14 @@ extern BOOL ( WINAPI * qwglSetDeviceGammaRampEXT ) ( const unsigned char *pRed, #endif -#ifdef __linux__ - +#if defined __linux__ || defined __FreeBSD__ // local function in dll extern void *qwglGetProcAddress(char *symbol); -extern void (*qgl3DfxSetPaletteEXT)(GLuint *); - // 3dfxSetPaletteEXT shunt void Fake_glColorTableEXT( GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table ); - #endif // linux /* deprecated */