helapordo 1.4.12
|
#include "helapordo.h"
Functions | |
void | gameloop (int argc, char **argv) |
Takes a integer and a string array (possibly from main). | |
void gameloop | ( | int | argc, |
char ** | argv ) |
Takes a integer and a string array (possibly from main).
Initialises a Path pointer and a Fighter pointer, before looping for each oom in path length by calling the correct room function. If all the rooms are cleared, prints a victory message and exits the program. Then getParams() is called to initialise a Fighter pointer's name and class fields. Takes an integer seed and frees path pointer. Notably, player pointer is not freed here.
argc | The number of argv values + 1 (0 is program name?). |
argv | Array of strings with argc - 1 values. |
Legacy code for reading palette.gpl. Was it ever needed at runtime? TODO check which tags may use the palette.gpl at runtime (other than trying to read it pointlessly).
char path_to_palette[600]; FILE* palette_file = NULL; char palette_name[50] = "palette.gpl"; sprintf(path_to_palette, "%s/%s", static_path, palette_name); palette_file = fopen(path_to_palette, "r"); if (palette_file == NULL) { fprintf(stderr, "Error: could not open palette file (%s/%s).\n", static_path, palette_name); exit(EXIT_FAILURE); }