DetectedGame::DetectedGame(const Common::String &id, const Common::String &d, Common::Language l, Common::Platform p, const Common::String &ex) : engineName(nullptr), hasUnknownFiles(false), canBeAdded(true), gameSupportLevel(kStableGame) { gameId = id; preferredTarget = id; description = d; language = l; platform = p; extra = ex; // Append additional information, if set, to the description. description += updateDesc(); }
int getR8(int xdim, int ydim, char *image, char *pal, int compress) { FILE *fp; int32 length; char *buf; if (!fileOpen()) { noFile(); return FAIL; } if (pal) if (setPal(pal) < 0) /* Error already signalled by setPal */ return FAIL; length = xdim * ydim; buf = (char *) HDmalloc(length); if ((fp = fopen(image, "r")) == NULL) { fprintf(stderr, "Error opening image file: %s.\n", image); return FAIL; } if (fread(buf, (size_t)xdim, (size_t)ydim, fp) < (size_t)ydim) { fprintf(stderr, "Error reading image file: %s.\n", image); return FAIL; } fclose(fp); if (DFR8addimage(he_file, buf, (int32) xdim, (int32) ydim, (uint16) compress) < 0) { HEprint(stderr, 0); return FAIL; } HDfree(buf); if (updateDesc() < 0) return FAIL; return HE_OK; }
int initFile(char *file) { if (he_file) HDfree(he_file); he_file = copyStr(file); if (updateDesc() < 0) return FAIL; /* if there are groups in this file, go to the first group tag */ /* otherwise, just go to the first element */ if (he_numGrp > 0) he_currDesc = he_grp[0].desc; else he_currDesc = 0; return resetPred(); }