[Scummvm-cvs-logs] scummvm-tools master -> a00c6cda07b7bad55cf027f41942d2b211878432

criezy criezy at scummvm.org
Mon Feb 3 21:58:48 CET 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .

Summary:
a00c6cda07 SWORD2: Fix issue with output file name when specifying and output directory


Commit: a00c6cda07b7bad55cf027f41942d2b211878432
    https://github.com/scummvm/scummvm-tools/commit/a00c6cda07b7bad55cf027f41942d2b211878432
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2014-02-03T12:58:25-08:00

Commit Message:
SWORD2: Fix issue with output file name when specifying and output directory

When specifying an output directory, the output file name was not set and
only an extension was set, resulting in a file being named ".cl3" for example.
Also improve the error message when giving a non-music or non-speech
cluster file as input to the tool.

Changed paths:
    NEWS
    engines/sword2/compress_sword2.cpp



diff --git a/NEWS b/NEWS
index 71e6433..340b864 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ For a more comprehensive changelog of the latest experimental code, see:
 1.7.0 (XXXX-XX-XX)
  - Improve support for sub-directory structure in Broken Sword 1 (e.g. when the
    files are in the Clusters, Music and Speech sub-directories).
+ - Fix issue with output file name in compress_sword2 tool when specifying an
+   output directory (the output file name was empty with only an extension).
 
 1.6.0 (2013-05-31)
  - Fix crash when compiling with wxWidgets 2.9.
diff --git a/engines/sword2/compress_sword2.cpp b/engines/sword2/compress_sword2.cpp
index fecec53..2ffae8d 100644
--- a/engines/sword2/compress_sword2.cpp
+++ b/engines/sword2/compress_sword2.cpp
@@ -73,6 +73,8 @@ void CompressSword2::execute() {
 	if (outpath.empty())
 		// Extensions change between the in/out files, so we can use the same directory
 		outpath = inpath;
+	else if (outpath.directory())
+		outpath.setFullName(inpath.getFullName());
 
 	switch (_format) {
 	case AUDIO_MP3:
@@ -98,7 +100,7 @@ void CompressSword2::execute() {
 	totalSize = 12 * (indexSize + 1);
 
 	if (_input.readUint32BE() != 0xfff0fff0) {
-		error("This doesn't look like a cluster file");
+		error("This doesn't look like a music or speech cluster file");
 	}
 
 	_output_idx.open(TEMP_IDX, "wb");






More information about the Scummvm-git-logs mailing list