WAGE: Migrate engine to Path

This commit is contained in:
Le Philousophe 2023-09-17 18:23:47 +02:00 committed by Eugene Sandulenko
parent dd374a778e
commit ca31647aeb
4 changed files with 13 additions and 13 deletions

View File

@ -106,15 +106,15 @@ Script::Script(Common::SeekableReadStream *data, int num, WageEngine *engine) :
if (ConfMan.getBool("dump_scripts")) {
Common::DumpFile out;
Common::String name;
Common::Path name;
if (num == -1)
name = Common::String::format("./dumps/%s-global.txt", _engine->getTargetName());
name = Common::Path(Common::String::format("./dumps/%s-global.txt", _engine->getTargetName()));
else
name = Common::String::format("./dumps/%s-%d.txt", _engine->getTargetName(), num);
name = Common::Path(Common::String::format("./dumps/%s-%d.txt", _engine->getTargetName(), num));
if (!out.open(name)) {
warning("Can not open dump file %s", name.c_str());
warning("Can not open dump file %s", name.toString().c_str());
return;
}

View File

@ -124,7 +124,7 @@ Common::Error WageEngine::run() {
// Your main event loop should be (invoked from) here.
_resManager = new Common::MacResManager();
if (!_resManager->open(Common::Path(getGameFile()).punycodeDecode().toString('/')))
if (!_resManager->open(Common::Path(getGameFile()).punycodeDecode()))
error("Could not open %s as a resource fork", getGameFile());
_world = new World(this);

View File

@ -160,11 +160,11 @@ bool World::loadWorld(Common::MacResManager *resMan) {
res->skip(3);
_aboutMessage = res->readPascalString();
if (!scumm_stricmp(resMan->getBaseFileName().toString().c_str(), "Scepters"))
if (!scumm_stricmp(_name.c_str(), "Scepters"))
res->skip(1); // ????
_soundLibrary1 = res->readPascalString();
_soundLibrary2 = res->readPascalString();
_soundLibrary1 = Common::Path(res->readPascalString());
_soundLibrary2 = Common::Path(res->readPascalString());
delete res;
}
@ -390,10 +390,10 @@ void World::addSound(Sound *sound) {
_orderedSounds.push_back(sound);
}
void World::loadExternalSounds(Common::String fname) {
void World::loadExternalSounds(const Common::Path &fname) {
Common::MacResManager resMan;
if (!resMan.open(fname)) {
warning("Cannot load sound file <%s>", fname.c_str());
warning("Cannot load sound file <%s>", fname.toString().c_str());
return;
}

View File

@ -64,7 +64,7 @@ public:
~World();
bool loadWorld(Common::MacResManager *resMan);
void loadExternalSounds(Common::String fname);
void loadExternalSounds(const Common::Path &fname);
Common::String *loadStringFromDITL(Common::MacResManager *resMan, int resourceId, int itemIndex);
void move(Obj *obj, Chr *chr);
void move(Obj *obj, Scene *scene, bool skipSort = false);
@ -78,8 +78,8 @@ public:
Common::String _name;
Common::String _aboutMessage;
Common::String _soundLibrary1;
Common::String _soundLibrary2;
Common::Path _soundLibrary1;
Common::Path _soundLibrary2;
bool _weaponMenuDisabled;
Script *_globalScript;