aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute
diff options
context:
space:
mode:
authorTobia Tesan2014-10-14 23:14:14 +0200
committerTobia Tesan2014-10-15 20:09:31 +0200
commit1715196325c5b5867fd9bc684ca5204655fc9573 (patch)
treeb2f65ee244edb3fb96e2b4a2dfa0ec7d893882a2 /engines/wintermute
parent6f6e49f4cf183d9cbdf75060f4c271a538c6d1d1 (diff)
downloadscummvm-rg350-1715196325c5b5867fd9bc684ca5204655fc9573.tar.gz
scummvm-rg350-1715196325c5b5867fd9bc684ca5204655fc9573.tar.bz2
scummvm-rg350-1715196325c5b5867fd9bc684ca5204655fc9573.zip
WINTERMUTE: Re-enable and use PathUtils for auto SRT detection
Diffstat (limited to 'engines/wintermute')
-rw-r--r--engines/wintermute/video/video_subtitler.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/engines/wintermute/video/video_subtitler.cpp b/engines/wintermute/video/video_subtitler.cpp
index 965f7f1979..facc7076ee 100644
--- a/engines/wintermute/video/video_subtitler.cpp
+++ b/engines/wintermute/video/video_subtitler.cpp
@@ -30,6 +30,7 @@
// #include "dcgf.h"
#include "engines/wintermute/video/video_subtitler.h"
#include "engines/wintermute/base/base_file_manager.h"
+#include "engines/wintermute/utils/path_util.h"
#define S_OK 0
#define BYTE byte
@@ -74,17 +75,17 @@ bool CVidSubtitler::LoadSubtitles(const char *Filename, const char *SubtitleFile
m_ShowSubtitle = false;
- char NewFile[MAX_PATH];
+ Common::String NewFile;
if (SubtitleFile) {
- strcpy(NewFile, SubtitleFile);
+ NewFile = Common::String(SubtitleFile);
+ } else {
+ Common::String path = PathUtil::getDirectoryName(Filename);
+ Common::String name = PathUtil::getFileNameWithoutExtension(Filename);
+ Common::String ext = ".SUB";
+ NewFile = PathUtil::combine(path, name + ext);
}
-#if 0
- else {
- _splitpath(Filename, drive, dir, fname, NULL);
- _makepath(NewFile, drive, dir, fname, ".SUB");
- }
-#endif
+
DWORD Size;
Common::SeekableReadStream *file = BaseFileManager::getEngineInstance()->openFile(NewFile, true, false);