joeylib2/examples/spacetaxi/stLevel.c

21 lines
441 B
C

// Space Taxi -- level loader (JoeyLib data path + the shared STL4 parser).
#include <stdio.h>
#include "joey/file.h"
#include "spacetaxi.h"
bool stLevelLoad(StLevelT *out, const char *path) {
FILE *fp;
bool ok;
// path is a name relative to DATA/ (e.g. "levels/title.dat").
fp = jlDataOpen(path, "rb");
if (fp == NULL) {
return false;
}
ok = stLevelParse(out, fp);
fclose(fp);
return ok;
}