Quake 4 integrated with DoomRTX

This commit is contained in:
Justin Marshall
2026-05-09 22:10:40 -07:00
parent 8c4a087aa9
commit d37f87e493
436 changed files with 277587 additions and 10254 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+530
View File
@@ -0,0 +1,530 @@
/*
Base class for all game objects. Provides fast run-time type checking and run-time
instancing of objects.
*/
#ifndef __SYS_CLASS_H__
#define __SYS_CLASS_H__
class idClass;
class idTypeInfo;
// RAVEN BEGIN
extern const idEventDef EV_PostRestore;
// RAVEN END
extern const idEventDef EV_Remove;
extern const idEventDef EV_SafeRemove;
typedef void ( idClass::*eventCallback_t )( void );
template< class Type >
struct idEventFunc {
const idEventDef *event;
eventCallback_t function;
};
// added & so gcc could compile this
#define EVENT( event, function ) { &( event ), ( void ( idClass::* )( void ) )( &function ) },
#define END_CLASS { NULL, NULL } };
class idEventArg {
public:
int type;
intptr_t value;
idEventArg() { type = D_EVENT_INTEGER; value = 0; };
idEventArg(int data) { type = D_EVENT_INTEGER; value = data; };
idEventArg(float data) { type = D_EVENT_FLOAT; value = *reinterpret_cast<int*>(&data); };
idEventArg(const idVec3& data) { type = D_EVENT_VECTOR; value = reinterpret_cast<intptr_t>(&data); };
idEventArg(const idStr& data) { type = D_EVENT_STRING; value = reinterpret_cast<intptr_t>(data.c_str()); };
idEventArg(const char* data) { type = D_EVENT_STRING; value = reinterpret_cast<intptr_t>(data); };
idEventArg(const class idEntity* data) { type = D_EVENT_ENTITY; value = reinterpret_cast<intptr_t>(data); };
idEventArg(const struct trace_s* data) { type = D_EVENT_TRACE; value = reinterpret_cast<intptr_t>(data); };
// jmarshall - this can't be called from doomscript!
idEventArg(intptr_t data) { type = D_EVENT_INTEGER64bit; value = data; };
// jmarshall end
};
class idAllocError : public idException {
public:
idAllocError( const char *text = "" ) : idException( text ) {}
};
/***********************************************************************
idClass
***********************************************************************/
/*
================
CLASS_PROTOTYPE
This macro must be included in the definition of any subclass of idClass.
It prototypes variables used in class instanciation and type checking.
Use this on single inheritance concrete classes only.
================
*/
#ifdef USE_STATIC_CLASS_CONSTRUCTION
#define CLASS_PROTOTYPE( nameofclass ) \
private: \
static idTypeInfo Type; \
public: \
static void RegisterClass( void ); \
static idClass *CreateInstance( void ); \
static idTypeInfo &GetClassType( void ); \
virtual idTypeInfo *GetType( void ) const; \
static idEventFunc<nameofclass> eventCallbacks[]
#else
// RAVEN BEGIN
// jnewquist: Use accessor for static class type
#define CLASS_PROTOTYPE( nameofclass ) \
private: \
static idTypeInfo *Type; \
public: \
static void RegisterClass( void ); \
static idClass *CreateInstance( void ); \
static idTypeInfo &GetClassType( void ); \
virtual idTypeInfo *GetType( void ) const; \
static idEventFunc<nameofclass> eventCallbacks[]
// RAVEN END
#endif // USE_STATIC_CLASS_CONSTRUCTION
/*
================
CLASS_DECLARATION
This macro must be included in the code to properly initialize variables
used in type checking and run-time instanciation. It also defines the list
of events that the class responds to. Take special care to ensure that the
proper superclass is indicated or the run-time type information will be
incorrect. Use this on concrete classes only.
================
*/
#ifdef USE_STATIC_CLASS_CONSTRUCTION
#define CLASS_DECLARATION( nameofsuperclass, nameofclass ) \
idTypeInfo nameofclass::Type( #nameofclass, #nameofsuperclass, \
( idEventFunc<idClass> * )nameofclass::eventCallbacks, nameofclass::CreateInstance, ( void ( idClass::* )( void ) )&nameofclass::Spawn, \
( rvStateFunc<idClass> * )nameofclass::stateCallbacks, \
( void ( idClass::* )( idSaveGame * ) const )&nameofclass::Save, ( void ( idClass::* )( idRestoreGame * ) )&nameofclass::Restore ); \
void nameofclass::RegisterClass( void ) { \
} \
void Register_##nameofclass( void ) { \
nameofclass::RegisterClass(); \
} \
idClass *nameofclass::CreateInstance( void ) { \
try { \
RV_PUSH_SYS_HEAP_ID(RV_HEAP_ID_LEVEL); \
nameofclass *ptr = new nameofclass; \
RV_POP_HEAP(); \
ptr->FindUninitializedMemory(); \
return ptr; \
} \
catch( idAllocError & ) { \
return NULL; \
} \
} \
idTypeInfo &nameofclass::GetClassType( void ) { \
return nameofclass::Type; \
} \
idTypeInfo *nameofclass::GetType( void ) const { \
return &nameofclass::Type; \
} \
idEventFunc<nameofclass> nameofclass::eventCallbacks[] = {
#else
// RAVEN BEGIN
// bdube: Added states
// jnewquist: Use accessor for static class type
// mwhitlock: Dynamic memory consolidation
#define CLASS_DECLARATION( nameofsuperclass, nameofclass ) \
idTypeInfo *nameofclass::Type = NULL; \
void nameofclass::RegisterClass( void ) { \
static idTypeInfo type( #nameofclass, #nameofsuperclass, \
( idEventFunc<idClass> * )nameofclass::eventCallbacks, nameofclass::CreateInstance, ( void ( idClass::* )( void ) )&nameofclass::Spawn, \
( rvStateFunc<idClass> * )nameofclass::stateCallbacks, \
( void ( idClass::* )( idSaveGame * ) const )&nameofclass::Save, ( void ( idClass::* )( idRestoreGame * ) )&nameofclass::Restore ); \
nameofclass::Type = &type; \
} \
void Register_##nameofclass( void ) { \
nameofclass::RegisterClass(); \
} \
idClass *nameofclass::CreateInstance( void ) { \
try { \
RV_PUSH_SYS_HEAP_ID(RV_HEAP_ID_LEVEL); \
nameofclass *ptr = new nameofclass; \
RV_POP_HEAP(); \
ptr->FindUninitializedMemory(); \
return ptr; \
} \
catch( idAllocError & ) { \
return NULL; \
} \
} \
idTypeInfo &nameofclass::GetClassType( void ) { \
return *nameofclass::Type; \
} \
idTypeInfo *nameofclass::GetType( void ) const { \
return nameofclass::Type; \
} \
idEventFunc<nameofclass> nameofclass::eventCallbacks[] = {
// RAVEN END
#endif // USE_STATIC_CLASS_CONSTRUCTION
/*
================
ABSTRACT_PROTOTYPE
This macro must be included in the definition of any abstract subclass of idClass.
It prototypes variables used in class instanciation and type checking.
Use this on single inheritance abstract classes only.
================
*/
#ifdef USE_STATIC_CLASS_CONSTRUCTION
#define ABSTRACT_PROTOTYPE( nameofclass ) \
private: \
static idTypeInfo Type; \
public: \
static void RegisterClass( void ); \
static idClass *CreateInstance( void ); \
static idTypeInfo &GetClassType( void ); \
virtual idTypeInfo *GetType( void ) const; \
static idEventFunc<nameofclass> eventCallbacks[]
#else
// RAVEN BEGIN
// jnewquist: Use accessor for static class type
#define ABSTRACT_PROTOTYPE( nameofclass ) \
private: \
static idTypeInfo *Type; \
public: \
static void RegisterClass( void ); \
static idClass *CreateInstance( void ); \
static idTypeInfo &GetClassType( void ); \
virtual idTypeInfo *GetType( void ) const; \
static idEventFunc<nameofclass> eventCallbacks[]
// RAVEN END
#endif // USE_STATIC_CLASS_CONSTRUCTION
/*
================
ABSTRACT_DECLARATION
This macro must be included in the code to properly initialize variables
used in type checking. It also defines the list of events that the class
responds to. Take special care to ensure that the proper superclass is
indicated or the run-time tyep information will be incorrect. Use this
on abstract classes only.
================
*/
#ifdef USE_STATIC_CLASS_CONSTRUCTION
#define ABSTRACT_DECLARATION( nameofsuperclass, nameofclass ) \
idTypeInfo nameofclass::Type( #nameofclass, #nameofsuperclass, \
( idEventFunc<idClass> * )nameofclass::eventCallbacks, nameofclass::CreateInstance, ( void ( idClass::* )( void ) )&nameofclass::Spawn, \
( rvStateFunc<idClass> * )nameofclass::stateCallbacks, \
( void ( idClass::* )( idSaveGame * ) const )&nameofclass::Save, ( void ( idClass::* )( idRestoreGame * ) )&nameofclass::Restore ); \
void nameofclass::RegisterClass( void ) { \
} \
void Register_##nameofclass( void ) { \
nameofclass::RegisterClass(); \
} \
idClass *nameofclass::CreateInstance( void ) { \
gameLocal.Error( "Cannot instanciate abstract class %s.", #nameofclass ); \
return NULL; \
} \
idTypeInfo &nameofclass::GetClassType( void ) { \
return nameofclass::Type; \
} \
idTypeInfo *nameofclass::GetType( void ) const { \
return &nameofclass::Type; \
} \
idEventFunc<nameofclass> nameofclass::eventCallbacks[] = {
#else CLASS_STATES_DECLARATION
// RAVEN BEGIN
// bdube: added states
// jnewquist: Use accessor for static class type
#define ABSTRACT_DECLARATION( nameofsuperclass, nameofclass ) \
idTypeInfo *nameofclass::Type = NULL; \
void nameofclass::RegisterClass( void ) { \
static idTypeInfo type( #nameofclass, #nameofsuperclass, \
( idEventFunc<idClass> * )nameofclass::eventCallbacks, nameofclass::CreateInstance, ( void ( idClass::* )( void ) )&nameofclass::Spawn, \
( rvStateFunc<idClass> * )nameofclass::stateCallbacks, \
( void ( idClass::* )( idSaveGame * ) const )&nameofclass::Save, ( void ( idClass::* )( idRestoreGame * ) )&nameofclass::Restore ); \
nameofclass::Type = &type; \
} \
void Register_##nameofclass( void ) { \
nameofclass::RegisterClass(); \
} \
idClass *nameofclass::CreateInstance( void ) { \
gameLocal.Error( "Cannot instanciate abstract class %s.", #nameofclass ); \
return NULL; \
} \
idTypeInfo &nameofclass::GetClassType( void ) { \
return *nameofclass::Type; \
} \
idTypeInfo *nameofclass::GetType( void ) const { \
return nameofclass::Type; \
} \
idEventFunc<nameofclass> nameofclass::eventCallbacks[] = {
// RAVEN END
#endif // USE_STATIC_CLASS_CONSTRUCTION
typedef void ( idClass::*classSpawnFunc_t )( void );
class idSaveGame;
class idRestoreGame;
class idClass {
public:
ABSTRACT_PROTOTYPE( idClass );
#ifdef ID_REDIRECT_NEWDELETE
#undef new
#endif
void * operator new( size_t );
void * operator new( size_t s, int, int, char *, int );
void operator delete( void * );
void operator delete( void *, int, int, char *, int );
#ifdef ID_REDIRECT_NEWDELETE
#define new ID_DEBUG_NEW
#endif
virtual ~idClass();
void Spawn( void );
void CallSpawn( void );
bool IsType( const idTypeInfo &c ) const;
// RAVEN BEGIN
// jnewquist: Use accessor for static class type
bool IsType( const idTypeInfo *c ) const { return IsType(*c); }
// RAVEN END
const char * GetClassname( void ) const;
const char * GetSuperclass( void ) const;
void FindUninitializedMemory( void );
void Save( idSaveGame *savefile ) const {};
void Restore( idRestoreGame *savefile ) {};
bool RespondsTo( const idEventDef &ev ) const;
// RAVEN BEGIN
// bdube: states
stateResult_t ProcessState ( const rvStateFunc<idClass>* state, const stateParms_t& parms );
stateResult_t ProcessState ( const char* name, const stateParms_t& parms );
const rvStateFunc<idClass>* FindState ( const char* name ) const;
// bdube: client entities
virtual bool IsClient ( void ) const;
// jnewquist: Register subclasses explicitly so they aren't dead-stripped
static void RegisterClasses( void );
// RAVEN END
bool PostEventMS( const idEventDef *ev, int time );
bool PostEventMS( const idEventDef *ev, int time, idEventArg arg1 );
bool PostEventMS( const idEventDef *ev, int time, idEventArg arg1, idEventArg arg2 );
bool PostEventMS( const idEventDef *ev, int time, idEventArg arg1, idEventArg arg2, idEventArg arg3 );
bool PostEventMS( const idEventDef *ev, int time, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4 );
bool PostEventMS( const idEventDef *ev, int time, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5 );
bool PostEventMS( const idEventDef *ev, int time, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6 );
bool PostEventMS( const idEventDef *ev, int time, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7 );
bool PostEventMS( const idEventDef *ev, int time, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7, idEventArg arg8 );
bool PostEventSec( const idEventDef *ev, float time );
bool PostEventSec( const idEventDef *ev, float time, idEventArg arg1 );
bool PostEventSec( const idEventDef *ev, float time, idEventArg arg1, idEventArg arg2 );
bool PostEventSec( const idEventDef *ev, float time, idEventArg arg1, idEventArg arg2, idEventArg arg3 );
bool PostEventSec( const idEventDef *ev, float time, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4 );
bool PostEventSec( const idEventDef *ev, float time, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5 );
bool PostEventSec( const idEventDef *ev, float time, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6 );
bool PostEventSec( const idEventDef *ev, float time, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7 );
bool PostEventSec( const idEventDef *ev, float time, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7, idEventArg arg8 );
bool ProcessEvent( const idEventDef *ev );
bool ProcessEvent( const idEventDef *ev, idEventArg arg1 );
bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2 );
bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3 );
bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4 );
bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5 );
bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6 );
bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7 );
bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7, idEventArg arg8 );
bool ProcessEventArgPtr( const idEventDef *ev, intptr_t *data );
void CancelEvents( const idEventDef *ev );
// RAVEN BEGIN
// abahr:
bool EventIsPosted( const idEventDef *ev ) const;
void Event_PostRestore( void ) {}
// RAVEN END
void Event_Remove( void );
// Static functions
static void Init( void );
static void Shutdown( void );
static idTypeInfo * GetClass( const char *name );
static void DisplayInfo_f( const idCmdArgs &args );
static void ListClasses_f( const idCmdArgs &args );
static idClass * CreateInstance( const char *name );
static int GetNumTypes( void ) { return types.Num(); }
static int GetTypeNumBits( void ) { return typeNumBits; }
static idTypeInfo * GetType( int num );
// RAVEN BEGIN
// jscott: for memory profiling
static size_t GetUsedMemory( void ) { return( memused ); }
// bdube: debug info
virtual void GetDebugInfo ( debugInfoProc_t proc, void* userData );
// RAVEN END
private:
classSpawnFunc_t CallSpawnFunc( idTypeInfo *cls );
bool PostEventArgs( const idEventDef *ev, int time, int numargs, ... );
bool ProcessEventArgs( const idEventDef *ev, int numargs, ... );
void Event_SafeRemove( void );
static bool initialized;
static idList<idTypeInfo *> types;
static idList<idTypeInfo *> typenums;
static int typeNumBits;
static int memused;
static int numobjects;
// RAVEN BEGIN
// bdube: states
CLASS_STATES_PROTOTYPE(idClass);
// RAVEN END
};
/***********************************************************************
idTypeInfo
***********************************************************************/
class idTypeInfo {
public:
const char * classname;
const char * superclass;
idClass * ( *CreateInstance )( void );
void ( idClass::*Spawn )( void );
void ( idClass::*Save )( idSaveGame *savefile ) const;
void ( idClass::*Restore )( idRestoreGame *savefile );
// RAVEN BEGIN
// bdube: added
rvStateFunc<idClass> * stateCallbacks;
// RAVEN END
idEventFunc<idClass> * eventCallbacks;
eventCallback_t * eventMap;
idTypeInfo * super;
idTypeInfo * next;
bool freeEventMap;
int typeNum;
int lastChild;
idHierarchy<idTypeInfo> node;
idTypeInfo( const char *classname, const char *superclass,
idEventFunc<idClass> *eventCallbacks, idClass *( *CreateInstance )( void ), void ( idClass::*Spawn )( void ),
// RAVEN BEGIN
// bdube: added
rvStateFunc<idClass> *stateCallbacks,
// RAVEN END
void ( idClass::*Save )( idSaveGame *savefile ) const, void ( idClass::*Restore )( idRestoreGame *savefile ) );
~idTypeInfo();
void Init( void );
void Shutdown( void );
bool IsType( const idTypeInfo &superclass ) const;
// RAVEN BEGIN
// jnewquist: Use accessor for static class type
bool IsType( const idTypeInfo *superclass ) const { return IsType(*superclass); }
// RAVEN END
bool RespondsTo( const idEventDef &ev ) const;
};
/*
================
idTypeInfo::IsType
Checks if the object's class is a subclass of the class defined by the
passed in idTypeInfo.
================
*/
ID_INLINE bool idTypeInfo::IsType( const idTypeInfo &type ) const {
return ( ( typeNum >= type.typeNum ) && ( typeNum <= type.lastChild ) );
}
/*
================
idTypeInfo::RespondsTo
================
*/
ID_INLINE bool idTypeInfo::RespondsTo( const idEventDef &ev ) const {
assert( idEvent::initialized );
if ( !eventMap[ ev.GetEventNum() ] ) {
// we don't respond to this event
return false;
}
return true;
}
/*
================
idClass::IsType
Checks if the object's class is a subclass of the class defined by the
passed in idTypeInfo.
================
*/
ID_INLINE bool idClass::IsType( const idTypeInfo &superclass ) const {
idTypeInfo *subclass;
subclass = GetType();
return subclass->IsType( superclass );
}
/*
================
idClass::RespondsTo
================
*/
ID_INLINE bool idClass::RespondsTo( const idEventDef &ev ) const {
const idTypeInfo *c;
assert( idEvent::initialized );
c = GetType();
return c->RespondsTo( ev );
}
#endif /* !__SYS_CLASS_H__ */
+68
View File
@@ -0,0 +1,68 @@
#include "precompiled.h"
#pragma hdrstop
#include "../Game_local.h"
/*
================
idDebugGraph::idDebugGraph
================
*/
idDebugGraph::idDebugGraph() {
index = 0;
}
/*
================
idDebugGraph::SetNumSamples
================
*/
void idDebugGraph::SetNumSamples( int num ) {
index = 0;
samples.Clear();
samples.SetNum( num );
memset( samples.Ptr(), 0, samples.MemoryUsed() );
}
/*
================
idDebugGraph::AddValue
================
*/
void idDebugGraph::AddValue( float value ) {
samples[ index ] = value;
index++;
if ( index >= samples.Num() ) {
index = 0;
}
}
/*
================
idDebugGraph::Draw
================
*/
void idDebugGraph::Draw( const idVec4 &color, float scale ) const {
int i;
float value1;
float value2;
idVec3 vec1;
idVec3 vec2;
const idMat3 &axis = gameLocal.GetLocalPlayer()->viewAxis;
const idVec3 pos = gameLocal.GetLocalPlayer()->GetPhysics()->GetOrigin() + axis[ 1 ] * samples.Num() * 0.5f;
value1 = samples[ index ] * scale;
for( i = 1; i < samples.Num(); i++ ) {
value2 = samples[ ( i + index ) % samples.Num() ] * scale;
vec1 = pos + axis[ 2 ] * value1 - axis[ 1 ] * ( i - 1 ) + axis[ 0 ] * samples.Num();
vec2 = pos + axis[ 2 ] * value2 - axis[ 1 ] * i + axis[ 0 ] * samples.Num();
// RAVEN BEGIN
// bdube: use GetMSec access rather than USERCMD_TIME
gameRenderWorld->DebugLine( color, vec1, vec2, gameLocal.GetMSec ( ), false );
// RAVEN END
value1 = value2;
}
}
+13
View File
@@ -0,0 +1,13 @@
// DebugGraph.h
class idDebugGraph {
public:
idDebugGraph();
void SetNumSamples( int num );
void AddValue( float value );
void Draw( const idVec4 &color, float scale ) const;
private:
idList<float> samples;
int index;
};
+813
View File
@@ -0,0 +1,813 @@
/*
sys_event.cpp
Event are used for scheduling tasks and for linking script commands.
*/
#include "precompiled.h"
#pragma hdrstop
#include "../Game_local.h"
#define MAX_EVENTSPERFRAME 8192 // Upped from 4096
//#define CREATE_EVENT_CODE
/***********************************************************************
idEventDef
***********************************************************************/
idEventDef *idEventDef::eventDefList[MAX_EVENTS];
int idEventDef::numEventDefs = 0;
static bool eventError = false;
static char eventErrorMsg[ 128 ];
/*
================
idEventDef::idEventDef
================
*/
idEventDef::idEventDef( const char *command, const char *formatspec, char returnType ) {
idEventDef *ev;
int i;
unsigned int bits;
assert( command );
assert( !idEvent::initialized );
// Allow NULL to indicate no args, but always store it as ""
// so we don't have to check for it.
if ( !formatspec ) {
formatspec = "";
}
this->name = command;
this->formatspec = formatspec;
this->returnType = returnType;
numargs = strlen( formatspec );
assert( numargs <= D_EVENT_MAXARGS );
if ( numargs > D_EVENT_MAXARGS ) {
eventError = true;
sprintf( eventErrorMsg, "idEventDef::idEventDef : Too many args for '%s' event.", name );
return;
}
// make sure the format for the args is valid, calculate the formatspecindex, and the offsets for each arg
bits = 0;
argsize = 0;
memset( argOffset, 0, sizeof( argOffset ) );
for( i = 0; i < numargs; i++ ) {
argOffset[ i ] = argsize;
switch( formatspec[ i ] ) {
case D_EVENT_FLOAT :
bits |= 1 << i;
argsize += sizeof(intptr_t);
break;
case D_EVENT_INTEGER :
argsize += sizeof(intptr_t);
break;
case D_EVENT_VECTOR :
argsize += E_EVENT_SIZEOF_VEC;
break;
case D_EVENT_STRING :
argsize += MAX_STRING_LEN;
break;
case D_EVENT_ENTITY :
argsize += sizeof( intptr_t);
break;
case D_EVENT_ENTITY_NULL :
argsize += sizeof(intptr_t);
break;
case D_EVENT_TRACE :
argsize += sizeof( trace_t ) + MAX_STRING_LEN + sizeof( bool );
break;
default :
eventError = true;
sprintf( eventErrorMsg, "idEventDef::idEventDef : Invalid arg format '%s' string for '%s' event.", formatspec, name );
return;
break;
}
}
// calculate the formatspecindex
formatspecIndex = ( 1 << ( numargs + D_EVENT_MAXARGS ) ) | bits;
// go through the list of defined events and check for duplicates
// and mismatched format strings
eventnum = numEventDefs;
for( i = 0; i < eventnum; i++ ) {
ev = eventDefList[ i ];
if ( idStr::Cmp( command, ev->name ) == 0 ) {
if ( idStr::Cmp( formatspec, ev->formatspec ) != 0 ) {
eventError = true;
sprintf( eventErrorMsg, "idEvent '%s' defined twice with same name but differing format strings ('%s'!='%s').",
command, formatspec, ev->formatspec );
return;
}
if ( ev->returnType != returnType ) {
eventError = true;
sprintf( eventErrorMsg, "idEvent '%s' defined twice with same name but differing return types ('%c'!='%c').",
command, returnType, ev->returnType );
return;
}
// Don't bother putting the duplicate event in list.
eventnum = ev->eventnum;
return;
}
}
ev = this;
if ( numEventDefs >= MAX_EVENTS ) {
eventError = true;
sprintf( eventErrorMsg, "numEventDefs >= MAX_EVENTS" );
return;
}
eventDefList[numEventDefs] = ev;
numEventDefs++;
}
/*
================
idEventDef::NumEventCommands
================
*/
int idEventDef::NumEventCommands( void ) {
return numEventDefs;
}
/*
================
idEventDef::GetEventCommand
================
*/
const idEventDef *idEventDef::GetEventCommand( int eventnum ) {
return eventDefList[ eventnum ];
}
/*
================
idEventDef::FindEvent
================
*/
const idEventDef *idEventDef::FindEvent( const char *name ) {
idEventDef *ev;
int num;
int i;
assert( name );
num = numEventDefs;
for( i = 0; i < num; i++ ) {
ev = eventDefList[ i ];
if ( idStr::Cmp( name, ev->name ) == 0 ) {
return ev;
}
}
return NULL;
}
/***********************************************************************
idEvent
***********************************************************************/
static idLinkList<idEvent> FreeEvents;
static idLinkList<idEvent> EventQueue;
static idEvent EventPool[ MAX_EVENTS ];
bool idEvent::initialized = false;
idDynamicBlockAlloc<byte, 16 * 1024, 256> idEvent::eventDataAllocator;
/*
================
idEvent::~idEvent()
================
*/
idEvent::~idEvent() {
Free();
}
void idEvent::WriteDebugInfo( void ) {
idEvent *event;
int count = 0;
idFile *FH = fileSystem->OpenFileAppend( "idEvents.txt" );
FH->Printf( "Num Events = %d\n", EventQueue.Num() );
event = EventQueue.Next();
while( event != NULL ) {
count++;
FH->Printf( "%d. %d - %s - %s - %s\n", count, event->time, event->eventdef->GetName(), event->typeinfo->classname, event->object->GetClassname() );
event = event->eventNode.Next();
}
FH->Printf( "\n\n" );
fileSystem->CloseFile( FH );
}
/*
================
idEvent::Alloc
================
*/
idEvent *idEvent::Alloc( const idEventDef *evdef, int numargs, va_list args ) {
idEvent *ev;
size_t size;
const char *format;
idEventArg *arg;
byte *dataPtr;
int i;
const char *materialName;
if ( FreeEvents.IsListEmpty() ) {
WriteDebugInfo( );
gameLocal.Error( "idEvent::Alloc : No more free events for '%s' event.", evdef->GetName() );
}
ev = FreeEvents.Next();
ev->eventNode.Remove();
ev->eventdef = evdef;
if ( numargs != evdef->GetNumArgs() ) {
gameLocal.Error( "idEvent::Alloc : Wrong number of args for '%s' event.", evdef->GetName() );
}
size = evdef->GetArgSize();
if ( size ) {
ev->data = eventDataAllocator.Alloc( size );
memset( ev->data, 0, size );
} else {
ev->data = NULL;
}
format = evdef->GetArgFormat();
for( i = 0; i < numargs; i++ ) {
arg = va_arg( args, idEventArg * );
if ( format[ i ] != arg->type ) {
// RAVEN BEGIN
// abahr: type checking change as per Jim D.
//if ( ( format[ i ] == D_EVENT_ENTITY_NULL ) && ( arg->type == D_EVENT_ENTITY ) ) {
//// these types are identical, so allow them
//} else if ( ( arg->type == D_EVENT_INTEGER ) && ( arg->value == 0 ) ) {
// if ( ( format[ i ] == D_EVENT_ENTITY ) || ( format[ i ] == D_EVENT_ENTITY_NULL ) || ( format[ i ] == D_EVENT_TRACE ) ) {
// // when NULL is passed in for an entity or trace, it gets cast as an integer 0, so don't give an error when it happens
// } else {
// gameLocal.Error( "idEvent::Alloc : Wrong type passed in for arg # %d on '%s' event.", i, evdef->GetName() );
// }
//} else {
// gameLocal.Error( "idEvent::Alloc : Wrong type passed in for arg # %d on '%s' event.", i, evdef->GetName() );
//}
// RAVEN END
}
dataPtr = &ev->data[ evdef->GetArgOffset( i ) ];
switch( format[ i ] ) {
case D_EVENT_FLOAT :
case D_EVENT_INTEGER :
*reinterpret_cast<int *>( dataPtr ) = arg->value;
break;
case D_EVENT_VECTOR :
if ( arg->value ) {
*reinterpret_cast<idVec3 *>( dataPtr ) = *reinterpret_cast<const idVec3 *>( arg->value );
}
break;
case D_EVENT_STRING :
if ( arg->value ) {
idStr::Copynz( reinterpret_cast<char *>( dataPtr ), reinterpret_cast<const char *>( arg->value ), MAX_STRING_LEN );
}
break;
// RAVEN BEGIN
// abahr: type checking change as per Jim D.
// jshepard: TODO FIXME HACK this never ever produces desired, positive results. Events should be built to prepare for null entities, especially when dealing with
// script events. This will throw a warning, and events should be prepared to deal with null entities.
case D_EVENT_ENTITY :
if ( reinterpret_cast<idEntity *>( arg->value ) == NULL ) {
gameLocal.Warning( "idEvent::Alloc : NULL entity passed in to event function that expects a non-NULL pointer on arg # %d on '%s' event.", i, evdef->GetName() );
}
*reinterpret_cast< idEntityPtr<idEntity> * >( dataPtr ) = reinterpret_cast<idEntity *>( arg->value );
break;
case D_EVENT_ENTITY_NULL :
*reinterpret_cast< idEntityPtr<idEntity> * >( dataPtr ) = reinterpret_cast<idEntity *>( arg->value );
break;
//RAVEN END
case D_EVENT_TRACE :
if ( arg->value ) {
*reinterpret_cast<bool *>( dataPtr ) = true;
*reinterpret_cast<trace_t *>( dataPtr + sizeof( bool ) ) = *reinterpret_cast<const trace_t *>( arg->value );
// save off the material as a string since the pointer won't be valid in save games.
// since we save off the entire trace_t structure, if the material is NULL here,
// it will be NULL when we process it, so we don't need to save off anything in that case.
if ( reinterpret_cast<const trace_t *>( arg->value )->c.material ) {
materialName = reinterpret_cast<const trace_t *>( arg->value )->c.material->GetName();
idStr::Copynz( reinterpret_cast<char *>( dataPtr + sizeof( bool ) + sizeof( trace_t ) ), materialName, MAX_STRING_LEN );
}
} else {
*reinterpret_cast<bool *>( dataPtr ) = false;
}
break;
default :
gameLocal.Error( "idEvent::Alloc : Invalid arg format '%s' string for '%s' event.", format, evdef->GetName() );
break;
}
}
return ev;
}
/*
================
idEvent::CopyArgs
================
*/
void idEvent::CopyArgs( const idEventDef *evdef, int numargs, va_list args, intptr_t data[ D_EVENT_MAXARGS ] ) {
int i;
const char *format;
idEventArg *arg;
format = evdef->GetArgFormat();
if ( numargs != evdef->GetNumArgs() ) {
gameLocal.Error( "idEvent::CopyArgs : Wrong number of args for '%s' event.", evdef->GetName() );
}
for( i = 0; i < numargs; i++ ) {
arg = va_arg( args, idEventArg * );
if ( format[ i ] != arg->type ) {
// RAVEN BEGIN
// abahr: type checking change as per Jim D.
//if ( ( format[ i ] == D_EVENT_ENTITY_NULL ) && ( arg->type == D_EVENT_ENTITY ) ) {
//// these types are identical, so allow them
//} else if ( ( arg->type == D_EVENT_INTEGER ) && ( arg->value == 0 ) ) {
// if ( ( format[ i ] == D_EVENT_ENTITY ) || ( format[ i ] == D_EVENT_ENTITY_NULL ) ) {
// // when NULL is passed in for an entity, it gets cast as an integer 0, so don't give an error when it happens
// } else {
// gameLocal.Error( "idEvent::Alloc : Wrong type passed in for arg # %d on '%s' event.", i, evdef->GetName() );
// }
//} else {
// gameLocal.Error( "idEvent::Alloc : Wrong type passed in for arg # %d on '%s' event.", i, evdef->GetName() );
//}
// RAVEN END
}
data[ i ] = arg->value;
}
}
/*
================
idEvent::Free
================
*/
void idEvent::Free( void ) {
if ( data ) {
eventDataAllocator.Free( data );
data = NULL;
}
eventdef = NULL;
time = 0;
object = NULL;
typeinfo = NULL;
eventNode.SetOwner( this );
eventNode.AddToEnd( FreeEvents );
}
/*
================
idEvent::Schedule
================
*/
void idEvent::Schedule( idClass *obj, const idTypeInfo *type, int time ) {
idEvent *event;
assert( initialized );
if ( !initialized ) {
return;
}
object = obj;
typeinfo = type;
// wraps after 24 days...like I care. ;)
this->time = gameLocal.time + time;
eventNode.Remove();
event = EventQueue.Next();
while( ( event != NULL ) && ( this->time >= event->time ) ) {
event = event->eventNode.Next();
}
if ( event ) {
eventNode.InsertBefore( event->eventNode );
} else {
eventNode.AddToEnd( EventQueue );
}
}
/*
================
idEvent::CancelEvents
================
*/
void idEvent::CancelEvents( const idClass *obj, const idEventDef *evdef ) {
idEvent *event;
idEvent *next;
if ( !initialized ) {
return;
}
for( event = EventQueue.Next(); event != NULL; event = next ) {
next = event->eventNode.Next();
if ( event->object == obj ) {
if ( !evdef || ( evdef == event->eventdef ) ) {
event->Free();
}
}
}
}
// RAVEN BEGIN
// abahr:
/*
================
idEvent::EventIsPosted
================
*/
bool idEvent::EventIsPosted( const idClass *obj, const idEventDef *evdef ) {
idEvent *event;
idEvent *next;
if ( !initialized ) {
return false;
}
for( event = EventQueue.Next(); event != NULL; event = next ) {
next = event->eventNode.Next();
if( event->object == obj && evdef == event->eventdef ) {
return true;
}
}
return false;
}
// RAVEN END
/*
================
idEvent::ClearEventList
================
*/
void idEvent::ClearEventList( void ) {
int i;
//
// initialize lists
//
FreeEvents.Clear();
EventQueue.Clear();
//
// add the events to the free list
//
for( i = 0; i < MAX_EVENTS; i++ ) {
EventPool[ i ].Free();
}
}
/*
================
idEvent::ServiceEvents
================
*/
void idEvent::ServiceEvents( void ) {
idEvent *event;
int num;
intptr_t args[ D_EVENT_MAXARGS ];
int offset;
int i;
int numargs;
const char *formatspec;
trace_t **tracePtr;
const idEventDef *ev;
byte *data;
const char *materialName;
num = 0;
while( !EventQueue.IsListEmpty() ) {
#ifdef _XENON
session->PacifierUpdate();
#endif
event = EventQueue.Next();
assert( event );
if ( event->time > gameLocal.time ) {
break;
}
// copy the data into the local args array and set up pointers
ev = event->eventdef;
formatspec = ev->GetArgFormat();
numargs = ev->GetNumArgs();
for( i = 0; i < numargs; i++ ) {
offset = ev->GetArgOffset( i );
data = event->data;
switch( formatspec[ i ] ) {
case D_EVENT_FLOAT :
case D_EVENT_INTEGER :
args[ i ] = *reinterpret_cast<int *>( &data[ offset ] );
break;
case D_EVENT_VECTOR :
*reinterpret_cast<idVec3 **>( &args[ i ] ) = reinterpret_cast<idVec3 *>( &data[ offset ] );
break;
case D_EVENT_STRING :
*reinterpret_cast<const char **>( &args[ i ] ) = reinterpret_cast<const char *>( &data[ offset ] );
break;
// RAVEN BEGIN
// abahr: type checking change as per Jim D.
case D_EVENT_ENTITY :
*reinterpret_cast<idEntity **>( &args[ i ] ) = reinterpret_cast< idEntityPtr<idEntity> * >( &data[ offset ] )->GetEntity();
if ( *reinterpret_cast<idEntity **>( &args[ i ] ) == NULL ) {
gameLocal.Warning( "idEvent::ServiceEvents : NULL entity passed in to event function that expects a non-NULL pointer on arg # %d on '%s' event.", i, ev->GetName() );
}
break;
case D_EVENT_ENTITY_NULL :
*reinterpret_cast<idEntity **>( &args[ i ] ) = reinterpret_cast< idEntityPtr<idEntity> * >( &data[ offset ] )->GetEntity();
break;
// RAVEN END
case D_EVENT_TRACE :
tracePtr = reinterpret_cast<trace_t **>( &args[ i ] );
if ( *reinterpret_cast<bool *>( &data[ offset ] ) ) {
*tracePtr = reinterpret_cast<trace_t *>( &data[ offset + sizeof( bool ) ] );
if ( ( *tracePtr )->c.material != NULL ) {
// look up the material name to get the material pointer
materialName = reinterpret_cast<const char *>( &data[ offset + sizeof( bool ) + sizeof( trace_t ) ] );
( *tracePtr )->c.material = declManager->FindMaterial( materialName, true );
}
} else {
*tracePtr = NULL;
}
break;
default:
gameLocal.Error( "idEvent::ServiceEvents : Invalid arg format '%s' string for '%s' event.", formatspec, ev->GetName() );
}
}
// the event is removed from its list so that if then object
// is deleted, the event won't be freed twice
event->eventNode.Remove();
assert( event->object );
// savegames can trash the object, so do this for safety
if ( event->object ) {
event->object->ProcessEventArgPtr( ev, args );
}
#if 0
// event functions may never leave return values on the FPU stack
// enable this code to check if any event call left values on the FPU stack
if ( !sys->FPU_StackIsEmpty() ) {
gameLocal.Error( "idEvent::ServiceEvents %d: %s left a value on the FPU stack\n", num, ev->GetName() );
}
#endif
// return the event to the free list
event->Free();
// Don't allow ourselves to stay in here too long. An abnormally high number
// of events being processed is evidence of an infinite loop of events.
num++;
if ( num > MAX_EVENTSPERFRAME ) {
gameLocal.Error( "Event overflow. Possible infinite loop in script." );
}
}
}
/*
================
idEvent::Init
================
*/
void idEvent::Init( void ) {
gameLocal.Printf( "Initializing event system\n" );
if ( eventError ) {
gameLocal.Error( "%s", eventErrorMsg );
}
#ifdef CREATE_EVENT_CODE
void CreateEventCallbackHandler();
CreateEventCallbackHandler();
gameLocal.Error( "Wrote event callback handler" );
#endif
if ( initialized ) {
gameLocal.Printf( "...already initialized\n" );
ClearEventList();
return;
}
ClearEventList();
eventDataAllocator.Init();
gameLocal.Printf( "...%i event definitions\n", idEventDef::NumEventCommands() );
// the event system has started
initialized = true;
}
/*
================
idEvent::Shutdown
================
*/
void idEvent::Shutdown( void ) {
gameLocal.Printf( "Shutdown event system\n" );
if ( !initialized ) {
gameLocal.Printf( "...not started\n" );
return;
}
ClearEventList();
eventDataAllocator.Shutdown();
// say it is now shutdown
initialized = false;
}
/*
================
idEvent::Save
================
*/
void idEvent::Save( idSaveGame *savefile ) {
idEvent *event;
savefile->WriteInt( EventQueue.Num() );
event = EventQueue.Next();
while( event != NULL ) {
savefile->WriteInt( event->time );
savefile->WriteString( event->eventdef->GetName() );
savefile->WriteString( event->typeinfo->classname );
savefile->WriteObject( event->object );
savefile->WriteInt( event->eventdef->GetArgSize() );
savefile->Write( event->data, event->eventdef->GetArgSize() );
event = event->eventNode.Next();
}
}
/*
================
idEvent::Restore
================
*/
void idEvent::Restore( idRestoreGame *savefile ) {
int i;
int num;
int argsize;
idStr name;
idEvent *event;
savefile->ReadInt( num );
for ( i = 0; i < num; i++ ) {
if ( FreeEvents.IsListEmpty() ) {
gameLocal.Error( "idEvent::Restore : No more free events" );
}
event = FreeEvents.Next();
event->eventNode.Remove();
event->eventNode.AddToEnd( EventQueue );
savefile->ReadInt( event->time );
// read the event name
savefile->ReadString( name );
event->eventdef = idEventDef::FindEvent( name );
if ( !event->eventdef ) {
savefile->Error( "idEvent::Restore: unknown event '%s'", name.c_str() );
}
// read the classtype
savefile->ReadString( name );
event->typeinfo = idClass::GetClass( name );
if ( !event->typeinfo ) {
savefile->Error( "idEvent::Restore: unknown class '%s' on event '%s'", name.c_str(), event->eventdef->GetName() );
}
savefile->ReadObject( event->object );
assert( event->object );
// read the args
savefile->ReadInt( argsize );
if ( argsize != event->eventdef->GetArgSize() ) {
savefile->Error( "idEvent::Restore: arg size (%d) doesn't match saved arg size(%d) on event '%s'", event->eventdef->GetArgSize(), argsize, event->eventdef->GetName() );
}
if ( argsize ) {
event->data = eventDataAllocator.Alloc( argsize );
savefile->Read( event->data, argsize );
} else {
event->data = NULL;
}
}
}
#ifdef CREATE_EVENT_CODE
/*
================
CreateEventCallbackHandler
================
*/
void CreateEventCallbackHandler( void ) {
int num;
int count;
int i, j, k;
char argString[ D_EVENT_MAXARGS + 1 ];
idStr string1;
idStr string2;
idFile *file;
file = fileSystem->OpenFileWrite( "Callbacks.cpp" );
file->Printf( "// generated file - see CREATE_EVENT_CODE\n\n" );
for( i = 1; i <= D_EVENT_MAXARGS; i++ ) {
file->Printf( "\t/*******************************************************\n\n\t\t%d args\n\n\t*******************************************************/\n\n", i );
for ( j = 0; j < ( 1 << i ); j++ ) {
for ( k = 0; k < i; k++ ) {
argString[ k ] = j & ( 1 << k ) ? 'f' : 'i';
}
argString[ i ] = '\0';
string1.Empty();
string2.Empty();
for( k = 0; k < i; k++ ) {
if ( j & ( 1 << k ) ) {
string1 += "const float";
string2 += va( "*( float * )&data[ %d ]", k );
} else {
string1 += "const int";
string2 += va( "data[ %d ]", k );
}
if ( k < i - 1 ) {
string1 += ", ";
string2 += ", ";
}
}
file->Printf( "\tcase %d :\n\t\ttypedef void ( idClass::*eventCallback_%s_t )( %s );\n", ( 1 << ( i + D_EVENT_MAXARGS ) ) + j, argString, string1.c_str() );
file->Printf( "\t\t( this->*( eventCallback_%s_t )callback )( %s );\n\t\tbreak;\n\n", argString, string2.c_str() );
}
}
fileSystem->CloseFile( file );
}
#endif
+190
View File
@@ -0,0 +1,190 @@
/*
sys_event.h
Event are used for scheduling tasks and for linking script commands.
*/
#ifndef __SYS_EVENT_H__
#define __SYS_EVENT_H__
#define D_EVENT_MAXARGS 8 // if changed, enable the CREATE_EVENT_CODE define in Event.cpp to generate switch statement for idClass::ProcessEventArgPtr.
// running the game will then generate c:\doom\base\events.txt, the contents of which should be copied into the switch statement.
#define D_EVENT_VOID ( ( char )0 )
#define D_EVENT_INTEGER 'd'
#define D_EVENT_FLOAT 'f'
#define D_EVENT_VECTOR 'v'
#define D_EVENT_STRING 's'
#define D_EVENT_ENTITY 'e'
#define D_EVENT_ENTITY_NULL 'E' // event can handle NULL entity pointers
#define D_EVENT_TRACE 't'
// jmarshall - 64bit
#define D_EVENT_INTEGER64bit 'y'
// jmarshall end
#define MAX_EVENTS 8192 // Upped from 4096
// stack size of idVec3, aligned to native pointer size
#define E_EVENT_SIZEOF_VEC ((sizeof(idVec3) + (sizeof(intptr_t) - 1)) & ~(sizeof(intptr_t) - 1))
class idClass;
class idTypeInfo;
class idEventDef {
private:
const char *name;
const char *formatspec;
unsigned int formatspecIndex;
int returnType;
int numargs;
size_t argsize;
int argOffset[ D_EVENT_MAXARGS ];
int eventnum;
const idEventDef * next;
static idEventDef * eventDefList[MAX_EVENTS];
static int numEventDefs;
public:
idEventDef( const char *command, const char *formatspec = NULL, char returnType = 0 );
const char *GetName( void ) const;
const char *GetArgFormat( void ) const;
unsigned int GetFormatspecIndex( void ) const;
char GetReturnType( void ) const;
int GetEventNum( void ) const;
int GetNumArgs( void ) const;
size_t GetArgSize( void ) const;
int GetArgOffset( int arg ) const;
static int NumEventCommands( void );
static const idEventDef *GetEventCommand( int eventnum );
static const idEventDef *FindEvent( const char *name );
};
class idSaveGame;
class idRestoreGame;
class idEvent {
private:
const idEventDef *eventdef;
byte *data;
int time;
idClass *object;
const idTypeInfo *typeinfo;
idLinkList<idEvent> eventNode;
static idDynamicBlockAlloc<byte, 16 * 1024, 256> eventDataAllocator;
public:
static bool initialized;
~idEvent();
static void WriteDebugInfo( void );
static idEvent *Alloc( const idEventDef *evdef, int numargs, va_list args );
static void CopyArgs( const idEventDef *evdef, int numargs, va_list args, intptr_t data[ D_EVENT_MAXARGS ] );
void Free( void );
void Schedule( idClass *object, const idTypeInfo *cls, int time );
byte *GetData( void );
static void CancelEvents( const idClass *obj, const idEventDef *evdef = NULL );
// RAVEN BEGIN
// abahr:
static bool EventIsPosted( const idClass *obj, const idEventDef *evdef );
// RAVEN END
static void ClearEventList( void );
static void ServiceEvents( void );
static void Init( void );
static void Shutdown( void );
// save games
static void Save( idSaveGame *savefile ); // archives object for save game file
static void Restore( idRestoreGame *savefile ); // unarchives object from save game file
};
/*
================
idEvent::GetData
================
*/
ID_INLINE byte *idEvent::GetData( void ) {
return data;
}
/*
================
idEventDef::GetName
================
*/
ID_INLINE const char *idEventDef::GetName( void ) const {
return name;
}
/*
================
idEventDef::GetArgFormat
================
*/
ID_INLINE const char *idEventDef::GetArgFormat( void ) const {
return formatspec;
}
/*
================
idEventDef::GetFormatspecIndex
================
*/
ID_INLINE unsigned int idEventDef::GetFormatspecIndex( void ) const {
return formatspecIndex;
}
/*
================
idEventDef::GetReturnType
================
*/
ID_INLINE char idEventDef::GetReturnType( void ) const {
return returnType;
}
/*
================
idEventDef::GetNumArgs
================
*/
ID_INLINE int idEventDef::GetNumArgs( void ) const {
return numargs;
}
/*
================
idEventDef::GetArgSize
================
*/
ID_INLINE size_t idEventDef::GetArgSize( void ) const {
return argsize;
}
/*
================
idEventDef::GetArgOffset
================
*/
ID_INLINE int idEventDef::GetArgOffset( int arg ) const {
assert( ( arg >= 0 ) && ( arg < D_EVENT_MAXARGS ) );
return argOffset[ arg ];
}
/*
================
idEventDef::GetEventNum
================
*/
ID_INLINE int idEventDef::GetEventNum( void ) const {
return eventnum;
}
#endif /* !__SYS_EVENT_H__ */
+56
View File
@@ -0,0 +1,56 @@
#ifndef __GAMETYPEINFO_H__
#define __GAMETYPEINFO_H__
/*
===================================================================================
This file has been generated with the Type Info Generator v1.0 (c) 2004 id Software
===================================================================================
*/
typedef struct {
const char * name;
const char * type;
const char * value;
} constantInfo_t;
typedef struct {
const char * name;
int value;
} enumValueInfo_t;
typedef struct {
const char * typeName;
const enumValueInfo_t * values;
} enumTypeInfo_t;
typedef struct {
const char * type;
const char * name;
int offset;
int size;
} classVariableInfo_t;
typedef struct {
const char * typeName;
const char * superType;
int size;
const classVariableInfo_t * variables;
} classTypeInfo_t;
static constantInfo_t constantInfo[] = {
{ NULL, NULL, NULL }
};
static enumTypeInfo_t enumTypeInfo[] = {
{ NULL, NULL }
};
static classTypeInfo_t classTypeInfo[] = {
{ NULL, NULL, 0, NULL }
};
#endif /* !__GAMETYPEINFO_H__ */
File diff suppressed because it is too large Load Diff
+183
View File
@@ -0,0 +1,183 @@
#ifndef __SAVEGAME_H__
#define __SAVEGAME_H__
/*
Save game related helper classes.
*/
const int INITIAL_RELEASE_BUILD_NUMBER = 1262;
class idSaveGame {
public:
friend void Cmd_CheckSave_f( const idCmdArgs &args );
idSaveGame( idFile *savefile );
~idSaveGame();
void Close( void );
void AddObject( const idClass *obj );
void WriteObjectList( void );
void Write( const void *buffer, int len );
void WriteInt( const int value );
void WriteJoint( const jointHandle_t value );
void WriteShort( const short value );
void WriteByte( const byte value );
void WriteSignedChar( const signed char value );
void WriteFloat( const float value );
void WriteBool( const bool value );
void WriteString( const char *string );
void WriteVec2( const idVec2 &vec );
void WriteVec3( const idVec3 &vec );
void WriteVec4( const idVec4 &vec );
void WriteVec5( const idVec5 &vec );
void WriteVec6( const idVec6 &vec );
void WriteWinding( const idWinding &winding );
void WriteBounds( const idBounds &bounds );
void WriteMat3( const idMat3 &mat );
void WriteAngles( const idAngles &angles );
void WriteObject( const idClass *obj );
void WriteStaticObject( const idClass &obj );
void WriteDict( const idDict *dict );
void WriteMaterial( const idMaterial *material );
void WriteSkin( const idDeclSkin *skin );
// RAVEN BEGIN
// jscott: not using
// void WriteParticle( const idDeclParticle *particle );
// void WriteFX( const idDeclFX *fx );
// RAVEN END
void WriteSoundShader( const idSoundShader *shader );
void WriteModelDef( const class idDeclModelDef *modelDef );
void WriteModel( const idRenderModel *model );
// RAVEN BEGIN
// bdube: material type
void WriteMaterialType ( const rvDeclMatType* matType );
void WriteTable ( const idDeclTable* table );
// abahr
void WriteExtrapolate( const idExtrapolate<int>& extrap );
void WriteExtrapolate( const idExtrapolate<float>& extrap );
void WriteExtrapolate( const idExtrapolate<idVec3>& extrap );
void WriteInterpolate( const idInterpolateAccelDecelLinear<int>& lerp );
void WriteInterpolate( const idInterpolateAccelDecelLinear<float>& lerp );
void WriteInterpolate( const idInterpolateAccelDecelLinear<idVec3>& lerp );
void WriteInterpolate( const idInterpolate<int>& lerp );
void WriteInterpolate( const idInterpolate<float>& lerp );
void WriteInterpolate( const idInterpolate<idVec3>& lerp );
void WriteRenderEffect( const renderEffect_t &renderEffect );
void WriteFrustum( const idFrustum& frustum );
void WriteSyncId( void );
// RAVEN END
void WriteUserInterface( const idUserInterface *ui, bool unique );
void WriteRenderEntity( const renderEntity_t &renderEntity );
void WriteRenderLight( const renderLight_t &renderLight );
void WriteRefSound( const refSound_t &refSound );
void WriteRenderView( const renderView_t &view );
void WriteUsercmd( const usercmd_t &usercmd );
void WriteContactInfo( const contactInfo_t &contactInfo );
void WriteTrace( const trace_t &trace );
void WriteClipModel( const class idClipModel *clipModel );
void WriteSoundCommands( void );
void WriteBuildNumber( const int value );
protected:
idFile * file;
idList<const idClass *> objects;
void CallSave_r( const idTypeInfo *cls, const idClass *obj );
};
class idRestoreGame {
public:
friend void Cmd_CheckSave_f( const idCmdArgs &args );
idRestoreGame( idFile *savefile );
~idRestoreGame();
void CreateObjects( void );
void RestoreObjects( void );
void DeleteObjects( void );
void Error( const char *fmt, ... );
void Read( void *buffer, int len );
void ReadInt( int &value );
void ReadJoint( jointHandle_t &value );
void ReadShort( short &value );
void ReadByte( byte &value );
void ReadSignedChar( signed char &value );
void ReadFloat( float &value );
void ReadBool( bool &value );
void ReadString( idStr &string );
void ReadVec2( idVec2 &vec );
void ReadVec3( idVec3 &vec );
void ReadVec4( idVec4 &vec );
void ReadVec5( idVec5 &vec );
void ReadVec6( idVec6 &vec );
void ReadWinding( idWinding &winding );
void ReadBounds( idBounds &bounds );
void ReadMat3( idMat3 &mat );
void ReadAngles( idAngles &angles );
void ReadObject( idClass *&obj );
void ReadStaticObject( idClass &obj );
void ReadDict( idDict *dict );
void ReadMaterial( const idMaterial *&material );
void ReadSkin( const idDeclSkin *&skin );
// RAVEN BEGIN
// bdube: not using
// void ReadParticle( const idDeclParticle *&particle );
// void ReadFX( const idDeclFX *&fx );
// RAVEN END
void ReadSoundShader( const idSoundShader *&shader );
void ReadModelDef( const idDeclModelDef *&modelDef );
void ReadModel( idRenderModel *&model );
// RAVEN BEGIN
void ReadUserInterface( idUserInterface *&ui, const idDict *args );
// bdube: material type
void ReadMaterialType ( const rvDeclMatType* &matType );
void ReadTable ( const idDeclTable* &table );
// abahr
void ReadExtrapolate( idExtrapolate<int>& extrap );
void ReadExtrapolate( idExtrapolate<float>& extrap );
void ReadExtrapolate( idExtrapolate<idVec3>& extrap );
void ReadInterpolate( idInterpolateAccelDecelLinear<int>& lerp );
void ReadInterpolate( idInterpolateAccelDecelLinear<float>& lerp );
void ReadInterpolate( idInterpolateAccelDecelLinear<idVec3>& lerp );
void ReadInterpolate( idInterpolate<int>& lerp );
void ReadInterpolate( idInterpolate<float>& lerp );
void ReadInterpolate( idInterpolate<idVec3>& lerp );
void ReadRenderEffect( renderEffect_t &renderEffect );
void ReadFrustum( idFrustum& frustum );
void ReadSyncId( const char *detail = "unspecified", const char *classname = NULL ) { file->ReadSyncId( detail, classname ); }
void ReadRenderEntity( renderEntity_t &renderEntity, const idDict *args );
// RAVEN END
void ReadRenderLight( renderLight_t &renderLight );
void ReadRefSound( refSound_t &refSound );
void ReadRenderView( renderView_t &view );
void ReadUsercmd( usercmd_t &usercmd );
void ReadContactInfo( contactInfo_t &contactInfo );
void ReadTrace( trace_t &trace );
void ReadClipModel( idClipModel *&clipModel );
void ReadSoundCommands( void );
void ReadBuildNumber( void );
// Used to retrieve the saved game buildNumber from within class Restore methods
int GetBuildNumber( void );
private:
int buildNumber;
idFile * file;
idList<idClass *> objects;
void CallRestore_r( const idTypeInfo *cls, idClass *obj );
};
#endif /* !__SAVEGAME_H__*/
+424
View File
@@ -0,0 +1,424 @@
#include "precompiled.h"
#pragma hdrstop
#include "../Game_local.h"
const int HISTORY_COUNT = 50;
/*
=====================
stateParms_t::Save
=====================
*/
void stateParms_t::Save( idSaveGame *saveFile ) const {
saveFile->WriteInt( blendFrames );
saveFile->WriteInt( time );
saveFile->WriteInt( stage );
}
/*
=====================
stateParms_t::Restore
=====================
*/
void stateParms_t::Restore( idRestoreGame *saveFile ) {
saveFile->ReadInt( blendFrames );
saveFile->ReadInt( time );
saveFile->ReadInt( stage );
}
/*
=====================
stateCall_t::Save
=====================
*/
void stateCall_t::Save( idSaveGame *saveFile ) const {
saveFile->WriteString( state->name );
// TOSAVE: idLinkList<stateCall_t> node;
saveFile->WriteInt( flags );
saveFile->WriteInt( delay );
parms.Save( saveFile );
}
/*
=====================
stateCall_t::Save
=====================
*/
void stateCall_t::Restore( idRestoreGame *saveFile, const idClass* owner ) {
idStr name;
saveFile->ReadString( name );
state = owner->FindState( name );
saveFile->ReadInt( flags );
saveFile->ReadInt( delay );
parms.Restore( saveFile );
}
/*
=====================
rvStateThread::rvStateThread
=====================
*/
rvStateThread::rvStateThread ( void ) {
owner = NULL;
insertAfter = NULL;
lastResult = SRESULT_DONE;
states.Clear ( );
interrupted.Clear ( );
memset ( &fl, 0, sizeof(fl) );
}
/*
=====================
rvStateThread::~rvStateThread
=====================
*/
rvStateThread::~rvStateThread ( void ) {
Clear ( true );
}
/*
=====================
rvStateThread::SetOwner
=====================
*/
void rvStateThread::SetOwner ( idClass* _owner ) {
owner = _owner;
}
/*
=====================
rvStateThread::Post
=====================
*/
stateResult_t rvStateThread::PostState ( const char* name, int blendFrames, int delay, int flags ) {
const rvStateFunc<idClass>* func;
// Make sure the state exists before queueing it
if ( NULL == (func = owner->FindState ( name ) ) ) {
return SRESULT_ERROR;
}
stateCall_t* call;
call = new stateCall_t;
call->state = func;
call->delay = delay;
call->flags = flags;
call->parms.blendFrames = blendFrames;
call->parms.time = -1;
call->parms.stage = 0;
call->node.SetOwner ( call );
if ( fl.executing && insertAfter ) {
call->node.InsertAfter ( insertAfter->node );
} else {
call->node.AddToEnd ( states );
}
insertAfter = call;
return SRESULT_OK;
}
/*
=====================
rvStateThread::Set
=====================
*/
stateResult_t rvStateThread::SetState ( const char* name, int blendFrames, int delay, int flags ) {
Clear ( );
return PostState ( name, blendFrames, delay, flags );
}
/*
=====================
rvStateThread::InterruptState
=====================
*/
stateResult_t rvStateThread::InterruptState ( const char* name, int blendFrames, int delay, int flags ) {
stateCall_t* call;
// Move all states to the front of the interrupted list in the same order
for ( call = states.Prev(); call; call = states.Prev() ) {
call->node.Remove ( );
call->node.AddToFront ( interrupted );
}
// Nothing to insert after anymore
insertAfter = NULL;
fl.stateInterrupted = true;
// Post the state now
return PostState ( name, blendFrames, delay, flags );
}
/*
=====================
rvStateThread::CurrentStateIs
=====================
*/
bool rvStateThread::CurrentStateIs( const char* name ) const {
return ( !IsIdle() ) ? owner->FindState(name) == GetState()->state : false;
}
/*
=====================
rvStateThread::Clear
=====================
*/
void rvStateThread::Clear ( bool ignoreStateCalls ) {
stateCall_t* call;
// Clear all states from the main state list
for( call = states.Next(); call != NULL; call = states.Next() ) {
if ( !ignoreStateCalls && (call->flags & (SFLAG_ONCLEAR|SFLAG_ONCLEARONLY) ) ) {
owner->ProcessState ( call->state, call->parms );
}
call->node.Remove();
delete call;
}
// Clear all interrupted states
for( call = interrupted.Next(); call != NULL; call = interrupted.Next() ) {
if ( !ignoreStateCalls && (call->flags & (SFLAG_ONCLEAR|SFLAG_ONCLEARONLY) ) ) {
owner->ProcessState ( call->state, call->parms );
}
call->node.Remove();
delete call;
}
insertAfter = NULL;
fl.stateCleared = true;
states.Clear ( );
interrupted.Clear ( );
}
/*
=====================
rvStateThread::Execute
=====================
*/
stateResult_t rvStateThread::Execute ( void ) {
stateCall_t* call = NULL;
int count;
const char* stateName;
int stateStage;
const char* historyState[HISTORY_COUNT];
int historyStage[HISTORY_COUNT];
int historyStart;
int historyEnd;
// If our main state loop is empty copy over any states in the interrupted state
if ( !states.Next ( ) ) {
for ( call = interrupted.Next(); call; call = interrupted.Next() ) {
call->node.Remove ( );
call->node.AddToEnd ( states );
}
assert ( !interrupted.Next ( ) );
}
// State thread is idle if there are no states
if ( !states.Next() ) {
return SRESULT_IDLE;
}
fl.executing = true;
// Run through the states until there are no more or one of them tells us to wait
count = 0;
historyStart = 0;
historyEnd = 0;
for( call = states.Next(); call && count < HISTORY_COUNT; call = states.Next(), ++count ) {
insertAfter = call;
fl.stateCleared = false;
fl.stateInterrupted = false;
// If this state is only called when being cleared then just skip it
if ( call->flags & SFLAG_ONCLEARONLY ) {
call->node.Remove ( );
delete call;
continue;
}
// If the call has a delay on it the time will be set to negative initially and then
// converted to game time.
if ( call->parms.time <= 0 ) {
call->parms.time = gameLocal.time;
}
// Check for delayed states
if ( call->delay && gameLocal.time < call->parms.time + call->delay ) {
fl.executing = false;
return SRESULT_WAIT;
}
// Debugging
if ( lastResult != SRESULT_WAIT ) {
if ( *g_debugState.GetString ( ) && (*g_debugState.GetString ( ) == '*' || !idStr::Icmp ( g_debugState.GetString ( ), name ) ) ) {
if ( call->parms.stage ) {
gameLocal.Printf ( "%s: %s (%d)\n", name.c_str(), call->state->name, call->parms.stage );
} else {
gameLocal.Printf ( "%s: %s\n", name.c_str(), call->state->name );
}
}
// Keep a history of the called states so we can dump them on an overflow
historyState[historyEnd] = call->state->name;
historyStage[historyEnd] = call->parms.stage;
historyEnd = (historyEnd+1) % HISTORY_COUNT;
if ( historyEnd == historyStart ) {
historyStart = (historyEnd+1) % HISTORY_COUNT;
}
}
// Cache name and stage for error messages
stateName = call->state->name;
stateStage = call->parms.stage;
// Actually call the state function
lastResult = owner->ProcessState ( call->state, call->parms );
switch ( lastResult ) {
case SRESULT_WAIT:
fl.executing = false;
return SRESULT_WAIT;
case SRESULT_ERROR:
gameLocal.Error ( "rvStateThread: error reported by state '%s (%d)'", stateName, stateStage );
fl.executing = false;
return SRESULT_ERROR;
}
// Dont remove the node if it was interrupted or cleared in the last process
if ( !fl.stateCleared && !fl.stateInterrupted ) {
if( lastResult >= SRESULT_SETDELAY ) {
call->delay = lastResult - SRESULT_SETDELAY;
call->parms.time = gameLocal.GetTime();
continue;
} else if ( lastResult >= SRESULT_SETSTAGE ) {
call->parms.stage = lastResult - SRESULT_SETSTAGE;
continue;
}
// Done with state so remove it from list
call->node.Remove ( );
delete call;
}
// Finished the last state but wait a frame for next one
if ( lastResult == SRESULT_DONE_WAIT ) {
fl.executing = false;
return SRESULT_WAIT;
}
}
// Runaway state loop?
if ( count >= HISTORY_COUNT ) {
idFile *file;
fileSystem->RemoveFile ( "statedump.txt" );
file = fileSystem->OpenFileWrite( "statedump.txt" );
for ( ; historyStart != historyEnd; historyStart = (historyStart + 1) % HISTORY_COUNT ) {
if ( historyStage[historyStart] ) {
gameLocal.Printf ( "rvStateThread: %s (%d)\n", historyState[historyStart], historyStage[historyStart] );
} else {
gameLocal.Printf ( "rvStateThread: %s\n", historyState[historyStart] );
}
if ( file ) {
if ( historyStage[historyStart] ) {
file->Printf ( "rvStateThread: %s (%d)\n", historyState[historyStart], historyStage[historyStart] );
} else {
file->Printf ( "rvStateThread: %s\n", historyState[historyStart] );
}
}
}
if ( file ) {
fileSystem->CloseFile( file );
}
gameLocal.Error ( "rvStateThread: run away state loop '%s'", name.c_str() );
}
insertAfter = NULL;
fl.executing = false;
// Move interrupted states back into the main state list when the main state list is empty
if ( !states.Next() && interrupted.Next ( ) ) {
return Execute ( );
}
return lastResult;
}
/*
=====================
rvStateThread::Save
=====================
*/
void rvStateThread::Save( idSaveGame *saveFile ) const {
saveFile->WriteString( name.c_str() );
// No need to save owner, its setup in restore
saveFile->WriteInt( lastResult );
saveFile->Write ( &fl, sizeof(fl) );
saveFile->WriteInt( states.Num() );
for( idLinkList<stateCall_t>* node = states.NextNode(); node; node = node->NextNode() ) {
node->Owner()->Save( saveFile );
}
saveFile->WriteInt( interrupted.Num() );
for( idLinkList<stateCall_t>* node = interrupted.NextNode(); node; node = node->NextNode() ) {
node->Owner()->Save( saveFile );
}
// TOSAVE: stateCall_t* insertAfter;
// TOSAVE: stateResult_t lastResult;
}
/*
=====================
rvStateThread::Restore
=====================
*/
void rvStateThread::Restore( idRestoreGame *saveFile, idClass* owner ) {
int numStates;
stateCall_t* call = NULL;
saveFile->ReadString( name );
this->owner = owner;
saveFile->ReadInt( (int&)lastResult );
saveFile->Read ( &fl, sizeof(fl) );
saveFile->ReadInt( numStates );
for( ; numStates > 0; numStates-- ) {
call = new stateCall_t;
assert( call );
call->Restore( saveFile, owner );
call->node.SetOwner ( call );
call->node.AddToEnd ( states );
}
saveFile->ReadInt( numStates );
for( ; numStates > 0; numStates-- ) {
call = new stateCall_t;
assert( call );
call->Restore( saveFile, owner );
call->node.SetOwner ( call );
call->node.AddToEnd ( interrupted );
}
}
+157
View File
@@ -0,0 +1,157 @@
#ifndef __SYS_STATE_H__
#define __SYS_STATE_H__
typedef enum {
SRESULT_OK, // Call was made successfully
SRESULT_ERROR, // An unrecoverable error occurred
SRESULT_DONE, // Done with current state, move to next
SRESULT_DONE_WAIT, // Done with current state, wait a frame then move to next
SRESULT_WAIT, // Wait a frame and re-run current state
SRESULT_IDLE, // State thread is currently idle (ie. no states)
SRESULT_SETSTAGE, // Sets the current stage of the current state and reruns the state
// NOTE: this has to be the last result becuase the stage is added to
// the result.
SRESULT_SETDELAY = SRESULT_SETSTAGE + 20
} stateResult_t;
#define MAX_STATE_CALLS 50
#define SRESULT_STAGE(x) ((stateResult_t)((int)SRESULT_SETSTAGE + (int)(x)))
#define SRESULT_DELAY(x) ((stateResult_t)((int)SRESULT_SETDELAY + (int)(x)))
struct stateParms_t {
int blendFrames;
int time;
int stage;
void Save( idSaveGame *saveFile ) const;
void Restore( idRestoreGame *saveFile );
};
typedef stateResult_t ( idClass::*stateCallback_t )( const stateParms_t& parms );
template< class Type >
struct rvStateFunc {
const char* name;
stateCallback_t function;
};
/*
================
CLASS_STATES_PROTOTYPE
This macro must be included in the definition of any subclass of idClass that
wishes to have its own custom states. Its prototypes variables used in the process
of managing states.
================
*/
#define CLASS_STATES_PROTOTYPE(nameofclass) \
protected: \
static rvStateFunc<nameofclass> stateCallbacks[]
/*
================
CLASS_STATES_DECLARATION
This macro must be included in the code to properly initialize variables
used in state processing for a idClass dervied class
================
*/
#define CLASS_STATES_DECLARATION(nameofclass) \
rvStateFunc<nameofclass> nameofclass::stateCallbacks[] = {
/*
================
STATE
This macro declares a single state. It must be surrounded by the CLASS_STATES_DECLARATION
and END_CLASS_STATES macros.
================
*/
#define STATE(statename,function) { statename, (stateCallback_t)( &function ) },
/*
================
END_CLASS_STATES
Terminates a state block
================
*/
#define END_CLASS_STATES { NULL, NULL } };
struct stateCall_t {
const rvStateFunc<idClass>* state;
idLinkList<stateCall_t> node;
int flags;
int delay;
stateParms_t parms;
void Save( idSaveGame *saveFile ) const;
void Restore( idRestoreGame *saveFile, const idClass* owner );
};
class idClass;
const int SFLAG_ONCLEAR = BIT(0); // Executes, even if the state queue is cleared
const int SFLAG_ONCLEARONLY = BIT(1); // Executes only if the state queue is cleared
class rvStateThread {
public:
rvStateThread ( void );
~rvStateThread ( void );
void SetName ( const char* name );
void SetOwner ( idClass* owner );
bool Interrupt ( void );
stateResult_t InterruptState ( const char* state, int blendFrames = 0, int delay = 0, int flags = 0 );
stateResult_t PostState ( const char* state, int blendFrames = 0, int delay = 0, int flags = 0 );
stateResult_t SetState ( const char* state, int blendFrames = 0, int delay = 0, int flags = 0 );
stateCall_t* GetState ( void ) const;
bool CurrentStateIs ( const char* name ) const;
stateResult_t Execute ( void );
void Clear ( bool ignoreStateCalls = false );
bool IsIdle ( void ) const;
bool IsExecuting ( void ) const;
void Save( idSaveGame *saveFile ) const;
void Restore( idRestoreGame *saveFile, idClass* owner );
protected:
struct flags {
bool stateCleared :1; // State list was cleared
bool stateInterrupted :1; // State list was interrupted
bool executing :1; // Execute is currently processing states
} fl;
idStr name;
idClass* owner;
idLinkList<stateCall_t> states;
idLinkList<stateCall_t> interrupted;
stateCall_t* insertAfter;
stateResult_t lastResult;
};
ID_INLINE void rvStateThread::SetName ( const char* _name ) {
name = _name;
}
ID_INLINE stateCall_t* rvStateThread::GetState ( void ) const {
return states.Next();
}
ID_INLINE bool rvStateThread::IsIdle ( void ) const {
return !states.Next() && !interrupted.Next();
}
ID_INLINE bool rvStateThread::IsExecuting ( void ) const {
return fl.executing;
}
#endif // __SYS_STATE_H__
File diff suppressed because it is too large Load Diff
+11
View File
@@ -0,0 +1,11 @@
#ifndef __SYS_CMDS_H__
#define __SYS_CMDS_H__
void D_DrawDebugLines( void );
void KillEntities( const idCmdArgs &args, const idTypeInfo &superClass );
void GiveStuffToPlayer( idPlayer* player, const char* name, const char* value );
#endif /* !__SYS_CMDS_H__ */
+609
View File
@@ -0,0 +1,609 @@
#include "precompiled.h"
#pragma hdrstop
#include "../Game_local.h"
#if defined( _DEBUG )
#define BUILD_DEBUG "-debug"
#else
#define BUILD_DEBUG "-release"
#endif
/*
All game cvars should be defined here.
*/
// RAVEN BEGIN
// ddynerman: our gameplay modes
// RITUAL BEGIN
// squirrel: added DeadZone multiplayer mode
const char *si_gameTypeArgs[] = { "singleplayer", "DM", "Tourney", "Team DM", "CTF", "Arena CTF", "DeadZone", NULL };
const int si_numGameTypeArgs = sizeof( si_gameTypeArgs ) / sizeof( si_gameTypeArgs[0] );
// RITUAL END
// RAVEN END
const char *si_readyArgs[] = { "Not Ready", "Ready", NULL };
const char *si_spectateArgs[] = { "Play", "Spectate", NULL };
// RAVEN BEGIN
// ddynerman: our teams
const char *ui_teamArgs[] = { "Marine", "Strogg", NULL };
// RAVEN END
struct gameVersion_s {
gameVersion_s( void ) { sprintf( string, "%s %s V%s %s %s", GAME_NAME, GAME_BUILD_TYPE, VERSION_STRING_DOTTED, BUILD_STRING, __DATE__ ); }
char string[256];
} gameVersion;
idCVar g_version( "g_version", gameVersion.string, CVAR_GAME | CVAR_ROM, "game version" );
// noset vars
idCVar gamename( "gamename", GAME_VERSION, CVAR_GAME | CVAR_SERVERINFO | CVAR_ROM, "" );
idCVar gamedate( "gamedate", __DATE__, CVAR_GAME | CVAR_ROM, "" );
// server info
idCVar si_name( "si_name", "Quake 4 Server", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE | CVAR_CASE_SENSITIVE | CVAR_SPECIAL_CONCAT, "name of the server" );
// RITUAL BEGIN
// squirrel: added DeadZone multiplayer mode
//idCVar sq_numRoundsPerMatch( "dz_numRoundsPerMatch", "5", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_INTEGER, "number of rounds per match in DeadZone", 1, 999999 );
//idCVar sq_buyFreezeSeconds( "dz_buyFreezeSeconds", "3", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_INTEGER, "number of seconds players are frozen at the start of each round in DeadZone", 0, 30 );
//idCVar sq_buyTimeSeconds( "dz_buyTimeSeconds", "20", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_INTEGER, "number of additional seconds after buy freeze that buy zones are active", 0, 999999 );
// squirrel: Mode-agnostic buymenus
idCVar si_isBuyingEnabled( "si_isBuyingEnabled", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_BOOL, "enable buying in current mode" );
idCVar si_dropWeaponsInBuyingModes( "si_dropWeaponsInBuyingModes", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_BOOL, "dead players drop weapons, even in Buying game modes" );
// RITUAL END
// RAVEN BEGIN
// ddynerman: new gametype strings
idCVar si_gameType( "si_gameType", si_gameTypeArgs[ 0 ], CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE, "game type - singleplayer, DM, Tourney, Team DM, CTF, Arena CTF, or DeadZone", si_gameTypeArgs, idCmdSystem::ArgCompletion_String<si_gameTypeArgs> );
idCVar si_map( "si_map", "mp/q4dm1", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE, "map to be played next on server", idCmdSystem::ArgCompletion_MapName );
idCVar si_mapCycle( "si_mapCycle", "", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE, "map cycle list semicolon delimited" );
// bdube: raise player limit
idCVar si_maxPlayers( "si_maxPlayers", "12", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE | CVAR_INTEGER, "max number of players allowed on the server", 1, 16 );
// ddynerman: min players to start
idCVar si_minPlayers( "si_minPlayers", "1", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE | CVAR_INTEGER, "min number of players to start a game (only when warmup is enabled)", 1, 16 );
// ddynerman: CTF
idCVar si_captureLimit( "si_captureLimit", "5", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE | CVAR_INTEGER, "score limit for CTF", 1, MP_PLAYER_MAXFRAGS );
// shouchard: for tourney
idCVar si_tourneyLimit( "si_tourneyLimit", "3", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_INTEGER, "number of times a tourney will be run before cycling maps", 1, MP_PLAYER_MAXFRAGS );
idCVar si_useReady( "si_useReady", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_BOOL, "require players to ready before starting a match" );
idCVar si_allowVoting( "si_allowVoting", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_BOOL, "enable or disable server option voting" );
// ddynerman: disable hitscan tint
idCVar si_allowHitscanTint( "si_allowHitscanTint", "2", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE | CVAR_INTEGER, "use hitscan tint (e.g. rail color) 0 - no tinting allowed, 1 - player hitscan tinting allowed in DM and NO hitscan tinting in team games, 2 - player hitscan tinting allowed in DM and use team-color hitscan tints in team games" );
idCVar si_privatePlayers( "si_privatePlayers", "0", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE | CVAR_INTEGER, "number of private player slots reserved on the server. subtracts from si_maxPlayers, so a server with si_maxPlayers 16 and 4 private player slots will only allow 12 public players to connect - see g_privatePassword, privatePassword", 0, 16 );
idCVar g_privatePassword( "g_privatePassword", "", CVAR_GAME | PC_CVAR_ARCHIVE, "server-side password to access reserved client slots, clients set privatePassword" );
idCVar privatePassword( "privatePassword", "", CVAR_GAME | CVAR_NOCHEAT, "client password used to access a servers private player slots" );
idCVar si_numPrivatePlayers( "si_numPrivatePlayers", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_ROM, "number of private slots currently in use" );
idCVar si_suddenDeathRestart( "si_suddenDeathRestart", "1", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE, "toggles whether or not to respawn players/items when team games enter sudden death" );
// RAVEN END
idCVar si_fragLimit( "si_fragLimit", "10", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE | CVAR_INTEGER, "frag limit", 0, MP_PLAYER_MAXFRAGS );
idCVar si_timeLimit( "si_timeLimit", "10", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE | CVAR_INTEGER, "time limit in minutes", 0, 60 );
idCVar si_teamDamage( "si_teamDamage", "0", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE | CVAR_BOOL, "enable team damage" );
idCVar si_warmup( "si_warmup", "1", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE | CVAR_BOOL, "do pre-game warmup" );
idCVar si_usePass( "si_usePass", "0", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE | CVAR_BOOL, "enable client password checking" );
#ifdef _MPBETA
idCVar si_pure( "si_pure", "1", CVAR_GAME | CVAR_SERVERINFO | CVAR_BOOL | CVAR_ROM, "server is pure and does not allow modified data" );
#else
idCVar si_pure( "si_pure", "1", CVAR_GAME | CVAR_SERVERINFO | CVAR_BOOL, "server is pure and does not allow modified data" );
#endif // _MPBETA
idCVar si_spectators( "si_spectators", "1", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE | CVAR_BOOL, "allow spectators or require all clients to play" );
idCVar si_shuffle( "si_shuffle", "0", CVAR_GAME | CVAR_SERVERINFO | PC_CVAR_ARCHIVE | CVAR_BOOL, "shuffle teams after each round" );
// shouchard: g_balanceTDM->si_autobalance so we can also use it for CTF
// asalmon: Changed to archive only on PC
idCVar si_autobalance( "si_autobalance", "1", CVAR_GAME | CVAR_SERVERINFO | CVAR_BOOL | PC_CVAR_ARCHIVE, "maintain even teams" );
// RAVEN BEGIN
// jscott: added entity filtering
idCVar si_entityFilter( "si_entityFilter", "", CVAR_GAME | CVAR_SERVERINFO, "filter to use when spawning entities" );
idCVar si_countDown( "si_countDown", "10", CVAR_GAME | CVAR_SERVERINFO | CVAR_INTEGER, "pregame countdown in seconds", 4, 3600 );
// MCG: added "weapon stay" option
idCVar si_weaponStay( "si_weaponStay", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_BOOL, "cannot pick up weapons you already have (get no ammo from them)" );
// RAVEN END
// RITUAL BEGIN
// DeadZone Mode and Buying related CVARS
idCVar si_deadZonePowerupTime( "si_deadZonePowerupTime", "45", CVAR_GAME | CVAR_SERVERINFO | CVAR_INTEGER, "Amount of time the dead zone powerup lasts" );
idCVar si_buyModeStartingCredits( "si_buyModeStartingCredits", "1000", CVAR_GAME | CVAR_SERVERINFO | CVAR_INTEGER, "Amount of credits players start with in buying enable games" );
idCVar si_buyModeMaxCredits( "si_buyModeMaxCredits", "25000", CVAR_GAME | CVAR_SERVERINFO | CVAR_INTEGER, "Maximum amount of credits in buying enable games" );
idCVar si_buyModeMinCredits( "si_buyModeMinCredits", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_INTEGER, "Minimum amount of credits in buying enable games" );
idCVar si_controlTime( "si_controlTime", "120", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_INTEGER, "Time required to hold the dead zone", 1, 999 );
// RITUAL END
// user info
idCVar ui_name( "ui_name", "Player", CVAR_GAME | CVAR_USERINFO | PC_CVAR_ARCHIVE | CVAR_CASE_SENSITIVE | CVAR_SPECIAL_CONCAT, "player name" );
idCVar ui_team( "ui_team", ui_teamArgs[ 0 ], CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE, "player team", ui_teamArgs, idCmdSystem::ArgCompletion_String<ui_teamArgs> );
// RAVEN BEGIN
// ddynerman: new UI cvars
idCVar ui_model( "ui_model", "", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE, "player model, blank uses default model" );
idCVar ui_model_backup( "ui_model_backup", "", CVAR_GAME | CVAR_USERINFO, "player model backup" );
idCVar ui_model_marine( "ui_model_marine", "", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE, "player model used on marine team in team games, blank uses default model" );
idCVar ui_model_strogg( "ui_model_strogg", "", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE, "player model used on strogg team in team games, blank uses default model" );
idCVar ui_clan( "ui_clan", "", CVAR_GAME | CVAR_USERINFO | PC_CVAR_ARCHIVE | CVAR_CASE_SENSITIVE | CVAR_SPECIAL_CONCAT, "player clan" );
idCVar ui_hitscanTint( "ui_hitscanTint", "120.0 0.6 1.0", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE, "a tint applied to select hitscan effects. Specified as a value in HSV color space. Hue [0.0-360.0] Saturation [0.0-1.0] Value [0.75-1.0]" );
// RAVEN END
idCVar ui_autoSwitch( "ui_autoSwitch", "1", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "auto switch weapon" );
idCVar ui_autoReload( "ui_autoReload", "1", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "auto reload weapon" );
idCVar ui_showGun( "ui_showGun", "1", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "show gun" );
idCVar ui_ready( "ui_ready", si_readyArgs[ 0 ], CVAR_GAME | CVAR_USERINFO, "player is ready to start playing", idCmdSystem::ArgCompletion_String<si_readyArgs> );
idCVar ui_spectate( "ui_spectate", si_spectateArgs[ 0 ], CVAR_GAME | CVAR_USERINFO, "play or spectate", idCmdSystem::ArgCompletion_String<si_spectateArgs> );
idCVar ui_chat( "ui_chat", "0", CVAR_GAME | CVAR_USERINFO | CVAR_BOOL | CVAR_ROM | CVAR_CHEAT, "player is chatting" );
// change anytime vars
idCVar developer( "developer", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_forceModel( "g_forceModel", "", CVAR_GAME | CVAR_ARCHIVE, "Locally forces all players to this model in non-team gameplay modes. See g_forceStroggModel, g_forceMarineModel. listModels to list available models", idCmdSystem::ArgCompletion_ForceModel );
idCVar g_forceStroggModel( "g_forceStroggModel", "", CVAR_GAME | CVAR_ARCHIVE, "Locally forces Strogg team players to this model in team gameplay modes. See g_forceModel. listModels to list available models", idCmdSystem::ArgCompletion_ForceModelStrogg );
idCVar g_forceMarineModel( "g_forceMarineModel", "", CVAR_GAME | CVAR_ARCHIVE, "Locally forces Marine team players to this model in team gameplay modes. See g_forceModel. listModels to list available models", idCmdSystem::ArgCompletion_ForceModelMarine );
// RAVEN BEGIN
// jnewquist: vertical stretch for letterboxed cinematics authored for 4:3 aspect
idCVar g_fixedHorizFOV( "r_fixedHorizFOV", "0", CVAR_RENDERER | CVAR_BOOL, "vertical stretch for letterboxed cinematics authored for 4:3 aspect" );
idCVar g_cinematic( "g_cinematic", "1", CVAR_GAME | CVAR_BOOL, "skips updating entities that aren't marked 'cinematic' '1' during cinematics" );
idCVar g_cinematicMaxSkipTime( "g_cinematicMaxSkipTime", "600", CVAR_GAME | CVAR_FLOAT, "# of seconds to allow game to run when skipping cinematic. prevents lock-up when cinematic doesn't end.", 0, 3600 );
idCVar g_muzzleFlash( "g_muzzleFlash", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "show muzzle flashes" );
idCVar g_projectileLights( "g_projectileLights", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "show dynamic lights on projectiles" );
idCVar g_doubleVision( "g_doubleVision", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "show double vision when taking damage" );
idCVar g_monsters( "g_monsters", "1", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_decals( "g_decals", "1", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_BOOL, "show decals such as bullet holes" );
idCVar g_knockback( "g_knockback", "1000", CVAR_GAME | CVAR_INTEGER, "" );
idCVar g_skill( "g_skill", "1", CVAR_GAME | CVAR_INTEGER, "difficulty level", 0, MAX_SKILL_LEVELS - 1 );
idCVar g_nightmare( "g_nightmare", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "if nightmare mode is allowed" );
idCVar g_gravity( "g_gravity", DEFAULT_GRAVITY_STRING, CVAR_GAME | CVAR_FLOAT, "singleplayer gravity" );
idCVar g_mp_gravity( "g_mp_gravity", DEFAULT_MP_GRAVITY_STRING, CVAR_GAME | CVAR_FLOAT, "multiplayer gravity" );
idCVar g_skipFX( "g_skipFX", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_skipParticles( "g_skipParticles", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_disasm( "g_disasm", "0", CVAR_GAME | CVAR_BOOL, "disassemble script into base/script/disasm.txt on the local drive when script is compiled" );
idCVar g_debugBounds( "g_debugBounds", "0", CVAR_GAME | CVAR_BOOL, "checks for models with bounds > 2048" );
idCVar g_debugAnim( "g_debugAnim", "-1", CVAR_GAME | CVAR_INTEGER, "displays information on which animations are playing on the specified entity number. set to -1 to disable." );
idCVar g_debugMove( "g_debugMove", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_debugDamage( "g_debugDamage", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_debugWeapon( "g_debugWeapon", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_debugScript( "g_debugScript", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_debugMover( "g_debugMover", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_debugTriggers( "g_debugTriggers", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_debugCinematic( "g_debugCinematic", "0", CVAR_GAME, "set to the name of the state you want to debug or * for all" );
// RAVEN BEGIN
// bdube: added
idCVar g_debugState( "g_debugState", "0", CVAR_GAME, "" );
idCVar g_stopTime( "g_stopTime", "0", CVAR_GAME | CVAR_BOOL, "" );
//idCVar g_damageScale( "g_damageScale", "1", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "scale final damage on player by this factor" );
// RAVEN END
idCVar g_armorProtection( "g_armorProtection", "0.66667", CVAR_GAME | CVAR_FLOAT | PC_CVAR_ARCHIVE, "armor takes this percentage of damage" );
idCVar g_armorProtectionMP( "g_armorProtectionMP", "0.66667", CVAR_GAME | CVAR_FLOAT | PC_CVAR_ARCHIVE, "armor takes this percentage of damage in mp" );
idCVar g_useDynamicProtection( "g_useDynamicProtection", "1", CVAR_GAME | CVAR_BOOL | PC_CVAR_ARCHIVE, "scale damage and armor dynamically to keep the player alive more often" );
idCVar g_healthTakeTime( "g_healthTakeTime", "5", CVAR_GAME | CVAR_INTEGER | PC_CVAR_ARCHIVE, "how often to take health in nightmare mode" );
idCVar g_healthTakeAmt( "g_healthTakeAmt", "5", CVAR_GAME | CVAR_INTEGER | PC_CVAR_ARCHIVE, "how much health to take in nightmare mode" );
idCVar g_healthTakeLimit( "g_healthTakeLimit", "25", CVAR_GAME | CVAR_INTEGER | PC_CVAR_ARCHIVE, "how low can health get taken in nightmare mode" );
idCVar g_showPVS( "g_showPVS", "0", CVAR_GAME | CVAR_INTEGER, "", 0, 2 );
idCVar g_showTargets( "g_showTargets", "0", CVAR_GAME | CVAR_BOOL, "draws entities and thier targets. hidden entities are drawn grey." );
idCVar g_showTriggers( "g_showTriggers", "0", CVAR_GAME | CVAR_BOOL, "draws trigger entities (orange) and thier targets (green). disabled triggers are drawn grey." );
idCVar g_showCollisionWorld( "g_showCollisionWorld", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_showCollisionModels( "g_showCollisionModels", "0", CVAR_GAME | CVAR_INTEGER, "0 = off, 1 = draw collision models, 2 = only draw player collision models. g_maxShowDistance controls distance." );
// RAVEN BEGIN
// rjohnson: added debug line drawing for traces
idCVar g_showCollisionTraces( "g_showCollisionTraces", "0", CVAR_GAME | CVAR_INTEGER, "", 0, 2 );
// ddynerman: SD's clip sector code
idCVar g_showClipSectors( "g_showClipSectors", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_showClipSectorFilter( "g_showClipSectorFilter", "0", CVAR_GAME, "" );
idCVar g_showAreaClipSectors( "g_showAreaClipSectors", "0", CVAR_GAME | CVAR_FLOAT, "" );
// RAVEN END
idCVar g_maxShowDistance( "g_maxShowDistance", "128", CVAR_GAME | CVAR_FLOAT, "Distance at which to draw clipmodels and clipworld - Will significantly hurt performance at values above 512" );
idCVar g_showEntityInfo( "g_showEntityInfo", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_showviewpos( "g_showviewpos", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_showcamerainfo( "g_showcamerainfo", "0", CVAR_GAME | PC_CVAR_ARCHIVE, "displays the current frame # for the camera when playing cinematics" );
idCVar g_showTestModelFrame( "g_showTestModelFrame", "0", CVAR_GAME | CVAR_BOOL, "displays the current animation and frame # for testmodels" );
idCVar g_showActiveEntities( "g_showActiveEntities", "0", CVAR_GAME | CVAR_BOOL, "draws boxes around thinking entities. dormant entities (outside of pvs) are drawn yellow. non-dormant are green." );
idCVar g_showEnemies( "g_showEnemies", "0", CVAR_GAME | CVAR_BOOL, "draws boxes around monsters that have targeted the the player" );
idCVar g_frametime( "g_frametime", "0", CVAR_GAME | CVAR_BOOL, "displays timing information for each game frame" );
idCVar g_timeentities( "g_timeEntities", "0", CVAR_GAME | CVAR_FLOAT, "when non-zero, shows entities whose think functions exceeded the # of milliseconds specified" );
// RAVEN BEGIN
// bdube: frame command debugging
idCVar g_showFrameCmds( "g_showFrameCmds", "0", CVAR_GAME | CVAR_BOOL, "displays frame commands as they are executed" );
idCVar g_showGodDamage( "g_showGodDamage", "0", CVAR_GAME | CVAR_BOOL, "displays the amount of damage taken while in god mode on the hud" );
idCVar g_debugVehicle( "g_debugVehicle", "0", CVAR_GAME | CVAR_INTEGER, "" );
// RAVEN END
// RAVEN BEGIN
// twhitaker: for rvVehicleDriver
idCVar g_debugVehicleDriver( "g_debugVehicleDriver", "0", CVAR_GAME | CVAR_INTEGER, "enables debug features for the func_vehicle_driver" );
idCVar g_debugVehicleAI( "g_debugVehicleAI", "0", CVAR_GAME | CVAR_INTEGER, "enables debug features for the vehicle ai system" );
idCVar g_vehicleMode( "g_vehicleMode", "1", CVAR_GAME | CVAR_INTEGER, "enables the new vehicle control system for the GEV." );
// RAVEN END
idCVar g_allowVehicleGunOverheat( "g_allowVehicleGunOverheat","1", CVAR_GAME | CVAR_BOOL, "allows disabling the gun overheating mechanism for vehicles that use it." );
idCVar ai_debugScript( "ai_debugScript", "-1", CVAR_GAME | CVAR_INTEGER, "displays script calls for the specified monster entity number" );
idCVar ai_debugMove( "ai_debugMove", "0", CVAR_GAME | CVAR_BOOL, "draws movement information for monsters" );
idCVar ai_debugTrajectory( "ai_debugTrajectory", "0", CVAR_GAME | CVAR_BOOL, "draws trajectory tests for monsters" );
idCVar ai_debugTactical( "ai_debugTactical", "0", CVAR_GAME, "draws tactical information for monsters" );
idCVar ai_debugHelpers( "ai_debugHelpers", "0", CVAR_GAME, "draws ai helpers" );
idCVar ai_debugFilterString( "ai_debugFilterString", "", CVAR_GAME, "see ai_debugFilter" );
idCVar ai_testPredictPath( "ai_testPredictPath", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar ai_showCombatNodes( "ai_showCombatNodes", "0", CVAR_GAME | CVAR_BOOL, "draws attack cones for monsters" );
idCVar ai_showPaths( "ai_showPaths", "0", CVAR_GAME | CVAR_BOOL, "draws path_* entities" );
idCVar ai_showObstacleAvoidance( "ai_showObstacleAvoidance", "0", CVAR_GAME | CVAR_INTEGER, "draws obstacle avoidance information for monsters. if 2, draws obstacles for player, as well", 0, 2, idCmdSystem::ArgCompletion_Integer<0,2> );
idCVar ai_blockedFailSafe( "ai_blockedFailSafe", "1", CVAR_GAME | CVAR_BOOL, "enable blocked fail safe handling" );
idCVar ai_debugSquad( "ai_debugSquad", "0", CVAR_GAME | CVAR_BOOL, "draws squad info for allies" );
idCVar ai_debugStealth( "ai_debugStealth", "0", CVAR_GAME | CVAR_INTEGER, "draws suspicion info for enemies" );
idCVar ai_allowTacticalRush( "ai_allowTacticalRush", "1", CVAR_GAME | CVAR_BOOL, "allows tactical ai to rush an enemy when hurt" );
// RAVEN BEGIN
// nmckenzie: added speeds and freeze
idCVar ai_speeds( "ai_speeds", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar ai_freeze( "ai_freeze", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar ai_animShow( "ai_animShow", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar ai_showCover( "ai_showCover", "0", CVAR_GAME | CVAR_INTEGER, "" );
idCVar ai_showTacticalFeatures( "ai_showTacticalFeatures", "0", CVAR_GAME | CVAR_INTEGER, "" );
idCVar ai_disableEntTactical( "ai_disableEntTactical", "0", CVAR_GAME | CVAR_BOOL, "disables tactical points around entities" );
idCVar ai_disableAttacks( "ai_disableAttacks", "0", CVAR_GAME | CVAR_BOOL, "disables attack decisions" );
idCVar ai_disableSimpleThink( "ai_disableSimpleThink", "0", CVAR_GAME | CVAR_BOOL, "disables simple thinking in AI entities" );
idCVar ai_disableCover( "ai_disableCover", "0", CVAR_GAME | CVAR_BOOL, "disables AI using cover points" );
//cdr: use new master move functions
idCVar ai_useRVMasterMove( "ai_useRVMasterMove", "0", CVAR_GAME | CVAR_BOOL, "changes AI to use new master move function" );
//jshepard: allow out of date AAS files to be used, for testing
idCVar ai_allowOldAAS( "ai_allowOldAAS", "0", CVAR_GAME | CVAR_BOOL, "allows AI to use most recent AAS file, even if it is not up-to-date. Enable only for testing.");
// twhitaker: debugging support for eye focus
idCVar ai_debugEyeFocus( "ai_debugEyeFocus", "0", CVAR_GAME | CVAR_BOOL, "draws eye focus info" );
//mcg: always allow player to push buddies, unless scripted
idCVar ai_playerPushAlways( "ai_playerPushAlways", "1", CVAR_GAME | CVAR_BOOL, "always allow player to push buddies, unless scripted" );
// RAVEN END
idCVar g_dvTime( "g_dvTime", "1", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_dvAmplitude( "g_dvAmplitude", "0.001", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_dvFrequency( "g_dvFrequency", "0.5", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_kickTime( "g_kickTime", "1", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_kickAmplitude( "g_kickAmplitude", "0.0001", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_blobTime( "g_blobTime", "1", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_blobSize( "g_blobSize", "1", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_testHealthVision( "g_testHealthVision", "0", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_editEntityMode( "g_editEntityMode", "0", CVAR_GAME | CVAR_INTEGER, "0 = off\n"
"1 = lights\n"
"2 = sounds\n"
"3 = articulated figures\n"
"4 = particle systems\n"
"5 = monsters\n"
"6 = entity names\n"
// RAVEN BEGIN
// bdube: extended
"7 = entity models\n"
"8 = effects", 0, 8, idCmdSystem::ArgCompletion_Integer<0,8> );
// rhummer: Added archive flag.
idCVar g_editEntityDistance( "g_editEntityDistance", "512", CVAR_GAME | CVAR_ARCHIVE, "range to display entities to edit" );
// rhummer: Allow to customize the distance the text is drawn for edit entities, Zack request. Also added archive flag.
idCVar g_editEntityTextDistance( "g_editEntityTextDistance", "256", CVAR_GAME | CVAR_ARCHIVE, "range to display entities to edit text information");
idCVar g_testCTF( "g_testCTF", "0", CVAR_GAME | CVAR_CHEAT | CVAR_BOOL, "" );
// rjohnson: entity usage stats
idCVar g_keepEntityStats( "g_keepEntityStats", "0", CVAR_GAME | CVAR_CHEAT |CVAR_BOOL, "keep track of entity usage stats" );
// RAVEN END
idCVar g_dragEntity( "g_dragEntity", "0", CVAR_GAME | CVAR_BOOL, "allows dragging physics objects around by placing the crosshair over them and holding the fire button" );
idCVar g_dragDamping( "g_dragDamping", "0.5", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_dragShowSelection( "g_dragShowSelection", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_dropItemRotation( "g_dropItemRotation", "", CVAR_GAME, "" );
idCVar g_vehicleVelocity( "g_vehicleVelocity", "1000", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_vehicleForce( "g_vehicleForce", "50000", CVAR_GAME | CVAR_FLOAT, "" );
idCVar ik_enable( "ik_enable", "1", CVAR_GAME | CVAR_BOOL, "enable IK" );
idCVar ik_debug( "ik_debug", "0", CVAR_GAME | CVAR_BOOL, "show IK debug lines" );
idCVar af_useLinearTime( "af_useLinearTime", "1", CVAR_GAME | CVAR_BOOL, "use linear time algorithm for tree-like structures" );
idCVar af_useImpulseFriction( "af_useImpulseFriction", "0", CVAR_GAME | CVAR_BOOL, "use impulse based contact friction" );
idCVar af_useJointImpulseFriction( "af_useJointImpulseFriction","0", CVAR_GAME | CVAR_BOOL, "use impulse based joint friction" );
idCVar af_useSymmetry( "af_useSymmetry", "1", CVAR_GAME | CVAR_BOOL, "use constraint matrix symmetry" );
idCVar af_skipSelfCollision( "af_skipSelfCollision", "0", CVAR_GAME | CVAR_BOOL, "skip self collision detection" );
idCVar af_skipLimits( "af_skipLimits", "0", CVAR_GAME | CVAR_BOOL, "skip joint limits" );
idCVar af_skipFriction( "af_skipFriction", "0", CVAR_GAME | CVAR_BOOL, "skip friction" );
idCVar af_forceFriction( "af_forceFriction", "-1", CVAR_GAME | CVAR_FLOAT, "force the given friction value" );
idCVar af_maxLinearVelocity( "af_maxLinearVelocity", "128", CVAR_GAME | CVAR_FLOAT, "maximum linear velocity" );
idCVar af_maxAngularVelocity( "af_maxAngularVelocity", "1.57", CVAR_GAME | CVAR_FLOAT, "maximum angular velocity" );
idCVar af_timeScale( "af_timeScale", "1", CVAR_GAME | CVAR_FLOAT, "scales the time" );
idCVar af_jointFrictionScale( "af_jointFrictionScale", "0", CVAR_GAME | CVAR_FLOAT, "scales the joint friction" );
idCVar af_contactFrictionScale( "af_contactFrictionScale", "0", CVAR_GAME | CVAR_FLOAT, "scales the contact friction" );
idCVar af_highlightBody( "af_highlightBody", "", CVAR_GAME, "name of the body to highlight" );
idCVar af_highlightConstraint( "af_highlightConstraint", "", CVAR_GAME, "name of the constraint to highlight" );
idCVar af_showTimings( "af_showTimings", "0", CVAR_GAME | CVAR_BOOL, "show articulated figure cpu usage" );
idCVar af_showConstraints( "af_showConstraints", "0", CVAR_GAME | CVAR_BOOL, "show constraints" );
idCVar af_showConstraintNames( "af_showConstraintNames", "0", CVAR_GAME | CVAR_BOOL, "show constraint names" );
idCVar af_showConstrainedBodies( "af_showConstrainedBodies", "0", CVAR_GAME | CVAR_BOOL, "show the two bodies contrained by the highlighted constraint" );
idCVar af_showPrimaryOnly( "af_showPrimaryOnly", "0", CVAR_GAME | CVAR_BOOL, "show primary constraints only" );
idCVar af_showTrees( "af_showTrees", "0", CVAR_GAME | CVAR_BOOL, "show tree-like structures" );
idCVar af_showLimits( "af_showLimits", "0", CVAR_GAME | CVAR_BOOL, "show joint limits" );
idCVar af_showBodies( "af_showBodies", "0", CVAR_GAME | CVAR_BOOL, "show bodies" );
idCVar af_showBodyNames( "af_showBodyNames", "0", CVAR_GAME | CVAR_BOOL, "show body names" );
idCVar af_showMass( "af_showMass", "0", CVAR_GAME | CVAR_BOOL, "show the mass of each body" );
idCVar af_showTotalMass( "af_showTotalMass", "0", CVAR_GAME | CVAR_BOOL, "show the total mass of each articulated figure" );
idCVar af_showInertia( "af_showInertia", "0", CVAR_GAME | CVAR_BOOL, "show the inertia tensor of each body" );
idCVar af_showVelocity( "af_showVelocity", "0", CVAR_GAME | CVAR_BOOL, "show the velocity of each body" );
idCVar af_showActive( "af_showActive", "0", CVAR_GAME | CVAR_BOOL, "show tree-like structures of articulated figures not at rest" );
idCVar af_testSolid( "af_testSolid", "1", CVAR_GAME | CVAR_BOOL, "test for bodies initially stuck in solid" );
idCVar rb_showTimings( "rb_showTimings", "0", CVAR_GAME | CVAR_BOOL, "show rigid body cpu usage" );
idCVar rb_showBodies( "rb_showBodies", "0", CVAR_GAME | CVAR_BOOL, "show rigid bodies" );
idCVar rb_showMass( "rb_showMass", "0", CVAR_GAME | CVAR_BOOL, "show the mass of each rigid body" );
idCVar rb_showInertia( "rb_showInertia", "0", CVAR_GAME | CVAR_BOOL, "show the inertia tensor of each rigid body" );
idCVar rb_showVelocity( "rb_showVelocity", "0", CVAR_GAME | CVAR_BOOL, "show the velocity of each rigid body" );
idCVar rb_showActive( "rb_showActive", "0", CVAR_GAME | CVAR_BOOL, "show rigid bodies that are not at rest" );
// RAVEN BEGIN
// bdube: more rigid body debug
idCVar rb_showContacts( "rb_showContacts", "0", CVAR_GAME | CVAR_BOOL, "show rigid body contacts" );
// RAVEN END
// The default values for player movement cvars are set in def/player.def
idCVar pm_jumpheight( "pm_jumpheight", "48", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "approximate hieght the player can jump" );
idCVar pm_stepsize( "pm_stepsize", "16", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "maximum height the player can step up without jumping" );
idCVar pm_crouchspeed( "pm_crouchspeed", "80", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "speed the player can move while crouched" );
// RAVEN BEGIN
idCVar pm_speed( "pm_speed", "160", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "speed the player can move while running" );
idCVar pm_walkspeed( "pm_walkspeed", "80", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "speed the player can move while walking" );
// RAVEN END
idCVar pm_noclipspeed( "pm_noclipspeed", "270", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "speed the player can move while in noclip" );
idCVar pm_spectatespeed( "pm_spectatespeed", "450", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "speed the player can move while spectating" );
idCVar pm_spectatebbox( "pm_spectatebbox", "32", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "size of the spectator bounding box" );
idCVar pm_usecylinder( "pm_usecylinder", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_BOOL | CVAR_NORESET, "use a cylinder approximation instead of a bounding box for player collision detection" );
idCVar pm_minviewpitch( "pm_minviewpitch", "-89", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "amount player's view can look up (negative values are up)" );
idCVar pm_maxviewpitch( "pm_maxviewpitch", "89", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "amount player's view can look down" );
idCVar pm_stamina( "pm_stamina", "24", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "length of time player can run" );
idCVar pm_staminathreshold( "pm_staminathreshold", "45", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "when stamina drops below this value, player gradually slows to a walk" );
idCVar pm_staminarate( "pm_staminarate", "0.75", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "rate that player regains stamina. divide pm_stamina by this value to determine how long it takes to fully recharge." );
// ddynerman: adjusted bboxes to actual height
idCVar pm_normalheight( "pm_normalheight", "77", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "height of player's bounding box while standing" );
idCVar pm_crouchheight( "pm_crouchheight", "49", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "height of player's bounding box while crouched" );
idCVar pm_crouchviewheight( "pm_crouchviewheight", "32", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "height of player's view while crouched" );
idCVar pm_normalviewheight( "pm_normalviewheight", "68", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "height of player's view while standing" );
idCVar pm_deadheight( "pm_deadheight", "20", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "height of player's bounding box while dead" );
idCVar pm_deadviewheight( "pm_deadviewheight", "10", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "height of player's view while dead" );
idCVar pm_crouchrate( "pm_crouchrate", "0.87", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "time it takes for player's view to change from standing to crouching" );
idCVar pm_bboxwidth( "pm_bboxwidth", "32", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NORESET, "x/y size of player's bounding box" );
idCVar pm_crouchbob( "pm_crouchbob", "0.5", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NOCHEAT | CVAR_NORESET, "bob much faster when crouched" );
idCVar pm_walkbob( "pm_walkbob", "0.3", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NOCHEAT | CVAR_NORESET, "bob slowly when walking" );
idCVar pm_runbob( "pm_runbob", "0.4", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NOCHEAT | CVAR_NORESET, "bob faster when running" );
idCVar pm_runpitch( "pm_runpitch", "0.002", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NOCHEAT | CVAR_NORESET, "" );
idCVar pm_runroll( "pm_runroll", "0.005", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NOCHEAT | CVAR_NORESET, "" );
idCVar pm_bobup( "pm_bobup", "0.005", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NOCHEAT | CVAR_NORESET, "" );
idCVar pm_bobpitch( "pm_bobpitch", "0.002", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NOCHEAT | CVAR_NORESET, "" );
idCVar pm_bobroll( "pm_bobroll", "0.002", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_NOCHEAT, "" );
idCVar pm_thirdPersonRange( "pm_thirdPersonRange", "80", CVAR_GAME | CVAR_FLOAT | CVAR_NORESET, "camera distance from player in 3rd person" );
idCVar pm_thirdPersonHeight( "pm_thirdPersonHeight", "0", CVAR_GAME | CVAR_FLOAT | CVAR_NORESET, "height of camera from normal view height in 3rd person" );
idCVar pm_thirdPersonAngle( "pm_thirdPersonAngle", "0", CVAR_GAME | CVAR_FLOAT | CVAR_NORESET, "direction of camera from player in 3rd person in degrees (0 = behind player, 180 = in front)" );
idCVar pm_thirdPersonClip( "pm_thirdPersonClip", "1", CVAR_GAME | CVAR_BOOL, "clip third person view into world space" );
idCVar pm_thirdPerson( "pm_thirdPerson", "0", CVAR_GAME | CVAR_BOOL, "enables third person view" );
idCVar pm_thirdPersonDeath( "pm_thirdPersonDeath", "0", CVAR_GAME | CVAR_BOOL, "enables third person view when player dies" );
idCVar pm_modelView( "pm_modelView", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_INTEGER, "draws camera from POV of player model (1 = always, 2 = when dead)", 0, 2, idCmdSystem::ArgCompletion_Integer<0,2> );
idCVar pm_airTics( "pm_air", "1800", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_INTEGER, "how long in milliseconds the player can go without air before he starts taking damage" );
// RAVEN BEGIN
// asalmon: parameters for aim assistance on Xenon - or a non-final pc build so Caryn can edit the guis
#if defined( _XBOX ) || !defined( _FINAL )
idCVar pm_AimAssist( "pm_AimAssist", "2", CVAR_GAME | CVAR_INTEGER | CVAR_ARCHIVE , "Enable Xbox aim assistance. 1 to use change player view method. 2 to use change muzzle aim method.\n");
idCVar pm_AimAssistDistance( "pm_AimAssistDistance", "1000", CVAR_GAME | CVAR_INTEGER, "The max aim assist distance.\n");
idCVar pm_AimAssistThreshold( "pm_AimAssistThreshold", "1.0", CVAR_GAME | CVAR_FLOAT, "Threshold by which the projectile is aimed at the offending target.\n");
idCVar pm_AimAssistFOV( "pm_AimAssistFOV", "10", CVAR_GAME | CVAR_INTEGER, "The field of view for aim assistance.\n");
idCVar pm_AimAssistBump( "pm_AimAssistBump", "10", CVAR_GAME | CVAR_INTEGER, "The percentage of correction applied either to the view or the muzzle aim.\n");
idCVar pm_showAimAssist( "pm_showAimAssist", "0", CVAR_GAME | CVAR_BOOL, "Draw aim assist frustum and bounding boxes.\n");
idCVar pm_AimAssistSlow( "pm_AimAssistSlow", "50", CVAR_GAME | CVAR_INTEGER, "The percentage to slow the turning motion by when targeting an enemy.\n");
//asalmon: xenon controller config cvars
idCVar pm_ThumbstickConfig( "pm_ThumbstickConfig", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER | CVAR_GUI, "Change the thumbstick config on Xenon. 0 right handed, 1 left handed.\n");
idCVar pm_ButtonConfig( "pm_ButtonConfig", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER | CVAR_GUI, "Change the button configuration for Xenon.\n");
idCVar pm_Inversion( "pm_Inversion", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER | CVAR_GUI, "invert look up and down\n");
idCVar pm_VLookSens( "pm_VLookSens", "1.0", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Xenon sensitivity\n");
idCVar pm_HLookSens( "pm_HLookSens", "1.0", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Xenon sensitivity\n");
idCVar pm_VMoveSens( "pm_VMoveSens", "1.0", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Xenon sensitivity\n");
idCVar pm_HMoveSens( "pm_HMoveSens", "1.0", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Xenon sensitivity\n");
idCVar pm_voiceEnabled( "pm_voiceEnabled", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL | CVAR_GUI, "Enable/disable voice.\n");
//asalmon: Xenon leaderboard cvars
idCVar ui_LeaderboardView( "ui_LeaderboardView", "17", CVAR_INTEGER | CVAR_NOCHEAT, "Which leaderboard to show.\n");
idCVar ui_LeaderboardSort( "ui_LeaderboardSort", "1", CVAR_INTEGER | CVAR_NOCHEAT, "How to sort the leaderboard. 0 for rating, 1 for ranking, 2 for friends, 3 find logged in player.\n");
//nrausch
idCVar pm_RocketJumpAutocenter( "pm_RocketJumpAutocenter", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "Automatic autocentering following a rocket jump\n");
idCVar pm_IAmACheater( "pm_IAmACheater", "0", CVAR_GAME | CVAR_BOOL, "Whomever is playing is a dirty, rotten cheater\n");
idCVar g_systemLinkMatch( "g_systemLinkMatch", "0", CVAR_INTEGER, "In a system link game\n");
//asalmon: cvars for Live teams. Teams will now be a post launch feature but this was left here in case it is of use on future projects
//idCVar ui_LiveClanName( "ui_LiveClanName", "My Clan", CVAR_GAME | CVAR_USERINFO, "The name of the live clan being created\n");
//idCVar ui_LiveClanDesc( "ui_LiveClanDesc", "A Quake 4 clan", CVAR_GAME | CVAR_USERINFO, "The description of the live clan being created\n");
//idCVar ui_LiveClanMotto( "ui_LiveClanMotto", "We love Quake 4", CVAR_GAME | CVAR_USERINFO, "The motto of the live clan being created\n");
//idCVar ui_LiveClanUrl( "ui_LiveClanUrl", "www.ravensoft.com", CVAR_GAME | CVAR_USERINFO, "The url of the live clan being created\n");
//
//idCVar ui_LiveRecruitName( "ui_LiveRecruitName", "Recruit Name Here", CVAR_GAME | CVAR_USERINFO, "name of the gamer you are trying recruit\n");
//idCVar ui_LiveRecruitPDelete( "ui_LiveRecruitPDelete", "0", CVAR_GAME | CVAR_USERINFO, "give the recruit delete permissions\n");
//idCVar ui_LiveRecruitPData( "ui_LiveRecruitPData", "0", CVAR_GAME | CVAR_USERINFO, "give the recruit modify data permissions\n");
//idCVar ui_LiveRecruitPMemberPermissions("ui_LiveRecruitPMemberPermissions", "0", CVAR_GAME | CVAR_USERINFO, "give the recruit member modify permissions\n");
//idCVar ui_LiveRecruitPMemberDelete( "ui_LiveRecruitPMemberDelete", "0", CVAR_GAME | CVAR_USERINFO, "give the recruit member delete permissions\n");
//idCVar ui_LiveRecruitPMemberRecruit( "ui_LiveRecruitPMemberRecruit", "0", CVAR_GAME | CVAR_USERINFO, "give the recruit member recruit permissions\n");
#endif
idCVar pm_zoomedSlow( "pm_zoomedSlow", "100", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER | CVAR_NOCHEAT | CVAR_NORESET, "Slow look speed while zoomed 0..100% of speed");
#ifndef _XENON
idCVar pm_isZoomed( "pm_isZoomed", "0", CVAR_GAME | CVAR_INTEGER | CVAR_NOCHEAT | CVAR_NORESET, "if nonzero, is the slow speed");
#endif
// nmckenzie: added ability to try alternate accelerations.
idCVar pm_acceloverride( "pm_acceloverride", "0", CVAR_GAME | CVAR_FLOAT, "Adjust the player acceleration." );
idCVar pm_frictionoverride( "pm_frictionoverride", "-1", CVAR_GAME | CVAR_FLOAT, "Adjust the player friciton." );
idCVar pm_forcespectatormove( "pm_forcespectatormove", "0", CVAR_GAME | CVAR_FLOAT, "Force the player to move like a spectator (fly)." );
// bdube: added vehicle cvars
idCVar pm_vehicleCameraSnap( "pm_vehicleCameraSnap", "1", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar pm_vehicleCameraMinDist( "pm_vehicleCameraMinDist", "300", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar pm_vehicleCameraSpeedScale( "pm_vehicleCameraSpeedScale", "0.5", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar pm_vehicleCameraScaleMax( "pm_vehicleCameraScaleMax", "300", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar pm_vehicleSoundLerpScale( "pm_vehicleSoundLerpScale", "10", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_FLOAT, "" );
// RAVEN END
idCVar g_showPlayerShadow( "g_showPlayerShadow", "0", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_BOOL, "enables shadow of player model" );
idCVar g_skipPlayerShadowsMP( "g_skipPlayerShadowsMP", "0", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_BOOL, "disables all player shadows in multiplayer" );
idCVar g_skipItemShadowsMP( "g_skipItemShadowsMP", "0", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_BOOL, "disables all item shadows in multiplayer" );
idCVar g_simpleItems( "g_simpleItems", "0", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_BOOL, "render icon representations of items instead of the actual model" );
idCVar g_showHud( "g_showHud", "1", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_BOOL, "" );
idCVar g_showProjectilePct( "g_showProjectilePct", "0", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_BOOL, "enables display of player hit percentage" );
// RAVEN BEGIN
// dluetscher: changed to g_brassTime
idCVar g_brassTime( "g_brassTime", "1", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_FLOAT, "amount of time brass should stay in the world before dissapearing, set to 0 to disable brass" );
// RAVEN END
idCVar g_gun_x( "g_gunX", "0", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_gun_y( "g_gunY", "0", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_gun_z( "g_gunZ", "0", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_viewNodalX( "g_viewNodalX", "0", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_viewNodalZ( "g_viewNodalZ", "0", CVAR_GAME | CVAR_FLOAT, "" );
// RAVEN BEGIN
// jshepard: fov as a float for smoother transitions?
idCVar g_fov( "g_fov", "90", CVAR_GAME | CVAR_FLOAT | CVAR_NOCHEAT, "" );
// RAVEN END
idCVar g_skipViewEffects( "g_skipViewEffects", "0", CVAR_GAME | CVAR_BOOL, "skip damage and other view effects" );
idCVar g_mpWeaponAngleScale( "g_mpWeaponAngleScale", "0", CVAR_GAME | CVAR_FLOAT, "Control the weapon sway in MP" );
// RAVEN BEGIN
// bdube: crosshairs
// mekberg: custom size
idCVar g_crosshairSize( "g_crosshairSize", "32", CVAR_GAME | CVAR_INTEGER | CVAR_ARCHIVE, "crosshair size: 16,24,32,40,48", 16, 48 );
//idCVar g_crosshairColor( "g_crosshairColor", "0.458 0.894 0.247 .75", CVAR_GAME | CVAR_ARCHIVE, "sets the combat crosshair color" );
idCVar g_crosshairColor( "g_crosshairColor", "1 1 1 1", CVAR_GAME | CVAR_ARCHIVE, "sets the combat crosshair color" );
// cnicholson: Custom crosshair
idCVar g_crosshairCustom( "g_crosshairCustom", "0", CVAR_GAME | PC_CVAR_ARCHIVE, "sets the custom combat crosshair" );
idCVar g_crosshairCustomFile( "g_crosshairCustomFile", "0", CVAR_GAME | PC_CVAR_ARCHIVE, "stores the custom crosshair's filename" );
idCVar g_crosshairCharInfoFar( "g_crosshairCharInfoFar", "1", CVAR_GAME | CVAR_BOOL, "instead of a green crosshair from far away, full character info always draws" );
// bdube: database entries
idCVar g_showHudPopups( "g_showHudPopups", "1", CVAR_GAME | PC_CVAR_ARCHIVE | CVAR_BOOL, "displays objective and database popups on the hud" );
idCVar g_showRange( "g_showRange", "0", CVAR_GAME | CVAR_CHEAT | CVAR_BOOL, "shows the range from the player to the first collision under the players crosshair" );
// bdube: debug hud
idCVar g_showDebugHud( "g_showDebugHud", "0", CVAR_GAME | CVAR_INTEGER, "displays the debug hud\n"
"0 = off\n"
"1 = player\n"
"2 = physics\n"
"3 = AI\n"
"4 = vehicle\n"
"5 = performance\n"
"6 = effects\n"
"7 = map information\n"
"8 = AI performance\n"
"9 = MP\n"
"10 = Sound\n"
"32 = scratch\n" );
// bdube: cvar for messing with foreshortening and gun position
idCVar g_gun_pitch( "g_gunPitch", "0", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_gun_yaw( "g_gunYaw", "0", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_gun_roll( "g_gunRoll", "0", CVAR_GAME | CVAR_FLOAT, "" );
// abahr:
idCVar g_gunViewStyle( "g_gunViewStyle", "0", CVAR_GAME | CVAR_NOCHEAT | PC_CVAR_ARCHIVE | CVAR_INTEGER, "style presets\n"
"0 = Q3 style\n"
"1 = Shouldered style\n");
// jscott: cvar for debugging playbacks
idCVar g_showPlayback( "g_showPlayback", "0", CVAR_GAME | CVAR_INTEGER, "show g_currentPlayback" );
idCVar g_currentPlayback( "g_currentPlayback", "", CVAR_GAME, "name of playback shown by g_showPlayback" );
// jscott: unused
//idCVar g_testParticle( "g_testParticle", "0", CVAR_GAME | CVAR_INTEGER, "test particle visualation, set by the particle editor" );
//idCVar g_testParticleName( "g_testParticleName", "", CVAR_GAME, "name of the particle being tested by the particle editor" );
// RAVEN END
idCVar g_testModelRotate( "g_testModelRotate", "0", CVAR_GAME, "test model rotation speed" );
idCVar g_testPostProcess( "g_testPostProcess", "", CVAR_GAME, "name of material to draw over screen" );
idCVar g_testModelAnimate( "g_testModelAnimate", "0", CVAR_GAME | CVAR_INTEGER, "test model animation,\n"
"0 = cycle anim with origin reset\n"
"1 = cycle anim with fixed origin\n"
"2 = cycle anim with continuous origin\n"
"3 = frame by frame with continuous origin\n"
"4 = play anim once\n"
"5 = frame by frame with fixed origin", 0, 5, idCmdSystem::ArgCompletion_Integer<0,5> );
idCVar g_testModelBlend( "g_testModelBlend", "0", CVAR_GAME | CVAR_INTEGER, "number of frames to blend" );
idCVar g_testDeath( "g_testDeath", "0", CVAR_GAME | CVAR_BOOL, "" );
// RAVEN BEGIN
// bdube: added scoreboard testing
idCVar g_testScoreboard( "g_testScoreboard", "0", CVAR_GAME | CVAR_INTEGER, "number of clients to test in the scoreboard gui" );
idCVar g_testPlayer( "g_testPlayer", "", CVAR_GAME, "test player classname" );
// RAVEN END
idCVar g_exportMask( "g_exportMask", "", CVAR_GAME, "" );
idCVar g_flushSave( "g_flushSave", "0", CVAR_GAME | CVAR_BOOL, "1 = don't buffer file writing for save games." );
idCVar aas_test( "aas_test", "0", CVAR_GAME | CVAR_INTEGER, "" );
idCVar aas_showAreas( "aas_showAreas", "0", CVAR_GAME | CVAR_INTEGER, "" );
idCVar aas_showAreaBounds( "aas_showAreaBounds", "0", CVAR_GAME | CVAR_INTEGER, "When show areas is on, this draws the bounds of the areas, too..." );
idCVar aas_showPath( "aas_showPath", "0", CVAR_GAME | CVAR_INTEGER, "" );
idCVar aas_showFlyPath( "aas_showFlyPath", "0", CVAR_GAME | CVAR_INTEGER, "" );
idCVar aas_showWallEdges( "aas_showWallEdges", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar aas_showHideArea( "aas_showHideArea", "0", CVAR_GAME | CVAR_INTEGER, "" );
idCVar aas_pullPlayer( "aas_pullPlayer", "0", CVAR_GAME | CVAR_INTEGER, "" );
idCVar aas_randomPullPlayer( "aas_randomPullPlayer", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar aas_goalArea( "aas_goalArea", "0", CVAR_GAME | CVAR_INTEGER, "" );
idCVar aas_showPushIntoArea( "aas_showPushIntoArea", "0", CVAR_GAME | CVAR_BOOL, "" );
// RAVEN BEGIN
// rjohnson: added aas help
idCVar aas_showProblemAreas( "aas_showProblemAreas", "0", CVAR_GAME | CVAR_INTEGER, "" );
// cdr: added rev reach
idCVar aas_showRevReach( "aas_showRevReach", "0", CVAR_GAME | CVAR_INTEGER, "" );
// RAVEN END
idCVar g_password( "g_password", "", CVAR_GAME | PC_CVAR_ARCHIVE, "game password" );
idCVar password( "password", "", CVAR_GAME | CVAR_NOCHEAT, "client password used when connecting" );
// RAVEN BEGIN
idCVar g_gameReviewPause( "g_gameReviewPause", "30", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_INTEGER | PC_CVAR_ARCHIVE, "scores review time in seconds (at end game)", 2, 3600 );
// RAVEN END
idCVar net_clientPredictGUI( "net_clientPredictGUI", "1", CVAR_GAME | CVAR_BOOL, "test guis in networking without prediction" );
idCVar si_voteFlags( "si_voteFlags", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_INTEGER | PC_CVAR_ARCHIVE, "vote flags. bit mask of votes not allowed on this server\n"
"bit 0 (+1) restart now\n"
"bit 1 (+2) min players\n"
"bit 2 (+4) auto balance teams\n"
"bit 3 (+8) shuffle teams\n"
"bit 4 (+16) kick player\n"
"bit 5 (+32) change map\n"
"bit 6 (+64) change gametype\n"
"bit 7 (+128) time limit\n"
"bit 8 (+256) tourney limit\n"
"bit 9 (+512) capture limit\n"
"bit 10 (+1024) frag limit" );
idCVar g_mapCycle( "g_mapCycle", "mapcycle", CVAR_GAME | CVAR_ARCHIVE, "map cycling script for multiplayer games - see mapcycle.scriptcfg" );
// RAVEN BEGIN
// bdube: client entitiy cvars
idCVar g_gamelog( "g_gamelog", "0", CVAR_GAME | CVAR_BOOL, "enables game logging" );
idCVar cl_showEntityInfo( "cl_showEntityInfo", "0", CVAR_GAME | CVAR_BOOL, "" );
// ddynerman: announcer delay time
idCVar g_announcerDelay( "g_announcerDelay", "1000", CVAR_SOUND | PC_CVAR_ARCHIVE, "no more than one announcer sound will be played in this many ms" );
// jnewquist: Option to force undying state
idCVar g_forceUndying( "g_forceUndying", "0", CVAR_GAME | CVAR_BOOL, "forces undying state" );
// mcg: combat performance testing cvars
idCVar g_perfTest_weaponNoFX( "g_perfTest_weaponNoFX", "0", CVAR_GAME | CVAR_BOOL, "no muzzle flash, brass eject, muzzle fx, tracers, impact fx, blood decals or blood splats (whew!)" );
idCVar g_perfTest_hitscanShort( "g_perfTest_hitscanShort", "0", CVAR_GAME | CVAR_BOOL, "all hitscans capped at 2048" );
idCVar g_perfTest_hitscanBBox( "g_perfTest_hitscanBBox", "0", CVAR_GAME | CVAR_BOOL, "all hitscans vs bbox, not rendermodel" );
idCVar g_perfTest_aiStationary( "g_perfTest_aiStationary", "0", CVAR_GAME | CVAR_BOOL, "ai attempts no combat movement" );
idCVar g_perfTest_aiNoDodge( "g_perfTest_aiNoDodge", "0", CVAR_GAME | CVAR_BOOL, "ai attempts no dodging" );
idCVar g_perfTest_aiNoRagdoll( "g_perfTest_aiNoRagdoll", "0", CVAR_GAME | CVAR_BOOL, "ai does not ragdoll" );
idCVar g_perfTest_aiNoObstacleAvoid( "g_perfTest_aiNoObstacleAvoid", "0", CVAR_GAME | CVAR_BOOL, "ai does not attempt obstacle avoidance" );
idCVar g_perfTest_aiUndying( "g_perfTest_aiUndying", "0", CVAR_GAME | CVAR_BOOL, "makes all AI undying" );
idCVar g_perfTest_aiNoVisTrace( "g_perfTest_aiNoVisTrace", "0", CVAR_GAME | CVAR_BOOL, "ai does no vis traces" );
idCVar g_perfTest_noJointTransform( "g_perfTest_noJointTransform", "0", CVAR_GAME | CVAR_BOOL, "all joint transforms return origin" );
idCVar g_perfTest_noPlayerFocus( "g_perfTest_noPlayerFocus", "0", CVAR_GAME | CVAR_BOOL, "doesn't do player focus traces/logic" );
idCVar g_perfTest_noProjectiles( "g_perfTest_noProjectiles", "0", CVAR_GAME | CVAR_BOOL, "all projectiles are removed instantly" );
idCVar g_clientProjectileCollision( "g_clientProjectileCollision", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "allow the client to predict collisions" );
idCVar net_serverDownload( "net_serverDownload", "0", CVAR_GAME | CVAR_INTEGER | CVAR_ARCHIVE, "enable server download redirects. 0: off 1: client exits and opens si_serverURL in web browser 2: client downloads pak files from an URL and connects again. See net_serverDl* cvars for configuration" );
idCVar net_serverDlBaseURL( "net_serverDlBaseURL", "", CVAR_GAME | CVAR_ARCHIVE, "base URL for the download redirection" );
idCVar net_serverDlTable( "net_serverDlTable", "", CVAR_GAME | CVAR_ARCHIVE, "pak names for which download is provided, seperated by ; - use a * to mark all paks" );
idCVar si_serverURL( "si_serverURL", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE, "server information page" );
idCVar net_warnStale( "net_warnStale", "1", CVAR_INTEGER | CVAR_GAME | CVAR_NOCHEAT, "Warn stale entity occurences on network client - == 1: only on ClientStale call, > 1 all times" );
+425
View File
@@ -0,0 +1,425 @@
#ifndef __SYS_CVAR_H__
#define __SYS_CVAR_H__
extern idCVar developer;
extern idCVar g_cinematic;
extern idCVar g_cinematicMaxSkipTime;
// RAVEN BEGIN
// jnewquist: vertical stretch for letterboxed cinematics authored for 4:3 aspect
extern idCVar g_fixedHorizFOV;
// RAVEN END
extern idCVar g_monsters;
extern idCVar g_decals;
extern idCVar g_knockback;
extern idCVar g_skill;
extern idCVar g_gravity;
extern idCVar g_mp_gravity;
extern idCVar g_skipFX;
extern idCVar g_skipParticles;
extern idCVar g_projectileLights;
extern idCVar g_doubleVision;
extern idCVar g_muzzleFlash;
extern idCVar g_disasm;
extern idCVar g_debugBounds;
extern idCVar g_debugAnim;
extern idCVar g_debugMove;
extern idCVar g_debugDamage;
extern idCVar g_debugWeapon;
extern idCVar g_debugScript;
extern idCVar g_debugMover;
extern idCVar g_debugTriggers;
extern idCVar g_debugCinematic;
// RAVEN BEGIN
// bdube: added
extern idCVar g_debugState;
extern idCVar g_stopTime;
extern idCVar g_armorProtection;
extern idCVar g_armorProtectionMP;
//extern idCVar g_damageScale;
// jsinger: added to support binary read/write
extern idCVar com_BinaryRead;
#ifdef RV_BINARYDECLS
extern idCVar com_BinaryDeclRead;
#endif
// jsinger: added to support loading all decls from a single file
#ifdef RV_SINGLE_DECL_FILE
extern idCVar com_SingleDeclFile;
extern idCVar com_WriteSingleDeclFile;
#endif
extern idCVar com_BinaryWrite;
// RAVEN END
extern idCVar g_useDynamicProtection;
extern idCVar g_healthTakeTime;
extern idCVar g_healthTakeAmt;
extern idCVar g_healthTakeLimit;
extern idCVar g_showPVS;
extern idCVar g_showTargets;
extern idCVar g_showTriggers;
extern idCVar g_showCollisionWorld;
extern idCVar g_showCollisionModels;
extern idCVar g_showCollisionTraces;
// RAVEN BEGIN
// ddynerman: SD's clip sector code
extern idCVar g_showClipSectors;
extern idCVar g_showClipSectorFilter;
extern idCVar g_showAreaClipSectors;
// RAVEN END
extern idCVar g_maxShowDistance;
extern idCVar g_showEntityInfo;
extern idCVar g_showviewpos;
extern idCVar g_showcamerainfo;
extern idCVar g_showTestModelFrame;
extern idCVar g_showActiveEntities;
extern idCVar g_showEnemies;
extern idCVar g_frametime;
extern idCVar g_timeentities;
// RAVEN BEGIN
// bdube: new debug cvar
extern idCVar g_debugVehicle;
extern idCVar g_showFrameCmds;
extern idCVar g_showGodDamage;
// RAVEN END
// RAVEN BEGIN
// twhitaker: debug cvars for rvVehicleDriver
extern idCVar g_debugVehicleDriver;
extern idCVar g_debugVehicleAI;
extern idCVar g_vehicleMode;
// RAVEN END
extern idCVar g_allowVehicleGunOverheat;
extern idCVar ai_debugScript;
extern idCVar ai_debugMove;
extern idCVar ai_debugTrajectory;
extern idCVar ai_debugTactical;
extern idCVar ai_debugFilterString;
extern idCVar ai_testPredictPath;
extern idCVar ai_showCombatNodes;
extern idCVar ai_showPaths;
extern idCVar ai_showObstacleAvoidance;
extern idCVar ai_blockedFailSafe;
extern idCVar ai_debugSquad;
extern idCVar ai_debugStealth;
extern idCVar ai_allowTacticalRush;
// RAVEN BEGIN
// nmckenzie: added speeds and freeze
extern idCVar ai_speeds;
extern idCVar ai_freeze;
extern idCVar ai_animShow;
extern idCVar ai_showCover;
extern idCVar ai_showTacticalFeatures;
extern idCVar ai_disableEntTactical;
extern idCVar ai_disableAttacks;
extern idCVar ai_disableSimpleThink;
extern idCVar ai_disableCover;
extern idCVar ai_debugHelpers;
// cdr: added new master move type
extern idCVar ai_useRVMasterMove;
//jshepard: allow old AAS files
extern idCVar ai_allowOldAAS;
// twhitaker: debugging support for eye focus
extern idCVar ai_debugEyeFocus;
//mcg: always allow player to push buddies, unless scripted
extern idCVar ai_playerPushAlways;
// RAVEN END
extern idCVar g_dvTime;
extern idCVar g_dvAmplitude;
extern idCVar g_dvFrequency;
extern idCVar g_kickTime;
extern idCVar g_kickAmplitude;
extern idCVar g_blobTime;
extern idCVar g_blobSize;
extern idCVar g_testHealthVision;
extern idCVar g_editEntityMode;
// RAVEN BEGIN
extern idCVar g_editEntityDistance;
// rhummer: Allow to customize the distance the text is drawn for edit entities, Zack request.
extern idCVar g_editEntityTextDistance;
// rjohnson: entity usage stats
extern idCVar g_keepEntityStats;
// RAVEN END
extern idCVar g_dragEntity;
extern idCVar g_dragDamping;
extern idCVar g_dragShowSelection;
extern idCVar g_dropItemRotation;
extern idCVar g_vehicleVelocity;
extern idCVar g_vehicleForce;
extern idCVar ik_enable;
extern idCVar ik_debug;
extern idCVar af_useLinearTime;
extern idCVar af_useImpulseFriction;
extern idCVar af_useJointImpulseFriction;
extern idCVar af_useSymmetry;
extern idCVar af_skipSelfCollision;
extern idCVar af_skipLimits;
extern idCVar af_skipFriction;
extern idCVar af_forceFriction;
extern idCVar af_maxLinearVelocity;
extern idCVar af_maxAngularVelocity;
extern idCVar af_timeScale;
extern idCVar af_jointFrictionScale;
extern idCVar af_contactFrictionScale;
extern idCVar af_highlightBody;
extern idCVar af_highlightConstraint;
extern idCVar af_showTimings;
extern idCVar af_showConstraints;
extern idCVar af_showConstraintNames;
extern idCVar af_showConstrainedBodies;
extern idCVar af_showPrimaryOnly;
extern idCVar af_showTrees;
extern idCVar af_showLimits;
extern idCVar af_showBodies;
extern idCVar af_showBodyNames;
extern idCVar af_showMass;
extern idCVar af_showTotalMass;
extern idCVar af_showInertia;
extern idCVar af_showVelocity;
extern idCVar af_showActive;
extern idCVar af_testSolid;
extern idCVar rb_showTimings;
extern idCVar rb_showBodies;
extern idCVar rb_showMass;
extern idCVar rb_showInertia;
extern idCVar rb_showVelocity;
extern idCVar rb_showActive;
extern idCVar pm_jumpheight;
extern idCVar pm_stepsize;
extern idCVar pm_crouchspeed;
// RAVEN BEGIN
extern idCVar pm_speed;
extern idCVar pm_walkspeed;
extern idCVar pm_zoomedSlow;
extern idCVar pm_isZoomed;
// RAVEN END
extern idCVar pm_noclipspeed;
extern idCVar pm_spectatespeed;
extern idCVar pm_spectatebbox;
extern idCVar pm_usecylinder;
extern idCVar pm_minviewpitch;
extern idCVar pm_maxviewpitch;
extern idCVar pm_stamina;
extern idCVar pm_staminathreshold;
extern idCVar pm_staminarate;
extern idCVar pm_crouchheight;
extern idCVar pm_crouchviewheight;
extern idCVar pm_normalheight;
extern idCVar pm_normalviewheight;
extern idCVar pm_deadheight;
extern idCVar pm_deadviewheight;
extern idCVar pm_crouchrate;
extern idCVar pm_bboxwidth;
extern idCVar pm_crouchbob;
extern idCVar pm_walkbob;
extern idCVar pm_runbob;
extern idCVar pm_runpitch;
extern idCVar pm_runroll;
extern idCVar pm_bobup;
extern idCVar pm_bobpitch;
extern idCVar pm_bobroll;
extern idCVar pm_thirdPersonRange;
extern idCVar pm_thirdPersonHeight;
extern idCVar pm_thirdPersonAngle;
extern idCVar pm_thirdPersonClip;
extern idCVar pm_thirdPerson;
extern idCVar pm_thirdPersonDeath;
extern idCVar pm_modelView;
extern idCVar pm_airTics;
// RAVEN BEGIN
// asalmon: parameters for aim assistance on Xenon
#ifdef _XBOX
extern idCVar pm_AimAssist;
extern idCVar pm_AimAssistDistance;
extern idCVar pm_AimAssistThreshold;
extern idCVar pm_AimAssistFOV;
extern idCVar pm_AimAssistBump;
extern idCVar pm_AimAssistShow;
extern idCVar pm_AimAssistSlow;
extern idCVar pm_ThumbstickConfig;
extern idCVar pm_ButtonConfig;
extern idCVar pm_RocketJumpAutocenter;
extern idCVar pm_IAmACheater;
#endif
// nmckenzie: added ability to try alternate accelerations.
extern idCVar pm_acceloverride;
extern idCVar pm_frictionoverride;
extern idCVar pm_forcespectatormove;
extern idCVar pm_thirdPersonTarget;
// bdube: vehicle
extern idCVar pm_vehicleLean;
extern idCVar pm_vehicleCameraSnap;
extern idCVar pm_vehicleCameraScaleMax;
extern idCVar pm_vehicleSoundLerpScale;
extern idCVar pm_vehicleCameraSpeedScale;
extern idCVar pm_vehicleCameraMinDist;
// RAVEN END
extern idCVar g_showPlayerShadow;
extern idCVar g_skipPlayerShadowsMP;
extern idCVar g_skipItemShadowsMP;
extern idCVar g_simpleItems;
extern idCVar g_showHud;
// RAVEN BEGIN
extern idCVar g_crosshairColor;
// cnicholson: Custom Crosshair
extern idCVar g_crosshairCustom;
extern idCVar g_crosshairCustomFile;
extern idCVar g_crosshairCharInfoFar;
// bdube: hud popups
extern idCVar g_showHudPopups;
// bdube: range
extern idCVar g_showRange;
// bdube: debug hud
extern idCVar g_showDebugHud;
// RAVEN END
extern idCVar g_showProjectilePct;
// RAVEN BEGIN
// bdube: brass time
extern idCVar g_brassTime;
// RAVEN END
extern idCVar g_gun_x;
extern idCVar g_gun_y;
extern idCVar g_gun_z;
// RAVEN BEGIN
// bdube: cvar for messing with foreshortening
extern idCVar g_gun_pitch;
extern idCVar g_gun_yaw;
extern idCVar g_gun_roll;
// abahr:
extern idCVar g_gunViewStyle;
// jscott: for playbacks
extern idCVar g_showPlayback;
extern idCVar g_currentPlayback;
// RAVEN END
extern idCVar g_viewNodalX;
extern idCVar g_viewNodalZ;
extern idCVar g_fov;
extern idCVar g_testDeath;
extern idCVar g_skipViewEffects;
extern idCVar g_mpWeaponAngleScale;
extern idCVar g_testParticle;
extern idCVar g_testParticleName;
// RAVEN BEGIN
// bdube: more rigid body debug
extern idCVar rb_showContacts;
// RAVEN END
extern idCVar g_testPostProcess;
extern idCVar g_testModelRotate;
extern idCVar g_testModelAnimate;
extern idCVar g_testModelBlend;
extern idCVar g_forceModel;
extern idCVar g_forceStroggModel;
extern idCVar g_forceMarineModel;
// RAVEN BEGIN
// bdube: test scoreboard
extern idCVar g_testScoreboard;
extern idCVar g_testPlayer;
// RAVEN END
extern idCVar g_exportMask;
extern idCVar g_flushSave;
extern idCVar aas_test;
extern idCVar aas_showAreas;
extern idCVar aas_showAreaBounds;
extern idCVar aas_showPath;
extern idCVar aas_showFlyPath;
extern idCVar aas_showWallEdges;
extern idCVar aas_showHideArea;
extern idCVar aas_pullPlayer;
extern idCVar aas_randomPullPlayer;
extern idCVar aas_goalArea;
extern idCVar aas_showPushIntoArea;
// RAVEN BEGIN
// rjohnson: added aas help
extern idCVar aas_showProblemAreas;
// cdr: added rev reach
extern idCVar aas_showRevReach;
// RAVEN END
extern idCVar net_clientPredictGUI;
extern idCVar si_voteFlags;
extern idCVar g_mapCycle;
// RAVEN BEGIN
// shouchard: g_balanceTDM->g_balanceTeams so we can also use it for CTF
extern idCVar si_autobalance;
// RAVEN END
// RITUAL BEGIN
// squirrel: Mode-agnostic buymenus
extern idCVar si_isBuyingEnabled;
extern idCVar si_dropWeaponsInBuyingModes;
extern idCVar si_controlTime;
// RITUAL END
extern idCVar si_timeLimit;
extern idCVar si_fragLimit;
extern idCVar si_gameType;
extern idCVar si_map;
extern idCVar si_mapCycle;
extern idCVar si_spectators;
extern idCVar si_minPlayers;
// RAVEN BEGIN
// shouchard: CTF
extern idCVar si_captureLimit;
// shouchard: Tourney
extern idCVar si_tourneyLimit;
// RAVEN END
extern const char *si_gameTypeArgs[];
// RAVEN BEGIN
// bdube: client entities
extern idCVar g_gamelog;
extern idCVar cl_showEntityInfo;
// jnewquist: Option to force undying state
extern idCVar g_forceUndying;
// mcg: combat performance testing cvars
extern idCVar g_perfTest_weaponNoFX;
extern idCVar g_perfTest_hitscanShort;
extern idCVar g_perfTest_hitscanBBox;
extern idCVar g_perfTest_aiStationary;
extern idCVar g_perfTest_aiNoDodge;
extern idCVar g_perfTest_aiNoRagdoll;
extern idCVar g_perfTest_aiNoObstacleAvoid;
extern idCVar g_perfTest_aiUndying;
extern idCVar g_perfTest_aiNoVisTrace;
extern idCVar g_perfTest_noJointTransform;
extern idCVar g_perfTest_noPlayerFocus;
extern idCVar g_perfTest_noProjectiles;
// RAVEN END
extern idCVar g_clientProjectileCollision;
extern idCVar net_clientLagOMeter;
extern idCVar net_warnStale;
#endif /* !__SYS_CVAR_H__ */