diff --git a/src/battle/script.c b/src/battle/script.c index d8088c3..00240a9 100644 --- a/src/battle/script.c +++ b/src/battle/script.c @@ -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; diff --git a/src/system/lookup.c b/src/system/lookup.c index bb38375..0416217 100644 --- a/src/system/lookup.c +++ b/src/system/lookup.c @@ -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; diff --git a/src/system/textures.c b/src/system/textures.c index 3f1d894..f6478f8 100644 --- a/src/system/textures.c +++ b/src/system/textures.c @@ -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; diff --git a/src/system/util.c b/src/system/util.c index c21ad59..85f3233 100644 --- a/src/system/util.c +++ b/src/system/util.c @@ -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;