Elite Force white space clean up

Also fixed some code to match ioq3 (a few comments, a printf, ..).
This commit is contained in:
Zack Middleton 2014-10-29 10:13:04 -05:00
parent 80986cbf21
commit b7cd6b6088
33 changed files with 163 additions and 129 deletions

View file

@ -114,3 +114,4 @@ void BotSetChatName(int chatstate, char *name);
#else #else
void BotSetChatName(int chatstate, char *name, int client); void BotSetChatName(int chatstate, char *name, int client);
#endif #endif

View file

@ -172,9 +172,10 @@ typedef enum {
CG_GETCAMERAINFO, CG_GETCAMERAINFO,
*/ */
#else #else
CG_R_REGISTERSHADER3D, //59 CG_R_REGISTERSHADER3D, //59
CG_CVAR_SET_NO_MODIFY, // 60 CG_CVAR_SET_NO_MODIFY, // 60
#endif #endif
CG_MEMSET = 100, CG_MEMSET = 100,
CG_MEMCPY, CG_MEMCPY,
CG_STRNCPY, CG_STRNCPY,
@ -231,6 +232,7 @@ typedef enum {
CG_LAST_ATTACKER, CG_LAST_ATTACKER,
// int (*CG_LastAttacker)( void ); // int (*CG_LastAttacker)( void );
#ifndef ELITEFORCE #ifndef ELITEFORCE
CG_KEY_EVENT, CG_KEY_EVENT,
// void (*CG_KeyEvent)( int key, qboolean down ); // void (*CG_KeyEvent)( int key, qboolean down );

View file

@ -549,11 +549,11 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
return S_RegisterSound( VMA(1), args[2] ); return S_RegisterSound( VMA(1), args[2] );
case CG_S_STARTBACKGROUNDTRACK: case CG_S_STARTBACKGROUNDTRACK:
#ifdef ELITEFORCE #ifdef ELITEFORCE
if(!VMA(1) || !*((char *) VMA(1))) if ( !VMA(1) || !*((char *) VMA(1)) )
S_StopBackgroundTrack(); S_StopBackgroundTrack();
else else
#endif #endif
S_StartBackgroundTrack(VMA(1), VMA(2)); S_StartBackgroundTrack( VMA(1), VMA(2) );
return 0; return 0;
case CG_R_LOADWORLDMAP: case CG_R_LOADWORLDMAP:
re.LoadWorld( VMA(1) ); re.LoadWorld( VMA(1) );
@ -645,6 +645,7 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
#endif #endif
case CG_MEMSET: case CG_MEMSET:
Com_Memset( VMA(1), args[2], args[3] ); Com_Memset( VMA(1), args[2], args[3] );
return 0; return 0;
@ -669,6 +670,7 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
#ifndef ELITEFORCE #ifndef ELITEFORCE
case CG_ACOS: case CG_ACOS:
return FloatAsInt( Q_acos( VMF(1) ) ); return FloatAsInt( Q_acos( VMF(1) ) );
case CG_PC_ADD_GLOBAL_DEFINE: case CG_PC_ADD_GLOBAL_DEFINE:
return botlib_export->PC_AddGlobalDefine( VMA(1) ); return botlib_export->PC_AddGlobalDefine( VMA(1) );
case CG_PC_LOAD_SOURCE: case CG_PC_LOAD_SOURCE:
@ -732,6 +734,7 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
case CG_CVAR_SET_NO_MODIFY: case CG_CVAR_SET_NO_MODIFY:
return qfalse; return qfalse;
#endif #endif
default: default:
assert(0); assert(0);
Com_Error( ERR_DROP, "Bad cgame system trap: %ld", (long int) args[0] ); Com_Error( ERR_DROP, "Bad cgame system trap: %ld", (long int) args[0] );

View file

@ -665,7 +665,6 @@ void Con_DrawSolidConsole( float frac ) {
// draw the background // draw the background
y = frac * SCREEN_HEIGHT; y = frac * SCREEN_HEIGHT;
if ( y < 1 ) { if ( y < 1 ) {
y = 0; y = 0;
} }
@ -685,6 +684,8 @@ void Con_DrawSolidConsole( float frac ) {
color[2] = 0; color[2] = 0;
color[3] = 1; color[3] = 1;
SCR_FillRect( 0, y, SCREEN_WIDTH, 2, color ); SCR_FillRect( 0, y, SCREEN_WIDTH, 2, color );
// draw the version number // draw the version number
re.SetColor( g_color_table[ColorIndex(COLOR_RED)] ); re.SetColor( g_color_table[ColorIndex(COLOR_RED)] );

View file

@ -1252,6 +1252,7 @@ void CL_KeyDownEvent( int key, unsigned time )
return; return;
} }
#endif #endif
if ( !( Key_GetCatcher( ) & KEYCATCH_UI ) ) { if ( !( Key_GetCatcher( ) & KEYCATCH_UI ) ) {
if ( clc.state == CA_ACTIVE && !clc.demoplaying ) { if ( clc.state == CA_ACTIVE && !clc.demoplaying ) {
VM_Call( uivm, UI_SET_ACTIVE_MENU, UIMENU_INGAME ); VM_Call( uivm, UI_SET_ACTIVE_MENU, UIMENU_INGAME );
@ -1263,6 +1264,7 @@ void CL_KeyDownEvent( int key, unsigned time )
} }
return; return;
} }
#ifdef ELITEFORCE #ifdef ELITEFORCE
VM_Call( uivm, UI_KEY_EVENT, key ); VM_Call( uivm, UI_KEY_EVENT, key );
#else #else

View file

@ -733,7 +733,6 @@ void CL_Record_f( void ) {
if ( Cmd_Argc() == 2 ) { if ( Cmd_Argc() == 2 ) {
s = Cmd_Argv(1); s = Cmd_Argv(1);
Q_strncpyz( demoName, s, sizeof( demoName ) ); Q_strncpyz( demoName, s, sizeof( demoName ) );
#ifdef LEGACY_PROTOCOL #ifdef LEGACY_PROTOCOL
if(clc.compat) if(clc.compat)
#ifdef ELITEFORCE #ifdef ELITEFORCE
@ -2432,7 +2431,7 @@ void CL_CheckForResend( void ) {
data[10+i] = 0; data[10+i] = 0;
// NOTE TTimo don't forget to set the right data length! // NOTE TTimo don't forget to set the right data length!
#ifdef ELITEFORCE #ifdef ELITEFORCE
NET_OutOfBandPrint( NS_CLIENT, clc.serverAddress, "%s", data); NET_OutOfBandPrint( NS_CLIENT, clc.serverAddress, "%s", data);
#else #else
NET_OutOfBandData( NS_CLIENT, clc.serverAddress, (byte *) &data[0], i+10 ); NET_OutOfBandData( NS_CLIENT, clc.serverAddress, (byte *) &data[0], i+10 );
@ -2603,6 +2602,7 @@ void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extend
addresses[numservers].port += *buffptr++; addresses[numservers].port += *buffptr++;
addresses[numservers].port = BigShort( addresses[numservers].port ); addresses[numservers].port = BigShort( addresses[numservers].port );
#endif #endif
// syntax check // syntax check
if (*buffptr != '\\' && *buffptr != '/') if (*buffptr != '\\' && *buffptr != '/')
break; break;

View file

@ -37,7 +37,6 @@ CL_Netchan_Encode
============== ==============
*/ */
static void CL_Netchan_Encode( msg_t *msg ) { static void CL_Netchan_Encode( msg_t *msg ) {
int serverId, messageAcknowledge, reliableAcknowledge; int serverId, messageAcknowledge, reliableAcknowledge;
int i, index, srdc, sbit, soob; int i, index, srdc, sbit, soob;
@ -92,7 +91,6 @@ CL_Netchan_Decode
============== ==============
*/ */
static void CL_Netchan_Decode( msg_t *msg ) { static void CL_Netchan_Decode( msg_t *msg ) {
long reliableAcknowledge, i, index; long reliableAcknowledge, i, index;
byte key, *string; byte key, *string;
@ -186,6 +184,7 @@ qboolean CL_Netchan_Process( netchan_t *chan, msg_t *msg ) {
ret = Netchan_Process( chan, msg ); ret = Netchan_Process( chan, msg );
if (!ret) if (!ret)
return qfalse; return qfalse;
#ifndef ELITEFORCE #ifndef ELITEFORCE
#ifdef LEGACY_PROTOCOL #ifdef LEGACY_PROTOCOL
if(chan->compat) if(chan->compat)

View file

@ -486,7 +486,7 @@ void CL_ParseGamestate( msg_t *msg ) {
cmd = MSG_ReadByte( msg ); cmd = MSG_ReadByte( msg );
#ifdef ELITEFORCE #ifdef ELITEFORCE
if((msg->compat && cmd <= 0) || cmd == svc_EOF) if ( ( msg->compat && cmd <= 0 ) || cmd == svc_EOF )
#else #else
if ( cmd == svc_EOF ) if ( cmd == svc_EOF )
#endif #endif
@ -913,7 +913,7 @@ void CL_ParseServerMessage( msg_t *msg ) {
cmd = MSG_ReadByte( msg ); cmd = MSG_ReadByte( msg );
#ifdef ELITEFORCE #ifdef ELITEFORCE
if(cmd == svc_EOF || (msg->compat && cmd == -1)) if ( cmd == svc_EOF || ( msg->compat && cmd == -1 ) )
#else #else
if ( cmd == svc_EOF) if ( cmd == svc_EOF)
#endif #endif

View file

@ -84,6 +84,7 @@ void LAN_SaveServersToCache( void ) {
FS_FCloseFile(fileOut); FS_FCloseFile(fileOut);
} }
#ifndef ELITEFORCE #ifndef ELITEFORCE
/* /*
==================== ====================
@ -206,6 +207,7 @@ static void LAN_RemoveServer(int source, const char *addr) {
} }
#endif #endif
/* /*
==================== ====================
LAN_GetServerCount LAN_GetServerCount
@ -226,6 +228,7 @@ static int LAN_GetServerCount( int source ) {
} }
return 0; return 0;
} }
/* /*
==================== ====================
LAN_GetLocalServerAddressString LAN_GetLocalServerAddressString
@ -365,6 +368,7 @@ static serverInfo_t *LAN_GetServerPtr( int source, int n ) {
} }
return NULL; return NULL;
} }
/* /*
==================== ====================
LAN_CompareServers LAN_CompareServers
@ -631,7 +635,7 @@ static void Key_GetBindingBuf( int keynum, char *buf, int buflen ) {
CLUI_GetCDKey CLUI_GetCDKey
==================== ====================
*/ */
#ifndef ELITEFORCE #ifndef ELITEFORCE
static void CLUI_GetCDKey( char *buf, int buflen ) { static void CLUI_GetCDKey( char *buf, int buflen ) {
#ifndef STANDALONE #ifndef STANDALONE
cvar_t *fs; cvar_t *fs;
@ -647,7 +651,8 @@ static void CLUI_GetCDKey( char *buf, int buflen ) {
*buf = 0; *buf = 0;
#endif #endif
} }
#endif #endif
/* /*
==================== ====================
@ -966,6 +971,7 @@ intptr_t CL_UISystemCalls( intptr_t *args ) {
case UI_LAN_GETSERVERADDRESSSTRING: case UI_LAN_GETSERVERADDRESSSTRING:
LAN_GetServerAddressString( args[1], args[2], VMA(3), args[4] ); LAN_GetServerAddressString( args[1], args[2], VMA(3), args[4] );
return 0; return 0;
case UI_LAN_GETSERVERINFO: case UI_LAN_GETSERVERINFO:
LAN_GetServerInfo( args[1], args[2], VMA(3), args[4] ); LAN_GetServerInfo( args[1], args[2], VMA(3), args[4] );
return 0; return 0;
@ -1002,6 +1008,7 @@ intptr_t CL_UISystemCalls( intptr_t *args ) {
CLUI_GetCDKey( VMA(1), args[2] ); CLUI_GetCDKey( VMA(1), args[2] );
return 0; return 0;
#endif #endif
case UI_SET_CDKEY: case UI_SET_CDKEY:
#ifndef STANDALONE #ifndef STANDALONE
CLUI_SetCDKey( VMA(1) ); CLUI_SetCDKey( VMA(1) );
@ -1010,6 +1017,7 @@ intptr_t CL_UISystemCalls( intptr_t *args ) {
#endif #endif
#endif #endif
return 0; return 0;
#ifndef ELITEFORCE #ifndef ELITEFORCE
case UI_SET_PBCLSTATUS: case UI_SET_PBCLSTATUS:
return 0; return 0;

View file

@ -575,7 +575,7 @@ void SCR_DrawNamedPic( float x, float y, float width, float height, const char *
void SCR_DrawBigString( int x, int y, const char *s, float alpha, qboolean noColorEscape ); // draws a string with embedded color control characters with fade void SCR_DrawBigString( int x, int y, const char *s, float alpha, qboolean noColorEscape ); // draws a string with embedded color control characters with fade
void SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color, qboolean noColorEscape ); // ignores embedded color control characters void SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color, qboolean noColorEscape ); // ignores embedded color control characters
#ifdef ELITEFORCE #ifdef ELITEFORCE
void SCR_DrawSmallString( int x, int y, const char *s, float alpha ); // draws a string with embedded color control characters with fade void SCR_DrawSmallString( int x, int y, const char *s, float alpha ); // draws a string with embedded color control characters with fade
#endif #endif
void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor, qboolean forceColor, qboolean noColorEscape ); void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor, qboolean forceColor, qboolean noColorEscape );
void SCR_DrawSmallChar( int x, int y, int ch ); void SCR_DrawSmallChar( int x, int y, int ch );

View file

@ -200,7 +200,6 @@ void S_CodecRegister(snd_codec_t *codec)
S_CodecLoad S_CodecLoad
================= =================
*/ */
void *S_CodecLoad(const char *filename, snd_info_t *info) void *S_CodecLoad(const char *filename, snd_info_t *info)
{ {
return S_CodecGetSound(filename, info); return S_CodecGetSound(filename, info);

View file

@ -375,7 +375,7 @@ sfxHandle_t S_Base_RegisterSound( const char *name, qboolean compressed ) {
sfx->inMemory = qfalse; sfx->inMemory = qfalse;
sfx->soundCompressed = compressed; sfx->soundCompressed = compressed;
S_memoryLoad(sfx); S_memoryLoad(sfx);
if ( sfx->defaultSound ) { if ( sfx->defaultSound ) {
#ifdef ELITEFORCE #ifdef ELITEFORCE

View file

@ -540,8 +540,8 @@ sfxHandle_t S_AL_RegisterSound( const char *sample, qboolean compressed )
S_AL_BufferLoad(sfx, s_alPrecache->integer); S_AL_BufferLoad(sfx, s_alPrecache->integer);
#ifdef ELITEFORCE #ifdef ELITEFORCE
if(! *knownSfx[sfx].filename) if (!*knownSfx[sfx].filename)
return 0; return 0;
#endif #endif
knownSfx[sfx].lastUsedTime = Com_Milliseconds(); knownSfx[sfx].lastUsedTime = Com_Milliseconds();

View file

@ -677,6 +677,7 @@ typedef enum {
} gameImport_t; } gameImport_t;
#endif #endif
// //
// functions exported by the game subsystem // functions exported by the game subsystem
// //

View file

@ -2456,6 +2456,7 @@ void Com_ReadCDKey( const char *filename ) {
fileHandle_t f; fileHandle_t f;
char buffer[33]; char buffer[33];
char fbuffer[MAX_OSPATH]; char fbuffer[MAX_OSPATH];
#ifdef ELITEFORCE #ifdef ELITEFORCE
int index = 0; int index = 0;
char curchar; char curchar;
@ -2585,17 +2586,20 @@ static void Com_WriteCDKey( const char *filename, const char *ikey ) {
mode_t savedumask; mode_t savedumask;
#endif #endif
#ifdef ELITEFORCE #ifdef ELITEFORCE
sprintf(fbuffer, "%s/efq3.key", filename); sprintf(fbuffer, "%s/efq3.key", filename);
#else #else
Com_sprintf(fbuffer, sizeof(fbuffer), "%s/q3key", filename); Com_sprintf(fbuffer, sizeof(fbuffer), "%s/q3key", filename);
#endif #endif
#ifdef ELITEFORCE #ifdef ELITEFORCE
Q_strncpyz( key, ikey, 23 ); Q_strncpyz( key, ikey, 23 );
key[22] = '\0'; key[22] = '\0';
#else #else
Q_strncpyz( key, ikey, 17 ); Q_strncpyz( key, ikey, 17 );
if(!CL_CDKeyValidate(key, NULL) ) { if(!CL_CDKeyValidate(key, NULL) ) {
return; return;
} }

View file

@ -3410,7 +3410,6 @@ static void FS_CheckPak0( void )
{ {
if(pakBasename[3] == '0') if(pakBasename[3] == '0')
{ {
Com_Printf("\n\n" Com_Printf("\n\n"
"**************************************************\n" "**************************************************\n"
"WARNING: " BASEGAME "/pak0.pk3 is present but its checksum (%u)\n" "WARNING: " BASEGAME "/pak0.pk3 is present but its checksum (%u)\n"
@ -3476,11 +3475,13 @@ static void FS_CheckPak0( void )
"\"pak0.pk3\" is missing. Please copy it " "\"pak0.pk3\" is missing. Please copy it "
"from your legitimate EliteForce CDROM. "); "from your legitimate EliteForce CDROM. ");
} }
if((foundPak & 0x1fe) != 0x1fe) if((foundPak & 0x1fe) != 0x1fe)
{ {
Q_strcat(errorText, sizeof(errorText), Q_strcat(errorText, sizeof(errorText),
"Patch files are missing. Please\n" "Patch files are missing. Please\n"
"copy the .pk3 files from EliteForce patch 1.2 to baseEF.\n"); } "copy the .pk3 files from EliteForce patch 1.2 to baseEF.\n");
}
Q_strcat(errorText, sizeof(errorText), Q_strcat(errorText, sizeof(errorText),
va("Also check that your EliteForce executable is in " va("Also check that your EliteForce executable is in "
@ -3534,7 +3535,6 @@ static void FS_CheckPak0( void )
{ {
if(pakBasename[3] == '0') if(pakBasename[3] == '0')
{ {
Com_Printf("\n\n" Com_Printf("\n\n"
"**************************************************\n" "**************************************************\n"
"WARNING: " BASEGAME "/pak0.pk3 is present but its checksum (%u)\n" "WARNING: " BASEGAME "/pak0.pk3 is present but its checksum (%u)\n"
@ -3651,6 +3651,7 @@ static void FS_CheckPak0( void )
"\"pak0.pk3\" is missing. Please copy it " "\"pak0.pk3\" is missing. Please copy it "
"from your legitimate Q3 CDROM. "); "from your legitimate Q3 CDROM. ");
} }
if((foundPak & 0x1fe) != 0x1fe) if((foundPak & 0x1fe) != 0x1fe)
{ {
Q_strcat(errorText, sizeof(errorText), Q_strcat(errorText, sizeof(errorText),
@ -4227,7 +4228,6 @@ void FS_FilenameCompletion( const char *dir, const char *ext,
callback( filename ); callback( filename );
} }
FS_FreeFileList( filenames ); FS_FreeFileList( filenames );
} }
const char *FS_GetCurrentGameDir(void) const char *FS_GetCurrentGameDir(void)

View file

@ -320,6 +320,7 @@ int MSG_ReadBits( msg_t *msg, int bits ) {
} }
//================================================================================ //================================================================================
// //
@ -385,7 +386,7 @@ void MSG_WriteString( msg_t *sb, const char *s ) {
MSG_WriteData (sb, "", 1); MSG_WriteData (sb, "", 1);
} else { } else {
#ifdef ELITEFORCE #ifdef ELITEFORCE
int l; int l;
#else #else
int l,i; int l,i;
#endif #endif
@ -417,7 +418,7 @@ void MSG_WriteBigString( msg_t *sb, const char *s ) {
MSG_WriteData (sb, "", 1); MSG_WriteData (sb, "", 1);
} else { } else {
#ifdef ELITEFORCE #ifdef ELITEFORCE
int l; int l;
#else #else
int l,i; int l,i;
#endif #endif
@ -550,6 +551,7 @@ char *MSG_ReadString( msg_t *msg ) {
c = '.'; c = '.';
} }
#endif #endif
string[l] = c; string[l] = c;
l++; l++;
} while (l < sizeof(string)-1); } while (l < sizeof(string)-1);
@ -620,6 +622,7 @@ char *MSG_ReadStringLine( msg_t *msg ) {
c = '.'; c = '.';
} }
#endif #endif
string[l] = c; string[l] = c;
l++; l++;
} while (l < sizeof(string)-1); } while (l < sizeof(string)-1);
@ -838,11 +841,7 @@ void MSG_ReadDeltaUsercmd( msg_t *msg, usercmd_t *from, usercmd_t *to ) {
/* /*
===================== =====================
<<<<<<< Updated upstream
MSG_WriteDeltaUsercmd
=======
MSG_WriteDeltaUsercmdKey MSG_WriteDeltaUsercmdKey
>>>>>>> Stashed changes
===================== =====================
*/ */
void MSG_WriteDeltaUsercmdKey( msg_t *msg, int key, usercmd_t *from, usercmd_t *to ) { void MSG_WriteDeltaUsercmdKey( msg_t *msg, int key, usercmd_t *from, usercmd_t *to ) {
@ -884,7 +883,7 @@ void MSG_WriteDeltaUsercmdKey( msg_t *msg, int key, usercmd_t *from, usercmd_t *
/* /*
===================== =====================
MSG_ReadDeltaUsercmd MSG_ReadDeltaUsercmdKey
===================== =====================
*/ */
void MSG_ReadDeltaUsercmdKey( msg_t *msg, int key, usercmd_t *from, usercmd_t *to ) { void MSG_ReadDeltaUsercmdKey( msg_t *msg, int key, usercmd_t *from, usercmd_t *to ) {
@ -1112,6 +1111,7 @@ netField_t entityStateFields[] =
}; };
#endif #endif
// if (int)f == f and (int)f + ( 1<<(FLOAT_INT_BITS-1) ) < ( 1 << FLOAT_INT_BITS ) // if (int)f == f and (int)f + ( 1<<(FLOAT_INT_BITS-1) ) < ( 1 << FLOAT_INT_BITS )
// the float will be sent with FLOAT_INT_BITS, otherwise all 32 bits will be sent // the float will be sent with FLOAT_INT_BITS, otherwise all 32 bits will be sent
#define FLOAT_INT_BITS 13 #define FLOAT_INT_BITS 13
@ -1137,8 +1137,8 @@ void MSG_WriteDeltaEntity( msg_t *msg, struct entityState_s *from, struct entity
float fullFloat; float fullFloat;
int *fromF, *toF; int *fromF, *toF;
#ifdef ELITEFORCE #ifdef ELITEFORCE
byte vector[PVECTOR_BYTES]; byte vector[PVECTOR_BYTES];
int vectorIndex = -1; int vectorIndex = -1;
#endif #endif
numFields = ARRAY_LEN( entityStateFields ); numFields = ARRAY_LEN( entityStateFields );
@ -1163,7 +1163,7 @@ void MSG_WriteDeltaEntity( msg_t *msg, struct entityState_s *from, struct entity
Com_Error (ERR_FATAL, "MSG_WriteDeltaEntity: Bad entity number: %i", to->number ); Com_Error (ERR_FATAL, "MSG_WriteDeltaEntity: Bad entity number: %i", to->number );
} }
#ifdef ELITEFORCE #ifdef ELITEFORCE
if(msg->compat) if(msg->compat)
Com_Memset(vector, 0, sizeof(vector)); Com_Memset(vector, 0, sizeof(vector));
#endif #endif
@ -1337,9 +1337,9 @@ void MSG_ReadDeltaEntity( msg_t *msg, entityState_t *from, entityState_t *to,
int trunc; int trunc;
int startBit, endBit; int startBit, endBit;
#ifdef ELITEFORCE #ifdef ELITEFORCE
int vectorIndex; int vectorIndex;
byte vector_space[PVECTOR_BYTES]; byte vector_space[PVECTOR_BYTES];
byte *vector = vector_space; byte *vector = vector_space;
#endif #endif
if ( number < 0 || number >= MAX_GENTITIES) { if ( number < 0 || number >= MAX_GENTITIES) {
@ -1608,6 +1608,7 @@ netField_t playerStateFields[] =
{ PSF(loopSound), 16 } { PSF(loopSound), 16 }
}; };
#endif #endif
/* /*
============= =============
MSG_WriteDeltaPlayerstate MSG_WriteDeltaPlayerstate
@ -1830,8 +1831,8 @@ void MSG_ReadDeltaPlayerstate (msg_t *msg, playerState_t *from, playerState_t *t
{ {
lc = MSG_ReadByte(msg); lc = MSG_ReadByte(msg);
if(lc > numFields || lc < 0) if(lc > numFields || lc < 0)
Com_Error(ERR_DROP, "invalid entityState field count"); Com_Error(ERR_DROP, "invalid playerState field count");
} }
for ( i = 0, field = playerStateFields ; i < lc ; i++, field++ ) { for ( i = 0, field = playerStateFields ; i < lc ; i++, field++ ) {
@ -1883,6 +1884,7 @@ void MSG_ReadDeltaPlayerstate (msg_t *msg, playerState_t *from, playerState_t *t
} }
#endif #endif
// read the arrays // read the arrays
#ifdef ELITEFORCE #ifdef ELITEFORCE
if(msg->compat || MSG_ReadBits( msg, 1 )) if(msg->compat || MSG_ReadBits( msg, 1 ))

View file

@ -1158,9 +1158,9 @@ typedef struct playerState_s {
vec3_t velocity; vec3_t velocity;
int weaponTime; int weaponTime;
#ifdef ELITEFORCE #ifdef ELITEFORCE
int rechargeTime; // for the phaser int rechargeTime; // for the phaser
short useTime; // use debounce short useTime; // use debounce
int introTime; // for the holodoor int introTime; // for the holodoor
#endif #endif
int gravity; int gravity;
int speed; int speed;
@ -1263,11 +1263,11 @@ typedef struct playerState_s {
// usercmd_t is sent to the server each client frame // usercmd_t is sent to the server each client frame
#ifdef ELITEFORCE #ifdef ELITEFORCE
typedef struct usercmd_s { typedef struct usercmd_s {
int serverTime; int serverTime;
byte buttons; byte buttons;
byte weapon; byte weapon;
int angles[3]; int angles[3];
signed char forwardmove, rightmove, upmove; signed char forwardmove, rightmove, upmove;
} usercmd_t; } usercmd_t;
#else #else
typedef struct usercmd_s { typedef struct usercmd_s {
@ -1278,6 +1278,7 @@ typedef struct usercmd_s {
signed char forwardmove, rightmove, upmove; signed char forwardmove, rightmove, upmove;
} usercmd_t; } usercmd_t;
#endif #endif
//=================================================================== //===================================================================
// if entityState->solid == SOLID_BMODEL, modelindex is an inline model number // if entityState->solid == SOLID_BMODEL, modelindex is an inline model number

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define __TR_TYPES_H #define __TR_TYPES_H
#define MAX_DLIGHTS 32 // can't be increased, because bit flags are used on surfaces #define MAX_DLIGHTS 32 // can't be increased, because bit flags are used on surfaces
#define REFENTITYNUM_BITS 10 // can't be increased without changing drawsurf bit packing #define REFENTITYNUM_BITS 10 // can't be increased without changing drawsurf bit packing
#define REFENTITYNUM_MASK ((1<<REFENTITYNUM_BITS) - 1) #define REFENTITYNUM_MASK ((1<<REFENTITYNUM_BITS) - 1)
@ -46,15 +46,15 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// projection matrix won't be hacked to reduce the stereo separation as // projection matrix won't be hacked to reduce the stereo separation as
// is done for the gun. // is done for the gun.
#else #else
#define RF_CROSSHAIR 0x0010 #define RF_CROSSHAIR 0x0010
#endif #endif
#define RF_NOSHADOW 0x0040 // don't add stencil shadows #define RF_NOSHADOW 0x0040 // don't add stencil shadows
#define RF_LIGHTING_ORIGIN 0x0080 // use refEntity->lightingOrigin instead of refEntity->origin #define RF_LIGHTING_ORIGIN 0x0080 // use refEntity->lightingOrigin instead of refEntity->origin
// for lighting. This allows entities to sink into the floor // for lighting. This allows entities to sink into the floor
// with their origin going solid, and allows all parts of a // with their origin going solid, and allows all parts of a
// player to get the same lighting // player to get the same lighting
#define RF_SHADOW_PLANE 0x0100 // use refEntity->shadowPlane #define RF_SHADOW_PLANE 0x0100 // use refEntity->shadowPlane
#define RF_WRAP_FRAMES 0x0200 // mod the model frames by the maxframes to allow continuous #define RF_WRAP_FRAMES 0x0200 // mod the model frames by the maxframes to allow continuous
@ -65,8 +65,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif #endif
// refdef flags // refdef flags
#define RDF_NOWORLDMODEL 1 // used for player configuration screen #define RDF_NOWORLDMODEL 0x0001 // used for player configuration screen
#define RDF_HYPERSPACE 4 // teleportation effect #define RDF_HYPERSPACE 0x0004 // teleportation effect
typedef struct { typedef struct {
vec3_t xyz; vec3_t xyz;
@ -82,23 +82,23 @@ typedef struct poly_s {
#ifdef ELITEFORCE #ifdef ELITEFORCE
typedef enum { typedef enum {
RT_MODEL, RT_MODEL,
RT_SPRITE, RT_SPRITE,
RT_ORIENTEDSPRITE, // Replaces RT_POLY, which wasn't used. --Pat RT_ORIENTEDSPRITE, // Replaces RT_POLY, which wasn't used. --Pat
RT_ALPHAVERTPOLY, // Individual alpha levels on each vertex RT_ALPHAVERTPOLY, // Individual alpha levels on each vertex
RT_BEAM, RT_BEAM,
RT_RAIL_CORE, RT_RAIL_CORE,
RT_RAIL_RINGS, RT_RAIL_RINGS,
RT_LIGHTNING, RT_LIGHTNING,
RT_PORTALSURFACE, // doesn't draw anything, just info for portals RT_PORTALSURFACE, // doesn't draw anything, just info for portals
RT_LINE, // New type for Trek MP --Pat RT_LINE, // New type for Trek MP --Pat
RT_ORIENTEDLINE, RT_ORIENTEDLINE,
RT_LINE2, // New line type for Trek MP, with taper support --Pat RT_LINE2, // New line type for Trek MP, with taper support --Pat
RT_BEZIER, // what he said --keith RT_BEZIER, // what he said --keith
RT_CYLINDER, // Yet another Trek primitive! RT_CYLINDER, // Yet another Trek primitive!
RT_ELECTRICITY, // Yet another Trek primitive! RT_ELECTRICITY, // Yet another Trek primitive!
RT_MAX_REF_ENTITY_TYPE RT_MAX_REF_ENTITY_TYPE
} refEntityType_t; } refEntityType_t;
#else #else
typedef enum { typedef enum {
@ -147,44 +147,44 @@ typedef struct {
// extra sprite information // extra sprite information
#ifdef ELITEFORCE #ifdef ELITEFORCE
union union
{ {
struct struct
{ {
float rotation; float rotation;
float radius; float radius;
byte vertRGBA[4][4]; byte vertRGBA[4][4];
} sprite; } sprite;
struct struct
{ {
float width; float width;
float width2; float width2;
float stscale; float stscale;
} line; } line;
struct // that whole put-the-opening-brace-on-the-same-line-as-the-beginning-of-the-definition coding style is fecal // I agree. struct // that whole put-the-opening-brace-on-the-same-line-as-the-beginning-of-the-definition coding style is fecal // I agree.
{ {
float width; float width;
vec3_t control1; vec3_t control1;
vec3_t control2; vec3_t control2;
} bezier; } bezier;
struct struct
{ {
float width; float width;
float width2; float width2;
float stscale; float stscale;
float height; float height;
float bias; float bias;
qboolean wrap; qboolean wrap;
} cylinder; } cylinder;
struct struct
{ {
float width; float width;
float deviation; float deviation;
float stscale; float stscale;
qboolean wrap; qboolean wrap;
qboolean taper; qboolean taper;
} electricity; } electricity;
} data; } data;
#else #else
float radius; float radius;
float rotation; float rotation;

View file

@ -944,7 +944,7 @@ typedef struct {
float triangleTable[FUNCTABLE_SIZE]; float triangleTable[FUNCTABLE_SIZE];
float sawToothTable[FUNCTABLE_SIZE]; float sawToothTable[FUNCTABLE_SIZE];
float inverseSawToothTable[FUNCTABLE_SIZE]; float inverseSawToothTable[FUNCTABLE_SIZE];
float noiseTable[FUNCTABLE_SIZE]; float noiseTable[FUNCTABLE_SIZE];
float fogTable[FOG_TABLE_SIZE]; float fogTable[FOG_TABLE_SIZE];
} trGlobals_t; } trGlobals_t;

View file

@ -1719,6 +1719,7 @@ static void RB_SurfaceGrid( srfGridMesh_t *cv ) {
} }
} }
/* /*
=========================================================================== ===========================================================================

View file

@ -1651,7 +1651,7 @@ typedef struct {
float triangleTable[FUNCTABLE_SIZE]; float triangleTable[FUNCTABLE_SIZE];
float sawToothTable[FUNCTABLE_SIZE]; float sawToothTable[FUNCTABLE_SIZE];
float inverseSawToothTable[FUNCTABLE_SIZE]; float inverseSawToothTable[FUNCTABLE_SIZE];
float noiseTable[FUNCTABLE_SIZE]; float noiseTable[FUNCTABLE_SIZE];
float fogTable[FOG_TABLE_SIZE]; float fogTable[FOG_TABLE_SIZE];
} trGlobals_t; } trGlobals_t;

View file

@ -2067,6 +2067,7 @@ static void RB_SurfaceGrid( srfBspSurface_t *srf ) {
} }
} }
/* /*
=========================================================================== ===========================================================================

View file

@ -179,6 +179,7 @@ void SV_GetChallenge(netadr_t from)
Com_DPrintf( "authorize server timed out\n" ); Com_DPrintf( "authorize server timed out\n" );
else else
{ {
// otherwise send their ip to the authorize server
#ifndef ELITEFORCE #ifndef ELITEFORCE
cvar_t *fs; cvar_t *fs;
char game[1024]; char game[1024];
@ -186,7 +187,6 @@ void SV_GetChallenge(netadr_t from)
Com_DPrintf( "sending getIpAuthorize for %s\n", NET_AdrToString( from )); Com_DPrintf( "sending getIpAuthorize for %s\n", NET_AdrToString( from ));
// otherwise send their ip to the authorize server
#ifdef ELITEFORCE #ifdef ELITEFORCE
NET_OutOfBandPrint( NS_SERVER, svs.authorizeAddress, NET_OutOfBandPrint( NS_SERVER, svs.authorizeAddress,
"getIpAuthorize %i %i.%i.%i.%i ", challenge->challenge, "getIpAuthorize %i %i.%i.%i.%i ", challenge->challenge,
@ -204,6 +204,7 @@ void SV_GetChallenge(netadr_t from)
"getIpAuthorize %i %i.%i.%i.%i %s 0 %s", challenge->challenge, "getIpAuthorize %i %i.%i.%i.%i %s 0 %s", challenge->challenge,
from.ip[0], from.ip[1], from.ip[2], from.ip[3], game, sv_strictAuth->string ); from.ip[0], from.ip[1], from.ip[2], from.ip[3], game, sv_strictAuth->string );
#endif #endif
return; return;
} }
} }
@ -554,7 +555,6 @@ gotnewcl:
ent = SV_GentityNum( clientNum ); ent = SV_GentityNum( clientNum );
newcl->gentity = ent; newcl->gentity = ent;
// save the challenge // save the challenge
newcl->challenge = challenge; newcl->challenge = challenge;
@ -2043,7 +2043,7 @@ void SV_ExecuteClientMessage( client_t *cl, msg_t *msg ) {
c = MSG_ReadByte( msg ); c = MSG_ReadByte( msg );
#ifdef ELITEFORCE #ifdef ELITEFORCE
if(msg->compat && c == -1) if ( msg->compat && c == -1 )
c = clc_EOF; c = clc_EOF;
#endif #endif
if ( c == clc_EOF ) if ( c == clc_EOF )

View file

@ -339,6 +339,7 @@ intptr_t SV_GameSystemCalls( intptr_t *args ) {
case G_FS_SEEK: case G_FS_SEEK:
return FS_Seek( args[1], args[2], args[3] ); return FS_Seek( args[1], args[2], args[3] );
#endif #endif
case G_LOCATE_GAME_DATA: case G_LOCATE_GAME_DATA:
SV_LocateGameData( VMA(1), args[2], args[3], VMA(4), args[5] ); SV_LocateGameData( VMA(1), args[2], args[3], VMA(4), args[5] );
return 0; return 0;
@ -435,6 +436,7 @@ intptr_t SV_GameSystemCalls( intptr_t *args ) {
Q_SnapVector(VMA(1)); Q_SnapVector(VMA(1));
return 0; return 0;
#endif #endif
//==================================== //====================================
case BOTLIB_SETUP: case BOTLIB_SETUP:
@ -461,6 +463,7 @@ intptr_t SV_GameSystemCalls( intptr_t *args ) {
case BOTLIB_PC_SOURCE_FILE_AND_LINE: case BOTLIB_PC_SOURCE_FILE_AND_LINE:
return botlib_export->PC_SourceFileAndLine( args[1], VMA(2), VMA(3) ); return botlib_export->PC_SourceFileAndLine( args[1], VMA(2), VMA(3) );
#endif #endif
case BOTLIB_START_FRAME: case BOTLIB_START_FRAME:
return botlib_export->BotLibStartFrame( VMF(1) ); return botlib_export->BotLibStartFrame( VMF(1) );
case BOTLIB_LOAD_MAP: case BOTLIB_LOAD_MAP:
@ -477,6 +480,7 @@ intptr_t SV_GameSystemCalls( intptr_t *args ) {
case BOTLIB_USER_COMMAND: case BOTLIB_USER_COMMAND:
SV_ClientThink( &svs.clients[args[1]], VMA(2) ); SV_ClientThink( &svs.clients[args[1]], VMA(2) );
return 0; return 0;
#ifndef ELITEFORCE #ifndef ELITEFORCE
case BOTLIB_AAS_BBOX_AREAS: case BOTLIB_AAS_BBOX_AREAS:
return botlib_export->aas.AAS_BBoxAreas( VMA(1), VMA(2), VMA(3), args[4] ); return botlib_export->aas.AAS_BBoxAreas( VMA(1), VMA(2), VMA(3), args[4] );
@ -530,6 +534,7 @@ intptr_t SV_GameSystemCalls( intptr_t *args ) {
case BOTLIB_AAS_PREDICT_ROUTE: case BOTLIB_AAS_PREDICT_ROUTE:
return botlib_export->aas.AAS_PredictRoute( VMA(1), args[2], VMA(3), args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11] ); return botlib_export->aas.AAS_PredictRoute( VMA(1), args[2], VMA(3), args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11] );
#endif #endif
case BOTLIB_AAS_SWIMMING: case BOTLIB_AAS_SWIMMING:
return botlib_export->aas.AAS_Swimming( VMA(1) ); return botlib_export->aas.AAS_Swimming( VMA(1) );
case BOTLIB_AAS_PREDICT_CLIENT_MOVEMENT: case BOTLIB_AAS_PREDICT_CLIENT_MOVEMENT:
@ -877,6 +882,7 @@ intptr_t SV_GameSystemCalls( intptr_t *args ) {
botlib_export->ea.EA_Attack( args[1] ); botlib_export->ea.EA_Attack( args[1] );
return 0; return 0;
#endif #endif
default: default:
Com_Error( ERR_DROP, "Bad game system trap: %ld", (long int) args[0] ); Com_Error( ERR_DROP, "Bad game system trap: %ld", (long int) args[0] );
} }

View file

@ -320,6 +320,7 @@ void SV_MasterHeartbeat(const char *message)
// this command should be changed if the server info / status format // this command should be changed if the server info / status format
// ever incompatably changes // ever incompatably changes
#ifdef ELITEFORCE #ifdef ELITEFORCE
if(adr[i][0].type != NA_BAD) if(adr[i][0].type != NA_BAD)
NET_OutOfBandPrint(NS_SERVER, adr[i][0], "\\heartbeat\\%d\\gamename\\%s\\", NET_OutOfBandPrint(NS_SERVER, adr[i][0], "\\heartbeat\\%d\\gamename\\%s\\",

View file

@ -134,6 +134,7 @@ static void SV_Netchan_Decode( client_t *client, msg_t *msg ) {
#endif #endif
/* /*
================= =================
SV_Netchan_FreeQueue SV_Netchan_FreeQueue
@ -273,12 +274,14 @@ qboolean SV_Netchan_Process( client_t *client, msg_t *msg ) {
ret = Netchan_Process( &client->netchan, msg ); ret = Netchan_Process( &client->netchan, msg );
if (!ret) if (!ret)
return qfalse; return qfalse;
#ifndef ELITEFORCE #ifndef ELITEFORCE
#ifdef LEGACY_PROTOCOL #ifdef LEGACY_PROTOCOL
if(client->compat) if(client->compat)
SV_Netchan_Decode(client, msg); SV_Netchan_Decode(client, msg);
#endif #endif
#endif #endif
return qtrue; return qtrue;
} }

View file

@ -155,11 +155,10 @@ static void SV_WriteSnapshotToClient( client_t *client, msg_t *msg ) {
MSG_WriteByte (msg, svc_snapshot); MSG_WriteByte (msg, svc_snapshot);
#ifdef ELITEFORCE #ifdef ELITEFORCE
if(msg->compat) if(msg->compat)
#endif #endif
MSG_WriteLong( msg, client->lastClientCommand ); MSG_WriteLong( msg, client->lastClientCommand );
// NOTE, MRE: now sent at the start of every message from server to client // NOTE, MRE: now sent at the start of every message from server to client
// let the client know which reliable clientCommands we have received // let the client know which reliable clientCommands we have received
//MSG_WriteLong( msg, client->lastClientCommand ); //MSG_WriteLong( msg, client->lastClientCommand );