Script* Disk_ns::loadLocation(const char *name) { char path[PATH_LEN]; sprintf(path, "%s%s/%s.loc", _vm->_char.getBaseName(), _language.c_str(), name); debugC(3, kDebugDisk, "Disk_ns::loadLocation(%s): trying '%s'", name, path); Common::SeekableReadStream *stream = tryOpenFile(path); if (!stream) { sprintf(path, "%s/%s.loc", _language.c_str(), name); debugC(3, kDebugDisk, "DosDisk_ns::loadLocation(%s): trying '%s'", name, path); stream = openFile(path); } return new Script(stream, true); }
Script* Disk_ns::loadLocation(const char *name) { char path[PATH_LEN]; const char *charName = _vm->_char.getBaseName(); // WORKAROUND: Special case for the Multilingual DOS version: during the ending // sequence, it tries to load a non-existing file using "Dinor" as a character // name. In this case, the character name should be just "dino". if (!strcmp(charName, "Dinor")) charName = "dino"; sprintf(path, "%s%s/%s.loc", charName, _language.c_str(), name); debugC(3, kDebugDisk, "Disk_ns::loadLocation(%s): trying '%s'", name, path); Common::SeekableReadStream *stream = tryOpenFile(path); if (!stream) { sprintf(path, "%s/%s.loc", _language.c_str(), name); debugC(3, kDebugDisk, "DosDisk_ns::loadLocation(%s): trying '%s'", name, path); stream = openFile(path); } return new Script(stream, true); }
Common::SeekableReadStream *Disk_ns::openFile(const char *filename) { Common::SeekableReadStream *stream = tryOpenFile(filename); if (!stream) errorFileNotFound(filename); return stream; }