updated to v3.21 originally from ftp://ftp.idsoftware.com/idstuff/source/quake2.zip
This commit is contained in:
parent
372afde46e
commit
80647db492
|
@ -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.
|
|
@ -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).
|
|
@ -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).
|
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -26,8 +26,7 @@ typedef struct vrect_s
|
|||
|
||||
typedef struct
|
||||
{
|
||||
int width;
|
||||
int height;
|
||||
unsigned width, height; // coordinates from main game
|
||||
} viddef_t;
|
||||
|
||||
extern viddef_t viddef; // global video state
|
||||
|
|
279
ctf/g_ctf.c
279
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;
|
||||
}
|
||||
|
||||
|
|
11
ctf/g_ctf.h
11
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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
//-------------------
|
||||
|
||||
|
|
252
ctf/g_svcmds.c
252
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 <ip>
|
||||
removeip <ip>
|
||||
|
||||
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 <ip>" 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 ; i<numipfilters ; i++)
|
||||
if ( (in & ipfilters[i].mask) == ipfilters[i].compare)
|
||||
return (int)filterban->value;
|
||||
|
||||
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 <ip-mask>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0 ; i<numipfilters ; i++)
|
||||
if (ipfilters[i].compare == 0xffffffff)
|
||||
break; // free spot
|
||||
if (i == numipfilters)
|
||||
{
|
||||
if (numipfilters == MAX_IPFILTERS)
|
||||
{
|
||||
gi.cprintf (NULL, PRINT_HIGH, "IP filter list is full\n");
|
||||
return;
|
||||
}
|
||||
numipfilters++;
|
||||
}
|
||||
|
||||
if (!StringToFilter (gi.argv(2), &ipfilters[i]))
|
||||
ipfilters[i].compare = 0xffffffff;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
SV_RemoveIP_f
|
||||
=================
|
||||
*/
|
||||
void SVCmd_RemoveIP_f (void)
|
||||
{
|
||||
ipfilter_t f;
|
||||
int i, j;
|
||||
|
||||
if (gi.argc() < 3) {
|
||||
gi.cprintf(NULL, PRINT_HIGH, "Usage: sv removeip <ip-mask>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!StringToFilter (gi.argv(2), &f))
|
||||
return;
|
||||
|
||||
for (i=0 ; i<numipfilters ; i++)
|
||||
if (ipfilters[i].mask == f.mask
|
||||
&& ipfilters[i].compare == f.compare)
|
||||
{
|
||||
for (j=i+1 ; j<numipfilters ; j++)
|
||||
ipfilters[j-1] = ipfilters[j];
|
||||
numipfilters--;
|
||||
gi.cprintf (NULL, PRINT_HIGH, "Removed.\n");
|
||||
return;
|
||||
}
|
||||
gi.cprintf (NULL, PRINT_HIGH, "Didn't find %s.\n", gi.argv(2));
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
SV_ListIP_f
|
||||
=================
|
||||
*/
|
||||
void SVCmd_ListIP_f (void)
|
||||
{
|
||||
int i;
|
||||
byte b[4];
|
||||
|
||||
gi.cprintf (NULL, PRINT_HIGH, "Filter list:\n");
|
||||
for (i=0 ; i<numipfilters ; i++)
|
||||
{
|
||||
*(unsigned *)b = ipfilters[i].compare;
|
||||
gi.cprintf (NULL, PRINT_HIGH, "%3i.%3i.%3i.%3i\n", b[0], b[1], b[2], b[3]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
SV_WriteIP_f
|
||||
=================
|
||||
*/
|
||||
void SVCmd_WriteIP_f (void)
|
||||
{
|
||||
FILE *f;
|
||||
char name[MAX_OSPATH];
|
||||
byte b[4];
|
||||
int i;
|
||||
cvar_t *game;
|
||||
|
||||
game = gi.cvar("game", "", 0);
|
||||
|
||||
if (!*game->string)
|
||||
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 ; i<numipfilters ; i++)
|
||||
{
|
||||
*(unsigned *)b = ipfilters[i].compare;
|
||||
fprintf (f, "sv addip %i.%i.%i.%i\n", b[0], b[1], b[2], b[3]);
|
||||
}
|
||||
|
||||
fclose (f);
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
ServerCommand
|
||||
|
@ -42,6 +286,14 @@ void ServerCommand (void)
|
|||
cmd = gi.argv(1);
|
||||
if (Q_stricmp (cmd, "test") == 0)
|
||||
Svcmd_Test_f ();
|
||||
else if (Q_stricmp (cmd, "addip") == 0)
|
||||
SVCmd_AddIP_f ();
|
||||
else if (Q_stricmp (cmd, "removeip") == 0)
|
||||
SVCmd_RemoveIP_f ();
|
||||
else if (Q_stricmp (cmd, "listip") == 0)
|
||||
SVCmd_ListIP_f ();
|
||||
else if (Q_stricmp (cmd, "writeip") == 0)
|
||||
SVCmd_WriteIP_f ();
|
||||
else
|
||||
gi.cprintf (NULL, PRINT_HIGH, "Unknown server command \"%s\"\n", cmd);
|
||||
}
|
||||
|
|
|
@ -675,7 +675,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;
|
||||
|
|
|
@ -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)
|
||||
|
|
18
ctf/p_view.c
18
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!!!
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 ();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
19
game/game.h
19
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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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 <sys/types.h>
|
||||
#include <cdaudio.h>
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <dmedia/dmedia.h>
|
||||
#include <dmedia/audio.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.
|
||||
|
||||
*/
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.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.
|
||||
|
||||
*/
|
||||
#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[] =
|
||||
|
|
|
@ -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 )
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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
|
||||
|
|
@ -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)
|
||||
|
|
@ -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
|
||||
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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
|
||||
//
|
||||
|
|
|
@ -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 <GL/fxmesa.h>
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,836 @@
|
|||
/*
|
||||
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
|
||||
** OpenGL refresh. When a port is being made the following functions
|
||||
** must be implemented by the port:
|
||||
**
|
||||
** GLimp_EndFrame
|
||||
** GLimp_Init
|
||||
** GLimp_Shutdown
|
||||
** GLimp_SwitchFullscreen
|
||||
**
|
||||
*/
|
||||
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/vt.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "../ref_gl/gl_local.h"
|
||||
|
||||
#include "../client/keys.h"
|
||||
|
||||
#include "../linux/rw_linux.h"
|
||||
#include "../linux/glw_linux.h"
|
||||
|
||||
#include <GL/glx.h>
|
||||
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/cursorfont.h>
|
||||
|
||||
#include <X11/extensions/xf86dga.h>
|
||||
#include <X11/extensions/xf86vmode.h>
|
||||
|
||||
glwstate_t glw_state;
|
||||
|
||||
static Display *dpy = NULL;
|
||||
static int scrnum;
|
||||
static Window win;
|
||||
static GLXContext ctx = NULL;
|
||||
|
||||
#define KEY_MASK (KeyPressMask | KeyReleaseMask)
|
||||
#define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | \
|
||||
PointerMotionMask | ButtonMotionMask )
|
||||
#define X_MASK (KEY_MASK | MOUSE_MASK | VisibilityChangeMask | StructureNotifyMask )
|
||||
|
||||
/*****************************************************************************/
|
||||
/* MOUSE */
|
||||
/*****************************************************************************/
|
||||
|
||||
// this is inside the renderer shared lib, so these are called from vid_so
|
||||
|
||||
static qboolean mouse_avail;
|
||||
static int mx, my;
|
||||
static int old_mouse_x, old_mouse_y;
|
||||
|
||||
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;
|
||||
|
||||
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)
|
||||
{
|
||||
Pixmap cursormask;
|
||||
XGCValues xgc;
|
||||
GC gc;
|
||||
XColor dummycolour;
|
||||
Cursor cursor;
|
||||
|
||||
cursormask = XCreatePixmap(display, root, 1, 1, 1/*depth*/);
|
||||
xgc.function = GXclear;
|
||||
gc = XCreateGC(display, cursormask, GCFunction, &xgc);
|
||||
XFillRectangle(display, cursormask, gc, 0, 0, 1, 1);
|
||||
dummycolour.pixel = 0;
|
||||
dummycolour.red = 0;
|
||||
dummycolour.flags = 04;
|
||||
cursor = XCreatePixmapCursor(display, cursormask, cursormask,
|
||||
&dummycolour,&dummycolour, 0,0);
|
||||
XFreePixmap(display,cursormask);
|
||||
XFreeGC(display,gc);
|
||||
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;
|
||||
|
||||
// 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)
|
||||
{
|
||||
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
|
||||
{
|
||||
cmd->forwardmove -= m_forward->value * my;
|
||||
}
|
||||
|
||||
mx = my = 0;
|
||||
}
|
||||
|
||||
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 || vidmode_active)
|
||||
IN_ActivateMouse();
|
||||
else
|
||||
IN_DeactivateMouse ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* KEYBOARD */
|
||||
/*****************************************************************************/
|
||||
|
||||
static int XLateKey(XKeyEvent *ev)
|
||||
{
|
||||
|
||||
int key;
|
||||
char buf[64];
|
||||
KeySym keysym;
|
||||
|
||||
key = 0;
|
||||
|
||||
XLookupString(ev, buf, sizeof buf, &keysym, 0);
|
||||
|
||||
switch(keysym)
|
||||
{
|
||||
case XK_KP_Page_Up: key = K_KP_PGUP; break;
|
||||
case XK_Page_Up: key = K_PGUP; break;
|
||||
|
||||
case XK_KP_Page_Down: key = K_KP_PGDN; break;
|
||||
case XK_Page_Down: key = K_PGDN; break;
|
||||
|
||||
case XK_KP_Home: key = K_KP_HOME; break;
|
||||
case XK_Home: key = K_HOME; break;
|
||||
|
||||
case XK_KP_End: key = K_KP_END; break;
|
||||
case XK_End: key = K_END; break;
|
||||
|
||||
case XK_KP_Left: key = K_KP_LEFTARROW; break;
|
||||
case XK_Left: key = K_LEFTARROW; break;
|
||||
|
||||
case XK_KP_Right: key = K_KP_RIGHTARROW; break;
|
||||
case XK_Right: key = K_RIGHTARROW; break;
|
||||
|
||||
case XK_KP_Down: key = K_KP_DOWNARROW; break;
|
||||
case XK_Down: key = K_DOWNARROW; break;
|
||||
|
||||
case XK_KP_Up: key = K_KP_UPARROW; break;
|
||||
case XK_Up: key = K_UPARROW; break;
|
||||
|
||||
case XK_Escape: key = K_ESCAPE; break;
|
||||
|
||||
case XK_KP_Enter: key = K_KP_ENTER; break;
|
||||
case XK_Return: key = K_ENTER; break;
|
||||
|
||||
case XK_Tab: key = K_TAB; break;
|
||||
|
||||
case XK_F1: key = K_F1; break;
|
||||
|
||||
case XK_F2: key = K_F2; break;
|
||||
|
||||
case XK_F3: key = K_F3; break;
|
||||
|
||||
case XK_F4: key = K_F4; break;
|
||||
|
||||
case XK_F5: key = K_F5; break;
|
||||
|
||||
case XK_F6: key = K_F6; break;
|
||||
|
||||
case XK_F7: key = K_F7; break;
|
||||
|
||||
case XK_F8: key = K_F8; break;
|
||||
|
||||
case XK_F9: key = K_F9; break;
|
||||
|
||||
case XK_F10: key = K_F10; break;
|
||||
|
||||
case XK_F11: key = K_F11; break;
|
||||
|
||||
case XK_F12: key = K_F12; break;
|
||||
|
||||
case XK_BackSpace: key = K_BACKSPACE; break;
|
||||
|
||||
case XK_KP_Delete: key = K_KP_DEL; break;
|
||||
case XK_Delete: key = K_DEL; break;
|
||||
|
||||
case XK_Pause: key = K_PAUSE; break;
|
||||
|
||||
case XK_Shift_L:
|
||||
case XK_Shift_R: key = K_SHIFT; break;
|
||||
|
||||
case XK_Execute:
|
||||
case XK_Control_L:
|
||||
case XK_Control_R: key = K_CTRL; break;
|
||||
|
||||
case XK_Alt_L:
|
||||
case XK_Meta_L:
|
||||
case XK_Alt_R:
|
||||
case XK_Meta_R: key = K_ALT; break;
|
||||
|
||||
case XK_KP_Begin: key = K_KP_5; break;
|
||||
|
||||
case XK_Insert:key = K_INS; break;
|
||||
case XK_KP_Insert: key = K_KP_INS; break;
|
||||
|
||||
case XK_KP_Multiply: key = '*'; break;
|
||||
case XK_KP_Add: key = K_KP_PLUS; break;
|
||||
case XK_KP_Subtract: key = K_KP_MINUS; break;
|
||||
case XK_KP_Divide: key = K_KP_SLASH; break;
|
||||
|
||||
#if 0
|
||||
case 0x021: key = '1';break;/* [!] */
|
||||
case 0x040: key = '2';break;/* [@] */
|
||||
case 0x023: key = '3';break;/* [#] */
|
||||
case 0x024: key = '4';break;/* [$] */
|
||||
case 0x025: key = '5';break;/* [%] */
|
||||
case 0x05e: key = '6';break;/* [^] */
|
||||
case 0x026: key = '7';break;/* [&] */
|
||||
case 0x02a: key = '8';break;/* [*] */
|
||||
case 0x028: key = '9';;break;/* [(] */
|
||||
case 0x029: key = '0';break;/* [)] */
|
||||
case 0x05f: key = '-';break;/* [_] */
|
||||
case 0x02b: key = '=';break;/* [+] */
|
||||
case 0x07c: key = '\'';break;/* [|] */
|
||||
case 0x07d: key = '[';break;/* [}] */
|
||||
case 0x07b: key = ']';break;/* [{] */
|
||||
case 0x022: key = '\'';break;/* ["] */
|
||||
case 0x03a: key = ';';break;/* [:] */
|
||||
case 0x03f: key = '/';break;/* [?] */
|
||||
case 0x03e: key = '.';break;/* [>] */
|
||||
case 0x03c: key = ',';break;/* [<] */
|
||||
#endif
|
||||
|
||||
default:
|
||||
key = *(unsigned char*)buf;
|
||||
if (key >= 'A' && key <= 'Z')
|
||||
key = key - 'A' + 'a';
|
||||
break;
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
static void HandleEvents(void)
|
||||
{
|
||||
XEvent event;
|
||||
int b;
|
||||
qboolean dowarp = false;
|
||||
int mwx = vid.width/2;
|
||||
int mwy = vid.height/2;
|
||||
|
||||
if (!dpy)
|
||||
return;
|
||||
|
||||
while (XPending(dpy)) {
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if (dowarp) {
|
||||
/* move the mouse to the window center again */
|
||||
XWarpPointer(dpy,None,win,0,0,0,0, vid.width/2,vid.height/2);
|
||||
}
|
||||
}
|
||||
|
||||
Key_Event_fp_t Key_Event_fp;
|
||||
|
||||
void KBD_Init(Key_Event_fp_t fp)
|
||||
{
|
||||
Key_Event_fp = fp;
|
||||
}
|
||||
|
||||
void KBD_Update(void)
|
||||
{
|
||||
// get events from x server
|
||||
HandleEvents();
|
||||
}
|
||||
|
||||
void KBD_Close(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static qboolean GLimp_SwitchFullscreen( int width, int height );
|
||||
qboolean GLimp_InitGL (void);
|
||||
|
||||
static void signal_handler(int sig)
|
||||
{
|
||||
printf("Received signal %d, exiting...\n", sig);
|
||||
GLimp_Shutdown();
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
static void InitSig(void)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
** GLimp_SetMode
|
||||
*/
|
||||
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;
|
||||
|
||||
r_fakeFullscreen = ri.Cvar_Get( "r_fakeFullscreen", "0", CVAR_ARCHIVE);
|
||||
|
||||
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 ) )
|
||||
{
|
||||
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 {
|
||||
ri.Con_Printf(PRINT_ALL, "Using XFree86-VidModeExtension Version %d.%d\n",
|
||||
MajorVersion, MinorVersion);
|
||||
vidmode_ext = true;
|
||||
}
|
||||
|
||||
visinfo = qglXChooseVisual(dpy, scrnum, attrib);
|
||||
if (!visinfo) {
|
||||
fprintf(stderr, "Error couldn't get an RGB, Double-buffered, Depth visual\n");
|
||||
return rserr_invalid_mode;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/*
|
||||
** 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 )
|
||||
{
|
||||
uninstall_grabs();
|
||||
mouse_active = false;
|
||||
dgamouse = false;
|
||||
|
||||
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
|
||||
/*------------------------------------------------*/
|
||||
|
19
linux/glob.c
19
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 <stdio.h>
|
||||
#include "../linux/glob.h"
|
||||
|
|
19
linux/glob.h
19
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);
|
||||
|
|
|
@ -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
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/time.h>
|
||||
|
@ -126,7 +145,8 @@ static qboolean CompareAttributes(char *path, char *name,
|
|||
if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0)
|
||||
return false;
|
||||
|
||||
sprintf(fn, "%s/%s", path, name);
|
||||
return true;
|
||||
|
||||
if (stat(fn, &st) == -1)
|
||||
return false; // shouldn't happen
|
||||
|
||||
|
|
19
linux/qasm.h
19
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__
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
LD_PRELOAD="./lib3dfxgl.so /usr/lib/libglide2x.so" ./quake2 +set vid_ref gl $*
|
|
@ -0,0 +1,75 @@
|
|||
#!/bin/sh
|
||||
# Generate q2ded.spec
|
||||
# $1 is version
|
||||
# $2 is release
|
||||
# $3 is arch
|
||||
# $4 is install dir (assumed to be in /var/tmp)
|
||||
cat <<EOF
|
||||
%define name q2ded
|
||||
%define version ${1}
|
||||
%define release ${2}
|
||||
%define arch ${3}
|
||||
%define builddir \$RPM_BUILD_DIR/%{name}-%{version}
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
Vendor: id Software
|
||||
Packager: Dave "Zoid" Kirsch <zoid@idsoftware.com>
|
||||
URL: http://www.idsoftware.com/
|
||||
Source: q2ded-%{version}.tar.gz
|
||||
Group: Games
|
||||
Copyright: Restricted
|
||||
Icon: quake2.gif
|
||||
BuildRoot: /var/tmp/%{name}-%{version}
|
||||
Summary: Quake2 Dedicated Server for Linux
|
||||
|
||||
%description
|
||||
|
||||
Quake2
|
||||
|
||||
Shortly after landing on an alien surface you learn that hundreds of your men
|
||||
have been reduced to just a few. Now you must fight your way through heavily
|
||||
fortified military installations, lower the city's defenses and shut down
|
||||
the enemy's war machine. Only then will the fate of humanity be known.
|
||||
|
||||
LARGER, MISSION-BASED LEVELS
|
||||
|
||||
You have a series of complex missions, what you do in one level could affect
|
||||
another. One false move and you could alert security, flood an entire
|
||||
passageway, or worse.
|
||||
|
||||
SUPERIOR ARTIFICIAL INTELLIGENCE
|
||||
|
||||
This time the enemy has IQs the size of their appetites. The can evade your
|
||||
attack, strategically position themselves for an ambush and hunt your ass
|
||||
down.
|
||||
|
||||
IN-YOUR-FACE SOUND AND GRAPHICS
|
||||
|
||||
hear distant combat explosions and rockets whizzing past your head. And with
|
||||
a compatible 3-D graphics accelerator, experience smoother 16-bit graphics and
|
||||
real-time lighting effects.
|
||||
|
||||
WICKED MULTIPLAYER CAPABILITIES
|
||||
|
||||
More than 32 players, friends or foes, can do at it in a bloody deathmatch via
|
||||
LAN and over the internet.
|
||||
|
||||
----
|
||||
|
||||
This archive contains a Quake2 dedicated server for Linux Alpha based systems.
|
||||
|
||||
%install
|
||||
|
||||
%files
|
||||
|
||||
%attr(644,root,root) $4/README
|
||||
%attr(644,root,root) $4/readme.txt
|
||||
%attr(644,root,root) $4/3.20_Changes.txt
|
||||
%attr(755,root,root) $4/q2ded
|
||||
%attr(755,root,root) $4/baseq2/game%{arch}.so
|
||||
# %attr(755,root,root) $4/ctf/game%{arch}.so
|
||||
%attr(755,root,root) $4/xatrix/game%{arch}.so
|
||||
%attr(755,root,root) $4/rogue/game%{arch}.so
|
||||
EOF
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
|
@ -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 <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.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);
|
||||
|
|
|
@ -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
|
||||
|
|
750
linux/rw_x11.c
750
linux/rw_x11.c
File diff suppressed because it is too large
Load Diff
|
@ -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 <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.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.
|
||||
|
||||
*/
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
|
|
@ -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 <assert.h>
|
||||
#include <dlfcn.h> // ELF dl loader
|
||||
#include <sys/stat.h>
|
||||
|
@ -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,13 +226,13 @@ 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, "/");
|
||||
|
@ -224,11 +244,11 @@ qboolean VID_LoadRefresh( char *name )
|
|||
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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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] ) )
|
||||
|
||||
|
|
|
@ -131,7 +131,10 @@ void Com_Printf (char *fmt, ...)
|
|||
if (!logfile)
|
||||
{
|
||||
Com_sprintf (name, sizeof(name), "%s/qconsole.log", FS_Gamedir ());
|
||||
logfile = fopen (name, "w");
|
||||
if (logfile_active->value > 2)
|
||||
logfile = fopen (name, "a");
|
||||
else
|
||||
logfile = fopen (name, "w");
|
||||
}
|
||||
if (logfile)
|
||||
fprintf (logfile, "%s", msg);
|
||||
|
|
|
@ -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.
|
||||
|
||||
*/
|
||||
/* crc.h */
|
||||
|
||||
void CRC_Init(unsigned short *crcvalue);
|
||||
|
|
|
@ -554,7 +554,10 @@ Called to find where to write a file (demos, savegames, etc)
|
|||
*/
|
||||
char *FS_Gamedir (void)
|
||||
{
|
||||
return fs_gamedir;
|
||||
if (*fs_gamedir)
|
||||
return fs_gamedir;
|
||||
else
|
||||
return BASEDIRNAME;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -22,9 +22,9 @@ typedef unsigned long int UINT4;
|
|||
|
||||
All rights reserved.
|
||||
|
||||
License to copy and use this software is granted provided that it is identified as the “RSA Data Security, Inc. MD4 Message-Digest Algorithm” in all material mentioning or referencing this software or this function.
|
||||
License is also granted to make and use derivative works provided that such works are identified as “derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm” in all material mentioning or referencing the derived work.
|
||||
RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided “as is” without express or implied warranty of any kind.
|
||||
License to copy and use this software is granted provided that it is identified as the RSA Data Security, Inc. MD4 Message-Digest Algorithm in all material mentioning or referencing this software or this function.
|
||||
License is also granted to make and use derivative works provided that such works are identified as derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm in all material mentioning or referencing the derived work.
|
||||
RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided as is without express or implied warranty of any kind.
|
||||
|
||||
These notices must be retained in any copies of any part of this documentation and/or software. */
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "../game/q_shared.h"
|
||||
|
||||
|
||||
#define VERSION 3.19
|
||||
#define VERSION 3.21
|
||||
|
||||
#define BASEDIRNAME "baseq2"
|
||||
|
||||
|
|
|
@ -35,6 +35,15 @@ Package=<5>
|
|||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name ctf
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name game
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name ref_gl
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 <windows.h>
|
||||
|
@ -35,9 +28,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <GL/glu.h>
|
||||
#include <math.h>
|
||||
|
||||
#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;
|
||||
|
||||
|
|
|
@ -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++)
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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 ; i<numgltextures ; i++,image++)
|
||||
{
|
||||
|
@ -739,7 +741,7 @@ dynamic:
|
|||
R_BuildLightMap( surf, (void *)temp, smax*4 );
|
||||
R_SetCacheState( surf );
|
||||
|
||||
GL_MBind( GL_TEXTURE1_SGIS, gl_state.lightmap_textures + surf->lightmaptexturenum );
|
||||
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
|
||||
|
|
44
ref_gl/qgl.h
44
ref_gl/qgl.h
|
@ -30,6 +30,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#ifdef __linux__
|
||||
//#include <GL/fxmesa.h>
|
||||
#include <GL/glx.h>
|
||||
#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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -248,7 +248,7 @@ void SV_Begin_f (void)
|
|||
}
|
||||
|
||||
sv_client->state = cs_spawned;
|
||||
|
||||
|
||||
// call the game begin function
|
||||
ge->ClientBegin (sv_player);
|
||||
|
||||
|
|
|
@ -6,13 +6,15 @@
|
|||
# ELF only
|
||||
#
|
||||
|
||||
VERSION=3.20
|
||||
|
||||
ifneq (,$(findstring i86pc,$(shell uname -m)))
|
||||
ARCH=i386
|
||||
else
|
||||
ARCH=sparc
|
||||
endif
|
||||
|
||||
MOUNT_DIR=/chest/Quake2/code
|
||||
MOUNT_DIR=/grog/Projects/Quake2/code
|
||||
|
||||
BUILD_DEBUG_DIR=debug$(ARCH)
|
||||
BUILD_RELEASE_DIR=release$(ARCH)
|
||||
|
@ -23,6 +25,7 @@ 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
|
||||
|
@ -48,14 +51,16 @@ DO_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
|
|||
TARGETS=$(BUILDDIR)/q2ded \
|
||||
$(BUILDDIR)/game$(ARCH).$(SHLIBEXT) \
|
||||
$(BUILDDIR)/ctf/game$(ARCH).$(SHLIBEXT) \
|
||||
$(BUILDDIR)/xatrix/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)/xatrix \
|
||||
$(BUILD_DEBUG_DIR)/rogue
|
||||
$(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)"
|
||||
|
||||
build_release:
|
||||
|
@ -63,7 +68,8 @@ build_release:
|
|||
$(BUILD_RELEASE_DIR)/client \
|
||||
$(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
|
||||
|
@ -189,6 +195,7 @@ GAME_OBJS = \
|
|||
$(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 \
|
||||
|
@ -248,6 +255,9 @@ $(BUILDDIR)/game/g_cmds.o : $(GAME_DIR)/g_cmds.c
|
|||
$(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)
|
||||
|
||||
|
@ -497,6 +507,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 \
|
||||
|
@ -556,6 +567,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)
|
||||
|
||||
|
@ -703,6 +717,304 @@ $(BUILDDIR)/xatrix/p_weapon.o : $(XATRIX_DIR)/p_weapon.c
|
|||
$(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
|
||||
#############################################################################
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -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 <stdio.h>
|
||||
#include "../linux/glob.h"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue