[Scummvm-cvs-logs] SF.net SVN: scummvm:[51929] tools/branches/gsoc2010-decompiler

pidgeot at users.sourceforge.net pidgeot at users.sourceforge.net
Sun Aug 8 13:43:27 CEST 2010


Revision: 51929
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51929&view=rev
Author:   pidgeot
Date:     2010-08-08 11:43:26 +0000 (Sun, 08 Aug 2010)

Log Message:
-----------
DECOMPILER: Merge trunk changes into branch

Modified Paths:
--------------
    tools/branches/gsoc2010-decompiler/Makefile
    tools/branches/gsoc2010-decompiler/Makefile.common
    tools/branches/gsoc2010-decompiler/NEWS
    tools/branches/gsoc2010-decompiler/README
    tools/branches/gsoc2010-decompiler/common/file.cpp
    tools/branches/gsoc2010-decompiler/common/file.h
    tools/branches/gsoc2010-decompiler/common/hashmap.h
    tools/branches/gsoc2010-decompiler/compress.cpp
    tools/branches/gsoc2010-decompiler/compress.h
    tools/branches/gsoc2010-decompiler/dist/msvc9/resource_cli.h
    tools/branches/gsoc2010-decompiler/dist/msvc9/resource_gui.h
    tools/branches/gsoc2010-decompiler/dist/msvc9/toolscli.vcproj
    tools/branches/gsoc2010-decompiler/dist/msvc9/toolsgui.vcproj
    tools/branches/gsoc2010-decompiler/engines/agos/compress_agos.cpp
    tools/branches/gsoc2010-decompiler/engines/agos/extract_agos.cpp
    tools/branches/gsoc2010-decompiler/engines/cruise/extract_cruise_pc.cpp
    tools/branches/gsoc2010-decompiler/engines/kyra/compress_kyra.cpp
    tools/branches/gsoc2010-decompiler/engines/kyra/kyra_pak.cpp
    tools/branches/gsoc2010-decompiler/engines/mohawk/archive.cpp
    tools/branches/gsoc2010-decompiler/engines/mohawk/archive.h
    tools/branches/gsoc2010-decompiler/engines/mohawk/extract_mohawk.cpp
    tools/branches/gsoc2010-decompiler/engines/mohawk/utils/stream.h
    tools/branches/gsoc2010-decompiler/engines/queen/compress_queen.cpp
    tools/branches/gsoc2010-decompiler/engines/saga/compress_saga.cpp
    tools/branches/gsoc2010-decompiler/engines/sci/compress_sci.cpp
    tools/branches/gsoc2010-decompiler/engines/scumm/compress_scumm_bun.cpp
    tools/branches/gsoc2010-decompiler/engines/scumm/compress_scumm_san.cpp
    tools/branches/gsoc2010-decompiler/engines/scumm/compress_scumm_sou.cpp
    tools/branches/gsoc2010-decompiler/engines/scumm/extract_zak_c64.cpp
    tools/branches/gsoc2010-decompiler/engines/sword1/compress_sword1.cpp
    tools/branches/gsoc2010-decompiler/engines/sword2/compress_sword2.cpp
    tools/branches/gsoc2010-decompiler/engines/sword2/sword2_clue.cpp
    tools/branches/gsoc2010-decompiler/engines/tinsel/compress_tinsel.cpp
    tools/branches/gsoc2010-decompiler/engines/touche/compress_touche.cpp
    tools/branches/gsoc2010-decompiler/engines/tucker/compress_tucker.cpp
    tools/branches/gsoc2010-decompiler/gui/configuration.h
    tools/branches/gsoc2010-decompiler/gui/gui_tools.cpp
    tools/branches/gsoc2010-decompiler/gui/main.cpp
    tools/branches/gsoc2010-decompiler/gui/main.h
    tools/branches/gsoc2010-decompiler/gui/pages.cpp
    tools/branches/gsoc2010-decompiler/gui/pages.h
    tools/branches/gsoc2010-decompiler/sci/sfx/doc/patch001.txt
    tools/branches/gsoc2010-decompiler/sci/sfx/doc/sound01.txt
    tools/branches/gsoc2010-decompiler/scummvm-tools-cli.cpp
    tools/branches/gsoc2010-decompiler/tools.cpp

Added Paths:
-----------
    tools/branches/gsoc2010-decompiler/engines/gob/gob_loadcalc.cpp

Removed Paths:
-------------
    tools/branches/gsoc2010-decompiler/engines/groovie/

Property Changed:
----------------
    tools/branches/gsoc2010-decompiler/


Property changes on: tools/branches/gsoc2010-decompiler
___________________________________________________________________
Modified: svn:ignore
   - .deps
.gdb_history
construct_mohawk
create_sjisfnt
decine
degob
dekyra
deriven
descumm
desword2
extract_mohawk
ScummVM Tools.app
scummvm-tools
scummvm-tools-cli
config.mk
config.h
config.log

   + .deps
.gdb_history
construct_mohawk
create_sjisfnt
decine
degob
dekyra
deriven
descumm
desword2
extract_mohawk
gob_loadcalc
ScummVM Tools.app
scummvm-tools
scummvm-tools-cli
config.mk
config.h
config.log

Modified: svn:mergeinfo
   - /tools/trunk:41370-43135
   + /tools/trunk:41370-43135,48931-51928

Modified: tools/branches/gsoc2010-decompiler/Makefile
===================================================================
--- tools/branches/gsoc2010-decompiler/Makefile	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/Makefile	2010-08-08 11:43:26 UTC (rev 51929)
@@ -97,6 +97,7 @@
 	strip desword2.exe -o $(WIN32PATH)/tools/desword2.exe
 	strip extract_mohawk.exe -o $(WIN32PATH)/tools/extract_mohawk.exe
 	strip construct_mohawk.exe -o $(WIN32PATH)/tools/construct_mohawk.exe
+	strip gob_loadcalc.exe -o $(WIN32PATH)/tools/gob_loadcalc.exe
 	strip scummvm-tools.exe -o $(WIN32PATH)/tools/scummvm-tools.exe
 	strip scummvm-tools-cli.exe -o $(WIN32PATH)/tools/scummvm-tools-cli.exe
 	cp *.bat $(WIN32PATH)/tools

Modified: tools/branches/gsoc2010-decompiler/Makefile.common
===================================================================
--- tools/branches/gsoc2010-decompiler/Makefile.common	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/Makefile.common	2010-08-08 11:43:26 UTC (rev 51929)
@@ -18,72 +18,49 @@
 
 #MODULES := test tools base $(MODULES)
 
-# HACK: Until we get proper module support, add these "module dirs" to
-# get the dependency tracking code working.
-MODULE_DIRS := ./ common/ gui/ sound/ 
 
-ifdef USE_BOOST
-MODULE_DIRS += \
-	decompiler/ \
-	decompiler/scummv6/ \
-	decompiler/kyra/ \
-	decompiler/test/disassembler
-endif
-
-MODULE_DIRS += \
-	engines/agos/ \
-	engines/cine/ \
-	engines/cruise/ \
-	engines/gob/ \
-	engines/groovie/ \
-	engines/kyra/ \
-	engines/mohawk/ \
-	engines/mohawk/utils/ \
-	engines/parallaction/ \
-	engines/queen/ \
-	engines/saga/ \
-	engines/scumm/ \
-	engines/sci/ \
-	engines/sword1/ \
-	engines/sword2/ \
-	engines/tinsel/ \
-	engines/touche/ \
-	engines/tucker/
-
 # TODO: This file should be restructured and much of it moved
 # to module.mk style files.
 
 
 #######################################################################
 
-TARGETS := \
-	decine$(EXEEXT) \
-	dekyra$(EXEEXT) \
-	deriven$(EXEEXT) \
-	descumm$(EXEEXT) \
-	desword2$(EXEEXT) \
-	extract_mohawk$(EXEEXT) \
-	construct_mohawk$(EXEEXT) \
-	degob$(EXEEXT) \
-	scummvm-tools-cli$(EXEEXT)
+PROGRAMS = \
+	decine \
+	dekyra \
+	deriven \
+	descumm \
+	desword2 \
+	degob \
+	gob_loadcalc \
+	extract_mohawk \
+	construct_mohawk \
+	scummvm-tools-cli
 
 ifdef USE_BOOST
-TARGETS += \
-	decompile$(EXEEXT)
+PROGRAMS += \
+	decompile
 endif
 
 ifdef USE_FREETYPE
 ifdef USE_ICONV
-TARGETS += \
-	create_sjisfnt$(EXEEXT)
+PROGRAMS += \
+	create_sjisfnt
 endif
 endif
 
 ifdef USE_WXWIDGETS
-TARGETS += \
-	scummvm-tools$(EXEEXT)
+PROGRAMS += \
+	scummvm-tools
 endif
 
+# TODO: We don't currently set USE_GTK in configure, so the user would have
+# to manually specify it
+ifdef USE_GTK
+PROGRAMS += \
+	sword2_clue
+endif
+
 UTILS := \
 	common/file.o \
 	common/hashmap.o \
@@ -96,13 +73,6 @@
 	sound/voc.o \
 	sound/wave.o
 
-all: $(TARGETS)
-
-install: $(TARGETS)
-	for i in $^ ; do $(INSTALL) -p -m 0755 $$i $(DESTDIR)$(BINDIR) ; done
-	$(INSTALL) -m 0755 -d $(DESTDIR)$(DATADIR)/scummvm-tools
-	$(INSTALL) -p -m 0644 $(srcdir)/gui/media/*.* $(DESTDIR)$(DATADIR)/scummvm-tools
-
 bundle_name = ScummVM\ Tools.app
 bundle: scummvm-tools$(EXEEXT)
 	mkdir -p $(bundle_name)
@@ -116,22 +86,7 @@
 
 
 
-PROGRAMS = \
-	decine \
-	dekyra \
-	deriven \
-	descumm \
-	desword2 \
-	degob \
-	extract_mohawk \
-	construct_mohawk \
-	create_sjisfnt \
-	scummvm-tools \
-	scummvm-tools-cli \
-	sword2_clue \
-	decompile
 
-
 decine_OBJS := engines/cine/decine.o
 
 dekyra_OBJS := \
@@ -179,6 +134,9 @@
 	version.o \
 	$(UTILS)
 
+gob_loadcalc_OBJS := \
+	engines/gob/gob_loadcalc.o
+
 extract_mohawk_OBJS := \
 	engines/mohawk/archive.o \
 	engines/mohawk/extract_mohawk.o \
@@ -191,7 +149,7 @@
 
 construct_mohawk_OBJS := \
 	engines/mohawk/construct_mohawk.o \
-	$(UTILS)	
+	$(UTILS)
 
 create_sjisfnt_OBJS := create_sjisfnt.o $(UTILS)
 create_sjisfnt_LIBS := $(FREETYPELIBS) $(ICONVLIBS)
@@ -202,7 +160,7 @@
 sword2_clue_OBJS := engines/sword2/sword2_clue.o
 sword2_clue_LIBS := `pkg-config --libs gtk+-2.0`
 # Set custom build flags
-sword2_clue.o: CPPFLAGS+=`pkg-config --cflags gtk+-2.0`
+engines/sword2/sword2_clue.o: CPPFLAGS+=`pkg-config --cflags gtk+-2.0`
 
 
 tools_OBJS := \
@@ -231,7 +189,6 @@
 	engines/scumm/extract_mm_nes.o \
 	engines/parallaction/extract_parallaction.o \
 	engines/scumm/extract_scumm_mac.o \
-	engines/groovie/extract_t7g_mac.o \
 	engines/scumm/extract_zak_c64.o \
 	engines/kyra/kyra_pak.o \
 	engines/kyra/kyra_ins.o \
@@ -329,9 +286,21 @@
 
 ######################################################################
 
+# Generate list of tool binaries
+TARGETS := $(addsuffix $(EXEEXT),$(PROGRAMS))
+
+all: $(TARGETS)
+
+install: $(TARGETS)
+	for i in $^ ; do $(INSTALL) -p -m 0755 $$i $(DESTDIR)$(BINDIR) ; done
+	$(INSTALL) -m 0755 -d $(DESTDIR)$(DATADIR)/scummvm-tools
+	$(INSTALL) -p -m 0644 $(srcdir)/gui/media/*.* $(DESTDIR)$(DATADIR)/scummvm-tools
+
 # Template for all executable targets.
 # This also automatically hooks up a "clean" rule.
+# It also sets up MODULE_DIRS.
 define PROGRAM_template
+MODULE_DIRS += $(dir $($(1)_OBJS))
 $(1)$(EXEEXT): $$($(1)_OBJS)
 	$(QUIET_LINK)$(LD) -o $(1)$(EXEEXT) $$($(1)_OBJS) $(LDFLAGS) $$($(1)_LIBS)
 #all: $(1)$(EXEEXT)
@@ -343,6 +312,8 @@
 # Generate build rules for all tools
 $(foreach prog,$(PROGRAMS),$(eval $(call PROGRAM_template,$(prog))))
 
+# Merge duplicate entries in MODULE_DIRS
+MODULE_DIRS := $(sort $(MODULE_DIRS))
 
 ######################################################################
 

Modified: tools/branches/gsoc2010-decompiler/NEWS
===================================================================
--- tools/branches/gsoc2010-decompiler/NEWS	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/NEWS	2010-08-08 11:43:26 UTC (rev 51929)
@@ -6,13 +6,15 @@
  - Add version information to tools.
  - Respect $BINDIR when installing (similar to ScummVM).
  - Fix bug #2983010: GUI Tools builds even if optioned out.
- - Do not give a maximum bitrate to lame when encoding to ABR MP3 since the lame
-   documentation says "this is NOT RECOMMENDED".
+ - Change the behavior of the CLI flags for MP3 encoding.
+ - Add option to process other files at the end of a process.
+ - Improve visual feedback after a process has finished. It should now be clear that
+   it has finished and whether it was a success or not.
 
 1.1.1 (2010-05-02)
  First tools version to contain a NEWS file.
 
- - Improve the way the images are loaded for the tools GUI. It increases the chances of success. 
+ - Improve the way the images are loaded for the tools GUI. It increases the chances of success.
  - Fix bug #2984217: "Tools: The media directory is not intalled".
  - Fix bug #2905473: "GUI Tools: cannot use lame with compress_scumm_sou".
  - Patch #2982306: "set MP3 ABR bit rate in GUI Tools".

Modified: tools/branches/gsoc2010-decompiler/README
===================================================================
--- tools/branches/gsoc2010-decompiler/README	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/README	2010-08-08 11:43:26 UTC (rev 51929)
@@ -128,12 +128,6 @@
                 Example of usage:
                 ./scummvm-tools-cli --tool extract_scumm_mac [-o outputdir] <infile>
 
-        extract_t7g_mac
-                Extract data files from the The 7th Guest Macintosh data file.
-
-                Example of usage:
-                ./scummvm-tools-cli --tool extract_t7g_mac [-o outputdir] <infile>
-
         extract_zak_c64
                 Extracts data files from the Commodore 64 version of Zak
                 McKracken.
@@ -203,7 +197,7 @@
                 - The unsupported early DOS demo of Inherit the Earth
 
         compress_scumm_bun
-                Used to the compress '.bun' music/voice files with MP3, Vorbis
+                Used to compress '.bun' music/voice files with MP3, Vorbis
                 or FLAC.
 
                 Example of usage:
@@ -312,7 +306,7 @@
 
                 "<version>" describes from which game the script file
                 was taken and is one of "Gob1", "Gob2", "Gob3", "Ween",
-                "Bargon", "Fascination, "Lost", "Woodruff", "Dynasty" 
+                "Bargon", "Fascination, "Lost", "Woodruff", "Dynasty"
                 and "Urban".
 
                 If the script file calls loadMult(), the script file's

Modified: tools/branches/gsoc2010-decompiler/common/file.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/common/file.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/common/file.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -24,7 +24,11 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <assert.h>
+#ifndef _MSC_VER
+#include <unistd.h>	// for unlink()
+#endif
 
+
 namespace Common {
 
 // Filenname implementation
@@ -380,9 +384,9 @@
 	fscanf(_file, "%s", result);
 }
 
-void File::writeChar(int i) {
+void File::writeChar(char i) {
 	if (!_file)
-		throw FileException("File  is not open");
+		throw FileException("File is not open");
 	if ((_mode & FILEMODE_WRITE) == 0)
 		throw FileException("Tried to write to a file opened in read mode (" + _name.getFullPath() + ")");
 
@@ -486,5 +490,9 @@
 	return sz;
 }
 
+int removeFile(const char *path) {
+	return unlink(path);
+}
+
 } // End of namespace Common
 

Modified: tools/branches/gsoc2010-decompiler/common/file.h
===================================================================
--- tools/branches/gsoc2010-decompiler/common/file.h	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/common/file.h	2010-08-08 11:43:26 UTC (rev 51929)
@@ -301,7 +301,7 @@
 	/**
 	 * Writes a single character (equivalent of fputc).
 	 */
-	void writeChar(int c);
+	void writeChar(char c);
 	/**
 	 * Writes a single byte to the file.
 	 * @throws FileException if file is not open / if write failed.
@@ -392,6 +392,15 @@
 	uint8 _xormode;
 };
 
+
+/**
+ * Remove the specified file.
+ * Currently this simply call unlink() internally,
+ * but by using this wrapper we have an easier time
+ * staying compatible with Windows.
+ */
+int removeFile(const char *path);
+
 } // End of namespace Common
 
 

Modified: tools/branches/gsoc2010-decompiler/common/hashmap.h
===================================================================
--- tools/branches/gsoc2010-decompiler/common/hashmap.h	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/common/hashmap.h	2010-08-08 11:43:26 UTC (rev 51929)
@@ -40,7 +40,7 @@
 
 namespace Common {
 
-// The sgi IRIX MIPSpro Compiler has difficulties with nested templates. 
+// The sgi IRIX MIPSpro Compiler has difficulties with nested templates.
 // This and the other __sgi conditionals below work around these problems.
 #ifdef __sgi
 template<class T> class IteratorImpl;

Modified: tools/branches/gsoc2010-decompiler/compress.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/compress.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/compress.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -42,10 +42,10 @@
 #endif
 
 struct lameparams {
-	uint32 minBitr;
-	uint32 maxBitr;
+	int32 minBitr;
+	int32 maxBitr;
 	uint32 targetBitr;
-	bool abr;
+	CompressionType type;
 	uint32 algqual;
 	uint32 vbrqual;
 	bool silent;
@@ -72,7 +72,7 @@
 	uint8 bitsPerSample;
 };
 
-lameparams encparms = { minBitrDef, maxBitrDef, targetBitrDef, false, algqualDef, vbrqualDef, 0, "lame" };
+lameparams lameparms = { -1, -1, 32, VBR, algqualDef, vbrqualDef, 0, "lame" };
 oggencparams oggparms = { -1, -1, -1, (float)oggqualDef, 0 };
 flaccparams flacparms = { flacCompressDef, flacBlocksizeDef, false, false };
 rawtype	rawAudioType = { false, false, 8 };
@@ -125,7 +125,7 @@
 	char *tmp = fbuf;
 
 	if (compmode == AUDIO_MP3) {
-		tmp += sprintf(tmp, "%s -t ", encparms.lamePath.c_str());
+		tmp += sprintf(tmp, "%s -t ", lameparms.lamePath.c_str());
 		if (rawInput) {
 			tmp += sprintf(tmp, "-r ");
 			tmp += sprintf(tmp, "--bitwidth %d ", rawAudioType.bitsPerSample);
@@ -140,11 +140,18 @@
 			tmp += sprintf(tmp, "-s %d ", rawSamplerate);
 		}
 
-		if (encparms.abr)
-			tmp += sprintf(tmp, "--abr %d ", encparms.targetBitr);
+		if (lameparms.type == CBR)
+			tmp += sprintf(tmp, "--cbr -b %d ", lameparms.targetBitr);
 		else {
-			tmp += sprintf(tmp, "--vbr-new -b %d ", encparms.minBitr);
-			tmp += sprintf(tmp, "-B %d ", encparms.maxBitr);
+			if (lameparms.type == ABR)
+				tmp += sprintf(tmp, "--abr %d ", lameparms.targetBitr);
+			else
+				tmp += sprintf(tmp, "--vbr-new -V %d ", lameparms.vbrqual);
+
+			if (lameparms.minBitr != -1)
+				tmp += sprintf(tmp, "-b %d ", lameparms.minBitr);
+			if (lameparms.maxBitr != -1)
+				tmp += sprintf(tmp, "-B %d ", lameparms.maxBitr);
 		}
 
 		/* Explicitly specify a target sample rate, to work around a bug (?)
@@ -158,12 +165,11 @@
 			tmp += sprintf(tmp, "--resample %d ", map2MP3Frequency(97 * rawSamplerate / 100));
 		}
 
-		if (encparms.silent) {
+		if (lameparms.silent) {
 			tmp += sprintf(tmp, " --silent ");
 		}
 
-		tmp += sprintf(tmp, "-q %d ", encparms.algqual);
-		tmp += sprintf(tmp, "-V %d ", encparms.vbrqual);
+		tmp += sprintf(tmp, "-q %d ", lameparms.algqual);
 
 		tmp += sprintf(tmp, "\"%s\" \"%s\" ", inname, outname);
 
@@ -688,7 +694,7 @@
 	encodeAudio(TEMP_RAW, true, sampleRate, outName, compmode);
 
 	// Delete temporary file
-	unlink(TEMP_RAW);
+	Common::removeFile(TEMP_RAW);
 }
 
 void CompressionTool::extractAndEncodeVOC(const char *outName, Common::File &input, AudioFormat compMode) {
@@ -778,75 +784,96 @@
 
 // mp3 settings
 void CompressionTool::setMp3LamePath(const std::string& arg) {
-	encparms.lamePath = arg;
+	lameparms.lamePath = arg;
 }
 
 void CompressionTool::setMp3CompressionType(const std::string& arg) {
-	encparms.abr = (arg == "ABR");
+	if (arg == "CBR")
+		lameparms.type = CBR;
+	else if (arg == "ABR")
+		lameparms.type = ABR;
+	else
+		lameparms.type = VBR;
 }
 
+void CompressionTool::setMp3CompressionType(CompressionType type) {
+	lameparms.type = type;
+}
+
 void CompressionTool::setMp3MpegQuality(const std::string& arg) {
-	encparms.algqual = atoi(arg.c_str());
-	
-	if (encparms.algqual == 0 && arg != "0")
+	lameparms.algqual = atoi(arg.c_str());
+
+	if (lameparms.algqual == 0 && arg != "0")
 		throw ToolException("Quality (-q) must be a number.");
-	
-	if (encparms.algqual > 9)
+
+	if (lameparms.algqual > 9)
 		throw ToolException("Quality (-q) out of bounds, must be between 0 and 9.");
 }
 
-void CompressionTool::setMp3ABRBitrate(const std::string& arg) {
-	encparms.minBitr = atoi(arg.c_str());
-	
-	if (encparms.targetBitr == 0 && arg != "0")
-		throw ToolException("Minimum bitrate (-b) must be a number.");
-	
-	if (encparms.targetBitr < 8 || encparms.targetBitr > 160)
-		throw ToolException("Minimum bitrate out of bounds (-b), must be between 8 and 160.");
+void CompressionTool::setMp3TargetBitrate(const std::string& arg) {
+	lameparms.targetBitr = atoi(arg.c_str());
+
+	if (lameparms.targetBitr == 0 && arg != "0")
+		throw ToolException("Target bitrate must be a number.");
+
+	if (lameparms.targetBitr < 8 || lameparms.targetBitr > 160)
+		throw ToolException("Target bitrate out of bounds, must be between 8 and 160.");
 }
 
-void CompressionTool::setMp3VBRMinBitrate(const std::string& arg) {
-	encparms.minBitr = atoi(arg.c_str());
-	
-	if (encparms.minBitr == 0 && arg != "0")
+void CompressionTool::setMp3MinBitrate(const std::string& arg) {
+	lameparms.minBitr = atoi(arg.c_str());
+
+	if (lameparms.minBitr == 0 && arg != "0")
 		throw ToolException("Minimum bitrate (-b) must be a number.");
 
-	if ((encparms.minBitr % 8) != 0)
-		encparms.maxBitr -= encparms.minBitr % 8;
-	
-	if (encparms.minBitr < 8 || encparms.minBitr > 160)
+	if ((lameparms.minBitr % 8) != 0)
+		lameparms.minBitr -= lameparms.minBitr % 8;
+	if (lameparms.minBitr > 64 && (lameparms.minBitr % 16) != 0)
+		lameparms.minBitr -= lameparms.minBitr % 16;
+
+	if (lameparms.minBitr < 8 || lameparms.minBitr > 160)
 		throw ToolException("Minimum bitrate out of bounds (-b), must be between 8 and 160.");
 }
 
-void CompressionTool::setMp3VBRMaxBitrate(const std::string& arg) {
-	encparms.maxBitr = atoi(arg.c_str());
-	
-	if (encparms.maxBitr == 0 && arg != "0")
+void CompressionTool::setMp3MaxBitrate(const std::string& arg) {
+	lameparms.maxBitr = atoi(arg.c_str());
+
+	if (lameparms.maxBitr == 0 && arg != "0")
 		throw ToolException("Maximum bitrate (-B) must be a number.");
 
-	if ((encparms.maxBitr % 8) != 0)
-		encparms.maxBitr -= encparms.maxBitr % 8;
+	if ((lameparms.maxBitr % 8) != 0)
+		lameparms.maxBitr -= lameparms.maxBitr % 8;
+	if (lameparms.maxBitr > 64 && (lameparms.maxBitr % 16) != 0)
+		lameparms.maxBitr -= lameparms.maxBitr % 16;
 
-	if (encparms.maxBitr < 8 || encparms.maxBitr > 160)
+	if (lameparms.maxBitr < 8 || lameparms.maxBitr > 160)
 		throw ToolException("Maximum bitrate out of bounds (-B), must be between 8 and 160.");
 }
 
+void CompressionTool::unsetMp3MinBitrate() {
+	lameparms.minBitr = -1;
+}
+
+void CompressionTool::unsetMp3MaxBitrate() {
+	lameparms.maxBitr = -1;
+}
+
 void CompressionTool::setMp3VBRQuality(const std::string& arg) {
-	encparms.vbrqual = atoi(arg.c_str());
-	if (encparms.vbrqual > 9)
+	lameparms.vbrqual = atoi(arg.c_str());
+	if (lameparms.vbrqual > 9)
 		throw ToolException("Quality (-q) out of bounds, must be between 0 and 9.");
 }
 
 // flac
 void CompressionTool::setFlacCompressionLevel(const std::string& arg) {
 	flacparms.compressionLevel = atoi(arg.c_str());
-	
+
 	if (flacparms.compressionLevel == 0 && arg != "0")
 		throw ToolException("FLAC compression level must be a number.");
 
 	if (flacparms.compressionLevel < 0 || flacparms.compressionLevel > 8)
 		throw ToolException("FLAC compression level ot of bounds, must be between 0 and 8.");
-		
+
 }
 
 void CompressionTool::setFlacBlockSize(const std::string& arg) {
@@ -859,10 +886,10 @@
 // vorbis
 void CompressionTool::setOggQuality(const std::string& arg) {
 	oggparms.quality = (float)atoi(arg.c_str());
-	
+
 	if (oggparms.quality == 0. && arg != "0")
 		throw ToolException("Quality (-q) must be a number.");
-	
+
 	if (oggparms.quality < 0. || oggparms.quality > 10.)
 		throw ToolException("Quality out of bounds (-q), must be between 0 and 10.");
 }
@@ -872,14 +899,14 @@
 
 	if (oggparms.minBitr == 0 && arg != "0")
 		throw ToolException("Minimum bitrate (-m) must be a number.");
-	
+
 	if (oggparms.minBitr < 8 || oggparms.minBitr > 160)
 		throw ToolException("Minimum bitrate out of bounds (-m), must be between 8 and 160.");
 }
 
 void CompressionTool::setOggAvgBitrate(const std::string& arg) {
 	oggparms.nominalBitr = atoi(arg.c_str());
-	
+
 	if (oggparms.nominalBitr == 0 && arg != "0")
 		throw ToolException("Nominal bitrate (-b) must be a number.");
 
@@ -903,9 +930,20 @@
 		_arguments.pop_front();
 
 		if (arg == "--vbr") {
-			encparms.abr = 0;
+			lameparms.type = VBR;
 		} else if (arg == "--abr") {
-			encparms.abr = 1;
+			if (_arguments.empty())
+				throw ToolException("Could not parse command line options, expected target bitrate after --abr");
+			lameparms.type = VBR;
+			setMp3TargetBitrate(_arguments.front());
+			_arguments.pop_front();
+		} else if (arg == "--cbr") {
+			if (_arguments.empty())
+				throw ToolException("Could not parse command line options, expected target bitrate after --cbr");
+			lameparms.type = CBR;
+			setMp3TargetBitrate(_arguments.front());
+			_arguments.pop_front();
+
 		} else if (arg == "--lame-path") {
 			if (_arguments.empty())
 				throw ToolException("Could not parse command line options, expected value after --lame-path");
@@ -915,13 +953,13 @@
 		} else if (arg == "-b") {
 			if (_arguments.empty())
 				throw ToolException("Could not parse command line options, expected value after -b");
-			setMp3VBRMinBitrate(_arguments.front());
+			setMp3MinBitrate(_arguments.front());
 			_arguments.pop_front();
 
 		} else if (arg == "-B") {
 			if (_arguments.empty())
 				throw ToolException("Could not parse command line options, expected value after -B");
-			setMp3VBRMaxBitrate(_arguments.front());
+			setMp3MaxBitrate(_arguments.front());
 			_arguments.pop_front();
 
 		} else if (arg == "-V") {
@@ -937,7 +975,7 @@
 			_arguments.pop_front();
 
 		} else if (arg == "--silent") {
-			encparms.silent = 1;
+			lameparms.silent = 1;
 		} else {
 			_arguments.push_front(arg);	//put back the non-audio argument we popped.
 			break;
@@ -1115,11 +1153,12 @@
 
 	if (_supportedFormats & AUDIO_MP3) {
 		os << "\nMP3 mode params:\n";
-		os << " --lame-path <path> Path to the lame excutable to use (default: lame)\n";
-		os << " -b <rate>    <rate> is the target bitrate(ABR)/minimal bitrate(VBR) (default:" << targetBitrDef << " for ABR and " << minBitrDef << " for VBR)\n";
-		os << " -B <rate>    <rate> is the maximum VBR bitrate (default:" << maxBitrDef << ")\n";
+		os << " --lame-path <path> Path to the lame excutable to use (default:lame)\n";
+		os << " -b <rate>    <rate> is the minimal bitrate (default:unset)\n";
+		os << " -B <rate>    <rate> is the maximum bitrate (default:unset)\n";
 		os << " --vbr        LAME uses the VBR mode (default)\n";
-		os << " --abr        LAME uses the ABR mode\n";
+		os << " --abr <rate> LAME uses the ABR mode with the given target bitrate\n";
+		os << " --cbr <rate> LAME uses the CBR mode with the given bitrate\n";
 		os << " -V <value>   specifies the value (0 - 9) of VBR quality (0=best) (default:" << vbrqualDef << ")\n";
 		os << " -q <value>   specifies the MPEG algorithm quality (0-9; 0=best) (default:" << algqualDef << ")\n";
 		os << " --silent     the output of LAME is hidden (default:disabled)\n";

Modified: tools/branches/gsoc2010-decompiler/compress.h
===================================================================
--- tools/branches/gsoc2010-decompiler/compress.h	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/compress.h	2010-08-08 11:43:26 UTC (rev 51929)
@@ -28,9 +28,6 @@
 
 enum {
 	/* These are the defaults parameters for the Lame invocation */
-	minBitrDef	= 24,
-	maxBitrDef	= 64,
-	targetBitrDef = 32,
 	algqualDef	= 2,
 	vbrqualDef	= 4,
 
@@ -63,6 +60,12 @@
 	AUDIO_ALL = AUDIO_VORBIS | AUDIO_FLAC | AUDIO_MP3
 };
 
+enum CompressionType {
+	CBR,
+	ABR,
+	VBR
+};
+
 const char *audio_extensions(AudioFormat format);
 int compression_format(AudioFormat format);
 
@@ -92,10 +95,13 @@
 	// mp3 settings
 	void setMp3LamePath(const std::string&);
 	void setMp3CompressionType(const std::string&);
+	void setMp3CompressionType(CompressionType);
 	void setMp3MpegQuality(const std::string&);
-	void setMp3ABRBitrate(const std::string&);
-	void setMp3VBRMinBitrate(const std::string&);
-	void setMp3VBRMaxBitrate(const std::string&);
+	void setMp3TargetBitrate(const std::string&);
+	void setMp3MinBitrate(const std::string&);
+	void setMp3MaxBitrate(const std::string&);
+	void unsetMp3MinBitrate();
+	void unsetMp3MaxBitrate();
 	void setMp3VBRQuality(const std::string&);
 
 	// flac

Modified: tools/branches/gsoc2010-decompiler/dist/msvc9/resource_cli.h
===================================================================
--- tools/branches/gsoc2010-decompiler/dist/msvc9/resource_cli.h	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/dist/msvc9/resource_cli.h	2010-08-08 11:43:26 UTC (rev 51929)
@@ -5,7 +5,7 @@
 #define IDI_ICON1                       101
 
 // Next default values for new objects
-// 
+//
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        102

Modified: tools/branches/gsoc2010-decompiler/dist/msvc9/resource_gui.h
===================================================================
--- tools/branches/gsoc2010-decompiler/dist/msvc9/resource_gui.h	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/dist/msvc9/resource_gui.h	2010-08-08 11:43:26 UTC (rev 51929)
@@ -5,7 +5,7 @@
 #define IDI_ICON1                       101
 
 // Next default values for new objects
-// 
+//
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        102

Modified: tools/branches/gsoc2010-decompiler/dist/msvc9/toolscli.vcproj
===================================================================
--- tools/branches/gsoc2010-decompiler/dist/msvc9/toolscli.vcproj	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/dist/msvc9/toolscli.vcproj	2010-08-08 11:43:26 UTC (rev 51929)
@@ -384,14 +384,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\engines\groovie\extract_t7g_mac.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\engines\groovie\extract_t7g_mac.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\engines\scumm\extract_zak_c64.cpp"
 				>
 			</File>

Modified: tools/branches/gsoc2010-decompiler/dist/msvc9/toolsgui.vcproj
===================================================================
--- tools/branches/gsoc2010-decompiler/dist/msvc9/toolsgui.vcproj	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/dist/msvc9/toolsgui.vcproj	2010-08-08 11:43:26 UTC (rev 51929)
@@ -528,14 +528,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\extract_t7g_mac.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\extract_t7g_mac.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\extract_zak_c64.cpp"
 				>
 			</File>

Modified: tools/branches/gsoc2010-decompiler/engines/agos/compress_agos.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/agos/compress_agos.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/agos/compress_agos.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -37,7 +37,7 @@
 	input.format = "*.*";
 	_inputPaths.push_back(input);
 
-	_shorthelp = "Compresses Simon the Sorcer and Feeble Files data files.";
+	_shorthelp = "Compresses Simon the Sorcerer and Feeble Files data files.";
 	_helptext = "\nUsage: " + getName() + " [mode params] [-o outfile] [--mac] <infile>\n";
 }
 
@@ -64,11 +64,11 @@
 	outputFile.close();
 
 	/* And some clean-up :-) */
-	unlink(TEMP_IDX);
-	unlink(TEMP_DAT);
-	unlink(TEMP_RAW);
-	unlink(tempEncoded);
-	unlink(TEMP_WAV);
+	Common::removeFile(TEMP_IDX);
+	Common::removeFile(TEMP_DAT);
+	Common::removeFile(TEMP_RAW);
+	Common::removeFile(tempEncoded);
+	Common::removeFile(TEMP_WAV);
 }
 
 

Modified: tools/branches/gsoc2010-decompiler/engines/agos/extract_agos.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/agos/extract_agos.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/agos/extract_agos.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -34,7 +34,7 @@
 	input.format = "*.*";
 	_inputPaths.push_back(input);
 
-	_shorthelp = "Used to extract Simon the Sorcer and Feeble Files data files.";
+	_shorthelp = "Used to extract Simon the Sorcerer and Feeble Files data files.";
 	_helptext = "\nUsage: " + getName() + " [-o outputname] infilename\n" + _shorthelp + "\n";
 }
 

Modified: tools/branches/gsoc2010-decompiler/engines/cruise/extract_cruise_pc.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/cruise/extract_cruise_pc.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/cruise/extract_cruise_pc.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -224,7 +224,7 @@
 	input.format = "*.*";
 	_inputPaths.push_back(input);
 
-	_shorthelp = "Extract data files from the PC version of CRuise for a Corpse.";
+	_shorthelp = "Extract data files from the PC version of Cruise for a Corpse.";
 	_helptext = "Usage: " + _name + " [-o outputdir] <infile>\n" + _shorthelp + "\n";
 }
 

Copied: tools/branches/gsoc2010-decompiler/engines/gob/gob_loadcalc.cpp (from rev 51928, tools/trunk/engines/gob/gob_loadcalc.cpp)
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/gob/gob_loadcalc.cpp	                        (rev 0)
+++ tools/branches/gsoc2010-decompiler/engines/gob/gob_loadcalc.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -0,0 +1,140 @@
+/* gob_loadcalc - Gobliiins (Gob1) Load Code Calculator
+ * Copyright (C) 2010 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdlib.h>
+#include <string.h>
+
+void printUsage(void) {
+	printf("Usage : ./gob-loadcalc [Level/Screen = 0 to 23] [Health = 0 to 10]\n");
+}
+
+const char baseCodes[24][6] = {
+	"GAGEA", //  0 = Level  2
+	"BULBE", //  1 = Level  6
+	"CANON", //  2 = Level  3
+	"TOTOD", //  3 = Level  1
+	"DRUID", //  4 = Level  4
+	"FOUDR", //  5 = Level  5
+	"GATEA", //  6 = Level  8
+	"HAHAH", //  7 = Level  7
+	"HIHIH", //  8 = Level  9
+	"JONAS", //  9 = Level 10
+	"FLUTE", // 10 = Level 11
+	"DROIT", // 11 = Level 12
+	"BANJO", // 12 = Level 13
+	"CUBEN", // 13 = Level 14
+	"RALER", // 14 = Level 15
+	"RATOP", // 15 = Level 16
+	"GOBLI", // 16 = Level 17
+	"IIINS", // 17 = Level 18
+	"LEMEI", // 18 = Level 19
+	"LLEUR", // 19 = Level 20
+	"JEUDE", // 20 = Level 21
+	"ROLED", // 21 = Level 22
+	"ETOUT", // 22 = Level  0
+	"LESTP"  // 23 = Level  0 - Bad Start Screen With Palette Scramble
+};
+
+int main(int argc, char *argv[]) {
+	int i, temp, level, health;
+
+	char code[8];
+
+	for (i = 0; i < 8; i++)
+		code[i] = '\0';
+
+	if (argc != 3) {
+		printUsage();
+		return EXIT_FAILURE;
+	} else {
+		level = atoi(argv[1]);
+		if (level < 0 || level > 23) {
+			printUsage();
+			return EXIT_FAILURE;
+		}
+		health = atoi(argv[2]);
+		if (health < 0 || health > 10) {
+			printUsage();
+			return EXIT_FAILURE;
+		}
+	}
+
+	printf("Level: %d\n", level);
+	printf("Health: %d\n", health);
+
+	// Convert Level to offset in baseCodes
+	switch (level) {
+		case 0:
+			level = 22;
+			break;
+		case 1:
+			level = 3;
+			break;
+		case 2:
+			level = 0;
+			break;
+		case 6:
+			level = 1;
+			break;
+		case 8:
+			level = 6;
+			break;
+		case 4:
+		case 5:
+		case 7:
+		case 23:
+			// level unchanged
+			break;
+		default:
+			level -= 1;
+			break;
+	}
+
+	strncpy(code, baseCodes[level], 5*sizeof(char));
+
+	// Used by Load to determine Level
+	code[5] = level + 'A';
+
+	// Adjust Code for Health
+	for (i = 0; i < 5; i++) {
+		if (health >= 2) {
+			code[i] += 2;
+			health -= 2;
+		} else if (health >= 1) {
+			code[i] += 1;
+			health -= 1;
+		}
+	}
+
+	// Calculate Checksum Character
+	temp = 0;
+	for (i = 0; i < 6; i++)
+		temp += code[i];
+	temp %= 26;
+	code[6] = 'A' + (char)temp;
+
+	printf("Code :\"%s\"\n", code);
+
+	return EXIT_SUCCESS;
+}

Modified: tools/branches/gsoc2010-decompiler/engines/kyra/compress_kyra.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/kyra/compress_kyra.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/kyra/compress_kyra.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -99,9 +99,9 @@
 
 		output.addFile(outputName.getFullPath().c_str(), tempEncoded);
 
-		unlink(TEMPFILE);
-		unlink(TEMP_RAW);
-		unlink(tempEncoded);
+		Common::removeFile(TEMPFILE);
+		Common::removeFile(TEMP_RAW);
+		Common::removeFile(tempEncoded);
 	}
 
 	if (output.getFileList())
@@ -285,7 +285,7 @@
 
 	encodeAudio(TEMP_RAW, true, header.freq, outfile, _format);
 
-	unlink(TEMP_RAW);
+	Common::removeFile(TEMP_RAW);
 }
 
 struct CompressKyra::DuplicatedFile {
@@ -345,7 +345,7 @@
 
 				output.addFile(outname, outname);
 
-				unlink(outname);
+				Common::removeFile(outname);
 
 				input.seek(pos, SEEK_SET);
 			}

Modified: tools/branches/gsoc2010-decompiler/engines/kyra/kyra_pak.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/kyra/kyra_pak.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/kyra/kyra_pak.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -314,7 +314,7 @@
 
 	addFile("LINKLIST", "LINKLIST.TMP");
 
-	unlink("LINKLIST.TMP");
+	Common::removeFile("LINKLIST.TMP");
 	delete[] linkList;
 }
 

Modified: tools/branches/gsoc2010-decompiler/engines/mohawk/archive.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/mohawk/archive.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/mohawk/archive.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -76,10 +76,10 @@
 		error ("Could not find tag \'RSRC\'");
 
 	_rsrc.version = _mhk->readUint16BE();
-	
+
 	if (_rsrc.version != 0x100)
 		error("Unsupported Mohawk resource version %d.%d", (_rsrc.version >> 8) & 0xff, _rsrc.version & 0xff);
-	
+
 	_rsrc.compaction = _mhk->readUint16BE(); // Only used in creation, not in reading
 	_rsrc.filesize = _mhk->readUint32BE();
 	_rsrc.abs_offset = _mhk->readUint32BE();
@@ -412,9 +412,9 @@
 
 MohawkArchive *MohawkArchive::createMohawkArchive(Common::SeekableReadStream *stream) {
 	uint32 headerTag = stream->readUint32BE();
-	
+
 	MohawkArchive *mohawkArchive = 0;
-	
+
 	if (headerTag == ID_MHWK) {
 		stream->readUint32BE(); // File size, ignore
 		headerTag = stream->readUint32BE();
@@ -426,7 +426,7 @@
 		// Assume the Living Books v1 archive format
 		mohawkArchive = new LivingBooksArchive_v1();
 	}
-	
+
 	stream->seek(0);
 
 	if (mohawkArchive)

Modified: tools/branches/gsoc2010-decompiler/engines/mohawk/archive.h
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/mohawk/archive.h	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/mohawk/archive.h	2010-08-08 11:43:26 UTC (rev 51929)
@@ -183,7 +183,7 @@
 public:
 	MohawkArchive();
 	virtual ~MohawkArchive() { close(); }
-	
+
 	// Detect new/old Mohawk archive format. Return NULL if the file is neither.
 	static MohawkArchive *createMohawkArchive(Common::SeekableReadStream *stream);
 

Modified: tools/branches/gsoc2010-decompiler/engines/mohawk/extract_mohawk.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/mohawk/extract_mohawk.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/mohawk/extract_mohawk.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -222,7 +222,7 @@
 
 	// Open the file as a Mohawk archive
 	MohawkArchive *mohawkArchive = MohawkArchive::createMohawkArchive(new Common::File(file));
-	
+
 	if (!mohawkArchive) {
 		printf("\'%s\' is not a valid Mohawk archive\n", argv[archiveArg]);
 		fclose(file);

Modified: tools/branches/gsoc2010-decompiler/engines/mohawk/utils/stream.h
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/mohawk/utils/stream.h	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/mohawk/utils/stream.h	2010-08-08 11:43:26 UTC (rev 51929)
@@ -169,13 +169,13 @@
 		  _eos(false) {
 		assert(parentStream);
 	}
-	
+
 	~SubReadStream() {
 		if (_disposeParentStream) delete _parentStream;
 	}
 
 	virtual bool eos() const { return _eos; }
-	
+
 	virtual uint32 read(void *dataPtr, uint32 dataSize) {
 		if (dataSize > _end - _pos) {
 			dataSize = _end - _pos;
@@ -209,7 +209,7 @@
 		_parentStream->seek(_pos);
 		_eos = false;
 	}
-	
+
 	virtual uint32 pos() const { return _pos - _begin; }
 	virtual uint32 size() const { return _end - _begin; }
 	virtual bool eos() const { return _parentStream->eos(); }

Modified: tools/branches/gsoc2010-decompiler/engines/queen/compress_queen.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/queen/compress_queen.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/queen/compress_queen.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -98,7 +98,7 @@
 	input.format = "queen.1";
 	_inputPaths.push_back(input);
 
-	_shorthelp = "Used to compress Flight of the Amazon Queen data files. Output filename is " + std::string(FINAL_OUT) + " .";
+	_shorthelp = "Used to compress Flight of the Amazon Queen data files.";
 	_helptext = "\nUsage: " + getName() + " [mode] [mode params] [-o outputdir] <inputfile (queen.1)>\n\t" + _shorthelp + "\n";
 }
 
@@ -168,8 +168,8 @@
 	fromFileToFile(inData, outFinal, dataSize);
 
 	/* Cleanup */
-	unlink(TEMP_TBL);
-	unlink(TEMP_DAT);
+	Common::removeFile(TEMP_TBL);
+	Common::removeFile(TEMP_DAT);
 }
 
 void CompressQueen::execute() {
@@ -275,8 +275,8 @@
 			compFile.close();
 
 			/* Delete temporary files */
-			unlink(TEMP_SB);
-			unlink(tempEncoded);
+			Common::removeFile(TEMP_SB);
+			Common::removeFile(tempEncoded);
 		} else {
 			/* Non .SB file */
 			bool patched = false;

Modified: tools/branches/gsoc2010-decompiler/engines/saga/compress_saga.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/saga/compress_saga.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/saga/compress_saga.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -430,8 +430,8 @@
 	free(outputTable);
 
 	// Cleanup
-	unlink(TEMP_RAW);
-	unlink(tempEncoded);
+	Common::removeFile(TEMP_RAW);
+	Common::removeFile(tempEncoded);
 
 	print("Done!\n");
 }

Modified: tools/branches/gsoc2010-decompiler/engines/sci/compress_sci.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/sci/compress_sci.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/sci/compress_sci.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -58,7 +58,7 @@
 
 	_outputToDirectory = false;
 
-	_shorthelp = "Used to compress sierra resource.aud/resource.sfx files. (NOT SCI32 compatible!)";
+	_shorthelp = "Used to compress Sierra resource.aud/resource.sfx files. (NOT SCI32 compatible!)";
 	_helptext = "\nUsage: " + getName() + " [mode-params] [-o outputname] <inputname>\n";
 }
 
@@ -405,8 +405,8 @@
 	}
 
 	/* And some clean-up :-) */
-	unlink(TEMP_RAW);
-	unlink(TEMP_ENC);
+	Common::removeFile(TEMP_RAW);
+	Common::removeFile(TEMP_ENC);
 }
 
 

Modified: tools/branches/gsoc2010-decompiler/engines/scumm/compress_scumm_bun.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/scumm/compress_scumm_bun.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/scumm/compress_scumm_bun.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -895,7 +895,7 @@
 		}
 
 		sprintf(tmpPath, "%s%s_reg%03d.wav", dir, filename, l);
-		unlink(tmpPath);
+		Common::removeFile(tmpPath);
 
 		int32 startPos = output.pos();
 		switch (_format) {
@@ -923,7 +923,7 @@
 		byte *tmpBuf = (byte *)malloc(size);
 		cmpFile.read_throwsOnError(tmpBuf, size);
 		cmpFile.close();
-		unlink(tmpPath);
+		Common::removeFile(tmpPath);
 
 		output.write(tmpBuf, size);
 		free(tmpBuf);
@@ -1079,7 +1079,7 @@
 	input.format = "*.bun";
 	_inputPaths.push_back(input);
 
-	_shorthelp = "Used to compress the .bun data files from The Curse of Monkey Island games.";
+	_shorthelp = "Used to compress .bun data files from The Curse of Monkey Island.";
 	_helptext = "\nUsage: " + getName() + " [mode] [mode-params] [-o outputfile = inputfile.bun] <inputfile>\n";
 }
 

Modified: tools/branches/gsoc2010-decompiler/engines/scumm/compress_scumm_san.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/scumm/compress_scumm_san.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/scumm/compress_scumm_san.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -304,7 +304,7 @@
 			byte *tmpBuf = (byte *)malloc(fileSize);
 			_audioTracks[l].file.read_throwsOnError(tmpBuf, fileSize);
 			_audioTracks[l].file.close();
-			unlink(filename);
+			Common::removeFile(filename);
 
 			byte *wavBuf = (byte *)malloc(fileSize);
 			memset(wavBuf, 0, fileSize);
@@ -541,7 +541,7 @@
 	input.format = "*.san";
 	_inputPaths.push_back(input);
 
-	_shorthelp = "Used to compress the .san smush files.";
+	_shorthelp = "Used to compress .san files found in the later SCUMM games.";
 	// TODO: Feature set seems more limited than what kCompressionAudioHelp contains
 	_helptext = "\nUsage: " + getName() + " [mode] [mode-params] [-o outpufile = inputfile.san] <inputfile>\n";
 }
@@ -760,7 +760,7 @@
 		else
 			encodeSanWaveWithLame(tmpPath);
 		tmpPath += ".raw";
-		unlink(tmpPath.c_str());
+		Common::removeFile(tmpPath.c_str());
 	}
 
 	input.close();

Modified: tools/branches/gsoc2010-decompiler/engines/scumm/compress_scumm_sou.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/scumm/compress_scumm_sou.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/scumm/compress_scumm_sou.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -39,7 +39,7 @@
 	input.format = "*.sou";
 	_inputPaths.push_back(input);
 
-	_shorthelp = "Used to compress the .sou data files.";
+	_shorthelp = "Used to compress .sou files of SCUMM games.";
 	_helptext = "\nUsage: " + getName() + " [mode] [mode params] monster.sou\n";
 	_supportsProgressBar = true;
 }
@@ -69,10 +69,10 @@
 	_input.close();
 
 	/* And some clean-up :-) */
-	unlink(TEMP_IDX);
-	unlink(TEMP_DAT);
-	unlink(TEMP_RAW);
-	unlink(tempEncoded);
+	Common::removeFile(TEMP_IDX);
+	Common::removeFile(TEMP_DAT);
+	Common::removeFile(TEMP_RAW);
+	Common::removeFile(tempEncoded);
 }
 
 void CompressScummSou::append_byte(int size, char buf[]) {
@@ -93,7 +93,7 @@
 		/* Scan for the VCTL header */
 		_input.read_throwsOnError(buf, 4);
 		/* The demo (snmdemo) and floppy version of Sam & Max use VTTL */
-		while (memcmp(buf, "VCTL", 4)&&memcmp(buf, "VTTL", 4)) {
+		while (memcmp(buf, "VCTL", 4) && memcmp(buf, "VTTL", 4)) {
 			pos++;
 			append_byte(4, buf);
 		}
@@ -109,6 +109,9 @@
 	_output_idx.writeUint32BE((uint32)pos);
 	_output_idx.writeUint32BE((uint32)_output_snd.pos());
 	_output_idx.writeUint32BE(tags);
+	// FIXME/TODO: Copying "tags" bytes one by one is
+	// inefficient; should use a buffer (say, "buf") to copy
+	// larger amounts at a time.
 	while (tags > 0) {
 		_output_snd.writeChar(_input.readChar());
 		tags--;
@@ -165,7 +168,7 @@
 	_input.open(inpath, "rb");
 	_output_idx.open(TEMP_IDX, "wb");
 	_output_snd.open(TEMP_DAT, "wb");
-	
+
 	_file_size = _input.size();
 
 	/* Get the 'SOU ....' header */
@@ -175,7 +178,7 @@
 	}
 
 	while (get_part())
-		(void)0;// Do nothing
+		;	// Do nothing
 	end_of_file();
 }
 

Modified: tools/branches/gsoc2010-decompiler/engines/scumm/extract_zak_c64.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/scumm/extract_zak_c64.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/scumm/extract_zak_c64.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -143,9 +143,13 @@
 		input->seek((SectorOffset[room_tracks_c64[i]] + room_sectors_c64[i]) * 256, SEEK_SET);
 
 		for (j = 0; j < ResourcesPerFile[i]; j++) {
-			unsigned short len = input->readUint16LE();
-			output.writeUint16LE(len);
+			unsigned short len;
 
+			do {
+				len = input->readUint16LE();
+				output.writeUint16LE(len);
+			} while (len == 0xffff);
+
 			for (len -= 2; len > 0; len--) {
 				output.writeByte(input->readByte());
 			}

Modified: tools/branches/gsoc2010-decompiler/engines/sword1/compress_sword1.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/sword1/compress_sword1.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/sword1/compress_sword1.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -487,7 +487,7 @@
 				continue;
 			}
 		}
-		
+
 		switch (_format) {
 		case AUDIO_MP3:
 			sprintf(outFileName, "SPEECH%d.%s", i, "CL3");
@@ -501,7 +501,7 @@
 		default:
 			error("Unknown encoding method");
 		}
-		
+
 		// Try opening in SPEECH sub-directory
 		sprintf(outName, "%s/SPEECH/%s", outpath->getPath().c_str(), outFileName);
 		try {
@@ -522,20 +522,20 @@
 		print("Converting CD %d...\n", i);
 		convertClu(clu, cl3);
 	}
-	unlink(TEMP_RAW);
-	unlink(_audioOuputFilename.c_str());
+	Common::removeFile(TEMP_RAW);
+	Common::removeFile(_audioOuputFilename.c_str());
 }
 
 void CompressSword1::compressMusic(const Common::Filename *inpath, const Common::Filename *outpath) {
 	int i;
 	char inName[256], outName[256], inFileName[12], outFileName[12];
-	
+
 	// check if output music directory exist and if we can create files in it
 	sprintf(outName, "%s/MUSIC/compress_sword1_test_file", outpath->getPath().c_str());
 	try {
 		Common::File outf(outName, "wb");
 		outf.close();
-		unlink(outName);
+		Common::removeFile(outName);
 	} catch(Common::FileException& err) {
 		_useOutputMusicSubdir = false;
 		print("Cannot create files in %s/MUSIC/; will try in %s/\n", outpath->getPath().c_str(), outpath->getPath().c_str());
@@ -544,7 +544,7 @@
 	for (i = 0; i < TOTAL_TUNES; i++) {
 		// Update the progress bar, we add 2 if we compress speech to, for those files
 		updateProgress(i, TOTAL_TUNES +(_compSpeech? 2 : 0));
-		
+
 		// Get name of input file
 		if (!_macVersion)
 			sprintf(inFileName, "%s.WAV", musicNames[i].fileName);
@@ -584,7 +584,7 @@
 		default:
 			error("Unknown encoding method");
 		}
-		
+
 		if (_useOutputMusicSubdir)
 			sprintf(outName, "%s/MUSIC/%s", outpath->getPath().c_str(), outFileName);
 		else
@@ -647,7 +647,7 @@
 	 We detect if we have a PC or Mac version with the music files (WAV for PC and AIF for Mac).
 	 If we have the Mac version or if we don't check the music files, an heuristic will be used
 	 when first accessing the speech file to detect if it is little endian or big endian */
-	 
+
 	if (checkMusic) {
 		for (i = 0; i < 20; i++) { /* Check the first 20 music files */
 			// Check WAV file
@@ -664,7 +664,7 @@
 			// Then try at root of input directory
 			sprintf(fileName, "%s/%s.WAV", inpath->getPath().c_str(), musicNames[i].fileName);
 			testFile = fopen(fileName, "rb");
-			
+
 			if (testFile) {
 				musicFound = true;
 				fclose(testFile);
@@ -687,7 +687,7 @@
 			// Then try at root of input directory
 			sprintf(fileName, "%s/%s.AIF", inpath->getPath().c_str(), musicNames[i].fileName);
 			testFile = fopen(fileName, "rb");
-			
+
 			if (testFile) {
 				musicFound = true;
 				_macVersion = true;
@@ -695,7 +695,7 @@
 				fclose(testFile);
 				break;
 			}
-			
+
 		}
 
 		if (!musicFound) {
@@ -740,7 +740,7 @@
 	input.format = "*.*";
 	_inputPaths.push_back(input);
 
-	_shorthelp = "Used to compress the Broken Sword 1 data files.";
+	_shorthelp = "Used to compress Broken Sword 1 data files.";
 	_helptext = "\nUsage: " + getName() + " [mode] [mode params] [-o outputdir] [only] <inputdir>\n"
 		"only can be either:\n"
 		" --speech-only  only encode speech clusters\n"

Modified: tools/branches/gsoc2010-decompiler/engines/sword2/compress_sword2.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/sword2/compress_sword2.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/sword2/compress_sword2.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -203,12 +203,12 @@
 
 	output.close();
 
-	unlink(TEMP_DAT);
-	unlink(TEMP_IDX);
-	unlink(TEMP_MP3);
-	unlink(TEMP_OGG);
-	unlink(TEMP_FLAC);
-	unlink(TEMP_WAV);
+	Common::removeFile(TEMP_DAT);
+	Common::removeFile(TEMP_IDX);
+	Common::removeFile(TEMP_MP3);
+	Common::removeFile(TEMP_OGG);
+	Common::removeFile(TEMP_FLAC);
+	Common::removeFile(TEMP_WAV);
 }
 
 #ifdef STANDALONE_MAIN

Modified: tools/branches/gsoc2010-decompiler/engines/sword2/sword2_clue.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/sword2/sword2_clue.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/sword2/sword2_clue.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -21,10 +21,10 @@
  *
  */
 
+#include "common/util.h"
+
 #include <gtk/gtk.h>
 
-#include "util.h"
-
 // The following cluster files are - to some extent - understood:
 //
 // carib1.clu

Modified: tools/branches/gsoc2010-decompiler/engines/tinsel/compress_tinsel.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/tinsel/compress_tinsel.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/tinsel/compress_tinsel.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -60,7 +60,7 @@
 	input2.format = "*.idx";
 	_inputPaths.push_back(input2);
 
-	_shorthelp = "Used to compress tinsel .smp files.";
+	_shorthelp = "Used to compress Tinsel .smp files.";
 	_helptext = "\nUsage: " + getName() + " [mode-params] [-o outputname] <infile.smp> <infile.idx>\n";
 }
 
@@ -73,7 +73,7 @@
 
 	print("Assuming DW1 sample being 8-bit raw...\n");
 
-	unlink(TEMP_RAW); unlink(TEMP_ENC);
+	Common::removeFile(TEMP_RAW); Common::removeFile(TEMP_ENC);
 	curFileHandle.open(TEMP_RAW, "wb");
 	copyLeft = sampleSize;
 	while (copyLeft > 0) {
@@ -224,8 +224,8 @@
 		chunkPos = (chunkPos + 1) % 4;
 	}
 
-	unlink(TEMP_RAW);
-	unlink(TEMP_ENC);
+	Common::removeFile(TEMP_RAW);
+	Common::removeFile(TEMP_ENC);
 
 	curFileHandle.open(TEMP_RAW, "wb");
 	curFileHandle.write(outBuffer, decodedCount*2);
@@ -268,10 +268,10 @@
 	_input_idx.open(inpath_idx, "rb");
 	_input_smp.open(inpath_smp, "rb");
 
-	unlink(TEMP_IDX);
+	Common::removeFile(TEMP_IDX);
 	_output_idx.open(TEMP_IDX, "wb");
 
-	unlink(TEMP_SMP);
+	Common::removeFile(TEMP_SMP);
 	_output_smp.open(TEMP_SMP, "wb");
 
 	_input_idx.seek(0, SEEK_END);
@@ -330,8 +330,8 @@
 	}
 
 	/* And some clean-up :-) */
-	unlink(TEMP_RAW);
-	unlink(TEMP_ENC);
+	Common::removeFile(TEMP_RAW);
+	Common::removeFile(TEMP_ENC);
 }
 
 

Modified: tools/branches/gsoc2010-decompiler/engines/touche/compress_touche.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/touche/compress_touche.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/touche/compress_touche.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -22,9 +22,6 @@
 
 #include <string.h>
 #include <stdio.h>
-#ifndef _MSC_VER
-#include <unistd.h>
-#endif
 
 #include "compress.h"
 #include "compress_touche.h"
@@ -176,8 +173,8 @@
 	output.close();
 
 	/* cleanup */
-	unlink(TEMP_RAW);
-	unlink(tempEncoded);
+	Common::removeFile(TEMP_RAW);
+	Common::removeFile(tempEncoded);
 
 	print("Done.\n");
 }

Modified: tools/branches/gsoc2010-decompiler/engines/tucker/compress_tucker.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/tucker/compress_tucker.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/engines/tucker/compress_tucker.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -50,7 +50,7 @@
 	input.format = "/";
 	_inputPaths.push_back(input);
 
-	_shorthelp = "Used to compress the tucker data files.";
+	_shorthelp = "Used to compress the Bud Tucker data files.";
 	_helptext = "\nUsage: " + getName() + " [mode params] [-o outputdir] inputdir\n";
 }
 
@@ -412,9 +412,9 @@
 	output.close();
 
 	/* cleanup */
-	unlink(TEMP_WAV);
-	unlink(TEMP_RAW);
-	unlink(tempEncoded);
+	Common::removeFile(TEMP_WAV);
+	Common::removeFile(TEMP_RAW);
+	Common::removeFile(tempEncoded);
 
 	print("Done.\n");
 }

Modified: tools/branches/gsoc2010-decompiler/gui/configuration.h
===================================================================
--- tools/branches/gsoc2010-decompiler/gui/configuration.h	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/gui/configuration.h	2010-08-08 11:43:26 UTC (rev 51929)
@@ -58,13 +58,13 @@
 	 * Sets all the compression members to default values based on the 'selectedPlatform' member
 	 */
 	void setPlatformDefaults();
-	
+
 	/**
 	 * Utility functions that test the given lame path.
 	 *
 	 * @return false indicate that the given lame path does not point to a valid lame executable.
 	 */
-	static bool isLamePathValid(const wxString& mp3LamePath);	
+	static bool isLamePathValid(const wxString& mp3LamePath);
 
 	// While prepending with _ would be in line with the coding conventions
 	// this class is just a glorified map with different types, so it seems

Modified: tools/branches/gsoc2010-decompiler/gui/gui_tools.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/gui/gui_tools.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/gui/gui_tools.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -149,11 +149,13 @@
 		compression->setMp3LamePath       ( (const char *)conf.mp3LamePath.mb_str()        );
 		compression->setMp3CompressionType( (const char *)conf.mp3CompressionType.mb_str() );
 		compression->setMp3MpegQuality    ( (const char *)conf.mp3MpegQuality.mb_str()     );
-		if (conf.mp3CompressionType == wxT("ABR"))
-			compression->setMp3ABRBitrate     ( (const char *)conf.mp3ABRBitrate.mb_str()      );
-		else {
-			compression->setMp3VBRMinBitrate  ( (const char *)conf.mp3VBRMinBitrate.mb_str()   );
-			compression->setMp3VBRMaxBitrate  ( (const char *)conf.mp3VBRMaxBitrate.mb_str()   );
+		if (conf.mp3CompressionType == wxT("ABR")) {
+			compression->setMp3TargetBitrate  ( (const char *)conf.mp3ABRBitrate.mb_str()      );
+			compression->unsetMp3MinBitrate();
+			compression->unsetMp3MaxBitrate();
+		} else {
+			compression->setMp3MinBitrate  ( (const char *)conf.mp3VBRMinBitrate.mb_str()   );
+			compression->setMp3MaxBitrate  ( (const char *)conf.mp3VBRMaxBitrate.mb_str()   );
 		}
 		compression->setMp3VBRQuality     ( (const char *)conf.mp3VBRQuality.mb_str()      );
 

Modified: tools/branches/gsoc2010-decompiler/gui/main.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/gui/main.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/gui/main.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -274,7 +274,7 @@
 		while (_pages.size() > 1) {
 			delete _pages.back();
 			_pages.pop_back();
-			
+
 		}
 		break;
 	case PreviousPage:
@@ -399,7 +399,7 @@
 
 	sizer->AddSpacer(10);
 
-	_prefs= new wxButton(this, ID_ADVANCED, wxT("Default Settings"));
+	_prefs= new wxButton(this, ID_ADVANCED, wxT("Settings"));
 	_prefs->SetSize(80, -1);
 	sizer->Add(_prefs, wxSizerFlags().Left().ReserveSpaceEvenIfHidden());
 
@@ -471,15 +471,11 @@
 	_prev->Enable(enable);
 }
 
-void WizardButtons::enableCancel(bool enable) {
-	_cancel->Enable(enable);
-}
-
 void WizardButtons::showFinish(bool show) {
 	if (show)
-		_next->SetLabel(wxT("Finish!"));
+		_cancel->SetLabel(wxT("Finish!"));
 	else
-		_next->SetLabel(wxT("Next >"));
+		_cancel->SetLabel(wxT("Cancel"));
 }
 
 void WizardButtons::showAbort(bool show) {

Modified: tools/branches/gsoc2010-decompiler/gui/main.h
===================================================================
--- tools/branches/gsoc2010-decompiler/gui/main.h	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/gui/main.h	2010-08-08 11:43:26 UTC (rev 51929)
@@ -179,11 +179,6 @@
 	void enablePrevious(bool enable);
 
 	/**
-	 * Enables the cancel button.
-	 */
-	void enableCancel(bool enable);
-
-	/**
 	 * Display the previous/next button.
 	 */
 	void showNavigation(bool show);

Modified: tools/branches/gsoc2010-decompiler/gui/pages.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/gui/pages.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/gui/pages.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -132,25 +132,25 @@
 		wxT("Welcome to the ScummVM extraction and compression utility.\nWhat do you want to do?")));
 
 	sizer->AddSpacer(15);
-	
+
 	wxFlexGridSizer *buttonSizer = new wxFlexGridSizer(2, 3, 10, 25);
 	buttonSizer->SetFlexibleDirection(wxVERTICAL);
-	
+
 	// Compress button
 	wxButton *compressButton = new wxButton(panel, ID_COMPRESS, wxT("Compress"));
 	buttonSizer->Add(compressButton, wxSizerFlags().Expand());
 	compressButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(IntroPage::onClickCompress), NULL, this);
-	
+
 	// Extract button
 	wxButton *extractButton = new wxButton(panel, ID_EXTRACT, wxT("Extract"));
 	buttonSizer->Add(extractButton, wxSizerFlags().Expand());
 	extractButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(IntroPage::onClickExtract), NULL, this);
-	
+
 	// Advanced button
 	wxButton *advancedButton = new wxButton(panel, ID_ADVANCED, wxT("Advanced"));
 	buttonSizer->Add(advancedButton, wxSizerFlags().Expand());
 	advancedButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(IntroPage::onClickAdvanced), NULL, this);
-	
+
 	// Compress Label
 	wxStaticText *compressLabel = new wxStaticText(
 			panel, wxID_ANY,
@@ -159,7 +159,7 @@
 		);
 	compressLabel->Wrap(110);
 	buttonSizer->Add(compressLabel, wxSizerFlags().Align(wxALIGN_CENTER_HORIZONTAL));
-	
+
 	// Extract Label
 	wxStaticText *extractLabel = new wxStaticText(
 			panel, wxID_ANY,
@@ -168,7 +168,7 @@
 		);
 	extractLabel->Wrap(110);
 	buttonSizer->Add(extractLabel, wxSizerFlags().Align(wxALIGN_CENTER_HORIZONTAL));
-	
+
 	// Advanced Label
 	wxStaticText *advancedLabel = new wxStaticText(
 			panel, wxID_ANY,
@@ -177,7 +177,7 @@
 		);
 	advancedLabel->Wrap(110);
 	buttonSizer->Add(advancedLabel, wxSizerFlags().Align(wxALIGN_CENTER_HORIZONTAL));
-	
+
 	sizer->Add(buttonSizer);
 	SetAlignedSizer(panel, sizer);
 
@@ -192,7 +192,6 @@
 	buttons->setLineLabel(wxT("ScummVM Tools"));
 
 	buttons->showNavigation(false);
-	buttons->enableCancel(true);
 
 	WizardPage::updateButtons(panel, buttons);
 }
@@ -825,7 +824,7 @@
 		else if (format->GetStringSelection() == wxT("MP3"))
 			switchPage(new ChooseAudioOptionsMp3Page(_configuration));
 	} else {
-		
+
 		// For MP3 we check if the lame path is valid otherwise we let the choice
 		// tp the user to either change the audio format or to go to the MP3
 		// options page (to set the lame path).
@@ -834,12 +833,12 @@
 			!Configuration::isLamePathValid(_configuration.mp3LamePath)
 		) {
 			wxMessageDialog *msgDialog = new wxMessageDialog(
-					NULL, 
+					NULL,
 					wxT("The lame executable could not be found. It is needed to compress files to MP3. "
 						"You can either proceed to the advanced audio settings page and give the path to lame "
 						"or you can select another audio format to compress to.\n\n"
 						"Do you want to proceed to the advanced audio settings page?"),
-					wxT("lame not found"), 
+					wxT("lame not found"),
 					wxYES_NO | wxNO_DEFAULT | wxICON_EXCLAMATION
 				);
 			int retval = msgDialog->ShowModal();
@@ -847,7 +846,7 @@
 				switchPage(new ChooseAudioOptionsMp3Page(_configuration));
 			return;
 		}
-		
+
 		switchPage(new ProcessPage(_configuration));
 	}
 }
@@ -861,16 +860,8 @@
 
 wxWindow *ChooseAudioOptionsMp3Page::CreatePanel(wxWindow *parent) {
 	wxWindow *panel = WizardPage::CreatePanel(parent);
-	
+
 	wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
-	
-	// Add a ScrolledWindow in that panel as there is a lot of options
-	// and there might not be enough place to display them all.
-	wxScrolledWindow *scroll = new wxScrolledWindow(panel);
-	scroll->FitInside();
-	scroll->SetScrollRate(10, 10);
-	
-	sizer->Add(scroll, 1, wxEXPAND | wxALL);
 
 	/*
 	"\nMP3 mode params:\n"
@@ -885,36 +876,36 @@
 	*/
 
 	// Grid
-	wxFlexGridSizer *gridSizer = new wxFlexGridSizer(7, 2, 10, 25);
-	gridSizer->AddGrowableCol(1);
+	_gridSizer = new wxFlexGridSizer(7, 2, 10, 25);
+	_gridSizer->AddGrowableCol(1);
 
 	// Create output selection
-	gridSizer->Add(new wxStaticText(scroll, wxID_ANY, wxT("Lame executable:")));
+	_gridSizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Lame executable:")));
 
 	wxFilePickerCtrl *lamePicker = new wxFilePickerCtrl(
-			scroll, wxID_ANY, _configuration.outputPath, wxT("Select lame executable"),
+			panel, wxID_ANY, _configuration.outputPath, wxT("Select lame executable"),
 			wxT("lame"),
 			wxDefaultPosition, wxSize(250, -1),
 			wxFLP_USE_TEXTCTRL | wxFLP_OPEN, wxDefaultValidator,
 			wxT("LamePath")
 		);
-		
-	gridSizer->Add(lamePicker, wxSizerFlags().Expand());
 
+	_gridSizer->Add(lamePicker, wxSizerFlags().Expand());
+
 	// Type of compression
-	gridSizer->Add(new wxStaticText(scroll, wxID_ANY, wxT("Compression Type:")));
+	_gridSizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Compression Type:")));
 
-	wxRadioButton *abrButton = new wxRadioButton(scroll, wxID_ANY, wxT("ABR"),
+	wxRadioButton *abrButton = new wxRadioButton(panel, wxID_ANY, wxT("ABR"),
 		wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, wxT("ABR"));
 
 	wxSizer *radioSizer = new wxBoxSizer(wxHORIZONTAL);
 	radioSizer->Add(abrButton);
 
-	wxRadioButton *vbrButton = new wxRadioButton(scroll, wxID_ANY, wxT("VBR"),
+	wxRadioButton *vbrButton = new wxRadioButton(panel, wxID_ANY, wxT("VBR"),
 		wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, wxT("VBR"));
 	radioSizer->Add(vbrButton);
 
-	gridSizer->Add(radioSizer, wxSizerFlags().Expand());
+	_gridSizer->Add(radioSizer, wxSizerFlags().Expand());
 
 	// Bitrates
 	const int possibleBitrateCount = 160 / 8;
@@ -923,28 +914,31 @@
 		possibleBitrates[i] << (i+1)*8;
 	}
 
-	gridSizer->Add(new wxStaticText(scroll, wxID_ANY, wxT("Minimum Bitrate:")));
+	_vbrMinBitrateLabel = new wxStaticText(panel, wxID_ANY, wxT("Minimum Bitrate:"));
+	_gridSizer->Add(_vbrMinBitrateLabel);
 
-	wxChoice *vbrMinBitrate = new wxChoice(
-		scroll, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+	_vbrMinBitrate = new wxChoice(
+		panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
 		possibleBitrateCount, possibleBitrates, 0, wxDefaultValidator, wxT("MinimumBitrate"));
-	gridSizer->Add(vbrMinBitrate, wxSizerFlags().Expand().Border(wxRIGHT, 100));
+	_gridSizer->Add(_vbrMinBitrate, wxSizerFlags().Expand().Border(wxRIGHT, 100));
 
 
-	gridSizer->Add(new wxStaticText(scroll, wxID_ANY, wxT("Maximum Bitrate:")));
+	_vbrMaxBitrateLabel = new wxStaticText(panel, wxID_ANY, wxT("Maximum Bitrate:"));
+	_gridSizer->Add(_vbrMaxBitrateLabel);
 
-	wxChoice *vbrMaxBitrate = new wxChoice(
-		scroll, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+	_vbrMaxBitrate = new wxChoice(
+		panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
 		possibleBitrateCount, possibleBitrates, 0, wxDefaultValidator, wxT("MaximumBitrate"));
-	gridSizer->Add(vbrMaxBitrate, wxSizerFlags().Expand().Border(wxRIGHT, 100));
+	_gridSizer->Add(_vbrMaxBitrate, wxSizerFlags().Expand().Border(wxRIGHT, 100));
 
 
-	gridSizer->Add(new wxStaticText(scroll, wxID_ANY, wxT("Average Bitrate:")));
+	_abrAvgBitrateLabel = new wxStaticText(panel, wxID_ANY, wxT("Average Bitrate:"));
+	_gridSizer->Add(_abrAvgBitrateLabel);
 
-	wxChoice *abrAvgBitrate = new wxChoice(
-		scroll, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+	_abrAvgBitrate = new wxChoice(
+		panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
 		possibleBitrateCount, possibleBitrates, 0, wxDefaultValidator, wxT("AverageBitrate"));
-	gridSizer->Add(abrAvgBitrate, wxSizerFlags().Expand().Border(wxRIGHT, 100));
+	_gridSizer->Add(_abrAvgBitrate, wxSizerFlags().Expand().Border(wxRIGHT, 100));
 
 	abrButton->Connect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(ChooseAudioOptionsMp3Page::onChangeCompressionType), NULL, this);
 	vbrButton->Connect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(ChooseAudioOptionsMp3Page::onChangeCompressionType), NULL, this);
@@ -956,23 +950,24 @@
 		possibleQualities[i] << i;
 	}
 
-	gridSizer->Add(new wxStaticText(scroll, wxID_ANY, wxT("VBR Quality:")));
+	_vbrQualityLabel = new wxStaticText(panel, wxID_ANY, wxT("VBR Quality:"));
+	_gridSizer->Add(_vbrQualityLabel);
 
-	wxChoice *vbrQuality = new wxChoice(
-		scroll, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+	_vbrQuality = new wxChoice(
+		panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
 		possibleQualityCount, possibleQualities, 0, wxDefaultValidator, wxT("VBRQuality"));
-	gridSizer->Add(vbrQuality, wxSizerFlags().Expand().Border(wxRIGHT, 100));
+	_gridSizer->Add(_vbrQuality, wxSizerFlags().Expand().Border(wxRIGHT, 100));
 
 
-	gridSizer->Add(new wxStaticText(scroll, wxID_ANY, wxT("MPEG Quality:")));
+	_gridSizer->Add(new wxStaticText(panel, wxID_ANY, wxT("MPEG Quality:")));
 
 	wxChoice *mpegQuality = new wxChoice(
-		scroll, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+		panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
 		possibleQualityCount, possibleQualities, 0, wxDefaultValidator, wxT("MpegQuality"));
-	gridSizer->Add(mpegQuality, wxSizerFlags().Expand().Border(wxRIGHT, 100));
+	_gridSizer->Add(mpegQuality, wxSizerFlags().Expand().Border(wxRIGHT, 100));
 
 	// Finish the window
-	scroll->SetSizer(gridSizer);
+	sizer->Add(_gridSizer, wxSizerFlags().Expand());
 	SetAlignedSizer(panel, sizer);
 
 
@@ -982,11 +977,11 @@
 		abrButton->SetValue(true);
 	else
 		vbrButton->SetValue(true);
-	vbrMinBitrate->SetStringSelection(_configuration.mp3VBRMinBitrate);
-	vbrMaxBitrate->SetStringSelection(_configuration.mp3VBRMaxBitrate);
-	abrAvgBitrate->SetStringSelection(_configuration.mp3ABRBitrate);
-	vbrQuality   ->SetStringSelection(_configuration.mp3VBRQuality);
-	mpegQuality  ->SetStringSelection(_configuration.mp3MpegQuality);
+	_vbrMinBitrate->SetStringSelection(_configuration.mp3VBRMinBitrate);
+	_vbrMaxBitrate->SetStringSelection(_configuration.mp3VBRMaxBitrate);
+	_abrAvgBitrate->SetStringSelection(_configuration.mp3ABRBitrate);
+	_vbrQuality   ->SetStringSelection(_configuration.mp3VBRQuality);
+	mpegQuality   ->SetStringSelection(_configuration.mp3MpegQuality);
 
 	updateFields(panel);
 
@@ -995,22 +990,16 @@
 
 void ChooseAudioOptionsMp3Page::save(wxWindow *panel) {
 	wxFilePickerCtrl *lamePath = static_cast<wxFilePickerCtrl *>(panel->FindWindowByName(wxT("LamePath")));
-	
-	wxRadioButton *abr = static_cast<wxRadioButton *>(panel->FindWindowByName(wxT("ABR")));
-//	wxRadioButton *vbr = static_cast<wxRadioButton *>(panel->FindWindowByName(wxT("VBR")));
 
-	wxChoice *vbrMinBitrate = static_cast<wxChoice *>(panel->FindWindowByName(wxT("MinimumBitrate")));
-	wxChoice *vbrMaxBitrate = static_cast<wxChoice *>(panel->FindWindowByName(wxT("MaximumBitrate")));
-	wxChoice *abrAvgBitrate = static_cast<wxChoice *>(panel->FindWindowByName(wxT("AverageBitrate")));
-	wxChoice *vbrQuality = static_cast<wxChoice *>(panel->FindWindowByName(wxT("VBRQuality")));
+	wxRadioButton *abr = static_cast<wxRadioButton *>(panel->FindWindowByName(wxT("ABR")));
 	wxChoice *mpegQuality = static_cast<wxChoice *>(panel->FindWindowByName(wxT("MpegQuality")));
 
 	_configuration.mp3LamePath      = lamePath->GetPath();
-	_configuration.mp3VBRMinBitrate = vbrMinBitrate->GetStringSelection();
-	_configuration.mp3VBRMaxBitrate = vbrMaxBitrate->GetStringSelection();
-	_configuration.mp3ABRBitrate    = abrAvgBitrate->GetStringSelection();
-	_configuration.mp3VBRQuality    = vbrQuality   ->GetStringSelection();
-	_configuration.mp3MpegQuality   = mpegQuality  ->GetStringSelection();
+	_configuration.mp3VBRMinBitrate = _vbrMinBitrate->GetStringSelection();
+	_configuration.mp3VBRMaxBitrate = _vbrMaxBitrate->GetStringSelection();
+	_configuration.mp3ABRBitrate    = _abrAvgBitrate->GetStringSelection();
+	_configuration.mp3VBRQuality    = _vbrQuality   ->GetStringSelection();
+	_configuration.mp3MpegQuality   = mpegQuality   ->GetStringSelection();
 	if (abr->GetValue())
 		_configuration.mp3CompressionType = wxT("ABR");
 	else
@@ -1019,18 +1008,18 @@
 
 void ChooseAudioOptionsMp3Page::updateFields(wxWindow *panel) {
 	wxRadioButton *abr = static_cast<wxRadioButton *>(panel->FindWindowByName(wxT("ABR")));
-	//wxRadioButton *vbr = static_cast<wxRadioButton *>(panel->FindWindowByName(wxT("VBR")));
-	wxChoice *vbrMinBitrate = static_cast<wxChoice *>(panel->FindWindowByName(wxT("MinimumBitrate")));
-	wxChoice *vbrMaxBitrate = static_cast<wxChoice *>(panel->FindWindowByName(wxT("MaximumBitrate")));
-	wxChoice *abrAvgBitrate = static_cast<wxChoice *>(panel->FindWindowByName(wxT("AverageBitrate")));
-	wxChoice *vbrQuality = static_cast<wxChoice *>(panel->FindWindowByName(wxT("VBRQuality")));
-	//wxChoice *mpegQuality =  static_cast<wxChoice *>(panel->FindWindowByName(wxT("MpegQuality")));
 
-	vbrMinBitrate->Enable(!abr->GetValue());
-	vbrMaxBitrate->Enable(!abr->GetValue());
-	vbrQuality->Enable(!abr->GetValue());
+	bool isAbrSelected = abr->GetValue();
+	_gridSizer->Show(_abrAvgBitrate,       isAbrSelected);
+	_gridSizer->Show(_abrAvgBitrateLabel,  isAbrSelected);
+	_gridSizer->Show(_vbrMinBitrate,      !isAbrSelected);
+	_gridSizer->Show(_vbrMinBitrateLabel, !isAbrSelected);
+	_gridSizer->Show(_vbrMaxBitrate,      !isAbrSelected);
+	_gridSizer->Show(_vbrMaxBitrateLabel, !isAbrSelected);
+	_gridSizer->Show(_vbrQuality,         !isAbrSelected);
+	_gridSizer->Show(_vbrQualityLabel,    !isAbrSelected);
 
-	abrAvgBitrate->Enable(abr->GetValue());
+	_gridSizer->Layout();
 }
 
 void ChooseAudioOptionsMp3Page::onChangeCompressionType(wxCommandEvent &evt) {
@@ -1046,17 +1035,17 @@
 	wxFilePickerCtrl *lamePath = static_cast<wxFilePickerCtrl *>(panel->FindWindowByName(wxT("LamePath")));
 	if (!Configuration::isLamePathValid(lamePath->GetPath())) {
 		wxMessageDialog *msgDialog = new wxMessageDialog(
-				NULL, 
+				NULL,
 				wxT("The lame executable could not be found. It is needed to compress files to MP3. "
 				    "If you want to use MP3 compression you need to select a valid lame executable. "
 					"Otherwise you can go back to the audio format selection and select another format."),
-				wxT("lame not found"), 
+				wxT("lame not found"),
 				wxOK | wxICON_EXCLAMATION
 			);
 		msgDialog->ShowModal();
 		return;
 	}
-	
+
 	switchPage(new ProcessPage(_configuration));
 }
 
@@ -1279,7 +1268,7 @@
 	_gauge = new wxGauge(panel, wxID_ANY, _output.total, wxDefaultPosition, wxDefaultSize,
 		wxGA_HORIZONTAL, wxDefaultValidator, wxT("ProgressBar"));
 	sizer->Add(_gauge, wxSizerFlags(0).Expand().Border(wxBOTTOM | wxLEFT | wxRIGHT, 10));
-	
+
 	_finishText = new wxStaticText(panel, wxID_ANY, wxString());
 	sizer->Add(_finishText, wxSizerFlags().Expand().Border(wxLEFT, 20));
 
@@ -1527,6 +1516,8 @@
 	displayOut->SetValue(true);
 	sizer->Add(displayOut);
 
+	sizer->AddSpacer(10);
+
 	wxCheckBox *processOther = new wxCheckBox(panel, wxID_ANY, wxT("Process another file"), wxDefaultPosition, wxDefaultSize,
 		0, wxDefaultValidator, wxT("ProcessOther"));
 	processOther->SetValue(false);
@@ -1537,7 +1528,8 @@
 	return panel;
 }
 
-void FinishPage::onNext(wxWindow *panel) {
+bool FinishPage::onCancel(wxWindow *panel) {
+	// On that page, that's the Finish button
 	wxCheckBox *display = static_cast<wxCheckBox *>(panel->FindWindowByName(wxT("DisplayOutput")));
 	if (display->GetValue()) {
 		// There is no standard way to do this
@@ -1551,10 +1543,13 @@
 	}
 
 	wxCheckBox *restart = static_cast<wxCheckBox *>(panel->FindWindowByName(wxT("ProcessOther")));
-	if (restart->GetValue())
+	if (restart->GetValue()) {
 		_topframe->switchToFirstPage();
-	else
+		return false;
+	} else {
 		_topframe->Close(true);
+		return true;
+	}
 }
 
 wxString FinishPage::getHelp() {
@@ -1562,9 +1557,8 @@
 }
 
 void FinishPage::updateButtons(wxWindow *panel, WizardButtons *buttons) {
-	buttons->enablePrevious(false);
+	buttons->showNavigation(false);
 	buttons->showFinish(true);
-	buttons->enableCancel(false);
 
 	WizardPage::updateButtons(panel, buttons);
 }
@@ -1598,18 +1592,21 @@
 	return panel;
 }
 
-void FailurePage::onNext(wxWindow *panel) {
+bool FailurePage::onCancel(wxWindow *panel) {
+	// On that page, that's the Finish button
 	wxCheckBox *restart = static_cast<wxCheckBox *>(panel->FindWindowByName(wxT("ProcessOther")));
-	if (restart->GetValue())
+	if (restart->GetValue()) {
 		_topframe->switchToFirstPage();
-	else
+		return false;
+	} else {
 		_topframe->Close(true);
+		return true;
+	}
 }
 
 void FailurePage::updateButtons(wxWindow *panel, WizardButtons *buttons) {
-	buttons->enablePrevious(false);
+	buttons->showNavigation(false);
 	buttons->showFinish(true);
-	buttons->enableCancel(false);
 
 	WizardPage::updateButtons(panel, buttons);
 }

Modified: tools/branches/gsoc2010-decompiler/gui/pages.h
===================================================================
--- tools/branches/gsoc2010-decompiler/gui/pages.h	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/gui/pages.h	2010-08-08 11:43:26 UTC (rev 51929)
@@ -323,6 +323,17 @@
 	 * @param panel The panel to operate on
 	 */
 	void updateFields(wxWindow *panel);
+
+private:
+	wxFlexGridSizer* _gridSizer;
+	wxStaticText* _vbrMinBitrateLabel;
+	wxChoice* _vbrMinBitrate;
+	wxStaticText* _vbrMaxBitrateLabel;
+	wxChoice* _vbrMaxBitrate;
+	wxStaticText* _vbrQualityLabel;
+	wxChoice* _vbrQuality;
+	wxStaticText* _abrAvgBitrateLabel;
+	wxChoice* _abrAvgBitrate;
 };
 
 /**
@@ -492,7 +503,7 @@
 
 	wxString getHelp();
 
-	void onNext(wxWindow *panel);
+	bool onCancel(wxWindow *panel);
 
 	void updateButtons(wxWindow *panel, WizardButtons *buttons);
 };
@@ -508,7 +519,7 @@
 
 	wxWindow *CreatePanel(wxWindow *parent);
 
-	void onNext(wxWindow *panel);
+	bool onCancel(wxWindow *panel);
 
 	void updateButtons(wxWindow *panel, WizardButtons *buttons);
 };

Modified: tools/branches/gsoc2010-decompiler/sci/sfx/doc/patch001.txt
===================================================================
--- tools/branches/gsoc2010-decompiler/sci/sfx/doc/patch001.txt	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/sci/sfx/doc/patch001.txt	2010-08-08 11:43:26 UTC (rev 51929)
@@ -17,12 +17,12 @@
  0x016  20       ASCII String for MT-32 Display (" CAMELOT, CAMELOT!  ")
  0x02a  20       ASCII String for MT-32 Display ("Ham & Jam & SpamAlot")
  0x03e   2  word MT-32 Master Volume
- 0x040   1       Index in Predefined reverb settings at 0x04c (0-10) 
+ 0x040   1       Index in Predefined reverb settings at 0x04c (0-10)
  0x041  11       MT-32 SysEx block setting reverb
                  (last 3 bytes are dummies)
  0x04c   3       Predefined reverb setting #1 (Mode, Time, Level)
    :     :       :
- 0x06a   3       Predefined reverb setting #11 
+ 0x06a   3       Predefined reverb setting #11
  0x06d   8       MT-32 Patch Memory #1 (see Patch Memory description below)
    :     :       :
  0x1e5   8       MT-32 Patch Memory #48
@@ -31,7 +31,7 @@
 
 
   Patch Memory description
-  
+
   Offset Description
   --------------------------------------------------------------------
    0x00  Timbre Group (0 = Bank A, 1 = Bank B, 2 = Memory, 3 = Rythm)
@@ -46,7 +46,7 @@
 
    Mapping MT-32 to GM instruments is done with Timbre Group and
    Timbre Number.
-   
+
    Instrument 0-63:   Bank A, 0-63
    Instrument 64-127: Bank B, 0-63
 
@@ -62,7 +62,7 @@
 
 
   Timbre Memory description
-   
+
   Offset Size Description
   -----------------------------------------------------------------------
    0x00   10  Timbre Name (ASCII String)
@@ -86,14 +86,14 @@
    System Area - Partial Reserve, offset relative to 0x370 + n * 246
 
 Offset Size Description
----------------------------------------------------     
+---------------------------------------------------
  0x000   2  0xdc 0xba (if this this is not present
                        this block is non existent)
  0x002   4  Rythm Setup for Key #24 (see below)
-   :     :  :     
+   :     :  :
  0x0fe   4  Rythm Setup for Key #87
  0x102   9  System Area - Partial Reserve
----------------------------------------------------     
+---------------------------------------------------
 
   Rythm Setup description
   See http://members.xoom.com/_XMCM/TomLewandowski/lapc1.txt

Modified: tools/branches/gsoc2010-decompiler/sci/sfx/doc/sound01.txt
===================================================================
--- tools/branches/gsoc2010-decompiler/sci/sfx/doc/sound01.txt	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/sci/sfx/doc/sound01.txt	2010-08-08 11:43:26 UTC (rev 51929)
@@ -9,10 +9,10 @@
 Christmas greeting card 1990 (CC1990)
 
 The magic number (84 00) is left out, offset 0 is directly after these two
-bytes. 
+bytes.
 
 If you examine a SCI01 sound resource use "sciunpack --without-header" to
-get the pointers within the file correct for your hex viewer. 
+get the pointers within the file correct for your hex viewer.
 
 DESCRIPTION
 -----------
@@ -20,7 +20,7 @@
 The SCI01 sound resource consists of a number of track lists and the
 tracks themselves. There is one track list for (almost) every piece of
 sound hardware supported by the game. Each track either contains track
-data for one specific channel or a digital sample. 
+data for one specific channel or a digital sample.
 
 SCI1 resources are the same, except that sample chunks are no longer
 allowed (since they are now separate resources).
@@ -112,7 +112,7 @@
     This chunk begins with a 2 byte header. The low nibble of the
     first byte indicates the channel number. The high nibble controls
     certain aspects of (dynamic) track channel/hardware channel mapping.
-    
+
     The second byte tells us how many notes will be
     playing simultaneously in the channel. From the third byte onward
     is the MIDI track data which looks just like normal SCI0 MIDI
@@ -128,7 +128,7 @@
  0001     00 Track list continuation
  0002     00 Same hardware device
  0003   003F Data Chunk pointer (Little Endian)
- 0005   0013 Data Chunk length (LE)  
+ 0005   0013 Data Chunk length (LE)
  0007     00 Track list continuation
  0008     00 Same hardware device
  0009   006A Data Chunk pointer (LE)
@@ -176,7 +176,7 @@
  0041        MIDI Track data like SCI0
  0052     02 MIDI Track channel 2
  0053     02 Two notes playing on track
- 0054        MIDI Track data like SCI0 
+ 0054        MIDI Track data like SCI0
  006A	  03 MIDI Track channel 3
  006B	  01 One note playing on track
  006C	     MIDI Track data like SCI0
@@ -195,7 +195,7 @@
 
 Absolute cues are generally stored in the signal selector, and
 cumulative cues are generally stored in the dataInc selector, with
-some interesting twists: 
+some interesting twists:
 
 1. The server's record of the absolute cue value is reset as part of
    UPDATE_CUES.

Modified: tools/branches/gsoc2010-decompiler/scummvm-tools-cli.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/scummvm-tools-cli.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/scummvm-tools-cli.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -77,7 +77,7 @@
 					return 2;
 				}
 			}
-			std::cout << std::endl << "Unknown help topic '" << arguments[1] << "'" << std::endl;
+			std::cout << std::endl << "Unknown help topic '" << arguments[0] << "'" << std::endl;
 		}
 		printHelp(argv[0]);
 		return 2;

Modified: tools/branches/gsoc2010-decompiler/tools.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/tools.cpp	2010-08-08 03:33:44 UTC (rev 51928)
+++ tools/branches/gsoc2010-decompiler/tools.cpp	2010-08-08 11:43:26 UTC (rev 51929)
@@ -55,7 +55,6 @@
 #include "engines/scumm/extract_mm_nes.h"
 #include "engines/parallaction/extract_parallaction.h"
 #include "engines/scumm/extract_scumm_mac.h"
-#include "engines/groovie/extract_t7g_mac.h"
 #include "engines/scumm/extract_zak_c64.h"
 
 Tools::Tools() {
@@ -90,7 +89,6 @@
 	_tools.push_back(new ExtractMMNes());
 	_tools.push_back(new ExtractParallaction());
 	_tools.push_back(new ExtractScummMac());
-	_tools.push_back(new ExtractT7GMac());
 	_tools.push_back(new ExtractZakC64());
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list