aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo/lingo-funcs.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2017-03-29 08:35:33 +0200
committerEugene Sandulenko2017-03-29 08:35:33 +0200
commit1f5a57a54c4d70198b40c31dff49f4356821e403 (patch)
treef5dc723a35ffb4253c0c79210a39e544677327e8 /engines/director/lingo/lingo-funcs.cpp
parent581b2c84b83f7ab491f10b122662a1d6de62060f (diff)
downloadscummvm-rg350-1f5a57a54c4d70198b40c31dff49f4356821e403.tar.gz
scummvm-rg350-1f5a57a54c4d70198b40c31dff49f4356821e403.tar.bz2
scummvm-rg350-1f5a57a54c4d70198b40c31dff49f4356821e403.zip
DIRECTOR: Convert HFS file paths to Posix
Diffstat (limited to 'engines/director/lingo/lingo-funcs.cpp')
-rw-r--r--engines/director/lingo/lingo-funcs.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index 0f2110d8f1..4c02bf6bad 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -30,6 +30,7 @@
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-gr.h"
#include "director/sound.h"
+#include "director/util.h"
namespace Director {
@@ -180,6 +181,7 @@ void Lingo::func_goto(Datum &frame, Datum &movie) {
if (movie.type != VOID) {
movie.toString();
+ Common::String movieFilename = convertPath(*movie.u.s);
Common::String cleanedFilename;
bool fileExists = false;
@@ -187,30 +189,30 @@ void Lingo::func_goto(Datum &frame, Datum &movie) {
if (_vm->getPlatform() == Common::kPlatformMacintosh) {
Common::MacResManager resMan;
- for (const byte *p = (const byte *)movie.u.s->c_str(); *p; p++)
+ for (const byte *p = (const byte *)movieFilename.c_str(); *p; p++)
if (*p >= 0x20 && *p <= 0x7f)
cleanedFilename += (const char) *p;
- if (resMan.open(*movie.u.s)) {
+ if (resMan.open(movieFilename)) {
fileExists = true;
- cleanedFilename = *movie.u.s;
- } else if (!movie.u.s->equals(cleanedFilename) && resMan.open(cleanedFilename)) {
+ cleanedFilename = movieFilename;
+ } else if (!movieFilename.equals(cleanedFilename) && resMan.open(cleanedFilename)) {
fileExists = true;
}
} else {
Common::File file;
- cleanedFilename = *movie.u.s + ".MMM";
+ cleanedFilename = movieFilename + ".MMM";
- if (file.open(*movie.u.s)) {
+ if (file.open(movieFilename)) {
fileExists = true;
- cleanedFilename = *movie.u.s;
- } else if (!movie.u.s->equals(cleanedFilename) && file.open(cleanedFilename)) {
+ cleanedFilename = movieFilename;
+ } else if (!movieFilename.equals(cleanedFilename) && file.open(cleanedFilename)) {
fileExists = true;
}
}
if (!fileExists) {
- warning("Movie %s does not exist", movie.u.s->c_str());
+ warning("Movie %s does not exist", movieFilename.c_str());
return;
}