|
UFO: Alien Invasion
|
Header for script parsing functions. More...


Go to the source code of this file.
Data Structures | |
| struct | value_t |
| struct | terrainType_t |
| Different terrain definitions for footsteps and particles. More... | |
| struct | constListEntry_t |
| list of script aliases to register More... | |
Macros | |
| #define | MEMBER_SIZEOF(TYPE, MEMBER) |
| #define | V_BASETYPEMASK 0x3F |
| Allow to add extra bit into the type. | |
| #define | UFO_MAX 16 |
| #define | AIRCRAFT_NONE -1 |
| #define | UFO_NONE AIRCRAFT_NONE |
| #define | AIR_SLOT_TYPE_STRINGS |
| #define | SND_VOLUME_FOOTSTEPS 0.4f |
Typedefs | |
| typedef short | ufoType_t |
Functions | |
| template<typename T> | |
| T & | Com_GetValue (void *const object, value_t const *const value) |
| template<typename T> | |
| T const & | Com_GetValue (void const *const object, value_t const *const value) |
| int | Com_SetValue (void *base, const void *set, valueTypes_t type, int ofs, size_t size) |
| int | Com_EParseValue (void *base, const char *token, valueTypes_t type, int ofs, size_t size) |
| bool | Com_ParseBlock (const char *name, const char **text, void *base, const value_t *values, memPool_t *mempool) |
| bool | Com_ParseBlockToken (const char *name, const char **text, void *base, const value_t *values, memPool_t *mempool, const char *token) |
| bool | Com_ParseList (const char **text, linkedList_t **list) |
| void * | Com_AlignPtr (const void *memory, valueTypes_t type) |
| Align a memory to use a natural address for the data type we will write. | |
| const char * | Com_ValueToStr (const void *base, const valueTypes_t type, const int ofs) |
| const char * | Com_GetLastParseError (void) |
| resultStatus_t | Com_ParseValue (void *base, const char *token, valueTypes_t type, int ofs, size_t size, size_t *writtenBytes) |
| Parse a value from a string. | |
| bool | Com_ParseBoolean (const char *token) |
| Parses a boolean from a string. | |
| const terrainType_t * | Com_GetTerrainType (const char *textureName) |
| Searches the terrain definition if given. | |
| bool | Com_GetConstInt (const char *name, int *value) |
| Searches whether a given value was registered as a string to int mapping. | |
| bool | Com_GetConstIntFromNamespace (const char *space, const char *variable, int *value) |
| Searches whether a given value was registered as a string to int mapping. | |
| const char * | Com_GetConstVariable (const char *space, int value) |
| Searches the mapping variable for a given integer value and a namespace. | |
| bool | Com_UnregisterConstVariable (const char *name) |
| Removes a registered constant from the script mapping hash table. | |
| void | Com_RegisterConstInt (const char *name, int value) |
Register mappings between script strings and enum values for values of the type V_INT. | |
| void | Com_RegisterConstList (const constListEntry_t constList[]) |
| Registers a list of string aliases. | |
| bool | Com_UnregisterConstList (const constListEntry_t constList[]) |
| Unregisters a list of string aliases. | |
| void | Com_ParseScripts (bool onlyServer) |
| const char * | Com_EParse (const char **text, const char *errhead, const char *errinfo, char *target=0, size_t size=0) |
| Parsing function that prints an error message when there is no text in the buffer. | |
| const char * | Com_GetRandomMapAssemblyNameForCraft (const char *craftID) |
| Returns the name of an aircraft or an ufo that is used in the ump files for the random map assembly. | |
| const char * | Com_GetRandomMapAssemblyNameForCrashedCraft (const char *craftID) |
| ufoType_t | Com_UFOShortNameToID (const char *token) |
| Translate short name to UFO type. | |
| const char * | Com_UFOTypeToShortName (ufoType_t type) |
| Translate UFO type to short name. | |
| const char * | Com_UFOCrashedTypeToShortName (ufoType_t type) |
| Translate UFO type to short name when UFO is crashed. | |
| short | Com_GetUfoIdsNum (void) |
| short | Com_GetDropShipIdsNum (void) |
| short | Com_GetHumanAircraftIdsNum (void) |
| int | Com_GetScriptChecksum (void) |
| void | Com_Shutdown (void) |
| const ugv_t * | Com_GetUGVByIDSilent (const char *ugvID) |
| Searches an UGV definition by a given script id and returns the pointer to the global data. | |
| const ugv_t * | Com_GetUGVByID (const char *ugvID) |
| Searches an UGV definition by a given script id and returns the pointer to the global data. | |
| const char * | Com_DropShipTypeToShortName (humanAircraftType_t type) |
| Translate DropShip type to short name. | |
| humanAircraftType_t | Com_DropShipShortNameToID (const char *token) |
| Translate DropShip type to short name. | |
| void | Com_GetCharacterValues (const char *teamDefition, character_t *chr) |
| Assign character values, 3D models and names to a character. | |
| bool | Com_GetCharacterModel (character_t *chr) |
| const teamDef_t * | Com_GetTeamDefinitionByID (const char *team) |
| Returns the teamDef pointer for the searched team id - or nullptr if not found in the teamDef array. | |
| const chrTemplate_t * | Com_GetCharacterTemplateByID (const char *chrTemplate) |
| Returns the chrTemplate pointer for the given id - or nullptr if not found in the chrTemplates array. | |
Variables | |
| const char *const | vt_names [] |
| possible values for parsing functions | |
| const char *const | align_names [] |
| const char *const | blend_names [] |
| const char *const | style_names [] |
| const char *const | fade_names [] |
| const char *const | longlines_names [] |
| const char *const | name_strings [] |
Header for script parsing functions.
Definition in file scripts.h.
| #define AIR_SLOT_TYPE_STRINGS |
| #define AIRCRAFT_NONE -1 |
Definition at line 147 of file scripts.h.
Referenced by Com_GetAircraftIdNum(), Com_GetCrashedAircraftIdNum(), Com_GetHumanCraftIdNum(), Com_ParseAircraftNames(), Com_ParseValue(), and Com_SetValue().
| #define MEMBER_SIZEOF | ( | TYPE, | |
| MEMBER ) |
Definition at line 34 of file scripts.h.
Referenced by AIR_ParseAircraft(), UI_SpriteExists(), and WEB_ListCGameFilesCallback().
| #define SND_VOLUME_FOOTSTEPS 0.4f |
Definition at line 212 of file scripts.h.
Referenced by Com_ParseTerrain(), LE_PlayFootStepSound(), and LE_PlaySoundFileForContents().
| #define UFO_MAX 16 |
Definition at line 146 of file scripts.h.
Referenced by Com_ParseAircraftNames(), CP_MissionChooseUFO(), NAT_ScriptSanityCheck(), TEST_F(), TEST_F(), TEST_F(), and UFO_GetOneAvailableUFOForMission().
| #define UFO_NONE AIRCRAFT_NONE |
Definition at line 148 of file scripts.h.
Referenced by AIR_ParseAircraft(), Com_ParseValue(), Com_SetValue(), CP_MissionBegin(), CP_MissionChooseUFO(), CP_SupplyMissionCreate(), and UFO_GetOneAvailableUFOForMission().
| #define V_BASETYPEMASK 0x3F |
Allow to add extra bit into the type.
Definition at line 41 of file scripts.h.
Referenced by UI_InitRawActionValue(), UI_NodeSetPropertyFromRAW(), and UI_ParseProperty().
| enum align_t |
We need this here for checking the boundaries from script values.
possible align values - see also align_names
| enum blend_t |
| enum fade_t |
| enum resultStatus_t |
| enum style_t |
| enum valueTypes_t |
possible values for parsing functions
| void * Com_AlignPtr | ( | const void * | memory, |
| valueTypes_t | type ) |
Align a memory to use a natural address for the data type we will write.
Definition at line 437 of file scripts.cpp.
References Sys_Error(), type, V_NULL, V_NUM_TYPES, and vt_aligns.
Referenced by CL_ParsePtlCmds(), Com_ParseValue(), Com_SetValue(), Com_ValueToStr(), UI_InitRawActionValue(), and UI_ParseProperty().
| humanAircraftType_t Com_DropShipShortNameToID | ( | const char * | token | ) |
Translate DropShip type to short name.
Definition at line 3307 of file scripts.cpp.
References Com_ParseValue(), and V_AIRCRAFTTYPE.
Referenced by Com_ParseEquipment(), GAME_GetImportData(), and cgame_import_t::humanAircraftType_t().
| const char * Com_DropShipTypeToShortName | ( | humanAircraftType_t | type | ) |
Translate DropShip type to short name.
Definition at line 3319 of file scripts.cpp.
References Com_ValueToStr(), type, and V_AIRCRAFTTYPE.
Referenced by GAME_GetImportData().
| const char * Com_EParse | ( | const char ** | text, |
| const char * | errhead, | ||
| const char * | errinfo, | ||
| char * | target, | ||
| size_t | size ) |
Parsing function that prints an error message when there is no text in the buffer.
Definition at line 277 of file scripts.cpp.
References Com_Parse(), and Com_Printf().
Referenced by CL_ParseLanguages(), CL_ParseMessageID(), CL_ParseParticle(), CL_ParsePtlCmds(), CL_ParseSequence(), Com_EParse_(), Com_ParseActorModels(), Com_ParseActorNames(), Com_ParseActorSounds(), Com_ParseAircraftNames(), Com_ParseArmourOrResistance(), Com_ParseBlock(), Com_ParseBlockToken(), Com_ParseBodyPart(), Com_ParseBodyTemplate(), Com_ParseCharacterTemplate(), Com_ParseDamageTypes(), Com_ParseEquipment(), Com_ParseFire(), Com_ParseFireDefinition(), Com_ParseGameTypes(), Com_ParseImplant(), Com_ParseItem(), Com_ParseMapDefinition(), Com_ParseTeam(), Com_ParseTerrainDefinition(), SV_GetCvarToken(), SV_GetTileFromTileSet(), SV_GetTilesFromTileSet(), SV_ParseAssembly(), SV_ParseAssemblySeeds(), SV_ParseMapTile(), SV_ParseMapTileSet(), UI_ParseActionList(), UI_ParseCallAction(), UI_ParseComponent(), UI_ParseEventProperty(), UI_ParseExcludeRect(), UI_ParseFont(), UI_ParseNode(), UI_ParseNodeBody(), UI_ParseNodeProperties(), UI_ParseProperty(), UI_ParseSetAction(), and UI_ParseUIModel().
| int Com_EParseValue | ( | void * | base, |
| const char * | token, | ||
| valueTypes_t | type, | ||
| int | ofs, | ||
| size_t | size ) |
Definition at line 964 of file scripts.cpp.
References Com_ParseValue(), Com_Printf(), parseErrorMessage, RESULT_ERROR, RESULT_OK, RESULT_WARNING, Sys_Error(), and type.
Referenced by CL_ParseMapParticle(), CL_ParsePtlCmds(), CL_SpawnParseEntitystring(), Com_ParseBlockToken(), Com_ParseBodyPart(), Com_ParseCharacterTemplate(), GAME_GetImportData(), cgame_import_t::int(), SEQ_ExecuteCamera(), SEQ_ExecuteModel(), SEQ_ExecuteObj2D(), UI_InitRawActionValue(), UI_ParseExcludeRect(), UI_ParseFont(), UI_ParseUIModel(), and WEB_ListCGameFilesCallback().
| bool Com_GetCharacterModel | ( | character_t * | chr | ) |
Definition at line 2358 of file scripts.cpp.
References character_t::body, teamDef_t::model_t::body, character_t::bodySkin, teamDef_t::model_t::bodySkin, Com_GiveModel(), character_t::gender, character_t::head, teamDef_t::model_t::head, character_t::headSkin, teamDef_t::model_t::headSkin, character_t::path, teamDef_t::model_t::path, Q_strncpyz(), and character_t::teamDef.
Referenced by Com_GetCharacterValues(), and GAME_LoadCharacter().
| const chrTemplate_t * Com_GetCharacterTemplateByID | ( | const char * | chrTemplate | ) |
Returns the chrTemplate pointer for the given id - or nullptr if not found in the chrTemplates array.
| [in] | chrTemplate | The character template id (given in ufo-script files) |
Definition at line 2809 of file scripts.cpp.
References Com_Printf(), csi, i, Q_streq, and Q_strnull().
Referenced by Com_ParseTeam().
| void Com_GetCharacterValues | ( | const char * | teamDefition, |
| character_t * | chr ) |
Assign character values, 3D models and names to a character.
| [in] | teamDefition | The team definition id to use to generate the character values. |
| [in,out] | chr | The character that should get the paths to the different models/skins. |
Definition at line 2408 of file scripts.cpp.
References ACTOR_SIZE_INVALID, ACTOR_SIZE_NORMAL, Com_Error(), Com_GetCharacterModel(), Com_GetGender(), Com_GetTeamDefinitionByID(), Com_GiveName(), ERR_DROP, character_t::fieldSize, character_t::gender, character_t::name, NAME_LAST, Q_strcat(), Q_strncpyz(), teamDef_t::size, and character_t::teamDef.
Referenced by CL_GenerateCharacter(), and SV_InitGameProgs().
| bool Com_GetConstInt | ( | const char * | name, |
| int * | value ) |
Searches whether a given value was registered as a string to int mapping.
| [in] | name | The name of the string mapping (maybe including a namespace) |
| [out] | value | The mapped integer if found, not touched if the given string was found in the registered values. |
Definition at line 74 of file scripts.cpp.
References Com_ConstIntGetVariable(), com_constNameInt_hash, Com_HashKey(), CONSTNAMEINT_HASH_SIZE, hash, name, and Q_streq.
Referenced by cgame_import_t::bool(), Com_GetConstIntFromNamespace(), Com_ParseValue(), GAME_GetImportData(), SV_InitGameProgs(), and TEST_F().
| bool Com_GetConstIntFromNamespace | ( | const char * | space, |
| const char * | variable, | ||
| int * | value ) |
Searches whether a given value was registered as a string to int mapping.
| [in] | space | The namespace of the mapping variable |
| [in] | variable | The name of the string mapping |
| [out] | value | The mapped integer if found, not touched if the given string was found in the registered values. |
Definition at line 103 of file scripts.cpp.
References Com_GetConstInt(), Q_strnull(), and va().
Referenced by cgame_import_t::bool(), GAME_GetImportData(), GAME_LoadCharacter(), and SV_InitGameProgs().
| const char * Com_GetConstVariable | ( | const char * | space, |
| int | value ) |
Searches the mapping variable for a given integer value and a namespace.
| [in] | space | The namespace to search in - might not be nullptr or empty. |
| [in] | value | The mapped integer |
Definition at line 122 of file scripts.cpp.
References com_constNameInt, com_constNameInt_t::fullname, com_constNameInt_t::name, com_constNameInt_t::next, and com_constNameInt_t::value.
Referenced by GAME_GetImportData(), GAME_SaveCharacter(), SV_InitGameProgs(), and TEST_F().
| short Com_GetDropShipIdsNum | ( | void | ) |
Definition at line 576 of file scripts.cpp.
References aircraftIdsNum, and CRAFT_DROP.
Referenced by GAME_GetImportData(), and cgame_import_t::short().
| short Com_GetHumanAircraftIdsNum | ( | void | ) |
Definition at line 581 of file scripts.cpp.
References aircraftIdsNum, CRAFT_DROP, and CRAFT_INTER.
Referenced by GAME_GetImportData(), and cgame_import_t::short().
| const char * Com_GetLastParseError | ( | void | ) |
Returns the last error message
Definition at line 428 of file scripts.cpp.
References parseErrorMessage.
Referenced by UI_NodeSetProperty(), and UI_ParseProperty().
| const char * Com_GetRandomMapAssemblyNameForCraft | ( | const char * | craftID | ) |
Returns the name of an aircraft or an ufo that is used in the ump files for the random map assembly.
Definition at line 3277 of file scripts.cpp.
References va().
Referenced by GAME_GetImportData(), TEST_F(), GameTest::testCountSpawnpointsForMapWithAssembly(), and GameTest::testCountSpawnpointsForMapWithAssemblyAndAircraft().
| const char * Com_GetRandomMapAssemblyNameForCrashedCraft | ( | const char * | craftID | ) |
Definition at line 3285 of file scripts.cpp.
References Q_streq.
Referenced by GAME_GetImportData().
Definition at line 3717 of file scripts.cpp.
References Com_BlockChecksum(), FS_GetFileData(), and LittleLong.
Referenced by CL_CanMultiplayerStart(), and SV_Map().
| const teamDef_t * Com_GetTeamDefinitionByID | ( | const char * | team | ) |
Returns the teamDef pointer for the searched team id - or nullptr if not found in the teamDef array.
| [in] | team | The team id (given in ufo-script files) |
Definition at line 2345 of file scripts.cpp.
References Com_Printf(), csi, i, teamDef_t::id, and Q_streq.
Referenced by Com_GetCharacterValues(), GAME_GetImportData(), GAME_ItemIsUseable(), GAME_LoadCharacter(), TEST_F(), and TEST_F().
| const terrainType_t * Com_GetTerrainType | ( | const char * | textureName | ) |
Searches the terrain definition if given.
| [in] | textureName | The terrain definition id from script files which is the texture name relative to base/textures |
Definition at line 3067 of file scripts.cpp.
References Com_HashKey(), hash, Q_streq, TERRAIN_HASH_SIZE, and terrainTypesHash.
Referenced by Com_ParseTerrain(), LE_PlaySoundFileAndParticleForSurface(), SV_GetBounceFraction(), and SV_GetFootstepSound().
| short Com_GetUfoIdsNum | ( | void | ) |
Definition at line 571 of file scripts.cpp.
References aircraftIdsNum, and CRAFT_UFO.
Referenced by GAME_GetImportData(), and TEST_F().
| const ugv_t * Com_GetUGVByID | ( | const char * | ugvID | ) |
Searches an UGV definition by a given script id and returns the pointer to the global data.
| [in] | ugvID | The script id of the UGV definition you are looking for |
Definition at line 3381 of file scripts.cpp.
References Com_GetUGVByIDSilent(), Com_Printf(), and csi.
Referenced by GAME_GetImportData(), and TEST_F().
| const ugv_t * Com_GetUGVByIDSilent | ( | const char * | ugvID | ) |
Searches an UGV definition by a given script id and returns the pointer to the global data.
| [in] | ugvID | The script id of the UGV definition you are looking for |
Definition at line 3362 of file scripts.cpp.
References csi, i, ugv_t::id, and Q_streq.
Referenced by Com_GetUGVByID(), GAME_AppendTeamMember(), and GAME_GetImportData().
Definition at line 174 of file scripts.h.
References value_t::ofs.
Referenced by Com_GetValue(), Com_ParseBlockToken(), uiFuncNode::onLoaded(), SEQ_ExecuteObj2D(), UI_AddListener(), UI_DeleteNode(), UI_ExecuteCallAction(), UI_GetFloatFromNodeProperty(), UI_GetStringFromNodeProperty(), UI_NodeSetProperty(), UI_NodeSetPropertyFromActionValue(), UI_NodeSetPropertyFromRAW(), UI_ParseEventProperty(), UI_ParseFont(), UI_ParseProperty(), UI_ParseUIModel(), and UI_RemoveListener().
|
inline |
Definition at line 179 of file scripts.h.
References Com_GetValue().
| bool Com_ParseBlock | ( | const char * | name, |
| const char ** | text, | ||
| void * | base, | ||
| const value_t * | values, | ||
| memPool_t * | mempool ) |
Definition at line 1393 of file scripts.cpp.
References Com_EParse(), Com_Parse(), Com_ParseBlockToken(), Com_Printf(), and name.
Referenced by CL_ParseActorSkin(), Com_ParseInventory(), Com_ParseTerrain(), Com_ParseUGVs(), GAME_GetImportData(), GAME_ParseModes(), and TUT_ParseTutorials().
| bool Com_ParseBlockToken | ( | const char * | name, |
| const char ** | text, | ||
| void * | base, | ||
| const value_t * | values, | ||
| memPool_t * | mempool, | ||
| const char * | token ) |
Definition at line 1311 of file scripts.cpp.
References Com_EParse(), Com_EParseValue(), Com_GetValue(), Com_ParseList(), Com_Printf(), Com_UnParseLastToken(), Mem_PoolStrDupTo, name, Q_streq, v, V_HUNK_STRING, V_LIST, and V_TRANSLATION_STRING.
Referenced by cgame_import_t::bool(), Com_ParseBlock(), Com_ParseBodyPart(), Com_ParseEquipment(), Com_ParseFire(), Com_ParseGameTypes(), Com_ParseImplant(), Com_ParseItem(), Com_ParseItemEffect(), Com_ParseMapDefinition(), Com_ParseTeam(), and GAME_GetImportData().
| bool Com_ParseBoolean | ( | const char * | token | ) |
Parses a boolean from a string.
| token | The token to convert into a boolean |
false if the string could not get parsed Definition at line 986 of file scripts.cpp.
References Com_ParseValue(), RESULT_ERROR, and V_BOOL.
Referenced by cgame_import_t::bool(), GAME_GetImportData(), and HUD_RemainingTUs_f().
| bool Com_ParseList | ( | const char ** | text, |
| linkedList_t ** | list ) |
Parse tokens between '(' and ')' and return them into a linked list. It the list is not well formed, the returned list is null.
| [in] | text | Pointer to a token stream |
| [out] | list | list to return |
Definition at line 1363 of file scripts.cpp.
References Com_GetToken(), Com_NextToken(), Com_Printf(), LIST_AddString(), LIST_Delete(), TT_BEGIN_LIST, TT_CONTENT, TT_END_LIST, TT_EOF, and type.
Referenced by cgame_import_t::bool(), CL_ParseLanguages(), CL_ParseSequence(), Com_ParseActorModels(), Com_ParseActorNames(), Com_ParseBlockToken(), Com_ParseBodyPart(), Com_ParseEquipment(), Com_ParseMapDefinition(), Com_ParseTeam(), GAME_GetImportData(), M_ParseMusic(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| void Com_ParseScripts | ( | bool | onlyServer | ) |
Definition at line 3619 of file scripts.cpp.
References aircraftIdsNum, CL_ParseClientData(), Com_AddObjectLinks(), Com_ParseActorNames(), Com_ParseAircraftNames(), Com_ParseBodyTemplate(), Com_ParseCharacterTemplate(), Com_ParseDamageTypes(), Com_ParseEquipment(), Com_ParseGameTypes(), Com_ParseImplant(), Com_ParseInventory(), Com_ParseItem(), Com_ParseMapDefinition(), Com_ParseTeam(), Com_ParseTerrain(), Com_ParseTerrainDefinition(), Com_ParseUGVs(), Com_ParseVersion(), Com_Printf(), csi, dropIdsTable, FS_BuildFileList(), FS_NextScriptHeader(), interIdsTable, INVSH_InitCSI(), name, NONE, OBJZERO, Q_streq, Sys_Error(), type, ufoIdsTable, and versionParsed.
Referenced by Qcommon_Init(), CampaignTest::SetUpTestCase(), CharacterTest::SetUpTestCase(), FootStepTest::SetUpTestCase(), GameTest::SetUpTestCase(), InventoryTest::SetUpTestCase(), MapDefMassRMATest::SetUpTestCase(), MapDefStatsTest::SetUpTestCase(), MapDefTest::SetUpTestCase(), ParticleTest::SetUpTestCase(), RandomMapAssemblyTest::SetUpTestCase(), RoutingTest::SetUpTestCase(), ScriptTest::SetUpTestCase(), and WebApiTest::SetUpTestCase().
| resultStatus_t Com_ParseValue | ( | void * | base, |
| const char * | token, | ||
| valueTypes_t | type, | ||
| int | ofs, | ||
| size_t | size, | ||
| size_t * | writtenBytes ) |
Parse a value from a string.
| [in] | base | The start pointer to a given data type (typedef, struct) where the parsed data is stored |
| [in] | token | The data which should be parsed |
| [in] | type | The data type that should be parsed |
| [in] | ofs | The offset for the value |
| [in] | size | The expected size of the data type. If 0, no checks are done |
| [out] | writtenBytes |
Definition at line 656 of file scripts.cpp.
References AIRCRAFT_NONE, ALIGN_LAST, align_names, BLEND_LAST, blend_names, Com_AlignPtr(), Com_GetConstInt(), Com_GetCrashedUfoIdNum(), Com_GetHumanCraftIdNum(), Com_GetUfoIdNum(), Com_Printf(), csi, f, FADE_LAST, fade_names, int(), MAX_VAR, parseErrorMessage, Q_streq, Q_strncpyz(), RESULT_ERROR, RESULT_OK, RESULT_WARNING, SHAPE_BIG_MAX_HEIGHT, SHAPE_BIG_MAX_WIDTH, SHAPE_SMALL_MAX_HEIGHT, SHAPE_SMALL_MAX_WIDTH, STYLE_LAST, style_names, Sys_Error(), TEAM_ALIEN, TEAM_CIVILIAN, TEAM_PHALANX, type, UFO_NONE, UFO_SIZE_T, V_AIRCRAFTTYPE, V_ALIGN, V_BLEND, V_BOOL, V_CHAR, V_COLOR, V_DAMAGE, V_FADE, V_FLOAT, V_HUNK_STRING, V_INT, V_INT2, V_LONGSTRING, V_NULL, V_POS, V_RELABS, V_SHAPE_BIG, V_SHAPE_SMALL, V_STRING, V_STYLE, V_TEAM, V_TRANSLATION_STRING, V_UFO, V_UFOCRASHED, V_VECTOR, vt_aligns, and vt_sizes.
Referenced by Com_DropShipShortNameToID(), Com_EParseValue(), Com_ParseBoolean(), Com_UFOShortNameToID(), TEST_F(), UI_MaterialEditorChangeValue_f(), UI_NodeSetProperty(), UI_ParseProperty(), and UI_PushDropDownWindow_f().
Register mappings between script strings and enum values for values of the type V_INT.
| name | The name of the script entry to map to an integer. This can also include a namespace prefix for the case we want to map back an integer to a string from a specific namespace. In case this string is equipped with a namespace, the string is in the form "namespace::variable" |
| value | The value to map the given name to |
Definition at line 198 of file scripts.cpp.
References com_aliasSysPool, Com_ConstIntGetVariable(), com_constNameInt, com_constNameInt_hash, Com_HashKey(), Com_Printf(), CONSTNAMEINT_HASH_SIZE, com_constNameInt_t::fullname, hash, com_constNameInt_t::hash_next, Mem_PoolAllocType, Mem_StrDup, com_constNameInt_t::name, name, com_constNameInt_t::next, Q_streq, Q_strncpyz(), and com_constNameInt_t::value.
Referenced by Com_RegisterConstList(), GAME_GetImportData(), SV_InitGameProgs(), TEST_F(), UI_RegisterAbstractNode(), UI_RegisterBaseInventoryNode(), UI_RegisterPanelNode(), UI_RegisterSpinnerNode(), and UI_RegisterTextNode().
| void Com_RegisterConstList | ( | const constListEntry_t | constList[] | ) |
Registers a list of string aliases.
| [in] | constList | Array of string => int mappings. Must be terminated with a nullptr string ({nullptr, -1}) line |
Definition at line 253 of file scripts.cpp.
References Com_RegisterConstInt(), i, constListEntry_t::name, and name.
Referenced by GAME_GetImportData(), GAME_LoadCharacter(), GAME_SaveCharacter(), TEST_F(), and cgame_import_t::void().
| int Com_SetValue | ( | void * | base, |
| const void * | set, | ||
| valueTypes_t | type, | ||
| int | ofs, | ||
| size_t | size ) |
| [in] | base | The start pointer to a given data type (typedef, struct) |
| [in] | set | The data which should be parsed |
| [in] | type | The data type that should be parsed |
| [in] | ofs | The offset for the value |
| [in] | size | The expected size of the data type. If 0, no checks are done |
Definition at line 1009 of file scripts.cpp.
References AIRCRAFT_NONE, Com_AlignPtr(), Com_GetCrashedUfoIdNum(), Com_GetHumanCraftIdNum(), Com_GetUfoIdNum(), Com_Printf(), int(), len, MAX_VAR, Q_streq, Q_strncpyz(), SHAPE_BIG_MAX_HEIGHT, SHAPE_SMALL_MAX_HEIGHT, Sys_Backtrace(), Sys_Error(), TEAM_ALIEN, TEAM_CIVILIAN, TEAM_PHALANX, type, UFO_NONE, UFO_SIZE_T, V_AIRCRAFTTYPE, V_ALIGN, V_BLEND, V_BOOL, V_CHAR, V_COLOR, V_DAMAGE, V_FADE, V_FLOAT, V_INT, V_INT2, V_LONGSTRING, V_NULL, V_POS, V_SHAPE_BIG, V_SHAPE_SMALL, V_STRING, V_STYLE, V_TEAM, V_UFO, V_UFOCRASHED, V_VECTOR, vt_aligns, and vt_sizes.
Referenced by CL_ParticleFunction(), and UI_NodeSetPropertyFromRAW().
Definition at line 3732 of file scripts.cpp.
References com_constNameInt, com_constNameInt_hash, OBJZERO, terrainTypesHash, and versionParsed.
Referenced by Qcommon_Shutdown(), and TEST_Shutdown().
| const char * Com_UFOCrashedTypeToShortName | ( | ufoType_t | type | ) |
Translate UFO type to short name when UFO is crashed.
Definition at line 3351 of file scripts.cpp.
References Com_ValueToStr(), type, and V_UFOCRASHED.
Referenced by GAME_GetImportData().
| ufoType_t Com_UFOShortNameToID | ( | const char * | token | ) |
Translate short name to UFO type.
Definition at line 3329 of file scripts.cpp.
References Com_ParseValue(), and V_UFO.
Referenced by GAME_GetImportData(), and cgame_import_t::ufoType_t().
| const char * Com_UFOTypeToShortName | ( | ufoType_t | type | ) |
Translate UFO type to short name.
Definition at line 3342 of file scripts.cpp.
References Com_ValueToStr(), type, and V_UFO.
Referenced by GAME_GetImportData().
| bool Com_UnregisterConstList | ( | const constListEntry_t | constList[] | ) |
Unregisters a list of string aliases.
| [in] | constList | Array of string => int mappings. Must be terminated with a nullptr string ({nullptr, -1}) line |
Definition at line 237 of file scripts.cpp.
References Com_UnregisterConstVariable(), i, constListEntry_t::name, and name.
Referenced by cgame_import_t::bool(), GAME_GetImportData(), GAME_LoadCharacter(), GAME_SaveCharacter(), and TEST_F().
| bool Com_UnregisterConstVariable | ( | const char * | name | ) |
Removes a registered constant from the script mapping hash table.
| name | The name of the script entry to remove out of the const int hash. In case this string is equipped with a namespace, the string is in the form "namespace::variable". If you try to unregister a variable that was registered with a namespace, this namespace must be included in the given name, too. |
Definition at line 147 of file scripts.cpp.
References Com_ConstIntGetVariable(), com_constNameInt, com_constNameInt_hash, Com_HashKey(), CONSTNAMEINT_HASH_SIZE, com_constNameInt_t::fullname, hash, com_constNameInt_t::hash_next, Mem_Free, name, com_constNameInt_t::next, and Q_streq.
Referenced by cgame_import_t::bool(), Com_UnregisterConstList(), GAME_GetImportData(), SV_InitGameProgs(), and TEST_F().
| const char * Com_ValueToStr | ( | const void * | base, |
| const valueTypes_t | type, | ||
| const int | ofs ) |
| [in] | base | The start pointer to a given data type (typedef, struct) |
| [in] | type | The data type that should be parsed |
| [in] | ofs | The offset for the value |
Definition at line 1171 of file scripts.cpp.
References ALIGN_LAST, align_names, BLEND_LAST, blend_names, Com_AlignPtr(), Com_GetCrashedUfoIdStr(), Com_GetHumanCraftIdStr(), Com_GetUfoIdStr(), Com_Printf(), Com_sprintf(), csi, FADE_LAST, fade_names, MAX_DAMAGETYPES, MAX_VAR, Q_strncpyz(), STYLE_LAST, style_names, Sys_Backtrace(), Sys_Error(), TEAM_ALIEN, TEAM_CIVILIAN, TEAM_PHALANX, type, UFO_SIZE_T, V_AIRCRAFTTYPE, V_ALIGN, V_BLEND, V_BOOL, V_CHAR, V_COLOR, V_DAMAGE, V_FADE, V_FLOAT, V_HUNK_STRING, V_INT, V_INT2, V_LONGSTRING, V_NULL, V_POS, V_RELABS, V_SHAPE_BIG, V_SHAPE_SMALL, V_STRING, V_STYLE, V_TEAM, V_TRANSLATION_STRING, V_UFO, V_UFOCRASHED, V_VECTOR, and vt_aligns.
Referenced by Com_DropShipTypeToShortName(), Com_UFOCrashedTypeToShortName(), Com_UFOTypeToShortName(), GAME_GetImportData(), and UI_GetStringFromNodeProperty().
|
extern |
Definition at line 340 of file scripts.cpp.
Referenced by CASSERT(), Com_ParseValue(), and Com_ValueToStr().
|
extern |
Definition at line 345 of file scripts.cpp.
Referenced by CASSERT(), Com_ParseValue(), and Com_ValueToStr().
|
extern |
Definition at line 355 of file scripts.cpp.
Referenced by CASSERT(), Com_ParseValue(), and Com_ValueToStr().
|
extern |
|
extern |
Definition at line 2162 of file scripts.cpp.
Referenced by Com_FindNameType(), and Com_ParseActorSounds().
|
extern |
Definition at line 350 of file scripts.cpp.
Referenced by CASSERT(), Com_ParseValue(), and Com_ValueToStr().
|
extern |
possible values for parsing functions
Definition at line 310 of file scripts.cpp.
Referenced by CASSERT(), CL_ParsePtlCmds(), and CL_ParticleFunction().