From b9a33f84be5b39bafbb3bd0794e71300e068588c Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Wed, 27 Feb 2013 15:50:36 -0600 Subject: [PATCH] Remove unused config string code from botlib --- code/botlib/be_aas_def.h | 14 ------ code/botlib/be_aas_main.c | 90 --------------------------------------- code/botlib/be_aas_main.h | 4 -- code/botlib/be_ai_goal.c | 3 +- 4 files changed, 1 insertion(+), 110 deletions(-) diff --git a/code/botlib/be_aas_def.h b/code/botlib/be_aas_def.h index 4f5655bf..4e177cfa 100644 --- a/code/botlib/be_aas_def.h +++ b/code/botlib/be_aas_def.h @@ -34,10 +34,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA //debugging on #define AAS_DEBUG -#define CS_SCORES 32 -#define CS_MODELS (CS_SCORES+MAX_CLIENTS) -#define CS_SOUNDS (CS_MODELS+MAX_MODELS) - #define DF_AASENTNUMBER(x) (x - aasworld.entities) #define DF_NUMBERAASENT(x) (&aasworld.entities[x]) #define DF_AASENTCLIENT(x) (x - aasworld.entities - 1) @@ -47,13 +43,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define MAX_PATH MAX_QPATH #endif -//string index (for model, sound and image index) -typedef struct aas_stringindex_s -{ - int numindexes; - char **index; -} aas_stringindex_t; - //structure to link entities to areas and areas to entities typedef struct aas_link_s { @@ -254,9 +243,6 @@ typedef struct aas_s int maxentities; int maxclients; aas_entity_t *entities; - //string indexes - char *configstrings[MAX_CONFIGSTRINGS]; - int indexessetup; //index to retrieve travel flag for a travel type int travelflagfortype[MAX_TRAVELTYPES]; //travel flags for each area based on contents diff --git a/code/botlib/be_aas_main.c b/code/botlib/be_aas_main.c index 7a9f7017..08f82135 100644 --- a/code/botlib/be_aas_main.c +++ b/code/botlib/be_aas_main.c @@ -70,96 +70,6 @@ void QDECL AAS_Error(char *fmt, ...) // Returns: - // Changes Globals: - //=========================================================================== -char *AAS_StringFromIndex(char *indexname, char *stringindex[], int numindexes, int index) -{ - if (!aasworld.indexessetup) - { - botimport.Print(PRT_ERROR, "%s: index %d not setup\n", indexname, index); - return ""; - } //end if - if (index < 0 || index >= numindexes) - { - botimport.Print(PRT_ERROR, "%s: index %d out of range\n", indexname, index); - return ""; - } //end if - if (!stringindex[index]) - { - if (index) - { - botimport.Print(PRT_ERROR, "%s: reference to unused index %d\n", indexname, index); - } //end if - return ""; - } //end if - return stringindex[index]; -} //end of the function AAS_StringFromIndex -//=========================================================================== -// -// Parameter: - -// Returns: - -// Changes Globals: - -//=========================================================================== -int AAS_IndexFromString(char *indexname, char *stringindex[], int numindexes, char *string) -{ - int i; - if (!aasworld.indexessetup) - { - botimport.Print(PRT_ERROR, "%s: index not setup \"%s\"\n", indexname, string); - return 0; - } //end if - for (i = 0; i < numindexes; i++) - { - if (!stringindex[i]) continue; - if (!Q_stricmp(stringindex[i], string)) return i; - } //end for - return 0; -} //end of the function AAS_IndexFromString -//=========================================================================== -// -// Parameter: - -// Returns: - -// Changes Globals: - -//=========================================================================== -char *AAS_ModelFromIndex(int index) -{ - return AAS_StringFromIndex("ModelFromIndex", &aasworld.configstrings[CS_MODELS], MAX_MODELS, index); -} //end of the function AAS_ModelFromIndex -//=========================================================================== -// -// Parameter: - -// Returns: - -// Changes Globals: - -//=========================================================================== -int AAS_IndexFromModel(char *modelname) -{ - return AAS_IndexFromString("IndexFromModel", &aasworld.configstrings[CS_MODELS], MAX_MODELS, modelname); -} //end of the function AAS_IndexFromModel -//=========================================================================== -// -// Parameter: - -// Returns: - -// Changes Globals: - -//=========================================================================== -void AAS_UpdateStringIndexes(int numconfigstrings, char *configstrings[]) -{ - int i; - //set string pointers and copy the strings - for (i = 0; i < numconfigstrings; i++) - { - if (configstrings[i]) - { - //if (aasworld.configstrings[i]) FreeMemory(aasworld.configstrings[i]); - aasworld.configstrings[i] = (char *) GetMemory(strlen(configstrings[i]) + 1); - strcpy(aasworld.configstrings[i], configstrings[i]); - } //end if - } //end for - aasworld.indexessetup = qtrue; -} //end of the function AAS_UpdateStringIndexes -//=========================================================================== -// -// Parameter: - -// Returns: - -// Changes Globals: - -//=========================================================================== int AAS_Loaded(void) { return aasworld.loaded; diff --git a/code/botlib/be_aas_main.h b/code/botlib/be_aas_main.h index 0748ad11..fce17800 100644 --- a/code/botlib/be_aas_main.h +++ b/code/botlib/be_aas_main.h @@ -51,10 +51,6 @@ int AAS_StartFrame(float time); int AAS_Initialized(void); //returns true if the AAS file is loaded int AAS_Loaded(void); -//returns the model name from the given index -char *AAS_ModelFromIndex(int index); -//returns the index from the given model name -int AAS_IndexFromModel(char *modelname); //returns the current time float AAS_Time(void); // diff --git a/code/botlib/be_ai_goal.c b/code/botlib/be_ai_goal.c index 8d3b75ed..be15d9af 100644 --- a/code/botlib/be_ai_goal.c +++ b/code/botlib/be_ai_goal.c @@ -558,10 +558,9 @@ void BotInitLevelItems(void) //if there's no AAS file loaded if (!AAS_Loaded()) return; - //update the modelindexes of the item info + //validate the modelindexes of the item info for (i = 0; i < ic->numiteminfo; i++) { - //ic->iteminfo[i].modelindex = AAS_IndexFromModel(ic->iteminfo[i].model); if (!ic->iteminfo[i].modelindex) { Log_Write("item %s has modelindex 0", ic->iteminfo[i].classname);