Removed unused functions.
This commit is contained in:
parent
603c3c4340
commit
ab55f19e75
|
@ -137,41 +137,6 @@ void runScriptFunction(const char *format, ...)
|
|||
}
|
||||
}
|
||||
|
||||
void runScriptTimeFunctions(void)
|
||||
{
|
||||
ScriptRunner *scriptRunner;
|
||||
cJSON *function;
|
||||
char *functionName;
|
||||
char funcNameBuffer[MAX_NAME_LENGTH];
|
||||
|
||||
if (scriptJSON && runScript)
|
||||
{
|
||||
function = scriptJSON->child;
|
||||
|
||||
sprintf(funcNameBuffer, "TIME %d", battle.stats[STAT_TIME] / 60);
|
||||
|
||||
while (function)
|
||||
{
|
||||
functionName = cJSON_GetObjectItem(function, "function")->valuestring;
|
||||
|
||||
if (strcmp(functionName, funcNameBuffer) == 0)
|
||||
{
|
||||
scriptRunner = malloc(sizeof(ScriptRunner));
|
||||
memset(scriptRunner, 0, sizeof(ScriptRunner));
|
||||
|
||||
scriptRunner->line = cJSON_GetObjectItem(function, "lines")->child;
|
||||
|
||||
tail->next = scriptRunner;
|
||||
tail = scriptRunner;
|
||||
|
||||
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Running script '%s'", funcNameBuffer);
|
||||
}
|
||||
|
||||
function = function->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void executeNextLine(ScriptRunner *runner)
|
||||
{
|
||||
char *line;
|
||||
|
|
|
@ -257,34 +257,6 @@ char *getLookupName(char *prefix, long num)
|
|||
return "";
|
||||
}
|
||||
|
||||
char *getFlagValues(char *prefix, long flags)
|
||||
{
|
||||
static char flagStr[MAX_DESCRIPTION_LENGTH];
|
||||
int requirePlus;
|
||||
Lookup *l;
|
||||
|
||||
memset(flagStr, '\0', MAX_DESCRIPTION_LENGTH);
|
||||
|
||||
requirePlus = 0;
|
||||
|
||||
for (l = head.next ; l != NULL ; l = l->next)
|
||||
{
|
||||
if (flags & l->value && strncmp(prefix, l->name, strlen(prefix)) == 0)
|
||||
{
|
||||
if (requirePlus)
|
||||
{
|
||||
strcat(flagStr, "+");
|
||||
}
|
||||
|
||||
strcat(flagStr, l->name);
|
||||
|
||||
requirePlus = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return flagStr;
|
||||
}
|
||||
|
||||
long flagsToLong(char *in, int *add)
|
||||
{
|
||||
char *flag, *flags;
|
||||
|
|
|
@ -25,11 +25,6 @@ static Texture textures[NUM_TEXTURE_BUCKETS];
|
|||
static void addTextureToCache(char *name, SDL_Texture *texture);
|
||||
SDL_Texture *getTexture(char *name);
|
||||
|
||||
void initTextures(void)
|
||||
{
|
||||
memset(&textures, 0, sizeof(Texture) * NUM_TEXTURE_BUCKETS);
|
||||
}
|
||||
|
||||
static void addTextureToCache(char *name, SDL_Texture *texture)
|
||||
{
|
||||
Texture *t, *new;
|
||||
|
|
|
@ -25,11 +25,6 @@ float mod(float n, float x)
|
|||
return fmod(fmod(n, x) + x, x);
|
||||
}
|
||||
|
||||
int rrnd(int low, int high)
|
||||
{
|
||||
return low + rand() % ((high - low) + 1);
|
||||
}
|
||||
|
||||
int getPercent(float current, float total)
|
||||
{
|
||||
return total != 0 ? (current / total) * 100 : 0;
|
||||
|
@ -56,23 +51,6 @@ int getDistance(int x1, int y1, int x2, int y2)
|
|||
return sqrt(x * x + y *y);
|
||||
}
|
||||
|
||||
void getSlope(int x1, int y1, int x2, int y2, float *dx, float *dy)
|
||||
{
|
||||
int steps = MAX(abs(x1 - x2), abs(y1 - y2));
|
||||
|
||||
if (steps == 0)
|
||||
{
|
||||
*dx = *dy = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
*dx = (x1 - x2);
|
||||
*dx /= steps;
|
||||
|
||||
*dy = (y1 - y2);
|
||||
*dy /= steps;
|
||||
}
|
||||
|
||||
char **toTypeArray(char *types, int *numTypes)
|
||||
{
|
||||
int i;
|
||||
|
|
Loading…
Reference in New Issue