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

criezy criezy at scummvm.org
Sat Nov 26 23:22:37 CET 2011


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

Summary:
2262857f41 TOOLS: Only request one input file for extract_cge
d0dd437d3a TOOLS: Improve detection of the pack_cge tool
7935394474 README: Update extract_cge usage
892d26780f NEWS: Mention new extract_cge and pack_cge tools
ca6e34dfd1 TOOLS: Fix 'next' button in extra inputs page when there is only one input


Commit: 2262857f4109ba8ee3bd444ee2f27b8376785cdb
    https://github.com/scummvm/scummvm-tools/commit/2262857f4109ba8ee3bd444ee2f27b8376785cdb
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2011-11-26T14:12:00-08:00

Commit Message:
TOOLS: Only request one input file for extract_cge

The user only needs to give the vol.cat or vol.dat file now and not both
of them. This means the two file now have to be in the same directory
but I don't see that as an issue since ScummVM also requires that.

Changed paths:
    engines/cge/extract_cge.cpp
    engines/cge/extract_cge.h



diff --git a/engines/cge/extract_cge.cpp b/engines/cge/extract_cge.cpp
index 2dffa98..81b275d 100644
--- a/engines/cge/extract_cge.cpp
+++ b/engines/cge/extract_cge.cpp
@@ -30,24 +30,31 @@
 #define SEED        0xA5
 
 ExtractCge::ExtractCge(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION) {
-	ToolInput input1;
-	input1.format = "vol.cat";
-	_inputPaths.push_back(input1);
-	
-	ToolInput input2;
-	input2.format = "vol.dat";
-	_inputPaths.push_back(input2);
+	ToolInput input;
+	input.format = "vol.*";
+	_inputPaths.push_back(input);
 		
 	_outputToDirectory = true;
 
 	_shorthelp = "Used to extract Soltys data files.";
-	_helptext = "\nUsage: " + getName() + " [-o /path/to/output/dir/] <vol.dat> <vol.cat>\n";
+	_helptext = "\nUsage: " + getName() + " [-o /path/to/output/dir/] <inputfile>\n";
 }
 
 void ExtractCge::execute() {
 	unpack();
 }
 
+InspectionMatch ExtractCge::inspectInput(const Common::Filename &filename) {
+	// Accept either 'vol.cat' or 'vol.dat'
+	std::string file = filename.getFullName();
+	if (
+		scumm_stricmp(file.c_str(), "vol.dat") == 0 ||
+		scumm_stricmp(file.c_str(), "vol.cat") == 0
+	)
+		return IMATCH_PERFECT;
+	return IMATCH_AWFUL;
+}
+
 void ExtractCge::readData(Common::File &f, byte *buff, int size) {
 	int bytesRead = f.read_noThrow(buff, size);
 	for (int i = 0; i < bytesRead; ++i)
@@ -59,12 +66,15 @@ void ExtractCge::unpack() {
 
 	BtPage btPage;
 
-	Common::File volCat(_inputPaths[0].path, "rb");
+	Common::Filename filename = _inputPaths[0].path;
+	filename.setFullName("vol.cat");
+	Common::File volCat(filename, "rb");
 	if (!volCat.isOpen()) {
 		error("Unable to open vol.cat");
 	}
 
-	Common::File volDat(_inputPaths[1].path, "rb");
+	filename.setFullName("vol.dat");
+	Common::File volDat(filename, "rb");
 	if (!volDat.isOpen()) {
 		error("Unable to open vol.dat");
 	}
diff --git a/engines/cge/extract_cge.h b/engines/cge/extract_cge.h
index 75f707d..2a35138 100644
--- a/engines/cge/extract_cge.h
+++ b/engines/cge/extract_cge.h
@@ -31,6 +31,8 @@ public:
 	
 	virtual void execute();
 	
+	virtual InspectionMatch inspectInput(const Common::Filename &filename);
+	
 protected:
 	void readData(Common::File &f, byte *buff, int size);
 	void unpack();


Commit: d0dd437d3ac45ca1da63e415a2d8d2663dcd200d
    https://github.com/scummvm/scummvm-tools/commit/d0dd437d3ac45ca1da63e415a2d8d2663dcd200d
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2011-11-26T14:14:38-08:00

Commit Message:
TOOLS: Improve detection of the pack_cge tool

Before that it was detected if the user gave any directory as input.
Now it also requires the directory to contains a files.txt file.

Changed paths:
    engines/cge/pack_cge.cpp
    engines/cge/pack_cge.h



diff --git a/engines/cge/pack_cge.cpp b/engines/cge/pack_cge.cpp
index 8bd38ab..df8ed5f 100644
--- a/engines/cge/pack_cge.cpp
+++ b/engines/cge/pack_cge.cpp
@@ -33,7 +33,7 @@
 //   - Use output directory instead of current directory
 //   - Use input directory instead of current directory
 
-PackCge::PackCge(const std::string &name) : Tool(name, TOOLTYPE_UNKNOWN) {
+PackCge::PackCge(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION/*TOOLTYPE_UNKNOWN*/) {
 	ToolInput input;
 	input.format = "/";
 	input.file = false;
@@ -49,6 +49,18 @@ void PackCge::execute() {
 	pack();
 }
 
+InspectionMatch PackCge::inspectInput(const Common::Filename &filename) {
+	// Check that this is a directory
+	if (!filename.directory())
+		return IMATCH_AWFUL;
+
+	// Check that it contains a files.txt file
+	Common::Filename file = filename;
+	file.setFullName("files.txt");
+	if (file.exists())
+		return IMATCH_PERFECT;
+	return IMATCH_AWFUL;
+}
 
 void PackCge::writeData(Common::File &f, byte *buff, int size) {
 	for (int i = 0; i < size; ++i)
diff --git a/engines/cge/pack_cge.h b/engines/cge/pack_cge.h
index f453e4a..a52540d 100644
--- a/engines/cge/pack_cge.h
+++ b/engines/cge/pack_cge.h
@@ -31,6 +31,8 @@ public:
 	
 	virtual void execute();
 	
+	virtual InspectionMatch inspectInput(const Common::Filename &filename);
+	
 protected:
 	void writeData(Common::File &f, byte *buff, int size);
 	void pack();


Commit: 7935394474fa82a9240b927393cf72a2be61e020
    https://github.com/scummvm/scummvm-tools/commit/7935394474fa82a9240b927393cf72a2be61e020
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2011-11-26T14:15:16-08:00

Commit Message:
README: Update extract_cge usage

Changed paths:
    README



diff --git a/README b/README
index 3906514..647d5f7 100644
--- a/README
+++ b/README
@@ -55,7 +55,7 @@ Extraction Tools:
         extract_cge
                 Unpack Soltys game data files.
                 Example of usage:
-                ./scummvm-tools-cli --tool extract_cge [-o outputdir] vol.dat vol.cat
+                ./scummvm-tools-cli --tool extract_cge [-o outputdir] <inputfile>
 
         pack_cge
                Pack Soltys game data files.


Commit: 892d26780f34234b932efc52794d3f2dd8380488
    https://github.com/scummvm/scummvm-tools/commit/892d26780f34234b932efc52794d3f2dd8380488
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2011-11-26T14:15:46-08:00

Commit Message:
NEWS: Mention new extract_cge and pack_cge tools

Changed paths:
    NEWS



diff --git a/NEWS b/NEWS
index 9443a48..3c792a5 100644
--- a/NEWS
+++ b/NEWS
@@ -2,12 +2,13 @@ For a more comprehensive changelog of the latest experimental code, see:
         https://github.com/scummvm/scummvm-tools/commits/
 
 1.5.0 (????-??-??)
+ - Add two tools to extract and repackage the Soltys game data.
  - Fix bug #3093138: "compress_tucker with ScummVM CLI Tools not working".
  - Fix various issues on case sensitive systems when looking for input files
    (e.g. in compress_tucker or compress_sword1 the sub-directories and input
    files needed to be all uppercase).
- - Fix handling of input argument in scummvm-tools-cli for tools that expect
-   a directory to be given (and not a file).
+ - Improve tool detection and inputs handling for tools that require multiple
+   input files or an input directory (in both the GUI and command line).
 
 1.4.0 (2011-11-11)
  - Updated the compress_sci tool to add support for compressing the AUDIO001.002


Commit: ca6e34dfd19a70e3b02faecc19b12f7c63ec054e
    https://github.com/scummvm/scummvm-tools/commit/ca6e34dfd19a70e3b02faecc19b12f7c63ec054e
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2011-11-26T14:21:59-08:00

Commit Message:
TOOLS: Fix 'next' button in extra inputs page when there is only one input

Changed paths:
    gui/pages.cpp



diff --git a/gui/pages.cpp b/gui/pages.cpp
index 11c7228..d116ea7 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -351,7 +351,7 @@ void ChooseIOPage::updateButtons(wxWindow *panel, WizardButtons *buttons) {
 
 	const ToolGUI *tool = _configuration.selectedTool;
 	if (tool && !picker) {
-		for (size_t i = 1; i < tool->getInputList().size(); ++i) {
+		for (size_t i = 0; i < tool->getInputList().size(); ++i) {
 			wxString name(wxT("InputPicker"));
 			name << i;
 			picker = panel->FindWindowByName(name);






More information about the Scummvm-git-logs mailing list