LAB: Migrate engine to Path

This commit is contained in:
Le Philousophe 2023-09-17 18:23:43 +02:00 committed by Eugene Sandulenko
parent abfc953046
commit 244ee1b79e
3 changed files with 6 additions and 6 deletions

View File

@ -130,7 +130,7 @@ LabEngine::LabEngine(OSystem *syst, const ADGameDescription *gameDesc)
_highPalette[i] = 0;
_introPlaying = false;
const Common::FSNode gameDataDir(ConfMan.get("path"));
const Common::FSNode gameDataDir(ConfMan.getPath("path"));
SearchMan.addSubDirectoryMatching(gameDataDir, "game", 0, 4);
}

View File

@ -143,7 +143,7 @@ void Resource::readViews(uint16 roomNum) {
delete dataFile;
}
Common::String Resource::translateFileName(const Common::String filename) {
Common::Path Resource::translateFileName(const Common::String &filename) {
Common::String upperFilename;
// The DOS and Windows version aren't looking for the right file,
@ -213,7 +213,7 @@ Common::String Resource::translateFileName(const Common::String filename) {
fileNameStrFinal += upperFilename;
return fileNameStrFinal;
return Common::Path(fileNameStrFinal);
}
Common::File *Resource::openDataFile(const Common::String filename, uint32 fileHeader) {
@ -227,13 +227,13 @@ Common::File *Resource::openDataFile(const Common::String filename, uint32 fileH
delete dataFile;
return nullptr;
} else
error("openDataFile: Couldn't open %s (%s)", translateFileName(filename).c_str(), filename.c_str());
error("openDataFile: Couldn't open %s (%s)", translateFileName(filename).toString().c_str(), filename.c_str());
}
if (fileHeader > 0) {
uint32 headerTag = dataFile->readUint32BE();
if (headerTag != fileHeader) {
dataFile->close();
error("openDataFile: Unexpected header in %s (%s) - expected: %d, got: %d", translateFileName(filename).c_str(), filename.c_str(), fileHeader, headerTag);
error("openDataFile: Unexpected header in %s (%s) - expected: %d, got: %d", translateFileName(filename).toString().c_str(), filename.c_str(), fileHeader, headerTag);
}
}

View File

@ -113,7 +113,7 @@ private:
void readCloseUps(uint16 depth, Common::File *file, CloseDataList &close);
void readView(Common::File *file, ViewDataList &view);
void readStaticText();
Common::String translateFileName(const Common::String filename);
Common::Path translateFileName(const Common::String &filename);
Common::String _staticText[48];
};