g_main.c File Reference

Main game functions. More...

#include "g_local.h"
#include "g_ai.h"
Include dependency graph for g_main.c:

Go to the source code of this file.

Functions

static void G_FreeInventory (void *data)
static void * G_AllocInventoryMemory (size_t size)
static void G_FreeAllInventory (void)
static void G_Init (void)
 This will be called when the game library is first loaded.
static void G_Shutdown (void)
 Free the tags TAG_LEVEL and TAG_GAME.
game_export_tGetGameAPI (game_import_t *import)
 Returns a pointer to the structure with all entry points and global variables.
void Sys_Error (const char *error,...)
void Com_Printf (const char *msg,...)
void Com_DPrintf (int level, const char *msg,...)
static void CheckNeedPass (void)
 If password has changed, update sv_needpass cvar as needed.
static void G_SendBoundingBoxes (void)
qboolean G_RunFrame (void)

Variables

game_locals_t game
level_locals_t level
game_import_t gi
game_export_t globals
cvar_tpassword
cvar_tsv_needpass
cvar_tsv_maxplayersperteam
cvar_tsv_maxsoldiersperteam
cvar_tsv_maxsoldiersperplayer
cvar_tsv_enablemorale
cvar_tsv_roundtimelimit
cvar_tsv_maxentities
cvar_tsv_dedicated
cvar_tdeveloper
cvar_tlogstats
FILE * logstatsfile
cvar_tsv_filterban
static cvar_tsv_cheats
cvar_tsv_maxteams
cvar_tsv_ai
cvar_tsv_teamplay
cvar_tsv_maxclients
cvar_tsv_hurtaliens
cvar_tsv_shot_origin
static cvar_tsv_send_edicts
cvar_tai_alien
cvar_tai_civilian
cvar_tai_equipment
cvar_tai_numaliens
cvar_tai_numcivilians
cvar_tai_numactors
cvar_tmob_death
cvar_tmob_wound
cvar_tmof_watching
cvar_tmof_teamkill
cvar_tmof_civilian
cvar_tmof_enemy
cvar_tmor_pain
cvar_tmor_default
cvar_tmor_distance
cvar_tmor_victim
cvar_tmor_attacker
cvar_tmon_teamfactor
cvar_tmor_regeneration
cvar_tmor_shaken
cvar_tmor_panic
cvar_tmor_brave
cvar_tm_sanity
cvar_tm_rage
cvar_tm_rage_stop
cvar_tm_panic_stop
cvar_tg_reaction_fair
cvar_tg_ailua
cvar_tg_aidebug
cvar_tg_drawtraces
cvar_tg_nodamage
cvar_tg_notu
cvar_tg_nospawn
cvar_tg_actorspeed
cvar_tflood_msgs
cvar_tflood_persecond
cvar_tflood_waitdelay
cvar_tdifficulty
static const int TAG_INVENTORY = 2389
static const inventoryImport_t inventoryImport = { G_FreeInventory, G_FreeAllInventory, G_AllocInventoryMemory }

Detailed Description

Main game functions.

Definition in file g_main.c.


Function Documentation

static void CheckNeedPass ( void   )  [static]

If password has changed, update sv_needpass cvar as needed.

Definition at line 377 of file g_main.c.

References game_import_t::Cvar_Set(), cvar_s::modified, Q_strcasecmp, qfalse, and cvar_s::string.

Referenced by G_RunFrame().

void Com_DPrintf ( int  level,
const char *  msg,
  ... 
)

Definition at line 354 of file g_main.c.

References cvar_s::integer, and Q_vsnprintf().

void Com_Printf ( const char *  msg,
  ... 
)

Definition at line 342 of file g_main.c.

References Q_vsnprintf().

static void* G_AllocInventoryMemory ( size_t  size  )  [static]

Definition at line 127 of file g_main.c.

References G_TagMalloc, and TAG_INVENTORY.

static void G_FreeAllInventory ( void   )  [static]

Definition at line 132 of file g_main.c.

References G_FreeTags, and TAG_INVENTORY.

Referenced by G_Shutdown().

static void G_FreeInventory ( void *  data  )  [static]

Definition at line 122 of file g_main.c.

References G_MemFree.

static void G_Init ( void   )  [static]
qboolean G_RunFrame ( void   ) 
static void G_SendBoundingBoxes ( void   )  [static]

Definition at line 390 of file g_main.c.

References G_EdictsGetFirst(), G_EdictsGetNextInUse(), G_EventSendEdict(), and cvar_s::integer.

Referenced by G_RunFrame().

static void G_Shutdown ( void   )  [static]

Free the tags TAG_LEVEL and TAG_GAME.

See also:
Mem_FreeTags

Definition at line 271 of file g_main.c.

References AIL_Shutdown(), Com_Printf(), G_FreeAllInventory(), G_FreeTags, inventoryInterface_s::GetUsedSlots, game_locals_t::i, logstatsfile, TAG_GAME, and TAG_LEVEL.

Referenced by GetGameAPI().

game_export_t* GetGameAPI ( game_import_t import  ) 
void Sys_Error ( const char *  error,
  ... 
)

Definition at line 330 of file g_main.c.

References Q_vsnprintf().

Referenced by _Mem_Alloc(), _Mem_CheckPoolIntegrity(), _Mem_CheckSentinels(), _Mem_CreatePool(), _Mem_ReAlloc(), AddBrushBevels(), AddPortalToNodes(), AddScriptToStack(), AII_UpdateOneInstallationDelay(), AIR_ParseAircraft(), AL_AddAliens(), AL_RemoveAliens(), ASE_GetCurrentMesh(), ASE_KeyGEOMOBJECT(), ASE_KeyMATERIAL_LIST(), ASE_KeyMESH(), ASE_KeyMESH_FACE_LIST(), ASE_KeyMESH_TVERTLIST(), ASE_KeyMESH_VERTEX_LIST(), ASE_KeyTFACE_LIST(), ASE_Load(), ASE_ParseBracedBlock(), ASE_Process(), ASE_SkipEnclosingBraces(), BaseWindingForPlane(), BeginModel(), CalcLightinfoExtents(), CalcLightinfoVectors(), Check_ExtraBrushesForWorldspawn(), Check_FindCompositeSides(), Check_InfoStartAligned(), Check_InitEntityDefs(), Check_NearList(), CheckFlags(), CheckPlaneAgainstParents(), ChopWindingInPlace(), CHRSH_CharGenAbilitySkills(), CHRSH_CharGetBody(), CHRSH_CharGetHead(), CL_ParseCampaignEvents(), CL_ParseMapDefinition(), ClipWindingEpsilon(), Com_AddObjectLinks(), Com_AlignPtr(), Com_AllocateCustomSkin(), Com_EParseValue(), Com_Error(), Com_GiveName(), Com_ParseActorModels(), Com_ParseActorNames(), Com_ParseArmourOrResistance(), Com_ParseCharacterTemplate(), Com_ParseDamageTypes(), Com_ParseEquipment(), Com_ParseGameTypes(), Com_ParseInventory(), Com_ParseItem(), Com_ParseScripts(), Com_ParseTeam(), Com_ParseValue(), Com_ParseVersion(), Com_SetValue(), Com_ValueToStr(), CopyLump(), CP_GetEventsByID(), CP_MissionChooseUFO(), CreateNewFloatPlane(), EmitBrushes(), EmitDrawNode_r(), EmitFace(), EmitFaceVertexes(), EmitLeaf(), EndOfScript(), FacesWithVert(), FinalLightFace(), FindMiptex(), FIRESH_GetFiredef(), FixWorkingDirectory(), FreeWinding(), FS_CopyFile(), FS_OpenFileSingle(), FS_Read(), FS_RemoveFile(), FS_RenameFile(), FS_RestartFilesystem(), FS_Seek(), GatherSampleLight(), GetEdge(), GetToken(), GetVertexnum(), HashVec(), I_EquipActorMelee(), I_MoveInInventory(), InitCocoa(), INV_GetFilterFromItem(), INVSH_CheckToInventory_shape(), INVSH_GetItemByIDX(), INVSH_SearchInInventory(), Key_GetBinding(), LightWorld(), LoadBSPFile(), LoadJPG(), LoadPNG(), LoadTGA(), main(), MakeNodePortal(), MoveBrushesToWorld(), MSO_InitList(), ParseBrush(), ParseEntity(), ParseEpair(), ParseFromMemory(), ParseMapEntity(), PlaneFromPoints(), PQueueInitialise(), ProcessSubModel(), PruneNodes_r(), Q_strcat(), Q_strncpyz(), Qcommon_Init(), RemovePortalFromNode(), RT_WriteCSVFiles(), SelectSplitSide(), SplitNodePortals(), SubdivideFace(), Sys_FindFirst(), Sys_Init(), TestBrushToPlanenum(), TestEdge(), TexinfoForBrushTexture(), ThreadInit(), ThreadLock(), ThreadUnlock(), TR_BuildTracingNode_r(), U2M_Parameter(), UI_BaseMapNodeRightClick(), UI_CheckActionTokenTypeSanity(), UI_DrawModelNodeWithUIModel(), UI_EditorNodeCapturedMouseMove(), UI_GetReferenceFloat(), UI_GetReferenceString(), UI_ParseWindow(), WriteBSPBrushMap(), WriteBSPFile(), WriteMapFile(), and WriteTGA24().


Variable Documentation

Definition at line 65 of file g_main.c.

Definition at line 66 of file g_main.c.

Definition at line 67 of file g_main.c.

Definition at line 70 of file g_main.c.

Referenced by AI_CreatePlayer(), G_SpawnEntities(), and SP_alien_start().

Definition at line 68 of file g_main.c.

Referenced by AI_CreatePlayer().

Definition at line 69 of file g_main.c.

Referenced by AI_CreatePlayer(), and SP_civilian_start().

Definition at line 47 of file g_main.c.

Definition at line 118 of file g_main.c.

Referenced by G_Damage().

Definition at line 114 of file g_main.c.

Referenced by G_CheckFlood().

Definition at line 115 of file g_main.c.

Referenced by G_CheckFlood().

Definition at line 116 of file g_main.c.

Referenced by G_CheckFlood().

Definition at line 113 of file g_main.c.

Referenced by G_ClientMove().

Definition at line 108 of file g_main.c.

Referenced by G_TestVis().

Definition at line 107 of file g_main.c.

Referenced by AI_Run().

Definition at line 109 of file g_main.c.

Referenced by G_TraceDraw().

Definition at line 110 of file g_main.c.

Referenced by G_Damage().

Definition at line 112 of file g_main.c.

Referenced by G_SetTeamForPlayer().

Definition at line 111 of file g_main.c.

Referenced by G_ClientMove().

Definition at line 106 of file g_main.c.

Referenced by G_ReactionFireCheckExecution().

Definition at line 34 of file g_main.c.

Referenced by AI_ActorThink(), AI_CheckForMissionTargets(), AI_CheckUsingDoor(), AI_CivilianCalcBestAction(), AI_CreatePlayer(), AI_FighterCalcBestAction(), AI_FindHerdLocation(), AI_FindHidingLocation(), AI_InitPlayer(), AI_PrepBestAction(), AI_SearchBestTarget(), AI_SetCharacterValues(), AI_SetEquipment(), AI_TryToReloadWeapon(), AI_TurnIntoDirection(), AIL_ActorThink(), AIL_canreload(), AIL_Init(), AIL_InitActor(), AIL_positionshoot(), AIL_print(), AIL_reload(), AIL_Shutdown(), AIL_toTeamInt(), AIL_toTeamString(), Destroy_Breakable(), Door_Use(), ED_ParseEdict(), FS_LoadPackFile(), G_Actor2x2Spawn(), G_ActorFall(), G_ActorInvMove(), G_ActorReload(), G_ActorSetMaxs(), G_ActorSpawn(), G_AddItemToFloor(), G_AppearPerishEvent(), G_BuildForbiddenList(), G_CenterView(), G_CharacterGetMaxExperiencePerMission(), G_CheckForceEndRound(), G_ClientAction(), G_ClientAssignDefaultActorValues(), G_ClientBegin(), G_ClientCanReload(), G_ClientCommand(), G_ClientConnect(), G_ClientDisconnect(), G_ClientEndRound(), G_ClientGetFreeSpawnPointForActorSize(), G_ClientGetWeaponFromInventory(), G_ClientInitActorStates(), G_ClientMove(), G_ClientPrintf(), G_ClientReadCharacter(), G_ClientReadInventory(), G_ClientSendEdictsAndBrushModels(), G_ClientShoot(), G_ClientSkipActorInfo(), G_ClientSpawn(), G_ClientStateChange(), G_ClientStateChangeUpdate(), G_ClientTeamInfo(), G_ClientTurn(), G_ClientUseEdict(), G_ClientUserinfoChanged(), G_Damage(), G_EdictAppear(), G_EdictCalcOrigin(), G_EdictSetOrigin(), G_EdictsGetByNum(), G_EventActorDie(), G_EventActorFall(), G_EventActorRevitalise(), G_EventActorSendReservations(), G_EventActorStats(), G_EventActorTurn(), G_EventDestroyEdict(), G_EventEndRound(), G_EventInventoryAdd(), G_EventInventoryAmmo(), G_EventInventoryDelete(), G_EventInventoryReload(), G_EventParticleSpawn(), G_EventPerish(), G_EventReactionFireChange(), G_EventResetClientAction(), G_EventSendEdict(), G_EventSetClientAction(), G_EventShoot(), G_EventShootHidden(), G_EventSpawnSound(), G_EventStartShoot(), G_EventThrow(), G_FireAffectedSurface(), G_FreeEdict(), G_GetObjectForFiredef(), G_GetShotOrigin(), G_GetTeam(), G_InventoryDropToFloorCheck(), G_InventoryRemoveItemByID(), G_InventoryToFloor(), G_MatchSendResults(), G_MissionThink(), G_MissionTouch(), G_MissionUse(), G_Morale(), G_MoraleBehaviour(), G_MoralePanic(), G_MoraleRage(), G_MoveCalcLocal(), G_PhysicsStep(), G_PhysicsThink(), G_PrepareShot(), G_PrintStats(), G_ReactionFireReset(), G_ReadItem(), G_RecalcRouting(), G_Say_f(), G_SendCharacterData(), G_SendInventory(), G_SendInvisible(), G_SendParticle(), G_SendState(), G_ServerCommand(), G_SetTeamForPlayer(), G_ShootGrenade(), G_ShootSingle(), G_Spawn(), G_SpawnAIPlayer(), G_SpawnEntities(), G_SpawnFloor(), G_SpawnItemOnFloor(), G_SplashDamage(), G_TestLine(), G_TestLineWithEnts(), G_TouchEdicts(), G_TouchSolids(), G_TouchTriggers(), G_Trace(), G_TriggerSpawn(), G_WriteItem(), pos3L_goto(), SP_civilian_target(), SP_func_breakable(), SP_func_door(), SP_func_rotating(), SP_misc_item(), SP_misc_message(), SP_misc_mission(), SP_misc_mission_aliens(), SP_misc_model(), SP_trigger_hurt(), SP_trigger_rescue(), SP_trigger_touch(), SP_worldspawn(), SVCmd_AddIP_f(), SVCmd_AI_Add_f(), SVCmd_ListIP_f(), SVCmd_RemoveIP_f(), SVCmd_Win_f(), SVCmd_WriteIP_f(), and Touch_TouchTrigger().

const inventoryImport_t inventoryImport = { G_FreeInventory, G_FreeAllInventory, G_AllocInventoryMemory } [static]

Definition at line 137 of file g_main.c.

Definition at line 49 of file g_main.c.

FILE* logstatsfile

Definition at line 50 of file g_main.c.

Referenced by G_Init(), G_PrintStats(), and G_Shutdown().

Definition at line 104 of file g_main.c.

Referenced by G_MoraleStopPanic().

Definition at line 102 of file g_main.c.

Referenced by G_MoraleBehaviour().

Definition at line 103 of file g_main.c.

Referenced by G_MoraleStopRage().

Definition at line 101 of file g_main.c.

Referenced by G_MoraleBehaviour().

Definition at line 73 of file g_main.c.

Referenced by G_Morale().

Definition at line 74 of file g_main.c.

Referenced by G_Morale().

Definition at line 77 of file g_main.c.

Referenced by G_Morale().

Definition at line 78 of file g_main.c.

Referenced by G_Morale().

Definition at line 76 of file g_main.c.

Referenced by G_Morale().

Definition at line 75 of file g_main.c.

Referenced by G_Morale().

Definition at line 94 of file g_main.c.

Referenced by G_Morale().

Definition at line 91 of file g_main.c.

Referenced by G_Morale().

Definition at line 99 of file g_main.c.

Referenced by AI_HideNeeded().

Definition at line 82 of file g_main.c.

Referenced by G_Morale().

Definition at line 85 of file g_main.c.

Referenced by G_Morale().

Definition at line 79 of file g_main.c.

Referenced by G_Morale().

Definition at line 96 of file g_main.c.

Referenced by G_MoraleBehaviour().

Definition at line 97 of file g_main.c.

Referenced by G_MoraleBehaviour(), and G_ReactionFireIsPossible().

Definition at line 88 of file g_main.c.

Referenced by G_Morale().

Definition at line 37 of file g_main.c.

Referenced by G_ClientConnect().

Definition at line 58 of file g_main.c.

Referenced by AI_CreatePlayer().

cvar_t* sv_cheats [static]

Definition at line 54 of file g_main.c.

Definition at line 46 of file g_main.c.

Definition at line 43 of file g_main.c.

Referenced by G_IsMoraleEnabled(), and SP_worldspawn().

Definition at line 52 of file g_main.c.

Referenced by SV_FilterPacket(), and SVCmd_WriteIP_f().

Definition at line 61 of file g_main.c.

Referenced by G_SpawnEntities().

Definition at line 60 of file g_main.c.

Definition at line 45 of file g_main.c.

Definition at line 40 of file g_main.c.

Definition at line 42 of file g_main.c.

Referenced by SP_worldspawn().

Definition at line 41 of file g_main.c.

Referenced by G_ActorSpawnIsAllowed(), SP_player_start(), and SP_worldspawn().

Definition at line 56 of file g_main.c.

Referenced by G_GetTeam(), and SP_worldspawn().

Definition at line 39 of file g_main.c.

Definition at line 44 of file g_main.c.

Referenced by G_CheckForceEndRound().

Definition at line 63 of file g_main.c.

Definition at line 62 of file g_main.c.

Referenced by G_ShootSingle().

Definition at line 59 of file g_main.c.

Referenced by G_ClientBegin(), G_ClientEndRound(), and G_GetTeam().

const int TAG_INVENTORY = 2389 [static]

Definition at line 120 of file g_main.c.

Referenced by G_AllocInventoryMemory(), and G_FreeAllInventory().


Generated by  doxygen 1.6.2