mirror of
https://github.com/blendogames/thirtyflightsofloving.git
synced 2025-02-21 03:00:54 +00:00
Refactored server, qcommon, and Win32 code to use cvar integer field where applicable.
Commented out removal of "sethud" command in cl_screen.c.
This commit is contained in:
parent
8083f057cf
commit
1b4eb2b6d7
18 changed files with 421 additions and 266 deletions
|
@ -1117,6 +1117,24 @@ void SCR_Sky_f (void)
|
|||
R_SetSky (Cmd_Argv(1), rotate, axis);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
================
|
||||
SCR_SetHud_f
|
||||
================
|
||||
*/
|
||||
void SCR_SetHud_f (void)
|
||||
{
|
||||
if (Cmd_Argc() < 2)
|
||||
{
|
||||
Com_Printf ("Usage: sethud <hudname>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Cvar_ForceSet ("cl_hud", Cmd_Argv(1));
|
||||
CL_LoadHud (false);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
================
|
||||
|
@ -1398,6 +1416,7 @@ void SCR_Init (void)
|
|||
Cmd_AddCommand ("sizeup",SCR_SizeUp_f);
|
||||
Cmd_AddCommand ("sizedown",SCR_SizeDown_f);
|
||||
Cmd_AddCommand ("sky",SCR_Sky_f);
|
||||
// Cmd_AddCommand ("sethud", SCR_SetHud_f);
|
||||
Cmd_AddCommand ("dumpstatuslayout", SCR_DumpStatusLayout_f);
|
||||
Cmd_AddCommand ("dumpgenerallayout", SCR_DumpGeneralLayout_f);
|
||||
|
||||
|
@ -1423,7 +1442,7 @@ void SCR_Shutdown (void)
|
|||
Cmd_RemoveCommand ("sizeup");
|
||||
Cmd_RemoveCommand ("sizedown");
|
||||
Cmd_RemoveCommand ("sky");
|
||||
Cmd_RemoveCommand ("sethud");
|
||||
// Cmd_RemoveCommand ("sethud");
|
||||
Cmd_RemoveCommand ("dumpstatuslayout");
|
||||
Cmd_RemoveCommand ("dumpgenerallayout");
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ void CL_LocPlace (void);
|
|||
#endif // LOC_SUPPORT
|
||||
|
||||
void Cmd_ForwardToServer (void);
|
||||
void CL_ForcePacket (void);
|
||||
|
||||
#define MAX_ALIAS_NAME 32
|
||||
|
||||
|
@ -249,6 +250,9 @@ void Cbuf_Execute (void)
|
|||
{
|
||||
// skip out while text still remains in buffer, leaving it
|
||||
// for next frame
|
||||
// if (!dedicated->value)
|
||||
if (!dedicated->integer)
|
||||
CL_ForcePacket ();
|
||||
cmd_wait = false;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -533,7 +533,8 @@ CMod_LoadEntityString
|
|||
void CMod_LoadEntityString (lump_t *l, char *name)
|
||||
{
|
||||
// Knightmare- .ent file support
|
||||
if (sv_entfile->value)
|
||||
// if (sv_entfile->value)
|
||||
if (sv_entfile->integer)
|
||||
{
|
||||
char s[MAX_QPATH];
|
||||
char *buffer = NULL;
|
||||
|
@ -662,36 +663,6 @@ cmodel_t *CM_LoadMap (char *name, qboolean clientload, unsigned *checksum)
|
|||
CMod_LoadVisibility (&header.lumps[LUMP_VISIBILITY]);
|
||||
CMod_LoadEntityString (&header.lumps[LUMP_ENTITIES], name);
|
||||
|
||||
// Knightmare- replaced this with better implementation
|
||||
/* // Barnes- try to load entity replacement file
|
||||
if (sv_entfile->value)
|
||||
{
|
||||
unsigned *entbuf;
|
||||
int entlength;
|
||||
char entfile[MAX_QPATH];
|
||||
qboolean foundentfile;
|
||||
|
||||
// strncpy(entfile, name);
|
||||
Q_strncpyz(entfile, sizeof(entfile), name);
|
||||
entfile[strlen(entfile)-4] = 0;
|
||||
// strncat(entfile, ".ent");
|
||||
Q_strncatz(entfile, sizeof(entfile), ".ent");
|
||||
entlength = FS_LoadFile(entfile, (void **)&entbuf);
|
||||
if (entbuf)
|
||||
{
|
||||
map_entitystring[0] = 0;
|
||||
numentitychars = entlength;
|
||||
Com_Printf ("Parsing entities from %s\n", entfile);
|
||||
if (entlength > MAX_MAP_ENTSTRING)
|
||||
Com_Error (ERR_DROP, ".ent file has too large entity lump - %i", entlength);
|
||||
memcpy(map_entitystring, entbuf, numentitychars);
|
||||
FS_FreeFile (entbuf);
|
||||
foundentfile = true;
|
||||
}
|
||||
//if (!entbuf)
|
||||
// Com_Printf ("External entities not found. Using bsp entities\n");
|
||||
}
|
||||
*/
|
||||
FS_FreeFile (buf);
|
||||
|
||||
CM_InitBoxHull ();
|
||||
|
@ -1737,7 +1708,8 @@ void CM_SetAreaPortalState (int portalnum, qboolean open)
|
|||
|
||||
qboolean CM_AreasConnected (int area1, int area2)
|
||||
{
|
||||
if (map_noareas->value)
|
||||
// if (map_noareas->value)
|
||||
if (map_noareas->integer)
|
||||
return true;
|
||||
|
||||
if (area1 > numareas || area2 > numareas)
|
||||
|
@ -1767,7 +1739,8 @@ int CM_WriteAreaBits (byte *buffer, int area)
|
|||
|
||||
bytes = (numareas+7)>>3;
|
||||
|
||||
if (map_noareas->value)
|
||||
// if (map_noareas->value)
|
||||
if (map_noareas->integer)
|
||||
{ // for debugging, send everything
|
||||
memset (buffer, 255, bytes);
|
||||
}
|
||||
|
|
|
@ -140,21 +140,24 @@ void Com_Printf (char *fmt, ...)
|
|||
Sys_ConsoleOutput (msg);
|
||||
|
||||
// logfile
|
||||
if (logfile_active && logfile_active->value)
|
||||
// if (logfile_active && logfile_active->value)
|
||||
if (logfile_active && logfile_active->integer)
|
||||
{
|
||||
char name[MAX_QPATH];
|
||||
|
||||
if (!logfile)
|
||||
{
|
||||
Com_sprintf (name, sizeof(name), "%s/qconsole.log", FS_Savegamedir ()); // was FS_Gamedir()
|
||||
if (logfile_active->value > 2)
|
||||
// if (logfile_active->value > 2)
|
||||
if (logfile_active->integer > 2)
|
||||
logfile = fopen (name, "a");
|
||||
else
|
||||
logfile = fopen (name, "w");
|
||||
}
|
||||
if (logfile)
|
||||
fprintf (logfile, "%s", msg);
|
||||
if (logfile_active->value > 1)
|
||||
// if (logfile_active->value > 1)
|
||||
if (logfile_active->integer > 1)
|
||||
fflush (logfile); // force it to save every time
|
||||
}
|
||||
}
|
||||
|
@ -172,7 +175,8 @@ void Com_DPrintf (char *fmt, ...)
|
|||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
|
||||
if (!developer || !developer->value)
|
||||
// if (!developer || !developer->value)
|
||||
if (!developer || !developer->integer)
|
||||
return; // don't confuse non-developers with techie stuff...
|
||||
|
||||
va_start (argptr, fmt);
|
||||
|
@ -1713,7 +1717,8 @@ void Qcommon_Init (int argc, char **argv)
|
|||
s = va("KMQ2 %4.2f %s %s %s %s", VERSION, CPUSTRING, OS_STRING, COMPILETYPE_STRING, __DATE__);
|
||||
Cvar_Get ("version", s, CVAR_SERVERINFO|CVAR_NOSET);
|
||||
|
||||
if (dedicated->value)
|
||||
// if (dedicated->value)
|
||||
if (dedicated->integer)
|
||||
Cmd_AddCommand ("quit", Com_Quit);
|
||||
|
||||
dedicated->modified = false; // make sure this starts false
|
||||
|
@ -1727,18 +1732,16 @@ void Qcommon_Init (int argc, char **argv)
|
|||
CL_Init ();
|
||||
|
||||
#ifdef _WIN32 // Knightmare- remove startup logo, code from TomazQuake
|
||||
#ifdef NEW_DED_CONSOLE // Hide console
|
||||
if (!dedicated->value)
|
||||
Sys_ShowConsole(false);
|
||||
#else
|
||||
DestroyWindow (hwnd_dialog);
|
||||
#endif
|
||||
// if (!dedicated->value)
|
||||
if (!dedicated->integer)
|
||||
Sys_ShowConsole (false);
|
||||
#endif
|
||||
|
||||
// add + commands from command line
|
||||
if (!Cbuf_AddLateCommands ())
|
||||
{ // if the user didn't give any commands, run default action
|
||||
if (!dedicated->value)
|
||||
// if (!dedicated->value)
|
||||
if (!dedicated->integer)
|
||||
Cbuf_AddText ("d1\n");
|
||||
else
|
||||
Cbuf_AddText ("dedicated_start\n");
|
||||
|
@ -1787,7 +1790,8 @@ void Qcommon_Frame (int msec)
|
|||
if ( log_stats->modified )
|
||||
{
|
||||
log_stats->modified = false;
|
||||
if ( log_stats->value )
|
||||
// if ( log_stats->value )
|
||||
if ( log_stats->integer )
|
||||
{
|
||||
char name[MAX_QPATH];
|
||||
|
||||
|
|
|
@ -322,7 +322,8 @@ qboolean FS_ModType (const char *name)
|
|||
// This enables Rogue menu options for Q2MP4
|
||||
qboolean FS_RoguePath (void)
|
||||
{
|
||||
if (FS_ModType("rogue") || fs_roguegame->value)
|
||||
// if (FS_ModType("rogue") || fs_roguegame->value)
|
||||
if (FS_ModType("rogue") || fs_roguegame->integer)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -338,7 +339,8 @@ void FS_DPrintf (const char *format, ...)
|
|||
char msg[1024];
|
||||
va_list argPtr;
|
||||
|
||||
if (!fs_debug->value)
|
||||
// if (!fs_debug->value)
|
||||
if (!fs_debug->integer)
|
||||
return;
|
||||
|
||||
va_start(argPtr, format);
|
||||
|
@ -568,13 +570,15 @@ int FS_FOpenFileAppend (fsHandle_t *handle)
|
|||
handle->file = fopen(path, "ab");
|
||||
if (handle->file)
|
||||
{
|
||||
if (fs_debug->value)
|
||||
// if (fs_debug->value)
|
||||
if (fs_debug->integer)
|
||||
Com_Printf("FS_FOpenFileAppend: %s\n", path);
|
||||
|
||||
return FS_FileLength(handle->file);
|
||||
}
|
||||
|
||||
if (fs_debug->value)
|
||||
// if (fs_debug->value)
|
||||
if (fs_debug->integer)
|
||||
Com_Printf("FS_FOpenFileAppend: couldn't open %s\n", path);
|
||||
|
||||
return -1;
|
||||
|
@ -604,12 +608,14 @@ int FS_FOpenFileWrite (fsHandle_t *handle)
|
|||
handle->file = fopen(path, "wb");
|
||||
if (handle->file)
|
||||
{
|
||||
if (fs_debug->value)
|
||||
// if (fs_debug->value)
|
||||
if (fs_debug->integer)
|
||||
Com_Printf("FS_FOpenFileWrite: %s\n", path);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fs_debug->value)
|
||||
// if (fs_debug->value)
|
||||
if (fs_debug->integer)
|
||||
Com_Printf("FS_FOpenFileWrite: couldn't open %s\n", path);
|
||||
|
||||
return -1;
|
||||
|
@ -675,7 +681,8 @@ int FS_FOpenFileRead (fsHandle_t *handle)
|
|||
Com_FilePath(pack->name, fs_fileInPath, sizeof(fs_fileInPath));
|
||||
fs_fileInPack = true;
|
||||
|
||||
if (fs_debug->value)
|
||||
// if (fs_debug->value)
|
||||
if (fs_debug->integer)
|
||||
Com_Printf("FS_FOpenFileRead: %s (found in %s)\n", handle->name, pack->name);
|
||||
|
||||
if (pack->pak)
|
||||
|
@ -725,7 +732,8 @@ int FS_FOpenFileRead (fsHandle_t *handle)
|
|||
Q_strncpyz(fs_fileInPath, sizeof(fs_fileInPath), search->path);
|
||||
fs_fileInPack = false;
|
||||
|
||||
if (fs_debug->value)
|
||||
// if (fs_debug->value)
|
||||
if (fs_debug->integer)
|
||||
Com_Printf("FS_FOpenFileRead: %s (found in %s)\n", handle->name, search->path);
|
||||
|
||||
return FS_FileLength(handle->file);
|
||||
|
@ -737,7 +745,8 @@ int FS_FOpenFileRead (fsHandle_t *handle)
|
|||
fs_fileInPath[0] = 0;
|
||||
fs_fileInPack = false;
|
||||
|
||||
if (fs_debug->value)
|
||||
// if (fs_debug->value)
|
||||
if (fs_debug->integer)
|
||||
Com_Printf("FS_FOpenFileRead: couldn't find %s\n", handle->name);
|
||||
|
||||
return -1;
|
||||
|
@ -818,14 +827,16 @@ int FS_FOpenCompressedFileWrite (fsHandle_t *handle, const char *zipName, const
|
|||
{
|
||||
if (zipOpenNewFileInZip(handle->writeZip, fileName, NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION) == ZIP_OK)
|
||||
{
|
||||
if (fs_debug->value)
|
||||
// if (fs_debug->value)
|
||||
if (fs_debug->integer)
|
||||
Com_Printf("FS_FOpenCompressedFileWrite: %s/%s\n", path, fileName);
|
||||
return 0;
|
||||
}
|
||||
zipClose(handle->writeZip, NULL);
|
||||
}
|
||||
|
||||
if (fs_debug->value)
|
||||
// if (fs_debug->value)
|
||||
if (fs_debug->integer)
|
||||
Com_Printf("FS_FOpenCompressedFileWrite: couldn't open %s/%s\n", path, fileName);
|
||||
|
||||
return -1;
|
||||
|
@ -862,7 +873,8 @@ int FS_FOpenCompressedFileRead (fsHandle_t *handle, const char *zipName, const c
|
|||
{ // Found it!
|
||||
Q_strncpyz(fs_fileInPath, sizeof(fs_fileInPath), search->path);
|
||||
fs_fileInPack = false;
|
||||
if (fs_debug->value)
|
||||
// if (fs_debug->value)
|
||||
if (fs_debug->integer)
|
||||
Com_Printf("FS_FOpenCompressedFileRead: %s (found in %s/%s)\n", fileName, search->path, zipName);
|
||||
|
||||
unzGetCurrentFileInfo(handle->zip, &info, NULL, 0, NULL, 0, NULL, 0);
|
||||
|
@ -878,7 +890,8 @@ int FS_FOpenCompressedFileRead (fsHandle_t *handle, const char *zipName, const c
|
|||
fs_fileInPath[0] = 0;
|
||||
fs_fileInPack = false;
|
||||
|
||||
if (fs_debug->value)
|
||||
// if (fs_debug->value)
|
||||
if (fs_debug->integer)
|
||||
Com_Printf("FS_FOpenCompressedFileRead: couldn't find %s\n", handle->name);
|
||||
|
||||
return -1;
|
||||
|
@ -2827,7 +2840,8 @@ void FS_SetGamedir (const char *dir)
|
|||
//
|
||||
// flush all data, so it will be forced to reload
|
||||
//
|
||||
if (dedicated && !dedicated->value)
|
||||
// if (dedicated && !dedicated->value)
|
||||
if (dedicated && !dedicated->integer)
|
||||
Cbuf_AddText ("vid_restart\nsnd_restart\n");
|
||||
|
||||
if (*dir == 0) // Knightmare- set to basedir if a blank dir is passed
|
||||
|
|
|
@ -257,7 +257,8 @@ void Netchan_Transmit (netchan_t *chan, int length, byte *data)
|
|||
|
||||
// send the qport if we are a client
|
||||
if (chan->sock == NS_CLIENT)
|
||||
MSG_WriteShort (&send, qport->value);
|
||||
// MSG_WriteShort (&send, qport->value);
|
||||
MSG_WriteShort (&send, qport->integer);
|
||||
|
||||
// copy the reliable message to the packet first
|
||||
if (send_reliable)
|
||||
|
@ -275,7 +276,8 @@ void Netchan_Transmit (netchan_t *chan, int length, byte *data)
|
|||
// send the datagram
|
||||
NET_SendPacket (chan->sock, send.cursize, send.data, chan->remote_address);
|
||||
|
||||
if (showpackets->value)
|
||||
// if (showpackets->value)
|
||||
if (showpackets->integer)
|
||||
{
|
||||
if (send_reliable)
|
||||
Com_Printf ("send %4i : s=%i reliable=%i ack=%i rack=%i\n"
|
||||
|
@ -322,7 +324,8 @@ qboolean Netchan_Process (netchan_t *chan, sizebuf_t *msg)
|
|||
sequence &= ~(1<<31);
|
||||
sequence_ack &= ~(1<<31);
|
||||
|
||||
if (showpackets->value)
|
||||
// if (showpackets->value)
|
||||
if (showpackets->integer)
|
||||
{
|
||||
if (reliable_message)
|
||||
Com_Printf ("recv %4i : s=%i reliable=%i ack=%i rack=%i\n"
|
||||
|
@ -344,7 +347,8 @@ qboolean Netchan_Process (netchan_t *chan, sizebuf_t *msg)
|
|||
//
|
||||
if (sequence <= chan->incoming_sequence)
|
||||
{
|
||||
if (showdrop->value)
|
||||
// if (showdrop->value)
|
||||
if (showdrop->integer)
|
||||
Com_Printf ("%s:Out of order packet %i at %i\n"
|
||||
, NET_AdrToString (chan->remote_address)
|
||||
, sequence
|
||||
|
@ -358,7 +362,8 @@ qboolean Netchan_Process (netchan_t *chan, sizebuf_t *msg)
|
|||
chan->dropped = sequence - (chan->incoming_sequence+1);
|
||||
if (chan->dropped > 0)
|
||||
{
|
||||
if (showdrop->value)
|
||||
// if (showdrop->value)
|
||||
if (showdrop->integer)
|
||||
Com_Printf ("%s:Dropped %i packets at %i\n"
|
||||
, NET_AdrToString (chan->remote_address)
|
||||
, chan->dropped
|
||||
|
|
|
@ -45,7 +45,8 @@ void SV_SetMaster_f (void)
|
|||
int i, slot;
|
||||
|
||||
// only dedicated servers send heartbeats
|
||||
if (!dedicated->value)
|
||||
// if (!dedicated->value)
|
||||
if (!dedicated->integer)
|
||||
{
|
||||
Com_Printf ("Only dedicated servers use masters.\n");
|
||||
return;
|
||||
|
@ -108,7 +109,8 @@ qboolean SV_SetPlayer (void)
|
|||
if (s[0] >= '0' && s[0] <= '9')
|
||||
{
|
||||
idnum = atoi(Cmd_Argv(1));
|
||||
if (idnum < 0 || idnum >= maxclients->value)
|
||||
// if (idnum < 0 || idnum >= maxclients->value)
|
||||
if (idnum < 0 || idnum >= maxclients->integer)
|
||||
{
|
||||
Com_Printf ("Bad client slot: %i\n", idnum);
|
||||
return false;
|
||||
|
@ -125,7 +127,8 @@ qboolean SV_SetPlayer (void)
|
|||
}
|
||||
|
||||
// check for a name match
|
||||
for (i=0,cl=svs.clients ; i<maxclients->value; i++,cl++)
|
||||
// for (i=0,cl=svs.clients ; i<maxclients->value; i++,cl++)
|
||||
for (i=0,cl=svs.clients ; i<maxclients->integer; i++,cl++)
|
||||
{
|
||||
if (!cl->state)
|
||||
continue;
|
||||
|
@ -427,7 +430,8 @@ void SV_WriteScreenshot (void)
|
|||
{
|
||||
char name[MAX_OSPATH];
|
||||
|
||||
if (dedicated->value) // can't do this in dedicated mode
|
||||
// if (dedicated->value) // can't do this in dedicated mode
|
||||
if (dedicated->integer) // can't do this in dedicated mode
|
||||
return;
|
||||
|
||||
Com_DPrintf("SV_WriteScreenshot()\n");
|
||||
|
@ -689,8 +693,10 @@ void SV_GameMap_f (void)
|
|||
// clear all the client inuse flags before saving so that
|
||||
// when the level is re-entered, the clients will spawn
|
||||
// at spawn points instead of occupying body shells
|
||||
savedInuse = malloc(maxclients->value * sizeof(qboolean));
|
||||
for (i=0,cl=svs.clients ; i<maxclients->value; i++,cl++)
|
||||
// savedInuse = malloc(maxclients->value * sizeof(qboolean));
|
||||
savedInuse = malloc(maxclients->integer * sizeof(qboolean));
|
||||
// for (i=0,cl=svs.clients ; i<maxclients->value; i++,cl++)
|
||||
for (i=0,cl=svs.clients ; i<maxclients->integer; i++,cl++)
|
||||
{
|
||||
savedInuse[i] = cl->edict->inuse;
|
||||
cl->edict->inuse = false;
|
||||
|
@ -699,7 +705,8 @@ void SV_GameMap_f (void)
|
|||
SV_WriteLevelFile ();
|
||||
|
||||
// we must restore these for clients to transfer over correctly
|
||||
for (i=0,cl=svs.clients ; i<maxclients->value; i++,cl++)
|
||||
// for (i=0,cl=svs.clients ; i<maxclients->value; i++,cl++)
|
||||
for (i=0,cl=svs.clients ; i<maxclients->integer; i++,cl++)
|
||||
cl->edict->inuse = savedInuse[i];
|
||||
free (savedInuse);
|
||||
}
|
||||
|
@ -715,7 +722,8 @@ void SV_GameMap_f (void)
|
|||
// Knightmare- don't do this in deathmatch or for cinematics
|
||||
l = (int)strlen(map);
|
||||
//l = strcspn(map, "+");
|
||||
if (!dedicated->value && !Cvar_VariableValue("deathmatch")
|
||||
// if (!dedicated->value && !Cvar_VariableValue("deathmatch")
|
||||
if (!dedicated->integer && !Cvar_VariableValue("deathmatch")
|
||||
&& Q_strcasecmp (map+l-4, ".cin") && Q_strcasecmp (map+l-4, ".roq")
|
||||
&& Q_strcasecmp (map+l-4, ".pcx"))
|
||||
{
|
||||
|
@ -752,8 +760,8 @@ void SV_Map_f (void)
|
|||
if (FS_LoadFile (expanded, NULL) == -1)
|
||||
{
|
||||
Com_Printf ("Can't find %s\n", expanded);
|
||||
//if (!dedicated->value && cls.state != ca_connected) // Knightmare added
|
||||
// CL_Drop ();
|
||||
// if (!dedicated->integer && cls.state != ca_connected) // Knightmare added
|
||||
// CL_Drop ();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -784,6 +792,7 @@ void SV_Loadgame_f (void)
|
|||
char name[MAX_OSPATH];
|
||||
FILE *f;
|
||||
char *dir;
|
||||
qboolean quicksave = false;
|
||||
|
||||
if (Cmd_Argc() != 2)
|
||||
{
|
||||
|
@ -799,6 +808,9 @@ void SV_Loadgame_f (void)
|
|||
Com_Printf ("Bad savedir.\n");
|
||||
}
|
||||
|
||||
// quicksave = ( !dedicated->value && (!strcmp(Cmd_Argv(1), "quick") || !strcmp(Cmd_Argv(1), "quik")) );
|
||||
quicksave = ( !dedicated->integer && (!strcmp(Cmd_Argv(1), "quick") || !strcmp(Cmd_Argv(1), "quik")) );
|
||||
|
||||
// make sure the server.ssv file exists
|
||||
// Com_sprintf (name, sizeof(name), "%s/save/%s/server.ssv", FS_Savegamedir(), Cmd_Argv(1)); // was FS_Gamedir()
|
||||
Com_sprintf (name, sizeof(name), "%s/"SAVEDIRNAME"/%s/server.ssv", FS_Savegamedir(), Cmd_Argv(1)); // was FS_Gamedir()
|
||||
|
@ -811,7 +823,7 @@ void SV_Loadgame_f (void)
|
|||
fclose (f);
|
||||
|
||||
// Knightmare- set saveshot name
|
||||
if ( !dedicated->value && (!strcmp(Cmd_Argv(1), "quick") || !strcmp(Cmd_Argv(1), "quik")) )
|
||||
if (quicksave)
|
||||
{
|
||||
// Com_sprintf(sv_loadshotname, sizeof(sv_loadshotname), "save/%s/shot.jpg", Cmd_Argv(1));
|
||||
Com_sprintf(sv_loadshotname, sizeof(sv_loadshotname), SAVEDIRNAME"/%s/shot.jpg", Cmd_Argv(1));
|
||||
|
@ -842,7 +854,7 @@ SV_Savegame_f
|
|||
|
||||
void SV_Savegame_f (void)
|
||||
{
|
||||
char *dir;
|
||||
char *dir;
|
||||
qboolean quicksave = false;
|
||||
|
||||
if (sv.state != ss_game)
|
||||
|
@ -879,13 +891,15 @@ void SV_Savegame_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
quicksave = ( !dedicated->value && (!strcmp(Cmd_Argv(1), "quick") || !strcmp(Cmd_Argv(1), "quik")) );
|
||||
// quicksave = ( !dedicated->value && (!strcmp(Cmd_Argv(1), "quick") || !strcmp(Cmd_Argv(1), "quik")) );
|
||||
quicksave = ( !dedicated->integer && (!strcmp(Cmd_Argv(1), "quick") || !strcmp(Cmd_Argv(1), "quik")) );
|
||||
|
||||
// Knightmare- grab screen for quicksave
|
||||
if ( !dedicated->value && (!strcmp(Cmd_Argv(1), "quick") || !strcmp(Cmd_Argv(1), "quik")) )
|
||||
if (quicksave)
|
||||
R_GrabScreen();
|
||||
|
||||
if (maxclients->value == 1 && svs.clients[0].edict->client->ps.stats[STAT_HEALTH] <= 0)
|
||||
// if (maxclients->value == 1 && svs.clients[0].edict->client->ps.stats[STAT_HEALTH] <= 0)
|
||||
if (maxclients->integer == 1 && svs.clients[0].edict->client->ps.stats[STAT_HEALTH] <= 0)
|
||||
{
|
||||
Com_Printf ("\nCan't savegame while dead!\n");
|
||||
return;
|
||||
|
@ -971,7 +985,8 @@ void SV_Status_f (void)
|
|||
|
||||
Com_Printf ("num score ping name lastmsg address qport \n");
|
||||
Com_Printf ("--- ----- ---- --------------- ------- --------------------- ------\n");
|
||||
for (i=0,cl=svs.clients ; i<maxclients->value; i++,cl++)
|
||||
// for (i=0,cl=svs.clients ; i<maxclients->value; i++,cl++)
|
||||
for (i=0,cl=svs.clients ; i<maxclients->integer; i++,cl++)
|
||||
{
|
||||
if (!cl->state)
|
||||
continue;
|
||||
|
@ -1036,7 +1051,8 @@ void SV_ConSay_f(void)
|
|||
// strncat(text, p);
|
||||
Q_strncatz(text, sizeof(text), p);
|
||||
|
||||
for (j = 0, client = svs.clients; j < maxclients->value; j++, client++)
|
||||
// for (j = 0, client = svs.clients; j < maxclients->value; j++, client++)
|
||||
for (j = 0, client = svs.clients; j < maxclients->integer; j++, client++)
|
||||
{
|
||||
if (client->state != cs_spawned)
|
||||
continue;
|
||||
|
@ -1333,7 +1349,8 @@ void SV_InitOperatorCommands (void)
|
|||
Cmd_AddCommand ("gamemap", SV_GameMap_f);
|
||||
Cmd_AddCommand ("setmaster", SV_SetMaster_f);
|
||||
|
||||
if ( dedicated->value )
|
||||
// if ( dedicated->value )
|
||||
if ( dedicated->integer )
|
||||
Cmd_AddCommand ("say", SV_ConSay_f);
|
||||
|
||||
Cmd_AddCommand ("serverrecord", SV_ServerRecord_f);
|
||||
|
|
|
@ -44,7 +44,8 @@ qboolean SV_AddProjectileUpdate (edict_t *ent)
|
|||
if (!sv_projectiles)
|
||||
sv_projectiles = Cvar_Get("sv_projectiles", "1", 0);
|
||||
|
||||
if (!sv_projectiles->value)
|
||||
// if (!sv_projectiles->value)
|
||||
if (!sv_projectiles->integer)
|
||||
return false;
|
||||
|
||||
if (!(ent->svflags & SVF_PROJECTILE))
|
||||
|
@ -170,7 +171,8 @@ void SV_EmitPacketEntities (client_frame_t *from, client_frame_t *to, sizebuf_t
|
|||
// in any bytes being emited if the entity has not changed at all
|
||||
// note that players are always 'newentities', this updates their oldorigin always
|
||||
// and prevents warping
|
||||
MSG_WriteDeltaEntity (oldent, newent, msg, false, newent->number <= maxclients->value);
|
||||
// MSG_WriteDeltaEntity (oldent, newent, msg, false, newent->number <= maxclients->value);
|
||||
MSG_WriteDeltaEntity (oldent, newent, msg, false, newent->number <= maxclients->integer);
|
||||
oldindex++;
|
||||
newindex++;
|
||||
continue;
|
||||
|
|
|
@ -43,7 +43,8 @@ void PF_Unicast (edict_t *ent, qboolean reliable)
|
|||
return;
|
||||
|
||||
p = NUM_FOR_EDICT(ent);
|
||||
if (p < 1 || p > maxclients->value)
|
||||
// if ( (p < 1) || (p > maxclients->value) )
|
||||
if ( (p < 1) || (p > maxclients->integer) )
|
||||
return;
|
||||
|
||||
client = svs.clients + (p-1);
|
||||
|
@ -106,7 +107,8 @@ void PF_cprintf (edict_t *ent, int level, char *fmt, ...)
|
|||
if (ent)
|
||||
{
|
||||
n = NUM_FOR_EDICT(ent);
|
||||
if (n < 1 || n > maxclients->value)
|
||||
// if (n < 1 || n > maxclients->value)
|
||||
if (n < 1 || n > maxclients->integer)
|
||||
Com_Error (ERR_DROP, "cprintf to a non-client");
|
||||
}
|
||||
|
||||
|
@ -136,7 +138,8 @@ void PF_centerprintf (edict_t *ent, char *fmt, ...)
|
|||
int n;
|
||||
|
||||
n = NUM_FOR_EDICT(ent);
|
||||
if (n < 1 || n > maxclients->value)
|
||||
// if (n < 1 || n > maxclients->value)
|
||||
if (n < 1 || n > maxclients->integer)
|
||||
return; // Com_Error (ERR_DROP, "centerprintf to a non-client");
|
||||
|
||||
va_start (argptr, fmt);
|
||||
|
|
|
@ -135,7 +135,8 @@ void SV_CheckForSavegame (void)
|
|||
FILE *f;
|
||||
int i;
|
||||
|
||||
if (sv_noreload->value)
|
||||
// if (sv_noreload->value)
|
||||
if (sv_noreload->integer)
|
||||
return;
|
||||
|
||||
if (Cvar_VariableValue ("deathmatch"))
|
||||
|
@ -239,7 +240,8 @@ void SV_SpawnServer (char *server, char *spawnpoint, server_state_t serverstate,
|
|||
Q_strncpyz (sv.name, sizeof(sv.name), server);
|
||||
|
||||
// leave slots at start for clients only
|
||||
for (i=0 ; i<maxclients->value ; i++)
|
||||
// for (i=0 ; i<maxclients->value ; i++)
|
||||
for (i=0 ; i<maxclients->integer ; i++)
|
||||
{
|
||||
// needs to reconnect
|
||||
if (svs.clients[i].state > cs_connected)
|
||||
|
@ -362,7 +364,8 @@ void SV_InitGame (void)
|
|||
|
||||
// dedicated servers can't be single player and are usually DM
|
||||
// so unless they explicity set coop, force it to deathmatch
|
||||
if (dedicated->value)
|
||||
// if (dedicated->value)
|
||||
if (dedicated->integer)
|
||||
{
|
||||
if (!Cvar_VariableValue ("coop"))
|
||||
Cvar_FullSet ("deathmatch", "1", CVAR_SERVERINFO | CVAR_LATCH);
|
||||
|
@ -371,14 +374,17 @@ void SV_InitGame (void)
|
|||
// init clients
|
||||
if (Cvar_VariableValue ("deathmatch"))
|
||||
{
|
||||
if (maxclients->value <= 1)
|
||||
// if (maxclients->value <= 1)
|
||||
if (maxclients->integer <= 1)
|
||||
Cvar_FullSet ("maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH);
|
||||
else if (maxclients->value > MAX_CLIENTS)
|
||||
// else if (maxclients->value > MAX_CLIENTS)
|
||||
else if (maxclients->integer > MAX_CLIENTS)
|
||||
Cvar_FullSet ("maxclients", va("%i", MAX_CLIENTS), CVAR_SERVERINFO | CVAR_LATCH);
|
||||
}
|
||||
else if (Cvar_VariableValue ("coop"))
|
||||
{
|
||||
if (maxclients->value <= 1 || maxclients->value > 4)
|
||||
// if (maxclients->value <= 1 || maxclients->value > 4)
|
||||
if (maxclients->integer <= 1 || maxclients->integer > 4)
|
||||
Cvar_FullSet ("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH);
|
||||
}
|
||||
else // non-deathmatch, non-coop is one player
|
||||
|
@ -387,12 +393,15 @@ void SV_InitGame (void)
|
|||
}
|
||||
|
||||
svs.spawncount = rand();
|
||||
svs.clients = Z_Malloc (sizeof(client_t)*maxclients->value);
|
||||
svs.num_client_entities = maxclients->value*UPDATE_BACKUP*64;
|
||||
// svs.clients = Z_Malloc (sizeof(client_t)*maxclients->value);
|
||||
svs.clients = Z_Malloc (sizeof(client_t) * maxclients->integer);
|
||||
// svs.num_client_entities = maxclients->value*UPDATE_BACKUP*64;
|
||||
svs.num_client_entities = maxclients->integer * UPDATE_BACKUP * 64;
|
||||
svs.client_entities = Z_Malloc (sizeof(entity_state_t)*svs.num_client_entities);
|
||||
|
||||
// init network stuff
|
||||
NET_Config ( (maxclients->value > 1) );
|
||||
// NET_Config ( (maxclients->value > 1) );
|
||||
NET_Config ( (maxclients->integer > 1) );
|
||||
|
||||
// heartbeats will always be sent to the id master
|
||||
svs.last_heartbeat = -99999; // send immediately
|
||||
|
@ -401,7 +410,8 @@ void SV_InitGame (void)
|
|||
|
||||
// init game
|
||||
SV_InitGameProgs ();
|
||||
for (i = 0; i < maxclients->value; i++)
|
||||
// for (i = 0; i < maxclients->value; i++)
|
||||
for (i = 0; i < maxclients->integer; i++)
|
||||
{
|
||||
ent = EDICT_NUM(i+1);
|
||||
ent->s.number = i+1;
|
||||
|
@ -483,28 +493,32 @@ void SV_Map (qboolean attractloop, char *levelstring, qboolean loadgame)
|
|||
if (l > 4 && !strcmp (level+l-4, ".cin") )
|
||||
#endif // ROQ_SUPPORT
|
||||
{
|
||||
if (!dedicated->value)
|
||||
// if (!dedicated->value)
|
||||
if (!dedicated->integer)
|
||||
SCR_BeginLoadingPlaque (); // for local system
|
||||
SV_BroadcastCommand ("changing\n");
|
||||
SV_SpawnServer (level, spawnpoint, ss_cinematic, attractloop, loadgame);
|
||||
}
|
||||
else if (l > 4 && !strcmp (level+l-4, ".dm2") )
|
||||
{
|
||||
if (!dedicated->value)
|
||||
// if (!dedicated->value)
|
||||
if (!dedicated->integer)
|
||||
SCR_BeginLoadingPlaque (); // for local system
|
||||
SV_BroadcastCommand ("changing\n");
|
||||
SV_SpawnServer (level, spawnpoint, ss_demo, attractloop, loadgame);
|
||||
}
|
||||
else if (l > 4 && !strcmp (level+l-4, ".pcx"))
|
||||
{
|
||||
if (!dedicated->value)
|
||||
// if (!dedicated->value)
|
||||
if (!dedicated->integer)
|
||||
SCR_BeginLoadingPlaque (); // for local system
|
||||
SV_BroadcastCommand ("changing\n");
|
||||
SV_SpawnServer (level, spawnpoint, ss_pic, attractloop, loadgame);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!dedicated->value)
|
||||
// if (!dedicated->value)
|
||||
if (!dedicated->integer)
|
||||
SCR_BeginLoadingPlaque (); // for local system
|
||||
SV_BroadcastCommand ("changing\n");
|
||||
SV_SendClientMessages ();
|
||||
|
|
|
@ -125,7 +125,8 @@ client_t *GetClientFromAdr (netadr_t address)
|
|||
int i;
|
||||
qboolean found = false;
|
||||
|
||||
for (i = 0; i < maxclients->value; i++)
|
||||
// for (i = 0; i < maxclients->value; i++)
|
||||
for (i = 0; i < maxclients->integer; i++)
|
||||
{
|
||||
cl = &svs.clients[i];
|
||||
if (NET_CompareBaseAdr(cl->netchan.remote_address, address)) {
|
||||
|
@ -224,7 +225,8 @@ char *SV_StatusString (void)
|
|||
Q_strncatz (status, sizeof(status), "\n");
|
||||
statusLength = (int)strlen(status);
|
||||
|
||||
for (i=0 ; i<maxclients->value ; i++)
|
||||
// for (i=0 ; i<maxclients->value ; i++)
|
||||
for (i=0 ; i<maxclients->integer ; i++)
|
||||
{
|
||||
cl = &svs.clients[i];
|
||||
if (cl->state == cs_connected || cl->state == cs_spawned )
|
||||
|
@ -285,7 +287,8 @@ void SVC_Info (void)
|
|||
int i, count;
|
||||
int version;
|
||||
|
||||
if (maxclients->value == 1)
|
||||
// if (maxclients->value == 1)
|
||||
if (maxclients->integer == 1)
|
||||
return; // ignore in single player
|
||||
|
||||
version = atoi (Cmd_Argv(1));
|
||||
|
@ -298,11 +301,13 @@ void SVC_Info (void)
|
|||
else
|
||||
{
|
||||
count = 0;
|
||||
for (i=0 ; i<maxclients->value ; i++)
|
||||
// for (i=0 ; i<maxclients->value ; i++)
|
||||
for (i=0 ; i<maxclients->integer ; i++)
|
||||
if (svs.clients[i].state >= cs_connected)
|
||||
count++;
|
||||
|
||||
Com_sprintf (string, sizeof(string), "%16s %8s %2i/%2i\n", hostname->string, sv.name, count, (int)maxclients->value);
|
||||
// Com_sprintf (string, sizeof(string), "%16s %8s %2i/%2i\n", hostname->string, sv.name, count, (int)maxclients->value);
|
||||
Com_sprintf (string, sizeof(string), "%16s %8s %2i/%2i\n", hostname->string, sv.name, count, maxclients->integer);
|
||||
}
|
||||
|
||||
Netchan_OutOfBandPrint (NS_SERVER, net_from, "info\n%s", string);
|
||||
|
@ -405,7 +410,8 @@ void SVC_DirectConnect (void)
|
|||
|
||||
// r1ch: limit connections from a single IP
|
||||
previousclients = 0;
|
||||
for (i=0,cl=svs.clients; i<(int)maxclients->value; i++,cl++)
|
||||
// for (i=0,cl=svs.clients; i<(int)maxclients->value; i++,cl++)
|
||||
for (i=0,cl=svs.clients; i<maxclients->integer; i++,cl++)
|
||||
{
|
||||
if (cl->state == cs_free)
|
||||
continue;
|
||||
|
@ -467,7 +473,8 @@ void SVC_DirectConnect (void)
|
|||
memset (newcl, 0, sizeof(client_t));
|
||||
|
||||
// if there is already a slot for this ip, reuse it
|
||||
for (i=0,cl=svs.clients ; i<maxclients->value ; i++,cl++)
|
||||
// for (i=0,cl=svs.clients ; i<maxclients->value ; i++,cl++)
|
||||
for (i=0,cl=svs.clients; i<maxclients->integer; i++,cl++)
|
||||
{
|
||||
if (cl->state == cs_free)
|
||||
continue;
|
||||
|
@ -475,7 +482,8 @@ void SVC_DirectConnect (void)
|
|||
&& ( cl->netchan.qport == qport
|
||||
|| adr.port == cl->netchan.remote_address.port ) )
|
||||
{
|
||||
if (!NET_IsLocalAddress (adr) && (svs.realtime - cl->lastconnect) < ((int)sv_reconnect_limit->value * 1000))
|
||||
// if (!NET_IsLocalAddress (adr) && (svs.realtime - cl->lastconnect) < ((int)sv_reconnect_limit->value * 1000))
|
||||
if (!NET_IsLocalAddress (adr) && (svs.realtime - cl->lastconnect) < (sv_reconnect_limit->integer * 1000))
|
||||
{
|
||||
Com_DPrintf ("%s:reconnect rejected : too soon\n", NET_AdrToString (adr));
|
||||
return;
|
||||
|
@ -503,7 +511,8 @@ void SVC_DirectConnect (void)
|
|||
|
||||
// find a client slot
|
||||
newcl = NULL;
|
||||
for (i=0,cl=svs.clients ; i<maxclients->value ; i++,cl++)
|
||||
// for (i=0,cl=svs.clients ; i<maxclients->value ; i++,cl++)
|
||||
for (i=0,cl=svs.clients ; i<maxclients->integer ; i++,cl++)
|
||||
{
|
||||
if (cl->state == cs_free)
|
||||
{
|
||||
|
@ -686,7 +695,8 @@ void SV_CalcPings (void)
|
|||
client_t *cl;
|
||||
int total, count;
|
||||
|
||||
for (i=0 ; i<maxclients->value ; i++)
|
||||
// for (i=0 ; i<maxclients->value ; i++)
|
||||
for (i=0 ; i<maxclients->integer ; i++)
|
||||
{
|
||||
cl = &svs.clients[i];
|
||||
if (cl->state != cs_spawned )
|
||||
|
@ -740,7 +750,8 @@ void SV_GiveMsec (void)
|
|||
if (sv.framenum & 15)
|
||||
return;
|
||||
|
||||
for (i=0 ; i<maxclients->value ; i++)
|
||||
// for (i=0 ; i<maxclients->value ; i++)
|
||||
for (i=0 ; i<maxclients->integer ; i++)
|
||||
{
|
||||
cl = &svs.clients[i];
|
||||
if (cl->state == cs_free )
|
||||
|
@ -779,7 +790,8 @@ void SV_ReadPackets (void)
|
|||
qport = MSG_ReadShort (&net_message) & 0xffff;
|
||||
|
||||
// check for packets from connected clients
|
||||
for (i=0, cl=svs.clients ; i<maxclients->value ; i++,cl++)
|
||||
// for (i=0, cl=svs.clients ; i<maxclients->value ; i++,cl++)
|
||||
for (i=0, cl=svs.clients ; i<maxclients->integer ; i++,cl++)
|
||||
{
|
||||
if (cl->state == cs_free)
|
||||
continue;
|
||||
|
@ -804,7 +816,8 @@ void SV_ReadPackets (void)
|
|||
break;
|
||||
}
|
||||
|
||||
if (i != maxclients->value)
|
||||
// if (i != maxclients->value)
|
||||
if (i != maxclients->integer)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -832,7 +845,8 @@ void SV_CheckTimeouts (void)
|
|||
droppoint = svs.realtime - 1000*timeout->value;
|
||||
zombiepoint = svs.realtime - 1000*zombietime->value;
|
||||
|
||||
for (i=0,cl=svs.clients ; i<maxclients->value ; i++,cl++)
|
||||
// for (i=0,cl=svs.clients ; i<maxclients->value ; i++,cl++)
|
||||
for (i=0,cl=svs.clients ; i<maxclients->integer ; i++,cl++)
|
||||
{
|
||||
// message times may be wrong across a changelevel
|
||||
if (cl->lastmessage > svs.realtime)
|
||||
|
@ -887,7 +901,8 @@ SV_RunGameFrame
|
|||
*/
|
||||
void SV_RunGameFrame (void)
|
||||
{
|
||||
if (host_speeds->value)
|
||||
// if (host_speeds->value)
|
||||
if (host_speeds->integer)
|
||||
time_before_game = Sys_Milliseconds ();
|
||||
|
||||
// we always need to bump framenum, even if we
|
||||
|
@ -898,20 +913,23 @@ void SV_RunGameFrame (void)
|
|||
sv.time = sv.framenum*100;
|
||||
|
||||
// don't run if paused
|
||||
if (!sv_paused->value || maxclients->value > 1)
|
||||
// if (!sv_paused->value || maxclients->value > 1)
|
||||
if (!sv_paused->integer || maxclients->integer > 1)
|
||||
{
|
||||
ge->RunFrame ();
|
||||
|
||||
// never get more than one tic behind
|
||||
if (sv.time < svs.realtime)
|
||||
{
|
||||
if (sv_showclamp->value)
|
||||
// if (sv_showclamp->value)
|
||||
if (sv_showclamp->integer)
|
||||
Com_Printf ("sv highclamp\n");
|
||||
svs.realtime = sv.time;
|
||||
}
|
||||
}
|
||||
|
||||
if (host_speeds->value)
|
||||
// if (host_speeds->value)
|
||||
if (host_speeds->integer)
|
||||
time_after_game = Sys_Milliseconds ();
|
||||
|
||||
}
|
||||
|
@ -942,12 +960,14 @@ void SV_Frame (int msec)
|
|||
SV_ReadPackets ();
|
||||
|
||||
// move autonomous things around if enough time has passed
|
||||
if (!sv_timedemo->value && svs.realtime < sv.time)
|
||||
// if (!sv_timedemo->value && svs.realtime < sv.time)
|
||||
if (!sv_timedemo->integer && svs.realtime < sv.time)
|
||||
{
|
||||
// never let the time get too far off
|
||||
if (sv.time - svs.realtime > 100)
|
||||
{
|
||||
if (sv_showclamp->value)
|
||||
// if (sv_showclamp->value)
|
||||
if (sv_showclamp->integer)
|
||||
Com_Printf ("sv lowclamp\n");
|
||||
svs.realtime = sv.time - 100;
|
||||
}
|
||||
|
@ -995,11 +1015,13 @@ void Master_Heartbeat (void)
|
|||
int i;
|
||||
|
||||
// pgm post 3.19 change, cvar pointer not validated before dereferencing
|
||||
if (!dedicated || !dedicated->value)
|
||||
// if (!dedicated || !dedicated->value)
|
||||
if (!dedicated || !dedicated->integer)
|
||||
return; // only dedicated servers send heartbeats
|
||||
|
||||
// pgm post 3.19 change, cvar pointer not validated before dereferencing
|
||||
if (!public_server || !public_server->value)
|
||||
// if (!public_server || !public_server->value)
|
||||
if (!public_server || !public_server->integer)
|
||||
return; // a private dedicated game
|
||||
|
||||
// check for time wraparound
|
||||
|
@ -1035,11 +1057,13 @@ void Master_Shutdown (void)
|
|||
int i;
|
||||
|
||||
// pgm post3.19 change, cvar pointer not validated before dereferencing
|
||||
if (!dedicated || !dedicated->value)
|
||||
// if (!dedicated || !dedicated->value)
|
||||
if (!dedicated || !dedicated->integer)
|
||||
return; // only dedicated servers send heartbeats
|
||||
|
||||
// pgm post3.19 change, cvar pointer not validated before dereferencing
|
||||
if (!public_server || !public_server->value)
|
||||
// if (!public_server || !public_server->value)
|
||||
if (!public_server || !public_server->integer)
|
||||
return; // a private dedicated game
|
||||
|
||||
// send to group master
|
||||
|
@ -1223,12 +1247,14 @@ void SV_FinalMessage (char *message, qboolean reconnect)
|
|||
// send it twice
|
||||
// stagger the packets to crutch operating system limited buffers
|
||||
|
||||
for (i=0, cl = svs.clients ; i<maxclients->value ; i++, cl++)
|
||||
// for (i=0, cl = svs.clients ; i<maxclients->value ; i++, cl++)
|
||||
for (i=0, cl = svs.clients ; i<maxclients->integer ; i++, cl++)
|
||||
if (cl->state >= cs_connected)
|
||||
Netchan_Transmit (&cl->netchan, net_message.cursize
|
||||
, net_message.data);
|
||||
|
||||
for (i=0, cl = svs.clients ; i<maxclients->value ; i++, cl++)
|
||||
// for (i=0, cl = svs.clients ; i<maxclients->value ; i++, cl++)
|
||||
for (i=0, cl = svs.clients ; i<maxclients->integer ; i++, cl++)
|
||||
if (cl->state >= cs_connected)
|
||||
Netchan_Transmit (&cl->netchan, net_message.cursize
|
||||
, net_message.data);
|
||||
|
|
|
@ -103,7 +103,8 @@ void SV_BroadcastPrintf (int level, char *fmt, ...)
|
|||
va_end (argptr);
|
||||
|
||||
// echo to console
|
||||
if (dedicated->value)
|
||||
// if (dedicated->value)
|
||||
if (dedicated->integer)
|
||||
{
|
||||
char copy[1024];
|
||||
int i;
|
||||
|
@ -115,7 +116,8 @@ void SV_BroadcastPrintf (int level, char *fmt, ...)
|
|||
Com_Printf ("%s", copy);
|
||||
}
|
||||
|
||||
for (i=0, cl = svs.clients ; i<maxclients->value; i++, cl++)
|
||||
// for (i=0, cl = svs.clients ; i<maxclients->value; i++, cl++)
|
||||
for (i=0, cl = svs.clients; i<maxclients->integer; i++, cl++)
|
||||
{
|
||||
if (level < cl->messagelevel)
|
||||
continue;
|
||||
|
@ -221,7 +223,8 @@ void SV_Multicast (vec3_t origin, multicast_t to)
|
|||
}
|
||||
|
||||
// send the data to all relevent clients
|
||||
for (j = 0, client = svs.clients; j < maxclients->value; j++, client++)
|
||||
// for (j = 0, client = svs.clients; j < maxclients->value; j++, client++)
|
||||
for (j = 0, client = svs.clients; j < maxclients->integer; j++, client++)
|
||||
{
|
||||
if (client->state == cs_free || client->state == cs_zombie)
|
||||
continue;
|
||||
|
@ -410,7 +413,8 @@ qboolean SV_SendClientDatagram (client_t *client)
|
|||
SZ_Init (&msg, msg_buf, sizeof(msg_buf));
|
||||
|
||||
// Knightmare- limit message size to 2800 for non-local clients in multiplayer
|
||||
if (maxclients->value > 1 && client->netchan.remote_address.type != NA_LOOPBACK && sv_limit_msglen->integer != 0)
|
||||
// if (maxclients->value > 1 && client->netchan.remote_address.type != NA_LOOPBACK && sv_limit_msglen->integer != 0)
|
||||
if (maxclients->integer > 1 && client->netchan.remote_address.type != NA_LOOPBACK && sv_limit_msglen->integer != 0)
|
||||
msg.maxsize = MAX_MSGLEN_MP;
|
||||
|
||||
msg.allowoverflow = true;
|
||||
|
@ -513,7 +517,8 @@ void SV_SendClientMessages (void)
|
|||
// read the next demo message if needed
|
||||
if (sv.state == ss_demo && sv.demofile)
|
||||
{
|
||||
if (sv_paused->value)
|
||||
// if (sv_paused->value)
|
||||
if (sv_paused->integer)
|
||||
msglen = 0;
|
||||
else
|
||||
{
|
||||
|
@ -542,7 +547,8 @@ void SV_SendClientMessages (void)
|
|||
}
|
||||
|
||||
// send a message to each connected client
|
||||
for (i=0, c = svs.clients ; i<maxclients->value; i++, c++)
|
||||
// for (i=0, c = svs.clients ; i<maxclients->value; i++, c++)
|
||||
for (i=0, c = svs.clients ; i<maxclients->integer; i++, c++)
|
||||
{
|
||||
if (!c->state)
|
||||
continue;
|
||||
|
|
|
@ -128,24 +128,28 @@ SV_SetMaxBaselinesSize
|
|||
int SV_SetMaxBaselinesSize (void)
|
||||
{
|
||||
// bounds check sv_baselines_maxlen
|
||||
if (sv_baselines_maxlen->value < 400)
|
||||
// if (sv_baselines_maxlen->value < 400)
|
||||
if (sv_baselines_maxlen->integer < 400)
|
||||
{
|
||||
Com_Printf (S_COLOR_YELLOW"WARNING: sv_baselines_maxlen is less than 400! Setting to default value of 1200.\n");
|
||||
Cvar_Set ("sv_baselines_maxlen", "1200");
|
||||
}
|
||||
if (sv_baselines_maxlen->value > MAX_MSGLEN)
|
||||
// if (sv_baselines_maxlen->value > MAX_MSGLEN)
|
||||
if (sv_baselines_maxlen->integer > MAX_MSGLEN)
|
||||
{
|
||||
Com_Printf (S_COLOR_YELLOW"WARNING: sv_baselines_maxlen is larger than MAX_MSGLEN of %i! Setting to default value of 1200.\n", MAX_MSGLEN);
|
||||
Cvar_Set ("sv_baselines_maxlen", "1200");
|
||||
}
|
||||
if (sv_baselines_maxlen->value > 1400)
|
||||
// if (sv_baselines_maxlen->value > 1400)
|
||||
if (sv_baselines_maxlen->integer > 1400)
|
||||
{
|
||||
Com_Printf (S_COLOR_YELLOW"WARNING: sv_baselines_maxlen is larger than 1400! Setting to default value of 1200.\n");
|
||||
Cvar_Set ("sv_baselines_maxlen", "1200");
|
||||
}
|
||||
|
||||
// use MAX_MSGLEN/2 for SP and local clients
|
||||
if ( (sv_client->netchan.remote_address.type == NA_LOOPBACK) || (maxclients->value == 1) )
|
||||
// if ( (sv_client->netchan.remote_address.type == NA_LOOPBACK) || (maxclients->value == 1) )
|
||||
if ( (sv_client->netchan.remote_address.type == NA_LOOPBACK) || (maxclients->integer == 1) )
|
||||
return MAX_MSGLEN/2;
|
||||
else
|
||||
return sv_baselines_maxlen->integer;
|
||||
|
@ -464,13 +468,20 @@ void SV_BeginDownload_f(void)
|
|||
|
||||
valid = true;
|
||||
|
||||
if ( !allow_download->value
|
||||
/* if ( !allow_download->value
|
||||
|| (strncmp(name, "players/", 8) == 0 && !allow_download_players->value)
|
||||
|| (strncmp(name, "models/", 7) == 0 && !allow_download_models->value)
|
||||
|| (strncmp(name, "sound/", 6) == 0 && !allow_download_sounds->value)
|
||||
|| (strncmp(name, "maps/", 5) == 0 && !allow_download_maps->value)
|
||||
|| (strncmp(name, "pics/", 5) == 0 && !allow_download_pics->value)
|
||||
|| ( ((strncmp(name, "env/", 4) == 0 || strncmp(name, "textures/", 9) == 0)) && !allow_download_textures->value ) )
|
||||
|| ( ((strncmp(name, "env/", 4) == 0 || strncmp(name, "textures/", 9) == 0)) && !allow_download_textures->value ) )*/
|
||||
if ( !allow_download->integer
|
||||
|| (strncmp(name, "players/", 8) == 0 && !allow_download_players->integer)
|
||||
|| (strncmp(name, "models/", 7) == 0 && !allow_download_models->integer)
|
||||
|| (strncmp(name, "sound/", 6) == 0 && !allow_download_sounds->integer)
|
||||
|| (strncmp(name, "maps/", 5) == 0 && !allow_download_maps->integer)
|
||||
|| (strncmp(name, "pics/", 5) == 0 && !allow_download_pics->integer)
|
||||
|| ( ((strncmp(name, "env/", 4) == 0 || strncmp(name, "textures/", 9) == 0)) && !allow_download_textures->integer ) )
|
||||
valid = false;
|
||||
|
||||
if (!valid)
|
||||
|
@ -694,7 +705,8 @@ void SV_ClientThink (client_t *cl, usercmd_t *cmd)
|
|||
{
|
||||
cl->commandMsec -= cmd->msec;
|
||||
|
||||
if (cl->commandMsec < 0 && sv_enforcetime->value )
|
||||
// if (cl->commandMsec < 0 && sv_enforcetime->value )
|
||||
if (cl->commandMsec < 0 && sv_enforcetime->integer )
|
||||
{
|
||||
Com_DPrintf ("commandMsec underflow from %s\n", cl->name);
|
||||
return;
|
||||
|
@ -803,7 +815,8 @@ void SV_ExecuteClientMessage (client_t *cl)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!sv_paused->value)
|
||||
// if (!sv_paused->value)
|
||||
if (!sv_paused->integer)
|
||||
{
|
||||
net_drop = cl->netchan.dropped;
|
||||
if (net_drop < 20)
|
||||
|
|
112
win32/glw_imp.c
112
win32/glw_imp.c
|
@ -54,7 +54,7 @@ WORD gamma_ramp[3][256];
|
|||
|
||||
void InitGammaRamp (void)
|
||||
{
|
||||
if (!r_ignorehwgamma->value)
|
||||
if (!r_ignorehwgamma->integer)
|
||||
{
|
||||
if (qwglGetDeviceGammaRamp3DFX)
|
||||
/* {
|
||||
|
@ -83,7 +83,7 @@ void InitGammaRamp (void)
|
|||
|
||||
void ShutdownGammaRamp (void)
|
||||
{
|
||||
// if (r_ignorehwgamma->value)
|
||||
// if (r_ignorehwgamma->integer)
|
||||
if (!glState.gammaRamp)
|
||||
return;
|
||||
|
||||
|
@ -274,8 +274,8 @@ qboolean VID_CreateWindow( int width, int height, qboolean fullscreen )
|
|||
{
|
||||
vid_xpos = Cvar_Get ("vid_xpos", "0", 0);
|
||||
vid_ypos = Cvar_Get ("vid_ypos", "0", 0);
|
||||
x = vid_xpos->value;
|
||||
y = vid_ypos->value;
|
||||
x = vid_xpos->integer;
|
||||
y = vid_ypos->integer;
|
||||
}
|
||||
|
||||
glw_state.hWnd = CreateWindowEx (
|
||||
|
@ -341,31 +341,31 @@ rserr_t GLimp_SetMode ( int *pwidth, int *pheight, int mode, qboolean fullscreen
|
|||
// do a CDS if needed
|
||||
if ( fullscreen )
|
||||
{
|
||||
DEVMODE dm;
|
||||
DEVMODE fullscreenMode;
|
||||
|
||||
VID_Printf( PRINT_ALL, "...attempting fullscreen\n" );
|
||||
|
||||
memset( &dm, 0, sizeof( dm ) );
|
||||
memset( &fullscreenMode, 0, sizeof( fullscreenMode ) );
|
||||
|
||||
dm.dmSize = sizeof( dm );
|
||||
fullscreenMode.dmSize = sizeof( fullscreenMode );
|
||||
|
||||
dm.dmPelsWidth = width;
|
||||
dm.dmPelsHeight = height;
|
||||
dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||
fullscreenMode.dmPelsWidth = width;
|
||||
fullscreenMode.dmPelsHeight = height;
|
||||
fullscreenMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||
|
||||
// Added refresh rate control
|
||||
if ( r_displayrefresh->value != 0 )
|
||||
if ( r_displayrefresh->integer != 0 )
|
||||
{
|
||||
dm.dmDisplayFrequency = r_displayrefresh->integer;
|
||||
dm.dmFields |= DM_DISPLAYFREQUENCY;
|
||||
VID_Printf( PRINT_ALL, "...using r_displayrefresh of %d\n", (int)r_displayrefresh->value );
|
||||
fullscreenMode.dmDisplayFrequency = r_displayrefresh->integer;
|
||||
fullscreenMode.dmFields |= DM_DISPLAYFREQUENCY;
|
||||
VID_Printf( PRINT_ALL, "...using r_displayrefresh of %d\n", r_displayrefresh->integer );
|
||||
}
|
||||
|
||||
if ( r_bitdepth->value != 0 )
|
||||
if ( r_bitdepth->integer != 0 )
|
||||
{
|
||||
dm.dmBitsPerPel = r_bitdepth->value;
|
||||
dm.dmFields |= DM_BITSPERPEL;
|
||||
VID_Printf( PRINT_ALL, "...using r_bitdepth of %d\n", ( int ) r_bitdepth->value );
|
||||
fullscreenMode.dmBitsPerPel = r_bitdepth->integer;
|
||||
fullscreenMode.dmFields |= DM_BITSPERPEL;
|
||||
VID_Printf( PRINT_ALL, "...using r_bitdepth of %d\n", r_bitdepth->integer );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -378,7 +378,7 @@ rserr_t GLimp_SetMode ( int *pwidth, int *pheight, int mode, qboolean fullscreen
|
|||
}
|
||||
|
||||
VID_Printf( PRINT_ALL, "...calling CDS: " );
|
||||
if ( ChangeDisplaySettings( &dm, CDS_FULLSCREEN ) == DISP_CHANGE_SUCCESSFUL )
|
||||
if ( ChangeDisplaySettings( &fullscreenMode, CDS_FULLSCREEN ) == DISP_CHANGE_SUCCESSFUL )
|
||||
{
|
||||
*pwidth = width;
|
||||
*pheight = height;
|
||||
|
@ -401,21 +401,21 @@ rserr_t GLimp_SetMode ( int *pwidth, int *pheight, int mode, qboolean fullscreen
|
|||
|
||||
VID_Printf( PRINT_ALL, "...calling CDS assuming dual monitors:" );
|
||||
|
||||
dm.dmPelsWidth = width * 2;
|
||||
dm.dmPelsHeight = height;
|
||||
dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||
fullscreenMode.dmPelsWidth = width * 2;
|
||||
fullscreenMode.dmPelsHeight = height;
|
||||
fullscreenMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||
|
||||
if ( r_bitdepth->value != 0 )
|
||||
if ( r_bitdepth->integer != 0 )
|
||||
{
|
||||
dm.dmBitsPerPel = r_bitdepth->value;
|
||||
dm.dmFields |= DM_BITSPERPEL;
|
||||
fullscreenMode.dmBitsPerPel = r_bitdepth->integer;
|
||||
fullscreenMode.dmFields |= DM_BITSPERPEL;
|
||||
}
|
||||
|
||||
/*
|
||||
** our first CDS failed, so maybe we're running on some weird dual monitor
|
||||
** system
|
||||
*/
|
||||
if ( ChangeDisplaySettings( &dm, CDS_FULLSCREEN ) != DISP_CHANGE_SUCCESSFUL )
|
||||
if ( ChangeDisplaySettings( &fullscreenMode, CDS_FULLSCREEN ) != DISP_CHANGE_SUCCESSFUL )
|
||||
{
|
||||
VID_Printf( PRINT_ALL, " failed\n" );
|
||||
|
||||
|
@ -592,7 +592,7 @@ qboolean GLimp_InitGL (void)
|
|||
/*
|
||||
** set PFD_STEREO if necessary
|
||||
*/
|
||||
if ( stereo->value != 0 )
|
||||
if ( stereo->integer != 0 )
|
||||
{
|
||||
VID_Printf( PRINT_ALL, "...attempting to use stereo\n" );
|
||||
pfd.dwFlags |= PFD_STEREO;
|
||||
|
@ -655,7 +655,7 @@ qboolean GLimp_InitGL (void)
|
|||
{
|
||||
extern cvar_t *gl_allow_software;
|
||||
|
||||
if ( gl_allow_software->value )
|
||||
if ( gl_allow_software->integer )
|
||||
glw_state.mcd_accelerated = true;
|
||||
else
|
||||
glw_state.mcd_accelerated = false;
|
||||
|
@ -669,7 +669,7 @@ qboolean GLimp_InitGL (void)
|
|||
/*
|
||||
** report if stereo is desired but unavailable
|
||||
*/
|
||||
if ( !( pfd.dwFlags & PFD_STEREO ) && ( stereo->value != 0 ) )
|
||||
if ( !( pfd.dwFlags & PFD_STEREO ) && ( stereo->integer != 0 ) )
|
||||
{
|
||||
VID_Printf( PRINT_ALL, "...failed to select stereo pixel format\n" );
|
||||
Cvar_SetValue( "cl_stereo", 0 );
|
||||
|
@ -772,7 +772,7 @@ void GLimp_BeginFrame( float camera_separation )
|
|||
{
|
||||
if ( r_bitdepth->modified )
|
||||
{
|
||||
if ( r_bitdepth->value != 0 && !glw_state.allowdisplaydepthchange )
|
||||
if ( r_bitdepth->integer != 0 && !glw_state.allowdisplaydepthchange )
|
||||
{
|
||||
Cvar_SetValue( "r_bitdepth", 0 );
|
||||
VID_Printf( PRINT_ALL, "r_bitdepth requires Win95 OSR2.x or WinNT 4.x\n" );
|
||||
|
@ -832,35 +832,35 @@ void GLimp_AppActivate( qboolean active )
|
|||
ShowWindow( glw_state.hWnd, SW_RESTORE );
|
||||
|
||||
// Knightmare- restore desktop settings on alt-tabbing from fullscreen
|
||||
if ( vid_fullscreen->value && desktop_restored && glw_state.hGLRC != NULL )
|
||||
if ( vid_fullscreen->integer && desktop_restored && glw_state.hGLRC != NULL )
|
||||
{
|
||||
int width, height;
|
||||
DEVMODE dm;
|
||||
DEVMODE fullscreenMode;
|
||||
|
||||
if ( !VID_GetModeInfo (&width, &height, (int)(r_mode->value)) )
|
||||
if ( !VID_GetModeInfo (&width, &height, r_mode->integer) )
|
||||
{
|
||||
VID_Printf( PRINT_ALL, "invalid mode\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
memset( &dm, 0, sizeof( dm ) );
|
||||
dm.dmSize = sizeof( dm );
|
||||
dm.dmPelsWidth = width;
|
||||
dm.dmPelsHeight = height;
|
||||
dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||
memset( &fullscreenMode, 0, sizeof( fullscreenMode ) );
|
||||
fullscreenMode.dmSize = sizeof( fullscreenMode );
|
||||
fullscreenMode.dmPelsWidth = width;
|
||||
fullscreenMode.dmPelsHeight = height;
|
||||
fullscreenMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||
|
||||
if ( r_displayrefresh->value != 0 )
|
||||
if ( r_displayrefresh->integer != 0 )
|
||||
{
|
||||
dm.dmDisplayFrequency = r_displayrefresh->integer;
|
||||
dm.dmFields |= DM_DISPLAYFREQUENCY;
|
||||
// VID_Printf( PRINT_ALL, "...using r_displayrefresh of %d\n", (int)r_displayrefresh->value );
|
||||
fullscreenMode.dmDisplayFrequency = r_displayrefresh->integer;
|
||||
fullscreenMode.dmFields |= DM_DISPLAYFREQUENCY;
|
||||
// VID_Printf( PRINT_ALL, "...using r_displayrefresh of %d\n", (int)r_displayrefresh->integer );
|
||||
}
|
||||
|
||||
if ( r_bitdepth->value != 0 )
|
||||
if ( r_bitdepth->integer != 0 )
|
||||
{
|
||||
dm.dmBitsPerPel = r_bitdepth->value;
|
||||
dm.dmFields |= DM_BITSPERPEL;
|
||||
// VID_Printf( PRINT_ALL, "...using r_bitdepth of %d\n", (int)r_bitdepth->value );
|
||||
fullscreenMode.dmBitsPerPel = r_bitdepth->integer;
|
||||
fullscreenMode.dmFields |= DM_BITSPERPEL;
|
||||
// VID_Printf( PRINT_ALL, "...using r_bitdepth of %d\n", (int)r_bitdepth->integer );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -871,7 +871,7 @@ void GLimp_AppActivate( qboolean active )
|
|||
}
|
||||
|
||||
VID_Printf( PRINT_ALL, "...calling CDS: " );
|
||||
if ( ChangeDisplaySettings( &dm, CDS_FULLSCREEN ) == DISP_CHANGE_SUCCESSFUL )
|
||||
if ( ChangeDisplaySettings( &fullscreenMode, CDS_FULLSCREEN ) == DISP_CHANGE_SUCCESSFUL )
|
||||
{
|
||||
VID_Printf( PRINT_ALL, "ok\n" );
|
||||
}
|
||||
|
@ -880,17 +880,17 @@ void GLimp_AppActivate( qboolean active )
|
|||
VID_Printf( PRINT_ALL, "failed\n" );
|
||||
VID_Printf( PRINT_ALL, "...calling CDS assuming dual monitors: " );
|
||||
|
||||
dm.dmPelsWidth = width * 2;
|
||||
dm.dmPelsHeight = height;
|
||||
dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||
fullscreenMode.dmPelsWidth = width * 2;
|
||||
fullscreenMode.dmPelsHeight = height;
|
||||
fullscreenMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||
|
||||
if ( r_bitdepth->value != 0 )
|
||||
if ( r_bitdepth->integer != 0 )
|
||||
{
|
||||
dm.dmBitsPerPel = r_bitdepth->value;
|
||||
dm.dmFields |= DM_BITSPERPEL;
|
||||
fullscreenMode.dmBitsPerPel = r_bitdepth->integer;
|
||||
fullscreenMode.dmFields |= DM_BITSPERPEL;
|
||||
}
|
||||
|
||||
if ( ChangeDisplaySettings( &dm, CDS_FULLSCREEN ) == DISP_CHANGE_SUCCESSFUL )
|
||||
if ( ChangeDisplaySettings( &fullscreenMode, CDS_FULLSCREEN ) == DISP_CHANGE_SUCCESSFUL )
|
||||
{
|
||||
VID_Printf( PRINT_ALL, "ok\n" );
|
||||
}
|
||||
|
@ -902,12 +902,12 @@ void GLimp_AppActivate( qboolean active )
|
|||
{
|
||||
ToggleGammaRamp (false);
|
||||
|
||||
if ( vid_fullscreen->value )
|
||||
if ( vid_fullscreen->integer )
|
||||
{
|
||||
ShowWindow( glw_state.hWnd, SW_MINIMIZE );
|
||||
|
||||
// Knightmare- restore desktop settings on alt-tabbing from fullscreen
|
||||
if (restore_desktop->value) {
|
||||
if (restore_desktop->integer) {
|
||||
ChangeDisplaySettings (0, 0);
|
||||
desktop_restored = true;
|
||||
}
|
||||
|
|
|
@ -119,8 +119,9 @@ qboolean mlooking;
|
|||
|
||||
void IN_MLookDown (void) { mlooking = true; }
|
||||
void IN_MLookUp (void) {
|
||||
mlooking = false;
|
||||
if (!freelook->value && lookspring->value)
|
||||
mlooking = false;
|
||||
// if (!freelook->value && lookspring->value)
|
||||
if (!freelook->integer && lookspring->integer)
|
||||
IN_CenterView ();
|
||||
}
|
||||
|
||||
|
@ -155,7 +156,8 @@ void IN_ActivateMouse (void)
|
|||
|
||||
if (!mouseinitialized)
|
||||
return;
|
||||
if (!in_mouse->value)
|
||||
// if (!in_mouse->value)
|
||||
if (!in_mouse->integer)
|
||||
{
|
||||
mouseactive = false;
|
||||
return;
|
||||
|
@ -165,7 +167,8 @@ void IN_ActivateMouse (void)
|
|||
|
||||
mouseactive = true;
|
||||
|
||||
if (m_noaccel->value)
|
||||
// if (m_noaccel->value)
|
||||
if (m_noaccel->integer)
|
||||
newmouseparms[2]=0; //sul XP fix?
|
||||
else
|
||||
newmouseparms[2]=1;
|
||||
|
@ -242,7 +245,8 @@ void IN_StartupMouse (void)
|
|||
|
||||
cv = Cvar_Get ("in_initmouse", "1", CVAR_NOSET);
|
||||
Cvar_SetDescription ("in_initmouse", "Enables the initialization of the mouse.");
|
||||
if ( !cv->value )
|
||||
// if ( !cv->value )
|
||||
if ( !cv->integer )
|
||||
return;
|
||||
|
||||
// Knightmare- added Psychospaz's menu mouse support
|
||||
|
@ -351,7 +355,8 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
return;
|
||||
#endif
|
||||
|
||||
if (m_filter->value)
|
||||
// if (m_filter->value)
|
||||
if (m_filter->integer)
|
||||
{
|
||||
mouse_x = (mx + old_mouse_x) * 0.5;
|
||||
mouse_y = (my + old_mouse_y) * 0.5;
|
||||
|
@ -387,8 +392,9 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
ui_mousecursor.oldx = 0;
|
||||
ui_mousecursor.oldy = 0;
|
||||
|
||||
//psychospaz - zooming in preserves sensitivity
|
||||
if (in_autosensitivity->value && cl.base_fov < 90)
|
||||
// psychospaz - zooming in preserves sensitivity
|
||||
// if (in_autosensitivity->value && cl.base_fov < 90)
|
||||
if (in_autosensitivity->integer && cl.base_fov < 90)
|
||||
{
|
||||
mouse_x *= sensitivity->value * (cl.base_fov/90.0);
|
||||
mouse_y *= sensitivity->value * (cl.base_fov/90.0);
|
||||
|
@ -400,12 +406,14 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
}
|
||||
|
||||
// add mouse X/Y movement to cmd
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && mlooking ))
|
||||
// if ( (in_strafe.state & 1) || (lookstrafe->value && mlooking ))
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->integer && mlooking ))
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw->value * mouse_x;
|
||||
|
||||
if ( (mlooking || freelook->value) && !(in_strafe.state & 1))
|
||||
// if ( (mlooking || freelook->value) && !(in_strafe.state & 1))
|
||||
if ( (mlooking || freelook->integer) && !(in_strafe.state & 1))
|
||||
{
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
}
|
||||
|
@ -627,7 +635,8 @@ void IN_StartupJoystick (void)
|
|||
// abort startup if user requests no joystick
|
||||
cv = Cvar_Get ("in_initjoy", "1", CVAR_NOSET);
|
||||
Cvar_SetDescription ("in_initjoy", "Enables the initialization of the joystick.");
|
||||
if ( !cv->value )
|
||||
// if ( !cv->value )
|
||||
if ( !cv->integer )
|
||||
return;
|
||||
|
||||
// verify joystick driver is present
|
||||
|
@ -898,7 +907,8 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
}
|
||||
|
||||
// verify joystick is available and that the user wants to use it
|
||||
if (!joy_avail || !in_joystick->value)
|
||||
// if (!joy_avail || !in_joystick->value)
|
||||
if (!joy_avail || !in_joystick->integer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -945,7 +955,8 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (in_autosensitivity->value && cl.base_fov < 90) // Knightmare added
|
||||
// if (in_autosensitivity->value && cl.base_fov < 90) // Knightmare added
|
||||
if (in_autosensitivity->integer && cl.base_fov < 90) // Knightmare added
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity->value * (cl.base_fov/90.0)) * aspeed * cl_pitchspeed->value;
|
||||
else
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity->value) * aspeed * cl_pitchspeed->value;
|
||||
|
@ -992,14 +1003,16 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
{
|
||||
if(dwControlMap[i] == JOY_ABSOLUTE_AXIS)
|
||||
{
|
||||
if (in_autosensitivity->value && cl.base_fov < 90) // Knightmare added
|
||||
// if (in_autosensitivity->value && cl.base_fov < 90) // Knightmare added
|
||||
if (in_autosensitivity->integer && cl.base_fov < 90) // Knightmare added
|
||||
cl.viewangles[YAW] += (fAxisValue * joy_yawsensitivity->value * (cl.base_fov/90.0)) * aspeed * cl_yawspeed->value;
|
||||
else
|
||||
cl.viewangles[YAW] += (fAxisValue * joy_yawsensitivity->value) * aspeed * cl_yawspeed->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (in_autosensitivity->value && cl.base_fov < 90) // Knightmare added
|
||||
// if (in_autosensitivity->value && cl.base_fov < 90) // Knightmare added
|
||||
if (in_autosensitivity->integer && cl.base_fov < 90) // Knightmare added
|
||||
cl.viewangles[YAW] += (fAxisValue * joy_yawsensitivity->value * (cl.base_fov/90.0)) * speed * 180.0;
|
||||
else
|
||||
cl.viewangles[YAW] += (fAxisValue * joy_yawsensitivity->value) * speed * 180.0;
|
||||
|
@ -1017,14 +1030,16 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
// pitch movement detected and pitch movement desired by user
|
||||
if(dwControlMap[i] == JOY_ABSOLUTE_AXIS)
|
||||
{
|
||||
if (in_autosensitivity->value && cl.base_fov < 90) // Knightmare added
|
||||
// if (in_autosensitivity->value && cl.base_fov < 90) // Knightmare added
|
||||
if (in_autosensitivity->integer && cl.base_fov < 90) // Knightmare added
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity->value * (cl.base_fov/90.0)) * aspeed * cl_pitchspeed->value;
|
||||
else
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity->value) * aspeed * cl_pitchspeed->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (in_autosensitivity->value && cl.base_fov < 90) // Knightmare added
|
||||
// if (in_autosensitivity->value && cl.base_fov < 90) // Knightmare added
|
||||
if (in_autosensitivity->integer && cl.base_fov < 90) // Knightmare added
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity->value * (cl.base_fov/90.0)) * speed * 180.0;
|
||||
else
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity->value) * speed * 180.0;
|
||||
|
|
|
@ -353,7 +353,7 @@ void NET_SendLoopPacket (netsrc_t sock, int length, void *data, netadr_t to)
|
|||
//=============================================================================
|
||||
void SV_DropClientFromAdr (netadr_t address);
|
||||
|
||||
qboolean NET_GetPacket (netsrc_t sock, netadr_t *net_from, sizebuf_t *net_message)
|
||||
qboolean NET_GetPacket (netsrc_t sock, netadr_t *net_from, sizebuf_t *net_message)
|
||||
{
|
||||
int ret;
|
||||
struct sockaddr from;
|
||||
|
@ -402,7 +402,7 @@ qboolean NET_GetPacket (netsrc_t sock, netadr_t *net_from, sizebuf_t *net_messag
|
|||
SV_DropClientFromAdr (*net_from);
|
||||
continue;
|
||||
}
|
||||
//if (dedicated->value) // let dedicated servers continue after errors
|
||||
//if (dedicated->integer) // let dedicated servers continue after errors
|
||||
// let servers continue after errors
|
||||
Com_Printf ("NET_GetPacket: %s from %s\n", NET_ErrorString(),
|
||||
NET_AdrToString(*net_from));
|
||||
|
@ -485,7 +485,8 @@ void NET_SendPacket (netsrc_t sock, int length, void *data, netadr_t to)
|
|||
&& ((to.type == NA_BROADCAST) || (to.type == NA_BROADCAST_IPX)))
|
||||
return;
|
||||
|
||||
if (dedicated->value) // let dedicated servers continue after errors
|
||||
// if (dedicated->value) // let dedicated servers continue after errors
|
||||
if (dedicated->integer) // let dedicated servers continue after errors
|
||||
{
|
||||
Com_Printf ("NET_SendPacket ERROR: %s to %s\n", NET_ErrorString(),
|
||||
NET_AdrToString (to));
|
||||
|
@ -755,22 +756,25 @@ void NET_Config (qboolean multiplayer)
|
|||
}
|
||||
else
|
||||
{ // open sockets
|
||||
if (! noudp->value)
|
||||
// if (! noudp->value)
|
||||
if (! noudp->integer)
|
||||
NET_OpenIP ();
|
||||
if (! noipx->value)
|
||||
// if (! noipx->value)
|
||||
if (! noipx->integer)
|
||||
NET_OpenIPX ();
|
||||
}
|
||||
}
|
||||
|
||||
// sleeps msec or until net socket is ready
|
||||
void NET_Sleep(int msec)
|
||||
void NET_Sleep (int msec)
|
||||
{
|
||||
struct timeval timeout;
|
||||
fd_set fdset;
|
||||
extern cvar_t *dedicated;
|
||||
int i;
|
||||
|
||||
if (!dedicated || !dedicated->value)
|
||||
// if (!dedicated || !dedicated->value)
|
||||
if (!dedicated || !dedicated->integer)
|
||||
return; // we're not a server, just run full speed
|
||||
|
||||
FD_ZERO(&fdset);
|
||||
|
|
|
@ -114,7 +114,8 @@ Sys_InitConsole
|
|||
*/
|
||||
void Sys_InitConsole (void)
|
||||
{
|
||||
if (!dedicated->value)
|
||||
// if (!dedicated->value)
|
||||
if (!dedicated->integer)
|
||||
return;
|
||||
|
||||
if (!AllocConsole ())
|
||||
|
@ -138,7 +139,8 @@ char *Sys_ConsoleInput (void)
|
|||
int dummy;
|
||||
int ch, numread, numevents;
|
||||
|
||||
if (!dedicated || !dedicated->value)
|
||||
// if (!dedicated || !dedicated->value)
|
||||
if (!dedicated || !dedicated->integer)
|
||||
return NULL;
|
||||
|
||||
for ( ;; )
|
||||
|
@ -213,7 +215,8 @@ void Sys_ConsoleOutput (char *string)
|
|||
int dummy;
|
||||
char text[256];
|
||||
|
||||
if (!dedicated || !dedicated->value)
|
||||
// if (!dedicated || !dedicated->value)
|
||||
if (!dedicated || !dedicated->integer)
|
||||
return;
|
||||
|
||||
if (console_textlen)
|
||||
|
@ -231,6 +234,12 @@ void Sys_ConsoleOutput (char *string)
|
|||
WriteFile(houtput, console_text, console_textlen, &dummy, NULL);
|
||||
}
|
||||
|
||||
void Sys_ShowConsole (qboolean show)
|
||||
{
|
||||
if (!show)
|
||||
Sys_RemoveStartupLogo ();
|
||||
}
|
||||
|
||||
//================================================================
|
||||
#endif // NEW_DED_CONSOLE
|
||||
|
||||
|
@ -352,7 +361,8 @@ void Sys_Quit (void)
|
|||
CL_Shutdown();
|
||||
Qcommon_Shutdown ();
|
||||
CloseHandle (qwclsemaphore);
|
||||
if (dedicated && dedicated->value)
|
||||
// if (dedicated && dedicated->value)
|
||||
if (dedicated && dedicated->integer)
|
||||
FreeConsole ();
|
||||
|
||||
#ifdef NEW_DED_CONSOLE
|
||||
|
@ -1571,6 +1581,45 @@ void ParseCommandLine (LPSTR lpCmdLine)
|
|||
}
|
||||
}
|
||||
|
||||
// Knightmare- startup logo, code from TomazQuake
|
||||
#ifndef NEW_DED_CONSOLE
|
||||
HWND hwnd_dialog; // Knightmare added
|
||||
qboolean logoRemoved = false;
|
||||
|
||||
void Sys_CreateStartupLogo (void)
|
||||
{
|
||||
// if (!(dedicated && dedicated->integer))
|
||||
{
|
||||
hwnd_dialog = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, NULL);
|
||||
RECT rect; // Knightmare added
|
||||
|
||||
if (hwnd_dialog)
|
||||
{
|
||||
if (GetWindowRect (hwnd_dialog, &rect))
|
||||
{
|
||||
if (rect.left > (rect.top * 2))
|
||||
{
|
||||
SetWindowPos (hwnd_dialog, 0, (rect.left/2) - ((rect.right - rect.left)/2), rect.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
|
||||
}
|
||||
}
|
||||
|
||||
ShowWindow (hwnd_dialog, SW_SHOWDEFAULT);
|
||||
UpdateWindow (hwnd_dialog);
|
||||
SetForegroundWindow (hwnd_dialog);
|
||||
}
|
||||
}
|
||||
// end Knightmare
|
||||
}
|
||||
|
||||
void Sys_RemoveStartupLogo (void)
|
||||
{
|
||||
if (!logoRemoved) {
|
||||
DestroyWindow (hwnd_dialog);
|
||||
logoRemoved = true;
|
||||
}
|
||||
}
|
||||
#endif // NEW_DED_CONSOLE
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
|
@ -2005,7 +2054,6 @@ WinMain
|
|||
==================
|
||||
*/
|
||||
HINSTANCE global_hInstance;
|
||||
HWND hwnd_dialog; // Knightmare added
|
||||
|
||||
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
|
@ -2030,35 +2078,12 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
|
|||
|
||||
Init_ExeDir (); // Knightmare added
|
||||
|
||||
#ifndef NEW_DED_CONSOLE
|
||||
// Knightmare- startup logo, code from TomazQuake
|
||||
//if (!(dedicated && dedicated->value))
|
||||
{
|
||||
hwnd_dialog = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, NULL);
|
||||
RECT rect; // Knightmare added
|
||||
|
||||
if (hwnd_dialog)
|
||||
{
|
||||
if (GetWindowRect (hwnd_dialog, &rect))
|
||||
{
|
||||
if (rect.left > (rect.top * 2))
|
||||
{
|
||||
SetWindowPos (hwnd_dialog, 0, (rect.left/2) - ((rect.right - rect.left)/2), rect.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
|
||||
}
|
||||
}
|
||||
|
||||
ShowWindow (hwnd_dialog, SW_SHOWDEFAULT);
|
||||
UpdateWindow (hwnd_dialog);
|
||||
SetForegroundWindow (hwnd_dialog);
|
||||
}
|
||||
}
|
||||
// end Knightmare
|
||||
#endif
|
||||
|
||||
#ifdef NEW_DED_CONSOLE // init debug console
|
||||
Sys_InitDedConsole ();
|
||||
Com_Printf("KMQ2 %4.2f %s %s %s %s\n", VERSION, CPUSTRING, OS_STRING, COMPILETYPE_STRING, __DATE__);
|
||||
#endif
|
||||
#else
|
||||
Sys_CreateStartupLogo ();
|
||||
#endif // NEW_DED_CONSOLE
|
||||
|
||||
// Knightmare- scan for cd command line option
|
||||
for (i=0; i<argc; i++)
|
||||
|
@ -2095,7 +2120,8 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
|
|||
while (1)
|
||||
{
|
||||
// if at a full screen console, don't update unless needed
|
||||
if (Minimized || (dedicated && dedicated->value) )
|
||||
// if (Minimized || (dedicated && dedicated->value) )
|
||||
if (Minimized || (dedicated && dedicated->integer) )
|
||||
{
|
||||
Sleep (1);
|
||||
}
|
||||
|
|
|
@ -267,7 +267,7 @@ int MapKey (int key)
|
|||
}
|
||||
}
|
||||
|
||||
void AppActivate(BOOL fActive, BOOL minimize)
|
||||
void AppActivate (BOOL fActive, BOOL minimize)
|
||||
{
|
||||
Minimized = minimize;
|
||||
|
||||
|
@ -286,7 +286,8 @@ void AppActivate(BOOL fActive, BOOL minimize)
|
|||
CDAudio_Activate (false);
|
||||
S_Activate (false);
|
||||
|
||||
if ( win_noalttab->value )
|
||||
// if ( win_noalttab->value )
|
||||
if ( win_noalttab->integer )
|
||||
{
|
||||
WIN_EnableAltTab();
|
||||
}
|
||||
|
@ -296,7 +297,8 @@ void AppActivate(BOOL fActive, BOOL minimize)
|
|||
IN_Activate (true);
|
||||
CDAudio_Activate (true);
|
||||
S_Activate (true);
|
||||
if ( win_noalttab->value )
|
||||
// if ( win_noalttab->value )
|
||||
if ( win_noalttab->integer )
|
||||
{
|
||||
WIN_DisableAltTab();
|
||||
}
|
||||
|
@ -390,7 +392,8 @@ LONG WINAPI MainWndProc (
|
|||
RECT r;
|
||||
int style;
|
||||
|
||||
if (!vid_fullscreen->value)
|
||||
// if (!vid_fullscreen->value)
|
||||
if (!vid_fullscreen->integer)
|
||||
{
|
||||
xPos = (short) LOWORD(lParam); // horizontal position
|
||||
yPos = (short) HIWORD(lParam); // vertical position
|
||||
|
@ -479,7 +482,8 @@ LONG WINAPI MainWndProc (
|
|||
{
|
||||
if ( vid_fullscreen )
|
||||
{
|
||||
Cvar_SetValue( "vid_fullscreen", !vid_fullscreen->value );
|
||||
// Cvar_SetValue( "vid_fullscreen", !vid_fullscreen->value );
|
||||
Cvar_SetValue( "vid_fullscreen", !vid_fullscreen->integer );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -548,8 +552,10 @@ qboolean VID_GetModeInfo (int *width, int *height, int mode)
|
|||
{
|
||||
if (mode == -1) // custom mode
|
||||
{
|
||||
*width = r_customwidth->value;
|
||||
*height = r_customheight->value;
|
||||
// *width = r_customwidth->value;
|
||||
// *height = r_customheight->value;
|
||||
*width = r_customwidth->integer;
|
||||
*height = r_customheight->integer;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -585,7 +591,8 @@ void VID_UpdateWindowPosAndSize ( int x, int y )
|
|||
w = r.right - r.left;
|
||||
h = r.bottom - r.top;
|
||||
|
||||
MoveWindow( cl_hwnd, vid_xpos->value, vid_ypos->value, w, h, TRUE );
|
||||
// MoveWindow( cl_hwnd, vid_xpos->value, vid_ypos->value, w, h, TRUE );
|
||||
MoveWindow (cl_hwnd, vid_xpos->integer, vid_ypos->integer, w, h, TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -702,7 +709,8 @@ void VID_CheckChanges (void)
|
|||
{
|
||||
if ( win_noalttab->modified )
|
||||
{
|
||||
if ( win_noalttab->value )
|
||||
// if ( win_noalttab->value )
|
||||
if ( win_noalttab->integer )
|
||||
WIN_DisableAltTab();
|
||||
else
|
||||
WIN_EnableAltTab();
|
||||
|
@ -715,8 +723,10 @@ void VID_CheckChanges (void)
|
|||
// update our window position
|
||||
if ( vid_xpos->modified || vid_ypos->modified )
|
||||
{
|
||||
if (!vid_fullscreen->value)
|
||||
VID_UpdateWindowPosAndSize( vid_xpos->value, vid_ypos->value );
|
||||
// if (!vid_fullscreen->value)
|
||||
// VID_UpdateWindowPosAndSize( vid_xpos->value, vid_ypos->value );
|
||||
if (!vid_fullscreen->integer)
|
||||
VID_UpdateWindowPosAndSize( vid_xpos->integer, vid_ypos->integer );
|
||||
|
||||
vid_xpos->modified = false;
|
||||
vid_ypos->modified = false;
|
||||
|
|
Loading…
Reference in a new issue