From 49ae964011daecbd0bf49205e6de421600571025 Mon Sep 17 00:00:00 2001 From: Jeff Teunissen Date: Fri, 28 Dec 2001 19:56:33 +0000 Subject: [PATCH] Update to 3.21-level source code. --- 3.18_changes.txt => 3.18_Changes.txt | 0 3.19_Changes.txt | 60 + 3.20_Changes.txt | 69 ++ 3.21_Changes.txt | 80 ++ client/cl_ents.c | 57 +- client/cl_input.c | 6 + client/cl_parse.c | 7 +- client/cl_tent.c | 6 +- client/keys.c | 3 +- client/menu.c | 13 +- client/ref.h | 4 + client/snd_mix.c | 6 +- client/vid.h | 3 +- ctf/g_ctf.c | 279 ++++- ctf/g_ctf.h | 11 +- ctf/g_local.h | 10 +- ctf/g_main.c | 2 + ctf/g_save.c | 1 + ctf/g_spawn.c | 13 +- ctf/g_svcmds.c | 252 ++++ ctf/g_weapon.c | 4 +- ctf/p_client.c | 37 +- ctf/p_view.c | 18 +- ctf/p_weapon.c | 6 +- ctf/q_shared.c | 2 +- game/g_cmds.c | 2 +- game/g_local.h | 1 + game/g_main.c | 31 + game/g_misc.c | 2 + game/g_save.c | 1 + game/g_weapon.c | 4 +- game/game.001 | 1619 -------------------------- game/game.h | 19 - game/game.plg | 75 -- game/p_client.c | 24 +- game/p_weapon.c | 2 +- irix/cd_irix.c | 19 + irix/glw_imp.c | 19 + irix/makefile.txt | 1054 +++++++++++++++++ irix/q_shirix.c | 19 + irix/qgl_irix.c | 19 + irix/snd_irix.c | 19 + irix/sys_irix.c | 19 + irix/vid_menu.c | 20 + irix/vid_so.c | 22 +- linux/.gitignore | 3 + linux/Makefile | 495 +++++++- linux/cd_linux.c | 19 + linux/d_ifacea.h | 19 + linux/gl_fxmesa.c | 60 +- linux/gl_glx.c | 1236 +++++++++----------- linux/glob.c | 19 + linux/glob.h | 19 + linux/glw_linux.h | 36 + linux/in_linux.c | 19 + linux/net_udp.c | 33 +- linux/q_shlinux.c | 26 +- linux/qasm.h | 19 + linux/qgl_linux.c | 906 ++++++++------ linux/readme | 219 ++++ linux/readme-3.21-release | 23 + linux/readme.axp | 53 + linux/rw_in_svgalib.c | 19 + linux/rw_linux.h | 19 + linux/rw_svgalib.c | 19 + linux/rw_x11.c | 752 +++++++----- linux/snd_linux.c | 19 + linux/sys_linux.c | 25 +- linux/vid_menu.c | 93 +- linux/vid_so.c | 52 +- makezip | 3 +- null/cd_null.c | 19 + null/cl_null.c | 19 + null/glimp_null.c | 19 + null/in_null.c | 19 + null/snddma_null.c | 19 + null/swimp_null.c | 19 + null/sys_null.c | 19 + null/vid_null.c | 22 +- readme.txt | 2 +- ref_gl/gl_image.c | 47 +- ref_gl/gl_local.h | 12 +- ref_gl/gl_mesh.c | 22 + ref_gl/gl_rmain.c | 64 +- ref_gl/gl_rsurf.c | 42 +- ref_gl/qgl.h | 44 + ref_gl/ref_gl.001 | 752 ------------ ref_gl/ref_gl.plg | 17 - ref_soft/r_alias.c | 9 +- ref_soft/r_poly.c | 35 +- ref_soft/ref_soft.001 | 1498 ------------------------ ref_soft/ref_soft.plg | 17 - server/sv_game.c | 1 + server/sv_main.c | 15 +- server/sv_null.c | 19 + solaris/g_so.c | 19 + solaris/glob.c | 19 + solaris/glob.h | 19 + solaris/makefile.solaris | 1031 ++++++++++++++++ solaris/net_udp.c | 19 + solaris/q_shsolaris.c | 19 + solaris/readme.solaris | 53 + solaris/sys_solaris.c | 19 + win32/net_wins.c | 26 +- win32/qgl_win.c | 2 + win32/sys_win.c | 2 + win32/vid_dll.c | 3 +- win32/vid_menu.c | 1 + 108 files changed, 6493 insertions(+), 5634 deletions(-) rename 3.18_changes.txt => 3.18_Changes.txt (100%) create mode 100644 3.19_Changes.txt create mode 100644 3.20_Changes.txt create mode 100644 3.21_Changes.txt delete mode 100644 game/game.001 delete mode 100644 game/game.plg create mode 100644 irix/makefile.txt create mode 100644 linux/glw_linux.h create mode 100644 linux/readme create mode 100644 linux/readme-3.21-release create mode 100644 linux/readme.axp delete mode 100644 ref_gl/ref_gl.001 delete mode 100644 ref_gl/ref_gl.plg delete mode 100644 ref_soft/ref_soft.001 delete mode 100644 ref_soft/ref_soft.plg create mode 100644 solaris/makefile.solaris create mode 100644 solaris/readme.solaris diff --git a/3.18_changes.txt b/3.18_Changes.txt similarity index 100% rename from 3.18_changes.txt rename to 3.18_Changes.txt diff --git a/3.19_Changes.txt b/3.19_Changes.txt new file mode 100644 index 0000000..52f2466 --- /dev/null +++ b/3.19_Changes.txt @@ -0,0 +1,60 @@ +Changes since v3.17 +------------------- + +- Updated VWEP models +- Fixed sound config strings getting out of sync on loadgame. This caused + the wrong sound to be played. +- Fixed a bug in ref_soft that caused the menu system's bottom of screen + help text not to be displayed +- Added a missing Rogue DM option +- "Water surfing" that was present in 3.17 has been fixed (holding jump while + on the surface of water let you swim at full speed). +- Environment maps (env) are now autodownloaded (if allow_download_maps is set). +- Spectator support added. A new cvar is built into the client, "spectator" + Setting it to value other than "0" will allow you join a game as a spectator. + While in spectator mode, you can press the attack button to enter a chasecam + mode and follow other players. Using the inventory keys (by default the + left and right square brackets) you can switch between players in the game + while using the chasecam. + You may enter and leave spectator mode while connected. Doing so resets + your score to zero. + ***The new spectator support requires a new game.dll and may not work for + user mods until they update their code. The default game.dll that comes + with 3.19 supports chasecam as well as the new included Xatrix game.dll. +- Fixed it so that when a model defaults to male/grunt (don't have the + necessary model or skin for the player), VWep support is still enabled. +- New console command for players, "playerlist". This will cause the server + to give you a text list of the players on the server, including their + connect time, score, ping and spectator status. This is handy if not + everyone fits on the scoreboard on busy servers. +- New cvar for the game.dll: spectator_password. If set to a value (other + than "none"), users must set their spectator variable to this value in order + to join the server as a spectator. This password is independant of the + normal user password. +- New cvar for the game.dll: maxspectators (defaults to 4). This value is + not seperate from maxclients (a spectator is still a client). +- New cvar for the game.dll: sv_maplist. This can be set to a list of map + names that the server should autorotate through, rather than using the + nextmap set in the actual map files themselves. + For example: set sv_maplist "base1 q2dm1 q2dm3 fact3" will cause the server + to rotate through those maps. + ***This requires a game.dll update and will not work with user mods until + they update their code. +- A new facility has been added to ClientConnect() in the game.dll to allow + the game.dll to pass a message back to the user for the reason of disallowing + a connection. It is done by setting a key of "rejmsg" in the passed userinfo. + For example: + Info_SetValueforKey(userinfo, "rejmsg", "Password required or incorrect."); +- The server cvar, password, may be set to "none" to clear the password. This + is needed because rcon can not set a blank password. +- New server cvar: sv_airaccelerate. This controls the optional air + acceleration facility. The default value is 0, which disables air control. + The usual value to replicate the air control seen in the original Quake and + later versions of Quakeworld is 10. 10 allows for much more + air control (as was seen in 3.15). This value is ignored in single player + and coop. +- Fixed NoSuchFrame/BAD_MODELTYPE errors when doing a vid_restart while + connected. +- NoSuchFrame errors now include model name to assist in debugging user mods. +- Fixed the remote status query response (ServerInfo) to not include error + messages and be more consistent. diff --git a/3.20_Changes.txt b/3.20_Changes.txt new file mode 100644 index 0000000..7169050 --- /dev/null +++ b/3.20_Changes.txt @@ -0,0 +1,69 @@ +3.20 Changes: +- Fixed a network problem where and oversize packet could cause a client + crash. +- Fixed the long standing Quake2 bug of where you would occasionally spawn + or teleport and find yourself either looking straight at the ceiling or + down at the floor. +- Changed it so that the function keys (F1 through F12) now get executed when + depressed during demo playback or attract modes. This allows you to take + screen shots (F12) during demos and other features. An example of other + features is a fast forward for demos: + alias +ff "timedemo 1" + alias -ff "timedemo 0" + bind f7 +ff + This binding will cause the current demo playing to zip into timedemo mode + while F7 is depressed, effectively acting like a fast forward key. +- Wrong packaging of 3.19 patch. The Rogue CD has a 45k pak2 and vwep .md2 + files in baseq2/players, but the 3.19 x86 patch we released has a 2.7MB + pak2. 3.20 has a 45k pak2 and the vwep models go in baseq2/players. +- VWep code has been added to Xatrix dll, new VWep models for the Xatrix + specific weapons (Ion Ripper and Phalanx) have been included. +- Rogue Linux game library was wrong version and had some unlinked symbols, + this has been corrected. +- Occasional error of: "D_SCAlloc: bad cache width 16384" in software renderer. + This had to do with surfaces to SURF_FLOWING and were transparent. This + has been fixed in the refs now so flowing transparent textures now works. +- [Unix] Net_ErrorToString calls were wrong, was using %i and not %s resulting + in random numbers being printed for error messages. +- Color shell mixing restored to the same blends as previous versions. This + was changed in 3.19 for the new color shells the Rogue mission pack + introduced. +- Fixed a possible server crash in the new "playerlist" command. +- Fixed a case where a person joining a server could be invisible (left over + setting of SVF_NOCLIENT from previous spectator). +- Invalid pak files no longer cause a crash and are just ignored +- Fixed a 3.19 bug where linked models (modelindex2) who's modelindex was + greater than 0x7f causes the wrong model to be drawn (in some cases, the + world would be drawn twice). This was the cause of many of the "extreme" + frame lag people were seeing in 3.19 on servers using old-style VWep code. +- Linux: Complete rewrite of the OpenGL library handling. This was needed + to cleanly integrate OpenGL extension checking. Linux now supports + extensions such as multitexture and better dynamic loading of libraries. + It's cleaner now in that you don't have to preload hack stuff to use the + 3DFX Miniport rather than libMesa3D. The Linux version now uses the + gl_driver to specify the 3D library to dynamically load. For example, to + use the lib3dfxgl.so miniport, one would now use: + ./quake2 +set vid_ref gl +set gl_driver lib3dfxgl.so + This change fixes several bugs that were apparant in the older method, such + as a segfault occasionally when connecting to a server with a different game + directory. + The vid menu in the Linux version has been changed to reflect the new + options, the current list of supported video drivers are now: software, + software X11, Mesa 3-D 3DFX, 3DFXGL Miniport, OpenGL glX, and Mesa 3-D glX, +- Railgun shots now go through gibs as well as other players. +- New server variable, "needpass" that can been seen with server browser + tools such as GameSpy. This variable indicates whether a password or + spectator password is needed to get onto a server. Bit 0 is password and + bit 1 is spectator password. +- Quake2 will no longer look for gamex86.dll in the main Quake2 directory. + It will always load out of the game directory first. +- Players joining a server during an intermission are now moved to the + intermission position. +- The "logfile" cvar has been extended with the following values: + 0 - don't log (default) + 1 - overwrite qconsole.log and use buffered writes + 2 - overwrite qconsole.log and flush write every line + 3 - append to existing qconsole.log and flush write every line +- Several minor bug fixes to the Rogue mission pack gamex86.dll +- Linux: Rebuild of Rogue mission pack shared library to correct some + dynamic symbol errors (is NAN errors). diff --git a/3.21_Changes.txt b/3.21_Changes.txt new file mode 100644 index 0000000..30e06ba --- /dev/null +++ b/3.21_Changes.txt @@ -0,0 +1,80 @@ +12-22-2001, for source release under GPL licensing: +- Tweaked linux/Makefile for easier build + added linux/README-3.21-RELEASE + +3.21 Changes: +- Support for GL_ARB_multitexture added. This supports the new multitexture + extensions and deprecates GL_SGIS_multitexture. +- Linux OpenGL X11 handling completely rewritten. Support for XF86DGA Mouse + and fullscreen resolution support added. Please see the README file for + Linux about the new features of this handling. + +3.20 Changes: +- Fixed a network problem where and oversize packet could cause a client + crash. +- Fixed the long standing Quake2 bug of where you would occasionally spawn + or teleport and find yourself either looking straight at the ceiling or + down at the floor. +- Changed it so that the function keys (F1 through F12) now get executed when + depressed during demo playback or attract modes. This allows you to take + screen shots (F12) during demos and other features. An example of other + features is a fast forward for demos: + alias +ff "timedemo 1" + alias -ff "timedemo 0" + bind f7 +ff + This binding will cause the current demo playing to zip into timedemo mode + while F7 is depressed, effectively acting like a fast forward key. +- Wrong packaging of 3.19 patch. The Rogue CD has a 45k pak2 and vwep .md2 + files in baseq2/players, but the 3.19 x86 patch we released has a 2.7MB + pak2. 3.20 has a 45k pak2 and the vwep models go in baseq2/players. +- VWep code has been added to Xatrix dll, new VWep models for the Xatrix + specific weapons (Ion Ripper and Phalanx) have been included. +- Rogue Linux game library was wrong version and had some unlinked symbols, + this has been corrected. +- Occasional error of: "D_SCAlloc: bad cache width 16384" in software renderer. + This had to do with surfaces to SURF_FLOWING and were transparent. This + has been fixed in the refs now so flowing transparent textures now works. +- [Unix] Net_ErrorToString calls were wrong, was using %i and not %s resulting + in random numbers being printed for error messages. +- Color shell mixing restored to the same blends as previous versions. This + was changed in 3.19 for the new color shells the Rogue mission pack + introduced. +- Fixed a possible server crash in the new "playerlist" command. +- Fixed a case where a person joining a server could be invisible (left over + setting of SVF_NOCLIENT from previous spectator). +- Invalid pak files no longer cause a crash and are just ignored +- Fixed a 3.19 bug where linked models (modelindex2) who's modelindex was + greater than 0x7f causes the wrong model to be drawn (in some cases, the + world would be drawn twice). This was the cause of many of the "extreme" + frame lag people were seeing in 3.19 on servers using old-style VWep code. +- Linux: Complete rewrite of the OpenGL library handling. This was needed + to cleanly integrate OpenGL extension checking. Linux now supports + extensions such as multitexture and better dynamic loading of libraries. + It's cleaner now in that you don't have to preload hack stuff to use the + 3DFX Miniport rather than libMesa3D. The Linux version now uses the + gl_driver to specify the 3D library to dynamically load. For example, to + use the lib3dfxgl.so miniport, one would now use: + ./quake2 +set vid_ref gl +set gl_driver lib3dfxgl.so + This change fixes several bugs that were apparant in the older method, such + as a segfault occasionally when connecting to a server with a different game + directory. + The vid menu in the Linux version has been changed to reflect the new + options, the current list of supported video drivers are now: software, + software X11, Mesa 3-D 3DFX, 3DFXGL Miniport, OpenGL glX, and Mesa 3-D glX, +- Railgun shots now go through gibs as well as other players. +- New server variable, "needpass" that can been seen with server browser + tools such as GameSpy. This variable indicates whether a password or + spectator password is needed to get onto a server. Bit 0 is password and + bit 1 is spectator password. +- Quake2 will no longer look for gamex86.dll in the main Quake2 directory. + It will always load out of the game directory first. +- Players joining a server during an intermission are now moved to the + intermission position. +- The "logfile" cvar has been extended with the following values: + 0 - don't log (default) + 1 - overwrite qconsole.log and use buffered writes + 2 - overwrite qconsole.log and flush write every line + 3 - append to existing qconsole.log and flush write every line +- Several minor bug fixes to the Rogue mission pack gamex86.dll +- Linux: Rebuild of Rogue mission pack shared library to correct some + dynamic symbol errors (is NAN errors). diff --git a/client/cl_ents.c b/client/cl_ents.c index 5f2f16b..41e2795 100644 --- a/client/cl_ents.c +++ b/client/cl_ents.c @@ -825,6 +825,9 @@ struct model_s *S_RegisterSexedModel (entity_state_t *ent, char *base) return mdl; } +// PMM - used in shell code +extern int Developer_searchpath (int who); +// pmm /* =============== CL_AddPacketEntities @@ -1068,9 +1071,48 @@ void CL_AddPacketEntities (frame_t *frame) // add to refresh list V_AddEntity (&ent); + // color shells generate a seperate entity for the main model if (effects & EF_COLOR_SHELL) { + // PMM - at this point, all of the shells have been handled + // if we're in the rogue pack, set up the custom mixing, otherwise just + // keep going +// if(Developer_searchpath(2) == 2) +// { + // all of the solo colors are fine. we need to catch any of the combinations that look bad + // (double & half) and turn them into the appropriate color, and make double/quad something special + if (renderfx & RF_SHELL_HALF_DAM) + { + if(Developer_searchpath(2) == 2) + { + // ditch the half damage shell if any of red, blue, or double are on + if (renderfx & (RF_SHELL_RED|RF_SHELL_BLUE|RF_SHELL_DOUBLE)) + renderfx &= ~RF_SHELL_HALF_DAM; + } + } + + if (renderfx & RF_SHELL_DOUBLE) + { + if(Developer_searchpath(2) == 2) + { + // lose the yellow shell if we have a red, blue, or green shell + if (renderfx & (RF_SHELL_RED|RF_SHELL_BLUE|RF_SHELL_GREEN)) + renderfx &= ~RF_SHELL_DOUBLE; + // if we have a red shell, turn it to purple by adding blue + if (renderfx & RF_SHELL_RED) + renderfx |= RF_SHELL_BLUE; + // if we have a blue shell (and not a red shell), turn it to cyan by adding green + else if (renderfx & RF_SHELL_BLUE) + // go to green if it's on already, otherwise do cyan (flash green) + if (renderfx & RF_SHELL_GREEN) + renderfx &= ~RF_SHELL_BLUE; + else + renderfx |= RF_SHELL_GREEN; + } + } +// } + // pmm ent.flags = renderfx | RF_TRANSLUCENT; ent.alpha = 0.30; V_AddEntity (&ent); @@ -1098,17 +1140,18 @@ void CL_AddPacketEntities (frame_t *frame) ent.model = cl.baseclientinfo.weaponmodel[0]; } } - //PGM - hack to allow translucent linked models (defender sphere's shell) - // set the high bit 0x80 on modelindex2 to enable translucency - else if(s1->modelindex2 & 0x80) + else + ent.model = cl.model_draw[s1->modelindex2]; + + // PMM - check for the defender sphere shell .. make it translucent + // replaces the previous version which used the high bit on modelindex2 to determine transparency + if (!Q_strcasecmp (cl.configstrings[CS_MODELS+(s1->modelindex2)], "models/items/shell/tris.md2")) { - ent.model = cl.model_draw[s1->modelindex2 & 0x7F]; ent.alpha = 0.32; ent.flags = RF_TRANSLUCENT; } - //PGM - else - ent.model = cl.model_draw[s1->modelindex2]; + // pmm + V_AddEntity (&ent); //PGM - make sure these get reset. diff --git a/client/cl_input.c b/client/cl_input.c index 800d5a1..344e1ae 100644 --- a/client/cl_input.c +++ b/client/cl_input.c @@ -316,6 +316,12 @@ void CL_ClampPitch (void) pitch = SHORT2ANGLE(cl.frame.playerstate.pmove.delta_angles[PITCH]); if (pitch > 180) pitch -= 360; + + if (cl.viewangles[PITCH] + pitch < -360) + cl.viewangles[PITCH] += 360; // wrapped + if (cl.viewangles[PITCH] + pitch > 360) + cl.viewangles[PITCH] -= 360; // wrapped + if (cl.viewangles[PITCH] + pitch > 89) cl.viewangles[PITCH] = 89 - pitch; if (cl.viewangles[PITCH] + pitch < -89) diff --git a/client/cl_parse.c b/client/cl_parse.c index 5468c2e..a79b217 100644 --- a/client/cl_parse.c +++ b/client/cl_parse.c @@ -520,11 +520,16 @@ void CL_ParseConfigString (void) { int i; char *s; + char olds[MAX_QPATH]; i = MSG_ReadShort (&net_message); if (i < 0 || i >= MAX_CONFIGSTRINGS) Com_Error (ERR_DROP, "configstring > MAX_CONFIGSTRINGS"); s = MSG_ReadString(&net_message); + + strncpy (olds, cl.configstrings[i], sizeof(olds)); + olds[sizeof(olds) - 1] = 0; + strcpy (cl.configstrings[i], s); // do something apropriate @@ -559,7 +564,7 @@ void CL_ParseConfigString (void) } else if (i >= CS_PLAYERSKINS && i < CS_PLAYERSKINS+MAX_CLIENTS) { - if (cl.refresh_prepped) + if (cl.refresh_prepped && strcmp(olds, s)) CL_ParseClientinfo (i-CS_PLAYERSKINS); } } diff --git a/client/cl_tent.c b/client/cl_tent.c index c039b49..24e1ea4 100644 --- a/client/cl_tent.c +++ b/client/cl_tent.c @@ -158,9 +158,9 @@ void CL_RegisterTEntSounds (void) cl_sfx_lightning = S_RegisterSound ("weapons/tesla.wav"); cl_sfx_disrexp = S_RegisterSound ("weapons/disrupthit.wav"); // version stuff - sprintf (name, "weapons/sound%d.wav", ROGUE_VERSION_ID); - if (name[0] == 'w') - name[0] = 'W'; +// sprintf (name, "weapons/sound%d.wav", ROGUE_VERSION_ID); +// if (name[0] == 'w') +// name[0] = 'W'; //PGM } diff --git a/client/keys.c b/client/keys.c index 6f6728a..c062fd5 100644 --- a/client/keys.c +++ b/client/keys.c @@ -784,7 +784,8 @@ void Key_Event (int key, qboolean down, unsigned time) } // any key during the attract mode will bring up the menu - if (cl.attractloop && cls.key_dest != key_menu) + if (cl.attractloop && cls.key_dest != key_menu && + !(key >= K_F1 && key <= K_F12)) key = K_ESCAPE; // menu key is hardcoded, so the user can never unbind it diff --git a/client/menu.c b/client/menu.c index 1835a86..169eec4 100644 --- a/client/menu.c +++ b/client/menu.c @@ -1115,24 +1115,17 @@ static void ControlsResetDefaultsFunc( void *unused ) static void InvertMouseFunc( void *unused ) { - if ( s_options_invertmouse_box.curvalue == 0 ) - { - Cvar_SetValue( "m_pitch", fabs( m_pitch->value ) ); - } - else - { - Cvar_SetValue( "m_pitch", -fabs( m_pitch->value ) ); - } + Cvar_SetValue( "m_pitch", -m_pitch->value ); } static void LookspringFunc( void *unused ) { - Cvar_SetValue( "lookspring", s_options_lookspring_box.curvalue ); + Cvar_SetValue( "lookspring", !lookspring->value ); } static void LookstrafeFunc( void *unused ) { - Cvar_SetValue( "lookstrafe", s_options_lookstrafe_box.curvalue ); + Cvar_SetValue( "lookstrafe", !lookstrafe->value ); } static void UpdateVolumeFunc( void *unused ) diff --git a/client/ref.h b/client/ref.h index 18ad121..1cc7c8a 100644 --- a/client/ref.h +++ b/client/ref.h @@ -17,6 +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. */ +#ifndef __REF_H +#define __REF_H #include "../qcommon/qcommon.h" @@ -222,3 +224,5 @@ typedef struct // this is the only function actually exported at the linker level typedef refexport_t (*GetRefAPI_t) (refimport_t); + +#endif // __REF_H diff --git a/client/snd_mix.c b/client/snd_mix.c index 00f201d..db6f7d2 100644 --- a/client/snd_mix.c +++ b/client/snd_mix.c @@ -378,8 +378,10 @@ void S_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count, int offset) if (ch->rightvol > 255) ch->rightvol = 255; - lscale = snd_scaletable[ ch->leftvol >> 11]; - rscale = snd_scaletable[ ch->rightvol >> 11]; + //ZOID-- >>11 has been changed to >>3, >>11 didn't make much sense + //as it would always be zero. + lscale = snd_scaletable[ ch->leftvol >> 3]; + rscale = snd_scaletable[ ch->rightvol >> 3]; sfx = (signed char *)sc->data + ch->pos; samp = &paintbuffer[offset]; diff --git a/client/vid.h b/client/vid.h index f38140f..fb465a2 100644 --- a/client/vid.h +++ b/client/vid.h @@ -26,8 +26,7 @@ typedef struct vrect_s typedef struct { - int width; - int height; + unsigned int width, height; // coordinates from main game } viddef_t; extern viddef_t viddef; // global video state diff --git a/ctf/g_ctf.c b/ctf/g_ctf.c index 1fcf0d5..e4e54fa 100644 --- a/ctf/g_ctf.c +++ b/ctf/g_ctf.c @@ -45,6 +45,7 @@ typedef struct ctfgame_s match_t match; // match state float matchtime; // time for match start/end (depends on state) int lasttime; // last time update + qboolean countdown; // has audio countdown started? elect_t election; // election type edict_t *etarget; // for admin election, who's being elected @@ -53,6 +54,7 @@ typedef struct ctfgame_s int needvotes; // votes needed float electtime; // remaining time until election times out char emsg[256]; // election name + int warnactive; // true if stat string 30 is active ghost_t ghosts[MAX_CLIENTS]; // ghost codes @@ -70,7 +72,25 @@ cvar_t *matchtime; cvar_t *matchsetuptime; cvar_t *matchstarttime; cvar_t *admin_password; +cvar_t *allow_admin; cvar_t *warp_list; +cvar_t *warn_unbalanced; + +// Index for various CTF pics, this saves us from calling gi.imageindex +// all the time and saves a few CPU cycles since we don't have to do +// a bunch of string compares all the time. +// These are set in CTFPrecache() called from worldspawn +int imageindex_i_ctf1; +int imageindex_i_ctf2; +int imageindex_i_ctf1d; +int imageindex_i_ctf2d; +int imageindex_i_ctf1t; +int imageindex_i_ctf2t; +int imageindex_i_ctfj; +int imageindex_sbfctf1; +int imageindex_sbfctf2; +int imageindex_ctfsb1; +int imageindex_ctfsb2; char *ctf_statusbar = "yb -24 " @@ -179,18 +199,28 @@ char *ctf_statusbar = // id view state "if 27 " - "xv 0 " + "xv 112 " "yb -58 " - "string \"Viewing\" " - "xv 64 " "stat_string 27 " "endif " +"if 29 " + "xv 96 " + "yb -58 " + "pic 29 " +"endif " + "if 28 " "xl 0 " "yb -78 " "stat_string 28 " "endif " + +"if 30 " + "xl 0 " + "yb -88 " + "stat_string 30 " +"endif " ; static char *tnames[] = { @@ -319,7 +349,28 @@ void CTFInit(void) matchsetuptime = gi.cvar("matchsetuptime", "10", 0); matchstarttime = gi.cvar("matchstarttime", "20", 0); admin_password = gi.cvar("admin_password", "", 0); + allow_admin = gi.cvar("allow_admin", "1", 0); warp_list = gi.cvar("warp_list", "q2ctf1 q2ctf2 q2ctf3 q2ctf4 q2ctf5", 0); + warn_unbalanced = gi.cvar("warn_unbalanced", "1", 0); +} + +/* + * Precache CTF items + */ + +void CTFPrecache(void) +{ + imageindex_i_ctf1 = gi.imageindex("i_ctf1"); + imageindex_i_ctf2 = gi.imageindex("i_ctf2"); + imageindex_i_ctf1d = gi.imageindex("i_ctf1d"); + imageindex_i_ctf2d = gi.imageindex("i_ctf2d"); + imageindex_i_ctf1t = gi.imageindex("i_ctf1t"); + imageindex_i_ctf2t = gi.imageindex("i_ctf2t"); + imageindex_i_ctfj = gi.imageindex("i_ctfj"); + imageindex_sbfctf1 = gi.imageindex("sbfctf1"); + imageindex_sbfctf2 = gi.imageindex("sbfctf2"); + imageindex_ctfsb1 = gi.imageindex("ctfsb1"); + imageindex_ctfsb2 = gi.imageindex("ctfsb2"); } /*--------------------------------------------------------------------------*/ @@ -332,7 +383,7 @@ char *CTFTeamName(int team) case CTF_TEAM2: return "BLUE"; } - return "UKNOWN"; + return "UNKNOWN"; // Hanzo pointed out this was spelled wrong as "UKNOWN" } char *CTFOtherTeamName(int team) @@ -343,7 +394,7 @@ char *CTFOtherTeamName(int team) case CTF_TEAM2: return "RED"; } - return "UKNOWN"; + return "UNKNOWN"; // Hanzo pointed out this was spelled wrong as "UKNOWN" } int CTFOtherTeam(int team) @@ -371,7 +422,7 @@ void CTFAssignSkin(edict_t *ent, char *s) Com_sprintf(t, sizeof(t), "%s", s); - if ((p = strrchr(t, '/')) != NULL) + if ((p = strchr(t, '/')) != NULL) p[1] = 0; else strcpy(t, "male/"); @@ -982,7 +1033,13 @@ static void CTFSetIDView(edict_t *ent) float bd = 0, d; int i; + // only check every few frames + if (level.time - ent->client->resp.lastidtime < 0.25) + return; + ent->client->resp.lastidtime = level.time; + ent->client->ps.stats[STAT_CTF_ID_VIEW] = 0; + ent->client->ps.stats[STAT_CTF_ID_VIEW_COLOR] = 0; AngleVectors(ent->client->v_angle, forward, NULL, NULL); VectorScale(forward, 1024, forward); @@ -990,7 +1047,11 @@ static void CTFSetIDView(edict_t *ent) tr = gi.trace(ent->s.origin, NULL, NULL, forward, ent, MASK_SOLID); if (tr.fraction < 1 && tr.ent && tr.ent->client) { ent->client->ps.stats[STAT_CTF_ID_VIEW] = - CS_PLAYERSKINS + (ent - g_edicts - 1); + CS_GENERAL + (tr.ent - g_edicts - 1); + if (tr.ent->client->resp.ctf_team == CTF_TEAM1) + ent->client->ps.stats[STAT_CTF_ID_VIEW_COLOR] = imageindex_sbfctf1; + else if (tr.ent->client->resp.ctf_team == CTF_TEAM2) + ent->client->ps.stats[STAT_CTF_ID_VIEW_COLOR] = imageindex_sbfctf2; return; } @@ -1008,9 +1069,14 @@ static void CTFSetIDView(edict_t *ent) best = who; } } - if (bd > 0.90) + if (bd > 0.90) { ent->client->ps.stats[STAT_CTF_ID_VIEW] = - CS_PLAYERSKINS + (best - g_edicts - 1); + CS_GENERAL + (best - g_edicts - 1); + if (best->client->resp.ctf_team == CTF_TEAM1) + ent->client->ps.stats[STAT_CTF_ID_VIEW_COLOR] = imageindex_sbfctf1; + else if (best->client->resp.ctf_team == CTF_TEAM2) + ent->client->ps.stats[STAT_CTF_ID_VIEW_COLOR] = imageindex_sbfctf2; + } } void SetCTFStats(edict_t *ent) @@ -1025,6 +1091,11 @@ void SetCTFStats(edict_t *ent) else ent->client->ps.stats[STAT_CTF_MATCH] = 0; + if (ctfgame.warnactive) + ent->client->ps.stats[STAT_CTF_TEAMINFO] = CONFIG_CTF_TEAMINFO; + else + ent->client->ps.stats[STAT_CTF_TEAMINFO] = 0; + //ghosting if (ent->client->resp.ghost) { ent->client->resp.ghost->score = ent->client->resp.score; @@ -1033,8 +1104,8 @@ void SetCTFStats(edict_t *ent) } // logo headers for the frag display - ent->client->ps.stats[STAT_CTF_TEAM1_HEADER] = gi.imageindex ("ctfsb1"); - ent->client->ps.stats[STAT_CTF_TEAM2_HEADER] = gi.imageindex ("ctfsb2"); + ent->client->ps.stats[STAT_CTF_TEAM1_HEADER] = imageindex_ctfsb1; + ent->client->ps.stats[STAT_CTF_TEAM2_HEADER] = imageindex_ctfsb2; // if during intermission, we must blink the team header of the winning team if (level.intermissiontime && (level.framenum & 8)) { // blink 1/8th second @@ -1070,7 +1141,7 @@ void SetCTFStats(edict_t *ent) // flag at base // flag taken // flag dropped - p1 = gi.imageindex ("i_ctf1"); + p1 = imageindex_i_ctf1; e = G_Find(NULL, FOFS(classname), "item_flag_team1"); if (e != NULL) { if (e->solid == SOLID_NOT) { @@ -1078,18 +1149,18 @@ void SetCTFStats(edict_t *ent) // not at base // check if on player - p1 = gi.imageindex ("i_ctf1d"); // default to dropped + p1 = imageindex_i_ctf1d; // default to dropped for (i = 1; i <= maxclients->value; i++) if (g_edicts[i].inuse && g_edicts[i].client->pers.inventory[ITEM_INDEX(flag1_item)]) { // enemy has it - p1 = gi.imageindex ("i_ctf1t"); + p1 = imageindex_i_ctf1t; break; } } else if (e->spawnflags & DROPPED_ITEM) - p1 = gi.imageindex ("i_ctf1d"); // must be dropped + p1 = imageindex_i_ctf1d; // must be dropped } - p2 = gi.imageindex ("i_ctf2"); + p2 = imageindex_i_ctf2; e = G_Find(NULL, FOFS(classname), "item_flag_team2"); if (e != NULL) { if (e->solid == SOLID_NOT) { @@ -1097,16 +1168,16 @@ void SetCTFStats(edict_t *ent) // not at base // check if on player - p2 = gi.imageindex ("i_ctf2d"); // default to dropped + p2 = imageindex_i_ctf2d; // default to dropped for (i = 1; i <= maxclients->value; i++) if (g_edicts[i].inuse && g_edicts[i].client->pers.inventory[ITEM_INDEX(flag2_item)]) { // enemy has it - p2 = gi.imageindex ("i_ctf2t"); + p2 = imageindex_i_ctf2t; break; } } else if (e->spawnflags & DROPPED_ITEM) - p2 = gi.imageindex ("i_ctf2d"); // must be dropped + p2 = imageindex_i_ctf2d; // must be dropped } @@ -1133,23 +1204,26 @@ void SetCTFStats(edict_t *ent) if (ent->client->resp.ctf_team == CTF_TEAM1 && ent->client->pers.inventory[ITEM_INDEX(flag2_item)] && (level.framenum & 8)) - ent->client->ps.stats[STAT_CTF_FLAG_PIC] = gi.imageindex ("i_ctf2"); + ent->client->ps.stats[STAT_CTF_FLAG_PIC] = imageindex_i_ctf2; else if (ent->client->resp.ctf_team == CTF_TEAM2 && ent->client->pers.inventory[ITEM_INDEX(flag1_item)] && (level.framenum & 8)) - ent->client->ps.stats[STAT_CTF_FLAG_PIC] = gi.imageindex ("i_ctf1"); + ent->client->ps.stats[STAT_CTF_FLAG_PIC] = imageindex_i_ctf1; ent->client->ps.stats[STAT_CTF_JOINED_TEAM1_PIC] = 0; ent->client->ps.stats[STAT_CTF_JOINED_TEAM2_PIC] = 0; if (ent->client->resp.ctf_team == CTF_TEAM1) - ent->client->ps.stats[STAT_CTF_JOINED_TEAM1_PIC] = gi.imageindex ("i_ctfj"); + ent->client->ps.stats[STAT_CTF_JOINED_TEAM1_PIC] = imageindex_i_ctfj; else if (ent->client->resp.ctf_team == CTF_TEAM2) - ent->client->ps.stats[STAT_CTF_JOINED_TEAM2_PIC] = gi.imageindex ("i_ctfj"); + ent->client->ps.stats[STAT_CTF_JOINED_TEAM2_PIC] = imageindex_i_ctfj; - ent->client->ps.stats[STAT_CTF_ID_VIEW] = 0; if (ent->client->resp.id_state) CTFSetIDView(ent); + else { + ent->client->ps.stats[STAT_CTF_ID_VIEW] = 0; + ent->client->ps.stats[STAT_CTF_ID_VIEW_COLOR] = 0; + } } /*------------------------------------------------------------------------*/ @@ -2385,8 +2459,8 @@ static void CTFSay_Team_Sight(edict_t *who, char *buf) void CTFSay_Team(edict_t *who, char *msg) { - char outmsg[1024]; - char buf[1024]; + char outmsg[256]; + char buf[256]; int i; char *p; edict_t *cl_ent; @@ -2401,45 +2475,57 @@ void CTFSay_Team(edict_t *who, char *msg) msg++; } - for (p = outmsg; *msg && (p - outmsg) < sizeof(outmsg) - 1; msg++) { + for (p = outmsg; *msg && (p - outmsg) < sizeof(outmsg) - 2; msg++) { if (*msg == '%') { switch (*++msg) { case 'l' : case 'L' : CTFSay_Team_Location(who, buf); - strcpy(p, buf); - p += strlen(buf); + if (strlen(buf) + (p - outmsg) < sizeof(outmsg) - 2) { + strcpy(p, buf); + p += strlen(buf); + } break; case 'a' : case 'A' : CTFSay_Team_Armor(who, buf); - strcpy(p, buf); - p += strlen(buf); + if (strlen(buf) + (p - outmsg) < sizeof(outmsg) - 2) { + strcpy(p, buf); + p += strlen(buf); + } break; case 'h' : case 'H' : CTFSay_Team_Health(who, buf); - strcpy(p, buf); - p += strlen(buf); + if (strlen(buf) + (p - outmsg) < sizeof(outmsg) - 2) { + strcpy(p, buf); + p += strlen(buf); + } break; case 't' : case 'T' : CTFSay_Team_Tech(who, buf); - strcpy(p, buf); - p += strlen(buf); + if (strlen(buf) + (p - outmsg) < sizeof(outmsg) - 2) { + strcpy(p, buf); + p += strlen(buf); + } break; case 'w' : case 'W' : CTFSay_Team_Weapon(who, buf); - strcpy(p, buf); - p += strlen(buf); + if (strlen(buf) + (p - outmsg) < sizeof(outmsg) - 2) { + strcpy(p, buf); + p += strlen(buf); + } break; case 'n' : case 'N' : CTFSay_Team_Sight(who, buf); - strcpy(p, buf); - p += strlen(buf); + if (strlen(buf) + (p - outmsg) < sizeof(outmsg) - 2) { + strcpy(p, buf); + p += strlen(buf); + } break; default : @@ -2653,6 +2739,7 @@ void CTFStartMatch(void) ctfgame.match = MATCH_GAME; ctfgame.matchtime = level.time + matchtime->value * 60; + ctfgame.countdown = false; ctfgame.team1 = ctfgame.team2 = 0; @@ -2847,6 +2934,8 @@ void CTFReady(edict_t *ent) gi.bprintf(PRINT_CHAT, "All players have commited. Match starting\n"); ctfgame.match = MATCH_PREGAME; ctfgame.matchtime = level.time + matchstarttime->value; + ctfgame.countdown = false; + gi.positioned_sound (world->s.origin, world, CHAN_AUTO | CHAN_RELIABLE, gi.soundindex("misc/talk1.wav"), 1, ATTN_NONE, 0); } } @@ -3054,6 +3143,7 @@ void CTFChaseCam(edict_t *ent, pmenuhnd_t *p) if (ent->client->chase_target) { ent->client->chase_target = NULL; + ent->client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION; PMenu_Close(ent); return; } @@ -3238,22 +3328,25 @@ qboolean CTFStartClient(edict_t *ent) void CTFObserver(edict_t *ent) { + char userinfo[MAX_INFO_STRING]; + // start as 'observer' - if (ent->movetype == MOVETYPE_NOCLIP) { - gi.cprintf(ent, PRINT_HIGH, "You are already an observer.\n"); - return; - } + if (ent->movetype == MOVETYPE_NOCLIP) CTFPlayerResetGrapple(ent); CTFDeadDropFlag(ent); CTFDeadDropTech(ent); + ent->deadflag = DEAD_NO; ent->movetype = MOVETYPE_NOCLIP; ent->solid = SOLID_NOT; ent->svflags |= SVF_NOCLIENT; ent->client->resp.ctf_team = CTF_NOTEAM; ent->client->ps.gunindex = 0; ent->client->resp.score = 0; + memcpy (userinfo, ent->client->pers.userinfo, sizeof(userinfo)); + InitClientPersistant(ent->client); + ClientUserinfoChanged (ent, userinfo); gi.linkentity (ent); CTFOpenJoinMenu(ent); } @@ -3280,6 +3373,9 @@ qboolean CTFCheckRules(void) if (ctfgame.match != MATCH_NONE) { t = ctfgame.matchtime - level.time; + // no team warnings in match mode + ctfgame.warnactive = 0; + if (t <= 0) { // time ended on something switch (ctfgame.match) { case MATCH_SETUP : @@ -3297,11 +3393,13 @@ qboolean CTFCheckRules(void) case MATCH_PREGAME : // match started! CTFStartMatch(); + gi.positioned_sound (world->s.origin, world, CHAN_AUTO | CHAN_RELIABLE, gi.soundindex("misc/tele_up.wav"), 1, ATTN_NONE, 0); return false; case MATCH_GAME : // match ended! CTFEndMatch(); + gi.positioned_sound (world->s.origin, world, CHAN_AUTO | CHAN_RELIABLE, gi.soundindex("misc/bigtele.wav"), 1, ATTN_NONE, 0); return false; } } @@ -3336,17 +3434,64 @@ qboolean CTFCheckRules(void) sprintf(text, "%02d:%02d UNTIL START", t / 60, t % 60); gi.configstring (CONFIG_CTF_MATCH, text); + + if (t <= 10 && !ctfgame.countdown) { + ctfgame.countdown = true; + gi.positioned_sound (world->s.origin, world, CHAN_AUTO | CHAN_RELIABLE, gi.soundindex("world/10_0.wav"), 1, ATTN_NONE, 0); + } break; case MATCH_GAME: sprintf(text, "%02d:%02d MATCH", t / 60, t % 60); gi.configstring (CONFIG_CTF_MATCH, text); + if (t <= 10 && !ctfgame.countdown) { + ctfgame.countdown = true; + gi.positioned_sound (world->s.origin, world, CHAN_AUTO | CHAN_RELIABLE, gi.soundindex("world/10_0.wav"), 1, ATTN_NONE, 0); + } break; } return false; + + } else { + int team1 = 0, team2 = 0; + + if (level.time == ctfgame.lasttime) + return false; + ctfgame.lasttime = level.time; + // this is only done in non-match (public) mode + + if (warn_unbalanced->value) { + // count up the team totals + for (i = 1; i <= maxclients->value; i++) { + ent = g_edicts + i; + if (!ent->inuse) + continue; + if (ent->client->resp.ctf_team == CTF_TEAM1) + team1++; + else if (ent->client->resp.ctf_team == CTF_TEAM2) + team2++; + } + + if (team1 - team2 >= 2 && team2 >= 2) { + if (ctfgame.warnactive != CTF_TEAM1) { + ctfgame.warnactive = CTF_TEAM1; + gi.configstring (CONFIG_CTF_TEAMINFO, "WARNING: Red has too many players"); + } + } else if (team2 - team1 >= 2 && team1 >= 2) { + if (ctfgame.warnactive != CTF_TEAM2) { + ctfgame.warnactive = CTF_TEAM2; + gi.configstring (CONFIG_CTF_TEAMINFO, "WARNING: Blue has too many players"); + } + } else + ctfgame.warnactive = 0; + } else + ctfgame.warnactive = 0; + } + + if (capturelimit->value && (ctfgame.team1 >= capturelimit->value || ctfgame.team2 >= capturelimit->value)) { @@ -3736,6 +3881,8 @@ void CTFAdmin_MatchSet(edict_t *ent, pmenuhnd_t *p) gi.bprintf(PRINT_CHAT, "Match has been forced to start.\n"); ctfgame.match = MATCH_PREGAME; ctfgame.matchtime = level.time + matchstarttime->value; + gi.positioned_sound (world->s.origin, world, CHAN_AUTO | CHAN_RELIABLE, gi.soundindex("misc/talk1.wav"), 1, ATTN_NONE, 0); + ctfgame.countdown = false; } else if (ctfgame.match == MATCH_GAME) { gi.bprintf(PRINT_CHAT, "Match has been forced to terminate.\n"); ctfgame.match = MATCH_SETUP; @@ -3756,6 +3903,17 @@ void CTFAdmin_MatchMode(edict_t *ent, pmenuhnd_t *p) } } +void CTFAdmin_Reset(edict_t *ent, pmenuhnd_t *p) +{ + PMenu_Close(ent); + + // go back to normal mode + gi.bprintf(PRINT_CHAT, "Match mode has been terminated, reseting to normal game.\n"); + ctfgame.match = MATCH_NONE; + gi.cvar_set("competition", "1"); + CTFResetAllPlayers(); +} + void CTFAdmin_Cancel(edict_t *ent, pmenuhnd_t *p) { PMenu_Close(ent); @@ -3776,10 +3934,14 @@ void CTFOpenAdminMenu(edict_t *ent) { adminmenu[3].text = NULL; adminmenu[3].SelectFunc = NULL; + adminmenu[4].text = NULL; + adminmenu[4].SelectFunc = NULL; if (ctfgame.match == MATCH_SETUP) { adminmenu[3].text = "Force start match"; adminmenu[3].SelectFunc = CTFAdmin_MatchSet; - } else if (ctfgame.match == MATCH_GAME) { + adminmenu[4].text = "Reset to pickup mode"; + adminmenu[4].SelectFunc = CTFAdmin_Reset; + } else if (ctfgame.match == MATCH_GAME || ctfgame.match == MATCH_PREGAME) { adminmenu[3].text = "Cancel match"; adminmenu[3].SelectFunc = CTFAdmin_MatchSet; } else if (ctfgame.match == MATCH_NONE && competition->value) { @@ -3787,6 +3949,7 @@ void CTFOpenAdminMenu(edict_t *ent) adminmenu[3].SelectFunc = CTFAdmin_MatchMode; } + // if (ent->client->menu) // PMenu_Close(ent->client->menu); @@ -3797,6 +3960,11 @@ void CTFAdmin(edict_t *ent) { char text[1024]; + if (!allow_admin->value) { + gi.cprintf(ent, PRINT_HIGH, "Administration is disabled\n"); + return; + } + if (gi.argc() > 1 && admin_password->string && *admin_password->string && !ent->client->resp.admin && strcmp(admin_password->string, gi.argv(1)) == 0) { ent->client->resp.admin = true; @@ -3824,7 +3992,7 @@ void CTFStats(edict_t *ent) int i, e; ghost_t *g; char st[80]; - char text[1400]; + char text[1024]; edict_t *e2; *text = 0; @@ -3888,6 +4056,7 @@ void CTFPlayerList(edict_t *ent) char text[1400]; edict_t *e2; +#if 0 *text = 0; if (ctfgame.match == MATCH_SETUP) { for (i = 1; i <= maxclients->value; i++) { @@ -3901,16 +4070,18 @@ void CTFPlayerList(edict_t *ent) } } } +#endif // number, name, connect time, ping, score, admin *text = 0; - for (i = 0, e2 = g_edicts + 1; i < maxclients->value; i++, e2++) { + for (i = 1; i <= maxclients->value; i++) { + e2 = g_edicts + i; if (!e2->inuse) continue; - sprintf(st, "%3d %-16.16s %02d:%02d %4d %3d%s%s\n", - i + 1, + Com_sprintf(st, sizeof(st), "%3d %-16.16s %02d:%02d %4d %3d%s%s\n", + i, e2->client->pers.netname, (level.framenum - e2->client->resp.enterframe) / 600, ((level.framenum - e2->client->resp.enterframe) % 600)/10, @@ -3919,6 +4090,7 @@ void CTFPlayerList(edict_t *ent) (ctfgame.match == MATCH_SETUP || ctfgame.match == MATCH_PREGAME) ? (e2->client->resp.ready ? " (ready)" : " (notready)") : "", e2->client->resp.admin ? " (admin)" : ""); + if (strlen(text) + strlen(st) > sizeof(text) - 50) { sprintf(text+strlen(text), "And more...\n"); gi.cprintf(ent, PRINT_HIGH, "%s", text); @@ -4013,4 +4185,13 @@ void CTFBoot(edict_t *ent) } - +void CTFSetPowerUpEffect(edict_t *ent, int def) +{ + if (ent->client->resp.ctf_team == CTF_TEAM1) + ent->s.effects |= EF_PENT; // red + else if (ent->client->resp.ctf_team == CTF_TEAM2) + ent->s.effects |= EF_QUAD; // red + else + ent->s.effects |= def; +} + diff --git a/ctf/g_ctf.h b/ctf/g_ctf.h index 5ab400d..8de4513 100644 --- a/ctf/g_ctf.h +++ b/ctf/g_ctf.h @@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define CTF_VERSION 1.09b +#define CTF_VERSION 1.52 #define CTF_VSTRING2(x) #x #define CTF_VSTRING(x) CTF_VSTRING2(x) #define CTF_STRING_VERSION CTF_VSTRING(CTF_VERSION) @@ -35,8 +35,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define STAT_CTF_TECH 26 #define STAT_CTF_ID_VIEW 27 #define STAT_CTF_MATCH 28 +#define STAT_CTF_ID_VIEW_COLOR 29 +#define STAT_CTF_TEAMINFO 30 -#define CONFIG_CTF_MATCH (CS_MAXCLIENTS-1) +#define CONFIG_CTF_MATCH (CS_AIRACCEL-1) +#define CONFIG_CTF_TEAMINFO (CS_AIRACCEL-2) typedef enum { CTF_NOTEAM, @@ -105,6 +108,7 @@ extern cvar_t *ctf; void CTFInit(void); void CTFSpawn(void); +void CTFPrecache(void); void SP_info_player_team1(edict_t *self); void SP_info_player_team2(edict_t *self); @@ -183,3 +187,6 @@ void CTFObserver(edict_t *ent); void SP_trigger_teleport (edict_t *ent); void SP_info_teleport_destination (edict_t *ent); + +void CTFSetPowerUpEffect(edict_t *ent, int def); + diff --git a/ctf/g_local.h b/ctf/g_local.h index 8e88222..ae85a0a 100644 --- a/ctf/g_local.h +++ b/ctf/g_local.h @@ -537,6 +537,8 @@ extern cvar_t *password; extern cvar_t *g_select_empty; extern cvar_t *dedicated; +extern cvar_t *filterban; + extern cvar_t *sv_gravity; extern cvar_t *sv_maxvelocity; @@ -767,6 +769,7 @@ void InitClientPersistant (gclient_t *client); void InitClientResp (gclient_t *client); void InitBodyQue (void); void ClientBeginServerFrame (edict_t *ent); +void ClientUserinfoChanged (edict_t *ent, char *userinfo); // // g_player.c @@ -819,6 +822,10 @@ void SaveClientData (void); void FetchClientEntData (edict_t *ent); void EndDMLevel (void); +// +// g_svcmds.c +// +qboolean SV_FilterPacket (char *from); //============================================================================ @@ -845,7 +852,7 @@ typedef struct // values saved and restored from edicts when changing levels int health; int max_health; - qboolean powerArmorActive; + int savedFlags; int selected_item; int inventory[MAX_ITEMS]; @@ -879,6 +886,7 @@ typedef struct float ctf_flagsince; float ctf_lastfraggedcarrier; qboolean id_state; + float lastidtime; qboolean voted; // for elections qboolean ready; qboolean admin; diff --git a/ctf/g_main.c b/ctf/g_main.c index db734c0..47f37fd 100644 --- a/ctf/g_main.c +++ b/ctf/g_main.c @@ -48,6 +48,8 @@ cvar_t *maxentities; cvar_t *g_select_empty; cvar_t *dedicated; +cvar_t *filterban; + cvar_t *sv_maxvelocity; cvar_t *sv_gravity; diff --git a/ctf/g_save.c b/ctf/g_save.c index e63a9f9..406677d 100644 --- a/ctf/g_save.c +++ b/ctf/g_save.c @@ -193,6 +193,7 @@ void InitGame (void) instantweap = gi.cvar ("instantweap", "0", CVAR_SERVERINFO); //ZOID password = gi.cvar ("password", "", CVAR_USERINFO); + filterban = gi.cvar ("filterban", "1", 0); g_select_empty = gi.cvar ("g_select_empty", "0", CVAR_ARCHIVE); diff --git a/ctf/g_spawn.c b/ctf/g_spawn.c index 7ebad56..f58e38a 100644 --- a/ctf/g_spawn.c +++ b/ctf/g_spawn.c @@ -838,17 +838,10 @@ void SP_worldspawn (edict_t *ent) //ZOID if (ctf->value) { gi.configstring (CS_STATUSBAR, ctf_statusbar); - //precaches - gi.imageindex("i_ctf1"); - gi.imageindex("i_ctf2"); - gi.imageindex("i_ctf1d"); - gi.imageindex("i_ctf2d"); - gi.imageindex("i_ctf1t"); - gi.imageindex("i_ctf2t"); - gi.imageindex("i_ctfj"); + CTFPrecache(); } else //ZOID - gi.configstring (CS_STATUSBAR, dm_statusbar); + gi.configstring (CS_STATUSBAR, dm_statusbar); else gi.configstring (CS_STATUSBAR, single_statusbar); @@ -900,7 +893,6 @@ void SP_worldspawn (edict_t *ent) gi.soundindex ("*pain100_1.wav"); gi.soundindex ("*pain100_2.wav"); -#if 0 //DISABLED // sexed models // THIS ORDER MUST MATCH THE DEFINES IN g_local.h // you can add more, max 15 @@ -916,7 +908,6 @@ void SP_worldspawn (edict_t *ent) gi.modelindex ("#w_railgun.md2"); gi.modelindex ("#w_bfg.md2"); gi.modelindex ("#w_grapple.md2"); -#endif //------------------- diff --git a/ctf/g_svcmds.c b/ctf/g_svcmds.c index 36ac9ce..6868633 100644 --- a/ctf/g_svcmds.c +++ b/ctf/g_svcmds.c @@ -26,6 +26,250 @@ void Svcmd_Test_f (void) gi.cprintf (NULL, PRINT_HIGH, "Svcmd_Test_f()\n"); } +/* +============================================================================== + +PACKET FILTERING + + +You can add or remove addresses from the filter list with: + +addip +removeip + +The ip address is specified in dot format, and any unspecified digits will match any value, so you can specify an entire class C network with "addip 192.246.40". + +Removeip will only remove an address specified exactly the same way. You cannot addip a subnet, then removeip a single host. + +listip +Prints the current list of filters. + +writeip +Dumps "addip " commands to listip.cfg so it can be execed at a later date. The filter lists are not saved and restored by default, because I beleive it would cause too much confusion. + +filterban <0 or 1> + +If 1 (the default), then ip addresses matching the current list will be prohibited from entering the game. This is the default setting. + +If 0, then only addresses matching the list will be allowed. This lets you easily set up a private game, or a game that only allows players from your local network. + + +============================================================================== +*/ + +typedef struct +{ + unsigned mask; + unsigned compare; +} ipfilter_t; + +#define MAX_IPFILTERS 1024 + +ipfilter_t ipfilters[MAX_IPFILTERS]; +int numipfilters; + +/* +================= +StringToFilter +================= +*/ +static qboolean StringToFilter (char *s, ipfilter_t *f) +{ + char num[128]; + int i, j; + byte b[4]; + byte m[4]; + + for (i=0 ; i<4 ; i++) + { + b[i] = 0; + m[i] = 0; + } + + for (i=0 ; i<4 ; i++) + { + if (*s < '0' || *s > '9') + { + gi.cprintf(NULL, PRINT_HIGH, "Bad filter address: %s\n", s); + return false; + } + + j = 0; + while (*s >= '0' && *s <= '9') + { + num[j++] = *s++; + } + num[j] = 0; + b[i] = atoi(num); + if (b[i] != 0) + m[i] = 255; + + if (!*s) + break; + s++; + } + + f->mask = *(unsigned *)m; + f->compare = *(unsigned *)b; + + return true; +} + +/* +================= +SV_FilterPacket +================= +*/ +qboolean SV_FilterPacket (char *from) +{ + int i; + unsigned in; + byte m[4]; + char *p; + + i = 0; + p = from; + while (*p && i < 4) { + m[i] = 0; + while (*p >= '0' && *p <= '9') { + m[i] = m[i]*10 + (*p - '0'); + p++; + } + if (!*p || *p == ':') + break; + i++, p++; + } + + in = *(unsigned *)m; + + for (i=0 ; ivalue; + + return (int)!filterban->value; +} + + +/* +================= +SV_AddIP_f +================= +*/ +void SVCmd_AddIP_f (void) +{ + int i; + + if (gi.argc() < 3) { + gi.cprintf(NULL, PRINT_HIGH, "Usage: addip \n"); + return; + } + + for (i=0 ; i\n"); + return; + } + + if (!StringToFilter (gi.argv(2), &f)) + return; + + for (i=0 ; istring) + sprintf (name, "%s/listip.cfg", GAMEVERSION); + else + sprintf (name, "%s/listip.cfg", game->string); + + gi.cprintf (NULL, PRINT_HIGH, "Writing %s.\n", name); + + f = fopen (name, "wb"); + if (!f) + { + gi.cprintf (NULL, PRINT_HIGH, "Couldn't open %s\n", name); + return; + } + + fprintf(f, "set filterban %d\n", (int)filterban->value); + + for (i=0 ; isvflags & SVF_MONSTER) || (tr.ent->client)) + //ZOID--added so rail goes through SOLID_BBOX entities (gibs, etc) + if ((tr.ent->svflags & SVF_MONSTER) || (tr.ent->client) || + (tr.ent->solid == SOLID_BBOX)) ignore = tr.ent; else ignore = NULL; diff --git a/ctf/p_client.c b/ctf/p_client.c index f77cf10..366b72f 100644 --- a/ctf/p_client.c +++ b/ctf/p_client.c @@ -20,8 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "g_local.h" #include "m_player.h" -void ClientUserinfoChanged (edict_t *ent, char *userinfo); - void SP_misc_teleporter_dest (edict_t *ent); // @@ -543,6 +541,7 @@ void player_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag self->client->invincible_framenum = 0; self->client->breather_framenum = 0; self->client->enviro_framenum = 0; + self->flags &= ~FL_POWER_ARMOR; // clear inventory memset(self->client->pers.inventory, 0, sizeof(self->client->pers.inventory)); @@ -686,7 +685,7 @@ void SaveClientData (void) continue; game.clients[i].pers.health = ent->health; game.clients[i].pers.max_health = ent->max_health; - game.clients[i].pers.powerArmorActive = (ent->flags & FL_POWER_ARMOR); + game.clients[i].pers.savedFlags = (ent->flags & (FL_GODMODE|FL_NOTARGET|FL_POWER_ARMOR)); if (coop->value) game.clients[i].pers.score = ent->client->resp.score; } @@ -696,8 +695,7 @@ void FetchClientEntData (edict_t *ent) { ent->health = ent->client->pers.health; ent->max_health = ent->client->pers.max_health; - if (ent->client->pers.powerArmorActive) - ent->flags |= FL_POWER_ARMOR; + ent->flags |= ent->client->pers.savedFlags; if (coop->value) ent->client->resp.score = ent->client->pers.score; } @@ -1217,11 +1215,18 @@ void ClientBeginDeathmatch (edict_t *ent) // locate ent at a spawn point PutClientInServer (ent); - // send effect - gi.WriteByte (svc_muzzleflash); - gi.WriteShort (ent-g_edicts); - gi.WriteByte (MZ_LOGIN); - gi.multicast (ent->s.origin, MULTICAST_PVS); + if (level.intermissiontime) + { + MoveClientToIntermission (ent); + } + else + { + // send effect + gi.WriteByte (svc_muzzleflash); + gi.WriteShort (ent-g_edicts); + gi.WriteByte (MZ_LOGIN); + gi.multicast (ent->s.origin, MULTICAST_PVS); + } gi.bprintf (PRINT_HIGH, "%s entered the game\n", ent->client->pers.netname); @@ -1332,6 +1337,11 @@ void ClientUserinfoChanged (edict_t *ent, char *userinfo) //ZOID gi.configstring (CS_PLAYERSKINS+playernum, va("%s\\%s", ent->client->pers.netname, s) ); +//ZOID + // set player name field (used in id_state view) + gi.configstring (CS_GENERAL+playernum, ent->client->pers.netname); +//ZOID + // fov if (deathmatch->value && ((int)dmflags->value & DF_FIXED_FOV)) { @@ -1376,6 +1386,11 @@ qboolean ClientConnect (edict_t *ent, char *userinfo) // check to see if they are on the banned IP list value = Info_ValueForKey (userinfo, "ip"); + if (SV_FilterPacket(value)) { + Info_SetValueForKey(userinfo, "rejmsg", "Banned."); + return false; + } + // check for a password value = Info_ValueForKey (userinfo, "password"); @@ -1395,7 +1410,7 @@ qboolean ClientConnect (edict_t *ent, char *userinfo) // clear the respawning variables //ZOID -- force team join ent->client->resp.ctf_team = -1; - ent->client->resp.id_state = false; + ent->client->resp.id_state = true; //ZOID InitClientResp (ent->client); if (!game.autosaved || !ent->client->pers.weapon) diff --git a/ctf/p_view.c b/ctf/p_view.c index ea66431..e7412e7 100644 --- a/ctf/p_view.c +++ b/ctf/p_view.c @@ -779,26 +779,20 @@ void G_SetClientEffects (edict_t *ent) CTFEffects(ent); //ZOID - if (ent->client->quad_framenum > level.framenum -//ZOID - && (level.framenum & 8) -//ZOID - ) + if (ent->client->quad_framenum > level.framenum) { remaining = ent->client->quad_framenum - level.framenum; if (remaining > 30 || (remaining & 4) ) - ent->s.effects |= EF_QUAD; +// ent->s.effects |= EF_QUAD; + CTFSetPowerUpEffect(ent, EF_QUAD); } - if (ent->client->invincible_framenum > level.framenum -//ZOID - && (level.framenum & 8) -//ZOID - ) + if (ent->client->invincible_framenum > level.framenum) { remaining = ent->client->invincible_framenum - level.framenum; if (remaining > 30 || (remaining & 4) ) - ent->s.effects |= EF_PENT; +// ent->s.effects |= EF_PENT; + CTFSetPowerUpEffect(ent, EF_PENT); } // show cheaters!!! diff --git a/ctf/p_weapon.c b/ctf/p_weapon.c index 907bd19..149f496 100644 --- a/ctf/p_weapon.c +++ b/ctf/p_weapon.c @@ -419,10 +419,6 @@ static void Weapon_Generic2 (edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FI { ent->client->weaponstate = WEAPON_READY; ent->client->ps.gunframe = FRAME_IDLE_FIRST; - // we go recursive here to instant ready the weapon - Weapon_Generic2 (ent, FRAME_ACTIVATE_LAST, FRAME_FIRE_LAST, - FRAME_IDLE_LAST, FRAME_DEACTIVATE_LAST, pause_frames, - fire_frames, fire); return; } @@ -1421,7 +1417,7 @@ void weapon_bfg_fire (edict_t *ent) ent->client->ps.gunframe++; - PlayerNoise(ent, ent->s.origin, PNOISE_WEAPON); + PlayerNoise(ent, start, PNOISE_WEAPON); return; } diff --git a/ctf/q_shared.c b/ctf/q_shared.c index 2458af1..e8520b4 100644 --- a/ctf/q_shared.c +++ b/ctf/q_shared.c @@ -345,7 +345,7 @@ BoxOnPlaneSide Returns 1, 2, or 1 + 2 ================== */ -#if !id386 +#if !id386 || defined __linux__ int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p) { float dist1, dist2; diff --git a/game/g_cmds.c b/game/g_cmds.c index 412c2a6..f71fa89 100644 --- a/game/g_cmds.c +++ b/game/g_cmds.c @@ -882,7 +882,7 @@ void Cmd_PlayerList_f(edict_t *ent) if (!e2->inuse) continue; - sprintf(st, "%02d:%02d %4d %3d %s%s\n", + Com_sprintf(st, sizeof(st), "%02d:%02d %4d %3d %s%s\n", (level.framenum - e2->client->resp.enterframe) / 600, ((level.framenum - e2->client->resp.enterframe) % 600)/10, e2->client->ping, diff --git a/game/g_local.h b/game/g_local.h index 78605e5..c5e9cc6 100644 --- a/game/g_local.h +++ b/game/g_local.h @@ -522,6 +522,7 @@ extern cvar_t *fraglimit; extern cvar_t *timelimit; extern cvar_t *password; extern cvar_t *spectator_password; +extern cvar_t *needpass; extern cvar_t *g_select_empty; extern cvar_t *dedicated; diff --git a/game/g_main.c b/game/g_main.c index d6c3c88..b6985e7 100644 --- a/game/g_main.c +++ b/game/g_main.c @@ -40,6 +40,7 @@ cvar_t *fraglimit; cvar_t *timelimit; cvar_t *password; cvar_t *spectator_password; +cvar_t *needpass; cvar_t *maxclients; cvar_t *maxspectators; cvar_t *maxentities; @@ -268,6 +269,33 @@ void EndDMLevel (void) } } + +/* +================= +CheckNeedPass +================= +*/ +void CheckNeedPass (void) +{ + int need; + + // if password or spectator_password has changed, update needpass + // as needed + if (password->modified || spectator_password->modified) + { + password->modified = spectator_password->modified = false; + + need = 0; + + if (*password->string && Q_stricmp(password->string, "none")) + need |= 1; + if (*spectator_password->string && Q_stricmp(spectator_password->string, "none")) + need |= 2; + + gi.cvar_set("needpass", va("%d", need)); + } +} + /* ================= CheckDMRules @@ -405,6 +433,9 @@ void G_RunFrame (void) // see if it is time to end a deathmatch CheckDMRules (); + // see if needpass needs updated + CheckNeedPass (); + // build the playerstate_t structures for all players ClientEndServerFrames (); } diff --git a/game/g_misc.c b/game/g_misc.c index 46abe08..d4b2db5 100644 --- a/game/g_misc.c +++ b/game/g_misc.c @@ -1812,7 +1812,9 @@ void teleporter_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_ // set angles for (i=0 ; i<3 ; i++) + { other->client->ps.pmove.delta_angles[i] = ANGLE2SHORT(dest->s.angles[i] - other->client->resp.cmd_angles[i]); + } VectorClear (other->s.angles); VectorClear (other->client->ps.viewangles); diff --git a/game/g_save.c b/game/g_save.c index 1153f51..957862d 100644 --- a/game/g_save.c +++ b/game/g_save.c @@ -184,6 +184,7 @@ void InitGame (void) timelimit = gi.cvar ("timelimit", "0", CVAR_SERVERINFO); password = gi.cvar ("password", "", CVAR_USERINFO); spectator_password = gi.cvar ("spectator_password", "", CVAR_USERINFO); + needpass = gi.cvar ("needpass", "0", CVAR_SERVERINFO); filterban = gi.cvar ("filterban", "1", 0); g_select_empty = gi.cvar ("g_select_empty", "0", CVAR_ARCHIVE); diff --git a/game/g_weapon.c b/game/g_weapon.c index de985cf..53f4bee 100644 --- a/game/g_weapon.c +++ b/game/g_weapon.c @@ -680,7 +680,9 @@ void fire_rail (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick } else { - if ((tr.ent->svflags & SVF_MONSTER) || (tr.ent->client)) + //ZOID--added so rail goes through SOLID_BBOX entities (gibs, etc) + if ((tr.ent->svflags & SVF_MONSTER) || (tr.ent->client) || + (tr.ent->solid == SOLID_BBOX)) ignore = tr.ent; else ignore = NULL; diff --git a/game/game.001 b/game/game.001 deleted file mode 100644 index 6e84a17..0000000 --- a/game/game.001 +++ /dev/null @@ -1,1619 +0,0 @@ -# Microsoft Developer Studio Project File - Name="game" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 -# TARGTYPE "Win32 (ALPHA) Dynamic-Link Library" 0x0602 - -CFG=game - Win32 Debug Alpha -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "game.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "game.mak" CFG="game - Win32 Debug Alpha" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "game - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "game - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "game - Win32 Debug Alpha" (based on\ - "Win32 (ALPHA) Dynamic-Link Library") -!MESSAGE "game - Win32 Release Alpha" (based on\ - "Win32 (ALPHA) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "game - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir ".\Release" -# PROP BASE Intermediate_Dir ".\Release" -# PROP BASE Target_Dir "." -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\release" -# PROP Intermediate_Dir ".\release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "." -CPP=cl.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /G5 /MT /W4 /GX /Zd /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows /dll /machine:I386 /out:"..\release\gamex86.dll" -# SUBTRACT LINK32 /incremental:yes /debug - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir ".\Debug" -# PROP BASE Intermediate_Dir ".\Debug" -# PROP BASE Target_Dir "." -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\debug" -# PROP Intermediate_Dir ".\debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "." -CPP=cl.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /G5 /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "BUILDING_REF_GL" /FR /YX /FD /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 -# ADD LINK32 kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"..\debug\gamex86.dll" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug Alpha" -# PROP BASE Intermediate_Dir "Debug Alpha" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\DebugAxp" -# PROP Intermediate_Dir ".\DebugAxp" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -CPP=cl.exe -# ADD BASE CPP /nologo /MTd /Gt0 /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /QA21164 /MTd /Gt0 /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "C_ONLY" /YX /FD /c -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x20000000" /subsystem:windows /dll /debug /machine:ALPHA -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x20000000" /subsystem:windows /dll /debug /machine:ALPHA /out:"..\DebugAxp/gameaxp.dll" - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "game___W" -# PROP BASE Intermediate_Dir "game___W" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\ReleaseAXP" -# PROP Intermediate_Dir ".\ReleaseAXP" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -CPP=cl.exe -# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /Zd /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /QA21164 /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "C_ONLY" /YX /FD /c -# SUBTRACT CPP /Z /Fr -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x20000000" /subsystem:windows /dll /machine:ALPHA /out:"..\Release/gamex86.dll" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib /nologo /base:"0x20000000" /subsystem:windows /dll /machine:ALPHA /out:"..\ReleaseAXP/gameaxp.dll" -# SUBTRACT LINK32 /debug - -!ENDIF - -# Begin Target - -# Name "game - Win32 Release" -# Name "game - Win32 Debug" -# Name "game - Win32 Debug Alpha" -# Name "game - Win32 Release Alpha" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90" -# Begin Source File - -SOURCE=.\g_ai.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_AI_=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_AI_=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_chase.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_CHA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_CHA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_cmds.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_CMD=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_player.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_CMD=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_player.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_combat.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_COM=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_COM=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_func.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_FUN=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_FUN=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_items.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_ITE=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_ITE=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_main.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_MAI=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_MAI=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_misc.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_MIS=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_MIS=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_monster.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_MON=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_MON=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_phys.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_PHY=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_PHY=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_save.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_SAV=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_SAV=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_spawn.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_SPA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_SPA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_svcmds.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_SVC=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_SVC=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_target.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_TAR=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_TAR=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_trigger.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_TRI=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_TRI=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_turret.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_TUR=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_TUR=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_utils.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_UTI=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_UTI=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\g_weapon.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_G_WEA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_G_WEA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_actor.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_ACT=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_actor.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_ACT=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_actor.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_berserk.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_BER=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_berserk.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_BER=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_berserk.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_boss2.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_BOS=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_boss2.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_BOS=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_boss2.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_boss3.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_BOSS=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_boss32.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_BOSS=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_boss32.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_boss31.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_BOSS3=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_boss31.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_BOSS3=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_boss31.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_boss32.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_BOSS32=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_boss32.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_BOSS32=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_boss32.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_brain.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_BRA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_brain.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_BRA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_brain.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_chick.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_CHI=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_chick.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_CHI=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_chick.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_flash.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_FLA=\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_FLA=\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_flipper.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_FLI=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_flipper.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_FLI=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_flipper.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_float.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_FLO=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_float.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_FLO=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_float.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_flyer.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_FLY=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_flyer.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_FLY=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_flyer.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_gladiator.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_GLA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_gladiator.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_GLA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_gladiator.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_gunner.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_GUN=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_gunner.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_GUN=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_gunner.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_hover.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_HOV=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_hover.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_HOV=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_hover.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_infantry.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_INF=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_infantry.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_INF=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_infantry.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_insane.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_INS=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_insane.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_INS=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_insane.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_medic.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_MED=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_medic.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_MED=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_medic.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_move.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_MOV=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_MOV=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_mutant.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_MUT=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_mutant.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_MUT=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_mutant.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_parasite.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_PAR=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_parasite.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_PAR=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_parasite.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_soldier.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_SOL=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_soldier.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_SOL=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_soldier.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_supertank.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_SUP=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_supertank.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_SUP=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_supertank.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\m_tank.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_M_TAN=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_tank.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_M_TAN=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_tank.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\p_client.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_P_CLI=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_player.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_P_CLI=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_player.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\p_hud.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_P_HUD=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_P_HUD=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\p_trail.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_P_TRA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_P_TRA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\p_view.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_P_VIE=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_player.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_P_VIE=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_player.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\p_weapon.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_P_WEA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_player.h"\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_P_WEA=\ - ".\g_local.h"\ - ".\game.h"\ - ".\m_player.h"\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\q_shared.c - -!IF "$(CFG)" == "game - Win32 Release" - -!ELSEIF "$(CFG)" == "game - Win32 Debug" - -!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha" - -DEP_CPP_Q_SHA=\ - ".\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "game - Win32 Release Alpha" - -DEP_CPP_Q_SHA=\ - ".\q_shared.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" -# Begin Source File - -SOURCE=.\g_local.h -# End Source File -# Begin Source File - -SOURCE=.\game.h -# End Source File -# Begin Source File - -SOURCE=.\m_actor.h -# End Source File -# Begin Source File - -SOURCE=.\m_berserk.h -# End Source File -# Begin Source File - -SOURCE=.\m_boss2.h -# End Source File -# Begin Source File - -SOURCE=.\m_boss31.h -# End Source File -# Begin Source File - -SOURCE=.\m_boss32.h -# End Source File -# Begin Source File - -SOURCE=.\m_brain.h -# End Source File -# Begin Source File - -SOURCE=.\m_chick.h -# End Source File -# Begin Source File - -SOURCE=.\m_flipper.h -# End Source File -# Begin Source File - -SOURCE=.\m_float.h -# End Source File -# Begin Source File - -SOURCE=.\m_flyer.h -# End Source File -# Begin Source File - -SOURCE=.\m_gladiator.h -# End Source File -# Begin Source File - -SOURCE=.\m_gunner.h -# End Source File -# Begin Source File - -SOURCE=.\m_hover.h -# End Source File -# Begin Source File - -SOURCE=.\m_infantry.h -# End Source File -# Begin Source File - -SOURCE=.\m_insane.h -# End Source File -# Begin Source File - -SOURCE=.\m_medic.h -# End Source File -# Begin Source File - -SOURCE=.\m_mutant.h -# End Source File -# Begin Source File - -SOURCE=.\m_parasite.h -# End Source File -# Begin Source File - -SOURCE=.\m_player.h -# End Source File -# Begin Source File - -SOURCE=.\m_soldier.h -# End Source File -# Begin Source File - -SOURCE=.\m_supertank.h -# End Source File -# Begin Source File - -SOURCE=.\m_tank.h -# End Source File -# Begin Source File - -SOURCE=.\q_shared.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\game.def -# End Source File -# End Group -# End Target -# End Project diff --git a/game/game.h b/game/game.h index 7b6218a..659e0f8 100644 --- a/game/game.h +++ b/game/game.h @@ -16,25 +16,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -/* -Copyright (C) 1997-2001 Id Software, Inc. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ // game.h -- game dll information visible to server diff --git a/game/game.plg b/game/game.plg deleted file mode 100644 index 3d0da9b..0000000 --- a/game/game.plg +++ /dev/null @@ -1,75 +0,0 @@ ---------------------Configuration: game - Win32 Release Alpha-------------------- -Begining build with project "G:\quake2\code\game\game.dsp", at root. -Active configuration is Win32 (ALPHA) Dynamic-Link Library (based on Win32 (ALPHA) Dynamic-Link Library) - -Project's tools are: - "OLE Type Library Maker" with flags "/nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 " - "C/C++ Compiler for Alpha" with flags "/nologo /QA21164 /MT /Gt0 /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "C_ONLY" /Fp".\ReleaseAXP/game.pch" /YX /Fo".\ReleaseAXP/" /Fd".\ReleaseAXP/" /FD /c " - "Win32 Resource Compiler" with flags "/l 0x409 /d "NDEBUG" " - "Browser Database Maker" with flags "/nologo /o"..\ReleaseAXP/game.bsc" " - "COFF Linker for Alpha" with flags "kernel32.lib user32.lib gdi32.lib /nologo /base:"0x20000000" /subsystem:windows /dll /incremental:no /pdb:"..\ReleaseAXP/gameaxp.pdb" /debug /machine:ALPHA /def:".\game.def" /out:"..\ReleaseAXP/gameaxp.dll" /implib:"..\ReleaseAXP/gameaxp.lib" " - "Custom Build" with flags "" - "" with flags "" - -Creating temp file "C:\TEMP\RSPA6.tmp" with contents -Creating command line "cl.exe @C:\TEMP\RSPA6.tmp" -Creating temp file "C:\TEMP\RSPA7.tmp" with contents -Creating command line "link.exe @C:\TEMP\RSPA7.tmp" -Compiling... -p_weapon.c -Linking... - Creating library ..\ReleaseAXP/gameaxp.lib and object ..\ReleaseAXP/gameaxp.exp - - - -gameaxp.dll - 0 error(s), 0 warning(s) diff --git a/game/p_client.c b/game/p_client.c index 80e444d..32b8a1c 100644 --- a/game/p_client.c +++ b/game/p_client.c @@ -1056,8 +1056,8 @@ void spectator_respawn (edict_t *ent) } } - // clear score on respawn - ent->client->pers.score = ent->client->resp.score = 0; + // clear client on respawn + ent->client->resp.score = ent->client->pers.score = 0; ent->svflags &= ~SVF_NOCLIENT; PutClientInServer (ent); @@ -1221,7 +1221,9 @@ void PutClientInServer (edict_t *ent) // set the delta angle for (i=0 ; i<3 ; i++) + { client->ps.pmove.delta_angles[i] = ANGLE2SHORT(spawn_angles[i] - client->resp.cmd_angles[i]); + } ent->s.angles[PITCH] = 0; ent->s.angles[YAW] = spawn_angles[YAW]; @@ -1272,11 +1274,18 @@ void ClientBeginDeathmatch (edict_t *ent) // locate ent at a spawn point PutClientInServer (ent); - // send effect - gi.WriteByte (svc_muzzleflash); - gi.WriteShort (ent-g_edicts); - gi.WriteByte (MZ_LOGIN); - gi.multicast (ent->s.origin, MULTICAST_PVS); + if (level.intermissiontime) + { + MoveClientToIntermission (ent); + } + else + { + // send effect + gi.WriteByte (svc_muzzleflash); + gi.WriteShort (ent-g_edicts); + gi.WriteByte (MZ_LOGIN); + gi.multicast (ent->s.origin, MULTICAST_PVS); + } gi.bprintf (PRINT_HIGH, "%s entered the game\n", ent->client->pers.netname); @@ -1489,6 +1498,7 @@ qboolean ClientConnect (edict_t *ent, char *userinfo) if (game.maxclients > 1) gi.dprintf ("%s connected\n", ent->client->pers.netname); + ent->svflags = 0; // make sure we start with known default ent->client->pers.connected = true; return true; } diff --git a/game/p_weapon.c b/game/p_weapon.c index dc418f3..79daba1 100644 --- a/game/p_weapon.c +++ b/game/p_weapon.c @@ -1386,7 +1386,7 @@ void weapon_bfg_fire (edict_t *ent) ent->client->ps.gunframe++; - PlayerNoise(ent, ent->s.origin, PNOISE_WEAPON); + PlayerNoise(ent, start, PNOISE_WEAPON); return; } diff --git a/irix/cd_irix.c b/irix/cd_irix.c index 75a17c3..88f49a1 100644 --- a/irix/cd_irix.c +++ b/irix/cd_irix.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include #include diff --git a/irix/glw_imp.c b/irix/glw_imp.c index fb4accf..fe66fb1 100644 --- a/irix/glw_imp.c +++ b/irix/glw_imp.c @@ -1,4 +1,23 @@ /* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +/* ** GLW_IMP.C ** ** This file contains ALL Linux specific stuff having to do with the diff --git a/irix/makefile.txt b/irix/makefile.txt new file mode 100644 index 0000000..1eccea7 --- /dev/null +++ b/irix/makefile.txt @@ -0,0 +1,1054 @@ +#!gmake -j3 +# +# MAKE="gmake -j8" +# +# Quake2 Makefile for Irix +# +# ELF only +# + +MOUNT_DIR=.. + +# SUB_MAKE_FLAGS=-j 3 + +BUILD_DEBUG_DIR=debug +BUILD_RELEASE_DIR=release +BUILD_DEBUG_STATIC_DIR=debug_static +BUILD_RELEASE_STATIC_DIR=release_static +CLIENT_DIR=$(MOUNT_DIR)/client +SERVER_DIR=$(MOUNT_DIR)/server +REF_SOFT_DIR=$(MOUNT_DIR)/ref_soft +REF_GL_DIR=$(MOUNT_DIR)/ref_gl +COMMON_DIR=$(MOUNT_DIR)/qcommon +IRIX_DIR=$(MOUNT_DIR)/irix +LINUX_DIR=$(MOUNT_DIR)/linux +GAME_DIR=$(MOUNT_DIR)/game +CTF_DIR=$(MOUNT_DIR)/ctf +XATRIX_DIR=$(MOUNT_DIR)/xatrix + +ARCH=mips + +#CC=gcc +# warning(1185): enumerated type mixed with another type +BASE_CFLAGS=-Dstricmp=strcasecmp -Xcpluscomm -woff 1185 -mips3 \ + -nostdinc -I. -I$(ROOT)/usr/include +RELEASE_CFLAGS=$(BASE_CFLAGS) -O3 +DEBUG_CFLAGS=$(BASE_CFLAGS) -g +BASE_STATIC_CFLAGS=-DGAME_HARD_LINKED -DREF_HARD_LINKED +RELEASE_STATIC_CFLAGS=$(BASE_STATIC_CFLAGS) $(RELEASE_CFLAGS) +DEBUG_STATIC_CFLAGS=$(BASE_STATIC_CFLAGS) $(DEBUG_CFLAGS) +# ld warning(15) multiply defined... +LDFLAGS=-nostdlib -L. -L$(ROOT)/usr/lib32 \ + -ldl -lm -laudio -ldmedia -Wl,-woff,15 +XLDFLAGS=-lX11 -lXext +XCFLAGS= + +GLLDFLAGS=-lGL -lX11 -lXext +GLCFLAGS= + +SHLIBEXT=so + +#SHLIBCFLAGS=-fPIC +SHLIBCFLAGS= +SHLIBLDFLAGS=-shared + +DO_CC=$(CC) $(CFLAGS) -o $@ -c $< +DO_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< +DO_GL_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(GLCFLAGS) -o $@ -c $< +DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< +DO_SHLIB_AS=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< + +############################################################################# +# SETUP AND BUILD +############################################################################# + +TARGETS=$(BUILDDIR)/quake2 $(BUILDDIR)/game$(ARCH).$(SHLIBEXT) \ + $(BUILDDIR)/ref_soft.$(SHLIBEXT) \ + $(BUILDDIR)/ref_gl.$(SHLIBEXT) \ + $(BUILDDIR)/ctf/game$(ARCH).$(SHLIBEXT) \ + $(BUILDDIR)/xatrix/game$(ARCH).$(SHLIBEXT) + +STATIC_TARGETS= \ + $(BUILDDIR)/quake2.gl \ + $(BUILDDIR)/quake2.sw + +build_debug: + @ if test ! -d $(BUILD_DEBUG_DIR) ; then mkdir $(BUILD_DEBUG_DIR) ; fi + @ if test ! -d $(BUILD_DEBUG_DIR)/client ; then mkdir $(BUILD_DEBUG_DIR)/client ; fi + @ if test ! -d $(BUILD_DEBUG_DIR)/ref_soft ; then mkdir $(BUILD_DEBUG_DIR)/ref_soft ; fi + @ if test ! -d $(BUILD_DEBUG_DIR)/ref_gl ; then mkdir $(BUILD_DEBUG_DIR)/ref_gl ; fi + @ if test ! -d $(BUILD_DEBUG_DIR)/game ; then mkdir $(BUILD_DEBUG_DIR)/game ; fi + @ if test ! -d $(BUILD_DEBUG_DIR)/ctf ; then mkdir $(BUILD_DEBUG_DIR)/ctf ; fi + @ if test ! -d $(BUILD_DEBUG_DIR)/xatrix ; then mkdir $(BUILD_DEBUG_DIR)/xatrix ; fi + $(MAKE) $(SUB_MAKE_FLAGS) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)" + +build_release: + @ if test ! -d $(BUILD_RELEASE_DIR) ; then mkdir $(BUILD_RELEASE_DIR) ; fi + @ if test ! -d $(BUILD_RELEASE_DIR)/client ; then mkdir $(BUILD_RELEASE_DIR)/client ; fi + @ if test ! -d $(BUILD_RELEASE_DIR)/ref_soft ; then mkdir $(BUILD_RELEASE_DIR)/ref_soft ; fi + @ if test ! -d $(BUILD_RELEASE_DIR)/ref_gl ; then mkdir $(BUILD_RELEASE_DIR)/ref_gl ; fi + @ if test ! -d $(BUILD_RELEASE_DIR)/game ; then mkdir $(BUILD_RELEASE_DIR)/game ; fi + @ if test ! -d $(BUILD_RELEASE_DIR)/ctf ; then mkdir $(BUILD_RELEASE_DIR)/ctf ; fi + @ if test ! -d $(BUILD_RELEASE_DIR)/xatrix ; then mkdir $(BUILD_RELEASE_DIR)/xatrix ; fi + $(MAKE) $(SUB_MAKE_FLAGS) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS)" + +build_debug_static: + @ if test ! -d $(BUILD_DEBUG_STATIC_DIR) ; then mkdir $(BUILD_DEBUG_STATIC_DIR) ; fi + @ if test ! -d $(BUILD_DEBUG_STATIC_DIR)/client ; then mkdir $(BUILD_DEBUG_STATIC_DIR)/client ; fi + @ if test ! -d $(BUILD_DEBUG_STATIC_DIR)/ref_soft ; then mkdir $(BUILD_DEBUG_STATIC_DIR)/ref_soft ; fi + @ if test ! -d $(BUILD_DEBUG_STATIC_DIR)/ref_gl ; then mkdir $(BUILD_DEBUG_STATIC_DIR)/ref_gl ; fi + @ if test ! -d $(BUILD_DEBUG_STATIC_DIR)/game ; then mkdir $(BUILD_DEBUG_STATIC_DIR)/game ; fi + $(MAKE) $(SUB_MAKE_FLAGS) static_targets BUILDDIR=$(BUILD_DEBUG_STATIC_DIR) CFLAGS="$(DEBUG_STATIC_CFLAGS)" + +build_release_static: + @ if test ! -d $(BUILD_RELEASE_STATIC_DIR) ; then mkdir $(BUILD_RELEASE_STATIC_DIR) ; fi + @ if test ! -d $(BUILD_RELEASE_STATIC_DIR)/client ; then mkdir $(BUILD_RELEASE_STATIC_DIR)/client ; fi + @ if test ! -d $(BUILD_RELEASE_STATIC_DIR)/ref_soft ; then mkdir $(BUILD_RELEASE_STATIC_DIR)/ref_soft ; fi + @ if test ! -d $(BUILD_RELEASE_STATIC_DIR)/ref_gl ; then mkdir $(BUILD_RELEASE_STATIC_DIR)/ref_gl ; fi + @ if test ! -d $(BUILD_RELEASE_STATIC_DIR)/game ; then mkdir $(BUILD_RELEASE_STATIC_DIR)/game ; fi + $(MAKE) $(SUB_MAKE_FLAGS) static_targets BUILDDIR=$(BUILD_RELEASE_STATIC_DIR) CFLAGS="$(RELEASE_STATIC_CFLAGS)" + +all: build_debug build_release build_debug_static build_release_static + +targets: $(TARGETS) + +static_targets: $(STATIC_TARGETS) + +############################################################################# +# CLIENT/SERVER +############################################################################# + +QUAKE2_OBJS = \ + $(BUILDDIR)/client/cl_cin.o \ + $(BUILDDIR)/client/cl_ents.o \ + $(BUILDDIR)/client/cl_fx.o \ + $(BUILDDIR)/client/cl_input.o \ + $(BUILDDIR)/client/cl_inv.o \ + $(BUILDDIR)/client/cl_main.o \ + $(BUILDDIR)/client/cl_newfx.o \ + $(BUILDDIR)/client/cl_parse.o \ + $(BUILDDIR)/client/cl_pred.o \ + $(BUILDDIR)/client/cl_tent.o \ + $(BUILDDIR)/client/cl_scrn.o \ + $(BUILDDIR)/client/cl_view.o \ + $(BUILDDIR)/client/console.o \ + $(BUILDDIR)/client/keys.o \ + $(BUILDDIR)/client/menu.o \ + $(BUILDDIR)/client/snd_dma.o \ + $(BUILDDIR)/client/snd_mem.o \ + $(BUILDDIR)/client/snd_mix.o \ + $(BUILDDIR)/client/qmenu.o \ + $(BUILDDIR)/client/m_flash.o \ + \ + $(BUILDDIR)/client/cmd.o \ + $(BUILDDIR)/client/cmodel.o \ + $(BUILDDIR)/client/common.o \ + $(BUILDDIR)/client/crc.o \ + $(BUILDDIR)/client/cvar.o \ + $(BUILDDIR)/client/files.o \ + $(BUILDDIR)/client/md4.o \ + $(BUILDDIR)/client/net_chan.o \ + \ + $(BUILDDIR)/client/sv_ccmds.o \ + $(BUILDDIR)/client/sv_ents.o \ + $(BUILDDIR)/client/sv_game.o \ + $(BUILDDIR)/client/sv_init.o \ + $(BUILDDIR)/client/sv_main.o \ + $(BUILDDIR)/client/sv_send.o \ + $(BUILDDIR)/client/sv_user.o \ + $(BUILDDIR)/client/sv_world.o \ + \ + $(BUILDDIR)/client/cd_irix.o \ + $(BUILDDIR)/client/q_shirix.o \ + $(BUILDDIR)/client/vid_menu.o \ + $(BUILDDIR)/client/vid_so.o \ + $(BUILDDIR)/client/snd_irix.o \ + $(BUILDDIR)/client/sys_irix.o \ + $(BUILDDIR)/client/glob.o \ + $(BUILDDIR)/client/net_udp.o \ + \ + $(BUILDDIR)/client/q_shared.o \ + $(BUILDDIR)/client/pmove.o + +$(BUILDDIR)/quake2 : $(QUAKE2_OBJS) + $(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(LDFLAGS) + +$(BUILDDIR)/client/cl_cin.o : $(CLIENT_DIR)/cl_cin.c + $(DO_CC) + +$(BUILDDIR)/client/cl_ents.o : $(CLIENT_DIR)/cl_ents.c + $(DO_CC) + +$(BUILDDIR)/client/cl_fx.o : $(CLIENT_DIR)/cl_fx.c + $(DO_CC) + +$(BUILDDIR)/client/cl_input.o : $(CLIENT_DIR)/cl_input.c + $(DO_CC) + +$(BUILDDIR)/client/cl_inv.o : $(CLIENT_DIR)/cl_inv.c + $(DO_CC) + +$(BUILDDIR)/client/cl_main.o : $(CLIENT_DIR)/cl_main.c + $(DO_CC) + +$(BUILDDIR)/client/cl_newfx.o : $(CLIENT_DIR)/cl_newfx.c + $(DO_CC) + +$(BUILDDIR)/client/cl_parse.o : $(CLIENT_DIR)/cl_parse.c + $(DO_CC) + +$(BUILDDIR)/client/cl_pred.o : $(CLIENT_DIR)/cl_pred.c + $(DO_CC) + +$(BUILDDIR)/client/cl_tent.o : $(CLIENT_DIR)/cl_tent.c + $(DO_CC) + +$(BUILDDIR)/client/cl_scrn.o : $(CLIENT_DIR)/cl_scrn.c + $(DO_CC) + +$(BUILDDIR)/client/cl_view.o : $(CLIENT_DIR)/cl_view.c + $(DO_CC) + +$(BUILDDIR)/client/console.o : $(CLIENT_DIR)/console.c + $(DO_CC) + +$(BUILDDIR)/client/keys.o : $(CLIENT_DIR)/keys.c + $(DO_CC) + +$(BUILDDIR)/client/menu.o : $(CLIENT_DIR)/menu.c + $(DO_CC) + +$(BUILDDIR)/client/snd_dma.o : $(CLIENT_DIR)/snd_dma.c + $(DO_CC) + +$(BUILDDIR)/client/snd_mem.o : $(CLIENT_DIR)/snd_mem.c + $(DO_CC) + +$(BUILDDIR)/client/snd_mix.o : $(CLIENT_DIR)/snd_mix.c + $(DO_CC) + +$(BUILDDIR)/client/qmenu.o : $(CLIENT_DIR)/qmenu.c + $(DO_CC) + +$(BUILDDIR)/client/m_flash.o : $(GAME_DIR)/m_flash.c + $(DO_CC) + +$(BUILDDIR)/client/cmd.o : $(COMMON_DIR)/cmd.c + $(DO_CC) + +$(BUILDDIR)/client/cmodel.o : $(COMMON_DIR)/cmodel.c + $(DO_CC) + +$(BUILDDIR)/client/common.o : $(COMMON_DIR)/common.c + $(DO_CC) + +$(BUILDDIR)/client/crc.o : $(COMMON_DIR)/crc.c + $(DO_CC) + +$(BUILDDIR)/client/cvar.o : $(COMMON_DIR)/cvar.c + $(DO_CC) + +$(BUILDDIR)/client/files.o : $(COMMON_DIR)/files.c + $(DO_CC) + +$(BUILDDIR)/client/md4.o : $(COMMON_DIR)/md4.c + $(DO_CC) + +$(BUILDDIR)/client/net_chan.o : $(COMMON_DIR)/net_chan.c + $(DO_CC) + +$(BUILDDIR)/client/q_shared.o : $(GAME_DIR)/q_shared.c + $(DO_CC) + +$(BUILDDIR)/client/pmove.o : $(COMMON_DIR)/pmove.c + $(DO_CC) + +$(BUILDDIR)/client/sv_ccmds.o : $(SERVER_DIR)/sv_ccmds.c + $(DO_CC) + +$(BUILDDIR)/client/sv_ents.o : $(SERVER_DIR)/sv_ents.c + $(DO_CC) + +$(BUILDDIR)/client/sv_game.o : $(SERVER_DIR)/sv_game.c + $(DO_CC) + +$(BUILDDIR)/client/sv_init.o : $(SERVER_DIR)/sv_init.c + $(DO_CC) + +$(BUILDDIR)/client/sv_main.o : $(SERVER_DIR)/sv_main.c + $(DO_CC) + +$(BUILDDIR)/client/sv_send.o : $(SERVER_DIR)/sv_send.c + $(DO_CC) + +$(BUILDDIR)/client/sv_user.o : $(SERVER_DIR)/sv_user.c + $(DO_CC) + +$(BUILDDIR)/client/sv_world.o : $(SERVER_DIR)/sv_world.c + $(DO_CC) + +$(BUILDDIR)/client/cd_irix.o : $(IRIX_DIR)/cd_irix.c + $(DO_CC) + +$(BUILDDIR)/client/q_shirix.o : $(IRIX_DIR)/q_shirix.c + $(DO_CC) + +$(BUILDDIR)/client/vid_menu.o : $(IRIX_DIR)/vid_menu.c + $(DO_CC) + +$(BUILDDIR)/client/vid_so.o : $(IRIX_DIR)/vid_so.c + $(DO_CC) + +$(BUILDDIR)/client/snd_irix.o : $(IRIX_DIR)/snd_irix.c + $(DO_CC) + +$(BUILDDIR)/client/sys_irix.o : $(IRIX_DIR)/sys_irix.c + $(DO_CC) + +$(BUILDDIR)/client/glob.o : $(LINUX_DIR)/glob.c + $(DO_CC) + +$(BUILDDIR)/client/net_udp.o : $(LINUX_DIR)/net_udp.c + $(DO_CC) + +############################################################################# +# GAME +############################################################################# + +GAME_OBJS = \ + $(BUILDDIR)/game/g_ai.o \ + $(BUILDDIR)/game/p_client.o \ + $(BUILDDIR)/game/g_cmds.o \ + $(BUILDDIR)/game/g_chase.o \ + $(BUILDDIR)/game/g_svcmds.o \ + $(BUILDDIR)/game/g_combat.o \ + $(BUILDDIR)/game/g_func.o \ + $(BUILDDIR)/game/g_items.o \ + $(BUILDDIR)/game/g_main.o \ + $(BUILDDIR)/game/g_misc.o \ + $(BUILDDIR)/game/g_monster.o \ + $(BUILDDIR)/game/g_phys.o \ + $(BUILDDIR)/game/g_save.o \ + $(BUILDDIR)/game/g_spawn.o \ + $(BUILDDIR)/game/g_target.o \ + $(BUILDDIR)/game/g_trigger.o \ + $(BUILDDIR)/game/g_turret.o \ + $(BUILDDIR)/game/g_utils.o \ + $(BUILDDIR)/game/g_weapon.o \ + $(BUILDDIR)/game/m_actor.o \ + $(BUILDDIR)/game/m_berserk.o \ + $(BUILDDIR)/game/m_boss2.o \ + $(BUILDDIR)/game/m_boss3.o \ + $(BUILDDIR)/game/m_boss31.o \ + $(BUILDDIR)/game/m_boss32.o \ + $(BUILDDIR)/game/m_brain.o \ + $(BUILDDIR)/game/m_chick.o \ + $(BUILDDIR)/game/m_flipper.o \ + $(BUILDDIR)/game/m_float.o \ + $(BUILDDIR)/game/m_flyer.o \ + $(BUILDDIR)/game/m_gladiator.o \ + $(BUILDDIR)/game/m_gunner.o \ + $(BUILDDIR)/game/m_hover.o \ + $(BUILDDIR)/game/m_infantry.o \ + $(BUILDDIR)/game/m_insane.o \ + $(BUILDDIR)/game/m_medic.o \ + $(BUILDDIR)/game/m_move.o \ + $(BUILDDIR)/game/m_mutant.o \ + $(BUILDDIR)/game/m_parasite.o \ + $(BUILDDIR)/game/m_soldier.o \ + $(BUILDDIR)/game/m_supertank.o \ + $(BUILDDIR)/game/m_tank.o \ + $(BUILDDIR)/game/p_hud.o \ + $(BUILDDIR)/game/p_trail.o \ + $(BUILDDIR)/game/p_view.o \ + $(BUILDDIR)/game/p_weapon.o \ + $(BUILDDIR)/game/q_shared.o \ + $(BUILDDIR)/game/m_flash.o + +$(BUILDDIR)/game$(ARCH).$(SHLIBEXT) : $(GAME_OBJS) + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(GAME_OBJS) + +$(BUILDDIR)/game/g_ai.o : $(GAME_DIR)/g_ai.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/p_client.o : $(GAME_DIR)/p_client.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_cmds.o : $(GAME_DIR)/g_cmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_chase.o : $(GAME_DIR)/g_chase.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_svcmds.o : $(GAME_DIR)/g_svcmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_combat.o : $(GAME_DIR)/g_combat.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_func.o : $(GAME_DIR)/g_func.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_items.o : $(GAME_DIR)/g_items.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_main.o : $(GAME_DIR)/g_main.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_misc.o : $(GAME_DIR)/g_misc.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_monster.o : $(GAME_DIR)/g_monster.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_phys.o : $(GAME_DIR)/g_phys.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_save.o : $(GAME_DIR)/g_save.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_spawn.o : $(GAME_DIR)/g_spawn.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_target.o : $(GAME_DIR)/g_target.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_trigger.o : $(GAME_DIR)/g_trigger.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_turret.o : $(GAME_DIR)/g_turret.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_utils.o : $(GAME_DIR)/g_utils.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_weapon.o : $(GAME_DIR)/g_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_actor.o : $(GAME_DIR)/m_actor.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_berserk.o : $(GAME_DIR)/m_berserk.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_boss2.o : $(GAME_DIR)/m_boss2.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_boss3.o : $(GAME_DIR)/m_boss3.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_boss31.o : $(GAME_DIR)/m_boss31.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_boss32.o : $(GAME_DIR)/m_boss32.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_brain.o : $(GAME_DIR)/m_brain.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_chick.o : $(GAME_DIR)/m_chick.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_flipper.o : $(GAME_DIR)/m_flipper.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_float.o : $(GAME_DIR)/m_float.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_flyer.o : $(GAME_DIR)/m_flyer.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_gladiator.o : $(GAME_DIR)/m_gladiator.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_gunner.o : $(GAME_DIR)/m_gunner.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_hover.o : $(GAME_DIR)/m_hover.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_infantry.o : $(GAME_DIR)/m_infantry.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_insane.o : $(GAME_DIR)/m_insane.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_medic.o : $(GAME_DIR)/m_medic.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_move.o : $(GAME_DIR)/m_move.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_mutant.o : $(GAME_DIR)/m_mutant.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_parasite.o : $(GAME_DIR)/m_parasite.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_soldier.o : $(GAME_DIR)/m_soldier.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_supertank.o : $(GAME_DIR)/m_supertank.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_tank.o : $(GAME_DIR)/m_tank.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/p_hud.o : $(GAME_DIR)/p_hud.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/p_trail.o : $(GAME_DIR)/p_trail.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/p_view.o : $(GAME_DIR)/p_view.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/p_weapon.o : $(GAME_DIR)/p_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/q_shared.o : $(GAME_DIR)/q_shared.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_flash.o : $(GAME_DIR)/m_flash.c + $(DO_SHLIB_CC) + +############################################################################# +# CTF +############################################################################# + +CTF_OBJS = \ + $(BUILDDIR)/ctf/g_ai.o \ + $(BUILDDIR)/ctf/g_chase.o \ + $(BUILDDIR)/ctf/g_cmds.o \ + $(BUILDDIR)/ctf/g_combat.o \ + $(BUILDDIR)/ctf/g_ctf.o \ + $(BUILDDIR)/ctf/g_func.o \ + $(BUILDDIR)/ctf/g_items.o \ + $(BUILDDIR)/ctf/g_main.o \ + $(BUILDDIR)/ctf/g_misc.o \ + $(BUILDDIR)/ctf/g_monster.o \ + $(BUILDDIR)/ctf/g_phys.o \ + $(BUILDDIR)/ctf/g_save.o \ + $(BUILDDIR)/ctf/g_spawn.o \ + $(BUILDDIR)/ctf/g_svcmds.o \ + $(BUILDDIR)/ctf/g_target.o \ + $(BUILDDIR)/ctf/g_trigger.o \ + $(BUILDDIR)/ctf/g_utils.o \ + $(BUILDDIR)/ctf/g_weapon.o \ + $(BUILDDIR)/ctf/m_move.o \ + $(BUILDDIR)/ctf/p_client.o \ + $(BUILDDIR)/ctf/p_hud.o \ + $(BUILDDIR)/ctf/p_menu.o \ + $(BUILDDIR)/ctf/p_trail.o \ + $(BUILDDIR)/ctf/p_view.o \ + $(BUILDDIR)/ctf/p_weapon.o \ + $(BUILDDIR)/ctf/q_shared.o + +$(BUILDDIR)/ctf/game$(ARCH).$(SHLIBEXT) : $(CTF_OBJS) + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(CTF_OBJS) + +$(BUILDDIR)/ctf/g_ai.o : $(CTF_DIR)/g_ai.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_chase.o : $(CTF_DIR)/g_chase.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_cmds.o : $(CTF_DIR)/g_cmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_combat.o : $(CTF_DIR)/g_combat.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_ctf.o : $(CTF_DIR)/g_ctf.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_func.o : $(CTF_DIR)/g_func.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_items.o : $(CTF_DIR)/g_items.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_main.o : $(CTF_DIR)/g_main.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_misc.o : $(CTF_DIR)/g_misc.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_monster.o : $(CTF_DIR)/g_monster.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_phys.o : $(CTF_DIR)/g_phys.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_save.o : $(CTF_DIR)/g_save.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_spawn.o : $(CTF_DIR)/g_spawn.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_svcmds.o : $(CTF_DIR)/g_svcmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_target.o : $(CTF_DIR)/g_target.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_trigger.o : $(CTF_DIR)/g_trigger.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_utils.o : $(CTF_DIR)/g_utils.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_weapon.o : $(CTF_DIR)/g_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/m_move.o : $(CTF_DIR)/m_move.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/p_client.o : $(CTF_DIR)/p_client.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/p_hud.o : $(CTF_DIR)/p_hud.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/p_menu.o : $(CTF_DIR)/p_menu.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/p_trail.o : $(CTF_DIR)/p_trail.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/p_view.o : $(CTF_DIR)/p_view.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/p_weapon.o : $(CTF_DIR)/p_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/q_shared.o : $(CTF_DIR)/q_shared.c + $(DO_SHLIB_CC) + +############################################################################# +# XATRIX +############################################################################# + +XATRIX_OBJS = \ + $(BUILDDIR)/xatrix/g_ai.o \ + $(BUILDDIR)/xatrix/g_chase.o \ + $(BUILDDIR)/xatrix/g_cmds.o \ + $(BUILDDIR)/xatrix/g_combat.o \ + $(BUILDDIR)/xatrix/g_func.o \ + $(BUILDDIR)/xatrix/g_items.o \ + $(BUILDDIR)/xatrix/g_main.o \ + $(BUILDDIR)/xatrix/g_misc.o \ + $(BUILDDIR)/xatrix/g_monster.o \ + $(BUILDDIR)/xatrix/g_phys.o \ + $(BUILDDIR)/xatrix/g_save.o \ + $(BUILDDIR)/xatrix/g_spawn.o \ + $(BUILDDIR)/xatrix/g_svcmds.o \ + $(BUILDDIR)/xatrix/g_target.o \ + $(BUILDDIR)/xatrix/g_trigger.o \ + $(BUILDDIR)/xatrix/g_turret.o \ + $(BUILDDIR)/xatrix/g_utils.o \ + $(BUILDDIR)/xatrix/g_weapon.o \ + $(BUILDDIR)/xatrix/m_actor.o \ + $(BUILDDIR)/xatrix/m_berserk.o \ + $(BUILDDIR)/xatrix/m_boss2.o \ + $(BUILDDIR)/xatrix/m_boss3.o \ + $(BUILDDIR)/xatrix/m_boss31.o \ + $(BUILDDIR)/xatrix/m_boss32.o \ + $(BUILDDIR)/xatrix/m_boss5.o \ + $(BUILDDIR)/xatrix/m_brain.o \ + $(BUILDDIR)/xatrix/m_chick.o \ + $(BUILDDIR)/xatrix/m_fixbot.o \ + $(BUILDDIR)/xatrix/m_flash.o \ + $(BUILDDIR)/xatrix/m_flipper.o \ + $(BUILDDIR)/xatrix/m_float.o \ + $(BUILDDIR)/xatrix/m_flyer.o \ + $(BUILDDIR)/xatrix/m_gekk.o \ + $(BUILDDIR)/xatrix/m_gladb.o \ + $(BUILDDIR)/xatrix/m_gladiator.o \ + $(BUILDDIR)/xatrix/m_gunner.o \ + $(BUILDDIR)/xatrix/m_hover.o \ + $(BUILDDIR)/xatrix/m_infantry.o \ + $(BUILDDIR)/xatrix/m_insane.o \ + $(BUILDDIR)/xatrix/m_medic.o \ + $(BUILDDIR)/xatrix/m_move.o \ + $(BUILDDIR)/xatrix/m_mutant.o \ + $(BUILDDIR)/xatrix/m_parasite.o \ + $(BUILDDIR)/xatrix/m_soldier.o \ + $(BUILDDIR)/xatrix/m_supertank.o \ + $(BUILDDIR)/xatrix/m_tank.o \ + $(BUILDDIR)/xatrix/p_client.o \ + $(BUILDDIR)/xatrix/p_hud.o \ + $(BUILDDIR)/xatrix/p_trail.o \ + $(BUILDDIR)/xatrix/p_view.o \ + $(BUILDDIR)/xatrix/p_weapon.o \ + $(BUILDDIR)/xatrix/q_shared.o + +$(BUILDDIR)/xatrix/game$(ARCH).$(SHLIBEXT) : $(XATRIX_OBJS) + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(XATRIX_OBJS) + +$(BUILDDIR)/xatrix/g_ai.o : $(XATRIX_DIR)/g_ai.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_chase.o : $(XATRIX_DIR)/g_chase.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_cmds.o : $(XATRIX_DIR)/g_cmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_combat.o : $(XATRIX_DIR)/g_combat.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_func.o : $(XATRIX_DIR)/g_func.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_items.o : $(XATRIX_DIR)/g_items.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_main.o : $(XATRIX_DIR)/g_main.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_misc.o : $(XATRIX_DIR)/g_misc.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_monster.o : $(XATRIX_DIR)/g_monster.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_phys.o : $(XATRIX_DIR)/g_phys.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_save.o : $(XATRIX_DIR)/g_save.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_spawn.o : $(XATRIX_DIR)/g_spawn.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_svcmds.o : $(XATRIX_DIR)/g_svcmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_target.o : $(XATRIX_DIR)/g_target.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_trigger.o : $(XATRIX_DIR)/g_trigger.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_turret.o : $(XATRIX_DIR)/g_turret.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_utils.o : $(XATRIX_DIR)/g_utils.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_weapon.o : $(XATRIX_DIR)/g_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_actor.o : $(XATRIX_DIR)/m_actor.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_berserk.o : $(XATRIX_DIR)/m_berserk.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_boss2.o : $(XATRIX_DIR)/m_boss2.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_boss3.o : $(XATRIX_DIR)/m_boss3.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_boss31.o : $(XATRIX_DIR)/m_boss31.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_boss32.o : $(XATRIX_DIR)/m_boss32.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_boss5.o : $(XATRIX_DIR)/m_boss5.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_brain.o : $(XATRIX_DIR)/m_brain.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_chick.o : $(XATRIX_DIR)/m_chick.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_fixbot.o : $(XATRIX_DIR)/m_fixbot.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_flash.o : $(XATRIX_DIR)/m_flash.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_flipper.o : $(XATRIX_DIR)/m_flipper.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_float.o : $(XATRIX_DIR)/m_float.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_flyer.o : $(XATRIX_DIR)/m_flyer.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_gekk.o : $(XATRIX_DIR)/m_gekk.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_gladb.o : $(XATRIX_DIR)/m_gladb.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_gladiator.o : $(XATRIX_DIR)/m_gladiator.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_gunner.o : $(XATRIX_DIR)/m_gunner.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_hover.o : $(XATRIX_DIR)/m_hover.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_infantry.o : $(XATRIX_DIR)/m_infantry.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_insane.o : $(XATRIX_DIR)/m_insane.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_medic.o : $(XATRIX_DIR)/m_medic.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_move.o : $(XATRIX_DIR)/m_move.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_mutant.o : $(XATRIX_DIR)/m_mutant.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_parasite.o : $(XATRIX_DIR)/m_parasite.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_soldier.o : $(XATRIX_DIR)/m_soldier.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_supertank.o : $(XATRIX_DIR)/m_supertank.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_tank.o : $(XATRIX_DIR)/m_tank.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/p_client.o : $(XATRIX_DIR)/p_client.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/p_hud.o : $(XATRIX_DIR)/p_hud.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/p_trail.o : $(XATRIX_DIR)/p_trail.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/p_view.o : $(XATRIX_DIR)/p_view.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/p_weapon.o : $(XATRIX_DIR)/p_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/q_shared.o : $(XATRIX_DIR)/q_shared.c + $(DO_SHLIB_CC) + + +############################################################################# +# REF_SOFT +############################################################################# + +REF_SOFT_OBJS = \ + $(BUILDDIR)/ref_soft/r_aclip.o \ + $(BUILDDIR)/ref_soft/r_alias.o \ + $(BUILDDIR)/ref_soft/r_bsp.o \ + $(BUILDDIR)/ref_soft/r_draw.o \ + $(BUILDDIR)/ref_soft/r_edge.o \ + $(BUILDDIR)/ref_soft/r_image.o \ + $(BUILDDIR)/ref_soft/r_light.o \ + $(BUILDDIR)/ref_soft/r_main.o \ + $(BUILDDIR)/ref_soft/r_misc.o \ + $(BUILDDIR)/ref_soft/r_model.o \ + $(BUILDDIR)/ref_soft/r_part.o \ + $(BUILDDIR)/ref_soft/r_poly.o \ + $(BUILDDIR)/ref_soft/r_polyse.o \ + $(BUILDDIR)/ref_soft/r_rast.o \ + $(BUILDDIR)/ref_soft/r_scan.o \ + $(BUILDDIR)/ref_soft/r_sprite.o \ + $(BUILDDIR)/ref_soft/r_surf.o \ + \ + $(BUILDDIR)/ref_soft/q_shared.o \ + $(BUILDDIR)/ref_soft/q_shirix.o \ + $(BUILDDIR)/ref_soft/glob.o + +REF_SOFT_X11_OBJS = \ + $(BUILDDIR)/ref_soft/rw_x11.o + +$(BUILDDIR)/ref_soft.$(SHLIBEXT) : $(REF_SOFT_OBJS) $(REF_SOFT_X11_OBJS) + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(REF_SOFT_OBJS) \ + $(REF_SOFT_X11_OBJS) $(XLDFLAGS) + +$(BUILDDIR)/ref_soft/r_aclip.o : $(REF_SOFT_DIR)/r_aclip.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_alias.o : $(REF_SOFT_DIR)/r_alias.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_bsp.o : $(REF_SOFT_DIR)/r_bsp.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_draw.o : $(REF_SOFT_DIR)/r_draw.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_edge.o : $(REF_SOFT_DIR)/r_edge.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_image.o : $(REF_SOFT_DIR)/r_image.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_light.o : $(REF_SOFT_DIR)/r_light.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_main.o : $(REF_SOFT_DIR)/r_main.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_misc.o : $(REF_SOFT_DIR)/r_misc.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_model.o : $(REF_SOFT_DIR)/r_model.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_part.o : $(REF_SOFT_DIR)/r_part.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_poly.o : $(REF_SOFT_DIR)/r_poly.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_polyse.o : $(REF_SOFT_DIR)/r_polyse.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_rast.o : $(REF_SOFT_DIR)/r_rast.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_scan.o : $(REF_SOFT_DIR)/r_scan.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_sprite.o : $(REF_SOFT_DIR)/r_sprite.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/r_surf.o : $(REF_SOFT_DIR)/r_surf.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/q_shared.o : $(GAME_DIR)/q_shared.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/q_shirix.o : $(IRIX_DIR)/q_shirix.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/glob.o : $(LINUX_DIR)/glob.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ref_soft/rw_x11.o : $(IRIX_DIR)/rw_x11.c + $(DO_SHLIB_CC) + +############################################################################# +# REF_GL +############################################################################# + +REF_GL_OBJS = \ + $(BUILDDIR)/ref_gl/gl_draw.o \ + $(BUILDDIR)/ref_gl/gl_image.o \ + $(BUILDDIR)/ref_gl/gl_light.o \ + $(BUILDDIR)/ref_gl/gl_mesh.o \ + $(BUILDDIR)/ref_gl/gl_model.o \ + $(BUILDDIR)/ref_gl/gl_rmain.o \ + $(BUILDDIR)/ref_gl/gl_rmisc.o \ + $(BUILDDIR)/ref_gl/gl_rsurf.o \ + $(BUILDDIR)/ref_gl/gl_warp.o \ + \ + $(BUILDDIR)/ref_gl/qgl_irix.o \ + $(BUILDDIR)/ref_gl/glw_imp.o \ + $(BUILDDIR)/ref_gl/q_shared.o \ + $(BUILDDIR)/ref_gl/q_shirix.o \ + $(BUILDDIR)/ref_gl/glob.o + +$(BUILDDIR)/ref_gl.$(SHLIBEXT) : $(REF_GL_OBJS) + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(REF_GL_OBJS) $(GLLDFLAGS) + +$(BUILDDIR)/ref_gl/gl_draw.o : $(REF_GL_DIR)/gl_draw.c + $(DO_GL_SHLIB_CC) + +$(BUILDDIR)/ref_gl/gl_image.o : $(REF_GL_DIR)/gl_image.c + $(DO_GL_SHLIB_CC) + +$(BUILDDIR)/ref_gl/gl_light.o : $(REF_GL_DIR)/gl_light.c + $(DO_GL_SHLIB_CC) + +$(BUILDDIR)/ref_gl/gl_mesh.o : $(REF_GL_DIR)/gl_mesh.c + $(DO_GL_SHLIB_CC) + +$(BUILDDIR)/ref_gl/gl_model.o : $(REF_GL_DIR)/gl_model.c + $(DO_GL_SHLIB_CC) + +$(BUILDDIR)/ref_gl/gl_rmain.o : $(REF_GL_DIR)/gl_rmain.c + $(DO_GL_SHLIB_CC) + +$(BUILDDIR)/ref_gl/gl_rmisc.o : $(REF_GL_DIR)/gl_rmisc.c + $(DO_GL_SHLIB_CC) + +$(BUILDDIR)/ref_gl/gl_rsurf.o : $(REF_GL_DIR)/gl_rsurf.c + $(DO_GL_SHLIB_CC) + +$(BUILDDIR)/ref_gl/gl_warp.o : $(REF_GL_DIR)/gl_warp.c + $(DO_GL_SHLIB_CC) + +$(BUILDDIR)/ref_gl/qgl_irix.o : $(IRIX_DIR)/qgl_irix.c + $(DO_GL_SHLIB_CC) + +$(BUILDDIR)/ref_gl/glw_imp.o : $(IRIX_DIR)/glw_imp.c + $(DO_GL_SHLIB_CC) + +$(BUILDDIR)/ref_gl/q_shared.o : $(GAME_DIR)/q_shared.c + $(DO_GL_SHLIB_CC) + +$(BUILDDIR)/ref_gl/q_shirix.o : $(IRIX_DIR)/q_shirix.c + $(DO_GL_SHLIB_CC) + +$(BUILDDIR)/ref_gl/glob.o : $(LINUX_DIR)/glob.c + $(DO_GL_SHLIB_CC) + +############################################################################# +# MISC +############################################################################# + +$(BUILDDIR)/quake2.sw : $(QUAKE2_OBJS) $(GAME_OBJS) \ + $(REF_SOFT_OBJS) $(REF_SOFT_X11_OBJS) + $(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(GAME_OBJS) \ + $(REF_SOFT_OBJS) $(REF_SOFT_X11_OBJS) $(LDFLAGS) $(XLDFLAGS) + +$(BUILDDIR)/quake2.gl : $(QUAKE2_OBJS) $(GAME_OBJS) $(REF_GL_OBJS) + $(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(GAME_OBJS) \ + $(REF_GL_OBJS) $(LDFLAGS) $(GLLDFLAGS) + +############################################################################# + +clean: clean-debug clean-release clean-debug-static clean-release-static + +clean-debug: + $(MAKE) clean2 BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)" + +clean-release: + $(MAKE) clean2 BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(DEBUG_CFLAGS)" + +clean-debug-static: + $(MAKE) clean2 BUILDDIR=$(BUILD_DEBUG_STATIC_DIR) CFLAGS="$(DEBUG_CFLAGS)" + +clean-release-static: + $(MAKE) clean2 BUILDDIR=$(BUILD_RELEASE_STATIC_DIR) CFLAGS="$(DEBUG_CFLAGS)" + +clean2: + -rm -f $(QUAKE2_OBJS) \ + $(GAME_OBJS) \ + $(REF_SOFT_OBJS) \ + $(REF_SOFT_X11_OBJS) \ + $(REF_GL_OBJS) + -rm -f \ + $(QUAKE2_OBJS) \ + $(QUAKE2_AS_OBJS) \ + $(GAME_OBJS) \ + $(CTF_OBJS) \ + $(XATRIX_OBJS) \ + $(REF_SOFT_OBJS) \ + $(REF_SOFT_SVGA_OBJS) \ + $(REF_SOFT_X11_OBJS) \ + $(REF_GL_OBJS) + diff --git a/irix/q_shirix.c b/irix/q_shirix.c index 9d27264..54e6fa1 100644 --- a/irix/q_shirix.c +++ b/irix/q_shirix.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include #include #include diff --git a/irix/qgl_irix.c b/irix/qgl_irix.c index c80c2c5..5e3b63b 100644 --- a/irix/qgl_irix.c +++ b/irix/qgl_irix.c @@ -1,4 +1,23 @@ /* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +/* ** QGL_WIN.C ** ** This file implements the operating system binding of GL to QGL function diff --git a/irix/snd_irix.c b/irix/snd_irix.c index a15bcb0..2af05d5 100644 --- a/irix/snd_irix.c +++ b/irix/snd_irix.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include #include diff --git a/irix/sys_irix.c b/irix/sys_irix.c index ed1834b..1c8878b 100644 --- a/irix/sys_irix.c +++ b/irix/sys_irix.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include #include #include diff --git a/irix/vid_menu.c b/irix/vid_menu.c index 523487d..dfe9898 100644 --- a/irix/vid_menu.c +++ b/irix/vid_menu.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include "../client/client.h" #include "../client/qmenu.h" @@ -177,6 +196,7 @@ void VID_MenuInit( void ) "[1152 864 ]", "[1280 1024]", "[1600 1200]", + "[2048 1536]", 0 }; static const char *refs[] = diff --git a/irix/vid_so.c b/irix/vid_so.c index df1325a..10280e9 100644 --- a/irix/vid_so.c +++ b/irix/vid_so.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ // Main windowed and fullscreen graphics interface module. This module // is used for both the software and OpenGL rendering versions of the // Quake refresh engine. @@ -131,7 +150,8 @@ vidmode_t vid_modes[] = { "Mode 6: 1024x768", 1024, 768, 6 }, { "Mode 7: 1152x864", 1152, 864, 7 }, { "Mode 8: 1280x1024", 1280, 1024, 8 }, - { "Mode 9: 1600x1200", 1600, 1200, 9 } + { "Mode 9: 1600x1200", 1600, 1200, 9 }, + { "Mode 10: 2048x1536", 2048, 1536, 10 } }; qboolean VID_GetModeInfo( int *width, int *height, int mode ) diff --git a/linux/.gitignore b/linux/.gitignore index ea53d9f..47a24a1 100644 --- a/linux/.gitignore +++ b/linux/.gitignore @@ -1,3 +1,6 @@ *.d +*.map debugi386 +debugi386-glibc releasei386 +releasei386-glibc diff --git a/linux/Makefile b/linux/Makefile index 01fb012..f19c0e9 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -6,12 +6,20 @@ # ELF only # +ifneq (,$(findstring libc6,$(shell if test -e /lib/libc.so.6*; then echo libc6; fi))) +GLIBC=-glibc +else +GLIBC= +endif ARCH=i386 -MOUNT_DIR=../../quake2 +MOUNT_DIR=.. +GAME_DIR=$(shell if test -f /etc/quake2.conf; then cat /etc/quake2.conf; else echo .; fi) -BUILD_DEBUG_DIR=debug$(ARCH) -BUILD_RELEASE_DIR=release$(ARCH) +DOFXMESA=0 + +BUILD_DEBUG_DIR=debug$(ARCH)$(GLIBC) +BUILD_RELEASE_DIR=release$(ARCH)$(GLIBC) CLIENT_DIR=$(MOUNT_DIR)/client SERVER_DIR=$(MOUNT_DIR)/server REF_SOFT_DIR=$(MOUNT_DIR)/ref_soft @@ -19,8 +27,12 @@ REF_GL_DIR=$(MOUNT_DIR)/ref_gl COMMON_DIR=$(MOUNT_DIR)/qcommon LINUX_DIR=$(MOUNT_DIR)/linux GAME_DIR=$(MOUNT_DIR)/game +NULL_DIR=$(MOUNT_DIR)/null CTF_DIR=$(MOUNT_DIR)/ctf XATRIX_DIR=$(MOUNT_DIR)/xatrix +ROGUE_DIR=$(MOUNT_DIR)/rogue + +MESA_DIR=/usr/local/src/Mesa-2.6 CC=gcc BASE_CFLAGS=-Dstricmp=strcasecmp @@ -30,19 +42,23 @@ RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \ -fomit-frame-pointer -fexpensive-optimizations else RELEASE_CFLAGS=$(BASE_CFLAGS) -march=i686 -O6 -ffast-math -funroll-loops \ - -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ - -malign-jumps=2 -malign-functions=2 + -fomit-frame-pointer -fexpensive-optimizations endif DEBUG_CFLAGS=$(BASE_CFLAGS) -g LDFLAGS=-ldl -lm -SVGALDFLAGS=-lvga -XLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext +SVGALDFLAGS=-lvga -ldl -lm +XLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -ldl -lm XCFLAGS= -GLLDFLAGS=-L/usr/X11R6/lib -L/usr/local/lib \ - -lGL -lX11 -lXext -lpthread +GLLDFLAGS=-L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXext -lvga -ldl -lm +GLXLDFLAGS=-L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXext -lXxf86dga -lXxf86vm -ldl -lm + +ifeq ($(DOFXMESA),1) +GLCFLAGS=-I$(MESA_DIR)/include -I/usr/include/glide +else GLCFLAGS= +endif SHLIBEXT=so @@ -50,8 +66,15 @@ SHLIBCFLAGS=-fPIC SHLIBLDFLAGS=-shared DO_CC=$(CC) $(CFLAGS) -o $@ -c $< +DO_DEBUG_CC=$(CC) $(DEBUG_CFLAGS) -o $@ -c $< +DO_DED_CC=$(CC) $(CFLAGS) -DDEDICATED_ONLY -o $@ -c $< +DO_DED_DEBUG_CC=$(CC) $(DEBUG_CFLAGS) -DDEDICATED_ONLY -o $@ -c $< +#DO_O_CC=$(CC) $(CFLAGS) -O -o $@ -c $< DO_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< +DO_SHLIB_DEBUG_CC=$(CC) $(DEBUG_CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< +#DO_SHLIB_O_CC=$(CC) $(CFLAGS) -O $(SHLIBCFLAGS) -o $@ -c $< DO_GL_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(GLCFLAGS) -o $@ -c $< +#DO_GL_SHLIB_O_CC=$(CC) $(CFLAGS) -O $(SHLIBCFLAGS) $(GLCFLAGS) -o $@ -c $< DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< DO_SHLIB_AS=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< @@ -60,31 +83,38 @@ DO_SHLIB_AS=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -DELF -x assembler-with-cpp -o $@ -c ############################################################################# TARGETS=$(BUILDDIR)/quake2 \ + $(BUILDDIR)/q2ded \ $(BUILDDIR)/game$(ARCH).$(SHLIBEXT) \ + $(BUILDDIR)/ref_soft.$(SHLIBEXT) \ $(BUILDDIR)/ref_softx.$(SHLIBEXT) \ - $(BUILDDIR)/ref_gl.$(SHLIBEXT) -# $(BUILDDIR)/ctf/game$(ARCH).$(SHLIBEXT) \ -# $(BUILDDIR)/ref_soft.$(SHLIBEXT) \ -# $(BUILDDIR)/xatrix/game$(ARCH).$(SHLIBEXT) + $(BUILDDIR)/ref_gl.$(SHLIBEXT) \ + $(BUILDDIR)/ref_glx.$(SHLIBEXT) \ + $(BUILDDIR)/ctf/game$(ARCH).$(SHLIBEXT) \ +# $(BUILDDIR)/xatrix/game$(ARCH).$(SHLIBEXT) \ +# $(BUILDDIR)/rogue/game$(ARCH).$(SHLIBEXT) build_debug: @-mkdir -p $(BUILD_DEBUG_DIR) \ $(BUILD_DEBUG_DIR)/client \ + $(BUILD_DEBUG_DIR)/ded \ $(BUILD_DEBUG_DIR)/ref_soft \ $(BUILD_DEBUG_DIR)/ref_gl \ $(BUILD_DEBUG_DIR)/game \ $(BUILD_DEBUG_DIR)/ctf \ - $(BUILD_DEBUG_DIR)/xatrix +# $(BUILD_DEBUG_DIR)/xatrix \ +# $(BUILD_DEBUG_DIR)/rogue $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)" build_release: @-mkdir -p $(BUILD_RELEASE_DIR) \ $(BUILD_RELEASE_DIR)/client \ + $(BUILD_RELEASE_DIR)/ded \ $(BUILD_RELEASE_DIR)/ref_soft \ $(BUILD_RELEASE_DIR)/ref_gl \ $(BUILD_RELEASE_DIR)/game \ $(BUILD_RELEASE_DIR)/ctf \ - $(BUILD_RELEASE_DIR)/xatrix +# $(BUILD_RELEASE_DIR)/xatrix \ +# $(BUILD_RELEASE_DIR)/rogue $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS)" all: build_debug build_release @@ -167,7 +197,7 @@ $(BUILDDIR)/client/cl_ents.o : $(CLIENT_DIR)/cl_ents.c $(BUILDDIR)/client/cl_fx.o : $(CLIENT_DIR)/cl_fx.c $(DO_CC) -$(BUILDDIR)/client/cl_newfx.o : $(CLIENT_DIR)/cl_newfx.c +$(BUILDDIR)/client/cl_newfx.o : $(CLIENT_DIR)/cl_newfx.c $(DO_CC) $(BUILDDIR)/client/cl_input.o : $(CLIENT_DIR)/cl_input.c @@ -246,7 +276,7 @@ $(BUILDDIR)/client/net_chan.o : $(COMMON_DIR)/net_chan.c $(DO_CC) $(BUILDDIR)/client/q_shared.o : $(GAME_DIR)/q_shared.c - $(DO_CC) + $(DO_DEBUG_CC) $(BUILDDIR)/client/pmove.o : $(COMMON_DIR)/pmove.c $(DO_CC) @@ -302,16 +332,131 @@ $(BUILDDIR)/client/glob.o : $(LINUX_DIR)/glob.c $(BUILDDIR)/client/net_udp.o : $(LINUX_DIR)/net_udp.c $(DO_CC) +############################################################################# +# DEDICATED SERVER +############################################################################# + +Q2DED_OBJS = \ + \ + $(BUILDDIR)/ded/cmd.o \ + $(BUILDDIR)/ded/cmodel.o \ + $(BUILDDIR)/ded/common.o \ + $(BUILDDIR)/ded/crc.o \ + $(BUILDDIR)/ded/cvar.o \ + $(BUILDDIR)/ded/files.o \ + $(BUILDDIR)/ded/checksum.o \ + $(BUILDDIR)/ded/mdfour.o \ + $(BUILDDIR)/ded/net_chan.o \ + \ + $(BUILDDIR)/ded/sv_ccmds.o \ + $(BUILDDIR)/ded/sv_ents.o \ + $(BUILDDIR)/ded/sv_game.o \ + $(BUILDDIR)/ded/sv_init.o \ + $(BUILDDIR)/ded/sv_main.o \ + $(BUILDDIR)/ded/sv_send.o \ + $(BUILDDIR)/ded/sv_user.o \ + $(BUILDDIR)/ded/sv_world.o \ + \ + $(BUILDDIR)/ded/q_shlinux.o \ + $(BUILDDIR)/ded/sys_linux.o \ + $(BUILDDIR)/ded/glob.o \ + $(BUILDDIR)/ded/net_udp.o \ + \ + $(BUILDDIR)/ded/q_shared.o \ + $(BUILDDIR)/ded/pmove.o \ + \ + $(BUILDDIR)/ded/cl_null.o \ + $(BUILDDIR)/ded/cd_null.o + +$(BUILDDIR)/q2ded : $(Q2DED_OBJS) + $(CC) $(CFLAGS) -o $@ $(Q2DED_OBJS) $(LDFLAGS) + +$(BUILDDIR)/ded/cmd.o : $(COMMON_DIR)/cmd.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/cmodel.o : $(COMMON_DIR)/cmodel.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/common.o : $(COMMON_DIR)/common.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/crc.o : $(COMMON_DIR)/crc.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/cvar.o : $(COMMON_DIR)/cvar.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/files.o : $(COMMON_DIR)/files.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/checksum.o : $(COMMON_DIR)/checksum.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/mdfour.o : $(COMMON_DIR)/mdfour.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/net_chan.o : $(COMMON_DIR)/net_chan.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/q_shared.o : $(GAME_DIR)/q_shared.c + $(DO_DED_DEBUG_CC) + +$(BUILDDIR)/ded/pmove.o : $(COMMON_DIR)/pmove.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/sv_ccmds.o : $(SERVER_DIR)/sv_ccmds.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/sv_ents.o : $(SERVER_DIR)/sv_ents.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/sv_game.o : $(SERVER_DIR)/sv_game.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/sv_init.o : $(SERVER_DIR)/sv_init.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/sv_main.o : $(SERVER_DIR)/sv_main.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/sv_send.o : $(SERVER_DIR)/sv_send.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/sv_user.o : $(SERVER_DIR)/sv_user.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/sv_world.o : $(SERVER_DIR)/sv_world.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/q_shlinux.o : $(LINUX_DIR)/q_shlinux.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/sys_linux.o : $(LINUX_DIR)/sys_linux.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/glob.o : $(LINUX_DIR)/glob.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/net_udp.o : $(LINUX_DIR)/net_udp.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/cd_null.o : $(NULL_DIR)/cd_null.c + $(DO_DED_CC) + +$(BUILDDIR)/ded/cl_null.o : $(NULL_DIR)/cl_null.c + $(DO_DED_CC) + ############################################################################# # GAME ############################################################################# GAME_OBJS = \ + $(BUILDDIR)/game/q_shared.o \ $(BUILDDIR)/game/g_ai.o \ $(BUILDDIR)/game/p_client.o \ - $(BUILDDIR)/game/g_chase.o \ $(BUILDDIR)/game/g_cmds.o \ $(BUILDDIR)/game/g_svcmds.o \ + $(BUILDDIR)/game/g_chase.o \ $(BUILDDIR)/game/g_combat.o \ $(BUILDDIR)/game/g_func.o \ $(BUILDDIR)/game/g_items.o \ @@ -353,7 +498,6 @@ GAME_OBJS = \ $(BUILDDIR)/game/p_trail.o \ $(BUILDDIR)/game/p_view.o \ $(BUILDDIR)/game/p_weapon.o \ - $(BUILDDIR)/game/q_shared.o \ $(BUILDDIR)/game/m_flash.o $(BUILDDIR)/game$(ARCH).$(SHLIBEXT) : $(GAME_OBJS) @@ -365,15 +509,15 @@ $(BUILDDIR)/game/g_ai.o : $(GAME_DIR)/g_ai.c $(BUILDDIR)/game/p_client.o : $(GAME_DIR)/p_client.c $(DO_SHLIB_CC) -$(BUILDDIR)/game/g_chase.o : $(GAME_DIR)/g_chase.c - $(DO_SHLIB_CC) - $(BUILDDIR)/game/g_cmds.o : $(GAME_DIR)/g_cmds.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_svcmds.o : $(GAME_DIR)/g_svcmds.c $(DO_SHLIB_CC) +$(BUILDDIR)/game/g_chase.o : $(GAME_DIR)/g_chase.c + $(DO_SHLIB_CC) + $(BUILDDIR)/game/g_combat.o : $(GAME_DIR)/g_combat.c $(DO_SHLIB_CC) @@ -498,7 +642,7 @@ $(BUILDDIR)/game/p_weapon.o : $(GAME_DIR)/p_weapon.c $(DO_SHLIB_CC) $(BUILDDIR)/game/q_shared.o : $(GAME_DIR)/q_shared.c - $(DO_SHLIB_CC) + $(DO_SHLIB_DEBUG_CC) $(BUILDDIR)/game/m_flash.o : $(GAME_DIR)/m_flash.c $(DO_SHLIB_CC) @@ -614,7 +758,7 @@ $(BUILDDIR)/ctf/p_weapon.o : $(CTF_DIR)/p_weapon.c $(DO_SHLIB_CC) $(BUILDDIR)/ctf/q_shared.o : $(CTF_DIR)/q_shared.c - $(DO_SHLIB_CC) + $(DO_SHLIB_DEBUG_CC) ############################################################################# # XATRIX @@ -623,6 +767,7 @@ $(BUILDDIR)/ctf/q_shared.o : $(CTF_DIR)/q_shared.c XATRIX_OBJS = \ $(BUILDDIR)/xatrix/g_ai.o \ $(BUILDDIR)/xatrix/g_cmds.o \ + $(BUILDDIR)/xatrix/g_chase.o \ $(BUILDDIR)/xatrix/g_combat.o \ $(BUILDDIR)/xatrix/g_func.o \ $(BUILDDIR)/xatrix/g_items.o \ @@ -682,6 +827,9 @@ $(BUILDDIR)/xatrix/g_ai.o : $(XATRIX_DIR)/g_ai.c $(BUILDDIR)/xatrix/g_cmds.o : $(XATRIX_DIR)/g_cmds.c $(DO_SHLIB_CC) +$(BUILDDIR)/xatrix/g_chase.o : $(XATRIX_DIR)/g_chase.c + $(DO_SHLIB_CC) + $(BUILDDIR)/xatrix/g_combat.o : $(XATRIX_DIR)/g_combat.c $(DO_SHLIB_CC) @@ -827,8 +975,264 @@ $(BUILDDIR)/xatrix/p_weapon.o : $(XATRIX_DIR)/p_weapon.c $(DO_SHLIB_CC) $(BUILDDIR)/xatrix/q_shared.o : $(XATRIX_DIR)/q_shared.c + $(DO_SHLIB_DEBUG_CC) + +############################################################################# +# ROGUE +############################################################################# + +ROGUE_OBJS = \ + $(BUILDDIR)/rogue/dm_ball.o \ + $(BUILDDIR)/rogue/dm_tag.o \ + $(BUILDDIR)/rogue/g_ai.o \ + $(BUILDDIR)/rogue/g_chase.o \ + $(BUILDDIR)/rogue/g_cmds.o \ + $(BUILDDIR)/rogue/g_combat.o \ + $(BUILDDIR)/rogue/g_func.o \ + $(BUILDDIR)/rogue/g_items.o \ + $(BUILDDIR)/rogue/g_main.o \ + $(BUILDDIR)/rogue/g_misc.o \ + $(BUILDDIR)/rogue/g_monster.o \ + $(BUILDDIR)/rogue/g_newai.o \ + $(BUILDDIR)/rogue/g_newdm.o \ + $(BUILDDIR)/rogue/g_newfnc.o \ + $(BUILDDIR)/rogue/g_newtarg.o \ + $(BUILDDIR)/rogue/g_newtrig.o \ + $(BUILDDIR)/rogue/g_newweap.o \ + $(BUILDDIR)/rogue/g_phys.o \ + $(BUILDDIR)/rogue/g_save.o \ + $(BUILDDIR)/rogue/g_spawn.o \ + $(BUILDDIR)/rogue/g_sphere.o \ + $(BUILDDIR)/rogue/g_svcmds.o \ + $(BUILDDIR)/rogue/g_target.o \ + $(BUILDDIR)/rogue/g_trigger.o \ + $(BUILDDIR)/rogue/g_turret.o \ + $(BUILDDIR)/rogue/g_utils.o \ + $(BUILDDIR)/rogue/g_weapon.o \ + $(BUILDDIR)/rogue/m_actor.o \ + $(BUILDDIR)/rogue/m_berserk.o \ + $(BUILDDIR)/rogue/m_boss2.o \ + $(BUILDDIR)/rogue/m_boss3.o \ + $(BUILDDIR)/rogue/m_boss31.o \ + $(BUILDDIR)/rogue/m_boss32.o \ + $(BUILDDIR)/rogue/m_brain.o \ + $(BUILDDIR)/rogue/m_carrier.o \ + $(BUILDDIR)/rogue/m_chick.o \ + $(BUILDDIR)/rogue/m_flash.o \ + $(BUILDDIR)/rogue/m_flipper.o \ + $(BUILDDIR)/rogue/m_float.o \ + $(BUILDDIR)/rogue/m_flyer.o \ + $(BUILDDIR)/rogue/m_gladiator.o \ + $(BUILDDIR)/rogue/m_gunner.o \ + $(BUILDDIR)/rogue/m_hover.o \ + $(BUILDDIR)/rogue/m_infantry.o \ + $(BUILDDIR)/rogue/m_insane.o \ + $(BUILDDIR)/rogue/m_medic.o \ + $(BUILDDIR)/rogue/m_move.o \ + $(BUILDDIR)/rogue/m_mutant.o \ + $(BUILDDIR)/rogue/m_parasite.o \ + $(BUILDDIR)/rogue/m_soldier.o \ + $(BUILDDIR)/rogue/m_stalker.o \ + $(BUILDDIR)/rogue/m_supertank.o \ + $(BUILDDIR)/rogue/m_tank.o \ + $(BUILDDIR)/rogue/m_turret.o \ + $(BUILDDIR)/rogue/m_widow.o \ + $(BUILDDIR)/rogue/m_widow2.o \ + $(BUILDDIR)/rogue/p_client.o \ + $(BUILDDIR)/rogue/p_hud.o \ + $(BUILDDIR)/rogue/p_trail.o \ + $(BUILDDIR)/rogue/p_view.o \ + $(BUILDDIR)/rogue/p_weapon.o \ + $(BUILDDIR)/rogue/q_shared.o + +$(BUILDDIR)/rogue/game$(ARCH).$(SHLIBEXT) : $(ROGUE_OBJS) + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(ROGUE_OBJS) + +$(BUILDDIR)/rogue/dm_ball.o : $(ROGUE_DIR)/dm_ball.c $(DO_SHLIB_CC) +$(BUILDDIR)/rogue/dm_tag.o : $(ROGUE_DIR)/dm_tag.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_ai.o : $(ROGUE_DIR)/g_ai.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_chase.o : $(ROGUE_DIR)/g_chase.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_cmds.o : $(ROGUE_DIR)/g_cmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_combat.o : $(ROGUE_DIR)/g_combat.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_func.o : $(ROGUE_DIR)/g_func.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_items.o : $(ROGUE_DIR)/g_items.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_main.o : $(ROGUE_DIR)/g_main.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_misc.o : $(ROGUE_DIR)/g_misc.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_monster.o : $(ROGUE_DIR)/g_monster.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_newai.o : $(ROGUE_DIR)/g_newai.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_newdm.o : $(ROGUE_DIR)/g_newdm.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_newfnc.o : $(ROGUE_DIR)/g_newfnc.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_newtarg.o : $(ROGUE_DIR)/g_newtarg.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_newtrig.o : $(ROGUE_DIR)/g_newtrig.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_newweap.o : $(ROGUE_DIR)/g_newweap.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_phys.o : $(ROGUE_DIR)/g_phys.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_save.o : $(ROGUE_DIR)/g_save.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_spawn.o : $(ROGUE_DIR)/g_spawn.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_sphere.o : $(ROGUE_DIR)/g_sphere.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_svcmds.o : $(ROGUE_DIR)/g_svcmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_target.o : $(ROGUE_DIR)/g_target.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_trigger.o : $(ROGUE_DIR)/g_trigger.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_turret.o : $(ROGUE_DIR)/g_turret.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_utils.o : $(ROGUE_DIR)/g_utils.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_weapon.o : $(ROGUE_DIR)/g_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_actor.o : $(ROGUE_DIR)/m_actor.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_berserk.o : $(ROGUE_DIR)/m_berserk.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_boss2.o : $(ROGUE_DIR)/m_boss2.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_boss3.o : $(ROGUE_DIR)/m_boss3.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_boss31.o : $(ROGUE_DIR)/m_boss31.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_boss32.o : $(ROGUE_DIR)/m_boss32.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_brain.o : $(ROGUE_DIR)/m_brain.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_carrier.o : $(ROGUE_DIR)/m_carrier.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_chick.o : $(ROGUE_DIR)/m_chick.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_flash.o : $(ROGUE_DIR)/m_flash.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_flipper.o : $(ROGUE_DIR)/m_flipper.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_float.o : $(ROGUE_DIR)/m_float.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_flyer.o : $(ROGUE_DIR)/m_flyer.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_gladiator.o : $(ROGUE_DIR)/m_gladiator.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_gunner.o : $(ROGUE_DIR)/m_gunner.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_hover.o : $(ROGUE_DIR)/m_hover.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_infantry.o : $(ROGUE_DIR)/m_infantry.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_insane.o : $(ROGUE_DIR)/m_insane.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_medic.o : $(ROGUE_DIR)/m_medic.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_move.o : $(ROGUE_DIR)/m_move.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_mutant.o : $(ROGUE_DIR)/m_mutant.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_parasite.o : $(ROGUE_DIR)/m_parasite.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_soldier.o : $(ROGUE_DIR)/m_soldier.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_stalker.o : $(ROGUE_DIR)/m_stalker.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_supertank.o : $(ROGUE_DIR)/m_supertank.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_tank.o : $(ROGUE_DIR)/m_tank.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_turret.o : $(ROGUE_DIR)/m_turret.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_widow.o : $(ROGUE_DIR)/m_widow.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_widow2.o : $(ROGUE_DIR)/m_widow2.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/p_client.o : $(ROGUE_DIR)/p_client.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/p_hud.o : $(ROGUE_DIR)/p_hud.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/p_trail.o : $(ROGUE_DIR)/p_trail.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/p_view.o : $(ROGUE_DIR)/p_view.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/p_weapon.o : $(ROGUE_DIR)/p_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/q_shared.o : $(ROGUE_DIR)/q_shared.c + $(DO_SHLIB_DEBUG_CC) ############################################################################# # REF_SOFT @@ -869,20 +1273,20 @@ REF_SOFT_OBJS = \ $(BUILDDIR)/ref_soft/q_shlinux.o \ $(BUILDDIR)/ref_soft/glob.o -#REF_SOFT_SVGA_OBJS = \ -# $(BUILDDIR)/ref_soft/rw_svgalib.o \ -# $(BUILDDIR)/ref_soft/d_copy.o \ -# $(BUILDDIR)/ref_soft/rw_in_svgalib.o +REF_SOFT_SVGA_OBJS = \ + $(BUILDDIR)/ref_soft/rw_svgalib.o \ + $(BUILDDIR)/ref_soft/d_copy.o \ + $(BUILDDIR)/ref_soft/rw_in_svgalib.o REF_SOFT_X11_OBJS = \ $(BUILDDIR)/ref_soft/rw_x11.o $(BUILDDIR)/ref_soft.$(SHLIBEXT) : $(REF_SOFT_OBJS) $(REF_SOFT_SVGA_OBJS) - $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(REF_SOFT_OBJS) \ + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -Xlinker -Map -Xlinker ref_soft.map -o $@ $(REF_SOFT_OBJS) \ $(REF_SOFT_SVGA_OBJS) $(SVGALDFLAGS) $(BUILDDIR)/ref_softx.$(SHLIBEXT) : $(REF_SOFT_OBJS) $(REF_SOFT_X11_OBJS) - $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(REF_SOFT_OBJS) \ + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -Xlinker -Map -Xlinker ref_softx.map -o $@ $(REF_SOFT_OBJS) \ $(REF_SOFT_X11_OBJS) $(XLDFLAGS) $(BUILDDIR)/ref_soft/r_aclip.o : $(REF_SOFT_DIR)/r_aclip.c @@ -1006,13 +1410,28 @@ REF_GL_OBJS = \ $(BUILDDIR)/ref_gl/gl_warp.o \ \ $(BUILDDIR)/ref_gl/qgl_linux.o \ - $(BUILDDIR)/ref_gl/gl_glx.o \ $(BUILDDIR)/ref_gl/q_shared.o \ $(BUILDDIR)/ref_gl/q_shlinux.o \ $(BUILDDIR)/ref_gl/glob.o -$(BUILDDIR)/ref_gl.$(SHLIBEXT) : $(REF_GL_OBJS) - $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(REF_GL_OBJS) $(GLLDFLAGS) +# TTimo: taking out Mesa +ifeq ($(DOFXMESA),1) +REF_GL_FXMESA_OBJS = \ + $(BUILDDIR)/ref_gl/gl_fxmesa.o \ + $(BUILDDIR)/ref_gl/rw_in_svgalib.o +else +REF_GL_FXMESA_OBJS = \ + $(BUILDDIR)/ref_gl/rw_in_svgalib.o +endif + +REF_GL_GLX_OBJS = \ + $(BUILDDIR)/ref_gl/gl_glx.o + +$(BUILDDIR)/ref_gl.$(SHLIBEXT) : $(REF_GL_OBJS) $(REF_GL_FXMESA_OBJS) + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(REF_GL_OBJS) $(REF_GL_FXMESA_OBJS) $(GLLDFLAGS) + +$(BUILDDIR)/ref_glx.$(SHLIBEXT) : $(REF_GL_OBJS) $(REF_GL_GLX_OBJS) + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(REF_GL_OBJS) $(REF_GL_GLX_OBJS) $(GLXLDFLAGS) $(BUILDDIR)/ref_gl/gl_draw.o : $(REF_GL_DIR)/gl_draw.c $(DO_GL_SHLIB_CC) @@ -1044,6 +1463,9 @@ $(BUILDDIR)/ref_gl/gl_warp.o : $(REF_GL_DIR)/gl_warp.c $(BUILDDIR)/ref_gl/qgl_linux.o : $(LINUX_DIR)/qgl_linux.c $(DO_GL_SHLIB_CC) +$(BUILDDIR)/ref_gl/gl_fxmesa.o : $(LINUX_DIR)/gl_fxmesa.c + $(DO_GL_SHLIB_CC) + $(BUILDDIR)/ref_gl/gl_glx.o : $(LINUX_DIR)/gl_glx.c $(DO_GL_SHLIB_CC) @@ -1074,12 +1496,15 @@ clean-release: clean2: -rm -f \ $(QUAKE2_OBJS) \ + $(Q2DED_OBJS) \ $(QUAKE2_AS_OBJS) \ $(GAME_OBJS) \ $(CTF_OBJS) \ $(XATRIX_OBJS) \ + $(ROGUE_OBJS) \ $(REF_SOFT_OBJS) \ $(REF_SOFT_SVGA_OBJS) \ $(REF_SOFT_X11_OBJS) \ - $(REF_GL_OBJS) - + $(REF_GL_OBJS) \ + $(REF_GL_FXMESA_OBJS) \ + $(REF_GL_GLX_OBJS) diff --git a/linux/cd_linux.c b/linux/cd_linux.c index 9c461fc..875b3db 100644 --- a/linux/cd_linux.c +++ b/linux/cd_linux.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ // Quake is a trademark of Id Software, Inc., (c) 1996 Id Software, Inc. All // rights reserved. diff --git a/linux/d_ifacea.h b/linux/d_ifacea.h index 220e9a8..f15c8cd 100644 --- a/linux/d_ifacea.h +++ b/linux/d_ifacea.h @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ // // d_ifacea.h // diff --git a/linux/gl_fxmesa.c b/linux/gl_fxmesa.c index 205ce7e..54ad87e 100644 --- a/linux/gl_fxmesa.c +++ b/linux/gl_fxmesa.c @@ -1,4 +1,23 @@ /* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +/* ** GLW_IMP.C ** ** This file contains ALL Linux specific stuff having to do with the @@ -24,10 +43,14 @@ #include "../client/keys.h" #include "../linux/rw_linux.h" +#include "../linux/glw_linux.h" + #include /*****************************************************************************/ +glwstate_t glw_state; + static qboolean GLimp_SwitchFullscreen( int width, int height ); qboolean GLimp_InitGL (void); @@ -36,12 +59,25 @@ extern cvar_t *vid_ref; static fxMesaContext fc = NULL; -#define NUM_RESOLUTIONS 3 +#define NUM_RESOLUTIONS 16 static resolutions[NUM_RESOLUTIONS][3]={ - { 512, 384, GR_RESOLUTION_512x384 }, - { 640, 400, GR_RESOLUTION_640x400 }, - { 640, 480, GR_RESOLUTION_640x480 } + { 320,200, GR_RESOLUTION_320x200 }, + { 320,240, GR_RESOLUTION_320x240 }, + { 400,256, GR_RESOLUTION_400x256 }, + { 400,300, GR_RESOLUTION_400x300 }, + { 512,384, GR_RESOLUTION_512x384 }, + { 640,200, GR_RESOLUTION_640x200 }, + { 640,350, GR_RESOLUTION_640x350 }, + { 640,400, GR_RESOLUTION_640x400 }, + { 640,480, GR_RESOLUTION_640x480 }, + { 800,600, GR_RESOLUTION_800x600 }, + { 960,720, GR_RESOLUTION_960x720 }, + { 856,480, GR_RESOLUTION_856x480 }, + { 512,256, GR_RESOLUTION_512x256 }, + { 1024,768, GR_RESOLUTION_1024x768 }, + { 1280,1024,GR_RESOLUTION_1280x1024 }, + { 1600,1200,GR_RESOLUTION_1600x1200 } }; static int findres(int *width, int *height) @@ -111,7 +147,7 @@ int GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen ) attribs[4] = 1; attribs[5] = FXMESA_NONE; - fc = fxMesaCreateContext(0, findres(&width, &height), GR_REFRESH_75Hz, + fc = qfxMesaCreateContext(0, findres(&width, &height), GR_REFRESH_75Hz, attribs); if (!fc) return rserr_invalid_mode; @@ -122,7 +158,7 @@ int GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen ) // let the sound and input subsystems know about the new window ri.Vid_NewWindow (width, height); - fxMesaMakeCurrent(fc); + qfxMesaMakeCurrent(fc); return rserr_ok; } @@ -139,7 +175,7 @@ int GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen ) void GLimp_Shutdown( void ) { if (fc) { - fxMesaDestroyContext(fc); + qfxMesaDestroyContext(fc); fc = NULL; } } @@ -173,8 +209,8 @@ void GLimp_BeginFrame( float camera_seperation ) */ void GLimp_EndFrame (void) { - glFlush(); - fxMesaSwapBuffers(); + qglFlush(); + qfxMesaSwapBuffers(); } /* @@ -184,8 +220,6 @@ void GLimp_AppActivate( qboolean active ) { } -extern void gl3DfxSetPaletteEXT(GLuint *pal); - void Fake_glColorTableEXT( GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table ) @@ -200,7 +234,7 @@ void Fake_glColorTableEXT( GLenum target, GLenum internalformat, temptable[i][0] = *intbl++; temptable[i][3] = 255; } - gl3DfxSetPaletteEXT((GLuint *)temptable); + qglEnable( GL_SHARED_TEXTURE_PALETTE_EXT ); + qgl3DfxSetPaletteEXT((GLuint *)temptable); } - diff --git a/linux/gl_glx.c b/linux/gl_glx.c index 6b78526..2c021d7 100644 --- a/linux/gl_glx.c +++ b/linux/gl_glx.c @@ -1,4 +1,23 @@ /* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +/* ** GLW_IMP.C ** ** This file contains ALL Linux specific stuff having to do with the @@ -12,91 +31,40 @@ ** */ +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include "../ref_gl/gl_local.h" + +#include "../client/keys.h" + +#include "../linux/rw_linux.h" +#include "../linux/glw_linux.h" #include -#include "../ref_gl/gl_local.h" -#include "../client/keys.h" -#include "../linux/rw_linux.h" +#include +#include -GLXContext gl_cx; +#include +#include -static qboolean doShm; -static Display *x_disp; -static Colormap x_cmap; -static Window x_win; -static GC x_gc; -static Visual *x_vis; -static XVisualInfo *x_visinfo; +glwstate_t glw_state; -static int StudlyRGBattributes[] = -{ - GLX_DOUBLEBUFFER, - GLX_RGBA, - GLX_RED_SIZE, 4, - GLX_GREEN_SIZE, 4, - GLX_BLUE_SIZE, 4, - GLX_DEPTH_SIZE, 1, -// GLX_SAMPLES_SGIS, 4, /* for better AA */ - None, -}; +static Display *dpy = NULL; +static int scrnum; +static Window win; +static GLXContext ctx = NULL; -static int RGBattributes[] = -{ - GLX_DOUBLEBUFFER, - GLX_RGBA, - GLX_RED_SIZE, 4, - GLX_GREEN_SIZE, 4, - GLX_BLUE_SIZE, 4, - GLX_DEPTH_SIZE, 1, - None, -}; - -#define STD_EVENT_MASK (StructureNotifyMask | KeyPressMask \ - | KeyReleaseMask | ExposureMask | PointerMotionMask | \ - ButtonPressMask | ButtonReleaseMask) - -int current_framebuffer; -static int x_shmeventtype; -//static XShmSegmentInfo x_shminfo; - -static qboolean oktodraw = false; -static qboolean X11_active = false; - -struct -{ - int key; - int down; -} keyq[64]; -int keyq_head=0; -int keyq_tail=0; - -static int mx, my; -static int p_mouse_x, p_mouse_y; -static cvar_t *_windowed_mouse; - -static cvar_t *sensitivity; -static cvar_t *lookstrafe; -static cvar_t *m_side; -static cvar_t *m_yaw; -static cvar_t *m_pitch; -static cvar_t *m_forward; -static cvar_t *freelook; - -int config_notify=0; -int config_notify_width; -int config_notify_height; - -typedef unsigned short PIXEL; - -// Console variables that we need to access from this module +#define KEY_MASK (KeyPressMask | KeyReleaseMask) +#define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | \ + PointerMotionMask | ButtonMotionMask ) +#define X_MASK (KEY_MASK | MOUSE_MASK | VisibilityChangeMask | StructureNotifyMask ) /*****************************************************************************/ /* MOUSE */ @@ -105,149 +73,38 @@ typedef unsigned short PIXEL; // this is inside the renderer shared lib, so these are called from vid_so static qboolean mouse_avail; -static int mouse_buttonstate; -static int mouse_oldbuttonstate; -static int mouse_x, mouse_y; +static int mx, my; static int old_mouse_x, old_mouse_y; -static float old_windowed_mouse; -static int p_mouse_x, p_mouse_y; -static cvar_t *_windowed_mouse; +static int win_x, win_y; + static cvar_t *m_filter; static cvar_t *in_mouse; +static cvar_t *in_dgamouse; + +static cvar_t *r_fakeFullscreen; + +static XF86VidModeModeInfo **vidmodes; +static int default_dotclock_vidmode; +static int num_vidmodes; +static qboolean vidmode_active = false; static qboolean mlooking; +static qboolean mouse_active = false; +static qboolean dgamouse = false; +static qboolean vidmode_ext = false; + // state struct passed in Init static in_state_t *in_state; -int XShmQueryExtension(Display *); -int XShmGetEventBase(Display *); - -static void signal_handler(int sig) -{ - fprintf(stderr, "Received signal %d, exiting...\n", sig); - GLimp_Shutdown(); - _exit(0); -} - -static void InitSig(void) -{ - struct sigaction sa; - sigaction(SIGINT, 0, &sa); - sa.sa_handler = signal_handler; - sigaction(SIGINT, &sa, 0); - sigaction(SIGTERM, &sa, 0); -} - -qboolean GLimp_InitGraphics( qboolean fullscreen ); - -/* -** GLimp_SetMode -*/ -int GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen ) -{ - int width, height; - GLint attribs[32]; - - fprintf(stderr, "GLimp_SetMode\n"); - - ri.Con_Printf( PRINT_ALL, "Initializing OpenGL display\n"); - - ri.Con_Printf (PRINT_ALL, "...setting mode %d:", mode ); - - if ( !ri.Vid_GetModeInfo( &width, &height, mode ) ) - { - ri.Con_Printf( PRINT_ALL, " invalid mode\n" ); - return rserr_invalid_mode; - } - - ri.Con_Printf( PRINT_ALL, " %d %d\n", width, height ); - - // destroy the existing window - GLimp_Shutdown (); - - *pwidth = width; - *pheight = height; - - if ( !GLimp_InitGraphics( fullscreen ) ) { - // failed to set a valid mode in windowed mode - return rserr_invalid_mode; - } -/* gl_cx = glXCreateContext( x_disp, x_visinfo, 0, True ); */ - - // let the sound and input subsystems know about the new window - ri.Vid_NewWindow (width, height); - - return rserr_ok; -} - -/* -** GLimp_Shutdown -** -** This routine does all OS specific shutdown procedures for the OpenGL -** subsystem. Under OpenGL this means NULLing out the current DC and -** HGLRC, deleting the rendering context, and releasing the DC acquired -** for the window. The state structure is also nulled out. -** -*/ -void GLimp_Shutdown( void ) -{ - fprintf(stderr, "GLimp_Shutdown\n"); - - if (!x_disp) - return; - - XSynchronize( x_disp, True ); - XAutoRepeatOn(x_disp); - XCloseDisplay(x_disp); - x_disp = NULL; -} - -/* -** GLimp_Init -** -** This routine is responsible for initializing the OS specific portions -** of OpenGL. -*/ -int GLimp_Init( void *hinstance, void *wndproc ) -{ -// catch signals so i can turn on auto-repeat and stuff - InitSig(); - - return true; -} - -/* -** GLimp_BeginFrame -*/ -void GLimp_BeginFrame( float camera_seperation ) -{ -} - -/* -** GLimp_EndFrame -** -** Responsible for doing a swapbuffers and possibly for other stuff -** as yet to be determined. Probably better not to make this a GLimp -** function and instead do a call to GLimp_SwapBuffers. -*/ -void GLimp_EndFrame (void) -{ - glFlush(); - glXSwapBuffers( x_disp, x_win ); -} - -/* -** GLimp_AppActivate -*/ -void GLimp_AppActivate( qboolean active ) -{ -} - -// ======================================================================== -// makes a null cursor -// ======================================================================== +static cvar_t *sensitivity; +static cvar_t *lookstrafe; +static cvar_t *m_side; +static cvar_t *m_yaw; +static cvar_t *m_pitch; +static cvar_t *m_forward; +static cvar_t *freelook; static Cursor CreateNullCursor(Display *display, Window root) { @@ -271,257 +128,207 @@ static Cursor CreateNullCursor(Display *display, Window root) return cursor; } -/* -** GLimp_InitGraphics -** -** This initializes the GL implementation specific -** graphics subsystem. -** -** The necessary width and height parameters are grabbed from -** vid.width and vid.height. -*/ -qboolean GLimp_InitGraphics( qboolean fullscreen ) +static void install_grabs(void) { - int pnum, i; - XVisualInfo template; - int num_visuals; - int template_mask; - - fprintf(stderr, "GLimp_InitGraphics\n"); - - srandom(getpid()); - - // let the sound and input subsystems know about the new window - ri.Vid_NewWindow (vid.width, vid.height); - - // open the display - x_disp = XOpenDisplay(NULL); - if (!x_disp) - { - if (getenv("DISPLAY")) - Sys_Error("VID: Could not open display [%s]\n", - getenv("DISPLAY")); - else - Sys_Error("VID: Could not open local display\n"); - } - else - fprintf(stderr, "VID: Opened display %s\n", getenv("DISPLAY")); - - XAutoRepeatOff(x_disp); - -// for debugging only - XSynchronize(x_disp, True); - -// check for command-line window size - template_mask = 0; - -#if 0 -// specify a visual id - if ((pnum=COM_CheckParm("-visualid"))) - { - if (pnum >= com_argc-1) - Sys_Error("VID: -visualid \n"); - template.visualid = Q_atoi(com_argv[pnum+1]); - template_mask = VisualIDMask; - } - -// If not specified, use default visual - else -#endif - { - int screen; - screen = XDefaultScreen(x_disp); - template.visualid = - XVisualIDFromVisual(XDefaultVisual(x_disp, screen)); - template_mask = VisualIDMask; - } - -// pick a visual- warn if more than one was available - - x_visinfo = glXChooseVisual( x_disp, DefaultScreen( x_disp ), - StudlyRGBattributes ); - if (!x_visinfo) - { - fprintf(stderr, "Using non studly RGB attributes\n"); - x_visinfo = glXChooseVisual( x_disp, DefaultScreen( x_disp ), - RGBattributes ); - if (!x_visinfo) Sys_Error( "No matching visual available!\n" ); - } - - ri.Con_Printf(PRINT_ALL, "Using visualid 0x%x:\n", - (int)(x_visinfo->visualid)); -#if 0 - if (verbose) - { - printf("Using visualid %d:\n", (int)(x_visinfo->visualid)); - printf(" screen %d\n", x_visinfo->screen); - printf(" red_mask 0x%x\n", (int)(x_visinfo->red_mask)); - printf(" green_mask 0x%x\n", (int)(x_visinfo->green_mask)); - printf(" blue_mask 0x%x\n", (int)(x_visinfo->blue_mask)); - printf(" colormap_size %d\n", x_visinfo->colormap_size); - printf(" bits_per_rgb %d\n", x_visinfo->bits_per_rgb); - } -#endif - - x_vis = x_visinfo->visual; - -// setup attributes for main window - { - int attribmask = CWEventMask | CWColormap | CWBorderPixel; - XSetWindowAttributes attribs; - Colormap tmpcmap; - - Window root_win = XRootWindow(x_disp, x_visinfo->screen); - - tmpcmap = XCreateColormap(x_disp, root_win, x_vis, AllocNone); - - - attribs.event_mask = STD_EVENT_MASK; - attribs.border_pixel = 0; - attribs.colormap = tmpcmap; - -// create the main window - x_win = XCreateWindow( x_disp, - root_win, - 0, 0, // x, y - vid.width, vid.height, - 0, // borderwidth - x_visinfo->depth, - InputOutput, - x_vis, - attribmask, - &attribs ); - XStoreName(x_disp, x_win, "Quake II"); - - if (x_visinfo->class != TrueColor) - XFreeColormap(x_disp, tmpcmap); - } - - if (x_visinfo->depth == 8) - { - // create and upload the palette - if (x_visinfo->class == PseudoColor) - { - x_cmap = XCreateColormap(x_disp, x_win, x_vis, AllocAll); - XSetWindowColormap(x_disp, x_win, x_cmap); - } - - } // inviso cursor - XDefineCursor(x_disp, x_win, CreateNullCursor(x_disp, x_win)); + XDefineCursor(dpy, win, CreateNullCursor(dpy, win)); -// create the GC - { - XGCValues xgcvalues; - int valuemask = GCGraphicsExposures; - xgcvalues.graphics_exposures = False; - x_gc = XCreateGC(x_disp, x_win, valuemask, &xgcvalues ); - } + XGrabPointer(dpy, win, + True, + 0, + GrabModeAsync, GrabModeAsync, + win, + None, + CurrentTime); -// set window properties for full screen - if (fullscreen) { -// MotifWmHints wmhints; - Atom aHints; - XSizeHints sizehints; - XWindowChanges changes; + if (in_dgamouse->value) { + int MajorVersion, MinorVersion; - aHints = XInternAtom( x_disp, "_MOTIF_WM_HINTS", 0 ); - if (aHints == None) - { - ri.Con_Printf( PRINT_ALL, "Could not intern X atom for _MOTIF_WM_HINTS." ); -/* return( false ); */ - } - else { -#if 0 - wmhints.flags = MWM_HINTS_DECORATIONS; - wmhints.decorations = 0; // Absolutely no decorations. - XChangeProperty(x_disp, x_win, aHints, aHints, 32, - PropModeReplace, (unsigned char *)&wmhints, - 4 ); -#endif - - sizehints.flags = USPosition | USSize; - sizehints.x = 0; - sizehints.y = 0; - sizehints.width = vid.width; - sizehints.height = vid.height; - XSetWMNormalHints( x_disp, x_win, &sizehints ); - - changes.x = 0; - changes.y = 0; - changes.width = vid.width; - changes.height = vid.height; - changes.stack_mode = TopIf; - XConfigureWindow(x_disp, x_win, - CWX | CWY | CWWidth | CWHeight | CWStackMode, - &changes); - } - } - -// map the window - XMapWindow(x_disp, x_win); - -// wait for first exposure event - { - XEvent event; - do - { - XNextEvent(x_disp, &event); - if (event.type == Expose && !event.xexpose.count) - oktodraw = true; - } while (!oktodraw); - } -// now safe to draw - - gl_cx = glXCreateContext( x_disp, x_visinfo, 0, True ); - if (!glXMakeCurrent( x_disp, x_win, gl_cx )) - Sys_Error( "Can't make window current to context\n" ); - -// even if MITSHM is available, make sure it's a local connection -#if 0 -// This is messing up the DISPLAY environment variable so can't close and -// reopen the window (it lops off the :0.0)... - if (XShmQueryExtension(x_disp)) - { - char *displayname; - doShm = true; - displayname = (char *) getenv("DISPLAY"); - if (displayname) - { - char *d = displayname; - while (*d && (*d != ':')) d++; - if (*d) *d = 0; - if (!(!strcasecmp(displayname, "unix") || !*displayname)) - doShm = false; + if (!XF86DGAQueryVersion(dpy, &MajorVersion, &MinorVersion)) { + // unable to query, probalby not supported + ri.Con_Printf( PRINT_ALL, "Failed to detect XF86DGA Mouse\n" ); + ri.Cvar_Set( "in_dgamouse", "0" ); + } else { + dgamouse = true; + XF86DGADirectVideo(dpy, DefaultScreen(dpy), XF86DGADirectMouse); + XWarpPointer(dpy, None, win, 0, 0, 0, 0, 0, 0); } + } else { + XWarpPointer(dpy, None, win, + 0, 0, 0, 0, + vid.width / 2, vid.height / 2); } -#endif -#if 0 - if (doShm) + XGrabKeyboard(dpy, win, + False, + GrabModeAsync, GrabModeAsync, + CurrentTime); + + mouse_active = true; + +// XSync(dpy, True); +} + +static void uninstall_grabs(void) +{ + if (!dpy || !win) + return; + + if (dgamouse) { + dgamouse = false; + XF86DGADirectVideo(dpy, DefaultScreen(dpy), 0); + } + + XUngrabPointer(dpy, CurrentTime); + XUngrabKeyboard(dpy, CurrentTime); + +// inviso cursor + XUndefineCursor(dpy, win); + + mouse_active = false; +} + +static void Force_CenterView_f (void) +{ + in_state->viewangles[PITCH] = 0; +} + +static void RW_IN_MLookDown (void) +{ + mlooking = true; +} + +static void RW_IN_MLookUp (void) +{ + mlooking = false; + in_state->IN_CenterView_fp (); +} + +void RW_IN_Init(in_state_t *in_state_p) +{ + int mtype; + int i; + + in_state = in_state_p; + + // mouse variables + m_filter = ri.Cvar_Get ("m_filter", "0", 0); + in_mouse = ri.Cvar_Get ("in_mouse", "1", CVAR_ARCHIVE); + in_dgamouse = ri.Cvar_Get ("in_dgamouse", "1", CVAR_ARCHIVE); + freelook = ri.Cvar_Get( "freelook", "0", 0 ); + lookstrafe = ri.Cvar_Get ("lookstrafe", "0", 0); + sensitivity = ri.Cvar_Get ("sensitivity", "3", 0); + m_pitch = ri.Cvar_Get ("m_pitch", "0.022", 0); + m_yaw = ri.Cvar_Get ("m_yaw", "0.022", 0); + m_forward = ri.Cvar_Get ("m_forward", "1", 0); + m_side = ri.Cvar_Get ("m_side", "0.8", 0); + + ri.Cmd_AddCommand ("+mlook", RW_IN_MLookDown); + ri.Cmd_AddCommand ("-mlook", RW_IN_MLookUp); + + ri.Cmd_AddCommand ("force_centerview", Force_CenterView_f); + + mx = my = 0.0; + mouse_avail = true; +} + +void RW_IN_Shutdown(void) +{ + mouse_avail = false; +} + +/* +=========== +IN_Commands +=========== +*/ +void RW_IN_Commands (void) +{ +} + +/* +=========== +IN_Move +=========== +*/ +void RW_IN_Move (usercmd_t *cmd) +{ + if (!mouse_avail) + return; + + if (m_filter->value) { - x_shmeventtype = XShmGetEventBase(x_disp) + ShmCompletion; - ResetSharedFrameBuffers(); + mx = (mx + old_mouse_x) * 0.5; + my = (my + old_mouse_y) * 0.5; + } + + old_mouse_x = mx; + old_mouse_y = my; + + mx *= sensitivity->value; + my *= sensitivity->value; + +// add mouse X/Y movement to cmd + if ( (*in_state->in_strafe_state & 1) || + (lookstrafe->value && mlooking )) + cmd->sidemove += m_side->value * mx; + else + in_state->viewangles[YAW] -= m_yaw->value * mx; + + if ( (mlooking || freelook->value) && + !(*in_state->in_strafe_state & 1)) + { + in_state->viewangles[PITCH] += m_pitch->value * my; } else - ResetFrameBuffer(); -#endif + { + cmd->forwardmove -= m_forward->value * my; + } - current_framebuffer = 0; -/* vid.rowbytes = x_framebuffer[0]->bytes_per_line; */ -/* vid.buffer = x_framebuffer[0]->data; */ + mx = my = 0; +} -// XSynchronize(x_disp, False); +static void IN_DeactivateMouse( void ) +{ + if (!mouse_avail || !dpy || !win) + return; - X11_active = true; + if (mouse_active) { + uninstall_grabs(); + mouse_active = false; + } +} - return true; +static void IN_ActivateMouse( void ) +{ + if (!mouse_avail || !dpy || !win) + return; + + if (!mouse_active) { + mx = my = 0; // don't spazz + install_grabs(); + mouse_active = true; + } +} + +void RW_IN_Frame (void) +{ +} + +void RW_IN_Activate(qboolean active) +{ + if (active || vidmode_active) + IN_ActivateMouse(); + else + IN_DeactivateMouse (); } +/*****************************************************************************/ +/* KEYBOARD */ /*****************************************************************************/ -int XLateKey(XKeyEvent *ev) +static int XLateKey(XKeyEvent *ev) { int key; @@ -651,280 +458,379 @@ int XLateKey(XKeyEvent *ev) return key; } -void GetEvent(void) + +static void HandleEvents(void) { - XEvent x_event; + XEvent event; int b; + qboolean dowarp = false; + int mwx = vid.width/2; + int mwy = vid.height/2; - XNextEvent(x_disp, &x_event); - switch(x_event.type) { - case KeyPress: - keyq[keyq_head].key = XLateKey(&x_event.xkey); - keyq[keyq_head].down = true; - keyq_head = (keyq_head + 1) & 63; - break; - case KeyRelease: - keyq[keyq_head].key = XLateKey(&x_event.xkey); - keyq[keyq_head].down = false; - keyq_head = (keyq_head + 1) & 63; - break; + if (!dpy) + return; - case MotionNotify: - if (_windowed_mouse->value) { - mx += ((int)x_event.xmotion.x - (int)(vid.width/2)); - my += ((int)x_event.xmotion.y - (int)(vid.height/2)); + while (XPending(dpy)) { - /* move the mouse to the window center again */ - XSelectInput(x_disp,x_win, STD_EVENT_MASK & ~PointerMotionMask); - XWarpPointer(x_disp,None,x_win,0,0,0,0, - (vid.width/2),(vid.height/2)); - XSelectInput(x_disp,x_win, STD_EVENT_MASK); - } else { - mx = ((int)x_event.xmotion.x - (int)p_mouse_x); - my = ((int)x_event.xmotion.y - (int)p_mouse_y); - p_mouse_x=x_event.xmotion.x; - p_mouse_y=x_event.xmotion.y; + XNextEvent(dpy, &event); + + switch(event.type) { + case KeyPress: + case KeyRelease: + if (in_state && in_state->Key_Event_fp) + in_state->Key_Event_fp (XLateKey(&event.xkey), event.type == KeyPress); + break; + + case MotionNotify: + if (mouse_active) { + if (dgamouse) { + mx += (event.xmotion.x + win_x) * 2; + my += (event.xmotion.y + win_y) * 2; + } + else + { + mx += ((int)event.xmotion.x - mwx) * 2; + my += ((int)event.xmotion.y - mwy) * 2; + mwx = event.xmotion.x; + mwy = event.xmotion.y; + + if (mx || my) + dowarp = true; + } + } + break; + + + case ButtonPress: + b=-1; + if (event.xbutton.button == 1) + b = 0; + else if (event.xbutton.button == 2) + b = 2; + else if (event.xbutton.button == 3) + b = 1; + if (b>=0 && in_state && in_state->Key_Event_fp) + in_state->Key_Event_fp (K_MOUSE1 + b, true); + break; + + case ButtonRelease: + b=-1; + if (event.xbutton.button == 1) + b = 0; + else if (event.xbutton.button == 2) + b = 2; + else if (event.xbutton.button == 3) + b = 1; + if (b>=0 && in_state && in_state->Key_Event_fp) + in_state->Key_Event_fp (K_MOUSE1 + b, false); + break; + + case CreateNotify : + win_x = event.xcreatewindow.x; + win_y = event.xcreatewindow.y; + break; + + case ConfigureNotify : + win_x = event.xconfigure.x; + win_y = event.xconfigure.y; + break; } - break; - - case ButtonPress: - b=-1; - if (x_event.xbutton.button == 1) - b = 0; - else if (x_event.xbutton.button == 2) - b = 2; - else if (x_event.xbutton.button == 3) - b = 1; - if (b>=0) - mouse_buttonstate |= 1<=0) - mouse_buttonstate &= ~(1<value) { - old_windowed_mouse = _windowed_mouse->value; - - if (!_windowed_mouse->value) { - /* ungrab the pointer */ - XUngrabPointer(x_disp,CurrentTime); - } else { - /* grab the pointer */ - XGrabPointer(x_disp,x_win,True,0,GrabModeAsync, - GrabModeAsync,x_win,None,CurrentTime); - } + + if (dowarp) { + /* move the mouse to the window center again */ + XWarpPointer(dpy,None,win,0,0,0,0, vid.width/2,vid.height/2); } } -/*****************************************************************************/ - -/*****************************************************************************/ -/* KEYBOARD */ -/*****************************************************************************/ - Key_Event_fp_t Key_Event_fp; void KBD_Init(Key_Event_fp_t fp) { - _windowed_mouse = ri.Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE); Key_Event_fp = fp; } void KBD_Update(void) { // get events from x server - if (x_disp) - { - while (XPending(x_disp)) - GetEvent(); - while (keyq_head != keyq_tail) - { - Key_Event_fp(keyq[keyq_tail].key, keyq[keyq_tail].down); - keyq_tail = (keyq_tail + 1) & 63; - } - } + HandleEvents(); } void KBD_Close(void) { } +/*****************************************************************************/ -static void Force_CenterView_f (void) +static qboolean GLimp_SwitchFullscreen( int width, int height ); +qboolean GLimp_InitGL (void); + +static void signal_handler(int sig) { - in_state->viewangles[PITCH] = 0; + printf("Received signal %d, exiting...\n", sig); + GLimp_Shutdown(); + _exit(0); } -static void RW_IN_MLookDown (void) -{ - mlooking = true; -} - -static void RW_IN_MLookUp (void) +static void InitSig(void) { - mlooking = false; - in_state->IN_CenterView_fp (); -} - -void RW_IN_Init(in_state_t *in_state_p) -{ - int mtype; - int i; - - fprintf(stderr, "GL RW_IN_Init\n"); - - in_state = in_state_p; - - // mouse variables - _windowed_mouse = ri.Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE); - m_filter = ri.Cvar_Get ("m_filter", "0", 0); - in_mouse = ri.Cvar_Get ("in_mouse", "1", CVAR_ARCHIVE); - freelook = ri.Cvar_Get( "freelook", "0", 0 ); - lookstrafe = ri.Cvar_Get ("lookstrafe", "0", 0); - sensitivity = ri.Cvar_Get ("sensitivity", "3", 0); - m_pitch = ri.Cvar_Get ("m_pitch", "0.022", 0); - m_yaw = ri.Cvar_Get ("m_yaw", "0.022", 0); - m_forward = ri.Cvar_Get ("m_forward", "1", 0); - m_side = ri.Cvar_Get ("m_side", "0.8", 0); - - ri.Cmd_AddCommand ("+mlook", RW_IN_MLookDown); - ri.Cmd_AddCommand ("-mlook", RW_IN_MLookUp); - - ri.Cmd_AddCommand ("force_centerview", Force_CenterView_f); - - mouse_x = mouse_y = 0.0; - mouse_avail = true; -} - -void RW_IN_Shutdown(void) -{ - mouse_avail = false; - - ri.Cmd_RemoveCommand ("force_centerview"); - ri.Cmd_RemoveCommand ("+mlook"); - ri.Cmd_RemoveCommand ("-mlook"); + signal(SIGHUP, signal_handler); + signal(SIGQUIT, signal_handler); + signal(SIGILL, signal_handler); + signal(SIGTRAP, signal_handler); + signal(SIGIOT, signal_handler); + signal(SIGBUS, signal_handler); + signal(SIGFPE, signal_handler); + signal(SIGSEGV, signal_handler); + signal(SIGTERM, signal_handler); } /* -=========== -IN_Commands -=========== +** GLimp_SetMode */ -void RW_IN_Commands (void) +int GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen ) { + int width, height; + int attrib[] = { + GLX_RGBA, + GLX_RED_SIZE, 1, + GLX_GREEN_SIZE, 1, + GLX_BLUE_SIZE, 1, + GLX_DOUBLEBUFFER, + GLX_DEPTH_SIZE, 1, + None + }; + Window root; + XVisualInfo *visinfo; + XSetWindowAttributes attr; + unsigned long mask; + int MajorVersion, MinorVersion; + int actualWidth, actualHeight; int i; - - if (!mouse_avail) - return; - - for (i=0 ; i<3 ; i++) { - if ( (mouse_buttonstate & (1<Key_Event_fp (K_MOUSE1 + i, true); - if ( !(mouse_buttonstate & (1<Key_Event_fp (K_MOUSE1 + i, false); - } - mouse_oldbuttonstate = mouse_buttonstate; -} + r_fakeFullscreen = ri.Cvar_Get( "r_fakeFullscreen", "0", CVAR_ARCHIVE); -/* -=========== -IN_Move -=========== -*/ -void RW_IN_Move (usercmd_t *cmd) -{ - if (!mouse_avail) - return; - - if (m_filter->value) + ri.Con_Printf( PRINT_ALL, "Initializing OpenGL display\n"); + + if (fullscreen) + ri.Con_Printf (PRINT_ALL, "...setting fullscreen mode %d:", mode ); + else + ri.Con_Printf (PRINT_ALL, "...setting mode %d:", mode ); + + if ( !ri.Vid_GetModeInfo( &width, &height, mode ) ) { - mouse_x = (mx + old_mouse_x) * 0.5; - mouse_y = (my + old_mouse_y) * 0.5; + ri.Con_Printf( PRINT_ALL, " invalid mode\n" ); + return rserr_invalid_mode; + } + + ri.Con_Printf( PRINT_ALL, " %d %d\n", width, height ); + + // destroy the existing window + GLimp_Shutdown (); + + // Mesa VooDoo hacks + if (fullscreen) + putenv("MESA_GLX_FX=fullscreen"); + else + putenv("MESA_GLX_FX=window"); + + if (!(dpy = XOpenDisplay(NULL))) { + fprintf(stderr, "Error couldn't open the X display\n"); + return rserr_invalid_mode; + } + + scrnum = DefaultScreen(dpy); + root = RootWindow(dpy, scrnum); + + // Get video mode list + MajorVersion = MinorVersion = 0; + if (!XF86VidModeQueryVersion(dpy, &MajorVersion, &MinorVersion)) { + vidmode_ext = false; } else { - mouse_x = mx; - mouse_y = my; + ri.Con_Printf(PRINT_ALL, "Using XFree86-VidModeExtension Version %d.%d\n", + MajorVersion, MinorVersion); + vidmode_ext = true; } - old_mouse_x = mx; - old_mouse_y = my; - - if (!mouse_x && !mouse_y) - return; - - mouse_x *= sensitivity->value; - mouse_y *= sensitivity->value; - -// add mouse X/Y movement to cmd - if ( (*in_state->in_strafe_state & 1) || - (lookstrafe->value && mlooking )) - cmd->sidemove += m_side->value * mouse_x; - else - in_state->viewangles[YAW] -= m_yaw->value * mouse_x; - - if ( (mlooking || freelook->value) && - !(*in_state->in_strafe_state & 1)) - { - in_state->viewangles[PITCH] += m_pitch->value * mouse_y; + visinfo = qglXChooseVisual(dpy, scrnum, attrib); + if (!visinfo) { + fprintf(stderr, "Error couldn't get an RGB, Double-buffered, Depth visual\n"); + return rserr_invalid_mode; } - else - { - cmd->forwardmove -= m_forward->value * mouse_y; + + if (vidmode_ext) { + int best_fit, best_dist, dist, x, y; + + XF86VidModeGetAllModeLines(dpy, scrnum, &num_vidmodes, &vidmodes); + + // Are we going fullscreen? If so, let's change video mode + if (fullscreen && !r_fakeFullscreen->value) { + best_dist = 9999999; + best_fit = -1; + + for (i = 0; i < num_vidmodes; i++) { + if (width > vidmodes[i]->hdisplay || + height > vidmodes[i]->vdisplay) + continue; + + x = width - vidmodes[i]->hdisplay; + y = height - vidmodes[i]->vdisplay; + dist = (x * x) + (y * y); + if (dist < best_dist) { + best_dist = dist; + best_fit = i; + } + } + + if (best_fit != -1) { + actualWidth = vidmodes[best_fit]->hdisplay; + actualHeight = vidmodes[best_fit]->vdisplay; + + // change to the mode + XF86VidModeSwitchToMode(dpy, scrnum, vidmodes[best_fit]); + vidmode_active = true; + + // Move the viewport to top left + XF86VidModeSetViewPort(dpy, scrnum, 0, 0); + } else + fullscreen = 0; + } } - mx = my = 0; + + /* window attributes */ + attr.background_pixel = 0; + attr.border_pixel = 0; + attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone); + attr.event_mask = X_MASK; + if (vidmode_active) { + mask = CWBackPixel | CWColormap | CWSaveUnder | CWBackingStore | + CWEventMask | CWOverrideRedirect; + attr.override_redirect = True; + attr.backing_store = NotUseful; + attr.save_under = False; + } else + mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; + + win = XCreateWindow(dpy, root, 0, 0, width, height, + 0, visinfo->depth, InputOutput, + visinfo->visual, mask, &attr); + XMapWindow(dpy, win); + + if (vidmode_active) { + XMoveWindow(dpy, win, 0, 0); + XRaiseWindow(dpy, win); + XWarpPointer(dpy, None, win, 0, 0, 0, 0, 0, 0); + XFlush(dpy); + // Move the viewport to top left + XF86VidModeSetViewPort(dpy, scrnum, 0, 0); + } + + XFlush(dpy); + + ctx = qglXCreateContext(dpy, visinfo, NULL, True); + + qglXMakeCurrent(dpy, win, ctx); + + *pwidth = width; + *pheight = height; + + // let the sound and input subsystems know about the new window + ri.Vid_NewWindow (width, height); + + qglXMakeCurrent(dpy, win, ctx); + + return rserr_ok; } -void RW_IN_Frame (void) -{ -} - -void RW_IN_Activate(void) -{ -} - - -//=============================================================================== - /* -================ -Sys_MakeCodeWriteable -================ +** GLimp_Shutdown +** +** This routine does all OS specific shutdown procedures for the OpenGL +** subsystem. Under OpenGL this means NULLing out the current DC and +** HGLRC, deleting the rendering context, and releasing the DC acquired +** for the window. The state structure is also nulled out. +** */ -void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length) +void GLimp_Shutdown( void ) { + uninstall_grabs(); + mouse_active = false; + dgamouse = false; - int r; - unsigned long addr; - int psize = getpagesize(); - - addr = (startaddr & ~(psize-1)) - psize; - -// fprintf(stderr, "writable code %lx(%lx)-%lx, length=%lx\n", startaddr, -// addr, startaddr+length, length); - - r = mprotect((char*)addr, length + startaddr - addr + psize, 7); - - if (r < 0) - Sys_Error("Protection change failed\n"); - + if (dpy) { + if (ctx) + qglXDestroyContext(dpy, ctx); + if (win) + XDestroyWindow(dpy, win); + if (vidmode_active) + XF86VidModeSwitchToMode(dpy, scrnum, vidmodes[0]); + XCloseDisplay(dpy); + } + ctx = NULL; + dpy = NULL; + win = 0; + ctx = NULL; } + +/* +** GLimp_Init +** +** This routine is responsible for initializing the OS specific portions +** of OpenGL. +*/ +int GLimp_Init( void *hinstance, void *wndproc ) +{ + InitSig(); + + return true; +} + +/* +** GLimp_BeginFrame +*/ +void GLimp_BeginFrame( float camera_seperation ) +{ +} + +/* +** GLimp_EndFrame +** +** Responsible for doing a swapbuffers and possibly for other stuff +** as yet to be determined. Probably better not to make this a GLimp +** function and instead do a call to GLimp_SwapBuffers. +*/ +void GLimp_EndFrame (void) +{ + qglFlush(); + qglXSwapBuffers(dpy, win); +} + +/* +** GLimp_AppActivate +*/ +void GLimp_AppActivate( qboolean active ) +{ +} + +void Fake_glColorTableEXT( GLenum target, GLenum internalformat, + GLsizei width, GLenum format, GLenum type, + const GLvoid *table ) +{ + byte temptable[256][4]; + byte *intbl; + int i; + + for (intbl = (byte *)table, i = 0; i < 256; i++) { + temptable[i][2] = *intbl++; + temptable[i][1] = *intbl++; + temptable[i][0] = *intbl++; + temptable[i][3] = 255; + } + qgl3DfxSetPaletteEXT((GLuint *)temptable); +} + + +/*------------------------------------------------*/ +/* X11 Input Stuff +/*------------------------------------------------*/ + diff --git a/linux/glob.c b/linux/glob.c index f248b03..43f885e 100644 --- a/linux/glob.c +++ b/linux/glob.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include #include "../linux/glob.h" diff --git a/linux/glob.h b/linux/glob.h index c4a1b43..584540b 100644 --- a/linux/glob.h +++ b/linux/glob.h @@ -1 +1,20 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ int glob_match(char *pattern, char *text); diff --git a/linux/glw_linux.h b/linux/glw_linux.h new file mode 100644 index 0000000..cd04b0e --- /dev/null +++ b/linux/glw_linux.h @@ -0,0 +1,36 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +#ifndef __linux__ +#error You shouldnt be including this file on non-Linux platforms +#endif + +#ifndef __GLW_LINUX_H__ +#define __GLW_LINUX_H__ + +typedef struct +{ + void *OpenGLLib; // instance of OpenGL library + + FILE *log_fp; +} glwstate_t; + +extern glwstate_t glw_state; + +#endif diff --git a/linux/in_linux.c b/linux/in_linux.c index daedff5..b681c76 100644 --- a/linux/in_linux.c +++ b/linux/in_linux.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ // in_null.c -- for systems without a mouse #include "../client/client.h" diff --git a/linux/net_udp.c b/linux/net_udp.c index 358cfe1..ffbc892 100644 --- a/linux/net_udp.c +++ b/linux/net_udp.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ // net_wins.c #include "../qcommon/qcommon.h" @@ -280,13 +299,17 @@ qboolean NET_GetPacket (netsrc_t sock, netadr_t *net_from, sizebuf_t *net_messag fromlen = sizeof(from); ret = recvfrom (net_socket, net_message->data, net_message->maxsize , 0, (struct sockaddr *)&from, &fromlen); + + SockadrToNetadr (&from, net_from); + if (ret == -1) { err = errno; if (err == EWOULDBLOCK || err == ECONNREFUSED) continue; - Com_Printf ("NET_GetPacket: %s", NET_ErrorString()); + Com_Printf ("NET_GetPacket: %s from %s\n", NET_ErrorString(), + NET_AdrToString(*net_from)); continue; } @@ -297,7 +320,6 @@ qboolean NET_GetPacket (netsrc_t sock, netadr_t *net_from, sizebuf_t *net_messag } net_message->cursize = ret; - SockadrToNetadr (&from, net_from); return true; } @@ -350,7 +372,8 @@ void NET_SendPacket (netsrc_t sock, int length, void *data, netadr_t to) ret = sendto (net_socket, data, length, 0, (struct sockaddr *)&addr, sizeof(addr) ); if (ret == -1) { - Com_Printf ("NET_SendPacket ERROR: %i\n", NET_ErrorString()); + Com_Printf ("NET_SendPacket ERROR: %s to %s\n", NET_ErrorString(), + NET_AdrToString (to)); } } @@ -450,7 +473,7 @@ int NET_Socket (char *net_interface, int port) if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { - Com_Printf ("ERROR: UDP_OpenSocket: socket:", NET_ErrorString()); + Com_Printf ("ERROR: UDP_OpenSocket: socket: %s", NET_ErrorString()); return 0; } @@ -468,7 +491,7 @@ int NET_Socket (char *net_interface, int port) return 0; } - if (!net_interface || !net_interface[0] || !strcasecmp(net_interface, "localhost")) + if (!net_interface || !net_interface[0] || !stricmp(net_interface, "localhost")) address.sin_addr.s_addr = INADDR_ANY; else NET_StringToSockaddr (net_interface, (struct sockaddr *)&address); diff --git a/linux/q_shlinux.c b/linux/q_shlinux.c index eeeef72..f2fcd56 100644 --- a/linux/q_shlinux.c +++ b/linux/q_shlinux.c @@ -1,8 +1,27 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include +#include #include #include #include -#include #include #include #include @@ -126,7 +145,12 @@ static qboolean CompareAttributes(char *path, char *name, if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) return false; +#if 1 sprintf(fn, "%s/%s", path, name); +#else + return true; +#endif + if (stat(fn, &st) == -1) return false; // shouldn't happen diff --git a/linux/qasm.h b/linux/qasm.h index 6931bd7..b77610e 100644 --- a/linux/qasm.h +++ b/linux/qasm.h @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #ifndef __ASM_I386__ #define __ASM_I386__ diff --git a/linux/qgl_linux.c b/linux/qgl_linux.c index d545632..61e724c 100644 --- a/linux/qgl_linux.c +++ b/linux/qgl_linux.c @@ -1,4 +1,23 @@ /* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +/* ** QGL_WIN.C ** ** This file implements the operating system binding of GL to QGL function @@ -8,10 +27,34 @@ ** QGL_Init() - loads libraries, assigns function pointers, etc. ** QGL_Shutdown() - unloads libraries, NULLs function pointers */ -#define QGL +#include #include "../ref_gl/gl_local.h" +#include "glw_linux.h" -static FILE *log_fp = NULL; +//#include +#include + +#include + +const char so_file[] = "/etc/quake2.conf"; + +/* +//FX Mesa Functions +fxMesaContext (*qfxMesaCreateContext)(GLuint win, GrScreenResolution_t, GrScreenRefresh_t, const GLint attribList[]); +fxMesaContext (*qfxMesaCreateBestContext)(GLuint win, GLint width, GLint height, const GLint attribList[]); +void (*qfxMesaDestroyContext)(fxMesaContext ctx); +void (*qfxMesaMakeCurrent)(fxMesaContext ctx); +fxMesaContext (*qfxMesaGetCurrentContext)(void); +void (*qfxMesaSwapBuffers)(void); +*/ + +//GLX Functions +XVisualInfo * (*qglXChooseVisual)( Display *dpy, int screen, int *attribList ); +GLXContext (*qglXCreateContext)( Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct ); +void (*qglXDestroyContext)( Display *dpy, GLXContext ctx ); +Bool (*qglXMakeCurrent)( Display *dpy, GLXDrawable drawable, GLXContext ctx); +void (*qglXCopyContext)( Display *dpy, GLXContext src, GLXContext dst, GLuint mask ); +void (*qglXSwapBuffers)( Display *dpy, GLXDrawable drawable ); void ( APIENTRY * qglAccum )(GLenum op, GLfloat value); void ( APIENTRY * qglAlphaFunc )(GLenum func, GLclampf ref); @@ -356,8 +399,11 @@ void ( APIENTRY * qglUnlockArraysEXT) ( void ); void ( APIENTRY * qglPointParameterfEXT)( GLenum param, GLfloat value ); void ( APIENTRY * qglPointParameterfvEXT)( GLenum param, const GLfloat *value ); void ( APIENTRY * qglColorTableEXT)( int, int, int, int, int, const void * ); +void ( APIENTRY * qgl3DfxSetPaletteEXT)( GLuint * ); void ( APIENTRY * qglSelectTextureSGIS)( GLenum ); void ( APIENTRY * qglMTexCoord2fSGIS)( GLenum, GLfloat, GLfloat ); +void ( APIENTRY * qglActiveTextureARB) ( GLenum ); +void ( APIENTRY * qglClientActiveTextureARB) ( GLenum ); static void ( APIENTRY * dllAccum )(GLenum op, GLfloat value); static void ( APIENTRY * dllAlphaFunc )(GLenum func, GLclampf ref); @@ -698,179 +744,179 @@ static void ( APIENTRY * dllViewport )(GLint x, GLint y, GLsizei width, GLsizei static void APIENTRY logAccum(GLenum op, GLfloat value) { - fprintf( log_fp, "glAccum\n" ); + fprintf( glw_state.log_fp, "glAccum\n" ); dllAccum( op, value ); } static void APIENTRY logAlphaFunc(GLenum func, GLclampf ref) { - fprintf( log_fp, "glAlphaFunc( 0x%x, %f )\n", func, ref ); + fprintf( glw_state.log_fp, "glAlphaFunc( 0x%x, %f )\n", func, ref ); dllAlphaFunc( func, ref ); } static GLboolean APIENTRY logAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences) { - fprintf( log_fp, "glAreTexturesResident\n" ); + fprintf( glw_state.log_fp, "glAreTexturesResident\n" ); return dllAreTexturesResident( n, textures, residences ); } static void APIENTRY logArrayElement(GLint i) { - fprintf( log_fp, "glArrayElement\n" ); + fprintf( glw_state.log_fp, "glArrayElement\n" ); dllArrayElement( i ); } static void APIENTRY logBegin(GLenum mode) { - fprintf( log_fp, "glBegin( 0x%x )\n", mode ); + fprintf( glw_state.log_fp, "glBegin( 0x%x )\n", mode ); dllBegin( mode ); } static void APIENTRY logBindTexture(GLenum target, GLuint texture) { - fprintf( log_fp, "glBindTexture( 0x%x, %u )\n", target, texture ); + fprintf( glw_state.log_fp, "glBindTexture( 0x%x, %u )\n", target, texture ); dllBindTexture( target, texture ); } static void APIENTRY logBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap) { - fprintf( log_fp, "glBitmap\n" ); + fprintf( glw_state.log_fp, "glBitmap\n" ); dllBitmap( width, height, xorig, yorig, xmove, ymove, bitmap ); } static void APIENTRY logBlendFunc(GLenum sfactor, GLenum dfactor) { - fprintf( log_fp, "glBlendFunc( 0x%x, 0x%x )\n", sfactor, dfactor ); + fprintf( glw_state.log_fp, "glBlendFunc( 0x%x, 0x%x )\n", sfactor, dfactor ); dllBlendFunc( sfactor, dfactor ); } static void APIENTRY logCallList(GLuint list) { - fprintf( log_fp, "glCallList( %u )\n", list ); + fprintf( glw_state.log_fp, "glCallList( %u )\n", list ); dllCallList( list ); } static void APIENTRY logCallLists(GLsizei n, GLenum type, const void *lists) { - fprintf( log_fp, "glCallLists\n" ); + fprintf( glw_state.log_fp, "glCallLists\n" ); dllCallLists( n, type, lists ); } static void APIENTRY logClear(GLbitfield mask) { - fprintf( log_fp, "glClear\n" ); + fprintf( glw_state.log_fp, "glClear\n" ); dllClear( mask ); } static void APIENTRY logClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { - fprintf( log_fp, "glClearAccum\n" ); + fprintf( glw_state.log_fp, "glClearAccum\n" ); dllClearAccum( red, green, blue, alpha ); } static void APIENTRY logClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { - fprintf( log_fp, "glClearColor\n" ); + fprintf( glw_state.log_fp, "glClearColor\n" ); dllClearColor( red, green, blue, alpha ); } static void APIENTRY logClearDepth(GLclampd depth) { - fprintf( log_fp, "glClearDepth\n" ); + fprintf( glw_state.log_fp, "glClearDepth\n" ); dllClearDepth( depth ); } static void APIENTRY logClearIndex(GLfloat c) { - fprintf( log_fp, "glClearIndex\n" ); + fprintf( glw_state.log_fp, "glClearIndex\n" ); dllClearIndex( c ); } static void APIENTRY logClearStencil(GLint s) { - fprintf( log_fp, "glClearStencil\n" ); + fprintf( glw_state.log_fp, "glClearStencil\n" ); dllClearStencil( s ); } static void APIENTRY logClipPlane(GLenum plane, const GLdouble *equation) { - fprintf( log_fp, "glClipPlane\n" ); + fprintf( glw_state.log_fp, "glClipPlane\n" ); dllClipPlane( plane, equation ); } static void APIENTRY logColor3b(GLbyte red, GLbyte green, GLbyte blue) { - fprintf( log_fp, "glColor3b\n" ); + fprintf( glw_state.log_fp, "glColor3b\n" ); dllColor3b( red, green, blue ); } static void APIENTRY logColor3bv(const GLbyte *v) { - fprintf( log_fp, "glColor3bv\n" ); + fprintf( glw_state.log_fp, "glColor3bv\n" ); dllColor3bv( v ); } static void APIENTRY logColor3d(GLdouble red, GLdouble green, GLdouble blue) { - fprintf( log_fp, "glColor3d\n" ); + fprintf( glw_state.log_fp, "glColor3d\n" ); dllColor3d( red, green, blue ); } static void APIENTRY logColor3dv(const GLdouble *v) { - fprintf( log_fp, "glColor3dv\n" ); + fprintf( glw_state.log_fp, "glColor3dv\n" ); dllColor3dv( v ); } static void APIENTRY logColor3f(GLfloat red, GLfloat green, GLfloat blue) { - fprintf( log_fp, "glColor3f\n" ); + fprintf( glw_state.log_fp, "glColor3f\n" ); dllColor3f( red, green, blue ); } static void APIENTRY logColor3fv(const GLfloat *v) { - fprintf( log_fp, "glColor3fv\n" ); + fprintf( glw_state.log_fp, "glColor3fv\n" ); dllColor3fv( v ); } static void APIENTRY logColor3i(GLint red, GLint green, GLint blue) { - fprintf( log_fp, "glColor3i\n" ); + fprintf( glw_state.log_fp, "glColor3i\n" ); dllColor3i( red, green, blue ); } static void APIENTRY logColor3iv(const GLint *v) { - fprintf( log_fp, "glColor3iv\n" ); + fprintf( glw_state.log_fp, "glColor3iv\n" ); dllColor3iv( v ); } static void APIENTRY logColor3s(GLshort red, GLshort green, GLshort blue) { - fprintf( log_fp, "glColor3s\n" ); + fprintf( glw_state.log_fp, "glColor3s\n" ); dllColor3s( red, green, blue ); } static void APIENTRY logColor3sv(const GLshort *v) { - fprintf( log_fp, "glColor3sv\n" ); + fprintf( glw_state.log_fp, "glColor3sv\n" ); dllColor3sv( v ); } static void APIENTRY logColor3ub(GLubyte red, GLubyte green, GLubyte blue) { - fprintf( log_fp, "glColor3ub\n" ); + fprintf( glw_state.log_fp, "glColor3ub\n" ); dllColor3ub( red, green, blue ); } static void APIENTRY logColor3ubv(const GLubyte *v) { - fprintf( log_fp, "glColor3ubv\n" ); + fprintf( glw_state.log_fp, "glColor3ubv\n" ); dllColor3ubv( v ); } -#define SIG( x ) fprintf( log_fp, x "\n" ) +#define SIG( x ) fprintf( glw_state.log_fp, x "\n" ) static void APIENTRY logColor3ui(GLuint red, GLuint green, GLuint blue) { @@ -920,12 +966,12 @@ static void APIENTRY logColor4dv(const GLdouble *v) } static void APIENTRY logColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { - SIG( "glColor4f" ); + fprintf( glw_state.log_fp, "glColor4f( %f,%f,%f,%f )\n", red, green, blue, alpha ); dllColor4f( red, green, blue, alpha ); } static void APIENTRY logColor4fv(const GLfloat *v) { - SIG( "glColor4fv" ); + fprintf( glw_state.log_fp, "glColor4fv( %f,%f,%f,%f )\n", v[0], v[1], v[2], v[3] ); dllColor4fv( v ); } static void APIENTRY logColor4i(GLint red, GLint green, GLint blue, GLint alpha) @@ -1063,7 +1109,7 @@ static void APIENTRY logDepthRange(GLclampd zNear, GLclampd zFar) static void APIENTRY logDisable(GLenum cap) { - fprintf( log_fp, "glDisable( 0x%x )\n", cap ); + fprintf( glw_state.log_fp, "glDisable( 0x%x )\n", cap ); dllDisable( cap ); } @@ -1117,7 +1163,7 @@ static void APIENTRY logEdgeFlagv(const GLboolean *flag) static void APIENTRY logEnable(GLenum cap) { - fprintf( log_fp, "glEnable( 0x%x )\n", cap ); + fprintf( glw_state.log_fp, "glEnable( 0x%x )\n", cap ); dllEnable( cap ); } @@ -1445,7 +1491,7 @@ static void APIENTRY logGetTexParameteriv(GLenum target, GLenum pname, GLint *pa static void APIENTRY logHint(GLenum target, GLenum mode) { - fprintf( log_fp, "glHint( 0x%x, 0x%x )\n", target, mode ); + fprintf( glw_state.log_fp, "glHint( 0x%x, 0x%x )\n", target, mode ); dllHint( target, mode ); } @@ -1864,7 +1910,7 @@ static void APIENTRY logPointSize(GLfloat size) static void APIENTRY logPolygonMode(GLenum face, GLenum mode) { - fprintf( log_fp, "glPolygonMode( 0x%x, 0x%x )\n", face, mode ); + fprintf( glw_state.log_fp, "glPolygonMode( 0x%x, 0x%x )\n", face, mode ); dllPolygonMode( face, mode ); } @@ -2344,7 +2390,7 @@ static void APIENTRY logTexCoordPointer(GLint size, GLenum type, GLsizei stride, static void APIENTRY logTexEnvf(GLenum target, GLenum pname, GLfloat param) { - fprintf( log_fp, "glTexEnvf( 0x%x, 0x%x, %f )\n", target, pname, param ); + fprintf( glw_state.log_fp, "glTexEnvf( 0x%x, 0x%x, %f )\n", target, pname, param ); dllTexEnvf( target, pname, param ); } @@ -2356,7 +2402,7 @@ static void APIENTRY logTexEnvfv(GLenum target, GLenum pname, const GLfloat *par static void APIENTRY logTexEnvi(GLenum target, GLenum pname, GLint param) { - fprintf( log_fp, "glTexEnvi( 0x%x, 0x%x, 0x%x )\n", target, pname, param ); + fprintf( glw_state.log_fp, "glTexEnvi( 0x%x, 0x%x, 0x%x )\n", target, pname, param ); dllTexEnvi( target, pname, param ); } static void APIENTRY logTexEnviv(GLenum target, GLenum pname, const GLint *params) @@ -2410,7 +2456,7 @@ static void APIENTRY logTexImage2D(GLenum target, GLint level, GLint internalfor static void APIENTRY logTexParameterf(GLenum target, GLenum pname, GLfloat param) { - fprintf( log_fp, "glTexParameterf( 0x%x, 0x%x, %f )\n", target, pname, param ); + fprintf( glw_state.log_fp, "glTexParameterf( 0x%x, 0x%x, %f )\n", target, pname, param ); dllTexParameterf( target, pname, param ); } @@ -2421,7 +2467,7 @@ static void APIENTRY logTexParameterfv(GLenum target, GLenum pname, const GLfloa } static void APIENTRY logTexParameteri(GLenum target, GLenum pname, GLint param) { - fprintf( log_fp, "glTexParameteri( 0x%x, 0x%x, 0x%x )\n", target, pname, param ); + fprintf( glw_state.log_fp, "glTexParameteri( 0x%x, 0x%x, 0x%x )\n", target, pname, param ); dllTexParameteri( target, pname, param ); } static void APIENTRY logTexParameteriv(GLenum target, GLenum pname, const GLint *params) @@ -2590,6 +2636,14 @@ static void APIENTRY logViewport(GLint x, GLint y, GLsizei width, GLsizei height */ void QGL_Shutdown( void ) { + if ( glw_state.OpenGLLib ) + { + dlclose ( glw_state.OpenGLLib ); + glw_state.OpenGLLib = NULL; + } + + glw_state.OpenGLLib = NULL; + qglAccum = NULL; qglAlphaFunc = NULL; qglAreTexturesResident = NULL; @@ -2926,6 +2980,29 @@ void QGL_Shutdown( void ) qglVertex4sv = NULL; qglVertexPointer = NULL; qglViewport = NULL; +/* + qfxMesaCreateContext = NULL; + qfxMesaCreateBestContext = NULL; + qfxMesaDestroyContext = NULL; + qfxMesaMakeCurrent = NULL; + qfxMesaGetCurrentContext = NULL; + qfxMesaSwapBuffers = NULL; +*/ + qglXChooseVisual = NULL; + qglXCreateContext = NULL; + qglXDestroyContext = NULL; + qglXMakeCurrent = NULL; + qglXCopyContext = NULL; + qglXSwapBuffers = NULL; +} + +#define GPA( a ) dlsym( glw_state.OpenGLLib, a ) + +void *qwglGetProcAddress(char *symbol) +{ + if (glw_state.OpenGLLib) + return GPA ( symbol ); + return NULL; } /* @@ -2938,350 +3015,409 @@ void QGL_Shutdown( void ) ** might be. ** */ + qboolean QGL_Init( const char *dllname ) { - qglAccum = dllAccum = glAccum; - qglAlphaFunc = dllAlphaFunc = glAlphaFunc; - qglAreTexturesResident = dllAreTexturesResident = glAreTexturesResident; - qglArrayElement = dllArrayElement = glArrayElement; - qglBegin = dllBegin = glBegin; - qglBindTexture = dllBindTexture = glBindTexture; - qglBitmap = dllBitmap = glBitmap; - qglBlendFunc = dllBlendFunc = glBlendFunc; - qglCallList = dllCallList = glCallList; - qglCallLists = dllCallLists = glCallLists; - qglClear = dllClear = glClear; - qglClearAccum = dllClearAccum = glClearAccum; - qglClearColor = dllClearColor = glClearColor; - qglClearDepth = dllClearDepth = glClearDepth; - qglClearIndex = dllClearIndex = glClearIndex; - qglClearStencil = dllClearStencil = glClearStencil; - qglClipPlane = dllClipPlane = glClipPlane; - qglColor3b = dllColor3b = glColor3b; - qglColor3bv = dllColor3bv = glColor3bv; - qglColor3d = dllColor3d = glColor3d; - qglColor3dv = dllColor3dv = glColor3dv; - qglColor3f = dllColor3f = glColor3f; - qglColor3fv = dllColor3fv = glColor3fv; - qglColor3i = dllColor3i = glColor3i; - qglColor3iv = dllColor3iv = glColor3iv; - qglColor3s = dllColor3s = glColor3s; - qglColor3sv = dllColor3sv = glColor3sv; - qglColor3ub = dllColor3ub = glColor3ub; - qglColor3ubv = dllColor3ubv = glColor3ubv; - qglColor3ui = dllColor3ui = glColor3ui; - qglColor3uiv = dllColor3uiv = glColor3uiv; - qglColor3us = dllColor3us = glColor3us; - qglColor3usv = dllColor3usv = glColor3usv; - qglColor4b = dllColor4b = glColor4b; - qglColor4bv = dllColor4bv = glColor4bv; - qglColor4d = dllColor4d = glColor4d; - qglColor4dv = dllColor4dv = glColor4dv; - qglColor4f = dllColor4f = glColor4f; - qglColor4fv = dllColor4fv = glColor4fv; - qglColor4i = dllColor4i = glColor4i; - qglColor4iv = dllColor4iv = glColor4iv; - qglColor4s = dllColor4s = glColor4s; - qglColor4sv = dllColor4sv = glColor4sv; - qglColor4ub = dllColor4ub = glColor4ub; - qglColor4ubv = dllColor4ubv = glColor4ubv; - qglColor4ui = dllColor4ui = glColor4ui; - qglColor4uiv = dllColor4uiv = glColor4uiv; - qglColor4us = dllColor4us = glColor4us; - qglColor4usv = dllColor4usv = glColor4usv; - qglColorMask = dllColorMask = glColorMask; - qglColorMaterial = dllColorMaterial = glColorMaterial; - qglColorPointer = dllColorPointer = glColorPointer; - qglCopyPixels = dllCopyPixels = glCopyPixels; - qglCopyTexImage1D = dllCopyTexImage1D = glCopyTexImage1D; - qglCopyTexImage2D = dllCopyTexImage2D = glCopyTexImage2D; - qglCopyTexSubImage1D = dllCopyTexSubImage1D = glCopyTexSubImage1D; - qglCopyTexSubImage2D = dllCopyTexSubImage2D = glCopyTexSubImage2D; - qglCullFace = dllCullFace = glCullFace; - qglDeleteLists = dllDeleteLists = glDeleteLists; - qglDeleteTextures = dllDeleteTextures = glDeleteTextures; - qglDepthFunc = dllDepthFunc = glDepthFunc; - qglDepthMask = dllDepthMask = glDepthMask; - qglDepthRange = dllDepthRange = glDepthRange; - qglDisable = dllDisable = glDisable; - qglDisableClientState = dllDisableClientState = glDisableClientState; - qglDrawArrays = dllDrawArrays = glDrawArrays; - qglDrawBuffer = dllDrawBuffer = glDrawBuffer; - qglDrawElements = dllDrawElements = glDrawElements; - qglDrawPixels = dllDrawPixels = glDrawPixels; - qglEdgeFlag = dllEdgeFlag = glEdgeFlag; - qglEdgeFlagPointer = dllEdgeFlagPointer = glEdgeFlagPointer; - qglEdgeFlagv = dllEdgeFlagv = glEdgeFlagv; - qglEnable = dllEnable = glEnable; - qglEnableClientState = dllEnableClientState = glEnableClientState; - qglEnd = dllEnd = glEnd; - qglEndList = dllEndList = glEndList; - qglEvalCoord1d = dllEvalCoord1d = glEvalCoord1d; - qglEvalCoord1dv = dllEvalCoord1dv = glEvalCoord1dv; - qglEvalCoord1f = dllEvalCoord1f = glEvalCoord1f; - qglEvalCoord1fv = dllEvalCoord1fv = glEvalCoord1fv; - qglEvalCoord2d = dllEvalCoord2d = glEvalCoord2d; - qglEvalCoord2dv = dllEvalCoord2dv = glEvalCoord2dv; - qglEvalCoord2f = dllEvalCoord2f = glEvalCoord2f; - qglEvalCoord2fv = dllEvalCoord2fv = glEvalCoord2fv; - qglEvalMesh1 = dllEvalMesh1 = glEvalMesh1; - qglEvalMesh2 = dllEvalMesh2 = glEvalMesh2; - qglEvalPoint1 = dllEvalPoint1 = glEvalPoint1; - qglEvalPoint2 = dllEvalPoint2 = glEvalPoint2; - qglFeedbackBuffer = dllFeedbackBuffer = glFeedbackBuffer; - qglFinish = dllFinish = glFinish; - qglFlush = dllFlush = glFlush; - qglFogf = dllFogf = glFogf; - qglFogfv = dllFogfv = glFogfv; - qglFogi = dllFogi = glFogi; - qglFogiv = dllFogiv = glFogiv; - qglFrontFace = dllFrontFace = glFrontFace; - qglFrustum = dllFrustum = glFrustum; - qglGenLists = dllGenLists = glGenLists; - qglGenTextures = dllGenTextures = glGenTextures; - qglGetBooleanv = dllGetBooleanv = glGetBooleanv; - qglGetClipPlane = dllGetClipPlane = glGetClipPlane; - qglGetDoublev = dllGetDoublev = glGetDoublev; - qglGetError = dllGetError = glGetError; - qglGetFloatv = dllGetFloatv = glGetFloatv; - qglGetIntegerv = dllGetIntegerv = glGetIntegerv; - qglGetLightfv = dllGetLightfv = glGetLightfv; - qglGetLightiv = dllGetLightiv = glGetLightiv; - qglGetMapdv = dllGetMapdv = glGetMapdv; - qglGetMapfv = dllGetMapfv = glGetMapfv; - qglGetMapiv = dllGetMapiv = glGetMapiv; - qglGetMaterialfv = dllGetMaterialfv = glGetMaterialfv; - qglGetMaterialiv = dllGetMaterialiv = glGetMaterialiv; - qglGetPixelMapfv = dllGetPixelMapfv = glGetPixelMapfv; - qglGetPixelMapuiv = dllGetPixelMapuiv = glGetPixelMapuiv; - qglGetPixelMapusv = dllGetPixelMapusv = glGetPixelMapusv; - qglGetPointerv = dllGetPointerv = glGetPointerv; - qglGetPolygonStipple = dllGetPolygonStipple = glGetPolygonStipple; - qglGetString = dllGetString = glGetString; - qglGetTexEnvfv = dllGetTexEnvfv = glGetTexEnvfv; - qglGetTexEnviv = dllGetTexEnviv = glGetTexEnviv; - qglGetTexGendv = dllGetTexGendv = glGetTexGendv; - qglGetTexGenfv = dllGetTexGenfv = glGetTexGenfv; - qglGetTexGeniv = dllGetTexGeniv = glGetTexGeniv; - qglGetTexImage = dllGetTexImage = glGetTexImage; -// qglGetTexLevelParameterfv = dllGetTexLevelParameterfv = glGetLevelParameterfv; -// qglGetTexLevelParameteriv = dllGetTexLevelParameteriv = glGetLevelParameteriv; - qglGetTexParameterfv = dllGetTexParameterfv = glGetTexParameterfv; - qglGetTexParameteriv = dllGetTexParameteriv = glGetTexParameteriv; - qglHint = dllHint = glHint; - qglIndexMask = dllIndexMask = glIndexMask; - qglIndexPointer = dllIndexPointer = glIndexPointer; - qglIndexd = dllIndexd = glIndexd; - qglIndexdv = dllIndexdv = glIndexdv; - qglIndexf = dllIndexf = glIndexf; - qglIndexfv = dllIndexfv = glIndexfv; - qglIndexi = dllIndexi = glIndexi; - qglIndexiv = dllIndexiv = glIndexiv; - qglIndexs = dllIndexs = glIndexs; - qglIndexsv = dllIndexsv = glIndexsv; - qglIndexub = dllIndexub = glIndexub; - qglIndexubv = dllIndexubv = glIndexubv; - qglInitNames = dllInitNames = glInitNames; - qglInterleavedArrays = dllInterleavedArrays = glInterleavedArrays; - qglIsEnabled = dllIsEnabled = glIsEnabled; - qglIsList = dllIsList = glIsList; - qglIsTexture = dllIsTexture = glIsTexture; - qglLightModelf = dllLightModelf = glLightModelf; - qglLightModelfv = dllLightModelfv = glLightModelfv; - qglLightModeli = dllLightModeli = glLightModeli; - qglLightModeliv = dllLightModeliv = glLightModeliv; - qglLightf = dllLightf = glLightf; - qglLightfv = dllLightfv = glLightfv; - qglLighti = dllLighti = glLighti; - qglLightiv = dllLightiv = glLightiv; - qglLineStipple = dllLineStipple = glLineStipple; - qglLineWidth = dllLineWidth = glLineWidth; - qglListBase = dllListBase = glListBase; - qglLoadIdentity = dllLoadIdentity = glLoadIdentity; - qglLoadMatrixd = dllLoadMatrixd = glLoadMatrixd; - qglLoadMatrixf = dllLoadMatrixf = glLoadMatrixf; - qglLoadName = dllLoadName = glLoadName; - qglLogicOp = dllLogicOp = glLogicOp; - qglMap1d = dllMap1d = glMap1d; - qglMap1f = dllMap1f = glMap1f; - qglMap2d = dllMap2d = glMap2d; - qglMap2f = dllMap2f = glMap2f; - qglMapGrid1d = dllMapGrid1d = glMapGrid1d; - qglMapGrid1f = dllMapGrid1f = glMapGrid1f; - qglMapGrid2d = dllMapGrid2d = glMapGrid2d; - qglMapGrid2f = dllMapGrid2f = glMapGrid2f; - qglMaterialf = dllMaterialf = glMaterialf; - qglMaterialfv = dllMaterialfv = glMaterialfv; - qglMateriali = dllMateriali = glMateriali; - qglMaterialiv = dllMaterialiv = glMaterialiv; - qglMatrixMode = dllMatrixMode = glMatrixMode; - qglMultMatrixd = dllMultMatrixd = glMultMatrixd; - qglMultMatrixf = dllMultMatrixf = glMultMatrixf; - qglNewList = dllNewList = glNewList; - qglNormal3b = dllNormal3b = glNormal3b; - qglNormal3bv = dllNormal3bv = glNormal3bv; - qglNormal3d = dllNormal3d = glNormal3d; - qglNormal3dv = dllNormal3dv = glNormal3dv; - qglNormal3f = dllNormal3f = glNormal3f; - qglNormal3fv = dllNormal3fv = glNormal3fv; - qglNormal3i = dllNormal3i = glNormal3i; - qglNormal3iv = dllNormal3iv = glNormal3iv; - qglNormal3s = dllNormal3s = glNormal3s; - qglNormal3sv = dllNormal3sv = glNormal3sv; - qglNormalPointer = dllNormalPointer = glNormalPointer; - qglOrtho = dllOrtho = glOrtho; - qglPassThrough = dllPassThrough = glPassThrough; - qglPixelMapfv = dllPixelMapfv = glPixelMapfv; - qglPixelMapuiv = dllPixelMapuiv = glPixelMapuiv; - qglPixelMapusv = dllPixelMapusv = glPixelMapusv; - qglPixelStoref = dllPixelStoref = glPixelStoref; - qglPixelStorei = dllPixelStorei = glPixelStorei; - qglPixelTransferf = dllPixelTransferf = glPixelTransferf; - qglPixelTransferi = dllPixelTransferi = glPixelTransferi; - qglPixelZoom = dllPixelZoom = glPixelZoom; - qglPointSize = dllPointSize = glPointSize; - qglPolygonMode = dllPolygonMode = glPolygonMode; - qglPolygonOffset = dllPolygonOffset = glPolygonOffset; - qglPolygonStipple = dllPolygonStipple = glPolygonStipple; - qglPopAttrib = dllPopAttrib = glPopAttrib; - qglPopClientAttrib = dllPopClientAttrib = glPopClientAttrib; - qglPopMatrix = dllPopMatrix = glPopMatrix; - qglPopName = dllPopName = glPopName; - qglPrioritizeTextures = dllPrioritizeTextures = glPrioritizeTextures; - qglPushAttrib = dllPushAttrib = glPushAttrib; - qglPushClientAttrib = dllPushClientAttrib = glPushClientAttrib; - qglPushMatrix = dllPushMatrix = glPushMatrix; - qglPushName = dllPushName = glPushName; - qglRasterPos2d = dllRasterPos2d = glRasterPos2d; - qglRasterPos2dv = dllRasterPos2dv = glRasterPos2dv; - qglRasterPos2f = dllRasterPos2f = glRasterPos2f; - qglRasterPos2fv = dllRasterPos2fv = glRasterPos2fv; - qglRasterPos2i = dllRasterPos2i = glRasterPos2i; - qglRasterPos2iv = dllRasterPos2iv = glRasterPos2iv; - qglRasterPos2s = dllRasterPos2s = glRasterPos2s; - qglRasterPos2sv = dllRasterPos2sv = glRasterPos2sv; - qglRasterPos3d = dllRasterPos3d = glRasterPos3d; - qglRasterPos3dv = dllRasterPos3dv = glRasterPos3dv; - qglRasterPos3f = dllRasterPos3f = glRasterPos3f; - qglRasterPos3fv = dllRasterPos3fv = glRasterPos3fv; - qglRasterPos3i = dllRasterPos3i = glRasterPos3i; - qglRasterPos3iv = dllRasterPos3iv = glRasterPos3iv; - qglRasterPos3s = dllRasterPos3s = glRasterPos3s; - qglRasterPos3sv = dllRasterPos3sv = glRasterPos3sv; - qglRasterPos4d = dllRasterPos4d = glRasterPos4d; - qglRasterPos4dv = dllRasterPos4dv = glRasterPos4dv; - qglRasterPos4f = dllRasterPos4f = glRasterPos4f; - qglRasterPos4fv = dllRasterPos4fv = glRasterPos4fv; - qglRasterPos4i = dllRasterPos4i = glRasterPos4i; - qglRasterPos4iv = dllRasterPos4iv = glRasterPos4iv; - qglRasterPos4s = dllRasterPos4s = glRasterPos4s; - qglRasterPos4sv = dllRasterPos4sv = glRasterPos4sv; - qglReadBuffer = dllReadBuffer = glReadBuffer; - qglReadPixels = dllReadPixels = glReadPixels; - qglRectd = dllRectd = glRectd; - qglRectdv = dllRectdv = glRectdv; - qglRectf = dllRectf = glRectf; - qglRectfv = dllRectfv = glRectfv; - qglRecti = dllRecti = glRecti; - qglRectiv = dllRectiv = glRectiv; - qglRects = dllRects = glRects; - qglRectsv = dllRectsv = glRectsv; - qglRenderMode = dllRenderMode = glRenderMode; - qglRotated = dllRotated = glRotated; - qglRotatef = dllRotatef = glRotatef; - qglScaled = dllScaled = glScaled; - qglScalef = dllScalef = glScalef; - qglScissor = dllScissor = glScissor; - qglSelectBuffer = dllSelectBuffer = glSelectBuffer; - qglShadeModel = dllShadeModel = glShadeModel; - qglStencilFunc = dllStencilFunc = glStencilFunc; - qglStencilMask = dllStencilMask = glStencilMask; - qglStencilOp = dllStencilOp = glStencilOp; - qglTexCoord1d = dllTexCoord1d = glTexCoord1d; - qglTexCoord1dv = dllTexCoord1dv = glTexCoord1dv; - qglTexCoord1f = dllTexCoord1f = glTexCoord1f; - qglTexCoord1fv = dllTexCoord1fv = glTexCoord1fv; - qglTexCoord1i = dllTexCoord1i = glTexCoord1i; - qglTexCoord1iv = dllTexCoord1iv = glTexCoord1iv; - qglTexCoord1s = dllTexCoord1s = glTexCoord1s; - qglTexCoord1sv = dllTexCoord1sv = glTexCoord1sv; - qglTexCoord2d = dllTexCoord2d = glTexCoord2d; - qglTexCoord2dv = dllTexCoord2dv = glTexCoord2dv; - qglTexCoord2f = dllTexCoord2f = glTexCoord2f; - qglTexCoord2fv = dllTexCoord2fv = glTexCoord2fv; - qglTexCoord2i = dllTexCoord2i = glTexCoord2i; - qglTexCoord2iv = dllTexCoord2iv = glTexCoord2iv; - qglTexCoord2s = dllTexCoord2s = glTexCoord2s; - qglTexCoord2sv = dllTexCoord2sv = glTexCoord2sv; - qglTexCoord3d = dllTexCoord3d = glTexCoord3d; - qglTexCoord3dv = dllTexCoord3dv = glTexCoord3dv; - qglTexCoord3f = dllTexCoord3f = glTexCoord3f; - qglTexCoord3fv = dllTexCoord3fv = glTexCoord3fv; - qglTexCoord3i = dllTexCoord3i = glTexCoord3i; - qglTexCoord3iv = dllTexCoord3iv = glTexCoord3iv; - qglTexCoord3s = dllTexCoord3s = glTexCoord3s; - qglTexCoord3sv = dllTexCoord3sv = glTexCoord3sv; - qglTexCoord4d = dllTexCoord4d = glTexCoord4d; - qglTexCoord4dv = dllTexCoord4dv = glTexCoord4dv; - qglTexCoord4f = dllTexCoord4f = glTexCoord4f; - qglTexCoord4fv = dllTexCoord4fv = glTexCoord4fv; - qglTexCoord4i = dllTexCoord4i = glTexCoord4i; - qglTexCoord4iv = dllTexCoord4iv = glTexCoord4iv; - qglTexCoord4s = dllTexCoord4s = glTexCoord4s; - qglTexCoord4sv = dllTexCoord4sv = glTexCoord4sv; - qglTexCoordPointer = dllTexCoordPointer = glTexCoordPointer; - qglTexEnvf = dllTexEnvf = glTexEnvf; - qglTexEnvfv = dllTexEnvfv = glTexEnvfv; - qglTexEnvi = dllTexEnvi = glTexEnvi; - qglTexEnviv = dllTexEnviv = glTexEnviv; - qglTexGend = dllTexGend = glTexGend; - qglTexGendv = dllTexGendv = glTexGendv; - qglTexGenf = dllTexGenf = glTexGenf; - qglTexGenfv = dllTexGenfv = glTexGenfv; - qglTexGeni = dllTexGeni = glTexGeni; - qglTexGeniv = dllTexGeniv = glTexGeniv; - qglTexImage1D = dllTexImage1D = glTexImage1D; - qglTexImage2D = dllTexImage2D = glTexImage2D; - qglTexParameterf = dllTexParameterf = glTexParameterf; - qglTexParameterfv = dllTexParameterfv = glTexParameterfv; - qglTexParameteri = dllTexParameteri = glTexParameteri; - qglTexParameteriv = dllTexParameteriv = glTexParameteriv; - qglTexSubImage1D = dllTexSubImage1D = glTexSubImage1D; - qglTexSubImage2D = dllTexSubImage2D = glTexSubImage2D; - qglTranslated = dllTranslated = glTranslated; - qglTranslatef = dllTranslatef = glTranslatef; - qglVertex2d = dllVertex2d = glVertex2d; - qglVertex2dv = dllVertex2dv = glVertex2dv; - qglVertex2f = dllVertex2f = glVertex2f; - qglVertex2fv = dllVertex2fv = glVertex2fv; - qglVertex2i = dllVertex2i = glVertex2i; - qglVertex2iv = dllVertex2iv = glVertex2iv; - qglVertex2s = dllVertex2s = glVertex2s; - qglVertex2sv = dllVertex2sv = glVertex2sv; - qglVertex3d = dllVertex3d = glVertex3d; - qglVertex3dv = dllVertex3dv = glVertex3dv; - qglVertex3f = dllVertex3f = glVertex3f; - qglVertex3fv = dllVertex3fv = glVertex3fv; - qglVertex3i = dllVertex3i = glVertex3i; - qglVertex3iv = dllVertex3iv = glVertex3iv; - qglVertex3s = dllVertex3s = glVertex3s; - qglVertex3sv = dllVertex3sv = glVertex3sv; - qglVertex4d = dllVertex4d = glVertex4d; - qglVertex4dv = dllVertex4dv = glVertex4dv; - qglVertex4f = dllVertex4f = glVertex4f; - qglVertex4fv = dllVertex4fv = glVertex4fv; - qglVertex4i = dllVertex4i = glVertex4i; - qglVertex4iv = dllVertex4iv = glVertex4iv; - qglVertex4s = dllVertex4s = glVertex4s; - qglVertex4sv = dllVertex4sv = glVertex4sv; - qglVertexPointer = dllVertexPointer = glVertexPointer; - qglViewport = dllViewport = glViewport; + // update 3Dfx gamma irrespective of underlying DLL + { + char envbuffer[1024]; + float g; + g = 2.00 * ( 0.8 - ( vid_gamma->value - 0.5 ) ) + 1.0F; + Com_sprintf( envbuffer, sizeof(envbuffer), "SSTV2_GAMMA=%f", g ); + putenv( envbuffer ); + Com_sprintf( envbuffer, sizeof(envbuffer), "SST_GAMMA=%f", g ); + putenv( envbuffer ); + } + + if ( ( glw_state.OpenGLLib = dlopen( dllname, RTLD_LAZY | RTLD_GLOBAL ) ) == 0 ) + { + char fn[MAX_OSPATH]; + FILE *fp; + +// ri.Con_Printf(PRINT_ALL, "QGL_Init: Can't load %s from /etc/ld.so.conf: %s\n", +// dllname, dlerror()); + + // try path in /etc/quake2.conf + if ((fp = fopen(so_file, "r")) == NULL) { + ri.Con_Printf(PRINT_ALL, "QGL_Init(\"%s\") failed: can't open %s\n", dllname, so_file); + return false; + } + fgets(fn, sizeof(fn), fp); + fclose(fp); + while (*fn && isspace(fn[strlen(fn) - 1])) + fn[strlen(fn) - 1] = 0; + + strcat(fn, "/"); + strcat(fn, dllname); + + if ( ( glw_state.OpenGLLib = dlopen( fn, RTLD_LAZY ) ) == 0 ) { + ri.Con_Printf( PRINT_ALL, "%s\n", dlerror() ); + return false; + } + } + + qglAccum = dllAccum = GPA( "glAccum" ); + qglAlphaFunc = dllAlphaFunc = GPA( "glAlphaFunc" ); + qglAreTexturesResident = dllAreTexturesResident = GPA( "glAreTexturesResident" ); + qglArrayElement = dllArrayElement = GPA( "glArrayElement" ); + qglBegin = dllBegin = GPA( "glBegin" ); + qglBindTexture = dllBindTexture = GPA( "glBindTexture" ); + qglBitmap = dllBitmap = GPA( "glBitmap" ); + qglBlendFunc = dllBlendFunc = GPA( "glBlendFunc" ); + qglCallList = dllCallList = GPA( "glCallList" ); + qglCallLists = dllCallLists = GPA( "glCallLists" ); + qglClear = dllClear = GPA( "glClear" ); + qglClearAccum = dllClearAccum = GPA( "glClearAccum" ); + qglClearColor = dllClearColor = GPA( "glClearColor" ); + qglClearDepth = dllClearDepth = GPA( "glClearDepth" ); + qglClearIndex = dllClearIndex = GPA( "glClearIndex" ); + qglClearStencil = dllClearStencil = GPA( "glClearStencil" ); + qglClipPlane = dllClipPlane = GPA( "glClipPlane" ); + qglColor3b = dllColor3b = GPA( "glColor3b" ); + qglColor3bv = dllColor3bv = GPA( "glColor3bv" ); + qglColor3d = dllColor3d = GPA( "glColor3d" ); + qglColor3dv = dllColor3dv = GPA( "glColor3dv" ); + qglColor3f = dllColor3f = GPA( "glColor3f" ); + qglColor3fv = dllColor3fv = GPA( "glColor3fv" ); + qglColor3i = dllColor3i = GPA( "glColor3i" ); + qglColor3iv = dllColor3iv = GPA( "glColor3iv" ); + qglColor3s = dllColor3s = GPA( "glColor3s" ); + qglColor3sv = dllColor3sv = GPA( "glColor3sv" ); + qglColor3ub = dllColor3ub = GPA( "glColor3ub" ); + qglColor3ubv = dllColor3ubv = GPA( "glColor3ubv" ); + qglColor3ui = dllColor3ui = GPA( "glColor3ui" ); + qglColor3uiv = dllColor3uiv = GPA( "glColor3uiv" ); + qglColor3us = dllColor3us = GPA( "glColor3us" ); + qglColor3usv = dllColor3usv = GPA( "glColor3usv" ); + qglColor4b = dllColor4b = GPA( "glColor4b" ); + qglColor4bv = dllColor4bv = GPA( "glColor4bv" ); + qglColor4d = dllColor4d = GPA( "glColor4d" ); + qglColor4dv = dllColor4dv = GPA( "glColor4dv" ); + qglColor4f = dllColor4f = GPA( "glColor4f" ); + qglColor4fv = dllColor4fv = GPA( "glColor4fv" ); + qglColor4i = dllColor4i = GPA( "glColor4i" ); + qglColor4iv = dllColor4iv = GPA( "glColor4iv" ); + qglColor4s = dllColor4s = GPA( "glColor4s" ); + qglColor4sv = dllColor4sv = GPA( "glColor4sv" ); + qglColor4ub = dllColor4ub = GPA( "glColor4ub" ); + qglColor4ubv = dllColor4ubv = GPA( "glColor4ubv" ); + qglColor4ui = dllColor4ui = GPA( "glColor4ui" ); + qglColor4uiv = dllColor4uiv = GPA( "glColor4uiv" ); + qglColor4us = dllColor4us = GPA( "glColor4us" ); + qglColor4usv = dllColor4usv = GPA( "glColor4usv" ); + qglColorMask = dllColorMask = GPA( "glColorMask" ); + qglColorMaterial = dllColorMaterial = GPA( "glColorMaterial" ); + qglColorPointer = dllColorPointer = GPA( "glColorPointer" ); + qglCopyPixels = dllCopyPixels = GPA( "glCopyPixels" ); + qglCopyTexImage1D = dllCopyTexImage1D = GPA( "glCopyTexImage1D" ); + qglCopyTexImage2D = dllCopyTexImage2D = GPA( "glCopyTexImage2D" ); + qglCopyTexSubImage1D = dllCopyTexSubImage1D = GPA( "glCopyTexSubImage1D" ); + qglCopyTexSubImage2D = dllCopyTexSubImage2D = GPA( "glCopyTexSubImage2D" ); + qglCullFace = dllCullFace = GPA( "glCullFace" ); + qglDeleteLists = dllDeleteLists = GPA( "glDeleteLists" ); + qglDeleteTextures = dllDeleteTextures = GPA( "glDeleteTextures" ); + qglDepthFunc = dllDepthFunc = GPA( "glDepthFunc" ); + qglDepthMask = dllDepthMask = GPA( "glDepthMask" ); + qglDepthRange = dllDepthRange = GPA( "glDepthRange" ); + qglDisable = dllDisable = GPA( "glDisable" ); + qglDisableClientState = dllDisableClientState = GPA( "glDisableClientState" ); + qglDrawArrays = dllDrawArrays = GPA( "glDrawArrays" ); + qglDrawBuffer = dllDrawBuffer = GPA( "glDrawBuffer" ); + qglDrawElements = dllDrawElements = GPA( "glDrawElements" ); + qglDrawPixels = dllDrawPixels = GPA( "glDrawPixels" ); + qglEdgeFlag = dllEdgeFlag = GPA( "glEdgeFlag" ); + qglEdgeFlagPointer = dllEdgeFlagPointer = GPA( "glEdgeFlagPointer" ); + qglEdgeFlagv = dllEdgeFlagv = GPA( "glEdgeFlagv" ); + qglEnable = dllEnable = GPA( "glEnable" ); + qglEnableClientState = dllEnableClientState = GPA( "glEnableClientState" ); + qglEnd = dllEnd = GPA( "glEnd" ); + qglEndList = dllEndList = GPA( "glEndList" ); + qglEvalCoord1d = dllEvalCoord1d = GPA( "glEvalCoord1d" ); + qglEvalCoord1dv = dllEvalCoord1dv = GPA( "glEvalCoord1dv" ); + qglEvalCoord1f = dllEvalCoord1f = GPA( "glEvalCoord1f" ); + qglEvalCoord1fv = dllEvalCoord1fv = GPA( "glEvalCoord1fv" ); + qglEvalCoord2d = dllEvalCoord2d = GPA( "glEvalCoord2d" ); + qglEvalCoord2dv = dllEvalCoord2dv = GPA( "glEvalCoord2dv" ); + qglEvalCoord2f = dllEvalCoord2f = GPA( "glEvalCoord2f" ); + qglEvalCoord2fv = dllEvalCoord2fv = GPA( "glEvalCoord2fv" ); + qglEvalMesh1 = dllEvalMesh1 = GPA( "glEvalMesh1" ); + qglEvalMesh2 = dllEvalMesh2 = GPA( "glEvalMesh2" ); + qglEvalPoint1 = dllEvalPoint1 = GPA( "glEvalPoint1" ); + qglEvalPoint2 = dllEvalPoint2 = GPA( "glEvalPoint2" ); + qglFeedbackBuffer = dllFeedbackBuffer = GPA( "glFeedbackBuffer" ); + qglFinish = dllFinish = GPA( "glFinish" ); + qglFlush = dllFlush = GPA( "glFlush" ); + qglFogf = dllFogf = GPA( "glFogf" ); + qglFogfv = dllFogfv = GPA( "glFogfv" ); + qglFogi = dllFogi = GPA( "glFogi" ); + qglFogiv = dllFogiv = GPA( "glFogiv" ); + qglFrontFace = dllFrontFace = GPA( "glFrontFace" ); + qglFrustum = dllFrustum = GPA( "glFrustum" ); + qglGenLists = dllGenLists = GPA( "glGenLists" ); + qglGenTextures = dllGenTextures = GPA( "glGenTextures" ); + qglGetBooleanv = dllGetBooleanv = GPA( "glGetBooleanv" ); + qglGetClipPlane = dllGetClipPlane = GPA( "glGetClipPlane" ); + qglGetDoublev = dllGetDoublev = GPA( "glGetDoublev" ); + qglGetError = dllGetError = GPA( "glGetError" ); + qglGetFloatv = dllGetFloatv = GPA( "glGetFloatv" ); + qglGetIntegerv = dllGetIntegerv = GPA( "glGetIntegerv" ); + qglGetLightfv = dllGetLightfv = GPA( "glGetLightfv" ); + qglGetLightiv = dllGetLightiv = GPA( "glGetLightiv" ); + qglGetMapdv = dllGetMapdv = GPA( "glGetMapdv" ); + qglGetMapfv = dllGetMapfv = GPA( "glGetMapfv" ); + qglGetMapiv = dllGetMapiv = GPA( "glGetMapiv" ); + qglGetMaterialfv = dllGetMaterialfv = GPA( "glGetMaterialfv" ); + qglGetMaterialiv = dllGetMaterialiv = GPA( "glGetMaterialiv" ); + qglGetPixelMapfv = dllGetPixelMapfv = GPA( "glGetPixelMapfv" ); + qglGetPixelMapuiv = dllGetPixelMapuiv = GPA( "glGetPixelMapuiv" ); + qglGetPixelMapusv = dllGetPixelMapusv = GPA( "glGetPixelMapusv" ); + qglGetPointerv = dllGetPointerv = GPA( "glGetPointerv" ); + qglGetPolygonStipple = dllGetPolygonStipple = GPA( "glGetPolygonStipple" ); + qglGetString = dllGetString = GPA( "glGetString" ); + qglGetTexEnvfv = dllGetTexEnvfv = GPA( "glGetTexEnvfv" ); + qglGetTexEnviv = dllGetTexEnviv = GPA( "glGetTexEnviv" ); + qglGetTexGendv = dllGetTexGendv = GPA( "glGetTexGendv" ); + qglGetTexGenfv = dllGetTexGenfv = GPA( "glGetTexGenfv" ); + qglGetTexGeniv = dllGetTexGeniv = GPA( "glGetTexGeniv" ); + qglGetTexImage = dllGetTexImage = GPA( "glGetTexImage" ); + qglGetTexLevelParameterfv = dllGetTexLevelParameterfv = GPA( "glGetLevelParameterfv" ); + qglGetTexLevelParameteriv = dllGetTexLevelParameteriv = GPA( "glGetLevelParameteriv" ); + qglGetTexParameterfv = dllGetTexParameterfv = GPA( "glGetTexParameterfv" ); + qglGetTexParameteriv = dllGetTexParameteriv = GPA( "glGetTexParameteriv" ); + qglHint = dllHint = GPA( "glHint" ); + qglIndexMask = dllIndexMask = GPA( "glIndexMask" ); + qglIndexPointer = dllIndexPointer = GPA( "glIndexPointer" ); + qglIndexd = dllIndexd = GPA( "glIndexd" ); + qglIndexdv = dllIndexdv = GPA( "glIndexdv" ); + qglIndexf = dllIndexf = GPA( "glIndexf" ); + qglIndexfv = dllIndexfv = GPA( "glIndexfv" ); + qglIndexi = dllIndexi = GPA( "glIndexi" ); + qglIndexiv = dllIndexiv = GPA( "glIndexiv" ); + qglIndexs = dllIndexs = GPA( "glIndexs" ); + qglIndexsv = dllIndexsv = GPA( "glIndexsv" ); + qglIndexub = dllIndexub = GPA( "glIndexub" ); + qglIndexubv = dllIndexubv = GPA( "glIndexubv" ); + qglInitNames = dllInitNames = GPA( "glInitNames" ); + qglInterleavedArrays = dllInterleavedArrays = GPA( "glInterleavedArrays" ); + qglIsEnabled = dllIsEnabled = GPA( "glIsEnabled" ); + qglIsList = dllIsList = GPA( "glIsList" ); + qglIsTexture = dllIsTexture = GPA( "glIsTexture" ); + qglLightModelf = dllLightModelf = GPA( "glLightModelf" ); + qglLightModelfv = dllLightModelfv = GPA( "glLightModelfv" ); + qglLightModeli = dllLightModeli = GPA( "glLightModeli" ); + qglLightModeliv = dllLightModeliv = GPA( "glLightModeliv" ); + qglLightf = dllLightf = GPA( "glLightf" ); + qglLightfv = dllLightfv = GPA( "glLightfv" ); + qglLighti = dllLighti = GPA( "glLighti" ); + qglLightiv = dllLightiv = GPA( "glLightiv" ); + qglLineStipple = dllLineStipple = GPA( "glLineStipple" ); + qglLineWidth = dllLineWidth = GPA( "glLineWidth" ); + qglListBase = dllListBase = GPA( "glListBase" ); + qglLoadIdentity = dllLoadIdentity = GPA( "glLoadIdentity" ); + qglLoadMatrixd = dllLoadMatrixd = GPA( "glLoadMatrixd" ); + qglLoadMatrixf = dllLoadMatrixf = GPA( "glLoadMatrixf" ); + qglLoadName = dllLoadName = GPA( "glLoadName" ); + qglLogicOp = dllLogicOp = GPA( "glLogicOp" ); + qglMap1d = dllMap1d = GPA( "glMap1d" ); + qglMap1f = dllMap1f = GPA( "glMap1f" ); + qglMap2d = dllMap2d = GPA( "glMap2d" ); + qglMap2f = dllMap2f = GPA( "glMap2f" ); + qglMapGrid1d = dllMapGrid1d = GPA( "glMapGrid1d" ); + qglMapGrid1f = dllMapGrid1f = GPA( "glMapGrid1f" ); + qglMapGrid2d = dllMapGrid2d = GPA( "glMapGrid2d" ); + qglMapGrid2f = dllMapGrid2f = GPA( "glMapGrid2f" ); + qglMaterialf = dllMaterialf = GPA( "glMaterialf" ); + qglMaterialfv = dllMaterialfv = GPA( "glMaterialfv" ); + qglMateriali = dllMateriali = GPA( "glMateriali" ); + qglMaterialiv = dllMaterialiv = GPA( "glMaterialiv" ); + qglMatrixMode = dllMatrixMode = GPA( "glMatrixMode" ); + qglMultMatrixd = dllMultMatrixd = GPA( "glMultMatrixd" ); + qglMultMatrixf = dllMultMatrixf = GPA( "glMultMatrixf" ); + qglNewList = dllNewList = GPA( "glNewList" ); + qglNormal3b = dllNormal3b = GPA( "glNormal3b" ); + qglNormal3bv = dllNormal3bv = GPA( "glNormal3bv" ); + qglNormal3d = dllNormal3d = GPA( "glNormal3d" ); + qglNormal3dv = dllNormal3dv = GPA( "glNormal3dv" ); + qglNormal3f = dllNormal3f = GPA( "glNormal3f" ); + qglNormal3fv = dllNormal3fv = GPA( "glNormal3fv" ); + qglNormal3i = dllNormal3i = GPA( "glNormal3i" ); + qglNormal3iv = dllNormal3iv = GPA( "glNormal3iv" ); + qglNormal3s = dllNormal3s = GPA( "glNormal3s" ); + qglNormal3sv = dllNormal3sv = GPA( "glNormal3sv" ); + qglNormalPointer = dllNormalPointer = GPA( "glNormalPointer" ); + qglOrtho = dllOrtho = GPA( "glOrtho" ); + qglPassThrough = dllPassThrough = GPA( "glPassThrough" ); + qglPixelMapfv = dllPixelMapfv = GPA( "glPixelMapfv" ); + qglPixelMapuiv = dllPixelMapuiv = GPA( "glPixelMapuiv" ); + qglPixelMapusv = dllPixelMapusv = GPA( "glPixelMapusv" ); + qglPixelStoref = dllPixelStoref = GPA( "glPixelStoref" ); + qglPixelStorei = dllPixelStorei = GPA( "glPixelStorei" ); + qglPixelTransferf = dllPixelTransferf = GPA( "glPixelTransferf" ); + qglPixelTransferi = dllPixelTransferi = GPA( "glPixelTransferi" ); + qglPixelZoom = dllPixelZoom = GPA( "glPixelZoom" ); + qglPointSize = dllPointSize = GPA( "glPointSize" ); + qglPolygonMode = dllPolygonMode = GPA( "glPolygonMode" ); + qglPolygonOffset = dllPolygonOffset = GPA( "glPolygonOffset" ); + qglPolygonStipple = dllPolygonStipple = GPA( "glPolygonStipple" ); + qglPopAttrib = dllPopAttrib = GPA( "glPopAttrib" ); + qglPopClientAttrib = dllPopClientAttrib = GPA( "glPopClientAttrib" ); + qglPopMatrix = dllPopMatrix = GPA( "glPopMatrix" ); + qglPopName = dllPopName = GPA( "glPopName" ); + qglPrioritizeTextures = dllPrioritizeTextures = GPA( "glPrioritizeTextures" ); + qglPushAttrib = dllPushAttrib = GPA( "glPushAttrib" ); + qglPushClientAttrib = dllPushClientAttrib = GPA( "glPushClientAttrib" ); + qglPushMatrix = dllPushMatrix = GPA( "glPushMatrix" ); + qglPushName = dllPushName = GPA( "glPushName" ); + qglRasterPos2d = dllRasterPos2d = GPA( "glRasterPos2d" ); + qglRasterPos2dv = dllRasterPos2dv = GPA( "glRasterPos2dv" ); + qglRasterPos2f = dllRasterPos2f = GPA( "glRasterPos2f" ); + qglRasterPos2fv = dllRasterPos2fv = GPA( "glRasterPos2fv" ); + qglRasterPos2i = dllRasterPos2i = GPA( "glRasterPos2i" ); + qglRasterPos2iv = dllRasterPos2iv = GPA( "glRasterPos2iv" ); + qglRasterPos2s = dllRasterPos2s = GPA( "glRasterPos2s" ); + qglRasterPos2sv = dllRasterPos2sv = GPA( "glRasterPos2sv" ); + qglRasterPos3d = dllRasterPos3d = GPA( "glRasterPos3d" ); + qglRasterPos3dv = dllRasterPos3dv = GPA( "glRasterPos3dv" ); + qglRasterPos3f = dllRasterPos3f = GPA( "glRasterPos3f" ); + qglRasterPos3fv = dllRasterPos3fv = GPA( "glRasterPos3fv" ); + qglRasterPos3i = dllRasterPos3i = GPA( "glRasterPos3i" ); + qglRasterPos3iv = dllRasterPos3iv = GPA( "glRasterPos3iv" ); + qglRasterPos3s = dllRasterPos3s = GPA( "glRasterPos3s" ); + qglRasterPos3sv = dllRasterPos3sv = GPA( "glRasterPos3sv" ); + qglRasterPos4d = dllRasterPos4d = GPA( "glRasterPos4d" ); + qglRasterPos4dv = dllRasterPos4dv = GPA( "glRasterPos4dv" ); + qglRasterPos4f = dllRasterPos4f = GPA( "glRasterPos4f" ); + qglRasterPos4fv = dllRasterPos4fv = GPA( "glRasterPos4fv" ); + qglRasterPos4i = dllRasterPos4i = GPA( "glRasterPos4i" ); + qglRasterPos4iv = dllRasterPos4iv = GPA( "glRasterPos4iv" ); + qglRasterPos4s = dllRasterPos4s = GPA( "glRasterPos4s" ); + qglRasterPos4sv = dllRasterPos4sv = GPA( "glRasterPos4sv" ); + qglReadBuffer = dllReadBuffer = GPA( "glReadBuffer" ); + qglReadPixels = dllReadPixels = GPA( "glReadPixels" ); + qglRectd = dllRectd = GPA( "glRectd" ); + qglRectdv = dllRectdv = GPA( "glRectdv" ); + qglRectf = dllRectf = GPA( "glRectf" ); + qglRectfv = dllRectfv = GPA( "glRectfv" ); + qglRecti = dllRecti = GPA( "glRecti" ); + qglRectiv = dllRectiv = GPA( "glRectiv" ); + qglRects = dllRects = GPA( "glRects" ); + qglRectsv = dllRectsv = GPA( "glRectsv" ); + qglRenderMode = dllRenderMode = GPA( "glRenderMode" ); + qglRotated = dllRotated = GPA( "glRotated" ); + qglRotatef = dllRotatef = GPA( "glRotatef" ); + qglScaled = dllScaled = GPA( "glScaled" ); + qglScalef = dllScalef = GPA( "glScalef" ); + qglScissor = dllScissor = GPA( "glScissor" ); + qglSelectBuffer = dllSelectBuffer = GPA( "glSelectBuffer" ); + qglShadeModel = dllShadeModel = GPA( "glShadeModel" ); + qglStencilFunc = dllStencilFunc = GPA( "glStencilFunc" ); + qglStencilMask = dllStencilMask = GPA( "glStencilMask" ); + qglStencilOp = dllStencilOp = GPA( "glStencilOp" ); + qglTexCoord1d = dllTexCoord1d = GPA( "glTexCoord1d" ); + qglTexCoord1dv = dllTexCoord1dv = GPA( "glTexCoord1dv" ); + qglTexCoord1f = dllTexCoord1f = GPA( "glTexCoord1f" ); + qglTexCoord1fv = dllTexCoord1fv = GPA( "glTexCoord1fv" ); + qglTexCoord1i = dllTexCoord1i = GPA( "glTexCoord1i" ); + qglTexCoord1iv = dllTexCoord1iv = GPA( "glTexCoord1iv" ); + qglTexCoord1s = dllTexCoord1s = GPA( "glTexCoord1s" ); + qglTexCoord1sv = dllTexCoord1sv = GPA( "glTexCoord1sv" ); + qglTexCoord2d = dllTexCoord2d = GPA( "glTexCoord2d" ); + qglTexCoord2dv = dllTexCoord2dv = GPA( "glTexCoord2dv" ); + qglTexCoord2f = dllTexCoord2f = GPA( "glTexCoord2f" ); + qglTexCoord2fv = dllTexCoord2fv = GPA( "glTexCoord2fv" ); + qglTexCoord2i = dllTexCoord2i = GPA( "glTexCoord2i" ); + qglTexCoord2iv = dllTexCoord2iv = GPA( "glTexCoord2iv" ); + qglTexCoord2s = dllTexCoord2s = GPA( "glTexCoord2s" ); + qglTexCoord2sv = dllTexCoord2sv = GPA( "glTexCoord2sv" ); + qglTexCoord3d = dllTexCoord3d = GPA( "glTexCoord3d" ); + qglTexCoord3dv = dllTexCoord3dv = GPA( "glTexCoord3dv" ); + qglTexCoord3f = dllTexCoord3f = GPA( "glTexCoord3f" ); + qglTexCoord3fv = dllTexCoord3fv = GPA( "glTexCoord3fv" ); + qglTexCoord3i = dllTexCoord3i = GPA( "glTexCoord3i" ); + qglTexCoord3iv = dllTexCoord3iv = GPA( "glTexCoord3iv" ); + qglTexCoord3s = dllTexCoord3s = GPA( "glTexCoord3s" ); + qglTexCoord3sv = dllTexCoord3sv = GPA( "glTexCoord3sv" ); + qglTexCoord4d = dllTexCoord4d = GPA( "glTexCoord4d" ); + qglTexCoord4dv = dllTexCoord4dv = GPA( "glTexCoord4dv" ); + qglTexCoord4f = dllTexCoord4f = GPA( "glTexCoord4f" ); + qglTexCoord4fv = dllTexCoord4fv = GPA( "glTexCoord4fv" ); + qglTexCoord4i = dllTexCoord4i = GPA( "glTexCoord4i" ); + qglTexCoord4iv = dllTexCoord4iv = GPA( "glTexCoord4iv" ); + qglTexCoord4s = dllTexCoord4s = GPA( "glTexCoord4s" ); + qglTexCoord4sv = dllTexCoord4sv = GPA( "glTexCoord4sv" ); + qglTexCoordPointer = dllTexCoordPointer = GPA( "glTexCoordPointer" ); + qglTexEnvf = dllTexEnvf = GPA( "glTexEnvf" ); + qglTexEnvfv = dllTexEnvfv = GPA( "glTexEnvfv" ); + qglTexEnvi = dllTexEnvi = GPA( "glTexEnvi" ); + qglTexEnviv = dllTexEnviv = GPA( "glTexEnviv" ); + qglTexGend = dllTexGend = GPA( "glTexGend" ); + qglTexGendv = dllTexGendv = GPA( "glTexGendv" ); + qglTexGenf = dllTexGenf = GPA( "glTexGenf" ); + qglTexGenfv = dllTexGenfv = GPA( "glTexGenfv" ); + qglTexGeni = dllTexGeni = GPA( "glTexGeni" ); + qglTexGeniv = dllTexGeniv = GPA( "glTexGeniv" ); + qglTexImage1D = dllTexImage1D = GPA( "glTexImage1D" ); + qglTexImage2D = dllTexImage2D = GPA( "glTexImage2D" ); + qglTexParameterf = dllTexParameterf = GPA( "glTexParameterf" ); + qglTexParameterfv = dllTexParameterfv = GPA( "glTexParameterfv" ); + qglTexParameteri = dllTexParameteri = GPA( "glTexParameteri" ); + qglTexParameteriv = dllTexParameteriv = GPA( "glTexParameteriv" ); + qglTexSubImage1D = dllTexSubImage1D = GPA( "glTexSubImage1D" ); + qglTexSubImage2D = dllTexSubImage2D = GPA( "glTexSubImage2D" ); + qglTranslated = dllTranslated = GPA( "glTranslated" ); + qglTranslatef = dllTranslatef = GPA( "glTranslatef" ); + qglVertex2d = dllVertex2d = GPA( "glVertex2d" ); + qglVertex2dv = dllVertex2dv = GPA( "glVertex2dv" ); + qglVertex2f = dllVertex2f = GPA( "glVertex2f" ); + qglVertex2fv = dllVertex2fv = GPA( "glVertex2fv" ); + qglVertex2i = dllVertex2i = GPA( "glVertex2i" ); + qglVertex2iv = dllVertex2iv = GPA( "glVertex2iv" ); + qglVertex2s = dllVertex2s = GPA( "glVertex2s" ); + qglVertex2sv = dllVertex2sv = GPA( "glVertex2sv" ); + qglVertex3d = dllVertex3d = GPA( "glVertex3d" ); + qglVertex3dv = dllVertex3dv = GPA( "glVertex3dv" ); + qglVertex3f = dllVertex3f = GPA( "glVertex3f" ); + qglVertex3fv = dllVertex3fv = GPA( "glVertex3fv" ); + qglVertex3i = dllVertex3i = GPA( "glVertex3i" ); + qglVertex3iv = dllVertex3iv = GPA( "glVertex3iv" ); + qglVertex3s = dllVertex3s = GPA( "glVertex3s" ); + qglVertex3sv = dllVertex3sv = GPA( "glVertex3sv" ); + qglVertex4d = dllVertex4d = GPA( "glVertex4d" ); + qglVertex4dv = dllVertex4dv = GPA( "glVertex4dv" ); + qglVertex4f = dllVertex4f = GPA( "glVertex4f" ); + qglVertex4fv = dllVertex4fv = GPA( "glVertex4fv" ); + qglVertex4i = dllVertex4i = GPA( "glVertex4i" ); + qglVertex4iv = dllVertex4iv = GPA( "glVertex4iv" ); + qglVertex4s = dllVertex4s = GPA( "glVertex4s" ); + qglVertex4sv = dllVertex4sv = GPA( "glVertex4sv" ); + qglVertexPointer = dllVertexPointer = GPA( "glVertexPointer" ); + qglViewport = dllViewport = GPA( "glViewport" ); +/* + qfxMesaCreateContext = GPA("fxMesaCreateContext"); + qfxMesaCreateBestContext = GPA("fxMesaCreateBestContext"); + qfxMesaDestroyContext = GPA("fxMesaDestroyContext"); + qfxMesaMakeCurrent = GPA("fxMesaMakeCurrent"); + qfxMesaGetCurrentContext = GPA("fxMesaGetCurrentContext"); + qfxMesaSwapBuffers = GPA("fxMesaSwapBuffers"); +*/ + qglXChooseVisual = GPA("glXChooseVisual"); + qglXCreateContext = GPA("glXCreateContext"); + qglXDestroyContext = GPA("glXDestroyContext"); + qglXMakeCurrent = GPA("glXMakeCurrent"); + qglXCopyContext = GPA("glXCopyContext"); + qglXSwapBuffers = GPA("glXSwapBuffers"); + + qglLockArraysEXT = 0; + qglUnlockArraysEXT = 0; qglPointParameterfEXT = 0; qglPointParameterfvEXT = 0; qglColorTableEXT = 0; + qgl3DfxSetPaletteEXT = 0; qglSelectTextureSGIS = 0; qglMTexCoord2fSGIS = 0; + qglActiveTextureARB = 0; + qglClientActiveTextureARB = 0; return true; } @@ -3290,7 +3426,7 @@ void GLimp_EnableLogging( qboolean enable ) { if ( enable ) { - if ( !log_fp ) + if ( !glw_state.log_fp ) { struct tm *newtime; time_t aclock; @@ -3301,10 +3437,10 @@ void GLimp_EnableLogging( qboolean enable ) asctime( newtime ); - sprintf( buffer, "%s/gl.log", ri.FS_Gamedir() ); - log_fp = fopen( buffer, "wt"); + Com_sprintf( buffer, sizeof(buffer), "%s/gl.log", ri.FS_Gamedir() ); + glw_state.log_fp = fopen( buffer, "wt" ); - fprintf( log_fp, "%s\n", asctime( newtime ) ); + fprintf( glw_state.log_fp, "%s\n", asctime( newtime ) ); } qglAccum = logAccum; @@ -3431,8 +3567,8 @@ void GLimp_EnableLogging( qboolean enable ) qglGetTexGenfv = logGetTexGenfv ; qglGetTexGeniv = logGetTexGeniv ; qglGetTexImage = logGetTexImage ; -// qglGetTexLevelParameterfv = logGetTexLevelParameterfv ; -// qglGetTexLevelParameteriv = logGetTexLevelParameteriv ; + qglGetTexLevelParameterfv = logGetTexLevelParameterfv ; + qglGetTexLevelParameteriv = logGetTexLevelParameteriv ; qglGetTexParameterfv = logGetTexParameterfv ; qglGetTexParameteriv = logGetTexParameteriv ; qglHint = logHint ; @@ -3988,7 +4124,7 @@ void GLimp_EnableLogging( qboolean enable ) void GLimp_LogNewFrame( void ) { - fprintf( log_fp, "*** R_BeginFrame ***\n"); + fprintf( glw_state.log_fp, "*** R_BeginFrame ***\n" ); } diff --git a/linux/readme b/linux/readme new file mode 100644 index 0000000..6f949ec --- /dev/null +++ b/linux/readme @@ -0,0 +1,219 @@ +Quake2 3.20 For Linux +--------------------- + +Please see the readme.txt file included for general information about the +game. This file contains Linux specific information. + +Please see the file 3.20_Changes.txt for changes from previous versions. + +Requirements +------------ + +Quake2 for Linux supports the following video subsystems: + +- SVGALib Console Graphics (ref_soft.so) + - Requires SVGALib 1.2.0 or later +- X11 Window Graphics (ref_softx.so) + - X11R5 or later, XShm shared memory extension supported +- 3DFX fxMesa with Mesa 3-D or 3DFX Miniport (ref_gl.so) + - Mesa 3-D 2.6 or later, specifically compiled for 3DFX support + Mesa 3-D 2.6 compiled with 3DFX support is provided with this archive. +- Generic glX (X11) based OpenGL (ref_glx.so) + - Requires a glX based hardware accelerated OpenGL implementation. + Mesa 3-D 2.6 supports this on 3DFX hardware. + +Also included is a specific 3DFX mini-OpenGL implementation for running Quake2 +on 3DFX hardware. + +Installation +------------ + +Make sure you have the appropirate hardware, drivers and libraries installed +for the renderer you are going to play on. + +Quake2 for Linux supports the following renderers: + +- ref_soft + Software rendering under SVGALib (console only). SVGALib 1.2.10 or later + is required. Note that SVGALib 1.2.11 supports the ability to run a + SVGALib application under X11 as it will automatically allocate a new + console. The default mode is 320x240 (ModeX) since that is the lowest + resolution supported by Quake2. If SVGALib supports your video card, higher + resolution modes such as 640x480 and 800x600 are also supported. + + Please note that you may need to configure your mouse for SVGALib in + /etc/vga/libvga.config (or /etc/libvga.config). + +- ref_softx + Software rendering under X11. This uses the MITSHM Extension and should + work will virtually all Linux X Servers. **NOTE: Do not resize the window + under X11. You must use the Video menu to change resolution/window size. + + By default, the mouse will not be 'tied' to the Quake2 window. To cause + Quake2 to grab the mouse, select 'Windowed Mouse' from the video menu, + or type '_windowed_mouse 0' at the console. Do the reverse to release it. + You can bind keys to grab and release the mouse in the console, like so: + bind i "_windowed_mouse 1" + bind o "_windowed_mouse 0" + Then "i" will grab the mouse and "o" will release it. + +- ref_gl + This render can be run with two different OpenGL drivers: Mesa 3-D + ontop of Linux GLIDE, or 3DFX's mini-OpenGL Quake driver. + For Mesa 3-D, the necessary libMesaGL.so.2.6 is included with this archive. + You must copy it to /usr/lib or /usr/local/lib and run ldconfig (as root) + in order to use it. You can do this as follows: + tar cf - lib*GL* | (cd /usr/lib; tar xf -) + You should use tar to keep the symlinks intact. Once you copy them over + run ldconfig. + You must also download and install the Linux GLIDE drivers at + http://www.3dfx.com/software/download_glidel.html + And install them as instructed. + RPMs for GLIDE are available at : + http://glide.xxedgexx.com/3DfxRPMS.html + With version 3.20, the GL library is entirely runtime loaded. This means + you can specify what shared object to load for GL display. + To use Mesa 3-D GL (console), run quake with: + ./quake2 +set vid_ref gl +set gl_driver libMesaGL.so.2 + To use the 3DFX OpenGL Miniport, run the included quake2.3dfxgl: + ./quake2 +set vid_ref gl +set gl_driver lib3dfxgl.so + The gl_driver cvar indicates the name of the library to load for GL + functions. It can be in any directory listed in /etc/ld.so.conf + or in /etc/quake2.conf + + **NOTE: There is a problem on libc5 systems where a vid_restart (causing + a reload of the video system) will crash. There doesn't seem to be a + solution to this yet. It looks to be some sort of ld.so dynamic loading + interaction with SVGALib and ref_gl.so. A work around is to start in + software mode (./quake2 +set vid_ref soft), then use the menu to set your + mode and a vid_restart will work when going from software to GL. Exit + out then and save your video mode settings. + This problem does not occur on libc6 (glibc) based systems; vid_restart + works fine on there. + +- ref_glx + ref_glx should run on many different hardward OpenGL implementations under + Linux and X11. This binary is an X11 application and must be run under + X11. It will work with Mesa 3-D as a standard glX based OpenGL + applications. If the Mesa 3-D library is compiled with 3DFX support, + you can have Mesa 3-D support 3DFX hardware under X11 by setting the + enviroment variable "MESA_GLX_FX" to "fullscreen" for fullscreen mode + and "window" for windowed mode, eg. "export MESA_GLX_FX=fullscreen" for sh + or "setenv MESA_GLX_FX fullscreen" for csh. + + As with ref_gl, the "gl_driver" cvar indicates the shared library to load + for OpenGL functions (the glX functions must provided in that library + as well). + +To install the Quake2 data files, mount your Quake2 CD and copy +the directory install/data to the location where you want Quake2. You +can also symlink it, but I don't recommend that. Around 200MB of disk +space is required for a full installation. + +For example: + cp -r /mnt/cdrom/install/data/* /usr/games/quake2 + +Permissions +----------- + +Quake2 requires root permissions to use the software (SVGALib) and GL (MesaGL +w/3dfx) renders. In order to make this secure, some special considerations +must be made. + +Quake2 should get setuid root: + chown root quake2 + chmod 4711 quake2 + +And the ref_soft.so and ref_gl.so files must owned by root. + +The file /etc/quake2.conf must be installed. This file contains a single +line with the path of where the ref shared libraries can be found. +A sample one is included that lists /usr/games/quake2 as the default +path. The libraries are only loaded out of the directory listed in +/etc/quake2.conf for security considerations. + +Special permissions are not required for the softx renderer, but quake2 may +still need to be setuid root to open the sound device (quake2 will give up +setuid root permissions before loading softx). + +NOTE: If you use a setuid quake2 binary and run it as a normal user, it +will NOT be able to switch renderers on the fly because root permissions +are given up after the renderer is loaded. You can switch renderers on the +fly if you run quake2 as root (su or log in as root). + +NOTE: When the quake2 binary is run in dedicated server mode +(+set dedicated 1), no special permissions are required and +/etc/quake2.conf is not read since no renderer is loaded. + +---- + +The first time you run Quake2, it will use ref_soft or ref_softx based +on whether a DISPLAY environment variable exists. + +To force the loading of a specific renderer at load time, use the following +command lines: + + ./quake2 +set vid_ref soft + ./quake2 +set vid_ref softx + ./quake2 +set vid_ref gl + ./quake2 +set vid_ref glx + +Linux Specific Cvars +-------------------- + +To set this, use +set on the command line, i.e.: + ./quake2 +set cd_dev /dev/hdc +set sndmono 1 + +nocdaudio (defaults to 0) + Do not enable cd audio if not zero + +sndbits (defaults to 16) + Set sound bit sample size. + +sndspeed (defaults to 0) + Set sound speed. Usual values are 8000, 11025, 22051 and 44100. + If set to zero, causes the sound driver to attempt speeds in the following + order: 11025, 22051, 44100, 8000. + +sndchannels (defaults to 2) + Indicates stereo or mono sound. Defaults to 2 (stereo). Use 1 for mono. + +nostdout (defaults to 0) + Whether to output console msgs to standard out. Non-zero is cease output. + +Dedicated server +---------------- + +To run Linux Quake2 as a dedicated server, just run it as follows: + + ./quake2 +set dedicated 1 + +You can also set dmflags, timelimit, etc. in a config file, like so: + set timelimit 20 + set fraglimit 25 + set dmflags 532 + map fact3 + +Then exec that config file on load, like so: + + ./quake2 +set dedicated 1 +exec server.cfg + +If you use a config file, you must put a 'map' command in it or the +server won't load a map. + +To run a dedicated server in the background, use this; + + nohup ./quake2 +set dedicated 1 +exec server.cfg & + +A better way is to run Quake2 on a tty via screen. screen can be found +at ftp://prep.ai.mit.edu/pub/gnu/screen-3.7.4.tar.gz, but it comes with +most modern Linux installations now. + +----------------------------------------------------------------------------- + +Linux Quake2 is an unsupported product. Usage of this product is bound by +the legal notice found on the distribution Quake2 CDROM. + +/// Zoid +zoid@idsoftware.com + diff --git a/linux/readme-3.21-release b/linux/readme-3.21-release new file mode 100644 index 0000000..a26ee07 --- /dev/null +++ b/linux/readme-3.21-release @@ -0,0 +1,23 @@ +12-22-2001 + +Some notes about this release on linux: + +#1: it is recommended that you have a working Quake2 installation already +(i.e. download precompiled binaries and stuff, have /usr/local/games/quake2 +with all the files etc.) + +#2: it builds in debug, only ref_glx.so has been tested + +once compiled, you need to create baseq2/ directory, +and symlink the pak, symlink debugi386-glibc/gamei386.so + +then to start Q2, in debugi386-glibc: +ln -s /usr/local/games/quake2/baseq2 +./quake2 +set vid_ref glx +set gl_driver /usr/lib/libGL.so + +you will need to edit /etc/quake2.conf, make it point to the right place +for loading of ref_glx.so +(I just put '.' in my quake2.conf to rely on current dir) + +TTimo (ttimo@idsoftware.com) + diff --git a/linux/readme.axp b/linux/readme.axp new file mode 100644 index 0000000..14c479c --- /dev/null +++ b/linux/readme.axp @@ -0,0 +1,53 @@ +Quake2 Dedicated 3.18 For Linux AXP +----------------------------------- + +Please see the readme.txt file included for general information about the +game. This file contains Linux/AXP specific information. + +Requirements +------------ + +Linux Alpha kernel 2.0.30 or later, Redhat 5.0 (glibc) or later. + +Installation +------------ + +To install the Quake2 data files, mount your Quake2 CD and copy +the directory install/data to the location where you want Quake2. You +can also symlink it, but I don't recommend that. Around 200MB of disk +space is required for a full installation. + +For example: + cp -r /mnt/cdrom/install/data/* /usr/games/quake2 + +This binary only runs as a dedicated server and requires no special +user permissions. + +You can also set dmflags, timelimit, etc. in a config file, like so: + set timelimit 20 + set fraglimit 25 + set dmflags 532 + map fact3 + +Then exec that config file on load, like so: + + ./q2ded +exec server.cfg + +If you use a config file, you must put a 'map' command in it or the +server won't load a map. + +To run a dedicated server in the background, use this; + + nohup ./q2ded +exec server.cfg & + +A better way is to run Quake2 on a tty via screen. screen can be found +at ftp://prep.ai.mit.edu/pub/gnu/screen-3.7.4.tar.gz. + +----------------------------------------------------------------------------- + +Linux Quake2 is an unsupported product. Usage of this product is bound by +the legal notice found on the distribution Quake2 CDROM. + +/// Zoid +zoid@idsoftware.com + diff --git a/linux/rw_in_svgalib.c b/linux/rw_in_svgalib.c index 31f5734..713a22e 100644 --- a/linux/rw_in_svgalib.c +++ b/linux/rw_in_svgalib.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include #include #include diff --git a/linux/rw_linux.h b/linux/rw_linux.h index c9a59c1..02ad26a 100644 --- a/linux/rw_linux.h +++ b/linux/rw_linux.h @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ typedef void (*Key_Event_fp_t)(int key, qboolean down); diff --git a/linux/rw_svgalib.c b/linux/rw_svgalib.c index 3799274..cf9cce6 100644 --- a/linux/rw_svgalib.c +++ b/linux/rw_svgalib.c @@ -1,4 +1,23 @@ /* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +/* ** RW_SVGALBI.C ** ** This file contains ALL Linux specific stuff having to do with the diff --git a/linux/rw_x11.c b/linux/rw_x11.c index c3fd7ed..257b247 100644 --- a/linux/rw_x11.c +++ b/linux/rw_x11.c @@ -1,4 +1,23 @@ /* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +/* ** RW_X11.C ** ** This file contains ALL Linux specific stuff having to do with the @@ -29,6 +48,7 @@ #include #include #include +#include #include "../ref_soft/r_local.h" #include "../client/keys.h" @@ -37,22 +57,25 @@ /*****************************************************************************/ static qboolean doShm; -Display *x_disp; +static Display *dpy; static Colormap x_cmap; -static Window x_win; +static Window win; static GC x_gc; static Visual *x_vis; -XVisualInfo *x_visinfo; -//static XImage *x_image; +static XVisualInfo *x_visinfo; +static int win_x, win_y; -#define STD_EVENT_MASK (StructureNotifyMask | KeyPressMask \ - | KeyReleaseMask | ExposureMask | PointerMotionMask | \ - ButtonPressMask | ButtonReleaseMask) +#define KEY_MASK (KeyPressMask | KeyReleaseMask) +#define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | \ + PointerMotionMask | ButtonMotionMask ) +#define X_MASK (KEY_MASK | MOUSE_MASK | VisibilityChangeMask | StructureNotifyMask | ExposureMask ) static int x_shmeventtype; //static XShmSegmentInfo x_shminfo; static qboolean oktodraw = false; +static qboolean ignorefirst = false; +static qboolean exposureflag = false; static qboolean X11_active = false; int XShmQueryExtension(Display *); @@ -62,19 +85,158 @@ int current_framebuffer; static XImage *x_framebuffer[2] = { 0, 0 }; static XShmSegmentInfo x_shminfo[2]; -struct -{ - int key; - int down; -} keyq[64]; -int keyq_head=0; -int keyq_tail=0; - int config_notify=0; int config_notify_width; int config_notify_height; -typedef unsigned short PIXEL; +typedef unsigned short PIXEL16; +typedef unsigned long PIXEL24; +static PIXEL16 st2d_8to16table[256]; +static PIXEL24 st2d_8to24table[256]; +static int shiftmask_fl=0; +static long r_shift,g_shift,b_shift; +static unsigned long r_mask,g_mask,b_mask; + +void shiftmask_init(void) +{ + unsigned int x; + r_mask=x_vis->red_mask; + g_mask=x_vis->green_mask; + b_mask=x_vis->blue_mask; + for(r_shift=-8,x=1;x0) { + p=(r<<(r_shift))&r_mask; + } else if(r_shift<0) { + p=(r>>(-r_shift))&r_mask; + } else p|=(r&r_mask); + + if(g_shift>0) { + p|=(g<<(g_shift))&g_mask; + } else if(g_shift<0) { + p|=(g>>(-g_shift))&g_mask; + } else p|=(g&g_mask); + + if(b_shift>0) { + p|=(b<<(b_shift))&b_mask; + } else if(b_shift<0) { + p|=(b>>(-b_shift))&b_mask; + } else p|=(b&b_mask); + + return p; +} + +PIXEL24 xlib_rgb24(int r,int g,int b) +{ + PIXEL24 p; + if(shiftmask_fl==0) shiftmask_init(); + p=0; + + if(r_shift>0) { + p=(r<<(r_shift))&r_mask; + } else if(r_shift<0) { + p=(r>>(-r_shift))&r_mask; + } else p|=(r&r_mask); + + if(g_shift>0) { + p|=(g<<(g_shift))&g_mask; + } else if(g_shift<0) { + p|=(g>>(-g_shift))&g_mask; + } else p|=(g&g_mask); + + if(b_shift>0) { + p|=(b<<(b_shift))&b_mask; + } else if(b_shift<0) { + p|=(b>>(-b_shift))&b_mask; + } else p|=(b&b_mask); + + return p; +} + + +void st2_fixup( XImage *framebuf, int x, int y, int width, int height) +{ + int xi,yi; + unsigned char *src; + PIXEL16 *dest; + register int count, n; + + if( (x<0)||(y<0) )return; + + for (yi = y; yi < (y+height); yi++) { + src = &framebuf->data [yi * framebuf->bytes_per_line]; + + // Duff's Device + count = width; + n = (count + 7) / 8; + dest = ((PIXEL16 *)src) + x+width - 1; + src += x+width - 1; + + switch (count % 8) { + case 0: do { *dest-- = st2d_8to16table[*src--]; + case 7: *dest-- = st2d_8to16table[*src--]; + case 6: *dest-- = st2d_8to16table[*src--]; + case 5: *dest-- = st2d_8to16table[*src--]; + case 4: *dest-- = st2d_8to16table[*src--]; + case 3: *dest-- = st2d_8to16table[*src--]; + case 2: *dest-- = st2d_8to16table[*src--]; + case 1: *dest-- = st2d_8to16table[*src--]; + } while (--n > 0); + } + +// for(xi = (x+width-1); xi >= x; xi--) { +// dest[xi] = st2d_8to16table[src[xi]]; +// } + } +} + +void st3_fixup( XImage *framebuf, int x, int y, int width, int height) +{ + int xi,yi; + unsigned char *src; + PIXEL24 *dest; + register int count, n; + + if( (x<0)||(y<0) )return; + + for (yi = y; yi < (y+height); yi++) { + src = &framebuf->data [yi * framebuf->bytes_per_line]; + + // Duff's Device + count = width; + n = (count + 7) / 8; + dest = ((PIXEL24 *)src) + x+width - 1; + src += x+width - 1; + + switch (count % 8) { + case 0: do { *dest-- = st2d_8to24table[*src--]; + case 7: *dest-- = st2d_8to24table[*src--]; + case 6: *dest-- = st2d_8to24table[*src--]; + case 5: *dest-- = st2d_8to24table[*src--]; + case 4: *dest-- = st2d_8to24table[*src--]; + case 3: *dest-- = st2d_8to24table[*src--]; + case 2: *dest-- = st2d_8to24table[*src--]; + case 1: *dest-- = st2d_8to24table[*src--]; + } while (--n > 0); + } + +// for(xi = (x+width-1); xi >= x; xi--) { +// dest[xi] = st2d_8to16table[src[xi]]; +// } + } +} + + // Console variables that we need to access from this module @@ -84,18 +246,21 @@ typedef unsigned short PIXEL; // this is inside the renderer shared lib, so these are called from vid_so -static qboolean mouse_avail; -static int mouse_buttonstate; -static int mouse_oldbuttonstate; -static int mouse_x, mouse_y; -static int old_mouse_x, old_mouse_y; +static qboolean mouse_avail; +static int mouse_buttonstate; +static int mouse_oldbuttonstate; +static int old_mouse_x, old_mouse_y; static int mx, my; -static float old_windowed_mouse; -static int p_mouse_x, p_mouse_y; -static cvar_t *_windowed_mouse; +static qboolean mouse_active = false; +static qboolean dgamouse = false; + static cvar_t *m_filter; static cvar_t *in_mouse; +static cvar_t *in_dgamouse; + +static cvar_t *vid_xpos; // X coordinate of window position +static cvar_t *vid_ypos; // Y coordinate of window position static qboolean mlooking; @@ -134,9 +299,9 @@ void RW_IN_Init(in_state_t *in_state_p) in_state = in_state_p; // mouse variables - _windowed_mouse = ri.Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE); m_filter = ri.Cvar_Get ("m_filter", "0", 0); - in_mouse = ri.Cvar_Get ("in_mouse", "1", CVAR_ARCHIVE); + in_mouse = ri.Cvar_Get ("in_mouse", "0", CVAR_ARCHIVE); + in_dgamouse = ri.Cvar_Get ("in_dgamouse", "1", CVAR_ARCHIVE); freelook = ri.Cvar_Get( "freelook", "0", 0 ); lookstrafe = ri.Cvar_Get ("lookstrafe", "0", 0); sensitivity = ri.Cvar_Get ("sensitivity", "3", 0); @@ -150,7 +315,6 @@ void RW_IN_Init(in_state_t *in_state_p) ri.Cmd_AddCommand ("force_centerview", Force_CenterView_f); - mouse_x = mouse_y = 0.0; mouse_avail = true; } @@ -193,119 +357,35 @@ void RW_IN_Move (usercmd_t *cmd) if (m_filter->value) { - mouse_x = (mx + old_mouse_x) * 0.5; - mouse_y = (my + old_mouse_y) * 0.5; - } else { - mouse_x = mx; - mouse_y = my; + mx = (mx + old_mouse_x) * 0.5; + my = (my + old_mouse_y) * 0.5; } old_mouse_x = mx; old_mouse_y = my; - if (!mouse_x && !mouse_y) - return; - - mouse_x *= sensitivity->value; - mouse_y *= sensitivity->value; + mx *= sensitivity->value; + my *= sensitivity->value; // add mouse X/Y movement to cmd if ( (*in_state->in_strafe_state & 1) || (lookstrafe->value && mlooking )) - cmd->sidemove += m_side->value * mouse_x; + cmd->sidemove += m_side->value * mx; else - in_state->viewangles[YAW] -= m_yaw->value * mouse_x; + in_state->viewangles[YAW] -= m_yaw->value * mx; if ( (mlooking || freelook->value) && !(*in_state->in_strafe_state & 1)) { - in_state->viewangles[PITCH] += m_pitch->value * mouse_y; + in_state->viewangles[PITCH] += m_pitch->value * my; } else { - cmd->forwardmove -= m_forward->value * mouse_y; + cmd->forwardmove -= m_forward->value * my; } mx = my = 0; } -void RW_IN_Frame (void) -{ -} - -void RW_IN_Activate(void) -{ -} - -/*****************************************************************************/ - -static PIXEL st2d_8to16table[256]; -static int shiftmask_fl=0; -static long r_shift,g_shift,b_shift; -static unsigned long r_mask,g_mask,b_mask; - -void shiftmask_init() -{ - unsigned int x; - r_mask=x_vis->red_mask; - g_mask=x_vis->green_mask; - b_mask=x_vis->blue_mask; - for(r_shift=-8,x=1;x0) { - p=(r<<(r_shift))&r_mask; - } else if(r_shift<0) { - p=(r>>(-r_shift))&r_mask; - } else p|=(r&r_mask); - - if(g_shift>0) { - p|=(g<<(g_shift))&g_mask; - } else if(g_shift<0) { - p|=(g>>(-g_shift))&g_mask; - } else p|=(g&g_mask); - - if(b_shift>0) { - p|=(b<<(b_shift))&b_mask; - } else if(b_shift<0) { - p|=(b>>(-b_shift))&b_mask; - } else p|=(b&b_mask); - - return p; -} - -void st2_fixup( XImage *framebuf, int x, int y, int width, int height) -{ - int xi,yi; - unsigned char *src; - PIXEL *dest; - - if( (x<0)||(y<0) )return; - - for (yi = y; yi < (y+height); yi++) { - src = &framebuf->data [yi * framebuf->bytes_per_line]; - dest = (PIXEL*)src; - for(xi = (x+width-1); xi >= x; xi -= 8) { - dest[xi ] = st2d_8to16table[src[xi ]]; - dest[xi-1] = st2d_8to16table[src[xi-1]]; - dest[xi-2] = st2d_8to16table[src[xi-2]]; - dest[xi-3] = st2d_8to16table[src[xi-3]]; - dest[xi-4] = st2d_8to16table[src[xi-4]]; - dest[xi-5] = st2d_8to16table[src[xi-5]]; - dest[xi-6] = st2d_8to16table[src[xi-6]]; - dest[xi-7] = st2d_8to16table[src[xi-7]]; - } - } -} - // ======================================================================== // makes a null cursor // ======================================================================== @@ -332,6 +412,103 @@ static Cursor CreateNullCursor(Display *display, Window root) return cursor; } +static void install_grabs(void) +{ + +// inviso cursor + XDefineCursor(dpy, win, CreateNullCursor(dpy, win)); + + XGrabPointer(dpy, win, + True, + 0, + GrabModeAsync, GrabModeAsync, + win, + None, + CurrentTime); + + if (in_dgamouse->value) { + int MajorVersion, MinorVersion; + + if (!XF86DGAQueryVersion(dpy, &MajorVersion, &MinorVersion)) { + // unable to query, probalby not supported + ri.Con_Printf( PRINT_ALL, "Failed to detect XF86DGA Mouse\n" ); + ri.Cvar_Set( "in_dgamouse", "0" ); + } else { + dgamouse = true; + XF86DGADirectVideo(dpy, DefaultScreen(dpy), XF86DGADirectMouse); + XWarpPointer(dpy, None, win, 0, 0, 0, 0, 0, 0); + } + } else + XWarpPointer(dpy, None, win, 0, 0, 0, 0, vid.width / 2, vid.height / 2); + + XGrabKeyboard(dpy, win, + False, + GrabModeAsync, GrabModeAsync, + CurrentTime); + + mouse_active = true; + + ignorefirst = true; + +// XSync(dpy, True); +} + +static void uninstall_grabs(void) +{ + if (!dpy || !win) + return; + + if (dgamouse) { + dgamouse = false; + XF86DGADirectVideo(dpy, DefaultScreen(dpy), 0); + } + + XUngrabPointer(dpy, CurrentTime); + XUngrabKeyboard(dpy, CurrentTime); + +// inviso cursor + XUndefineCursor(dpy, win); + + mouse_active = false; +} + +static void IN_DeactivateMouse( void ) +{ + if (!mouse_avail || !dpy || !win) + return; + + if (mouse_active) { + uninstall_grabs(); + mouse_active = false; + } +} + +static void IN_ActivateMouse( void ) +{ + if (!mouse_avail || !dpy || !win) + return; + + if (!mouse_active) { + mx = my = 0; // don't spazz + install_grabs(); + mouse_active = true; + } +} + +void RW_IN_Frame (void) +{ +} + +void RW_IN_Activate(qboolean active) +{ + if (active) + IN_ActivateMouse(); + else + IN_DeactivateMouse (); +} + +/*****************************************************************************/ + void ResetFrameBuffer(void) { int mem; @@ -348,7 +525,7 @@ void ResetFrameBuffer(void) if (pwidth == 3) pwidth = 4; mem = ((vid.width*pwidth+7)&~7) * vid.height; - x_framebuffer[0] = XCreateImage( x_disp, + x_framebuffer[0] = XCreateImage(dpy, x_vis, x_visinfo->depth, ZPixmap, @@ -376,13 +553,13 @@ void ResetSharedFrameBuffers(void) // free up old frame buffer memory if (x_framebuffer[frm]) { - XShmDetach(x_disp, &x_shminfo[frm]); + XShmDetach(dpy, &x_shminfo[frm]); free(x_framebuffer[frm]); shmdt(x_shminfo[frm].shmaddr); } // create the image - x_framebuffer[frm] = XShmCreateImage( x_disp, + x_framebuffer[frm] = XShmCreateImage( dpy, x_vis, x_visinfo->depth, ZPixmap, @@ -407,18 +584,16 @@ void ResetSharedFrameBuffers(void) x_shminfo[frm].shmaddr = (void *) shmat(x_shminfo[frm].shmid, 0, 0); - ri.Con_Printf(PRINT_ALL, - "MITSHM shared memory (id=%d, addr=0x%lx)\n", - x_shminfo[frm].shmid, - (long) x_shminfo[frm].shmaddr); + ri.Con_Printf(PRINT_DEVELOPER, "MITSHM shared memory (id=%d, addr=0x%lx)\n", + x_shminfo[frm].shmid, (long) x_shminfo[frm].shmaddr); x_framebuffer[frm]->data = x_shminfo[frm].shmaddr; // get the X server to attach to it - if (!XShmAttach(x_disp, &x_shminfo[frm])) + if (!XShmAttach(dpy, &x_shminfo[frm])) Sys_Error("VID: XShmAttach() failed\n"); - XSync(x_disp, 0); + XSync(dpy, 0); shmctl(x_shminfo[frm].shmid, IPC_RMID, 0); } @@ -430,8 +605,8 @@ void ResetSharedFrameBuffers(void) void TragicDeath(int signal_num) { - XAutoRepeatOn(x_disp); - XCloseDisplay(x_disp); +// XAutoRepeatOn(dpy); + XCloseDisplay(dpy); Sys_Error("This death brought to you by the number %d\n", signal_num); } @@ -565,88 +740,111 @@ int XLateKey(XKeyEvent *ev) return key; } -void GetEvent(void) +void HandleEvents(void) { - XEvent x_event; + XEvent event; int b; + qboolean dowarp = false; + int mwx = vid.width/2; + int mwy = vid.height/2; - XNextEvent(x_disp, &x_event); - switch(x_event.type) { - case KeyPress: - keyq[keyq_head].key = XLateKey(&x_event.xkey); - keyq[keyq_head].down = true; - keyq_head = (keyq_head + 1) & 63; - break; - case KeyRelease: - keyq[keyq_head].key = XLateKey(&x_event.xkey); - keyq[keyq_head].down = false; - keyq_head = (keyq_head + 1) & 63; - break; + while (XPending(dpy)) { - case MotionNotify: - if (_windowed_mouse->value) { - mx += ((int)x_event.xmotion.x - (int)(vid.width/2)); - my += ((int)x_event.xmotion.y - (int)(vid.height/2)); + XNextEvent(dpy, &event); - /* move the mouse to the window center again */ - XSelectInput(x_disp,x_win, STD_EVENT_MASK & ~PointerMotionMask); - XWarpPointer(x_disp,None,x_win,0,0,0,0, - (vid.width/2),(vid.height/2)); - XSelectInput(x_disp,x_win, STD_EVENT_MASK); - } else { - mx = ((int)x_event.xmotion.x - (int)p_mouse_x); - my = ((int)x_event.xmotion.y - (int)p_mouse_y); - p_mouse_x=x_event.xmotion.x; - p_mouse_y=x_event.xmotion.y; + switch(event.type) { + case KeyPress: + case KeyRelease: + if (in_state && in_state->Key_Event_fp) + in_state->Key_Event_fp (XLateKey(&event.xkey), event.type == KeyPress); + break; + + case MotionNotify: + if (ignorefirst) { + ignorefirst = false; + break; + } + + if (mouse_active) { + if (dgamouse) { + mx += (event.xmotion.x + win_x) * 2; + my += (event.xmotion.y + win_y) * 2; + } + else + { + mx += ((int)event.xmotion.x - mwx) * 2; + my += ((int)event.xmotion.y - mwy) * 2; + mwx = event.xmotion.x; + mwy = event.xmotion.y; + + if (mx || my) + dowarp = true; + } + } + break; + + + break; + + case ButtonPress: + b=-1; + if (event.xbutton.button == 1) + b = 0; + else if (event.xbutton.button == 2) + b = 2; + else if (event.xbutton.button == 3) + b = 1; + if (b>=0) + mouse_buttonstate |= 1<=0) + mouse_buttonstate &= ~(1<modified = false; + vid_ypos->modified = false; + win_x = event.xcreatewindow.x; + win_y = event.xcreatewindow.y; + break; + + case ConfigureNotify : + ri.Cvar_Set( "vid_xpos", va("%d", event.xcreatewindow.x)); + ri.Cvar_Set( "vid_ypos", va("%d", event.xcreatewindow.y)); + vid_xpos->modified = false; + vid_ypos->modified = false; + win_x = event.xconfigure.x; + win_y = event.xconfigure.y; + config_notify_width = event.xconfigure.width; + config_notify_height = event.xconfigure.height; + if (config_notify_width != vid.width || + config_notify_height != vid.height) + XMoveResizeWindow(dpy, win, win_x, win_y, vid.width, vid.height); + config_notify = 1; + break; + + default: + if (doShm && event.type == x_shmeventtype) + oktodraw = true; + if (event.type == Expose && !event.xexpose.count) + exposureflag = true; } - break; - - case ButtonPress: - b=-1; - if (x_event.xbutton.button == 1) - b = 0; - else if (x_event.xbutton.button == 2) - b = 2; - else if (x_event.xbutton.button == 3) - b = 1; - if (b>=0) - mouse_buttonstate |= 1<=0) - mouse_buttonstate &= ~(1<value) { - old_windowed_mouse = _windowed_mouse->value; - - if (!_windowed_mouse->value) { - /* ungrab the pointer */ - XUngrabPointer(x_disp,CurrentTime); - } else { - /* grab the pointer */ - XGrabPointer(x_disp,x_win,True,0,GrabModeAsync, - GrabModeAsync,x_win,None,CurrentTime); - } + + if (dowarp) { + /* move the mouse to the window center again */ + XWarpPointer(dpy,None,win,0,0,0,0, vid.width/2,vid.height/2); } } @@ -660,9 +858,13 @@ void GetEvent(void) */ int SWimp_Init( void *hInstance, void *wndProc ) { + + vid_xpos = ri.Cvar_Get ("vid_xpos", "3", CVAR_ARCHIVE); + vid_ypos = ri.Cvar_Get ("vid_ypos", "22", CVAR_ARCHIVE); + // open the display - x_disp = XOpenDisplay(0); - if (!x_disp) + dpy = XOpenDisplay(0); + if (!dpy) { if (getenv("DISPLAY")) Sys_Error("VID: Could not open display [%s]\n", @@ -700,6 +902,7 @@ static qboolean SWimp_InitGraphics( qboolean fullscreen ) XVisualInfo template; int num_visuals; int template_mask; + Window root; srandom(getpid()); @@ -709,10 +912,10 @@ static qboolean SWimp_InitGraphics( qboolean fullscreen ) // let the sound and input subsystems know about the new window ri.Vid_NewWindow (vid.width, vid.height); - XAutoRepeatOff(x_disp); +// XAutoRepeatOff(dpy); // for debugging only - XSynchronize(x_disp, True); + XSynchronize(dpy, True); // check for command-line window size template_mask = 0; @@ -732,14 +935,14 @@ static qboolean SWimp_InitGraphics( qboolean fullscreen ) #endif { int screen; - screen = XDefaultScreen(x_disp); + screen = XDefaultScreen(dpy); template.visualid = - XVisualIDFromVisual(XDefaultVisual(x_disp, screen)); + XVisualIDFromVisual(XDefaultVisual(dpy, screen)); template_mask = VisualIDMask; } // pick a visual- warn if more than one was available - x_visinfo = XGetVisualInfo(x_disp, template_mask, &template, &num_visuals); + x_visinfo = XGetVisualInfo(dpy, template_mask, &template, &num_visuals); if (num_visuals > 1) { printf("Found more than one visual id at depth %d:\n", template.depth); @@ -755,19 +958,17 @@ static qboolean SWimp_InitGraphics( qboolean fullscreen ) } #if 0 - if (verbose) - { - printf("Using visualid %d:\n", (int)(x_visinfo->visualid)); - printf(" screen %d\n", x_visinfo->screen); - printf(" red_mask 0x%x\n", (int)(x_visinfo->red_mask)); - printf(" green_mask 0x%x\n", (int)(x_visinfo->green_mask)); - printf(" blue_mask 0x%x\n", (int)(x_visinfo->blue_mask)); - printf(" colormap_size %d\n", x_visinfo->colormap_size); - printf(" bits_per_rgb %d\n", x_visinfo->bits_per_rgb); - } + printf("Using visualid %d:\n", (int)(x_visinfo->visualid)); + printf(" screen %d\n", x_visinfo->screen); + printf(" red_mask 0x%x\n", (int)(x_visinfo->red_mask)); + printf(" green_mask 0x%x\n", (int)(x_visinfo->green_mask)); + printf(" blue_mask 0x%x\n", (int)(x_visinfo->blue_mask)); + printf(" colormap_size %d\n", x_visinfo->colormap_size); + printf(" bits_per_rgb %d\n", x_visinfo->bits_per_rgb); #endif x_vis = x_visinfo->visual; + root = XRootWindow(dpy, x_visinfo->screen); // setup attributes for main window { @@ -775,28 +976,20 @@ static qboolean SWimp_InitGraphics( qboolean fullscreen ) XSetWindowAttributes attribs; Colormap tmpcmap; - tmpcmap = XCreateColormap(x_disp, XRootWindow(x_disp, - x_visinfo->screen), x_vis, AllocNone); + tmpcmap = XCreateColormap(dpy, root, x_vis, AllocNone); - attribs.event_mask = STD_EVENT_MASK; + attribs.event_mask = X_MASK; attribs.border_pixel = 0; attribs.colormap = tmpcmap; // create the main window - x_win = XCreateWindow( x_disp, - XRootWindow(x_disp, x_visinfo->screen), - 0, 0, // x, y - vid.width, vid.height, - 0, // borderwidth - x_visinfo->depth, - InputOutput, - x_vis, - attribmask, - &attribs ); - XStoreName(x_disp, x_win, "Quake II"); + win = XCreateWindow(dpy, root, (int)vid_xpos->value, (int)vid_ypos->value, + vid.width, vid.height, 0, x_visinfo->depth, InputOutput, x_vis, + attribmask, &attribs ); + XStoreName(dpy, win, "Quake II"); if (x_visinfo->class != TrueColor) - XFreeColormap(x_disp, tmpcmap); + XFreeColormap(dpy, tmpcmap); } if (x_visinfo->depth == 8) @@ -804,40 +997,36 @@ static qboolean SWimp_InitGraphics( qboolean fullscreen ) // create and upload the palette if (x_visinfo->class == PseudoColor) { - x_cmap = XCreateColormap(x_disp, x_win, x_vis, AllocAll); - XSetWindowColormap(x_disp, x_win, x_cmap); + x_cmap = XCreateColormap(dpy, win, x_vis, AllocAll); + XSetWindowColormap(dpy, win, x_cmap); } } -// inviso cursor - XDefineCursor(x_disp, x_win, CreateNullCursor(x_disp, x_win)); - // create the GC { XGCValues xgcvalues; int valuemask = GCGraphicsExposures; xgcvalues.graphics_exposures = False; - x_gc = XCreateGC(x_disp, x_win, valuemask, &xgcvalues ); + x_gc = XCreateGC(dpy, win, valuemask, &xgcvalues ); } -// map the window - XMapWindow(x_disp, x_win); + XMapWindow(dpy, win); + XMoveWindow(dpy, win, (int)vid_xpos->value, (int)vid_ypos->value); // wait for first exposure event { XEvent event; + exposureflag = false; do { - XNextEvent(x_disp, &event); - if (event.type == Expose && !event.xexpose.count) - oktodraw = true; - } while (!oktodraw); + HandleEvents(); + } while (!exposureflag); } // now safe to draw // even if MITSHM is available, make sure it's a local connection - if (XShmQueryExtension(x_disp)) + if (XShmQueryExtension(dpy)) { char *displayname; doShm = true; @@ -854,7 +1043,7 @@ static qboolean SWimp_InitGraphics( qboolean fullscreen ) if (doShm) { - x_shmeventtype = XShmGetEventBase(x_disp) + ShmCompletion; + x_shmeventtype = XShmGetEventBase(dpy) + ShmCompletion; ResetSharedFrameBuffers(); } else @@ -864,7 +1053,7 @@ static qboolean SWimp_InitGraphics( qboolean fullscreen ) vid.rowbytes = x_framebuffer[0]->bytes_per_line; vid.buffer = x_framebuffer[0]->data; -// XSynchronize(x_disp, False); +// XSynchronize(dpy, False); X11_active = true; @@ -903,29 +1092,28 @@ void SWimp_EndFrame (void) if (doShm) { - - if (x_visinfo->depth != 8) - st2_fixup( x_framebuffer[current_framebuffer], - 0, 0, vid.width, vid.height); - if (!XShmPutImage(x_disp, x_win, x_gc, - x_framebuffer[current_framebuffer], 0, 0, - 0, 0, vid.width, vid.height, True)) - Sys_Error("VID_Update: XShmPutImage failed\n"); + if (x_visinfo->depth == 16) + st2_fixup( x_framebuffer[current_framebuffer], 0, 0, vid.width, vid.height); + else if (x_visinfo->depth == 24) + st3_fixup( x_framebuffer[current_framebuffer], 0, 0, vid.width, vid.height); + if (!XShmPutImage(dpy, win, x_gc, + x_framebuffer[current_framebuffer], 0, 0, 0, 0, vid.width, vid.height, True)) + Sys_Error("VID_Update: XShmPutImage failed\n"); oktodraw = false; while (!oktodraw) - GetEvent(); + HandleEvents(); current_framebuffer = !current_framebuffer; vid.buffer = x_framebuffer[current_framebuffer]->data; - XSync(x_disp, False); + XSync(dpy, False); } else { - if (x_visinfo->depth != 8) - st2_fixup( x_framebuffer[current_framebuffer], - 0, 0, vid.width, vid.height); - XPutImage(x_disp, x_win, x_gc, x_framebuffer[0], - 0, 0, 0, 0, vid.width, vid.height); - XSync(x_disp, False); + if (x_visinfo->depth == 16) + st2_fixup( x_framebuffer[current_framebuffer], 0, 0, vid.width, vid.height); + else if (x_visinfo->depth == 24) + st3_fixup( x_framebuffer[current_framebuffer], 0, 0, vid.width, vid.height); + XPutImage(dpy, win, x_gc, x_framebuffer[0], 0, 0, 0, 0, vid.width, vid.height); + XSync(dpy, False); } } @@ -974,9 +1162,10 @@ void SWimp_SetPalette( const unsigned char *palette ) if ( !palette ) palette = ( const unsigned char * ) sw_state.currentpalette; - for(i=0;i<256;i++) - st2d_8to16table[i]= xlib_rgb(palette[i*4], - palette[i*4+1],palette[i*4+2]); + for(i=0;i<256;i++) { + st2d_8to16table[i]= xlib_rgb16(palette[i*4], palette[i*4+1],palette[i*4+2]); + st2d_8to24table[i]= xlib_rgb24(palette[i*4], palette[i*4+1],palette[i*4+2]); + } if (x_visinfo->class == PseudoColor && x_visinfo->depth == 8) { @@ -988,7 +1177,7 @@ void SWimp_SetPalette( const unsigned char *palette ) colors[i].green = palette[i*4+1] * 257; colors[i].blue = palette[i*4+2] * 257; } - XStoreColors(x_disp, x_cmap, colors, 256); + XStoreColors(dpy, x_cmap, colors, 256); } } @@ -1008,7 +1197,7 @@ void SWimp_Shutdown( void ) if (doShm) { for (i = 0; i < 2; i++) if (x_framebuffer[i]) { - XShmDetach(x_disp, &x_shminfo[i]); + XShmDetach(dpy, &x_shminfo[i]); free(x_framebuffer[i]); shmdt(x_shminfo[i].shmaddr); x_framebuffer[i] = NULL; @@ -1019,10 +1208,10 @@ void SWimp_Shutdown( void ) x_framebuffer[0] = NULL; } - XDestroyWindow( x_disp, x_win ); + XDestroyWindow( dpy, win ); - XAutoRepeatOn(x_disp); -// XCloseDisplay(x_disp); +// XAutoRepeatOn(dpy); +// XCloseDisplay(dpy); X11_active = false; } @@ -1074,16 +1263,7 @@ void KBD_Init(Key_Event_fp_t fp) void KBD_Update(void) { // get events from x server - if (x_disp) - { - while (XPending(x_disp)) - GetEvent(); - while (keyq_head != keyq_tail) - { - Key_Event_fp(keyq[keyq_tail].key, keyq[keyq_tail].down); - keyq_tail = (keyq_tail + 1) & 63; - } - } + HandleEvents(); } void KBD_Close(void) diff --git a/linux/snd_linux.c b/linux/snd_linux.c index 9f46f63..6641f00 100644 --- a/linux/snd_linux.c +++ b/linux/snd_linux.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include #include #include diff --git a/linux/sys_linux.c b/linux/sys_linux.c index c7077fc..5277065 100644 --- a/linux/sys_linux.c +++ b/linux/sys_linux.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include #include #include @@ -216,7 +235,7 @@ void *Sys_GetGameAPI (void *parms) getcwd(curpath, sizeof(curpath)); - Com_Printf("------- Loading %s -------", gamename); + Com_Printf("------- Loading %s -------\n", gamename); // now run through the search paths path = NULL; @@ -226,10 +245,10 @@ void *Sys_GetGameAPI (void *parms) if (!path) return NULL; // couldn't find one anywhere sprintf (name, "%s/%s/%s", curpath, path, gamename); - game_library = dlopen (name, RTLD_NOW ); + game_library = dlopen (name, RTLD_LAZY ); if (game_library) { - Com_DPrintf ("LoadLibrary (%s)\n",name); + Com_Printf ("LoadLibrary (%s)\n",name); break; } } diff --git a/linux/vid_menu.c b/linux/vid_menu.c index 6db42a2..5687c82 100644 --- a/linux/vid_menu.c +++ b/linux/vid_menu.c @@ -1,9 +1,31 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include "../client/client.h" #include "../client/qmenu.h" #define REF_SOFT 0 #define REF_SOFTX11 1 -#define REF_OPENGL 2 +#define REF_MESA3D 2 +#define REF_3DFXGL 3 +#define REF_OPENGLX 4 +#define REF_MESA3DGLX 5 extern cvar_t *vid_ref; extern cvar_t *vid_fullscreen; @@ -82,8 +104,8 @@ static void BrightnessCallback( void *s ) else s_brightness_slider[0].curvalue = s_brightness_slider[1].curvalue; - if ( strcasecmp( vid_ref->string, "soft" ) == 0 || - strcasecmp( vid_ref->string, "softx" ) == 0 ) + if ( stricmp( vid_ref->string, "soft" ) == 0 || + stricmp( vid_ref->string, "softx" ) == 0 ) { float gamma = ( 0.8 - ( slider->curvalue/10.0 - 0.5 ) ) + 0.5; @@ -129,9 +151,33 @@ static void ApplyChanges( void *unused ) case REF_SOFTX11: Cvar_Set( "vid_ref", "softx" ); break; - case REF_OPENGL: + + case REF_MESA3D : Cvar_Set( "vid_ref", "gl" ); - Cvar_Set( "gl_driver", "opengl32" ); + Cvar_Set( "gl_driver", "libMesaGL.so.2" ); + if (gl_driver->modified) + vid_ref->modified = true; + break; + + case REF_OPENGLX : + Cvar_Set( "vid_ref", "glx" ); + Cvar_Set( "gl_driver", "libGL.so" ); + if (gl_driver->modified) + vid_ref->modified = true; + break; + + case REF_MESA3DGLX : + Cvar_Set( "vid_ref", "glx" ); + Cvar_Set( "gl_driver", "libMesaGL.so.2" ); + if (gl_driver->modified) + vid_ref->modified = true; + break; + + case REF_3DFXGL : + Cvar_Set( "vid_ref", "gl" ); + Cvar_Set( "gl_driver", "lib3dfxgl.so" ); + if (gl_driver->modified) + vid_ref->modified = true; break; } @@ -140,12 +186,12 @@ static void ApplyChanges( void *unused ) ** update appropriate stuff if we're running OpenGL and gamma ** has been modified */ - if ( strcasecmp( vid_ref->string, "gl" ) == 0 ) + if ( stricmp( vid_ref->string, "gl" ) == 0 ) { if ( vid_gamma->modified ) { vid_ref->modified = true; - if ( strcasecmp( gl_driver->string, "3dfxgl" ) == 0 ) + if ( stricmp( gl_driver->string, "3dfxgl" ) == 0 ) { char envbuffer[1024]; float g; @@ -182,13 +228,17 @@ void VID_MenuInit( void ) "[1152 864 ]", "[1280 1024]", "[1600 1200]", + "[2048 1536]", 0 }; static const char *refs[] = { - "[software ]", - "[software X11 ]", - "[default OpenGL]", + "[software ]", + "[software X11 ]", + "[Mesa 3-D 3DFX ]", + "[3DFXGL Miniport]", + "[OpenGL glX ]", + "[Mesa 3-D glX ]", 0 }; static const char *yesno_names[] = @@ -200,7 +250,7 @@ void VID_MenuInit( void ) int i; if ( !gl_driver ) - gl_driver = Cvar_Get( "gl_driver", "opengl32", 0 ); + gl_driver = Cvar_Get( "gl_driver", "libMesaGL.so.2", 0 ); if ( !gl_picmip ) gl_picmip = Cvar_Get( "gl_picmip", "0", 0 ); if ( !gl_mode ) @@ -238,17 +288,18 @@ void VID_MenuInit( void ) else if ( strcmp( vid_ref->string, "gl" ) == 0 ) { s_current_menu_index = OPENGL_MENU; - s_ref_list[s_current_menu_index].curvalue = REF_OPENGL; -#if 0 - if ( strcmp( gl_driver->string, "3dfxgl" ) == 0 ) - s_ref_list[s_current_menu_index].curvalue = REF_3DFX; - else if ( strcmp( gl_driver->string, "pvrgl" ) == 0 ) - s_ref_list[s_current_menu_index].curvalue = REF_POWERVR; - else if ( strcmp( gl_driver->string, "opengl32" ) == 0 ) - s_ref_list[s_current_menu_index].curvalue = REF_OPENGL; + if ( strcmp( gl_driver->string, "lib3dfxgl.so" ) == 0 ) + s_ref_list[s_current_menu_index].curvalue = REF_3DFXGL; else - s_ref_list[s_current_menu_index].curvalue = REF_VERITE; -#endif + s_ref_list[s_current_menu_index].curvalue = REF_MESA3D; + } + else if ( strcmp( vid_ref->string, "glx" ) == 0 ) + { + s_current_menu_index = OPENGL_MENU; + if ( strcmp( gl_driver->string, "libMesaGL.so.2" ) == 0 ) + s_ref_list[s_current_menu_index].curvalue = REF_MESA3DGLX; + else + s_ref_list[s_current_menu_index].curvalue = REF_OPENGLX; } s_software_menu.x = viddef.width * 0.50; diff --git a/linux/vid_so.c b/linux/vid_so.c index 51b729e..1aa9942 100644 --- a/linux/vid_so.c +++ b/linux/vid_so.c @@ -1,9 +1,26 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ // Main windowed and fullscreen graphics interface module. This module // is used for both the software and OpenGL rendering versions of the // Quake refresh engine. -#define SO_FILE "/etc/quake2.conf" - #include #include // ELF dl loader #include @@ -31,6 +48,8 @@ qboolean reflib_active = 0; #define VID_NUM_MODES ( sizeof( vid_modes ) / sizeof( vid_modes[0] ) ) +const char so_file[] = "/etc/quake2.conf"; + /** KEYBOARD **************************************************************/ void Do_Key_Event(int key, qboolean down); @@ -127,7 +146,8 @@ vidmode_t vid_modes[] = { "Mode 6: 1024x768", 1024, 768, 6 }, { "Mode 7: 1152x864", 1152, 864, 7 }, { "Mode 8: 1280x1024", 1280, 1024, 8 }, - { "Mode 9: 1600x1200", 1600, 1200, 9 } + { "Mode 9: 1600x1200", 1600, 1200, 9 }, + { "Mode 10: 2048x1536", 2048, 1536, 10 } }; qboolean VID_GetModeInfo( int *width, int *height, int mode ) @@ -206,29 +226,29 @@ qboolean VID_LoadRefresh( char *name ) //regain root seteuid(saved_euid); - if ((fp = fopen(SO_FILE, "r")) == NULL) { - Com_Printf( "LoadLibrary(\"%s\") failed: can't open " SO_FILE " (required for location of ref libraries)\n", name); + if ((fp = fopen(so_file, "r")) == NULL) { + Com_Printf( "LoadLibrary(\"%s\") failed: can't open %s (required for location of ref libraries)\n", name, so_file); return false; } fgets(fn, sizeof(fn), fp); fclose(fp); - if (*fn && fn[strlen(fn) - 1] == '\n') + while (*fn && isspace(fn[strlen(fn) - 1])) fn[strlen(fn) - 1] = 0; strcat(fn, "/"); strcat(fn, name); // permission checking - if (0 && strstr(fn, "softx") == NULL) { // softx doesn't require root + if (strstr(fn, "softx") == NULL) { // softx doesn't require root if (stat(fn, &st) == -1) { Com_Printf( "LoadLibrary(\"%s\") failed: %s\n", name, strerror(errno)); return false; } +#if 0 if (st.st_uid != 0) { Com_Printf( "LoadLibrary(\"%s\") failed: ref is not owned by root\n", name); return false; } -#if 0 if ((st.st_mode & 0777) & ~0700) { Com_Printf( "LoadLibrary(\"%s\") failed: invalid permissions, must be 700 for security considerations\n", name); return false; @@ -240,12 +260,14 @@ qboolean VID_LoadRefresh( char *name ) setegid(getgid()); } - if ( ( reflib_library = dlopen( fn, RTLD_NOW ) ) == 0 ) + if ( ( reflib_library = dlopen( fn, RTLD_LAZY | RTLD_GLOBAL ) ) == 0 ) { Com_Printf( "LoadLibrary(\"%s\") failed: %s\n", name , dlerror()); return false; } + Com_Printf( "LoadLibrary(\"%s\")\n", fn ); + ri.Cmd_AddCommand = Cmd_AddCommand; ri.Cmd_RemoveCommand = Cmd_RemoveCommand; ri.Cmd_Argc = Cmd_Argc; @@ -440,7 +462,7 @@ void VID_Shutdown (void) cvar_t *in_joystick; -// This if fake, it's acutally done by the Refresh load +// This is fake, it's acutally done by the Refresh load void IN_Init (void) { in_joystick = Cvar_Get ("in_joystick", "0", CVAR_ARCHIVE); @@ -472,14 +494,20 @@ void IN_Move (usercmd_t *cmd) void IN_Frame (void) { + if (RW_IN_Activate_fp) + { + if ( !cl.refresh_prepped || cls.key_dest == key_console || cls.key_dest == key_menu) + RW_IN_Activate_fp(false); + else + RW_IN_Activate_fp(true); + } + if (RW_IN_Frame_fp) RW_IN_Frame_fp(); } void IN_Activate (qboolean active) { - if (RW_IN_Activate_fp) - RW_IN_Activate_fp(active); } void Do_Key_Event(int key, qboolean down) diff --git a/makezip b/makezip index 9c05c4a..afb5468 100644 --- a/makezip +++ b/makezip @@ -1,2 +1 @@ -zip -9 -r code . - +zip -9r code . diff --git a/null/cd_null.c b/null/cd_null.c index 43a2814..9e642db 100644 --- a/null/cd_null.c +++ b/null/cd_null.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include "../client/client.h" void CDAudio_Play(int track, qboolean looping) diff --git a/null/cl_null.c b/null/cl_null.c index 7967680..9890c75 100644 --- a/null/cl_null.c +++ b/null/cl_null.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ // cl_null.c -- this file can stub out the entire client system // for pure dedicated servers diff --git a/null/glimp_null.c b/null/glimp_null.c index c52196b..575b730 100644 --- a/null/glimp_null.c +++ b/null/glimp_null.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include "../ref_gl/gl_local.h" void GLimp_BeginFrame( float camera_separation ) diff --git a/null/in_null.c b/null/in_null.c index 79a9275..c0a7a5f 100644 --- a/null/in_null.c +++ b/null/in_null.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ // in_null.c -- for systems without a mouse #include "../client/client.h" diff --git a/null/snddma_null.c b/null/snddma_null.c index f9107f7..1f8084d 100644 --- a/null/snddma_null.c +++ b/null/snddma_null.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ // snddma_null.c // all other sound mixing is portable diff --git a/null/swimp_null.c b/null/swimp_null.c index 648f0b3..21d1eff 100644 --- a/null/swimp_null.c +++ b/null/swimp_null.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include "../ref_soft/r_local.h" void SWimp_BeginFrame( float camera_separation ) diff --git a/null/sys_null.c b/null/sys_null.c index bf616bc..f8dd08d 100644 --- a/null/sys_null.c +++ b/null/sys_null.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ // sys_null.h -- null system driver to aid porting efforts #include "../qcommon/qcommon.h" diff --git a/null/vid_null.c b/null/vid_null.c index 10bb7a8..cdcc6a4 100644 --- a/null/vid_null.c +++ b/null/vid_null.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ // vid_null.c -- null video driver to aid porting efforts // this assumes that one of the refs is statically linked to the executable @@ -72,7 +91,8 @@ vidmode_t vid_modes[] = { "Mode 6: 1024x768", 1024, 768, 6 }, { "Mode 7: 1152x864", 1152, 864, 7 }, { "Mode 8: 1280x960", 1280, 960, 8 }, - { "Mode 9: 1600x1200", 1600, 1200, 9 } + { "Mode 9: 1600x1200", 1600, 1200, 9 }, + { "Mode 10: 2048x1536", 2048, 1536, 10 } }; #define VID_NUM_MODES ( sizeof( vid_modes ) / sizeof( vid_modes[0] ) ) diff --git a/readme.txt b/readme.txt index a82dde7..ff05cab 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ -This is the complete source code for Quake 2, version 3.19, buildable with +This is the complete source code for Quake 2, version 3.21, buildable with visual C++ 6.0. The linux version should be buildable, but we haven't tested it for the release. diff --git a/ref_gl/gl_image.c b/ref_gl/gl_image.c index fcf25c6..24178ba 100644 --- a/ref_gl/gl_image.c +++ b/ref_gl/gl_image.c @@ -49,15 +49,15 @@ void GL_SetTexturePalette( unsigned palette[256] ) int i; unsigned char temptable[768]; - for ( i = 0; i < 256; i++ ) - { - temptable[i*3+0] = ( palette[i] >> 0 ) & 0xff; - temptable[i*3+1] = ( palette[i] >> 8 ) & 0xff; - temptable[i*3+2] = ( palette[i] >> 16 ) & 0xff; - } - if ( qglColorTableEXT && gl_ext_palettedtexture->value ) { + for ( i = 0; i < 256; i++ ) + { + temptable[i*3+0] = ( palette[i] >> 0 ) & 0xff; + temptable[i*3+1] = ( palette[i] >> 8 ) & 0xff; + temptable[i*3+2] = ( palette[i] >> 16 ) & 0xff; + } + qglColorTableEXT( GL_SHARED_TEXTURE_PALETTE_EXT, GL_RGB, 256, @@ -69,22 +69,22 @@ void GL_SetTexturePalette( unsigned palette[256] ) void GL_EnableMultitexture( qboolean enable ) { - if ( !qglSelectTextureSGIS ) + if ( !qglSelectTextureSGIS && !qglActiveTextureARB ) return; if ( enable ) { - GL_SelectTexture( GL_TEXTURE1_SGIS ); + GL_SelectTexture( GL_TEXTURE1 ); qglEnable( GL_TEXTURE_2D ); GL_TexEnv( GL_REPLACE ); } else { - GL_SelectTexture( GL_TEXTURE1_SGIS ); + GL_SelectTexture( GL_TEXTURE1 ); qglDisable( GL_TEXTURE_2D ); GL_TexEnv( GL_REPLACE ); } - GL_SelectTexture( GL_TEXTURE0_SGIS ); + GL_SelectTexture( GL_TEXTURE0 ); GL_TexEnv( GL_REPLACE ); } @@ -92,23 +92,34 @@ void GL_SelectTexture( GLenum texture ) { int tmu; - if ( !qglSelectTextureSGIS ) + if ( !qglSelectTextureSGIS && !qglActiveTextureARB ) return; - if ( texture == GL_TEXTURE0_SGIS ) + if ( texture == GL_TEXTURE0 ) + { tmu = 0; + } else + { tmu = 1; + } if ( tmu == gl_state.currenttmu ) + { return; + } gl_state.currenttmu = tmu; - if ( tmu == 0 ) - qglSelectTextureSGIS( GL_TEXTURE0_SGIS ); - else - qglSelectTextureSGIS( GL_TEXTURE1_SGIS ); + if ( qglSelectTextureSGIS ) + { + qglSelectTextureSGIS( texture ); + } + else if ( qglActiveTextureARB ) + { + qglActiveTextureARB( texture ); + qglClientActiveTextureARB( texture ); + } } void GL_TexEnv( GLenum mode ) @@ -137,7 +148,7 @@ void GL_Bind (int texnum) void GL_MBind( GLenum target, int texnum ) { GL_SelectTexture( target ); - if ( target == GL_TEXTURE0_SGIS ) + if ( target == GL_TEXTURE0 ) { if ( gl_state.currenttextures[0] == texnum ) return; diff --git a/ref_gl/gl_local.h b/ref_gl/gl_local.h index c090d2d..1629948 100644 --- a/ref_gl/gl_local.h +++ b/ref_gl/gl_local.h @@ -17,13 +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. */ -// disable data conversion warnings - -#if 0 -#pragma warning(disable : 4244) // MIPS -#pragma warning(disable : 4136) // X86 -#pragma warning(disable : 4051) // ALPHA -#endif #ifdef _WIN32 # include @@ -35,9 +28,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include +#ifndef __linux__ #ifndef GL_COLOR_INDEX8_EXT #define GL_COLOR_INDEX8_EXT GL_COLOR_INDEX #endif +#endif #include "../client/ref.h" @@ -55,10 +50,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define ROLL 2 +#ifndef __VIDDEF_T +#define __VIDDEF_T typedef struct { unsigned width, height; // coordinates from main game } viddef_t; +#endif extern viddef_t vid; diff --git a/ref_gl/gl_mesh.c b/ref_gl/gl_mesh.c index d6d1726..a079b90 100644 --- a/ref_gl/gl_mesh.c +++ b/ref_gl/gl_mesh.c @@ -542,9 +542,30 @@ void R_DrawAliasModel (entity_t *e) // get lighting information // // PMM - rewrote, reordered to handle new shells & mixing + // PMM - 3.20 code .. replaced with original way of doing it to keep mod authors happy // if ( currententity->flags & ( RF_SHELL_HALF_DAM | RF_SHELL_GREEN | RF_SHELL_RED | RF_SHELL_BLUE | RF_SHELL_DOUBLE ) ) { + VectorClear (shadelight); + if (currententity->flags & RF_SHELL_HALF_DAM) + { + shadelight[0] = 0.56; + shadelight[1] = 0.59; + shadelight[2] = 0.45; + } + if ( currententity->flags & RF_SHELL_DOUBLE ) + { + shadelight[0] = 0.9; + shadelight[1] = 0.7; + } + if ( currententity->flags & RF_SHELL_RED ) + shadelight[0] = 1.0; + if ( currententity->flags & RF_SHELL_GREEN ) + shadelight[1] = 1.0; + if ( currententity->flags & RF_SHELL_BLUE ) + shadelight[2] = 1.0; + } +/* // PMM -special case for godmode if ( (currententity->flags & RF_SHELL_RED) && (currententity->flags & RF_SHELL_BLUE) && @@ -607,6 +628,7 @@ void R_DrawAliasModel (entity_t *e) // } // } // pmm +*/ else if ( currententity->flags & RF_FULLBRIGHT ) { for (i=0 ; i<3 ; i++) diff --git a/ref_gl/gl_rmain.c b/ref_gl/gl_rmain.c index e37a468..1bde4a8 100644 --- a/ref_gl/gl_rmain.c +++ b/ref_gl/gl_rmain.c @@ -26,6 +26,8 @@ viddef_t vid; refimport_t ri; +int GL_TEXTURE0, GL_TEXTURE1; + model_t *r_worldmodel; float gldepthmin, gldepthmax; @@ -1217,6 +1219,10 @@ int R_Init( void *hinstance, void *hWnd ) ri.Cvar_Set( "scr_drawall", "0" ); } +#ifdef __linux__ + ri.Cvar_SetValue( "gl_finish", 1 ); +#endif + // MCD has buffering issues if ( gl_config.renderer == GL_RENDERER_MCD ) { @@ -1243,7 +1249,6 @@ int R_Init( void *hinstance, void *hWnd ) /* ** grab extensions */ -#ifdef WIN32 if ( strstr( gl_config.extensions_string, "GL_EXT_compiled_vertex_array" ) || strstr( gl_config.extensions_string, "GL_SGI_compiled_vertex_array" ) ) { @@ -1256,6 +1261,7 @@ int R_Init( void *hinstance, void *hWnd ) ri.Con_Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" ); } +#ifdef _WIN32 if ( strstr( gl_config.extensions_string, "WGL_EXT_swap_control" ) ) { qwglSwapIntervalEXT = ( BOOL (WINAPI *)(int)) qwglGetProcAddress( "wglSwapIntervalEXT" ); @@ -1265,6 +1271,7 @@ int R_Init( void *hinstance, void *hWnd ) { ri.Con_Printf( PRINT_ALL, "...WGL_EXT_swap_control not found\n" ); } +#endif if ( strstr( gl_config.extensions_string, "GL_EXT_point_parameters" ) ) { @@ -1284,8 +1291,29 @@ int R_Init( void *hinstance, void *hWnd ) ri.Con_Printf( PRINT_ALL, "...GL_EXT_point_parameters not found\n" ); } - if ( strstr( gl_config.extensions_string, "GL_EXT_paletted_texture" ) && - strstr( gl_config.extensions_string, "GL_EXT_shared_texture_palette" ) ) +#ifdef __linux__ + if ( strstr( gl_config.extensions_string, "3DFX_set_global_palette" )) + { + if ( gl_ext_palettedtexture->value ) + { + ri.Con_Printf( PRINT_ALL, "...using 3DFX_set_global_palette\n" ); + qgl3DfxSetPaletteEXT = ( void ( APIENTRY * ) (GLuint *) )qwglGetProcAddress( "gl3DfxSetPaletteEXT" ); + qglColorTableEXT = Fake_glColorTableEXT; + } + else + { + ri.Con_Printf( PRINT_ALL, "...ignoring 3DFX_set_global_palette\n" ); + } + } + else + { + ri.Con_Printf( PRINT_ALL, "...3DFX_set_global_palette not found\n" ); + } +#endif + + if ( !qglColorTableEXT && + strstr( gl_config.extensions_string, "GL_EXT_paletted_texture" ) && + strstr( gl_config.extensions_string, "GL_EXT_shared_texture_palette" ) ) { if ( gl_ext_palettedtexture->value ) { @@ -1302,13 +1330,40 @@ int R_Init( void *hinstance, void *hWnd ) ri.Con_Printf( PRINT_ALL, "...GL_EXT_shared_texture_palette not found\n" ); } - if ( strstr( gl_config.extensions_string, "GL_SGIS_multitexture" ) ) + if ( strstr( gl_config.extensions_string, "GL_ARB_multitexture" ) ) { if ( gl_ext_multitexture->value ) + { + ri.Con_Printf( PRINT_ALL, "...using GL_ARB_multitexture\n" ); + qglMTexCoord2fSGIS = ( void * ) qwglGetProcAddress( "glMultiTexCoord2fARB" ); + qglActiveTextureARB = ( void * ) qwglGetProcAddress( "glActiveTextureARB" ); + qglClientActiveTextureARB = ( void * ) qwglGetProcAddress( "glClientActiveTextureARB" ); + GL_TEXTURE0 = GL_TEXTURE0_ARB; + GL_TEXTURE1 = GL_TEXTURE1_ARB; + } + else + { + ri.Con_Printf( PRINT_ALL, "...ignoring GL_ARB_multitexture\n" ); + } + } + else + { + ri.Con_Printf( PRINT_ALL, "...GL_ARB_multitexture not found\n" ); + } + + if ( strstr( gl_config.extensions_string, "GL_SGIS_multitexture" ) ) + { + if ( qglActiveTextureARB ) + { + ri.Con_Printf( PRINT_ALL, "...GL_SGIS_multitexture deprecated in favor of ARB_multitexture\n" ); + } + else if ( gl_ext_multitexture->value ) { ri.Con_Printf( PRINT_ALL, "...using GL_SGIS_multitexture\n" ); qglMTexCoord2fSGIS = ( void * ) qwglGetProcAddress( "glMTexCoord2fSGIS" ); qglSelectTextureSGIS = ( void * ) qwglGetProcAddress( "glSelectTextureSGIS" ); + GL_TEXTURE0 = GL_TEXTURE0_SGIS; + GL_TEXTURE1 = GL_TEXTURE1_SGIS; } else { @@ -1319,7 +1374,6 @@ int R_Init( void *hinstance, void *hWnd ) { ri.Con_Printf( PRINT_ALL, "...GL_SGIS_multitexture not found\n" ); } -#endif GL_SetDefaultState(); diff --git a/ref_gl/gl_rsurf.c b/ref_gl/gl_rsurf.c index d8235a8..1741828 100644 --- a/ref_gl/gl_rsurf.c +++ b/ref_gl/gl_rsurf.c @@ -613,6 +613,8 @@ void R_DrawAlphaSurfaces (void) qglColor4f (intens,intens,intens,1); if (s->flags & SURF_DRAWTURB) EmitWaterPolys (s); + else if(s->texinfo->flags & SURF_FLOWING) // PGM 9/16/98 + DrawGLFlowingPoly (s); // PGM else DrawGLPoly (s->polys); } @@ -639,7 +641,7 @@ void DrawTextureChains (void) // GL_TexEnv( GL_REPLACE ); - if ( !qglSelectTextureSGIS ) + if ( !qglSelectTextureSGIS && !qglActiveTextureARB ) { for ( i = 0, image=gltextures ; ilightmaptexturenum ); + GL_MBind( GL_TEXTURE1, gl_state.lightmap_textures + surf->lightmaptexturenum ); lmtex = surf->lightmaptexturenum; @@ -757,7 +759,7 @@ dynamic: R_BuildLightMap( surf, (void *)temp, smax*4 ); - GL_MBind( GL_TEXTURE1_SGIS, gl_state.lightmap_textures + 0 ); + GL_MBind( GL_TEXTURE1, gl_state.lightmap_textures + 0 ); lmtex = 0; @@ -771,8 +773,8 @@ dynamic: c_brush_polys++; - GL_MBind( GL_TEXTURE0_SGIS, image->texnum ); - GL_MBind( GL_TEXTURE1_SGIS, gl_state.lightmap_textures + lmtex ); + GL_MBind( GL_TEXTURE0, image->texnum ); + GL_MBind( GL_TEXTURE1, gl_state.lightmap_textures + lmtex ); //========== //PGM @@ -790,8 +792,8 @@ dynamic: qglBegin (GL_POLYGON); for (i=0 ; i< nv; i++, v+= VERTEXSIZE) { - qglMTexCoord2fSGIS( GL_TEXTURE0_SGIS, (v[3]+scroll), v[4]); - qglMTexCoord2fSGIS( GL_TEXTURE1_SGIS, v[5], v[6]); + qglMTexCoord2fSGIS( GL_TEXTURE0, (v[3]+scroll), v[4]); + qglMTexCoord2fSGIS( GL_TEXTURE1, v[5], v[6]); qglVertex3fv (v); } qglEnd (); @@ -805,8 +807,8 @@ dynamic: qglBegin (GL_POLYGON); for (i=0 ; i< nv; i++, v+= VERTEXSIZE) { - qglMTexCoord2fSGIS( GL_TEXTURE0_SGIS, v[3], v[4]); - qglMTexCoord2fSGIS( GL_TEXTURE1_SGIS, v[5], v[6]); + qglMTexCoord2fSGIS( GL_TEXTURE0, v[3], v[4]); + qglMTexCoord2fSGIS( GL_TEXTURE1, v[5], v[6]); qglVertex3fv (v); } qglEnd (); @@ -819,8 +821,8 @@ dynamic: { c_brush_polys++; - GL_MBind( GL_TEXTURE0_SGIS, image->texnum ); - GL_MBind( GL_TEXTURE1_SGIS, gl_state.lightmap_textures + lmtex ); + GL_MBind( GL_TEXTURE0, image->texnum ); + GL_MBind( GL_TEXTURE1, gl_state.lightmap_textures + lmtex ); //========== //PGM @@ -838,8 +840,8 @@ dynamic: qglBegin (GL_POLYGON); for (i=0 ; i< nv; i++, v+= VERTEXSIZE) { - qglMTexCoord2fSGIS( GL_TEXTURE0_SGIS, (v[3]+scroll), v[4]); - qglMTexCoord2fSGIS( GL_TEXTURE1_SGIS, v[5], v[6]); + qglMTexCoord2fSGIS( GL_TEXTURE0, (v[3]+scroll), v[4]); + qglMTexCoord2fSGIS( GL_TEXTURE1, v[5], v[6]); qglVertex3fv (v); } qglEnd (); @@ -855,8 +857,8 @@ dynamic: qglBegin (GL_POLYGON); for (i=0 ; i< nv; i++, v+= VERTEXSIZE) { - qglMTexCoord2fSGIS( GL_TEXTURE0_SGIS, v[3], v[4]); - qglMTexCoord2fSGIS( GL_TEXTURE1_SGIS, v[5], v[6]); + qglMTexCoord2fSGIS( GL_TEXTURE0, v[3], v[4]); + qglMTexCoord2fSGIS( GL_TEXTURE1, v[5], v[6]); qglVertex3fv (v); } qglEnd (); @@ -1006,9 +1008,9 @@ e->angles[0] = -e->angles[0]; // stupid quake bug e->angles[2] = -e->angles[2]; // stupid quake bug GL_EnableMultitexture( true ); - GL_SelectTexture( GL_TEXTURE0_SGIS ); + GL_SelectTexture( GL_TEXTURE0); GL_TexEnv( GL_REPLACE ); - GL_SelectTexture( GL_TEXTURE1_SGIS ); + GL_SelectTexture( GL_TEXTURE1); GL_TexEnv( GL_MODULATE ); R_DrawInlineBModel (); @@ -1220,9 +1222,9 @@ void R_DrawWorld (void) { GL_EnableMultitexture( true ); - GL_SelectTexture( GL_TEXTURE0_SGIS ); + GL_SelectTexture( GL_TEXTURE0); GL_TexEnv( GL_REPLACE ); - GL_SelectTexture( GL_TEXTURE1_SGIS ); + GL_SelectTexture( GL_TEXTURE1); if ( gl_lightmap->value ) GL_TexEnv( GL_REPLACE ); @@ -1570,7 +1572,7 @@ void GL_BeginBuildingLightmaps (model_t *m) r_framecount = 1; // no dlightcache GL_EnableMultitexture( true ); - GL_SelectTexture( GL_TEXTURE1_SGIS ); + GL_SelectTexture( GL_TEXTURE1); /* ** setup the base lightstyles so the lightmaps won't have to be regenerated diff --git a/ref_gl/qgl.h b/ref_gl/qgl.h index bf2f04b..8ce70bc 100644 --- a/ref_gl/qgl.h +++ b/ref_gl/qgl.h @@ -30,6 +30,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include +#ifdef __linux__ +//#include +#include +#endif + qboolean QGL_Init( const char *dllname ); void QGL_Shutdown( void ); @@ -384,6 +389,9 @@ extern void ( APIENTRY * qglUnlockArraysEXT) (void); extern void ( APIENTRY * qglMTexCoord2fSGIS)( GLenum, GLfloat, GLfloat ); extern void ( APIENTRY * qglSelectTextureSGIS)( GLenum ); +extern void ( APIENTRY * qglActiveTextureARB)( GLenum ); +extern void ( APIENTRY * qglClientActiveTextureARB)( GLenum ); + #ifdef _WIN32 extern int ( WINAPI * qwglChoosePixelFormat )(HDC, CONST PIXELFORMATDESCRIPTOR *); @@ -422,6 +430,38 @@ extern BOOL ( WINAPI * qwglSetDeviceGammaRampEXT ) ( const unsigned char *pRed, #endif +#ifdef __linux__ + +// local function in dll +extern void *qwglGetProcAddress(char *symbol); + +extern void (*qgl3DfxSetPaletteEXT)(GLuint *); + +/* +//FX Mesa Functions +extern fxMesaContext (*qfxMesaCreateContext)(GLuint win, GrScreenResolution_t, GrScreenRefresh_t, const GLint attribList[]); +extern fxMesaContext (*qfxMesaCreateBestContext)(GLuint win, GLint width, GLint height, const GLint attribList[]); +extern void (*qfxMesaDestroyContext)(fxMesaContext ctx); +extern void (*qfxMesaMakeCurrent)(fxMesaContext ctx); +extern fxMesaContext (*qfxMesaGetCurrentContext)(void); +extern void (*qfxMesaSwapBuffers)(void); +*/ + +//GLX Functions +extern XVisualInfo * (*qglXChooseVisual)( Display *dpy, int screen, int *attribList ); +extern GLXContext (*qglXCreateContext)( Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct ); +extern void (*qglXDestroyContext)( Display *dpy, GLXContext ctx ); +extern Bool (*qglXMakeCurrent)( Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern void (*qglXCopyContext)( Display *dpy, GLXContext src, GLXContext dst, GLuint mask ); +extern void (*qglXSwapBuffers)( Display *dpy, GLXDrawable drawable ); + +// 3dfxSetPaletteEXT shunt +void Fake_glColorTableEXT( GLenum target, GLenum internalformat, + GLsizei width, GLenum format, GLenum type, + const GLvoid *table ); + +#endif // linux + /* ** extension constants */ @@ -438,5 +478,9 @@ extern BOOL ( WINAPI * qwglSetDeviceGammaRampEXT ) ( const unsigned char *pRed, #define GL_TEXTURE0_SGIS 0x835E #define GL_TEXTURE1_SGIS 0x835F +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 + +extern int GL_TEXTURE0, GL_TEXTURE1; #endif diff --git a/ref_gl/ref_gl.001 b/ref_gl/ref_gl.001 deleted file mode 100644 index eef41bf..0000000 --- a/ref_gl/ref_gl.001 +++ /dev/null @@ -1,752 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ref_gl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 -# TARGTYPE "Win32 (ALPHA) Dynamic-Link Library" 0x0602 - -CFG=ref_gl - Win32 Debug Alpha -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ref_gl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ref_gl.mak" CFG="ref_gl - Win32 Debug Alpha" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ref_gl - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ref_gl - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ref_gl - Win32 Debug Alpha" (based on\ - "Win32 (ALPHA) Dynamic-Link Library") -!MESSAGE "ref_gl - Win32 Release Alpha" (based on\ - "Win32 (ALPHA) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir ".\ref_gl__" -# PROP BASE Intermediate_Dir ".\ref_gl__" -# PROP BASE Target_Dir "." -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\release" -# PROP Intermediate_Dir ".\release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "." -CPP=cl.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /G5 /MT /W4 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /subsystem:windows /dll /machine:I386 -# SUBTRACT LINK32 /incremental:yes /debug - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir ".\ref_gl__" -# PROP BASE Intermediate_Dir ".\ref_gl__" -# PROP BASE Target_Dir "." -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\debug" -# PROP Intermediate_Dir ".\debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "." -CPP=cl.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /G5 /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /FR /YX /FD /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 -# SUBTRACT LINK32 /profile - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug Alpha" -# PROP BASE Intermediate_Dir "Debug Alpha" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\DebugAxp" -# PROP Intermediate_Dir ".\DebugAxp" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -CPP=cl.exe -# ADD BASE CPP /nologo /MTd /Gt0 /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /QA21164 /MTd /Gt0 /W3 /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "C_ONLY" /YX /FD /QAieee1 /c -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 winmm.lib opengl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:ALPHA -# ADD LINK32 opengl32.lib kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /subsystem:windows /dll /debug /machine:ALPHA - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ref_gl__" -# PROP BASE Intermediate_Dir "ref_gl__" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\ReleaseAXP" -# PROP Intermediate_Dir ".\ReleaseAXP" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -CPP=cl.exe -# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /QA21164 /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "C_ONLY" /YX /FD /QAieee1 /c -# SUBTRACT CPP /Z /Fr -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:ALPHA -# SUBTRACT BASE LINK32 /debug -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /subsystem:windows /dll /machine:ALPHA -# SUBTRACT LINK32 /debug - -!ENDIF - -# Begin Target - -# Name "ref_gl - Win32 Release" -# Name "ref_gl - Win32 Debug" -# Name "ref_gl - Win32 Debug Alpha" -# Name "ref_gl - Win32 Release Alpha" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90" -# Begin Source File - -SOURCE=.\gl_draw.c - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -DEP_CPP_GL_DR=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - -NODEP_CPP_GL_DR=\ - ".\L\gl.h"\ - ".\L\glu.h"\ - - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -DEP_CPP_GL_DR=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - {$(INCLUDE)}"GL\gl.h"\ - {$(INCLUDE)}"GL\glu.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\gl_image.c - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -DEP_CPP_GL_IM=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - -NODEP_CPP_GL_IM=\ - ".\L\gl.h"\ - ".\L\glu.h"\ - - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -DEP_CPP_GL_IM=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - {$(INCLUDE)}"GL\gl.h"\ - {$(INCLUDE)}"GL\glu.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\gl_light.c - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -DEP_CPP_GL_LI=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - -NODEP_CPP_GL_LI=\ - ".\L\gl.h"\ - ".\L\glu.h"\ - - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -DEP_CPP_GL_LI=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - {$(INCLUDE)}"GL\gl.h"\ - {$(INCLUDE)}"GL\glu.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\gl_mesh.c - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -DEP_CPP_GL_ME=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\anorms.h"\ - ".\anormtab.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - -NODEP_CPP_GL_ME=\ - ".\L\gl.h"\ - ".\L\glu.h"\ - - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -DEP_CPP_GL_ME=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\anorms.h"\ - ".\anormtab.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - {$(INCLUDE)}"GL\gl.h"\ - {$(INCLUDE)}"GL\glu.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\gl_model.c - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -DEP_CPP_GL_MO=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - -NODEP_CPP_GL_MO=\ - ".\L\gl.h"\ - ".\L\glu.h"\ - - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -DEP_CPP_GL_MO=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - {$(INCLUDE)}"GL\gl.h"\ - {$(INCLUDE)}"GL\glu.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\gl_rmain.c - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -DEP_CPP_GL_RM=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - -NODEP_CPP_GL_RM=\ - ".\L\gl.h"\ - ".\L\glu.h"\ - - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -DEP_CPP_GL_RM=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - {$(INCLUDE)}"GL\gl.h"\ - {$(INCLUDE)}"GL\glu.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\gl_rmisc.c - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -DEP_CPP_GL_RMI=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - -NODEP_CPP_GL_RMI=\ - ".\L\gl.h"\ - ".\L\glu.h"\ - - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -DEP_CPP_GL_RMI=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - {$(INCLUDE)}"GL\gl.h"\ - {$(INCLUDE)}"GL\glu.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\gl_rsurf.c - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -DEP_CPP_GL_RS=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - -NODEP_CPP_GL_RS=\ - ".\L\gl.h"\ - ".\L\glu.h"\ - - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -DEP_CPP_GL_RS=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - {$(INCLUDE)}"GL\gl.h"\ - {$(INCLUDE)}"GL\glu.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\gl_warp.c - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -DEP_CPP_GL_WA=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - ".\warpsin.h"\ - -NODEP_CPP_GL_WA=\ - ".\L\gl.h"\ - ".\L\glu.h"\ - - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -DEP_CPP_GL_WA=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - ".\warpsin.h"\ - {$(INCLUDE)}"GL\gl.h"\ - {$(INCLUDE)}"GL\glu.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\win32\glw_imp.c - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -DEP_CPP_GLW_I=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\glw_win.h"\ - "..\win32\winquake.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - -NODEP_CPP_GLW_I=\ - ".\L\gl.h"\ - ".\L\glu.h"\ - - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -DEP_CPP_GLW_I=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\glw_win.h"\ - "..\win32\winquake.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - {$(INCLUDE)}"GL\gl.h"\ - {$(INCLUDE)}"GL\glu.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\game\q_shared.c - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -DEP_CPP_Q_SHA=\ - "..\game\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -DEP_CPP_Q_SHA=\ - "..\game\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\win32\q_shwin.c - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -DEP_CPP_Q_SHW=\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\winquake.h"\ - - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -DEP_CPP_Q_SHW=\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\winquake.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\win32\qgl_win.c - -!IF "$(CFG)" == "ref_gl - Win32 Release" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Debug Alpha" - -DEP_CPP_QGL_W=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\glw_win.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - -NODEP_CPP_QGL_W=\ - ".\L\gl.h"\ - ".\L\glu.h"\ - - -!ELSEIF "$(CFG)" == "ref_gl - Win32 Release Alpha" - -DEP_CPP_QGL_W=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\glw_win.h"\ - ".\gl_local.h"\ - ".\gl_model.h"\ - ".\qgl.h"\ - {$(INCLUDE)}"GL\gl.h"\ - {$(INCLUDE)}"GL\glu.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" -# Begin Source File - -SOURCE=.\anorms.h -# End Source File -# Begin Source File - -SOURCE=.\anormtab.h -# End Source File -# Begin Source File - -SOURCE=.\gl_local.h -# End Source File -# Begin Source File - -SOURCE=.\gl_model.h -# End Source File -# Begin Source File - -SOURCE=..\win32\glw_win.h -# End Source File -# Begin Source File - -SOURCE=..\game\q_shared.h -# End Source File -# Begin Source File - -SOURCE=..\qcommon\qcommon.h -# End Source File -# Begin Source File - -SOURCE=..\qcommon\qfiles.h -# End Source File -# Begin Source File - -SOURCE=.\qgl.h -# End Source File -# Begin Source File - -SOURCE=.\qmenu.h -# End Source File -# Begin Source File - -SOURCE=..\client\ref.h -# End Source File -# Begin Source File - -SOURCE=.\ref_gl.h -# End Source File -# Begin Source File - -SOURCE=.\warpsin.h -# End Source File -# Begin Source File - -SOURCE=..\win32\winquake.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\ref_gl.def -# End Source File -# End Group -# End Target -# End Project diff --git a/ref_gl/ref_gl.plg b/ref_gl/ref_gl.plg deleted file mode 100644 index 7119ee2..0000000 --- a/ref_gl/ref_gl.plg +++ /dev/null @@ -1,17 +0,0 @@ ---------------------Configuration: ref_gl - Win32 Release Alpha-------------------- -Begining build with project "G:\quake2\code\ref_gl\ref_gl.dsp", at root. -Active configuration is Win32 (ALPHA) Dynamic-Link Library (based on Win32 (ALPHA) Dynamic-Link Library) - -Project's tools are: - "OLE Type Library Maker" with flags "/nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 " - "C/C++ Compiler for Alpha" with flags "/nologo /QA21164 /MT /Gt0 /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "C_ONLY" /Fp".\ReleaseAXP/ref_gl.pch" /YX /Fo".\ReleaseAXP/" /Fd".\ReleaseAXP/" /FD /QAieee1 /c " - "Win32 Resource Compiler" with flags "/l 0x409 /d "NDEBUG" " - "Browser Database Maker" with flags "/nologo /o"..\ReleaseAXP/ref_gl.bsc" " - "COFF Linker for Alpha" with flags "kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"..\ReleaseAXP/ref_gl.pdb" /debug /machine:ALPHA /def:".\ref_gl.def" /out:"..\ReleaseAXP/ref_gl.dll" /implib:"..\ReleaseAXP/ref_gl.lib" " - "Custom Build" with flags "" - "" with flags "" - - - - -ref_gl.dll - 0 error(s), 0 warning(s) diff --git a/ref_soft/r_alias.c b/ref_soft/r_alias.c index f64a78a..abf5fb5 100644 --- a/ref_soft/r_alias.c +++ b/ref_soft/r_alias.c @@ -1108,8 +1108,8 @@ void R_AliasDrawModel (void) // PMM - added double color = currententity->flags & ( RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE | RF_SHELL_DOUBLE | RF_SHELL_HALF_DAM); - // PMM - reordered, old code first -/* + // PMM - reordered, new shells after old shells (so they get overriden) + if ( color == RF_SHELL_RED ) r_aliasblendcolor = SHELL_RED_COLOR; else if ( color == RF_SHELL_GREEN ) @@ -1130,8 +1130,7 @@ void R_AliasDrawModel (void) // pmm else r_aliasblendcolor = SHELL_WHITE_COLOR; -*/ - if ( color & RF_SHELL_RED ) +/* if ( color & RF_SHELL_RED ) { if ( ( color & RF_SHELL_BLUE) && ( color & RF_SHELL_GREEN) ) r_aliasblendcolor = SHELL_WHITE_COLOR; @@ -1155,7 +1154,7 @@ void R_AliasDrawModel (void) r_aliasblendcolor = SHELL_GREEN_COLOR; else r_aliasblendcolor = SHELL_WHITE_COLOR; - +*/ if ( currententity->alpha > 0.33 ) d_pdrawspans = R_PolysetDrawSpansConstant8_66; diff --git a/ref_soft/r_poly.c b/ref_soft/r_poly.c index 522f03c..d4968df 100644 --- a/ref_soft/r_poly.c +++ b/ref_soft/r_poly.c @@ -51,7 +51,7 @@ vec5_t r_clip_verts[2][MAXWORKINGVERTS+2]; static int s_minindex, s_maxindex; -static void R_DrawPoly( qboolean iswater ); +static void R_DrawPoly( int iswater ); /* ** R_DrawSpanletOpaque @@ -583,7 +583,8 @@ int R_ClipPolyFace (int nump, clipplane_t *pclipplane) /* ** R_PolygonDrawSpans */ -void R_PolygonDrawSpans(espan_t *pspan, qboolean iswater ) +// PGM - iswater was qboolean. changed to allow passing more flags +void R_PolygonDrawSpans(espan_t *pspan, int iswater ) { int count; fixed16_t snext, tnext; @@ -592,8 +593,12 @@ void R_PolygonDrawSpans(espan_t *pspan, qboolean iswater ) s_spanletvars.pbase = cacheblock; - if ( iswater ) +//PGM + if ( iswater & SURF_WARP) r_turb_turb = sintable + ((int)(r_newrefdef.time*SPEED)&(CYCLE-1)); + else if (iswater & SURF_FLOWING) + r_turb_turb = blanktable; +//PGM sdivzspanletstepu = d_sdivzstepu * AFFINE_SPANLET_SIZE; tdivzspanletstepu = d_tdivzstepu * AFFINE_SPANLET_SIZE; @@ -889,7 +894,8 @@ void R_PolygonScanRightEdge (void) /* ** R_ClipAndDrawPoly */ -void R_ClipAndDrawPoly( float alpha, qboolean isturbulent, qboolean textured ) +// PGM - isturbulent was qboolean. changed to int to allow passing more flags +void R_ClipAndDrawPoly ( float alpha, int isturbulent, qboolean textured ) { emitpoint_t outverts[MAXWORKINGVERTS+3], *pout; float *pv; @@ -1047,12 +1053,14 @@ void R_BuildPolygonFromSurface(msurface_t *fa) VectorSubtract( vec3_origin, r_polydesc.vpn, r_polydesc.vpn ); } - if ( fa->texinfo->flags & SURF_WARP ) +// PGM 09/16/98 + if ( fa->texinfo->flags & (SURF_WARP|SURF_FLOWING) ) { r_polydesc.pixels = fa->texinfo->image->pixels[0]; r_polydesc.pixel_width = fa->texinfo->image->width; r_polydesc.pixel_height = fa->texinfo->image->height; } +// PGM 09/16/98 else { surfcache_t *scache; @@ -1123,7 +1131,8 @@ void R_PolygonCalculateGradients (void) ** ** This should NOT be called externally since it doesn't do clipping! */ -static void R_DrawPoly( qboolean iswater ) +// PGM - iswater was qboolean. changed to support passing more flags +static void R_DrawPoly( int iswater ) { int i, nump; float ymin, ymax; @@ -1194,10 +1203,20 @@ void R_DrawAlphaSurfaces( void ) { R_BuildPolygonFromSurface( s ); +//======= +//PGM +// if (s->texinfo->flags & SURF_TRANS66) +// R_ClipAndDrawPoly( 0.60f, ( s->texinfo->flags & SURF_WARP) != 0, true ); +// else +// R_ClipAndDrawPoly( 0.30f, ( s->texinfo->flags & SURF_WARP) != 0, true ); + + // PGM - pass down all the texinfo flags, not just SURF_WARP. if (s->texinfo->flags & SURF_TRANS66) - R_ClipAndDrawPoly( 0.60f, ( s->texinfo->flags & SURF_WARP) != 0, true ); + R_ClipAndDrawPoly( 0.60f, (s->texinfo->flags & SURF_WARP|SURF_FLOWING), true ); else - R_ClipAndDrawPoly( 0.30f, ( s->texinfo->flags & SURF_WARP) != 0, true ); + R_ClipAndDrawPoly( 0.30f, (s->texinfo->flags & SURF_WARP|SURF_FLOWING), true ); +//PGM +//======= s = s->nextalphasurface; } diff --git a/ref_soft/ref_soft.001 b/ref_soft/ref_soft.001 deleted file mode 100644 index 5afafe0..0000000 --- a/ref_soft/ref_soft.001 +++ /dev/null @@ -1,1498 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ref_soft" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 -# TARGTYPE "Win32 (ALPHA) Dynamic-Link Library" 0x0602 - -CFG=ref_soft - Win32 Debug Alpha -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ref_soft.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ref_soft.mak" CFG="ref_soft - Win32 Debug Alpha" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ref_soft - Win32 Release" (based on\ - "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ref_soft - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ref_soft - Win32 Debug Alpha" (based on\ - "Win32 (ALPHA) Dynamic-Link Library") -!MESSAGE "ref_soft - Win32 Release Alpha" (based on\ - "Win32 (ALPHA) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir ".\ref_soft" -# PROP BASE Intermediate_Dir ".\ref_soft" -# PROP BASE Target_Dir "." -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\release" -# PROP Intermediate_Dir ".\release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "." -CPP=cl.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /G5 /MT /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /subsystem:windows /dll /machine:I386 -# SUBTRACT LINK32 /debug - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir ".\ref_soft" -# PROP BASE Intermediate_Dir ".\ref_soft" -# PROP BASE Target_Dir "." -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\debug" -# PROP Intermediate_Dir ".\debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "." -CPP=cl.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /G5 /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /FR /YX /FD /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /nodefaultlib:"libc" -# SUBTRACT LINK32 /profile /nodefaultlib - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug Alpha" -# PROP BASE Intermediate_Dir "Debug Alpha" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\DebugAxp" -# PROP Intermediate_Dir ".\DebugAxp" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -CPP=cl.exe -# ADD BASE CPP /nologo /MTd /Gt0 /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /QA21164 /MTd /Gt0 /W3 /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "C_ONLY" /YX /FD /QAieee1 /c -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:ALPHA /nodefaultlib:"libc" -# SUBTRACT BASE LINK32 /nodefaultlib -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /subsystem:windows /dll /debug /machine:ALPHA /nodefaultlib:"libc" -# SUBTRACT LINK32 /nodefaultlib - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ref_soft" -# PROP BASE Intermediate_Dir "ref_soft" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\ReleaseAXP" -# PROP Intermediate_Dir ".\ReleaseAXP" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -CPP=cl.exe -# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /QA21164 /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "C_ONLY" /YX /FD /QAieee1 /c -# SUBTRACT CPP /Z /Fr -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:ALPHA -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /subsystem:windows /dll /machine:ALPHA -# SUBTRACT LINK32 /debug - -!ENDIF - -# Begin Target - -# Name "ref_soft - Win32 Release" -# Name "ref_soft - Win32 Debug" -# Name "ref_soft - Win32 Debug Alpha" -# Name "ref_soft - Win32 Release Alpha" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90" -# Begin Source File - -SOURCE=..\game\q_shared.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_Q_SHA=\ - "..\game\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_Q_SHA=\ - "..\game\q_shared.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_Q_SHA=\ - "..\game\q_shared.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\win32\q_shwin.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_Q_SHW=\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\winquake.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_Q_SHW=\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\winquake.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_Q_SHW=\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\winquake.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_aclip.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_ACL=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_ACL=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_ACL=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_aclipa.asm - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -# Begin Custom Build -OutDir=.\..\release -InputPath=.\r_aclipa.asm -InputName=r_aclipa - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -# Begin Custom Build -OutDir=.\..\debug -InputPath=.\r_aclipa.asm -InputName=r_aclipa - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_alias.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_ALI=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\anorms.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_ALI=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\anorms.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_ALI=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\anorms.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_bsp.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_BSP=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_BSP=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_BSP=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_draw.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_DRA=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_DRA=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_DRA=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_draw16.asm - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -# Begin Custom Build -OutDir=.\..\release -InputPath=.\r_draw16.asm -InputName=r_draw16 - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -# Begin Custom Build -OutDir=.\..\debug -InputPath=.\r_draw16.asm -InputName=r_draw16 - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_drawa.asm - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -# Begin Custom Build -OutDir=.\..\release -InputPath=.\r_drawa.asm -InputName=r_drawa - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -# Begin Custom Build -OutDir=.\..\debug -InputPath=.\r_drawa.asm -InputName=r_drawa - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_edge.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_EDG=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_EDG=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_EDG=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_edgea.asm - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -# Begin Custom Build -OutDir=.\..\release -InputPath=.\r_edgea.asm -InputName=r_edgea - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -# Begin Custom Build -OutDir=.\..\debug -InputPath=.\r_edgea.asm -InputName=r_edgea - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_image.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_IMA=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_IMA=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_IMA=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_light.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_LIG=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_LIG=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_LIG=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_main.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_MAI=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_MAI=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_MAI=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_misc.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_MIS=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_MIS=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_MIS=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_model.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_MOD=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_MOD=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_MOD=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_part.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_PAR=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_PAR=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_PAR=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_poly.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_POL=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_POL=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_POL=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_polysa.asm - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -# Begin Custom Build -OutDir=.\..\release -InputPath=.\r_polysa.asm -InputName=r_polysa - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -# Begin Custom Build -OutDir=.\..\debug -InputPath=.\r_polysa.asm -InputName=r_polysa - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_polyse.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_POLY=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\adivtab.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - ".\rand1k.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_POLY=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\adivtab.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - ".\rand1k.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_POLY=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\adivtab.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - ".\rand1k.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_rast.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_RAS=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_RAS=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_RAS=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_scan.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_SCA=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_SCA=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_SCA=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_scana.asm - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -# Begin Custom Build -OutDir=.\..\release -InputPath=.\r_scana.asm -InputName=r_scana - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -# Begin Custom Build -OutDir=.\..\debug -InputPath=.\r_scana.asm -InputName=r_scana - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_spr8.asm - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -# Begin Custom Build -OutDir=.\..\release -InputPath=.\r_spr8.asm -InputName=r_spr8 - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -# Begin Custom Build -OutDir=.\..\debug -InputPath=.\r_spr8.asm -InputName=r_spr8 - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_sprite.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_SPR=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_SPR=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_SPR=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_surf.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_R_SUR=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_R_SUR=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_R_SUR=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_surf8.asm - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -# Begin Custom Build -OutDir=.\..\release -InputPath=.\r_surf8.asm -InputName=r_surf8 - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -# Begin Custom Build -OutDir=.\..\debug -InputPath=.\r_surf8.asm -InputName=r_surf8 - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\r_varsa.asm - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -# Begin Custom Build -OutDir=.\..\release -InputPath=.\r_varsa.asm -InputName=r_varsa - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -# Begin Custom Build -OutDir=.\..\debug -InputPath=.\r_varsa.asm -InputName=r_varsa - -"$(OUTDIR)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml /c /Cp /coff /Fo$(OUTDIR)\$(InputName).obj /Zm /Zi $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\win32\rw_ddraw.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_RW_DD=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\rw_win.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_RW_DD=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\rw_win.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_RW_DD=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\rw_win.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\win32\rw_dib.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_RW_DI=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\rw_win.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_RW_DI=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\rw_win.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_RW_DI=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\rw_win.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\win32\rw_imp.c - -!IF "$(CFG)" == "ref_soft - Win32 Release" - -DEP_CPP_RW_IM=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\rw_win.h"\ - "..\win32\winquake.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug" - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Debug Alpha" - -DEP_CPP_RW_IM=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\rw_win.h"\ - "..\win32\winquake.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ELSEIF "$(CFG)" == "ref_soft - Win32 Release Alpha" - -DEP_CPP_RW_IM=\ - "..\client\ref.h"\ - "..\game\q_shared.h"\ - "..\qcommon\qcommon.h"\ - "..\qcommon\qfiles.h"\ - "..\win32\rw_win.h"\ - "..\win32\winquake.h"\ - ".\r_local.h"\ - ".\r_model.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" -# Begin Source File - -SOURCE=.\adivtab.h -# End Source File -# Begin Source File - -SOURCE=.\anorms.h -# End Source File -# Begin Source File - -SOURCE=..\game\q_shared.h -# End Source File -# Begin Source File - -SOURCE=..\qcommon\qcommon.h -# End Source File -# Begin Source File - -SOURCE=..\qcommon\qfiles.h -# End Source File -# Begin Source File - -SOURCE=.\r_local.h -# End Source File -# Begin Source File - -SOURCE=.\r_model.h -# End Source File -# Begin Source File - -SOURCE=.\rand1k.h -# End Source File -# Begin Source File - -SOURCE=..\client\ref.h -# End Source File -# Begin Source File - -SOURCE=..\win32\rw_win.h -# End Source File -# Begin Source File - -SOURCE=..\win32\winquake.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\ref_soft.def -# End Source File -# End Group -# End Target -# End Project diff --git a/ref_soft/ref_soft.plg b/ref_soft/ref_soft.plg deleted file mode 100644 index b651f0b..0000000 --- a/ref_soft/ref_soft.plg +++ /dev/null @@ -1,17 +0,0 @@ ---------------------Configuration: ref_soft - Win32 Release Alpha-------------------- -Begining build with project "G:\quake2\code\ref_soft\ref_soft.dsp", at root. -Active configuration is Win32 (ALPHA) Dynamic-Link Library (based on Win32 (ALPHA) Dynamic-Link Library) - -Project's tools are: - "OLE Type Library Maker" with flags "/nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 " - "C/C++ Compiler for Alpha" with flags "/nologo /QA21164 /MT /Gt0 /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "C_ONLY" /Fp".\ReleaseAXP/ref_soft.pch" /YX /Fo".\ReleaseAXP/" /Fd".\ReleaseAXP/" /FD /QAieee1 /c " - "Win32 Resource Compiler" with flags "/l 0x409 /d "NDEBUG" " - "Browser Database Maker" with flags "/nologo /o"..\ReleaseAXP/ref_soft.bsc" " - "COFF Linker for Alpha" with flags "kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"..\ReleaseAXP/ref_soft.pdb" /debug /machine:ALPHA /def:".\ref_soft.def" /out:"..\ReleaseAXP/ref_soft.dll" /implib:"..\ReleaseAXP/ref_soft.lib" " - "Custom Build" with flags "" - "" with flags "" - - - - -ref_soft.dll - 0 error(s), 0 warning(s) diff --git a/server/sv_game.c b/server/sv_game.c index 2010122..c5f557c 100644 --- a/server/sv_game.c +++ b/server/sv_game.c @@ -199,6 +199,7 @@ void PF_Configstring (int index, char *val) // change the string in sv strcpy (sv.configstrings[index], val); + if (sv.state != ss_loading) { // send the update to everyone diff --git a/server/sv_main.c b/server/sv_main.c index e176e97..590aa67 100644 --- a/server/sv_main.c +++ b/server/sv_main.c @@ -829,11 +829,12 @@ void Master_Heartbeat (void) char *string; int i; - - if (!dedicated->value) + // pgm post3.19 change, cvar pointer not validated before dereferencing + if (!dedicated || !dedicated->value) return; // only dedicated servers send heartbeats - if (!public_server->value) + // pgm post3.19 change, cvar pointer not validated before dereferencing + if (!public_server || !public_server->value) return; // a private dedicated game // check for time wraparound @@ -868,10 +869,12 @@ void Master_Shutdown (void) { int i; - if (!dedicated->value) + // pgm post3.19 change, cvar pointer not validated before dereferencing + if (!dedicated || !dedicated->value) return; // only dedicated servers send heartbeats - if (!public_server->value) + // pgm post3.19 change, cvar pointer not validated before dereferencing + if (!public_server || !public_server->value) return; // a private dedicated game // send to group master @@ -963,7 +966,7 @@ void SV_Init (void) sv_paused = Cvar_Get ("paused", "0", 0); sv_timedemo = Cvar_Get ("timedemo", "0", 0); sv_enforcetime = Cvar_Get ("sv_enforcetime", "0", 0); - allow_download = Cvar_Get ("allow_download", "0", CVAR_ARCHIVE); + allow_download = Cvar_Get ("allow_download", "1", CVAR_ARCHIVE); allow_download_players = Cvar_Get ("allow_download_players", "0", CVAR_ARCHIVE); allow_download_models = Cvar_Get ("allow_download_models", "1", CVAR_ARCHIVE); allow_download_sounds = Cvar_Get ("allow_download_sounds", "1", CVAR_ARCHIVE); diff --git a/server/sv_null.c b/server/sv_null.c index e9f5936..3abcfdc 100644 --- a/server/sv_null.c +++ b/server/sv_null.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ // sv_null.c -- this file can stub out the entire server system // for pure net-only clients diff --git a/solaris/g_so.c b/solaris/g_so.c index 69f75f8..97d1d64 100644 --- a/solaris/g_so.c +++ b/solaris/g_so.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ int main(int argc, char *argv) { } diff --git a/solaris/glob.c b/solaris/glob.c index f248b03..43f885e 100644 --- a/solaris/glob.c +++ b/solaris/glob.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include #include "../linux/glob.h" diff --git a/solaris/glob.h b/solaris/glob.h index c4a1b43..584540b 100644 --- a/solaris/glob.h +++ b/solaris/glob.h @@ -1 +1,20 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ int glob_match(char *pattern, char *text); diff --git a/solaris/makefile.solaris b/solaris/makefile.solaris new file mode 100644 index 0000000..beb0e9e --- /dev/null +++ b/solaris/makefile.solaris @@ -0,0 +1,1031 @@ +# +# Quake2 Makefile for Solaris +# +# Nov '97 by Zoid +# +# ELF only +# + +VERSION=3.20 + +ifneq (,$(findstring i86pc,$(shell uname -m))) +ARCH=i386 +else +ARCH=sparc +endif + +MOUNT_DIR=/grog/Projects/Quake2/code + +BUILD_DEBUG_DIR=debug$(ARCH) +BUILD_RELEASE_DIR=release$(ARCH) +CLIENT_DIR=$(MOUNT_DIR)/client +SERVER_DIR=$(MOUNT_DIR)/server +COMMON_DIR=$(MOUNT_DIR)/qcommon +SOLARIS_DIR=$(MOUNT_DIR)/solaris +GAME_DIR=$(MOUNT_DIR)/game +CTF_DIR=$(MOUNT_DIR)/ctf +XATRIX_DIR=$(MOUNT_DIR)/xatrix +ROGUE_DIR=$(MOUNT_DIR)/rogue +NULL_DIR=$(MOUNT_DIR)/null + +CC=gcc +BASE_CFLAGS=-Dstricmp=strcasecmp -DC_ONLY -DDEDICATED_ONLY +RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \ + -fomit-frame-pointer -fexpensive-optimizations + +DEBUG_CFLAGS=$(BASE_CFLAGS) -g +LDFLAGS=-ldl -lm -lsocket -lnsl + +SHLIBEXT=so + +SHLIBCFLAGS=-fPIC +SHLIBLDFLAGS=-shared + +DO_CC=$(CC) $(CFLAGS) -o $@ -c $< +DO_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< + +############################################################################# +# SETUP AND BUILD +############################################################################# + +TARGETS=$(BUILDDIR)/q2ded \ + $(BUILDDIR)/game$(ARCH).$(SHLIBEXT) \ + $(BUILDDIR)/ctf/game$(ARCH).$(SHLIBEXT) \ + $(BUILDDIR)/xatrix/game$(ARCH).$(SHLIBEXT) \ + $(BUILDDIR)/rogue/game$(ARCH).$(SHLIBEXT) + +build_debug: + @-mkdir $(BUILD_DEBUG_DIR) \ + $(BUILD_DEBUG_DIR)/client \ + $(BUILD_DEBUG_DIR)/game \ + $(BUILD_DEBUG_DIR)/ctf \ + $(BUILD_DEBUG_DIR)/xatrix \ + $(BUILD_DEBUG_DIR)/rogue + $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)" + +build_release: + @-mkdir $(BUILD_RELEASE_DIR) \ + $(BUILD_RELEASE_DIR)/client \ + $(BUILD_RELEASE_DIR)/game \ + $(BUILD_RELEASE_DIR)/ctf \ + $(BUILD_RELEASE_DIR)/xatrix \ + $(BUILD_RELEASE_DIR)/rogue + $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS)" + +all: build_debug build_release + +targets: $(TARGETS) + +############################################################################# +# CLIENT/SERVER +############################################################################# + +QUAKE2_OBJS = \ + \ + $(BUILDDIR)/client/cmd.o \ + $(BUILDDIR)/client/cmodel.o \ + $(BUILDDIR)/client/common.o \ + $(BUILDDIR)/client/crc.o \ + $(BUILDDIR)/client/cvar.o \ + $(BUILDDIR)/client/files.o \ + $(BUILDDIR)/client/md4.o \ + $(BUILDDIR)/client/net_chan.o \ + \ + $(BUILDDIR)/client/sv_ccmds.o \ + $(BUILDDIR)/client/sv_ents.o \ + $(BUILDDIR)/client/sv_game.o \ + $(BUILDDIR)/client/sv_init.o \ + $(BUILDDIR)/client/sv_main.o \ + $(BUILDDIR)/client/sv_send.o \ + $(BUILDDIR)/client/sv_user.o \ + $(BUILDDIR)/client/sv_world.o \ + \ + $(BUILDDIR)/client/q_shsolaris.o \ + $(BUILDDIR)/client/sys_solaris.o \ + $(BUILDDIR)/client/glob.o \ + $(BUILDDIR)/client/net_udp.o \ + \ + $(BUILDDIR)/client/q_shared.o \ + $(BUILDDIR)/client/pmove.o \ + \ + $(BUILDDIR)/client/cl_null.o \ + $(BUILDDIR)/client/cd_null.o + +$(BUILDDIR)/q2ded : $(QUAKE2_OBJS) + $(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(LDFLAGS) + +$(BUILDDIR)/client/cmd.o : $(COMMON_DIR)/cmd.c + $(DO_CC) + +$(BUILDDIR)/client/cmodel.o : $(COMMON_DIR)/cmodel.c + $(DO_CC) + +$(BUILDDIR)/client/common.o : $(COMMON_DIR)/common.c + $(DO_CC) + +$(BUILDDIR)/client/crc.o : $(COMMON_DIR)/crc.c + $(DO_CC) + +$(BUILDDIR)/client/cvar.o : $(COMMON_DIR)/cvar.c + $(DO_CC) + +$(BUILDDIR)/client/files.o : $(COMMON_DIR)/files.c + $(DO_CC) + +$(BUILDDIR)/client/md4.o : $(COMMON_DIR)/md4.c + $(DO_CC) + +$(BUILDDIR)/client/net_chan.o : $(COMMON_DIR)/net_chan.c + $(DO_CC) + +$(BUILDDIR)/client/q_shared.o : $(GAME_DIR)/q_shared.c + $(DO_CC) + +$(BUILDDIR)/client/pmove.o : $(COMMON_DIR)/pmove.c + $(DO_CC) + +$(BUILDDIR)/client/sv_ccmds.o : $(SERVER_DIR)/sv_ccmds.c + $(DO_CC) + +$(BUILDDIR)/client/sv_ents.o : $(SERVER_DIR)/sv_ents.c + $(DO_CC) + +$(BUILDDIR)/client/sv_game.o : $(SERVER_DIR)/sv_game.c + $(DO_CC) + +$(BUILDDIR)/client/sv_init.o : $(SERVER_DIR)/sv_init.c + $(DO_CC) + +$(BUILDDIR)/client/sv_main.o : $(SERVER_DIR)/sv_main.c + $(DO_CC) + +$(BUILDDIR)/client/sv_send.o : $(SERVER_DIR)/sv_send.c + $(DO_CC) + +$(BUILDDIR)/client/sv_user.o : $(SERVER_DIR)/sv_user.c + $(DO_CC) + +$(BUILDDIR)/client/sv_world.o : $(SERVER_DIR)/sv_world.c + $(DO_CC) + +$(BUILDDIR)/client/q_shsolaris.o : $(SOLARIS_DIR)/q_shsolaris.c + $(DO_CC) + +$(BUILDDIR)/client/sys_solaris.o : $(SOLARIS_DIR)/sys_solaris.c + $(DO_CC) + +$(BUILDDIR)/client/glob.o : $(SOLARIS_DIR)/glob.c + $(DO_CC) + +$(BUILDDIR)/client/net_udp.o : $(SOLARIS_DIR)/net_udp.c + $(DO_CC) + +$(BUILDDIR)/client/cd_null.o : $(NULL_DIR)/cd_null.c + $(DO_CC) + +$(BUILDDIR)/client/cl_null.o : $(NULL_DIR)/cl_null.c + $(DO_CC) + +############################################################################# +# GAME +############################################################################# + +GAME_OBJS = \ + $(BUILDDIR)/game/g_ai.o \ + $(BUILDDIR)/game/p_client.o \ + $(BUILDDIR)/game/g_cmds.o \ + $(BUILDDIR)/game/g_svcmds.o \ + $(BUILDDIR)/game/g_chase.o \ + $(BUILDDIR)/game/g_combat.o \ + $(BUILDDIR)/game/g_func.o \ + $(BUILDDIR)/game/g_items.o \ + $(BUILDDIR)/game/g_main.o \ + $(BUILDDIR)/game/g_misc.o \ + $(BUILDDIR)/game/g_monster.o \ + $(BUILDDIR)/game/g_phys.o \ + $(BUILDDIR)/game/g_save.o \ + $(BUILDDIR)/game/g_spawn.o \ + $(BUILDDIR)/game/g_target.o \ + $(BUILDDIR)/game/g_trigger.o \ + $(BUILDDIR)/game/g_turret.o \ + $(BUILDDIR)/game/g_utils.o \ + $(BUILDDIR)/game/g_weapon.o \ + $(BUILDDIR)/game/m_actor.o \ + $(BUILDDIR)/game/m_berserk.o \ + $(BUILDDIR)/game/m_boss2.o \ + $(BUILDDIR)/game/m_boss3.o \ + $(BUILDDIR)/game/m_boss31.o \ + $(BUILDDIR)/game/m_boss32.o \ + $(BUILDDIR)/game/m_brain.o \ + $(BUILDDIR)/game/m_chick.o \ + $(BUILDDIR)/game/m_flipper.o \ + $(BUILDDIR)/game/m_float.o \ + $(BUILDDIR)/game/m_flyer.o \ + $(BUILDDIR)/game/m_gladiator.o \ + $(BUILDDIR)/game/m_gunner.o \ + $(BUILDDIR)/game/m_hover.o \ + $(BUILDDIR)/game/m_infantry.o \ + $(BUILDDIR)/game/m_insane.o \ + $(BUILDDIR)/game/m_medic.o \ + $(BUILDDIR)/game/m_move.o \ + $(BUILDDIR)/game/m_mutant.o \ + $(BUILDDIR)/game/m_parasite.o \ + $(BUILDDIR)/game/m_soldier.o \ + $(BUILDDIR)/game/m_supertank.o \ + $(BUILDDIR)/game/m_tank.o \ + $(BUILDDIR)/game/p_hud.o \ + $(BUILDDIR)/game/p_trail.o \ + $(BUILDDIR)/game/p_view.o \ + $(BUILDDIR)/game/p_weapon.o \ + $(BUILDDIR)/game/q_shared.o \ + $(BUILDDIR)/game/m_flash.o + +$(BUILDDIR)/game$(ARCH).$(SHLIBEXT) : $(GAME_OBJS) + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(GAME_OBJS) + +$(BUILDDIR)/game/g_ai.o : $(GAME_DIR)/g_ai.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/p_client.o : $(GAME_DIR)/p_client.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_cmds.o : $(GAME_DIR)/g_cmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_svcmds.o : $(GAME_DIR)/g_svcmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_chase.o : $(GAME_DIR)/g_chase.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_combat.o : $(GAME_DIR)/g_combat.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_func.o : $(GAME_DIR)/g_func.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_items.o : $(GAME_DIR)/g_items.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_main.o : $(GAME_DIR)/g_main.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_misc.o : $(GAME_DIR)/g_misc.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_monster.o : $(GAME_DIR)/g_monster.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_phys.o : $(GAME_DIR)/g_phys.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_save.o : $(GAME_DIR)/g_save.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_spawn.o : $(GAME_DIR)/g_spawn.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_target.o : $(GAME_DIR)/g_target.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_trigger.o : $(GAME_DIR)/g_trigger.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_turret.o : $(GAME_DIR)/g_turret.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_utils.o : $(GAME_DIR)/g_utils.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/g_weapon.o : $(GAME_DIR)/g_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_actor.o : $(GAME_DIR)/m_actor.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_berserk.o : $(GAME_DIR)/m_berserk.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_boss2.o : $(GAME_DIR)/m_boss2.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_boss3.o : $(GAME_DIR)/m_boss3.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_boss31.o : $(GAME_DIR)/m_boss31.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_boss32.o : $(GAME_DIR)/m_boss32.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_brain.o : $(GAME_DIR)/m_brain.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_chick.o : $(GAME_DIR)/m_chick.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_flipper.o : $(GAME_DIR)/m_flipper.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_float.o : $(GAME_DIR)/m_float.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_flyer.o : $(GAME_DIR)/m_flyer.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_gladiator.o : $(GAME_DIR)/m_gladiator.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_gunner.o : $(GAME_DIR)/m_gunner.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_hover.o : $(GAME_DIR)/m_hover.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_infantry.o : $(GAME_DIR)/m_infantry.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_insane.o : $(GAME_DIR)/m_insane.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_medic.o : $(GAME_DIR)/m_medic.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_move.o : $(GAME_DIR)/m_move.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_mutant.o : $(GAME_DIR)/m_mutant.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_parasite.o : $(GAME_DIR)/m_parasite.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_soldier.o : $(GAME_DIR)/m_soldier.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_supertank.o : $(GAME_DIR)/m_supertank.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_tank.o : $(GAME_DIR)/m_tank.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/p_hud.o : $(GAME_DIR)/p_hud.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/p_trail.o : $(GAME_DIR)/p_trail.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/p_view.o : $(GAME_DIR)/p_view.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/p_weapon.o : $(GAME_DIR)/p_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/q_shared.o : $(GAME_DIR)/q_shared.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/game/m_flash.o : $(GAME_DIR)/m_flash.c + $(DO_SHLIB_CC) + +############################################################################# +# CTF +############################################################################# + +CTF_OBJS = \ + $(BUILDDIR)/ctf/g_ai.o \ + $(BUILDDIR)/ctf/g_chase.o \ + $(BUILDDIR)/ctf/g_cmds.o \ + $(BUILDDIR)/ctf/g_combat.o \ + $(BUILDDIR)/ctf/g_ctf.o \ + $(BUILDDIR)/ctf/g_func.o \ + $(BUILDDIR)/ctf/g_items.o \ + $(BUILDDIR)/ctf/g_main.o \ + $(BUILDDIR)/ctf/g_misc.o \ + $(BUILDDIR)/ctf/g_monster.o \ + $(BUILDDIR)/ctf/g_phys.o \ + $(BUILDDIR)/ctf/g_save.o \ + $(BUILDDIR)/ctf/g_spawn.o \ + $(BUILDDIR)/ctf/g_svcmds.o \ + $(BUILDDIR)/ctf/g_target.o \ + $(BUILDDIR)/ctf/g_trigger.o \ + $(BUILDDIR)/ctf/g_utils.o \ + $(BUILDDIR)/ctf/g_weapon.o \ + $(BUILDDIR)/ctf/m_move.o \ + $(BUILDDIR)/ctf/p_client.o \ + $(BUILDDIR)/ctf/p_hud.o \ + $(BUILDDIR)/ctf/p_menu.o \ + $(BUILDDIR)/ctf/p_trail.o \ + $(BUILDDIR)/ctf/p_view.o \ + $(BUILDDIR)/ctf/p_weapon.o \ + $(BUILDDIR)/ctf/q_shared.o + +$(BUILDDIR)/ctf/game$(ARCH).$(SHLIBEXT) : $(CTF_OBJS) + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(CTF_OBJS) + +$(BUILDDIR)/ctf/g_ai.o : $(CTF_DIR)/g_ai.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_chase.o : $(CTF_DIR)/g_chase.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_cmds.o : $(CTF_DIR)/g_cmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_combat.o : $(CTF_DIR)/g_combat.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_ctf.o : $(CTF_DIR)/g_ctf.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_func.o : $(CTF_DIR)/g_func.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_items.o : $(CTF_DIR)/g_items.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_main.o : $(CTF_DIR)/g_main.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_misc.o : $(CTF_DIR)/g_misc.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_monster.o : $(CTF_DIR)/g_monster.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_phys.o : $(CTF_DIR)/g_phys.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_save.o : $(CTF_DIR)/g_save.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_spawn.o : $(CTF_DIR)/g_spawn.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_svcmds.o : $(CTF_DIR)/g_svcmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_target.o : $(CTF_DIR)/g_target.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_trigger.o : $(CTF_DIR)/g_trigger.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_utils.o : $(CTF_DIR)/g_utils.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/g_weapon.o : $(CTF_DIR)/g_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/m_move.o : $(CTF_DIR)/m_move.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/p_client.o : $(CTF_DIR)/p_client.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/p_hud.o : $(CTF_DIR)/p_hud.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/p_menu.o : $(CTF_DIR)/p_menu.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/p_trail.o : $(CTF_DIR)/p_trail.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/p_view.o : $(CTF_DIR)/p_view.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/p_weapon.o : $(CTF_DIR)/p_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/ctf/q_shared.o : $(CTF_DIR)/q_shared.c + $(DO_SHLIB_CC) + +############################################################################# +# XATRIX +############################################################################# + +XATRIX_OBJS = \ + $(BUILDDIR)/xatrix/g_ai.o \ + $(BUILDDIR)/xatrix/g_cmds.o \ + $(BUILDDIR)/xatrix/g_chase.o \ + $(BUILDDIR)/xatrix/g_combat.o \ + $(BUILDDIR)/xatrix/g_func.o \ + $(BUILDDIR)/xatrix/g_items.o \ + $(BUILDDIR)/xatrix/g_main.o \ + $(BUILDDIR)/xatrix/g_misc.o \ + $(BUILDDIR)/xatrix/g_monster.o \ + $(BUILDDIR)/xatrix/g_phys.o \ + $(BUILDDIR)/xatrix/g_save.o \ + $(BUILDDIR)/xatrix/g_spawn.o \ + $(BUILDDIR)/xatrix/g_svcmds.o \ + $(BUILDDIR)/xatrix/g_target.o \ + $(BUILDDIR)/xatrix/g_trigger.o \ + $(BUILDDIR)/xatrix/g_turret.o \ + $(BUILDDIR)/xatrix/g_utils.o \ + $(BUILDDIR)/xatrix/g_weapon.o \ + $(BUILDDIR)/xatrix/m_actor.o \ + $(BUILDDIR)/xatrix/m_berserk.o \ + $(BUILDDIR)/xatrix/m_boss2.o \ + $(BUILDDIR)/xatrix/m_boss3.o \ + $(BUILDDIR)/xatrix/m_boss31.o \ + $(BUILDDIR)/xatrix/m_boss32.o \ + $(BUILDDIR)/xatrix/m_boss5.o \ + $(BUILDDIR)/xatrix/m_brain.o \ + $(BUILDDIR)/xatrix/m_chick.o \ + $(BUILDDIR)/xatrix/m_fixbot.o \ + $(BUILDDIR)/xatrix/m_flash.o \ + $(BUILDDIR)/xatrix/m_flipper.o \ + $(BUILDDIR)/xatrix/m_float.o \ + $(BUILDDIR)/xatrix/m_flyer.o \ + $(BUILDDIR)/xatrix/m_gekk.o \ + $(BUILDDIR)/xatrix/m_gladb.o \ + $(BUILDDIR)/xatrix/m_gladiator.o \ + $(BUILDDIR)/xatrix/m_gunner.o \ + $(BUILDDIR)/xatrix/m_hover.o \ + $(BUILDDIR)/xatrix/m_infantry.o \ + $(BUILDDIR)/xatrix/m_insane.o \ + $(BUILDDIR)/xatrix/m_medic.o \ + $(BUILDDIR)/xatrix/m_move.o \ + $(BUILDDIR)/xatrix/m_mutant.o \ + $(BUILDDIR)/xatrix/m_parasite.o \ + $(BUILDDIR)/xatrix/m_soldier.o \ + $(BUILDDIR)/xatrix/m_supertank.o \ + $(BUILDDIR)/xatrix/m_tank.o \ + $(BUILDDIR)/xatrix/p_client.o \ + $(BUILDDIR)/xatrix/p_hud.o \ + $(BUILDDIR)/xatrix/p_trail.o \ + $(BUILDDIR)/xatrix/p_view.o \ + $(BUILDDIR)/xatrix/p_weapon.o \ + $(BUILDDIR)/xatrix/q_shared.o + +$(BUILDDIR)/xatrix/game$(ARCH).$(SHLIBEXT) : $(XATRIX_OBJS) + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(XATRIX_OBJS) + +$(BUILDDIR)/xatrix/g_ai.o : $(XATRIX_DIR)/g_ai.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_cmds.o : $(XATRIX_DIR)/g_cmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_chase.o : $(XATRIX_DIR)/g_chase.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_combat.o : $(XATRIX_DIR)/g_combat.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_func.o : $(XATRIX_DIR)/g_func.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_items.o : $(XATRIX_DIR)/g_items.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_main.o : $(XATRIX_DIR)/g_main.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_misc.o : $(XATRIX_DIR)/g_misc.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_monster.o : $(XATRIX_DIR)/g_monster.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_phys.o : $(XATRIX_DIR)/g_phys.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_save.o : $(XATRIX_DIR)/g_save.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_spawn.o : $(XATRIX_DIR)/g_spawn.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_svcmds.o : $(XATRIX_DIR)/g_svcmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_target.o : $(XATRIX_DIR)/g_target.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_trigger.o : $(XATRIX_DIR)/g_trigger.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_turret.o : $(XATRIX_DIR)/g_turret.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_utils.o : $(XATRIX_DIR)/g_utils.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/g_weapon.o : $(XATRIX_DIR)/g_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_actor.o : $(XATRIX_DIR)/m_actor.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_berserk.o : $(XATRIX_DIR)/m_berserk.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_boss2.o : $(XATRIX_DIR)/m_boss2.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_boss3.o : $(XATRIX_DIR)/m_boss3.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_boss31.o : $(XATRIX_DIR)/m_boss31.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_boss32.o : $(XATRIX_DIR)/m_boss32.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_boss5.o : $(XATRIX_DIR)/m_boss5.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_brain.o : $(XATRIX_DIR)/m_brain.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_chick.o : $(XATRIX_DIR)/m_chick.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_fixbot.o : $(XATRIX_DIR)/m_fixbot.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_flash.o : $(XATRIX_DIR)/m_flash.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_flipper.o : $(XATRIX_DIR)/m_flipper.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_float.o : $(XATRIX_DIR)/m_float.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_flyer.o : $(XATRIX_DIR)/m_flyer.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_gekk.o : $(XATRIX_DIR)/m_gekk.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_gladb.o : $(XATRIX_DIR)/m_gladb.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_gladiator.o : $(XATRIX_DIR)/m_gladiator.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_gunner.o : $(XATRIX_DIR)/m_gunner.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_hover.o : $(XATRIX_DIR)/m_hover.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_infantry.o : $(XATRIX_DIR)/m_infantry.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_insane.o : $(XATRIX_DIR)/m_insane.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_medic.o : $(XATRIX_DIR)/m_medic.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_move.o : $(XATRIX_DIR)/m_move.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_mutant.o : $(XATRIX_DIR)/m_mutant.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_parasite.o : $(XATRIX_DIR)/m_parasite.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_soldier.o : $(XATRIX_DIR)/m_soldier.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_supertank.o : $(XATRIX_DIR)/m_supertank.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/m_tank.o : $(XATRIX_DIR)/m_tank.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/p_client.o : $(XATRIX_DIR)/p_client.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/p_hud.o : $(XATRIX_DIR)/p_hud.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/p_trail.o : $(XATRIX_DIR)/p_trail.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/p_view.o : $(XATRIX_DIR)/p_view.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/p_weapon.o : $(XATRIX_DIR)/p_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/xatrix/q_shared.o : $(XATRIX_DIR)/q_shared.c + $(DO_SHLIB_CC) + +############################################################################# +# ROGUE +############################################################################# + +ROGUE_OBJS = \ + $(BUILDDIR)/rogue/dm_ball.o \ + $(BUILDDIR)/rogue/dm_tag.o \ + $(BUILDDIR)/rogue/g_ai.o \ + $(BUILDDIR)/rogue/g_chase.o \ + $(BUILDDIR)/rogue/g_cmds.o \ + $(BUILDDIR)/rogue/g_combat.o \ + $(BUILDDIR)/rogue/g_func.o \ + $(BUILDDIR)/rogue/g_items.o \ + $(BUILDDIR)/rogue/g_main.o \ + $(BUILDDIR)/rogue/g_misc.o \ + $(BUILDDIR)/rogue/g_monster.o \ + $(BUILDDIR)/rogue/g_newai.o \ + $(BUILDDIR)/rogue/g_newdm.o \ + $(BUILDDIR)/rogue/g_newfnc.o \ + $(BUILDDIR)/rogue/g_newtarg.o \ + $(BUILDDIR)/rogue/g_newtrig.o \ + $(BUILDDIR)/rogue/g_newweap.o \ + $(BUILDDIR)/rogue/g_phys.o \ + $(BUILDDIR)/rogue/g_save.o \ + $(BUILDDIR)/rogue/g_spawn.o \ + $(BUILDDIR)/rogue/g_sphere.o \ + $(BUILDDIR)/rogue/g_svcmds.o \ + $(BUILDDIR)/rogue/g_target.o \ + $(BUILDDIR)/rogue/g_trigger.o \ + $(BUILDDIR)/rogue/g_turret.o \ + $(BUILDDIR)/rogue/g_utils.o \ + $(BUILDDIR)/rogue/g_weapon.o \ + $(BUILDDIR)/rogue/m_actor.o \ + $(BUILDDIR)/rogue/m_berserk.o \ + $(BUILDDIR)/rogue/m_boss2.o \ + $(BUILDDIR)/rogue/m_boss3.o \ + $(BUILDDIR)/rogue/m_boss31.o \ + $(BUILDDIR)/rogue/m_boss32.o \ + $(BUILDDIR)/rogue/m_brain.o \ + $(BUILDDIR)/rogue/m_carrier.o \ + $(BUILDDIR)/rogue/m_chick.o \ + $(BUILDDIR)/rogue/m_flash.o \ + $(BUILDDIR)/rogue/m_flipper.o \ + $(BUILDDIR)/rogue/m_float.o \ + $(BUILDDIR)/rogue/m_flyer.o \ + $(BUILDDIR)/rogue/m_gladiator.o \ + $(BUILDDIR)/rogue/m_gunner.o \ + $(BUILDDIR)/rogue/m_hover.o \ + $(BUILDDIR)/rogue/m_infantry.o \ + $(BUILDDIR)/rogue/m_insane.o \ + $(BUILDDIR)/rogue/m_medic.o \ + $(BUILDDIR)/rogue/m_move.o \ + $(BUILDDIR)/rogue/m_mutant.o \ + $(BUILDDIR)/rogue/m_parasite.o \ + $(BUILDDIR)/rogue/m_soldier.o \ + $(BUILDDIR)/rogue/m_stalker.o \ + $(BUILDDIR)/rogue/m_supertank.o \ + $(BUILDDIR)/rogue/m_tank.o \ + $(BUILDDIR)/rogue/m_turret.o \ + $(BUILDDIR)/rogue/m_widow.o \ + $(BUILDDIR)/rogue/m_widow2.o \ + $(BUILDDIR)/rogue/p_client.o \ + $(BUILDDIR)/rogue/p_hud.o \ + $(BUILDDIR)/rogue/p_trail.o \ + $(BUILDDIR)/rogue/p_view.o \ + $(BUILDDIR)/rogue/p_weapon.o \ + $(BUILDDIR)/rogue/q_shared.o + +$(BUILDDIR)/rogue/game$(ARCH).$(SHLIBEXT) : $(ROGUE_OBJS) + $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(ROGUE_OBJS) + +$(BUILDDIR)/rogue/dm_ball.o : $(ROGUE_DIR)/dm_ball.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/dm_tag.o : $(ROGUE_DIR)/dm_tag.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_ai.o : $(ROGUE_DIR)/g_ai.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_chase.o : $(ROGUE_DIR)/g_chase.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_cmds.o : $(ROGUE_DIR)/g_cmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_combat.o : $(ROGUE_DIR)/g_combat.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_func.o : $(ROGUE_DIR)/g_func.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_items.o : $(ROGUE_DIR)/g_items.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_main.o : $(ROGUE_DIR)/g_main.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_misc.o : $(ROGUE_DIR)/g_misc.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_monster.o : $(ROGUE_DIR)/g_monster.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_newai.o : $(ROGUE_DIR)/g_newai.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_newdm.o : $(ROGUE_DIR)/g_newdm.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_newfnc.o : $(ROGUE_DIR)/g_newfnc.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_newtarg.o : $(ROGUE_DIR)/g_newtarg.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_newtrig.o : $(ROGUE_DIR)/g_newtrig.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_newweap.o : $(ROGUE_DIR)/g_newweap.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_phys.o : $(ROGUE_DIR)/g_phys.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_save.o : $(ROGUE_DIR)/g_save.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_spawn.o : $(ROGUE_DIR)/g_spawn.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_sphere.o : $(ROGUE_DIR)/g_sphere.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_svcmds.o : $(ROGUE_DIR)/g_svcmds.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_target.o : $(ROGUE_DIR)/g_target.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_trigger.o : $(ROGUE_DIR)/g_trigger.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_turret.o : $(ROGUE_DIR)/g_turret.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_utils.o : $(ROGUE_DIR)/g_utils.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/g_weapon.o : $(ROGUE_DIR)/g_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_actor.o : $(ROGUE_DIR)/m_actor.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_berserk.o : $(ROGUE_DIR)/m_berserk.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_boss2.o : $(ROGUE_DIR)/m_boss2.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_boss3.o : $(ROGUE_DIR)/m_boss3.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_boss31.o : $(ROGUE_DIR)/m_boss31.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_boss32.o : $(ROGUE_DIR)/m_boss32.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_brain.o : $(ROGUE_DIR)/m_brain.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_carrier.o : $(ROGUE_DIR)/m_carrier.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_chick.o : $(ROGUE_DIR)/m_chick.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_flash.o : $(ROGUE_DIR)/m_flash.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_flipper.o : $(ROGUE_DIR)/m_flipper.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_float.o : $(ROGUE_DIR)/m_float.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_flyer.o : $(ROGUE_DIR)/m_flyer.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_gladiator.o : $(ROGUE_DIR)/m_gladiator.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_gunner.o : $(ROGUE_DIR)/m_gunner.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_hover.o : $(ROGUE_DIR)/m_hover.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_infantry.o : $(ROGUE_DIR)/m_infantry.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_insane.o : $(ROGUE_DIR)/m_insane.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_medic.o : $(ROGUE_DIR)/m_medic.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_move.o : $(ROGUE_DIR)/m_move.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_mutant.o : $(ROGUE_DIR)/m_mutant.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_parasite.o : $(ROGUE_DIR)/m_parasite.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_soldier.o : $(ROGUE_DIR)/m_soldier.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_stalker.o : $(ROGUE_DIR)/m_stalker.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_supertank.o : $(ROGUE_DIR)/m_supertank.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_tank.o : $(ROGUE_DIR)/m_tank.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_turret.o : $(ROGUE_DIR)/m_turret.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_widow.o : $(ROGUE_DIR)/m_widow.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/m_widow2.o : $(ROGUE_DIR)/m_widow2.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/p_client.o : $(ROGUE_DIR)/p_client.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/p_hud.o : $(ROGUE_DIR)/p_hud.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/p_trail.o : $(ROGUE_DIR)/p_trail.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/p_view.o : $(ROGUE_DIR)/p_view.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/p_weapon.o : $(ROGUE_DIR)/p_weapon.c + $(DO_SHLIB_CC) + +$(BUILDDIR)/rogue/q_shared.o : $(ROGUE_DIR)/q_shared.c + $(DO_SHLIB_CC) + +############################################################################# +# TAR +############################################################################# + +# Make RPMs. You need to be root to make this work +RPMDIR = /var/tmp/q2ded-$(VERSION) + +tar: + if [ ! -d archives ];then mkdir archives;fi + $(MAKE) copyfiles COPYDIR=$(RPMDIR) + cd $(RPMDIR); tar cvf q2ded-$(VERSION)-$(ARCH)-sun-solaris2.5.1.tar * + cd $(RPMDIR); compress q2ded-$(VERSION)-$(ARCH)-sun-solaris2.5.1.tar + mv $(RPMDIR)/*.tar.Z archives/. + rm -rf $(RPMDIR) + +copyfiles: + -mkdirhier $(COPYDIR) + cp $(BUILD_RELEASE_DIR)/q2ded $(COPYDIR) + strip $(COPYDIR)/q2ded + chmod 755 $(COPYDIR)/q2ded + -mkdir $(COPYDIR)/baseq2 + chmod 755 $(COPYDIR)/baseq2 + cp $(BUILD_RELEASE_DIR)/game$(ARCH).$(SHLIBEXT) $(COPYDIR)/baseq2 + chmod 755 $(COPYDIR)/baseq2/game$(ARCH).$(SHLIBEXT) +# -mkdir $(COPYDIR)/ctf +# chmod 755 $(COPYDIR)/ctf +# cp $(BUILD_RELEASE_DIR)/ctf/game$(ARCH).$(SHLIBEXT) $(COPYDIR)/ctf +# chmod 755 $(COPYDIR)/ctf/game$(ARCH).$(SHLIBEXT) + -mkdir $(COPYDIR)/xatrix + chmod 755 $(COPYDIR)/xatrix + cp $(BUILD_RELEASE_DIR)/xatrix/game$(ARCH).$(SHLIBEXT) $(COPYDIR)/xatrix + chmod 755 $(COPYDIR)/xatrix/game$(ARCH).$(SHLIBEXT) + -mkdir $(COPYDIR)/rogue + chmod 755 $(COPYDIR)/rogue + cp $(BUILD_RELEASE_DIR)/rogue/game$(ARCH).$(SHLIBEXT) $(COPYDIR)/rogue + chmod 755 $(COPYDIR)/rogue/game$(ARCH).$(SHLIBEXT) + cp $(MOUNT_DIR)/solaris/readme.solaris $(COPYDIR)/README + cp $(MOUNT_DIR)/readme.txt $(COPYDIR) + cp $(MOUNT_DIR)/3.19_Changes.txt $(COPYDIR) + + +############################################################################# +# MISC +############################################################################# + +clean: clean-debug clean-release + +clean-debug: + $(MAKE) clean2 BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)" + +clean-release: + $(MAKE) clean2 BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(DEBUG_CFLAGS)" + +clean2: + -rm -f $(QUAKE2_OBJS) $(GAME_OBJS) $(CTF_OBJS) $(XATRIX_OBJS) diff --git a/solaris/net_udp.c b/solaris/net_udp.c index eba7f9d..44b03dc 100644 --- a/solaris/net_udp.c +++ b/solaris/net_udp.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ // net_wins.c #include "../qcommon/qcommon.h" diff --git a/solaris/q_shsolaris.c b/solaris/q_shsolaris.c index c56055a..6b41f26 100644 --- a/solaris/q_shsolaris.c +++ b/solaris/q_shsolaris.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include #include #include diff --git a/solaris/readme.solaris b/solaris/readme.solaris new file mode 100644 index 0000000..fb504f1 --- /dev/null +++ b/solaris/readme.solaris @@ -0,0 +1,53 @@ +Quake2 Dedicated 3.20 For Sun Solaris (x86 and Sparc) +----------------------------------------------------- + +Please see the readme.txt file included for general information about the +game. This file contains Solaris specific information. + +Requirements +------------ + +Solaris x86 2.5.1 or later, Sun Solaris Sparc 2.5.1 or later. + +Installation +------------ + +To install the Quake2 data files, mount your Quake2 CD and copy +the directory install/data to the location where you want Quake2. You +can also symlink it, but I don't recommend that. Around 200MB of disk +space is required for a full installation. + +For example: + cp -r /mnt/cdrom/install/data/* /usr/games/quake2 + +This binary only runs as a dedicated server and requires no special +user permissions. + +You can also set dmflags, timelimit, etc. in a config file, like so: + set timelimit 20 + set fraglimit 25 + set dmflags 532 + map fact3 + +Then exec that config file on load, like so: + + ./q2ded +exec server.cfg + +If you use a config file, you must put a 'map' command in it or the +server won't load a map. + +To run a dedicated server in the background, use this; + + nohup ./q2ded +exec server.cfg & + +A better way is to run Quake2 on a tty via screen. screen can be found +at ftp://prep.ai.mit.edu/pub/gnu/screen-3.7.4.tar.gz. + +----------------------------------------------------------------------------- + +Solaris Quake2 is an unsupported product. Usage of this product is bound by +the legal notice found on the distribution Quake2 CDROM. + +/// Zoid +zoid@idsoftware.com + diff --git a/solaris/sys_solaris.c b/solaris/sys_solaris.c index 7b8e59b..0890750 100644 --- a/solaris/sys_solaris.c +++ b/solaris/sys_solaris.c @@ -1,3 +1,22 @@ +/* +Copyright (C) 1997-2001 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ #include #include #include diff --git a/win32/net_wins.c b/win32/net_wins.c index 82b6b29..98596aa 100644 --- a/win32/net_wins.c +++ b/win32/net_wins.c @@ -353,21 +353,30 @@ qboolean NET_GetPacket (netsrc_t sock, netadr_t *net_from, sizebuf_t *net_messag fromlen = sizeof(from); ret = recvfrom (net_socket, net_message->data, net_message->maxsize , 0, (struct sockaddr *)&from, &fromlen); + + SockadrToNetadr (&from, net_from); + if (ret == -1) { err = WSAGetLastError(); if (err == WSAEWOULDBLOCK) continue; + if (err == WSAEMSGSIZE) { + Com_Printf ("Warning: Oversize packet from %s\n", + NET_AdrToString(*net_from)); + continue; + } + if (dedicated->value) // let dedicated servers continue after errors - Com_Printf ("NET_GetPacket: %s", NET_ErrorString()); + Com_Printf ("NET_GetPacket: %s from %s\n", NET_ErrorString(), + NET_AdrToString(*net_from)); else - Com_Error (ERR_DROP, "NET_GetPacket: %s", NET_ErrorString()); + Com_Error (ERR_DROP, "NET_GetPacket: %s from %s", + NET_ErrorString(), NET_AdrToString(*net_from)); continue; } - SockadrToNetadr (&from, net_from); - if (ret == net_message->maxsize) { Com_Printf ("Oversize packet from %s\n", NET_AdrToString (*net_from)); @@ -439,17 +448,20 @@ void NET_SendPacket (netsrc_t sock, int length, void *data, netadr_t to) if (dedicated->value) // let dedicated servers continue after errors { - Com_Printf ("NET_SendPacket ERROR: %s\n", NET_ErrorString()); + Com_Printf ("NET_SendPacket ERROR: %s to %s\n", NET_ErrorString(), + NET_AdrToString (to)); } else { if (err == WSAEADDRNOTAVAIL) { - Com_DPrintf ("NET_SendPacket Warning: %s : %s\n", NET_ErrorString(), NET_AdrToString (to)); + Com_DPrintf ("NET_SendPacket Warning: %s : %s\n", + NET_ErrorString(), NET_AdrToString (to)); } else { - Com_Error (ERR_DROP, "NET_SendPacket ERROR: %s\n", NET_ErrorString()); + Com_Error (ERR_DROP, "NET_SendPacket ERROR: %s to %s\n", + NET_ErrorString(), NET_AdrToString (to)); } } } diff --git a/win32/qgl_win.c b/win32/qgl_win.c index 146aa73..09da1e9 100644 --- a/win32/qgl_win.c +++ b/win32/qgl_win.c @@ -408,6 +408,8 @@ void ( APIENTRY * qglPointParameterfvEXT)( GLenum param, const GLfloat *value ); void ( APIENTRY * qglColorTableEXT)( int, int, int, int, int, const void * ); void ( APIENTRY * qglSelectTextureSGIS)( GLenum ); void ( APIENTRY * qglMTexCoord2fSGIS)( GLenum, GLfloat, GLfloat ); +void ( APIENTRY * qglActiveTextureARB) ( GLenum ); +void ( APIENTRY * qglClientActiveTextureARB) ( GLenum ); static void ( APIENTRY * dllAccum )(GLenum op, GLfloat value); static void ( APIENTRY * dllAlphaFunc )(GLenum func, GLclampf ref); diff --git a/win32/sys_win.c b/win32/sys_win.c index f97c5dd..02e5b90 100644 --- a/win32/sys_win.c +++ b/win32/sys_win.c @@ -508,6 +508,7 @@ void *Sys_GetGameAPI (void *parms) } else { +#ifdef DEBUG // check the current directory for other development purposes Com_sprintf (name, sizeof(name), "%s/%s", cwd, gamename); game_library = LoadLibrary ( name ); @@ -516,6 +517,7 @@ void *Sys_GetGameAPI (void *parms) Com_DPrintf ("LoadLibrary (%s)\n", name); } else +#endif { // now run through the search paths path = NULL; diff --git a/win32/vid_dll.c b/win32/vid_dll.c index 4047885..b724584 100644 --- a/win32/vid_dll.c +++ b/win32/vid_dll.c @@ -492,7 +492,8 @@ vidmode_t vid_modes[] = { "Mode 6: 1024x768", 1024, 768, 6 }, { "Mode 7: 1152x864", 1152, 864, 7 }, { "Mode 8: 1280x960", 1280, 960, 8 }, - { "Mode 9: 1600x1200", 1600, 1200, 9 } + { "Mode 9: 1600x1200", 1600, 1200, 9 }, + { "Mode 10: 2048x1536", 2048, 1536, 10 } }; qboolean VID_GetModeInfo( int *width, int *height, int mode ) diff --git a/win32/vid_menu.c b/win32/vid_menu.c index 2592bcf..a7d84e3 100644 --- a/win32/vid_menu.c +++ b/win32/vid_menu.c @@ -220,6 +220,7 @@ void VID_MenuInit( void ) "[1152 864 ]", "[1280 960 ]", "[1600 1200]", + "[2048 1536]", 0 }; static const char *refs[] =