diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp index 6f5e3ac0556..56843e7bcef 100644 --- a/engines/lilliput/lilliput.cpp +++ b/engines/lilliput/lilliput.cpp @@ -2342,13 +2342,13 @@ void LilliputEngine::pollEvent() { } } -byte *LilliputEngine::loadVGA(Common::String filename, int expectedSize, bool loadPal) { - debugC(1, kDebugEngine, "loadVGA(%s, %d, %d)", filename.c_str(), expectedSize, (loadPal) ? 1 : 0); +byte *LilliputEngine::loadVGA(const Common::Path &filename, int expectedSize, bool loadPal) { + debugC(1, kDebugEngine, "loadVGA(%s, %d, %d)", filename.toString().c_str(), expectedSize, (loadPal) ? 1 : 0); Common::File f; if (!f.open(filename)) - error("Missing game file %s", filename.c_str()); + error("Missing game file %s", filename.toString().c_str()); int remainingSize = f.size(); if (loadPal) { @@ -2402,13 +2402,13 @@ byte *LilliputEngine::loadVGA(Common::String filename, int expectedSize, bool lo return decodeBuffer; } -byte *LilliputEngine::loadRaw(Common::String filename, int filesize) { - debugC(1, kDebugEngine, "loadRaw(%s)", filename.c_str()); +byte *LilliputEngine::loadRaw(const Common::Path &filename, int filesize) { + debugC(1, kDebugEngine, "loadRaw(%s)", filename.toString().c_str()); Common::File f; if (!f.open(filename)) - error("Missing game file %s", filename.c_str()); + error("Missing game file %s", filename.toString().c_str()); byte *res = (byte *)malloc(sizeof(byte) * filesize); for (int i = 0; i < filesize; ++i) @@ -2431,7 +2431,7 @@ void LilliputEngine::loadRules() { Common::File f; uint16 curWord; - Common::String filename = "ERULES.PRG"; + Common::Path filename("ERULES.PRG"); Common::Language lang = Common::parseLanguage(ConfMan.get("language")); switch (lang) { @@ -2451,7 +2451,7 @@ void LilliputEngine::loadRules() { } if (!f.open(filename)) - error("Missing game file %s", filename.c_str()); + error("Missing game file %s", filename.toString().c_str()); _word10800_ERULES = f.readUint16LE(); @@ -2609,8 +2609,8 @@ void LilliputEngine::loadRules() { f.close(); } -void LilliputEngine::displayVGAFile(Common::String fileName) { - debugC(1, kDebugEngine, "displayVGAFile(%s)", fileName.c_str()); +void LilliputEngine::displayVGAFile(const Common::Path &fileName) { + debugC(1, kDebugEngine, "displayVGAFile(%s)", fileName.toString().c_str()); byte *buffer = loadVGA(fileName, 64000, true); memcpy(_mainSurface->getPixels(), buffer, 320*200); diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h index b827fbee559..5ce465823d1 100644 --- a/engines/lilliput/lilliput.h +++ b/engines/lilliput/lilliput.h @@ -304,11 +304,11 @@ public: void homeInChooseDirection(int index); void initGame(const LilliputGameDescription *gd); - byte *loadVGA(Common::String filename, int fileSize, bool loadPal); - byte *loadRaw(Common::String filename, int filesize); + byte *loadVGA(const Common::Path &filename, int fileSize, bool loadPal); + byte *loadRaw(const Common::Path &filename, int filesize); void loadRules(); - void displayVGAFile(Common::String fileName); + void displayVGAFile(const Common::Path &fileName); void initPalette(); void fixPaletteEntries(uint8 *palette, int num); diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp index 5ec909296c9..10aa8b84b3b 100644 --- a/engines/lilliput/script.cpp +++ b/engines/lilliput/script.cpp @@ -2972,7 +2972,7 @@ void LilliputScript::OC_loadAndDisplayCubesGfx() { int setNumb = (_currScript->readUint16LE() & 0xFF); assert((setNumb >= 0) && (setNumb <= 9)); - Common::String fileName = Common::String::format("CUBES%d.GFX", setNumb); + Common::Path fileName(Common::String::format("CUBES%d.GFX", setNumb)); _cubeSet = setNumb; // Useless in this variant, keep for the moment for Rome _vm->_bufferCubegfx = _vm->loadVGA(fileName, 61440, false); @@ -3147,7 +3147,7 @@ void LilliputScript::OC_displayVGAFile() { _vm->paletteFadeOut(); int curWord = _currScript->readUint16LE(); int index = _vm->_packedStringIndex[curWord]; - Common::String fileName = Common::String((const char *)&_vm->_packedStrings[index]); + Common::Path fileName((const char *)&_vm->_packedStrings[index]); _talkingCharacter = -1; _vm->displayVGAFile(fileName); _vm->paletteFadeIn(); diff --git a/engines/lilliput/sound.cpp b/engines/lilliput/sound.cpp index cf1ca124ac2..f4d7b41ff9b 100644 --- a/engines/lilliput/sound.cpp +++ b/engines/lilliput/sound.cpp @@ -91,13 +91,13 @@ uint32 LilliputSound::decode(const byte *src, byte *dst, uint32 len, uint32 star return i; } -void LilliputSound::loadMusic(Common::String filename) { - debugC(1, kDebugSound, "loadMusic(%s)", filename.c_str()); +void LilliputSound::loadMusic(const Common::Path &filename) { + debugC(1, kDebugSound, "loadMusic(%s)", filename.toString().c_str()); Common::File f; if (!f.open(filename)) - error("Missing music file %s", filename.c_str()); + error("Missing music file %s", filename.toString().c_str()); _fileNumb = f.readUint16LE(); diff --git a/engines/lilliput/sound.h b/engines/lilliput/sound.h index 3ce4c7e74d5..ad2b8865665 100644 --- a/engines/lilliput/sound.h +++ b/engines/lilliput/sound.h @@ -55,7 +55,7 @@ private: uint32 decode(const byte *src, byte *dst, uint32 len, uint32 start); byte readByte(const byte *data, uint32 offset); - void loadMusic(Common::String filename); + void loadMusic(const Common::Path &filename); void playMusic(int var1); void send(uint32 b) override;