diff --git a/include/glquake.h b/include/glquake.h index c7d60ef..4a8ab8e 100644 --- a/include/glquake.h +++ b/include/glquake.h @@ -19,10 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // disable data conversion warnings -#pragma warning(disable : 4244) // MIPS -#pragma warning(disable : 4136) // X86 -#pragma warning(disable : 4051) // ALPHA - #ifdef _WIN32 #include #endif @@ -35,15 +31,15 @@ void GL_EndRendering (void); // Function prototypes for the Texture Object Extension routines -typedef GLboolean (APIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *, +typedef GLboolean (GLAPIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *, const GLboolean *); -typedef void (APIENTRY *BINDTEXFUNCPTR)(GLenum, GLuint); -typedef void (APIENTRY *DELTEXFUNCPTR)(GLsizei, const GLuint *); -typedef void (APIENTRY *GENTEXFUNCPTR)(GLsizei, GLuint *); -typedef GLboolean (APIENTRY *ISTEXFUNCPTR)(GLuint); -typedef void (APIENTRY *PRIORTEXFUNCPTR)(GLsizei, const GLuint *, +typedef void (GLAPIENTRY *BINDTEXFUNCPTR)(GLenum, GLuint); +typedef void (GLAPIENTRY *DELTEXFUNCPTR)(GLsizei, const GLuint *); +typedef void (GLAPIENTRY *GENTEXFUNCPTR)(GLsizei, GLuint *); +typedef GLboolean (GLAPIENTRY *ISTEXFUNCPTR)(GLuint); +typedef void (GLAPIENTRY *PRIORTEXFUNCPTR)(GLsizei, const GLuint *, const GLclampf *); -typedef void (APIENTRY *TEXSUBIMAGEPTR)(int, int, int, int, int, int, int, int, void *); +typedef void (GLAPIENTRY *TEXSUBIMAGEPTR)(int, int, int, int, int, int, int, int, void *); extern BINDTEXFUNCPTR bindTexFunc; extern DELTEXFUNCPTR delTexFunc; @@ -53,6 +49,7 @@ extern int texture_extension_number; extern int texture_mode; extern float gldepthmin, gldepthmax; +extern float v_blend[4]; void GL_Upload32 (unsigned *data, int width, int height, qboolean mipmap, qboolean alpha); void GL_Upload8 (byte *data, int width, int height, qboolean mipmap, qboolean alpha); diff --git a/include/view.h b/include/view.h index 7c12548..5017bad 100644 --- a/include/view.h +++ b/include/view.h @@ -21,9 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern cvar_t v_gamma; extern cvar_t lcd_x; -#ifdef GLQUAKE -extern float v_blend[4]; -#endif void V_Init (void); void V_RenderView (void); diff --git a/source/gl_draw.c b/source/gl_draw.c index 34c1c92..f632fe0 100644 --- a/source/gl_draw.c +++ b/source/gl_draw.c @@ -51,7 +51,7 @@ #include "console.h" #include "glquake.h" - +extern byte *host_basepal; extern unsigned char d_15to8table[65536]; extern cvar_t crosshair, cl_crossx, cl_crossy, crosshaircolor; diff --git a/source/gl_mesh.c b/source/gl_mesh.c index 94383d1..8c001ed 100644 --- a/source/gl_mesh.c +++ b/source/gl_mesh.c @@ -26,8 +26,30 @@ $Id$ */ // gl_mesh.c: triangle model functions +#include +#include -#include "quakedef.h" +#include "bothdefs.h" // needed by: common.h, net.h, client.h + +#include "common.h" +#include "bspfile.h" // needed by: glquake.h +#include "vid.h" +#include "sys.h" +#include "zone.h" // needed by: client.h, gl_model.h +#include "mathlib.h" // needed by: protocol.h, render.h, client.h, + // modelgen.h, glmodel.h +#include "wad.h" +#include "draw.h" +#include "cvar.h" +#include "net.h" // needed by: client.h +#include "protocol.h" // needed by: client.h +#include "cmd.h" +#include "sbar.h" +#include "render.h" // needed by: client.h, gl_model.h, glquake.h +#include "client.h" // need cls in this file +#include "gl_model.h" // needed by: glquake.h +#include "console.h" +#include "glquake.h" /* ================================================================= @@ -208,7 +230,7 @@ void BuildTris (void) int i, j, k; int startv; float s, t; - int len, bestlen, besttype; + int len, bestlen, besttype = 0; int bestverts[1024]; int besttris[1024]; int type; diff --git a/source/gl_model.c b/source/gl_model.c index 2dd128a..923475f 100644 --- a/source/gl_model.c +++ b/source/gl_model.c @@ -29,8 +29,33 @@ // models are the only shared resource between a client and server running // on the same machine. +#include +#include +#include + +#include "bothdefs.h" // needed by: common.h, net.h, client.h + +#include "common.h" +#include "bspfile.h" // needed by: glquake.h +#include "vid.h" +#include "sys.h" +#include "zone.h" // needed by: client.h, gl_model.h +#include "mathlib.h" // needed by: protocol.h, render.h, client.h, + // modelgen.h, glmodel.h +#include "wad.h" +#include "draw.h" +#include "cvar.h" +#include "crc.h" +#include "net.h" // needed by: client.h +#include "protocol.h" // needed by: client.h +#include "cmd.h" +#include "sbar.h" +#include "render.h" // needed by: client.h, gl_model.h, glquake.h +#include "client.h" // need cls in this file +#include "gl_model.h" // needed by: glquake.h +#include "console.h" +#include "glquake.h" -#include "quakedef.h" model_t *loadmodel; char loadname[32]; // for hunk tags diff --git a/source/gl_ngraph.c b/source/gl_ngraph.c index d72aa5e..60f1b41 100644 --- a/source/gl_ngraph.c +++ b/source/gl_ngraph.c @@ -25,8 +25,32 @@ $Id$ */ +#include +#include + +#include "bothdefs.h" // needed by: common.h, net.h, client.h + +#include "common.h" +#include "bspfile.h" // needed by: glquake.h +#include "vid.h" +#include "sys.h" +#include "zone.h" // needed by: client.h, gl_model.h +#include "mathlib.h" // needed by: protocol.h, render.h, client.h, + // modelgen.h, glmodel.h +#include "wad.h" +#include "draw.h" +#include "cvar.h" +#include "menu.h" +#include "net.h" // needed by: client.h +#include "protocol.h" // needed by: client.h +#include "cmd.h" +#include "sbar.h" +#include "render.h" // needed by: client.h, gl_model.h, glquake.h +#include "client.h" // need cls in this file +#include "gl_model.h" // needed by: glquake.h +#include "console.h" +#include "glquake.h" -#include "quakedef.h" extern byte *draw_chars; // 8*8 graphic characters diff --git a/source/gl_rlight.c b/source/gl_rlight.c index ca6d359..a907283 100644 --- a/source/gl_rlight.c +++ b/source/gl_rlight.c @@ -25,8 +25,31 @@ $Id$ */ +#include +#include +#include -#include "quakedef.h" +#include "bothdefs.h" // needed by: common.h, net.h, client.h + +#include "common.h" +#include "bspfile.h" // needed by: glquake.h +#include "vid.h" +#include "sys.h" +#include "zone.h" // needed by: client.h, gl_model.h +#include "mathlib.h" // needed by: protocol.h, render.h, client.h, + // modelgen.h, glmodel.h +#include "wad.h" +#include "draw.h" +#include "cvar.h" // needed by: view.h +#include "net.h" // needed by: client.h +#include "protocol.h" // needed by: client.h +#include "cmd.h" +#include "sbar.h" +#include "render.h" // needed by: client.h, gl_model.h, glquake.h +#include "client.h" // need cls in this file +#include "gl_model.h" // needed by: glquake.h +#include "console.h" +#include "glquake.h" int r_dlightframecount; diff --git a/source/gl_rmain.c b/source/gl_rmain.c index 9a7b229..d1ce542 100644 --- a/source/gl_rmain.c +++ b/source/gl_rmain.c @@ -25,8 +25,34 @@ $Id$ */ +#include +#include +#include +#include + +#include "bothdefs.h" // needed by: common.h, net.h, client.h + +#include "common.h" +#include "bspfile.h" // needed by: glquake.h +#include "vid.h" +#include "sys.h" +#include "zone.h" // needed by: client.h, gl_model.h +#include "mathlib.h" // needed by: protocol.h, render.h, client.h, + // modelgen.h, glmodel.h +#include "wad.h" +#include "draw.h" +#include "cvar.h" +#include "net.h" // needed by: client.h +#include "protocol.h" // needed by: client.h +#include "sound.h" +#include "cmd.h" +#include "sbar.h" +#include "render.h" // needed by: client.h, gl_model.h, glquake.h +#include "client.h" // need cls in this file +#include "gl_model.h" // needed by: glquake.h +#include "console.h" +#include "glquake.h" -#include "quakedef.h" entity_t r_worldentity; diff --git a/source/gl_rmisc.c b/source/gl_rmisc.c index e77380b..24e8d4e 100644 --- a/source/gl_rmisc.c +++ b/source/gl_rmisc.c @@ -25,9 +25,32 @@ $Id$ */ +#include +#include -#include "quakedef.h" +#include "bothdefs.h" // needed by: common.h, net.h, client.h +#include "common.h" +#include "bspfile.h" // needed by: glquake.h +#include "vid.h" +#include "sys.h" +#include "zone.h" // needed by: client.h, gl_model.h +#include "mathlib.h" // needed by: protocol.h, render.h, client.h, + // modelgen.h, glmodel.h +#include "wad.h" +#include "draw.h" +#include "cvar.h" +#include "net.h" // needed by: client.h +#include "protocol.h" // needed by: client.h +#include "cmd.h" +#include "sbar.h" +#include "render.h" // needed by: client.h, gl_model.h, glquake.h +#include "client.h" // need cls in this file +#include "gl_model.h" // needed by: glquake.h +#include "console.h" +#include "glquake.h" + +qboolean VID_Is8bit(void); extern void R_InitBubble(); /* diff --git a/source/gl_rsurf.c b/source/gl_rsurf.c index dfaf612..2d34480 100644 --- a/source/gl_rsurf.c +++ b/source/gl_rsurf.c @@ -26,9 +26,32 @@ $Id$ */ // r_surf.c: surface-related refresh code +#include +#include -#include "quakedef.h" +#include "bothdefs.h" // needed by: common.h, net.h, client.h +#include "common.h" +#include "bspfile.h" // needed by: glquake.h +#include "vid.h" +#include "sys.h" +#include "zone.h" // needed by: client.h, gl_model.h +#include "mathlib.h" // needed by: protocol.h, render.h, client.h, + // modelgen.h, glmodel.h +#include "wad.h" +#include "draw.h" +#include "cvar.h" +#include "net.h" // needed by: client.h +#include "protocol.h" // needed by: client.h +#include "cmd.h" +#include "sbar.h" +#include "render.h" // needed by: client.h, gl_model.h, glquake.h +#include "client.h" // need cls in this file +#include "gl_model.h" // needed by: glquake.h +#include "console.h" +#include "glquake.h" + +extern double realtime; int skytexturenum; #ifndef GL_RGBA4 diff --git a/source/gl_screen.c b/source/gl_screen.c index 5370342..0b659bf 100644 --- a/source/gl_screen.c +++ b/source/gl_screen.c @@ -26,11 +26,38 @@ $Id$ */ // screen.c -- master for refresh, status bar, console, chat, notify, etc - -#include "quakedef.h" - +#include +#include +#include +#include #include +#include "bothdefs.h" // needed by: common.h, net.h, client.h + +#include "common.h" +#include "bspfile.h" // needed by: glquake.h +#include "vid.h" +#include "sys.h" +#include "zone.h" // needed by: client.h, gl_model.h +#include "mathlib.h" // needed by: protocol.h, render.h, client.h, + // modelgen.h, glmodel.h +#include "wad.h" +#include "draw.h" +#include "cvar.h" +#include "net.h" // needed by: client.h +#include "protocol.h" // needed by: client.h +#include "keys.h" +#include "menu.h" +#include "cmd.h" +#include "sbar.h" +#include "sound.h" +#include "screen.h" +#include "render.h" // needed by: client.h, gl_model.h, glquake.h +#include "client.h" // need cls in this file +#include "gl_model.h" // needed by: glquake.h +#include "console.h" +#include "glquake.h" + /* background clear @@ -78,7 +105,9 @@ console is: */ - +extern byte *host_basepal; +extern double host_frametime; +extern double realtime; int glx, gly, glwidth, glheight; // only the refresh window will be updated unless these variables are flagged @@ -472,7 +501,7 @@ void SCR_DrawFPS (void) static double lastframetime; double t; extern int fps_count; - static lastfps; + static int lastfps; int x, y; char st[80]; @@ -760,7 +789,7 @@ int MipColor(int r, int g, int b) { int i; float dist; - int best; + int best = 0; float bestdist; int r1, g1, b1; static int lr = -1, lg = -1, lb = -1; @@ -837,12 +866,10 @@ SCR_RSShot_f */ void SCR_RSShot_f (void) { - int i, x, y; + int x, y; unsigned char *src, *dest; char pcxname[80]; - char checkname[MAX_OSPATH]; - unsigned char *newbuf, *srcbuf; - int srcrowbytes; + unsigned char *newbuf; int w, h; int dx, dy, dex, dey, nx; int r, b, g; diff --git a/source/gl_vidlinuxglx.c b/source/gl_vidlinuxglx.c index 2aa3c9f..f40b15b 100644 --- a/source/gl_vidlinuxglx.c +++ b/source/gl_vidlinuxglx.c @@ -30,11 +30,36 @@ #include #include #include +#include +#include #include #include #include +#include -#include "quakedef.h" +#include "bothdefs.h" // needed by: common.h, net.h, client.h + +#include "common.h" +#include "bspfile.h" // needed by: glquake.h +#include "vid.h" +#include "sys.h" +#include "zone.h" // needed by: client.h, gl_model.h +#include "mathlib.h" // needed by: protocol.h, render.h, client.h, + // modelgen.h, glmodel.h +#include "wad.h" +#include "draw.h" +#include "cvar.h" +#include "net.h" // needed by: client.h +#include "protocol.h" // needed by: client.h +#include "cmd.h" +#include "keys.h" +#include "sbar.h" +#include "sound.h" +#include "render.h" // needed by: client.h, gl_model.h, glquake.h +#include "client.h" // need cls in this file +#include "gl_model.h" // needed by: glquake.h +#include "console.h" +#include "glquake.h" #include @@ -49,6 +74,9 @@ #define WARP_WIDTH 320 #define WARP_HEIGHT 200 +extern byte *host_colormap; +extern qboolean noclip_anglehack; + static Display *dpy = NULL; static Window win; static GLXContext ctx = NULL; @@ -515,8 +543,6 @@ GL_BeginRendering */ void GL_BeginRendering (int *x, int *y, int *width, int *height) { - extern cvar_t gl_clear; - *x = *y = 0; *width = scr_width; *height = scr_height; diff --git a/source/gl_warp.c b/source/gl_warp.c index 53292cd..6b52365 100644 --- a/source/gl_warp.c +++ b/source/gl_warp.c @@ -26,9 +26,32 @@ $Id$ */ // gl_warp.c -- sky and water polygons +#include +#include -#include "quakedef.h" +#include "bothdefs.h" // needed by: common.h, net.h, client.h +#include "common.h" +#include "bspfile.h" // needed by: glquake.h +#include "vid.h" +#include "sys.h" +#include "zone.h" // needed by: client.h, gl_model.h +#include "mathlib.h" // needed by: protocol.h, render.h, client.h, + // modelgen.h, glmodel.h +#include "wad.h" +#include "draw.h" +#include "cvar.h" +#include "net.h" // needed by: client.h +#include "protocol.h" // needed by: client.h +#include "cmd.h" +#include "sbar.h" +#include "render.h" // needed by: client.h, gl_model.h, glquake.h +#include "client.h" // need cls in this file +#include "gl_model.h" // needed by: glquake.h +#include "console.h" +#include "glquake.h" + +extern double realtime; extern model_t *loadmodel; int skytexturenum; @@ -1042,7 +1065,6 @@ void R_InitSky (texture_t *mt) unsigned transpix; int r, g, b; unsigned *rgba; - extern int skytexturenum; src = (byte *)mt + mt->offsets[0];