Making things even more generic, and a fix for compiling without GL support.

This commit is contained in:
Zephaniah E. Hull 2000-01-23 04:42:43 +00:00
parent 620ccc3e84
commit eae2220a78
8 changed files with 19 additions and 27 deletions

View file

@ -8,6 +8,9 @@
/* Define this to the subdirectory name of the default game */ /* Define this to the subdirectory name of the default game */
#undef GAMENAME #undef GAMENAME
/* Define this if you have OGL */
#undef HAS_OGL
/* Define if you have the XFree86 DGA extension */ /* Define if you have the XFree86 DGA extension */
#undef HAS_DGA #undef HAS_DGA

View file

@ -69,11 +69,7 @@ void VID_UnlockBuffer (void);
#include "keys.h" #include "keys.h"
#include "console.h" #include "console.h"
#include "view.h" #include "view.h"
#ifndef QUAKEWORLD
#include "menu.h" #include "menu.h"
#elif !defined(SERVERONLY)
#include "menu.h"
#endif
#include "crc.h" #include "crc.h"
#include "cdaudio.h" #include "cdaudio.h"

View file

@ -123,10 +123,10 @@ void VID_SetPalette (unsigned char *palette)
int k; int k;
unsigned short i; unsigned short i;
unsigned *table; unsigned *table;
#ifdef QUAKEWORLD //#ifdef QUAKEWORLD
FILE *f; FILE *f;
char s[255]; char s[255];
#endif //#endif
float dist, bestdist; float dist, bestdist;
// //
// 8 8 8 encoding // 8 8 8 encoding
@ -150,7 +150,7 @@ void VID_SetPalette (unsigned char *palette)
d_8to24table[255] &= 0xffffff; // 255 is transparent d_8to24table[255] &= 0xffffff; // 255 is transparent
// JACK: 3D distance calcs - k is last closest, l is the distance. // JACK: 3D distance calcs - k is last closest, l is the distance.
#ifdef QUAKEWORLD //#ifdef QUAKEWORLD
{ {
static qboolean palflag = false; static qboolean palflag = false;
@ -165,7 +165,7 @@ void VID_SetPalette (unsigned char *palette)
fread(d_15to8table, 1<<15, 1, f); fread(d_15to8table, 1<<15, 1, f);
fclose(f); fclose(f);
} else } else
#endif // QUAKEWORLD //#endif // QUAKEWORLD
{ {
for (i=0; i < (1<<15); i++) { for (i=0; i < (1<<15); i++) {
/* Maps /* Maps
@ -190,7 +190,7 @@ void VID_SetPalette (unsigned char *palette)
} }
d_15to8table[i]=k; d_15to8table[i]=k;
} }
#ifdef QUAKEWORLD //#ifdef QUAKEWORLD
snprintf(s, sizeof(s), "%s/glquake", com_gamedir); snprintf(s, sizeof(s), "%s/glquake", com_gamedir);
Sys_mkdir (s); Sys_mkdir (s);
snprintf(s, sizeof(s), "%s/glquake/15to8.pal", com_gamedir); snprintf(s, sizeof(s), "%s/glquake/15to8.pal", com_gamedir);
@ -198,7 +198,7 @@ void VID_SetPalette (unsigned char *palette)
fwrite(d_15to8table, 1<<15, 1, f); fwrite(d_15to8table, 1<<15, 1, f);
fclose(f); fclose(f);
} }
#endif // QUAKEWORLD //#endif // QUAKEWORLD
} }
} }

View file

@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef _GLQUAKE_H #ifndef _GLQUAKE_H
#define _GLQUAKE_H #define _GLQUAKE_H
#ifdef HAS_OGL
#if !defined(__GNUC__) && !defined(__unix) && !defined(__unix__) #if !defined(__GNUC__) && !defined(__unix) && !defined(__unix__)
#pragma warning(disable : 4244) // MIPS #pragma warning(disable : 4244) // MIPS
#pragma warning(disable : 4136) // X86 #pragma warning(disable : 4136) // X86
@ -162,9 +164,7 @@ extern qboolean envmap;
extern int currenttexture; extern int currenttexture;
extern int cnttextures[2]; extern int cnttextures[2];
extern int particletexture; extern int particletexture;
#ifdef QUAKEWORLD
extern int netgraphtexture; // netgraph texture extern int netgraphtexture; // netgraph texture
#endif
extern int playertextures; extern int playertextures;
extern int skytexturenum; // index in cl.loadmodel, not gl texture object extern int skytexturenum; // index in cl.loadmodel, not gl texture object
@ -181,9 +181,7 @@ extern cvar_t r_shadows;
extern cvar_t r_wateralpha; extern cvar_t r_wateralpha;
extern cvar_t r_dynamic; extern cvar_t r_dynamic;
extern cvar_t r_novis; extern cvar_t r_novis;
#ifdef QUAKEWORLD
extern cvar_t r_netgraph; extern cvar_t r_netgraph;
#endif
extern cvar_t r_fog; extern cvar_t r_fog;
extern cvar_t r_waterwarp; extern cvar_t r_waterwarp;
extern cvar_t r_volfog; extern cvar_t r_volfog;
@ -199,9 +197,7 @@ extern cvar_t gl_polyblend;
extern cvar_t gl_keeptjunctions; extern cvar_t gl_keeptjunctions;
extern cvar_t gl_flashblend; extern cvar_t gl_flashblend;
extern cvar_t gl_nocolors; extern cvar_t gl_nocolors;
#ifdef QUAKEWORLD
extern cvar_t gl_finish; extern cvar_t gl_finish;
#endif
extern cvar_t gl_doubleeyes; extern cvar_t gl_doubleeyes;
extern int gl_lightmap_format; extern int gl_lightmap_format;
@ -281,11 +277,10 @@ void R_DrawBrushModel (entity_t *e);
void R_DrawWorld (void); void R_DrawWorld (void);
void GL_BuildLightmaps (void); void GL_BuildLightmaps (void);
#ifdef QUAKEWORLD
// //
// gl_ngraph.c // gl_ngraph.c
// //
void R_NetGraph (void); void R_NetGraph (void);
#endif
#endif // HAS_OGL
#endif // _GLQUAKE_H #endif // _GLQUAKE_H

View file

@ -155,11 +155,9 @@ extern int key_repeats[256];
extern int key_count; // incremented every key event extern int key_count; // incremented every key event
extern int key_lastpress; extern int key_lastpress;
#ifdef QUAKEWORLD
extern char chat_buffer[]; extern char chat_buffer[];
extern int chat_bufferlen; extern int chat_bufferlen;
extern qboolean chat_team; extern qboolean chat_team;
#endif // QUAKEWORLD
void Key_Event (int key, qboolean down); void Key_Event (int key, qboolean down);
void Key_Init (void); void Key_Init (void);

View file

@ -125,13 +125,10 @@ extern qboolean pr_trace;
extern dfunction_t *pr_xfunction; extern dfunction_t *pr_xfunction;
extern int pr_xstatement; extern int pr_xstatement;
#ifdef QUAKEWORLD
extern func_t SpectatorConnect; extern func_t SpectatorConnect;
extern func_t SpectatorThink; extern func_t SpectatorThink;
extern func_t SpectatorDisconnect; extern func_t SpectatorDisconnect;
#else
extern unsigned short pr_crc; extern unsigned short pr_crc;
#endif
void PR_RunError (char *error, ...); void PR_RunError (char *error, ...);

View file

@ -46,7 +46,7 @@ typedef struct efrag_s
typedef struct entity_s typedef struct entity_s
{ {
#ifndef QUAKEWORLD //#ifndef QUAKEWORLD
qboolean forcelink; // model changed qboolean forcelink; // model changed
int update_type; int update_type;
@ -57,7 +57,7 @@ typedef struct entity_s
vec3_t msg_origins[2]; // last two updates (0 is newest) vec3_t msg_origins[2]; // last two updates (0 is newest)
vec3_t msg_angles[2]; // last two updates (0 is newest) vec3_t msg_angles[2]; // last two updates (0 is newest)
int effects; // light, particals, etc int effects; // light, particals, etc
#endif //#endif
vec3_t origin; vec3_t origin;
vec3_t angles; vec3_t angles;
struct model_s *model; // NULL = no model struct model_s *model; // NULL = no model
@ -66,10 +66,10 @@ typedef struct entity_s
float syncbase; // for client-side animations float syncbase; // for client-side animations
byte *colormap; byte *colormap;
int skinnum; // for Alias models int skinnum; // for Alias models
#ifdef QUAKEWORLD //#ifdef QUAKEWORLD
int keynum; int keynum;
struct player_info_s *scoreboard; // identify player struct player_info_s *scoreboard; // identify player
#endif //#endif
int visframe; // last frame this entity was int visframe; // last frame this entity was
// found in an active leaf // found in an active leaf

View file

@ -289,6 +289,9 @@ if test "x$HAS_OGL" != xno; then
fi fi
CPPFLAGS="$save_CPPFLAGS" CPPFLAGS="$save_CPPFLAGS"
fi fi
if test "x$HAS_OGL" = xyes; then
AC_DEFINE(HAS_OGL)
fi
dnl Make sure DGA works dnl Make sure DGA works
if test "x$HAS_DGA" = xyes; then if test "x$HAS_DGA" = xyes; then