UFO: Alien Invasion
|
Header for script parsing functions. More...
Go to the source code of this file.
Data Structures | |
struct | value_s |
struct | terrainType_s |
Different terrain definitions for footsteps and particles. More... | |
struct | constListEntry_s |
list of script aliases to register More... | |
Macros | |
#define | MEMBER_SIZEOF(TYPE, MEMBER) sizeof(((TYPE*)0)->MEMBER) |
#define | V_BASETYPEMASK 0x3F |
Allow to add extra bit into the type. More... | |
#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 |
typedef struct value_s | value_t |
typedef struct terrainType_s | terrainType_t |
Different terrain definitions for footsteps and particles. More... | |
typedef struct constListEntry_s | constListEntry_t |
list of script aliases to register More... | |
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. More... | |
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. More... | |
bool | Com_ParseBoolean (const char *token) |
Parses a boolean from a string. More... | |
const terrainType_t * | Com_GetTerrainType (const char *textureName) |
Searches the terrain definition if given. More... | |
bool | Com_GetConstInt (const char *name, int *value) |
Searches whether a given value was registered as a string to int mapping. More... | |
bool | Com_GetConstIntFromNamespace (const char *space, const char *variable, int *value) |
Searches whether a given value was registered as a string to int mapping. More... | |
const char * | Com_GetConstVariable (const char *space, int value) |
Searches the mapping variable for a given integer value and a namespace. More... | |
bool | Com_UnregisterConstVariable (const char *name) |
Removes a registered constant from the script mapping hash table. More... | |
void | Com_RegisterConstInt (const char *name, int value) |
Register mappings between script strings and enum values for values of the type V_INT . More... | |
void | Com_RegisterConstList (const constListEntry_t constList[]) |
Registers a list of string aliases. More... | |
bool | Com_UnregisterConstList (const constListEntry_t constList[]) |
Unregisters a list of string aliases. More... | |
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. More... | |
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. More... | |
const char * | Com_GetRandomMapAssemblyNameForCrashedCraft (const char *craftID) |
ufoType_t | Com_UFOShortNameToID (const char *token) |
Translate short name to UFO type. More... | |
const char * | Com_UFOTypeToShortName (ufoType_t type) |
Translate UFO type to short name. More... | |
const char * | Com_UFOCrashedTypeToShortName (ufoType_t type) |
Translate UFO type to short name when UFO is crashed. More... | |
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. More... | |
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. More... | |
const char * | Com_DropShipTypeToShortName (humanAircraftType_t type) |
Translate DropShip type to short name. More... | |
humanAircraftType_t | Com_DropShipShortNameToID (const char *token) |
Translate DropShip type to short name. More... | |
void | Com_GetCharacterValues (const char *teamDefition, character_t *chr) |
Assign character values, 3D models and names to a character. More... | |
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. More... | |
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. More... | |
Variables | |
const char *const | vt_names [] |
possible values for parsing functions More... | |
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 148 of file scripts.h.
Referenced by Com_GetAircraftIdNum(), Com_GetCrashedAircraftIdNum(), Com_GetHumanCraftIdNum(), Com_ParseAircraftNames(), Com_ParseValue(), and Com_SetValue().
#define MEMBER_SIZEOF | ( | TYPE, | |
MEMBER | |||
) | sizeof(((TYPE*)0)->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 213 of file scripts.h.
Referenced by Com_ParseTerrain(), LE_PlayFootStepSound(), and LE_PlaySoundFileForContents().
#define UFO_MAX 16 |
Definition at line 147 of file scripts.h.
Referenced by Com_ParseAircraftNames(), CP_MissionChooseUFO(), NAT_ScriptSanityCheck(), TEST_F(), and UFO_GetOneAvailableUFOForMission().
#define UFO_NONE AIRCRAFT_NONE |
Definition at line 149 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().
typedef struct constListEntry_s constListEntry_t |
list of script aliases to register
typedef struct terrainType_s terrainType_t |
Different terrain definitions for footsteps and particles.
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 440 of file scripts.cpp.
References Sys_Error(), type, V_NULL, and V_NUM_TYPES.
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 3329 of file scripts.cpp.
References Com_ParseValue(), and V_AIRCRAFTTYPE.
Referenced by Com_ParseEquipment(), and GAME_GetImportData().
const char* Com_DropShipTypeToShortName | ( | humanAircraftType_t | type | ) |
Translate DropShip type to short name.
Definition at line 3341 of file scripts.cpp.
References Com_ValueToStr(), 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 978 of file scripts.cpp.
References Com_ParseValue(), Com_Printf(), RESULT_ERROR, RESULT_OK, RESULT_WARNING, and Sys_Error().
Referenced by CL_ParseMapParticle(), CL_ParsePtlCmds(), CL_SpawnParseEntitystring(), Com_ParseBlockToken(), Com_ParseBodyPart(), Com_ParseCharacterTemplate(), GAME_GetImportData(), 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 2380 of file scripts.cpp.
References teamDef_s::model_t::body, character_s::body, teamDef_s::model_t::bodySkin, character_s::bodySkin, Com_GiveModel(), character_s::gender, teamDef_s::model_t::head, character_s::head, teamDef_s::model_t::headSkin, character_s::headSkin, teamDef_s::model_t::path, character_s::path, Q_strncpyz(), and character_s::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 2831 of file scripts.cpp.
References csi_s::chrTemplates, Com_Printf(), csi, i, chrTemplate_s::id, csi_s::numChrTemplates, 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 2430 of file scripts.cpp.
References ACTOR_SIZE_INVALID, ACTOR_SIZE_NORMAL, Com_Error(), Com_GetCharacterModel(), Com_GetGender(), Com_GetTeamDefinitionByID(), Com_GiveName(), ERR_DROP, character_s::fieldSize, character_s::gender, character_s::name, NAME_LAST, Q_strcat(), Q_strncpyz(), teamDef_s::size, and character_s::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_HashKey(), CONSTNAMEINT_HASH_SIZE, hash, com_constNameInt_s::hash_next, and Q_streq.
Referenced by 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 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_s::fullname, com_constNameInt_s::name, com_constNameInt_s::next, and com_constNameInt_s::value.
Referenced by GAME_GetImportData(), GAME_SaveCharacter(), SV_InitGameProgs(), and TEST_F().
short Com_GetDropShipIdsNum | ( | void | ) |
Definition at line 579 of file scripts.cpp.
References CRAFT_DROP.
Referenced by GAME_GetImportData().
short Com_GetHumanAircraftIdsNum | ( | void | ) |
Definition at line 584 of file scripts.cpp.
References CRAFT_DROP, and CRAFT_INTER.
Referenced by GAME_GetImportData().
const char* Com_GetLastParseError | ( | void | ) |
Returns the last error message
Definition at line 431 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 3299 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 3307 of file scripts.cpp.
References Q_streq.
Referenced by GAME_GetImportData().
Definition at line 3739 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 2367 of file scripts.cpp.
References Com_Printf(), csi, i, teamDef_s::id, csi_s::numTeamDefs, Q_streq, and csi_s::teamDef.
Referenced by Com_GetCharacterValues(), GAME_GetImportData(), GAME_ItemIsUseable(), GAME_LoadCharacter(), 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 3089 of file scripts.cpp.
References Com_HashKey(), hash, terrainType_s::hash_next, Q_streq, and TERRAIN_HASH_SIZE.
Referenced by Com_ParseTerrain(), LE_PlaySoundFileAndParticleForSurface(), SV_GetBounceFraction(), and SV_GetFootstepSound().
short Com_GetUfoIdsNum | ( | void | ) |
Definition at line 574 of file scripts.cpp.
References 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 3403 of file scripts.cpp.
References Com_GetUGVByIDSilent(), Com_Printf(), csi, and csi_s::numUGV.
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 3384 of file scripts.cpp.
References csi, i, ugv_s::id, csi_s::numUGV, Q_streq, and csi_s::ugvs.
Referenced by Com_GetUGVByID(), GAME_AppendTeamMember(), and GAME_GetImportData().
Definition at line 175 of file scripts.h.
References value_s::ofs.
bool Com_ParseBlock | ( | const char * | name, |
const char ** | text, | ||
void * | base, | ||
const value_t * | values, | ||
memPool_t * | mempool | ||
) |
Definition at line 1415 of file scripts.cpp.
References Com_EParse(), Com_Parse(), Com_ParseBlockToken(), and Com_Printf().
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 1333 of file scripts.cpp.
References Com_EParse(), Com_EParseValue(), Com_ParseList(), Com_Printf(), Com_UnParseLastToken(), Mem_PoolStrDupTo, value_s::ofs, Q_streq, value_s::size, value_s::string, value_s::type, v, V_HUNK_STRING, V_LIST, and V_TRANSLATION_STRING.
Referenced by 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 1000 of file scripts.cpp.
References Com_ParseValue(), RESULT_ERROR, and V_BOOL.
Referenced by 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 1385 of file scripts.cpp.
References Com_GetToken(), Com_NextToken(), Com_Printf(), LIST_AddString(), LIST_Delete(), TT_BEGIN_LIST, TT_CONTENT, TT_END_LIST, and TT_EOF.
Referenced by CL_ParseLanguages(), CL_ParseSequence(), Com_ParseActorModels(), Com_ParseActorNames(), Com_ParseBlockToken(), Com_ParseBodyPart(), Com_ParseEquipment(), Com_ParseMapDefinition(), Com_ParseTeam(), GAME_GetImportData(), M_ParseMusic(), and TEST_F().
void Com_ParseScripts | ( | bool | onlyServer | ) |
Definition at line 3641 of file scripts.cpp.
References 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, csi_s::damBlast, csi_s::damFire, csi_s::damIncendiary, csi_s::damLaser, csi_s::damNormal, csi_s::damParticle, csi_s::damPlasma, csi_s::damShock, csi_s::damSmoke, csi_s::damStunElectro, csi_s::damStunGas, FS_BuildFileList(), FS_NextScriptHeader(), INVSH_InitCSI(), name, NONE, csi_s::numDTs, csi_s::numEDs, csi_s::numIDs, csi_s::numODs, csi_s::numTeamDefs, OBJZERO, Q_streq, Sys_Error(), type, and versionParsed.
Referenced by Qcommon_Init(), CharacterTest::SetUpTestCase(), ParticleTest::SetUpTestCase(), ScriptTest::SetUpTestCase(), RoutingTest::SetUpTestCase(), MapDefStatsTest::SetUpTestCase(), FootStepTest::SetUpTestCase(), MapDefMassRMATest::SetUpTestCase(), WebApiTest::SetUpTestCase(), MapDefTest::SetUpTestCase(), GameTest::SetUpTestCase(), RandomMapAssemblyTest::SetUpTestCase(), InventoryTest::SetUpTestCase(), and CampaignTest::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 659 of file scripts.cpp.
References AIRCRAFT_NONE, ALIGN_LAST, BLEND_LAST, Com_AlignPtr(), Com_GetConstInt(), Com_GetCrashedUfoIdNum(), Com_GetHumanCraftIdNum(), Com_GetUfoIdNum(), Com_Printf(), csi, DAYS_PER_YEAR, csi_s::dts, f, FADE_LAST, damageType_s::id, int(), MAX_VAR, csi_s::numDTs, Q_streq, Q_strncpyz(), RESULT_ERROR, RESULT_OK, RESULT_WARNING, SECONDS_PER_HOUR, SHAPE_BIG_MAX_HEIGHT, SHAPE_BIG_MAX_WIDTH, SHAPE_SMALL_MAX_HEIGHT, SHAPE_SMALL_MAX_WIDTH, STYLE_LAST, 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_DATE, 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, and V_VECTOR.
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_HashKey(), Com_Printf(), CONSTNAMEINT_HASH_SIZE, com_constNameInt_s::fullname, hash, com_constNameInt_s::hash_next, Mem_PoolAllocType, Mem_StrDup, com_constNameInt_s::name, com_constNameInt_s::next, Q_streq, Q_strncpyz(), and com_constNameInt_s::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, name, constListEntry_s::name, and com_constNameInt_s::value.
Referenced by GAME_GetImportData(), GAME_LoadCharacter(), GAME_SaveCharacter(), and TEST_F().
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 1023 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, UFO_NONE, UFO_SIZE_T, V_AIRCRAFTTYPE, V_ALIGN, V_BLEND, V_BOOL, V_CHAR, V_COLOR, V_DAMAGE, V_DATE, 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, and V_VECTOR.
Referenced by CL_ParticleFunction(), and UI_NodeSetPropertyFromRAW().
Definition at line 3754 of file scripts.cpp.
References OBJZERO, 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 3373 of file scripts.cpp.
References Com_ValueToStr(), and V_UFOCRASHED.
Referenced by GAME_GetImportData().
ufoType_t Com_UFOShortNameToID | ( | const char * | token | ) |
Translate short name to UFO type.
Definition at line 3351 of file scripts.cpp.
References Com_ParseValue(), and V_UFO.
Referenced by GAME_GetImportData().
const char* Com_UFOTypeToShortName | ( | ufoType_t | type | ) |
Translate UFO type to short name.
Definition at line 3364 of file scripts.cpp.
References Com_ValueToStr(), 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, name, and constListEntry_s::name.
Referenced by 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_HashKey(), CONSTNAMEINT_HASH_SIZE, com_constNameInt_s::fullname, hash, com_constNameInt_s::hash_next, Mem_Free, com_constNameInt_s::next, and Q_streq.
Referenced by 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 1189 of file scripts.cpp.
References ALIGN_LAST, BLEND_LAST, Com_AlignPtr(), Com_GetCrashedUfoIdStr(), Com_GetHumanCraftIdStr(), Com_GetUfoIdStr(), Com_Printf(), Com_sprintf(), csi, DAYS_PER_YEAR, csi_s::dts, FADE_LAST, MAX_DAMAGETYPES, MAX_VAR, Q_strncpyz(), STYLE_LAST, Sys_Backtrace(), Sys_Error(), TEAM_ALIEN, TEAM_CIVILIAN, TEAM_PHALANX, UFO_SIZE_T, V_AIRCRAFTTYPE, V_ALIGN, V_BLEND, V_BOOL, V_CHAR, V_COLOR, V_DAMAGE, V_DATE, 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, and V_VECTOR.
Referenced by Com_DropShipTypeToShortName(), Com_UFOCrashedTypeToShortName(), Com_UFOTypeToShortName(), GAME_GetImportData(), and UI_GetStringFromNodeProperty().
const char* const align_names[] |
Definition at line 341 of file scripts.cpp.
const char* const blend_names[] |
Definition at line 346 of file scripts.cpp.
const char* const fade_names[] |
Definition at line 356 of file scripts.cpp.
const char* const longlines_names[] |
const char* const name_strings[] |
Definition at line 2184 of file scripts.cpp.
Referenced by Com_FindNameType().
const char* const style_names[] |
Definition at line 351 of file scripts.cpp.
const char* const vt_names[] |
possible values for parsing functions
Definition at line 310 of file scripts.cpp.
Referenced by CL_ParsePtlCmds(), and CL_ParticleFunction().