TITANIC: Migrate engine to Path

This commit is contained in:
Le Philousophe 2023-09-17 18:23:46 +02:00 committed by Eugene Sandulenko
parent cd802da8ae
commit da5f81d151
4 changed files with 6 additions and 7 deletions

View File

@ -61,7 +61,7 @@ AVISurface::AVISurface(const CResourceKey &key) : _movieName(key.getString()) {
// The y222.avi is the bells animation for the music room.
// It needs on the fly fixing for the video header
_decoder->loadStream(new y222());
} else if (!_decoder->loadFile(_movieName)) {
} else if (!_decoder->loadFile(Common::Path(_movieName))) {
error("Could not open video - %s", key.getString().c_str());
}

View File

@ -77,8 +77,7 @@ bool CFilesManager::loadResourceIndex() {
}
bool CFilesManager::fileExists(const CString &name) {
Common::File f;
return f.exists(name);
return Common::File::exists(Common::Path(name));
}
bool CFilesManager::scanForFile(const CString &name) {

View File

@ -37,7 +37,7 @@ CString readStringFromStream(Common::SeekableReadStream *s) {
bool File::open(const Common::Path &filename) {
if (!Common::File::open(filename))
error("Could not open file - %s", filename.toString().c_str());
error("Could not open file - %s", filename.toString(Common::Path::kNativeSeparator).c_str());
return true;
}
@ -477,7 +477,7 @@ bool StdCWadFile::open(const Common::String &filename) {
if (idx < 0) {
// Nope, so open up file for standard reading
assert(!name.empty());
if (!f.open(name))
if (!f.open(Common::Path(name)))
return false;
SimpleFile::open(f.readStream(f.size()));
@ -492,7 +492,7 @@ bool StdCWadFile::open(const Common::String &filename) {
int resIndex = resStr.readInt();
// Open up the index for access
if (!f.open(fname))
if (!f.open(Common::Path(fname)))
return false;
int indexSize = f.readUint32LE() / 4;
assert(resIndex < indexSize);

View File

@ -31,7 +31,7 @@ void DialogueIndexEntry::load(Common::SeekableReadStream &s) {
/*------------------------------------------------------------------------*/
CDialogueFile::CDialogueFile(const CString &filename, uint count) {
if (!_file.open(filename))
if (!_file.open(Common::Path(filename)))
error("Could not locate dialogue file - %s", filename.c_str());
_cache.resize(count);