Refactoring patch by DevHC

This commit is contained in:
Thilo Schulz 2011-03-05 19:20:37 +00:00
parent 21668c0616
commit fef4d12d68
31 changed files with 60 additions and 98 deletions

View file

@ -61,7 +61,6 @@ extern vmCvar_t ui_spSelection;
extern vmCvar_t ui_browserMaster;
extern vmCvar_t ui_browserGameType;
extern vmCvar_t ui_browserSortKey;
extern vmCvar_t ui_browserShowFull;
extern vmCvar_t ui_browserShowEmpty;

View file

@ -51,7 +51,7 @@ static const char *skillLevels[] = {
"Nightmare"
};
static const int numSkillLevels = sizeof(skillLevels) / sizeof(const char*);
static const int numSkillLevels = ARRAY_LEN( skillLevels );
static const char *netSources[] = {
@ -60,7 +60,7 @@ static const char *netSources[] = {
"Internet",
"Favorites"
};
static const int numNetSources = sizeof(netSources) / sizeof(const char*);
static const int numNetSources = ARRAY_LEN( netSources );
static const serverFilter_t serverFilters[] = {
{"All", "" },
@ -72,6 +72,9 @@ static const serverFilter_t serverFilters[] = {
{"OSP", "osp" },
};
static const int numServerFilters = ARRAY_LEN( serverFilters );
static const char *teamArenaGameTypes[] = {
"FFA",
"TOURNAMENT",
@ -84,35 +87,9 @@ static const char *teamArenaGameTypes[] = {
"TEAMTOURNAMENT"
};
static int const numTeamArenaGameTypes = sizeof(teamArenaGameTypes) / sizeof(const char*);
static int const numTeamArenaGameTypes = ARRAY_LEN( teamArenaGameTypes );
static const char *teamArenaGameNames[] = {
"Free For All",
"Tournament",
"Single Player",
"Team Deathmatch",
"Capture the Flag",
"One Flag CTF",
"Overload",
"Harvester",
"Team Tournament",
};
static int const numTeamArenaGameNames = sizeof(teamArenaGameNames) / sizeof(const char*);
static const int numServerFilters = sizeof(serverFilters) / sizeof(serverFilter_t);
static const char *sortKeys[] = {
"Server Name",
"Map Name",
"Open Player Spots",
"Game Type",
"Ping Time"
};
static const int numSortKeys = sizeof(sortKeys) / sizeof(const char*);
static char* netnames[] = {
"???",
"UDP",
@ -1007,7 +984,7 @@ void UI_Load(void) {
static const char *handicapValues[] = {"None","95","90","85","80","75","70","65","60","55","50","45","40","35","30","25","20","15","10","5",NULL};
#ifndef MISSIONPACK
static int numHandicaps = sizeof(handicapValues) / sizeof(const char*);
static int numHandicaps = ARRAY_LEN(handicapValues);
#endif
static void UI_DrawHandicap(rectDef_t *rect, float scale, vec4_t color, int textStyle) {
@ -5609,7 +5586,6 @@ vmCvar_t ui_spSelection;
vmCvar_t ui_browserMaster;
vmCvar_t ui_browserGameType;
vmCvar_t ui_browserSortKey;
vmCvar_t ui_browserShowFull;
vmCvar_t ui_browserShowEmpty;
@ -5728,7 +5704,6 @@ static cvarTable_t cvarTable[] = {
{ &ui_browserMaster, "ui_browserMaster", "0", CVAR_ARCHIVE },
{ &ui_browserGameType, "ui_browserGameType", "0", CVAR_ARCHIVE },
{ &ui_browserSortKey, "ui_browserSortKey", "4", CVAR_ARCHIVE },
{ &ui_browserShowFull, "ui_browserShowFull", "1", CVAR_ARCHIVE },
{ &ui_browserShowEmpty, "ui_browserShowEmpty", "1", CVAR_ARCHIVE },
@ -5820,7 +5795,7 @@ static cvarTable_t cvarTable[] = {
};
static int cvarTableSize = sizeof(cvarTable) / sizeof(cvarTable[0]);
static int cvarTableSize = ARRAY_LEN( cvarTable );
/*

View file

@ -1258,7 +1258,7 @@ commandDef_t commandList[] =
{"orbit", &Script_Orbit} // group/name
};
int scriptCommandCount = sizeof(commandList) / sizeof(commandDef_t);
int scriptCommandCount = ARRAY_LEN(commandList);
void Item_RunScript(itemDef_t *item, const char *s) {
@ -3192,7 +3192,7 @@ static bind_t g_bindings[] =
};
static const int g_bindCount = sizeof(g_bindings) / sizeof(bind_t);
static const int g_bindCount = ARRAY_LEN(g_bindings);
#ifndef MISSIONPACK
static configcvar_t g_configcvars[] =