From a38f178730bd8658d2aee3611e7c8a1e37228cb1 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sun, 29 Jan 2017 16:59:05 +0000 Subject: [PATCH] TOOLS: Fix handling of input path for the extract_cine tool --- NEWS | 2 ++ engines/cine/extract_cine.cpp | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index dee9c2d8..8ffd1d62 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ For a more comprehensive changelog of the latest experimental code, see: 1.10.0 (YYYY-MM-DD) - Fix handling of output path for the compress_touche tool. + - Fix handling of input path for the extract_cine tool. It was only working + when run from the directory that contains the game data. 1.9.0 (2016-10-27) - Fix random crashes in the tool to convert Broken Sword 1 speech files. diff --git a/engines/cine/extract_cine.cpp b/engines/cine/extract_cine.cpp index 179505e4..09b8db9a 100644 --- a/engines/cine/extract_cine.cpp +++ b/engines/cine/extract_cine.cpp @@ -284,8 +284,10 @@ void ExtractCine::unpackAllResourceFiles(const Common::Filename &filename) { for (unsigned int i = 0; i < resourceFilesCount; ++i) { memcpy(resourceFileName, &buf[4 + i * entrySize], 8); resourceFileName[8] = 0; + Common::Filename resourcePath(filename); + resourcePath.setFullName(resourceFileName); - Common::File fpResFile(resourceFileName, "rb"); + Common::File fpResFile(resourcePath, "rb"); print("--- Unpacking resource file %s:", resourceFileName); unpackFile(fpResFile); } @@ -294,6 +296,11 @@ void ExtractCine::unpackAllResourceFiles(const Common::Filename &filename) { } void ExtractCine::execute() { + // We always need to setup default output path, since there is no obligation to specify it + if (_outputPath.empty()) { + _outputPath.setFullPath("./"); + } + Common::Filename infilename(_inputPaths[0].path); std::string fname = infilename.getFullName();