[Scummvm-cvs-logs] scummvm-tools master -> 362eb1fae0dd6d1b62429b59ea5b73619e75b67d

criezy criezy at scummvm.org
Sat Mar 2 14:00:29 CET 2013


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:
362eb1fae0 TOOLS: Respect the output directory given in compress_tinsel


Commit: 362eb1fae0dd6d1b62429b59ea5b73619e75b67d
    https://github.com/scummvm/scummvm-tools/commit/362eb1fae0dd6d1b62429b59ea5b73619e75b67d
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2013-03-02T04:59:47-08:00

Commit Message:
TOOLS: Respect the output directory given in compress_tinsel

That tool was ignoring the output directory given in command line
and always creating the result files in the current directory. Now it
uses the output directory if given and otherwise creates the result in
the directory that contains the input SMP file.

Changed paths:
    NEWS
    engines/tinsel/compress_tinsel.cpp



diff --git a/NEWS b/NEWS
index ce42f4d..eeaef98 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@ For a more comprehensive changelog of the latest experimental code, see:
  - Fix too long help string for compression tools in the extra input file
    selection which made the file selection impossible because the widgets
    were outside the window.
+ - Respect given output directory in compress_tinsel.
 
 1.4.0 (2011-11-11)
  - Updated the compress_sci tool to add support for compressing the AUDIO001.002
diff --git a/engines/tinsel/compress_tinsel.cpp b/engines/tinsel/compress_tinsel.cpp
index 2e0d821..4505271 100644
--- a/engines/tinsel/compress_tinsel.cpp
+++ b/engines/tinsel/compress_tinsel.cpp
@@ -263,14 +263,22 @@ void CompressTinsel::execute() {
 	Common::Filename inpath_smp = _inputPaths[0].path;
 	Common::Filename inpath_idx = _inputPaths[1].path;
 
+	Common::Filename &outpath = _outputPath;
+	if (outpath.empty())
+		outpath = inpath_smp.getPath();
+
 	_input_idx.open(inpath_idx, "rb");
 	_input_smp.open(inpath_smp, "rb");
 
-	Common::removeFile(TEMP_IDX);
-	_output_idx.open(TEMP_IDX, "wb");
+	Common::Filename outpath_idx = outpath;
+	outpath_idx.setFullName(TEMP_IDX);
+	Common::removeFile(outpath_idx.getFullPath().c_str());
+	_output_idx.open(outpath_idx, "wb");
 
-	Common::removeFile(TEMP_SMP);
-	_output_smp.open(TEMP_SMP, "wb");
+	Common::Filename outpath_smp = outpath;
+	outpath_smp.setFullName(TEMP_SMP);
+	Common::removeFile(outpath_smp.getFullPath().c_str());
+	_output_smp.open(outpath_smp, "wb");
 
 	switch (_format) {
  	case AUDIO_MP3:






More information about the Scummvm-git-logs mailing list