29 #include "../idlib/precompiled.h"
68 "none",
"metal",
"stone",
"flesh",
"wood",
"cardboard",
"liquid",
"glass",
"plastic",
69 "ricochet",
"surftype10",
"surftype11",
"surftype12",
"surftype13",
"surftype14",
"surftype15"
74 static const char* fastEntityList[] = {
79 "weapon_rocketlauncher",
82 "projectile_bullet_machinegun",
84 "projectile_bullet_pistol",
90 "projectile_chaingunbullet",
93 "projectile_plasmablast",
95 "projectile_bullet_shotgun",
97 "projectile_soulblast",
98 "weapon_shotgun_double",
99 "projectile_shotgunbullet_double",
101 "weapon_bloodstone_active1",
102 "weapon_bloodstone_active2",
103 "weapon_bloodstone_active3",
104 "weapon_bloodstone_passive",
116 #pragma GCC visibility push(default)
127 common =
import->common;
128 cmdSystem =
import->cmdSystem;
129 cvarSystem =
import->cvarSystem;
130 fileSystem =
import->fileSystem;
131 networkSystem =
import->networkSystem;
132 renderSystem =
import->renderSystem;
133 soundSystem =
import->soundSystem;
134 renderModelManager =
import->renderModelManager;
135 uiManager =
import->uiManager;
136 declManager =
import->declManager;
137 AASFileManager =
import->AASFileManager;
138 collisionModelManager =
import->collisionModelManager;
155 #pragma GCC visibility pop
282 portalSkyActive =
false;
316 Printf(
"--------- Initializing Game ----------\n" );
318 Printf(
"gamedate: %s\n", __DATE__ );
332 cmdSystem->
AddCommand(
"printModelDefs", idPrintDecls_f<DECL_MODELDEF>,
CMD_FL_SYSTEM|
CMD_FL_GAME,
"prints a model def", idCmdSystem::ArgCompletion_Decl<DECL_MODELDEF> );
343 if(!g_xp_bind_run_once.GetBool()) {
360 for ( i = 0; i < 2; i++ ) {
363 }
else if ( i == 1 ) {
366 if( gamedir.
Length() > 0 ) {
367 idStr scriptFile =
va(
"script/%s_main.script", gamedir.
c_str() );
381 Error(
"Unable to find entityDef for 'aas_types'" );
386 while( kv !=
NULL ) {
396 Printf(
"game initialized.\n" );
397 Printf(
"--------------------------------------\n" );
413 Printf(
"------------ Game Shutdown -----------\n" );
448 collisionModelManager->
FreeMap();
458 Printf(
"--------------------------------------\n" );
514 for( i = 0; i < threads.
Num(); i++ ) {
611 portalSkyEnt.Save( &savegame );
614 fast.Save( &savegame );
615 slow.Save( &savegame );
629 for( i = 0; i < gameRenderWorld->
NumAreas(); i++ ) {
678 if ( ent && ent->
IsType( idPlayer::Type ) ) {
679 static_cast<idPlayer *
>(ent)->SavePersistantInfo();
703 va_start( argptr, fmt );
707 common->
Printf(
"%s", text );
723 va_start( argptr, fmt );
727 common->
Printf(
"%s", text );
740 va_start( argptr, fmt );
766 va_start( argptr, fmt );
788 va_start( argptr, fmt );
794 thread->
Error(
"%s", text );
796 common->
Error(
"%s", text );
809 va_start( argptr, fmt );
813 gameLocal.
Error(
"%s", text );
832 bool modifiedInfo =
false;
850 if ( i == clientNum ) {
864 if (
entities[ clientNum ] &&
entities[ clientNum ]->IsType( idPlayer::Type ) ) {
865 modifiedInfo |=
static_cast<idPlayer *
>(
entities[ clientNum ] )->UserInfoChanged( canModify );
874 if ( modifiedInfo ) {
888 if (
entities[ clientNum ] &&
entities[ clientNum ]->IsType( idPlayer::Type ) ) {
908 outMsg.
Init( msgBuf,
sizeof( msgBuf ) );
947 Error(
"Couldn't load %s", mapName );
1000 portalSkyActive =
false;
1002 ResetSlowTimeVars();
1048 int i, latchSpawnCount;
1050 Printf(
"----------- Game Map Restart ------------\n" );
1071 if ( gameSoundWorld ) {
1106 Printf(
"--------------------------------------\n" );
1156 outMsg.
Init( msgBuf,
sizeof( msgBuf ) );
1169 gameLocal.
mpGame.ReloadScoreboard();
1186 common->
Printf(
"server is not running - use spawnServer\n" );
1220 func =
program.FindFunction(
"mapcycle::cycle" );
1223 func =
program.FindFunction(
"mapcycle::cycle" );
1226 Printf(
"Couldn't find mapcycle::cycle\n" );
1251 common->
Printf(
"server is not running\n" );
1268 cvarSystem->
SetCVarBool(
"r_skipSpecular",
false );
1286 Printf(
"==== Processing events ====\n" );
1305 Printf(
"----------- Game Map Init ------------\n" );
1309 gameRenderWorld = renderWorld;
1310 gameSoundWorld = soundWorld;
1327 Printf(
"--------------------------------------\n" );
1345 Printf(
"------- Game Map Init SaveGame -------\n" );
1349 gameRenderWorld = renderWorld;
1350 gameSoundWorld = soundWorld;
1360 if (
program.Restore( &savegame ) == false ) {
1386 if ( classname !=
'\0' ) {
1420 for( i = 0; i <
num; i++ ) {
1421 savegame.
ReadObject( reinterpret_cast<idClass *&>( ent ) );
1429 for( i = 0; i <
num; i++ ) {
1430 savegame.
ReadObject( reinterpret_cast<idClass *&>( ent ) );
1494 portalSkyEnt.Restore( &savegame );
1495 savegame.
ReadBool( portalSkyActive );
1497 fast.Restore( &savegame );
1498 slow.Restore( &savegame );
1502 slowmoState = (slowmoState_t)blah;
1505 savegame.
ReadBool( quickSlowmoReset );
1507 if ( slowmoState == SLOWMO_STATE_OFF ) {
1508 if ( gameSoundWorld ) {
1513 if ( gameSoundWorld ) {
1517 if ( gameSoundWorld ) {
1527 if ( num != gameRenderWorld->
NumAreas() ) {
1528 savegame.
Error(
"idGameLocal::InitFromSaveGame: number of areas in map differs from save game." );
1532 for( i = 0; i <
num; i++ ) {
1579 Printf(
"--------------------------------------\n" );
1602 if ( !clearClients ) {
1630 Printf(
"--------- Game Map Shutdown ----------\n" );
1634 if ( gameRenderWorld ) {
1664 gameRenderWorld =
NULL;
1665 gameSoundWorld =
NULL;
1669 Printf(
"--------------------------------------\n" );
1678 int i,
j, k,
size, totalSize;
1691 const_cast<idSoundShader *
>(soundShader)->EnsureNotPurged();
1694 soundName = soundShader->
GetSound( j );
1703 idStr testName = soundName;
1713 if ( parms->
shakes != 0.0f ) {
1719 if ( soundName.
Find(
"/vo/",
false ) == -1 &&
1720 soundName.
Find(
"/combat_chatter/",
false ) == -1 &&
1721 soundName.
Find(
"/bfgcarnage/",
false ) == -1 &&
1722 soundName.
Find(
"/enpro/",
false ) == - 1 &&
1723 soundName.
Find(
"/soulcube/energize_01.wav",
false ) == -1 ) {
1725 if ( soundName.
Find(
"weapon",
false ) != -1 ||
1726 soundName.
Find(
"gun",
false ) != -1 ||
1727 soundName.
Find(
"bullet",
false ) != -1 ||
1728 soundName.
Find(
"bfg",
false ) != -1 ||
1729 soundName.
Find(
"plasma",
false ) != -1 ) {
1736 if (
shakeSounds[k].IcmpPath( soundName ) == 0 ) {
1749 file = fileSystem->
OpenFileWrite(
"makeogg.bat",
"fs_savepath" );
1750 if ( file ==
NULL ) {
1751 common->
Warning(
"Couldn't open makeogg.bat" );
1763 file->
Printf(
"echo %d kB in shake sounds\n\n\n", totalSize >> 10 );
1767 for ( i = 0; i < weaponSounds.
Num(); i++ ) {
1770 weaponSounds[
i].Replace(
"/",
"\\" );
1771 file->
Printf(
"echo \"%s\" (%d kB)\n", weaponSounds[i].c_str(), size >> 10 );
1773 file->
Printf(
"echo %d kB in weapon sounds\n\n\n", totalSize >> 10 );
1777 for ( i = 0; i < oggSounds.
Num(); i++ ) {
1780 oggSounds[
i].Replace(
"/",
"\\" );
1781 file->
Printf(
"z:\\d3xp\\ogg\\oggenc -q 0 \"%s\\d3xp\\%s\"\n", cvarSystem->
GetCVarString(
"fs_basepath" ), oggSounds[
i].c_str() );
1782 file->
Printf(
"del \"%s\\d3xp\\%s\"\n", cvarSystem->
GetCVarString(
"fs_basepath" ), oggSounds[
i].c_str() );
1784 file->
Printf(
"\n\necho %d kB in OGG sounds\n\n\n", totalSize >> 10 );
1798 const char *soundShaderName;
1801 soundShaderName = dict->
GetString(
"s_shader" );
1802 if ( soundShaderName !=
'\0' && dict->
GetFloat(
"s_shakes" ) != 0.0f ) {
1803 soundShader = declManager->
FindSound( soundShaderName );
1826 if ( dict ==
NULL ) {
1827 if ( cvarSystem->
GetCVarBool(
"com_makingBuild") ) {
1833 if ( cvarSystem->
GetCVarBool(
"com_makingBuild" ) ) {
1852 kv = dict->
FindKey(
"s_shader" );
1885 kv = dict->
FindKey(
"texture" );
1911 int teleportType = atoi( kv->
GetValue() );
1912 const char *
p = ( teleportType ) ?
va(
"fx/teleporter%i.fx", teleportType ) :
"fx/teleporter.fx";
1929 int dash = prtName.
Find(
'-');
1931 prtName = prtName.
Left( dash );
1993 if ( func !=
NULL ) {
1995 if ( thread->
Start() ) {
2012 Printf(
"SpawnPlayer: %i\n", clientNum );
2014 args.
SetInt(
"spawn_entnum", clientNum );
2015 args.
Set(
"name",
va(
"player%d", clientNum + 1 ) );
2018 args.
Set(
"classname",
"player_doommarine_mp" );
2020 args.
Set(
"classname",
"player_doommarine_ctf" );
2022 args.
Set(
"classname",
"player_doommarine" );
2024 args.
Set(
"classname",
isMultiplayer ?
"player_doommarine_mp" :
"player_doommarine" );
2027 Error(
"Failed to spawn player as '%s'", args.
GetString(
"classname" ) );
2031 if ( !ent->
IsType( idPlayer::Type ) ) {
2032 Error(
"'%s' spawned the player as a '%s'. Player spawnclass must be a subclass of idPlayer.", args.
GetString(
"classname" ), ent->
GetClassname() );
2048 if ( current < 0 || current >=
numClients ) {
2067 if ( ent && ent->
IsType( idPlayer::Type ) ) {
2069 return static_cast<idPlayer *
>( ent );
2084 if ( !client.
Length() ) {
2094 common->
Printf(
"Player '%s' not found\n", client.
c_str() );
2109 current = ( _current + i + 1 ) % numClients;
2110 if (
entities[ current ] &&
entities[ current ]->IsType( idPlayer::Type ) ) {
2169 if ( !ent || !ent->
IsType( idPlayer::Type ) ) {
2173 player =
static_cast<idPlayer *
>(ent);
2197 if ( portalSkyEnt.GetEntity() ) {
2198 idEntity *skyEnt = portalSkyEnt.GetEntity();
2276 if ( ent->
IsType( idAFEntity_Generic::Type ) ) {
2305 idEntity *ent, *next_ent, *master, *part;
2312 if ( master && master == ent ) {
2325 if ( !master || master == ent ) {
2343 if ( !master || master == ent ) {
2369 void idGameLocal::RunTimeGroup2() {
2377 if ( ent->timeGroup != TIME_GROUP2 ) {
2398 idTimer timer_think, timer_events, timer_singlethink;
2482 timer_think.
Clear();
2483 timer_think.
Start();
2493 timer_singlethink.
Clear();
2494 timer_singlethink.
Start();
2496 timer_singlethink.
Stop();
2518 if ( ent->timeGroup != TIME_GROUP1 ) {
2548 timer_events.
Clear();
2549 timer_events.
Start();
2557 idEvent::ServiceFastEvents();
2561 timer_events.
Stop();
2573 Printf(
"game %d: all:%.1f th:%.1f ev:%.1f %d ents \n",
2589 if ( player->
lastDmgTime > 0 && time < player->lastDmgTime + 10000 ) {
2592 if ( player->
lastHitTime > 0 && time < player->lastHitTime + 10000 ) {
2605 Warning(
"Exceeded maximum cinematic skip length. Cinematic may be looping infinitely." );
2613 soundSystem->
SetMute(
false );
2648 Error(
"idGameLocal::CalcFov: FPU stack not empty" );
2652 x = 640.0f / tan( base_fov / 360.0
f *
idMath::PI );
2653 y = atan2( 480.0
f, x );
2660 Error(
"idGameLocal::CalcFov: bad result" );
2684 y = ratio_y / tan( fov_y / 360.0
f * idMath::PI );
2685 fov_x = atan2( ratio_x, y ) * 360.0f /
idMath::PI;
2687 if ( fov_x < base_fov ) {
2689 x = ratio_x / tan( fov_x / 360.0
f * idMath::PI );
2690 fov_y = atan2( ratio_y, x ) * 360.0f /
idMath::PI;
2694 assert( ( fov_x > 0 ) && ( fov_y > 0 ) );
2695 if ( ( fov_y <= 0 ) || ( fov_x <= 0 ) ) {
2697 Error(
"idGameLocal::CalcFov: bad result" );
2835 if ( !ent->
IsType( idTestModel::Type ) ) {
2836 Error(
"Unknown function '%s' called for frame command on entity '%s'", frameCommand, ent->
name.
c_str() );
2851 idVec3 up = axis[ 2 ] * 5.0f;
2853 idBounds viewTextBounds( viewPos );
2866 target = ent->
targets[
i ].GetEntity();
2880 float frac = ( 512.0f - dist ) / 512.0
f;
2881 if ( frac < 0.0
f ) {
2894 target = ent->
targets[
i ].GetEntity();
2921 idVec3 up = axis[ 2 ] * 5.0f;
2929 if ( ent ==
world ) {
2965 b[0][0] = b[0][1] = b[0][2] = -8;
2966 b[1][0] = b[1][1] = b[1][2] = 8;
3015 aas->
Test( origin );
3058 if ( ( num >= 0 ) && ( num <
aasList.
Num() ) ) {
3076 if ( !
aasList[ i ]->GetSettings() ) {
3095 aasList[
i ]->SetAreaState( bounds, areaContents, closed );
3113 obstacle =
aasList[ 0 ]->AddObstacle( bounds );
3115 check =
aasList[
i ]->AddObstacle( bounds );
3116 assert( check == obstacle );
3131 aasList[
i ]->RemoveObstacle( handle );
3144 aasList[
i ]->RemoveAllObstacles();
3157 Printf(
"Not allowed in multiplayer.\n" );
3166 if ( !requirePlayer || ( player && ( player->
health > 0 ) ) ) {
3170 Printf(
"You must be alive to use this command.\n" );
3184 Error(
"idGameLocal::RegisterEntity: spawn count overflow" );
3192 Error(
"no free entities" );
3241 assert( bIsClientReadSnapshot );
3245 if ( !classdef.
IsType( idEntity::Type ) ) {
3246 Error(
"Attempted to spawn non-entity class '%s'", classdef.
classname );
3276 const char *classname;
3290 sprintf( error,
" on '%s'", name);
3298 Warning(
"Unknown classname '%s'%s.", classname, error.
c_str() );
3308 for (
int i = 0; fastEntityList[
i];
i++ ) {
3309 if ( !
idStr::Cmp( classname, fastEntityList[
i] ) ) {
3327 Warning(
"Could not spawn '%s'. Class '%s' not found %s.", classname, spawn, error.
c_str() );
3333 Warning(
"Could not spawn '%s'. Instance could not be created %s.", classname, error.
c_str() );
3339 if ( ent && obj->
IsType( idEntity::Type ) ) {
3351 Warning(
"Could not spawn '%s'. Script function '%s' not found%s.", classname, spawn, error.
c_str() );
3359 Warning(
"%s doesn't include a spawnfunc or spawnclass%s.", classname, error.
c_str() );
3399 spawnArgs.
GetBool(
"not_multiplayer",
"0", result );
3401 spawnArgs.
GetBool(
"not_easy",
"0", result );
3403 spawnArgs.
GetBool(
"not_medium",
"0", result );
3405 spawnArgs.
GetBool(
"not_hard",
"0", result );
3408 spawnArgs.
GetBool(
"not_nightmare",
"0", result );
3415 #ifndef ID_DEMO_BUILD
3417 name = spawnArgs.
GetString(
"classname" );
3420 idStr::Icmp( name,
"moveable_item_medkit" ) == 0 ||
idStr::Icmp( name,
"moveable_item_medkit_small" ) == 0 ) {
3428 name = spawnArgs.
GetString(
"classname" );
3447 }
else if ( value > 3 ) {
3450 skill_level =
value;
3482 Printf(
"Spawning entities\n" );
3485 Printf(
"No mapfile present\n");
3492 if ( numEntities == 0 ) {
3493 Error(
"...no entities" );
3502 Error(
"Problem spawning world entity" );
3508 for ( i = 1 ; i < numEntities ; i++ ) {
3523 Printf(
"...%i entities spawned, %i inhibited\n\n", num, inhibit );
3533 Error(
"Multiple entities named '%s'", name );
3562 int i,
num, refLength;
3568 refLength = strlen( ref );
3570 for( i = 0; i <
num; i++ ) {
3573 if ( arg->
GetKey().
Icmpn( ref, refLength ) == 0 ) {
3690 if ( ent->
IsType( c ) && ent != skip ) {
3693 if ( scale >= 0.0
f && scale < bestScale ) {
3717 entityList[entCount++] = ent;
3747 for ( i = 0; i <
num; i++ ) {
3748 cm = clipModels[
i ];
3765 if ( hit->
IsType( idPlayer::Type ) &&
static_cast< idPlayer *
>( hit )->IsInTeleport() ) {
3767 }
else if ( !catch_teleport ) {
3784 if ( requires.
Length() ) {
3785 if ( activator->
IsType( idPlayer::Type ) ) {
3808 if ( ent && ent->
IsType( idActor::Type ) ) {
3826 SetTimeState ts( timeGroup );
3842 float dist, damageScale, attackerDamageScale, attackerPushScale;
3845 int numListedEntities;
3848 int i, e, damage, radius,
push;
3852 Warning(
"Unknown damageDef '%s'", damageDefName );
3856 damageDef->
GetInt(
"damage",
"20", damage );
3857 damageDef->
GetInt(
"radius",
"50", radius );
3858 damageDef->
GetInt(
"push",
va(
"%d", damage * 100 ), push );
3859 damageDef->
GetFloat(
"attackerDamageScale",
"0.5", attackerDamageScale );
3860 damageDef->
GetFloat(
"attackerPushScale",
"0", attackerPushScale );
3871 if ( inflictor && inflictor->
IsType( idAFAttachment::Type ) ) {
3874 if ( attacker && attacker->
IsType( idAFAttachment::Type ) ) {
3877 if ( ignoreDamage && ignoreDamage->
IsType( idAFAttachment::Type ) ) {
3878 ignoreDamage =
static_cast<idAFAttachment*
>(ignoreDamage)->GetBody();
3882 for ( e = 0; e < numListedEntities; e++ ) {
3883 ent = entityList[ e ];
3890 if ( ent == inflictor || ( ent->
IsType( idAFAttachment::Type ) &&
static_cast<idAFAttachment*
>(ent)->GetBody() == inflictor ) ) {
3894 if ( ent == ignoreDamage || ( ent->
IsType( idAFAttachment::Type ) &&
static_cast<idAFAttachment*
>(ent)->GetBody() == ignoreDamage ) ) {
3904 for ( i = 0; i < 3; i++ ) {
3915 if ( dist >= radius ) {
3919 if ( ent->
CanDamage( origin, damagePoint ) ) {
3926 damageScale = dmgPower * ( 1.0f - dist / radius );
3927 if ( ent == attacker || ( ent->
IsType( idAFAttachment::Type ) &&
static_cast<idAFAttachment*
>(ent)->GetBody() == attacker ) ) {
3928 damageScale *= attackerDamageScale;
3937 RadiusPush( origin, radius, push * dmgPower, attacker, ignorePush, attackerPushScale,
false );
3947 int i, numListedClipModels;
3956 dir.
Set( 0.0
f, 0.0
f, 1.0
f );
3963 if ( inflictor && inflictor->
IsType( idAFAttachment::Type ) ) {
3964 inflictor =
static_cast<const idAFAttachment*
>(inflictor)->GetBody();
3966 if ( ignore && ignore->
IsType( idAFAttachment::Type ) ) {
3971 for ( i = 0; i < numListedClipModels; i++ ) {
3973 clipModel = clipModelList[
i];
3983 if ( ent->
IsType( idProjectile::Type ) ) {
3988 if ( ent->
IsType( idPlayer::Type ) && !quake ) {
3993 if ( ent == ignore || ( ent->
IsType( idAFAttachment::Type ) &&
static_cast<idAFAttachment*
>(ent)->GetBody() == ignore ) ) {
4002 if ( ent == inflictor || ( ent->
IsType( idAFAttachment::Type ) &&
static_cast<idAFAttachment*
>(ent)->GetBody() == inflictor ) ) {
4003 scale = inflictorScale;
4023 float dot, dist, area;
4027 idVec3 v, localOrigin, center, impulse;
4039 for ( i = 0; i < trm->
numPolys; i++ ) {
4043 for ( j = 0; j < poly->
numEdges; j++ ) {
4051 v = center - localOrigin;
4063 impulse *= push * ( dot * area * ( 1.0f / ( 4.0f *
idMath::PI ) ) );
4065 impulse *= ( dist * 2.0f );
4082 idVec3 windingOrigin, projectionOrigin;
4084 static idVec3 decalWinding[4] = {
4101 axis[2].NormalVectors( axistemp[0], axistemp[1] );
4102 axis[0] = axistemp[ 0 ] * c + axistemp[ 1 ] * -
s;
4103 axis[1] = axistemp[ 0 ] * -s + axistemp[ 1 ] * -
c;
4105 windingOrigin = origin + depth * axis[2];
4107 projectionOrigin = origin - depth * axis[2];
4109 projectionOrigin = origin;
4115 winding +=
idVec5( windingOrigin + ( axis * decalWinding[0] ) * size,
idVec2( 1, 1 ) );
4116 winding +=
idVec5( windingOrigin + ( axis * decalWinding[1] ) * size,
idVec2( 0, 1 ) );
4117 winding +=
idVec5( windingOrigin + ( axis * decalWinding[2] ) * size,
idVec2( 0, 0 ) );
4118 winding +=
idVec5( windingOrigin + ( axis * decalWinding[3] ) * size,
idVec2( 1, 0 ) );
4128 float halfSize = size * 0.5f;
4130 idVec3( 0.0
f, +halfSize, -halfSize ),
4131 idVec3( 0.0
f, -halfSize, -halfSize ),
4132 idVec3( 0.0
f, -halfSize, +halfSize ) };
4200 if ( ent->
IsType( idAI::Type ) ) {
4201 ai =
static_cast<idAI *
>( ent );
4206 }
else if ( ent->
IsType( idProjectile::Type ) ) {
4289 int numAreas = gameRenderWorld->
NumAreas();
4295 if ( !ent->
IsType( idLocationEntity::Type ) ) {
4299 int areaNum = gameRenderWorld->
PointInArea( point );
4300 if ( areaNum < 0 ) {
4304 if ( areaNum >= numAreas ) {
4305 Error(
"idGameLocal::SpreadLocations: areaNum >= gameRenderWorld->NumAreas()" );
4315 for (
int i = 0 ;
i < numAreas ;
i++ ) {
4316 if (
i == areaNum ) {
4340 int areaNum = gameRenderWorld->
PointInArea( point );
4341 if ( areaNum < 0 ) {
4344 if ( areaNum >= gameRenderWorld->
NumAreas() ) {
4345 Error(
"idGameLocal::LocationForPoint: areaNum >= gameRenderWorld->NumAreas()" );
4361 outMsg.
Init( msgBuf,
sizeof( msgBuf ) );
4381 if ( diff < 0.0
f ) {
4383 }
else if ( diff > 0.0
f ) {
4412 teamSpawnSpots[0].Clear();
4413 teamSpawnSpots[1].Clear();
4414 teamInitialSpots[0].Clear();
4415 teamInitialSpots[1].Clear();
4426 if ( spot.team == 0 || spot.team == 1 )
4427 teamSpawnSpots[spot.team].Append( spot );
4429 common->
Warning(
"info_player_deathmatch : invalid or no team attached to spawn point\n");
4437 assert( spot.team == 0 || spot.team == 1 );
4438 teamInitialSpots[ spot.team ].Append( spot.
ent );
4450 if ( !teamSpawnSpots[0].Num() )
4451 common->
Warning(
"red team : no info_player_deathmatch in map" );
4452 if ( !teamSpawnSpots[1].Num() )
4453 common->
Warning(
"blue team : no info_player_deathmatch in map" );
4455 if ( !teamSpawnSpots[0].Num() || !teamSpawnSpots[1].Num() )
4461 common->
Warning(
"no info_player_deathmatch in map" );
4468 common->
Printf(
"red team : %d spawns (%d initials)\n", teamSpawnSpots[ 0 ].Num(), teamInitialSpots[ 0 ].Num() );
4470 if ( !teamInitialSpots[ 0 ].Num() ) {
4471 common->
Warning(
"red team : no info_player_deathmatch entities marked initial in map" );
4472 for ( i = 0; i < teamSpawnSpots[ 0 ].Num(); i++ ) {
4473 teamInitialSpots[ 0 ].Append( teamSpawnSpots[ 0 ][ i ].ent );
4477 common->
Printf(
"blue team : %d spawns (%d initials)\n", teamSpawnSpots[ 1 ].Num(), teamInitialSpots[ 1 ].Num() );
4479 if ( !teamInitialSpots[ 1 ].Num() ) {
4480 common->
Warning(
"blue team : no info_player_deathmatch entities marked initial in map" );
4481 for ( i = 0; i < teamSpawnSpots[ 1 ].Num(); i++ ) {
4482 teamInitialSpots[ 1 ].Append( teamSpawnSpots[ 1 ][ i ].ent );
4492 common->
Warning(
"no info_player_deathmatch entities marked initial in map" );
4499 for ( k = 0; k < 2; k++ )
4500 for ( i = 0; i < teamInitialSpots[ k ].Num(); i++ ) {
4502 ent = teamInitialSpots[ k ][
i ];
4503 teamInitialSpots[ k ][
i ] = teamInitialSpots[ k ][
j ];
4504 teamInitialSpots[ k ][
j ] = ent;
4518 teamCurrentInitialSpot[0] = 0;
4519 teamCurrentInitialSpot[1] = 0;
4546 Error(
"No info_player_start on map.\n" );
4552 bool useInitialSpots =
false;
4555 useInitialSpots = player->
useInitialSpawns && teamCurrentInitialSpot[ player->
team ] < teamInitialSpots[ player->
team ].Num();
4565 }
else if ( useInitialSpots ) {
4569 return teamInitialSpots[ player->
team ][ teamCurrentInitialSpot[ player->
team ]++ ];
4601 int team = player->
team;
4602 assert( team == 0 || team == 1 );
4605 for( i = 0; i < teamSpawnSpots[ team ].Num(); i++ ) {
4606 pos = teamSpawnSpots[ team ][
i ].ent->GetPhysics()->GetOrigin();
4610 teamSpawnSpots[ team ][
i ].dist = 0x0;
4614 teamSpawnSpots[ team ][
i ].dist = 0x7fffffff;
4624 if ( dist < teamSpawnSpots[ team ][ i ].dist ) {
4625 teamSpawnSpots[ team ][
i ].dist = dist;
4631 qsort( (
void * )teamSpawnSpots[ team ].Ptr(), teamSpawnSpots[ team ].Num(),
sizeof(
spawnSpot_t ), (
int (*)(
const void *,
const void *) )
sortSpawnPoints );
4635 spot = teamSpawnSpots[ team ][ which ];
4644 pos =
spawnSpots[
i ].ent->GetPhysics()->GetOrigin();
4649 || static_cast< idPlayer * >(
entities[ j ] )->spectating ) {
4694 common->
Warning(
"Last Man Standing - forcing warmup on" );
4698 common->
Warning(
"Last Man Standing - setting fraglimit 1" );
4747 void idGameLocal::SetPortalSkyEnt(
idEntity *ent ) {
4756 bool idGameLocal::IsPortalSkyAcive() {
4757 return portalSkyActive;
4794 idStr aux =
mpGame.GetBestGametype( map, gametype );
4796 buf[ MAX_STRING_CHARS - 1 ] =
'\0';
4804 void idGameLocal::ComputeSlowMsec() {
4810 if ( quickSlowmoReset ) {
4811 quickSlowmoReset =
false;
4814 if ( gameSoundWorld ) {
4820 slowmoState = SLOWMO_STATE_OFF;
4831 else if ( g_enableSlowmo.GetBool() ) {
4836 if ( powerupOn && slowmoState == SLOWMO_STATE_OFF ) {
4837 slowmoState = SLOWMO_STATE_RAMPUP;
4840 if ( gameSoundWorld ) {
4845 else if ( !powerupOn && slowmoState == SLOWMO_STATE_ON ) {
4846 slowmoState = SLOWMO_STATE_RAMPDOWN;
4850 player->PlayHelltimeStopSound();
4855 if ( slowmoState == SLOWMO_STATE_RAMPUP ) {
4856 delta = 4 - slowmoMsec;
4858 if ( fabs( delta ) < g_slowmoStepRate.GetFloat() ) {
4860 slowmoState = SLOWMO_STATE_ON;
4863 slowmoMsec += delta * g_slowmoStepRate.GetFloat();
4866 if ( gameSoundWorld ) {
4870 else if ( slowmoState == SLOWMO_STATE_RAMPDOWN ) {
4871 delta = 16 - slowmoMsec;
4873 if ( fabs( delta ) < g_slowmoStepRate.GetFloat() ) {
4875 slowmoState = SLOWMO_STATE_OFF;
4876 if ( gameSoundWorld ) {
4881 slowmoMsec += delta * g_slowmoStepRate.GetFloat();
4884 if ( gameSoundWorld ) {
4895 void idGameLocal::ResetSlowTimeVars() {
4898 slowmoState = SLOWMO_STATE_OFF;
4901 fast.previousTime = 0;
4906 slow.previousTime = 0;
4916 void idGameLocal::QuickSlowmoReset() {
4917 quickSlowmoReset =
true;
4925 bool idGameLocal::NeedRestart() {
4967 int oldTeam = player->
team ;
void WriteBuildNumber(const int value)
virtual const idVec3 & GetOrigin(int id=0) const =0
virtual void SetSlowmoSpeed(float speed)=0
idPlayer * GetLocalPlayer() const
void Mem_EnableLeakTest(const char *name)
void SetupPolygon(const idVec3 *v, const int count)
int ClipModelsTouchingBounds(const idBounds &bounds, int contentMask, idClipModel **clipModelList, int maxCount) const
idEntity * GetEntity(void) const
virtual void FreeMap(void)=0
virtual void GetBestGameType(const char *map, const char *gametype, char buf[MAX_STRING_CHARS])=0
virtual void DeAlloc(idUserInterface *gui)=0
void LocalMapRestart(void)
idNetworkSystem * networkSystem
idStaticList< idEntity *, MAX_GENTITIES > initialSpots
void RandomizeInitialSpawns(void)
bool AddBounds(const idBounds &a)
float GetFloat(const char *key, const char *defaultString="0") const
virtual void HandleMainMenuCommands(const char *menuCommand, idUserInterface *gui)
idMapEntity * GetEntity(int i) const
GLsizei const GLfloat * value
void WriteString(const char *string)
int GetInt(const char *key, const char *defaultString="0") const
idStr & SetFileExtension(const char *extension)
float GetArea(void) const
void void static idThread * CurrentThread(void)
unsigned int GetGeometryCRC(void) const
void TransferKeyValues(idDict &other)
void DrawClipModels(const idVec3 &eye, const float radius, const idEntity *passEntity)
virtual void SetEnviroSuit(bool active)=0
assert(prefInfo.fullscreenBtn)
void RadiusPushClipModel(const idVec3 &origin, const float push, const idClipModel *clipModel)
static void ClearTraceModelCache(void)
virtual const idSoundShader * FindSound(const char *name, bool makeDefault=true)=0
const idDict * FindEntityDefDict(const char *name, bool makeDefault=true) const
static const int INITIAL_SPAWN_COUNT
void Restore(idRestoreGame *savefile)
idLinkList< idEntity > activeEntities
int Cmp(const char *text) const
idCVarSystem * cvarSystem
const char * HandleGuiCommands(const char *menuCommand)
idMat3 mat3_identity(idVec3(1, 0, 0), idVec3(0, 1, 0), idVec3(0, 0, 1))
const int MAX_GLOBAL_SHADER_PARMS
static void Shutdown(void)
virtual int GetClipMask(int id=-1) const =0
idNetworkSystem * networkSystem
void ReadMaterial(const idMaterial *&material)
void CallFunction(const function_t *func, bool clearStack)
void WriteObject(const idClass *obj)
virtual void DebugArrow(const idVec4 &color, const idVec3 &start, const idVec3 &end, int size, const int lifetime=0)=0
static void ShutDown(void)
idVec3 GetCenter(void) const
int Next(const int index) const
virtual bool Draw(int clientNum)
void PlayerStats(int clientNum, char *data, const int len)
virtual void SetCVarFloat(const char *name, const float value, int flags=0)=0
void Printf(const char *fmt,...) const id_attribute((format(printf
idRenderSystem * renderSystem
virtual bool FPU_StackIsEmpty(void)=0
void Remove(const int key, const int index)
struct idEntity::entityFlags_s fl
void FreeCurrentPVS(pvsHandle_t handle) const
virtual void virtual void virtual const idLangDict * GetLanguageDict(void)=0
type * GetEntity(void) const
void DelayedStart(int delay)
idPlayer * GetClientByCmdArgs(const idCmdArgs &args) const
virtual const char * FPU_GetState(void)=0
idActor * GetEnemy(void) const
idSmokeParticles * smokeParticles
float GetFloat(void) const
traceModelVert_t verts[MAX_TRACEMODEL_VERTS]
virtual void ForceFlush(void)
void MapClear(bool clearClients)
const idStr & GetKey(void) const
virtual const soundShaderParms_t * GetParms() const
void ReadDict(idDict *dict)
int GetSpawnId(const idEntity *ent) const
idDeclManager * declManager
virtual escReply_t HandleESC(idUserInterface **gui)
bool RayIntersection(const idVec3 &start, const idVec3 &dir, float &scale) const
idEntity * GetBindMaster(void) const
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 >)
virtual int ReadFile(const char *relativePath, void **buffer, ID_TIME_T *timestamp=NULL)=0
void SwitchToTeam(int clientNum, int oldteam, int newteam)
GLenum GLenum GLenum GLenum GLenum scale
idMat3 Transpose(void) const
virtual void SetRenderView(const renderView_t *renderView)=0
void void void void void Error(const char *fmt,...) const id_attribute((format(printf
idScriptObject scriptObject
virtual void SpawnPlayer(int clientNum)
bool IsType(const idTypeInfo &c) const
void EnterGame(int clientNum)
void SpawnPlayer(int clientNum)
idCVar g_mapCycle("g_mapCycle","mapcycle", CVAR_GAME|CVAR_ARCHIVE,"map cycling script for multiplayer games - see mapcycle.scriptcfg")
virtual void LoadMap(const idMapFile *mapFile)=0
void Set(const float x, const float y, const float z)
void RenderPlayerView(idUserInterface *hud)
const idMat3 & GetAxis(void) const
idEntity * FindEntity(const char *name) const
idList< idEntityPtr< idEntity > > targets
bool EverReferenced(void) const
int spawnIds[MAX_GENTITIES]
idRenderSystem * renderSystem
static void DrawDebugInfo(void)
const idKeyValue * MatchPrefix(const char *prefix, const idKeyValue *lastMatch=NULL) const
idVec3 GetEyePosition(void) const
idFileSystem * fileSystem
virtual int GetNumClipModels(void) const =0
void RadiusDamage(const idVec3 &origin, idEntity *inflictor, idEntity *attacker, idEntity *ignoreDamage, idEntity *ignorePush, const char *damageDefName, float dmgPower=1.0f)
void SetupPlayerPVS(void)
idCVar g_showTargets("g_showTargets","0", CVAR_GAME|CVAR_BOOL,"draws entities and thier targets. hidden entities are drawn grey.")
#define SCRIPT_DEFAULTFUNC
virtual idUserInterface * Alloc(void) const =0
void void void void DWarning(const char *fmt,...) const id_attribute((format(printf
virtual const idDict * GetUserInfo(int clientNum)
void ReadBool(bool &value)
void InitAsyncNetwork(void)
void DisplayEntities(void)
idCVar si_gameType("si_gameType", si_gameTypeArgs[0], CVAR_GAME|CVAR_SERVERINFO|CVAR_ARCHIVE,"game type - singleplayer, deathmatch, Tourney, Team DM or Last Man", si_gameTypeArgs, idCmdSystem::ArgCompletion_String< si_gameTypeArgs >)
virtual void ExecuteCommandBuffer(void)=0
idSoundSystem * soundSystem
idLocationEntity ** locationEntities
GLint GLint GLsizei GLsizei GLsizei depth
const char * Left(int len, idStr &result) const
virtual const idDict * SetUserInfo(int clientNum, const idDict &userInfo, bool isClient, bool canModify)
idCamera * GetPrivateCameraView(void) const
idCVar com_forceGenericSIMD("com_forceGenericSIMD","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"force generic platform independent SIMD")
void DrawPVS(const idVec3 &source, const pvsType_t type=PVS_NORMAL) const
static bool FindPathAroundObstacles(const idPhysics *physics, const idAAS *aas, const idEntity *ignore, const idVec3 &startPos, const idVec3 &seekPos, obstaclePath_t &path)
static bool PredictPath(const idEntity *ent, const idAAS *aas, const idVec3 &start, const idVec3 &velocity, int totalTime, int frameTime, int stopEvent, predictedPath_t &path)
virtual void SetCVarString(const char *name, const char *value, int flags=0)=0
const idVec3 & GetOrigin(void) const
void ReadBuildNumber(void)
void BloodSplat(const idVec3 &origin, const idVec3 &dir, float size, const char *material)
int GetNextClientNum(int current) const
pvsHandle_t MergeCurrentPVS(pvsHandle_t pvs1, pvsHandle_t pvs2) const
GLuint GLuint GLsizei GLenum type
void void ServerProcessEntityNetworkEventQueue(void)
void AddToFront(idLinkList &node)
traceModelEdge_t edges[MAX_TRACEMODEL_EDGES+1]
virtual void SetLocalClient(int clientNum)
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
float GetVolume(void) const
const char * GetClassname(void) const
void Set(const char *key, const char *value)
virtual void ApplyImpulse(idEntity *ent, int id, const idVec3 &point, const idVec3 &impulse)
double Milliseconds(void) const
virtual void DrawModel(cmHandle_t model, const idVec3 &modelOrigin, const idMat3 &modelAxis, const idVec3 &viewOrigin, const float radius)=0
idActor * GetAlertEntity(void)
void ThrottleUserInfo(void)
idCVar g_showCollisionWorld("g_showCollisionWorld","0", CVAR_GAME|CVAR_BOOL,"")
idUserInterfaceManager * uiManager
void ReadUsercmd(usercmd_t &usercmd)
idFileSystem * fileSystem
idList< idAAS * > aasList
idAASFileManager * AASFileManager
void WriteVec3(const idVec3 &vec)
int IcmpNoColor(const char *text) const
void SetThreadName(const char *name)
void SetGlobalMaterial(const idMaterial *mat)
static void ClearForceList(void)
int Icmp(const char *text) const
idSoundWorld * gameSoundWorld
void WriteMaterial(const idMaterial *material)
idStr & BackSlashesToSlashes(void)
void RemoveInventoryItem(idDict *item)
void Init(byte *data, int length)
int EntitiesTouchingBounds(const idBounds &bounds, int contentMask, idEntity **entityList, int maxCount) const
const char * GetMapName(void) const
int First(const int key) const
virtual bool InitFromSaveGame(const char *mapName, idRenderWorld *renderWorld, idSoundWorld *soundWorld, idFile *saveGameFile)
void WriteBool(const bool value)
idCVar developer("developer","0", CVAR_GAME|CVAR_BOOL,"")
idCVar g_showEntityInfo("g_showEntityInfo","0", CVAR_GAME|CVAR_BOOL,"")
int numEntitiesToDeactivate
idLocationEntity * LocationForPoint(const idVec3 &point)
idCVar g_skill("g_skill","1", CVAR_GAME|CVAR_INTEGER,"")
virtual bool FastWorldTrace(modelTrace_t &trace, const idVec3 &start, const idVec3 &end) const =0
void WriteUsercmd(const usercmd_t &usercmd)
bool IsHidden(void) const
idEntity * SpawnEntityType(const idTypeInfo &classdef, const idDict *args=NULL, bool bIsClientReadSnapshot=false)
virtual void InitFromNewMap(const char *mapName, idRenderWorld *renderWorld, idSoundWorld *soundWorld, bool isServer, bool isClient, int randSeed)
virtual void ProjectDecalOntoWorld(const idFixedWinding &winding, const idVec3 &projectionOrigin, const bool parallel, const float fadeDepth, const idMaterial *material, const int startTime)=0
void void void Warning(const char *fmt,...) const id_attribute((format(printf
int Icmpn(const char *text, int n) const
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_timeentities("g_timeEntities","0", CVAR_GAME|CVAR_FLOAT,"when non-zero, shows entities whose think functions exceeded the # of milliseconds specified")
pvsHandle_t SetupCurrentPVS(const idVec3 &source, const pvsType_t type=PVS_NORMAL) const
void RemoveSelectedEntity(idEntity *ent)
virtual const idBounds & GetBounds(int id=-1) const =0
virtual void BufferCommandText(cmdExecution_t exec, const char *text)=0
virtual const idDict & GetPersistentPlayerInfo(int clientNum)
static void MapRestart_f(const idCmdArgs &args)
void RemovePrimitiveData()
void GetShakeSounds(const idDict *dict)
void SetPortalState(qhandle_t portal, int blockingBits)
void KillBox(idEntity *ent, bool catch_teleport=false)
class idPlayerView playerView
virtual void SetPortalState(qhandle_t portal, int blockingBits)=0
idCVar g_maxShowDistance("g_maxShowDistance","128", CVAR_GAME|CVAR_FLOAT,"")
void CallFrameCommand(idEntity *ent, const function_t *frameCommand)
idCVar g_cinematic("g_cinematic","1", CVAR_GAME|CVAR_BOOL,"skips updating entities that aren't marked 'cinematic' '1' during cinematics")
idEntity * FindTraceEntity(idVec3 start, idVec3 end, const idTypeInfo &c, const idEntity *skip) const
idAAS * GetAAS(int num) const
void SetString(const char *value)
virtual cmHandle_t LoadModel(const char *modelName, const bool precache)=0
static class idFileSystem * fileSystem
bool InhibitEntitySpawn(idDict &spawnArgs)
idPhysics * GetPhysics(void) const
virtual void SetGravity(const idVec3 &newGravity)=0
const char * GetString(const char *key, const char *defaultString="") const
void D_DrawDebugLines(void)
GLubyte GLubyte GLubyte GLubyte w
bool SpawnEntityDef(const idDict &args, idEntity **ent=NULL, bool setDefaults=true)
void ReadFloat(float &value)
bool InCurrentPVS(const pvsHandle_t handle, const idVec3 &target) const
bool IsType(const idTypeInfo &superclass) const
static int FtoiFast(float f)
int GetNumEntities(void) const
idVec3 vec3_origin(0.0f, 0.0f, 0.0f)
idCVar g_bloodEffects("g_bloodEffects","1", CVAR_GAME|CVAR_ARCHIVE|CVAR_BOOL,"show blood splats, sprays and gibs")
virtual void ClearAllSoundEmitters(void)=0
void SetDefaults(const idDict *dict)
bool Parse(const char *filename, bool ignoreRegion=false, bool osPath=false)
void InitScriptForMap(void)
void UnregisterEntity(idEntity *ent)
virtual void SwitchTeam(int clientNum, int team)
void gameError(const char *fmt,...)
static void Save(idSaveGame *savefile)
void WriteFloat(const float value)
bool InPlayerConnectedArea(idEntity *ent) const
idCamera * GetCamera(void) const
idCVar g_gravity("g_gravity", DEFAULT_GRAVITY_STRING, CVAR_GAME|CVAR_FLOAT,"")
virtual void virtual void virtual void DWarning(const char *fmt,...) id_attribute((format(printf
virtual void SetPersistentPlayerInfo(int clientNum, const idDict &playerInfo)
static const char * sufaceTypeNames[MAX_SURFACE_TYPES]
idThread * frameCommandThread
virtual int GetNumSounds() const
bool GetBool(const char *key, const char *defaultString="0") const
virtual bool InitFromFile(const char *qpath, bool rebuild=true, bool cache=true)=0
virtual const char * GetCVarString(const char *name) const =0
virtual void ThrottleUserInfo(void)
virtual void SetServerInfo(const idDict &serverInfo)
void void DPrintf(const char *fmt,...) const id_attribute((format(printf
int edges[MAX_TRACEMODEL_POLYEDGES]
static void Shutdown(void)
virtual idRenderModel * FindModel(const char *modelName)=0
virtual const idDecl * FindType(declType_t type, const char *name, bool makeDefault=true)=0
void SetInteger(const int value)
GLsizei GLsizei GLenum GLenum const GLvoid * data
renderView_t * GetRenderView(void)
virtual void SetCVarBool(const char *name, const bool value, int flags=0)=0
int GetInteger(void) const
idVec3 GetVector(const char *key, const char *defaultString=NULL) const
idEntity * GetNextTeamEntity(void) const
static idTypeInfo * GetClass(const char *name)
void RadiusPush(const idVec3 &origin, const float radius, const float push, const idEntity *inflictor, const idEntity *ignore, float inflictorScale, const bool quake)
void PrintStatistics(void)
virtual idFile * OpenFileWrite(const char *relativePath, const char *basePath="fs_savepath")=0
bool PowerUpActive(int powerup) const
const idVec3 & GetGravity(void) const
pvsHandle_t playerConnectedAreas
const char * GetString(const char *str) const
idDict persistentLevelInfo
virtual void DebugClearLines(int time)=0
#define ENTITYNUM_MAX_NORMAL
idUserInterface * StartMenu(void)
virtual void DebugOutput(const idVec3 &origin)=0
void ShutdownAsyncNetwork(void)
const idStr & GetValue(void) const
void RemoveAllAASObstacles(void)
virtual idUserInterface * StartMenu(void)
idCVar g_frametime("g_frametime","0", CVAR_GAME|CVAR_BOOL,"displays timing information for each game frame")
void DeleteContents(bool clear)
int EntitiesWithinRadius(const idVec3 org, float radius, idEntity **entityList, int maxCount) const
static void InitProcessor(const char *module, bool forceGeneric)
idMapFile * GetLevelMap(void)
float NormalizeFast(void)
static idCVar * staticVars
idCVar g_showCollisionTraces("g_showCollisionTraces","0", CVAR_GAME|CVAR_BOOL,"")
virtual void DrawText(const char *text, const idVec3 &origin, float scale, const idVec4 &color, const idMat3 &viewAxis, const int align=1, const int lifetime=0, bool depthTest=false)=0
virtual void RegisterDeclType(const char *typeName, declType_t type, idDecl *(*allocator)(void))=0
int Find(const char c, int start=0, int end=-1) const
void AddEntityToHash(const char *name, idEntity *ent)
static idList< idThread * > & GetThreads(void)
idLinkList< idEntity > spawnNode
void WriteObjectList(void)
gameState_t GameState(void) const
void SetBool(const char *key, bool val)
virtual void ServerSendReliableMessage(int clientNum, const idBitMsg &msg)
idUserInterfaceManager * uiManager
void AlertAI(idEntity *ent)
virtual void Damage(idEntity *inflictor, idEntity *attacker, const idVec3 &dir, const char *damageDefName, const float damageScale, const int location)
virtual const char * GetSound(int index) const
const idKeyValue * FindKey(const char *key) const
static void RegisterStaticVars(void)
void Error(const char *fmt,...) id_attribute((format(printf
virtual void Printf(const char *fmt,...) id_attribute((format(printf
idStaticList< spawnSpot_t, MAX_GENTITIES > spawnSpots
static void SinCos16(float a, float &s, float &c)
idBounds Expand(const float d) const
virtual const char * HandleGuiCommands(const char *menuCommand)
bool InPlayerPVS(idEntity *ent) const
idLinkList< idEntity > spawnedEntities
void RegisterEntity(idEntity *ent)
void FlushUnusedAnims(void)
virtual bool FileIsInPAK(const char *relativePath)=0
void WriteInt(const int value)
virtual void MediaPrint(const char *fmt,...) id_attribute((format(printf
virtual void CacheDictionaryMedia(const idDict *dict)
virtual void RegisterDeclFolder(const char *folder, const char *extension, declType_t defaultType)=0
idDeclManager * declManager
entityState_t * clientEntityStates[MAX_CLIENTS][MAX_GENTITIES]
int GetTargets(const idDict &args, idList< idEntityPtr< idEntity > > &list, const char *ref) const
const idMaterial * GetGlobalMaterial()
int GenerateKey(const char *string, bool caseSensitive=true) const
idAASFileManager * AASFileManager
void SortActiveEntityList(void)
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")
byte lagometer[LAGO_IMG_HEIGHT][LAGO_IMG_WIDTH][4]
idEntity * entities[MAX_GENTITIES]
idDict userInfo[MAX_CLIENTS]
void WriteDict(const idDict *dict)
virtual int GetNumDecls(declType_t type)=0
idPlayer * GetClientByName(const char *name) const
idPlayer * GetClientByNum(int current) const
static const float TWO_PI
idCVar aas_test("aas_test","0", CVAR_GAME|CVAR_INTEGER,"")
aasHandle_t AddAASObstacle(const idBounds &bounds)
const char * GetString(void) const
idCVar g_flushSave("g_flushSave","0", CVAR_GAME|CVAR_BOOL,"1 = don't buffer file writing for save games.")
bool IsNumeric(void) const
void CalcFov(float base_fov, float &fov_x, float &fov_y) const
void AddToEnd(idLinkList &node)
gameExport_t * GetGameAPI(gameImport_t *import)
int Append(const type &obj)
idEntity * GetTeamMaster(void) const
idEntity * GetTraceEntity(const trace_t &trace) const
virtual void SetMute(bool mute)=0
void CallObjectFrameCommand(idEntity *ent, const char *frameCommand)
int Append(const type &obj)
LPCSTR GetString(LPCSTR psPrompt)
void SetInt(const char *key, int val)
float globalShaderParms[MAX_GLOBAL_SHADER_PARMS]
idRenderModelManager * renderModelManager
idRenderModelManager * renderModelManager
void SetAASAreaState(const idBounds &bounds, const int areaContents, bool closed)
void SetCamera(idCamera *cam)
static int static int vsnPrintf(char *dest, int size, const char *fmt, va_list argptr)
int AddUnique(const type &obj)
static void DrawDebugInfo(void)
virtual const idDecl * DeclByIndex(declType_t type, int index, bool forceParse=true)=0
static void NextMap_f(const idCmdArgs &args)
idCVar r_aspectRatio("r_aspectRatio","0", CVAR_RENDERER|CVAR_INTEGER|CVAR_ARCHIVE,"aspect ratio of view:\n0 = 4:3\n1 = 16:9\n2 = 16:10", 0, 2)
idEntityPtr< idActor > lastAIAlertEntity
void ProjectDecal(const idVec3 &origin, const idVec3 &dir, float depth, bool parallel, float size, const char *material, float angle=0)
bool LoadModel(const char *name)
bool IsGametypeFlagBased(void)
idEditEntities * editEntities
idMat3 ToMat3(void) const
declState_t GetState(void) const
void InitConsoleCommands(void)
bool WriteDeltaDict(const idDict &dict, const idDict *base)
bool IntersectsBounds(const idBounds &a) const
static void FreeObstacleAvoidanceNodes(void)
virtual const idBounds & GetAbsBounds(int id=-1) const =0
virtual int NumAreas(void) const =0
virtual void SetSlowmo(bool active)=0
const function_t * GetFunction(const char *name) const
idSoundSystem * soundSystem
usercmd_t usercmds[MAX_CLIENTS]
static class idCVarSystem * cvarSystem
idCVar pm_thirdPerson("pm_thirdPerson","0", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_BOOL,"enables third person view")
bool IsModified(void) const
void void void void void void LoadMap(const char *mapName, int randseed)
static void Restore(idRestoreGame *savefile)
virtual int ClipContents(const idClipModel *model) const =0
idDict * FindInventoryItem(const char *name)
virtual bool AreasAreConnected(int areaNum1, int areaNum2, portalConnection_t connection)=0
const char * GetName(void) const
static void ServiceEvents(void)
idCVar si_map("si_map","game/mp/d3dm1", CVAR_GAME|CVAR_SERVERINFO|CVAR_ARCHIVE,"map to be played next on server", idCmdSystem::ArgCompletion_MapName)
void SpawnMapEntities(void)
void Save(idSaveGame *savefile) const
void ReadVec3(idVec3 &vec)
idAnimManager animationLib
idEventQueue savedEventQueue
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_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.")
static void Shutdown(void)
const char * c_str(void) const
traceModelPoly_t polys[MAX_TRACEMODEL_POLYS]
void RestoreObjects(void)
void Error(const char *fmt,...) const id_attribute((format(printf
const int MAX_GAME_MESSAGE_SIZE
const int CINEMATIC_SKIP_DELAY
bool RequirementMet(idEntity *activator, const idStr &requires, int removeItem)
virtual void DebugClearPolygons(int time)=0
int clientPVS[MAX_CLIENTS][ENTITY_PVS_SIZE]
idCVar g_stopTime("g_stopTime","0", CVAR_GAME|CVAR_BOOL,"")
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""7 = entity models", 0, 7, idCmdSystem::ArgCompletion_Integer< 0, 7 >)
virtual bool GetCVarBool(const char *name) const =0
const idKeyValue * GetKeyVal(int index) const
const idEventDef EV_Remove("<immediateremove>", NULL)
bool IsActive(void) const
const idBounds & GetAbsBounds(void) const
char sessionCommand[MAX_STRING_CHARS]
virtual int GetContents(int id=-1) const =0
void AddObject(const idClass *obj)
void UpdateServerInfoFlags(void)
const int * GetPVSAreas(void)
const char * Argv(int arg) const
idCVar ai_showPaths("ai_showPaths","0", CVAR_GAME|CVAR_BOOL,"draws path_* entities")
pvsHandle_t GetClientPVS(idPlayer *player, pvsType_t type)
virtual const idDict * MoveCVarsToDict(int flags) const =0
idDict persistentPlayerInfo[MAX_CLIENTS]
virtual bool CanDamage(const idVec3 &origin, idVec3 &damagePoint) const
void Add(const int key, const int index)
idCVarSystem * cvarSystem
bool CheatsOk(bool requirePlayer=true)
snapshot_t * clientSnapshots[MAX_CLIENTS]
static idAAS * Alloc(void)
virtual void GetMapLoadingGUI(char gui[MAX_STRING_CHARS])
const int NUM_RENDER_PORTAL_BITS
idBounds & ExpandSelf(const float d)
const idTraceModel * GetTraceModel(void) const
float dot(float a[], float b[])
virtual void SaveGame(idFile *saveGameFile)
virtual void RemoveFlaggedAutoCompletion(int flags)=0
virtual void MapShutdown(void)
virtual void DebugBounds(const idVec4 &color, const idBounds &bounds, const idVec3 &org=vec3_origin, const int lifetime=0)=0
virtual void UpdateTime(int endTimeMSec)=0
const char * GetEntityDefName(void) const
static void ArgCompletion_EntityName(const idCmdArgs &args, void(*callback)(const char *s))
virtual void Test(const idVec3 &origin)=0
virtual int GetTimeGroupTime(int timeGroup)=0
const idDeclEntityDef * FindEntityDef(const char *name, bool makeDefault=true) const
idRenderWorld * gameRenderWorld
idCVar g_showPVS("g_showPVS","0", CVAR_GAME|CVAR_INTEGER,"", 0, 2)
void AddPoint(const idVec3 &v)
char * va(const char *fmt,...)
virtual int PointInArea(const idVec3 &point) const =0
bool Translation(trace_t &results, const idVec3 &start, const idVec3 &end, const idClipModel *mdl, const idMat3 &trmAxis, int contentMask, const idEntity *passEntity)
const int GAME_API_VERSION
void WriteBits(int value, int numBits)
virtual void CloseFile(idFile *f)=0
bool PostEventMS(const idEventDef *ev, int time)
virtual void Error(const char *fmt,...) id_attribute((format(printf
bool RemoveEntityFromHash(const char *name, idEntity *ent)
const int MAX_SURFACE_TYPES
idEntityPtr< idEntity > lastGUIEnt
void SetFloat(const float value)
static void DrawDebugInfo(void)
int GetNumKeyVals(void) const
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
const char * GetName(void) const
virtual void SelectTimeGroup(int timeGroup)=0
void ReadString(idStr &string)
idCVar g_showCollisionModels("g_showCollisionModels","0", CVAR_GAME|CVAR_BOOL,"")
void EnterCinematic(void)
int sprintf(idStr &string, const char *fmt,...)
virtual gameReturn_t RunFrame(const usercmd_t *clientCmds)
const idMaterial * globalMaterial
idLinkList< idEntity > activeNode
virtual int Printf(const char *fmt,...) id_attribute((format(printf
idCollisionModelManager * collisionModelManager
bool IsRenderModel(void) const
void RemoveAASObstacle(const aasHandle_t handle)
virtual void AddCommand(const char *cmdName, cmdFunction_t function, int flags, const char *description, argCompletion_t argCompletion=NULL)=0
idEntity * SelectInitialSpawnPoint(idPlayer *player)
idCollisionModelManager * collisionModelManager
virtual void Shutdown(void)
void ShutdownConsoleCommands(void)
void ReadObject(idClass *&obj)
void void Warning(const char *fmt,...) const id_attribute((format(printf
static class idCommon * common
static int sortSpawnPoints(const void *ptr1, const void *ptr2)
idClass *(* CreateInstance)(void)
idCVar g_decals("g_decals","1", CVAR_GAME|CVAR_ARCHIVE|CVAR_BOOL,"show decals such as bullet holes")
virtual void GetClientStats(int clientNum, char *data, const int len)
idEntity * FindEntityUsingDef(idEntity *from, const char *match) const