[Scummvm-cvs-logs] SF.net SVN: scummvm:[46751] tools/trunk
jvprat at users.sourceforge.net
jvprat at users.sourceforge.net
Wed Dec 30 16:34:00 CET 2009
Revision: 46751
http://scummvm.svn.sourceforge.net/scummvm/?rev=46751&view=rev
Author: jvprat
Date: 2009-12-30 15:34:00 +0000 (Wed, 30 Dec 2009)
Log Message:
-----------
TOOLS: Whitespace cleanup
Modified Paths:
--------------
tools/trunk/Makefile
tools/trunk/Makefile.common
tools/trunk/README
tools/trunk/TODO
tools/trunk/common/file.cpp
tools/trunk/common/file.h
tools/trunk/compress.cpp
tools/trunk/compress.h
tools/trunk/configure
tools/trunk/create_sjisfnt.cpp
tools/trunk/encode_dxa.cpp
tools/trunk/engines/agos/compress_agos.cpp
tools/trunk/engines/agos/extract_agos.cpp
tools/trunk/engines/cine/decine.cpp
tools/trunk/engines/cine/extract_cine.cpp
tools/trunk/engines/cruise/extract_cruise_pc.cpp
tools/trunk/engines/gob/compress_gob.cpp
tools/trunk/engines/gob/compress_gob.h
tools/trunk/engines/gob/extract_gob_stk.cpp
tools/trunk/engines/groovie/extract_t7g_mac.cpp
tools/trunk/engines/kyra/extract_kyra.cpp
tools/trunk/engines/kyra/extract_kyra.h
tools/trunk/engines/mohawk/deriven.cpp
tools/trunk/engines/mohawk/extract_mohawk.cpp
tools/trunk/engines/mohawk/mohawk_file.cpp
tools/trunk/engines/mohawk/mohawk_file.h
tools/trunk/engines/parallaction/extract_parallaction.cpp
tools/trunk/engines/parallaction/extract_parallaction.h
tools/trunk/engines/queen/compress_queen.cpp
tools/trunk/engines/saga/compress_saga.cpp
tools/trunk/engines/saga/compress_saga.h
tools/trunk/engines/scumm/compress_scumm_bun.cpp
tools/trunk/engines/scumm/compress_scumm_san.cpp
tools/trunk/engines/scumm/descumm-tool.cpp
tools/trunk/engines/scumm/descumm.cpp
tools/trunk/engines/scumm/descumm6.cpp
tools/trunk/engines/scumm/extract_mm_apple.cpp
tools/trunk/engines/scumm/extract_mm_c64.cpp
tools/trunk/engines/scumm/extract_mm_nes.cpp
tools/trunk/engines/scumm/extract_scumm_mac.cpp
tools/trunk/engines/scumm/extract_scumm_mac.h
tools/trunk/engines/scumm/extract_zak_c64.cpp
tools/trunk/engines/sword1/compress_sword1.cpp
tools/trunk/engines/sword2/compress_sword2.cpp
tools/trunk/engines/sword2/compress_sword2.h
tools/trunk/engines/tinsel/compress_tinsel.cpp
tools/trunk/engines/tucker/compress_tucker.cpp
tools/trunk/example_tool.cpp
tools/trunk/gui/configuration.cpp
tools/trunk/gui/configuration.h
tools/trunk/gui/gui_tools.cpp
tools/trunk/gui/gui_tools.h
tools/trunk/gui/main.cpp
tools/trunk/gui/main.h
tools/trunk/gui/pages.cpp
tools/trunk/gui/pages.h
tools/trunk/scummvm-tools-cli.cpp
tools/trunk/tool.cpp
tools/trunk/tool.h
tools/trunk/tool_exception.h
tools/trunk/tools.cpp
tools/trunk/tools.h
Modified: tools/trunk/Makefile
===================================================================
--- tools/trunk/Makefile 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/Makefile 2009-12-30 15:34:00 UTC (rev 46751)
@@ -17,7 +17,7 @@
MODULES :=
MODULE_DIRS :=
-STANDALONE :=
+STANDALONE :=
# This one will go away once all tools are converted
NO_MAIN := -DEXPORT_MAIN
@@ -34,10 +34,10 @@
#CXXFLAGS+= -pedantic # -pedantic is too pedantic, at least on Mac OS X
CXXFLAGS+= -Wpointer-arith -Wcast-align
CXXFLAGS+= -Wshadow -Wimplicit -Wundef -Wnon-virtual-dtor -Wwrite-strings
-
+
# Enable checking of pointers returned by "new"
CXXFLAGS+= -fcheck-new
-
+
# There is a nice extra warning that flags variables that are potentially
# used before being initialized. Very handy to catch a certain kind of
# bugs. Unfortunately, it only works when optimizations are turned on,
Modified: tools/trunk/Makefile.common
===================================================================
--- tools/trunk/Makefile.common 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/Makefile.common 2009-12-30 15:34:00 UTC (rev 46751)
@@ -18,7 +18,7 @@
#MODULES := test tools base $(MODULES)
-# HACK: Until we get proper module support, add these "module dirs" to
+# HACK: Until we get proper module support, add these "module dirs" to
# get the dependency tracking code working.
MODULE_DIRS := ./ common/ gui/ sound/
Modified: tools/trunk/README
===================================================================
--- tools/trunk/README 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/README 2009-12-30 15:34:00 UTC (rev 46751)
@@ -14,7 +14,7 @@
extract_agos
Extracts the packed files used in the Amiga and AtariST
versions of Elvira 1/2, Waxworks and Simon the Sorcerer 1.
-
+
Example of usage:
extract_agos <infile 1> ... <infile n>
@@ -35,25 +35,25 @@
all WESTWOOD.### files for that, since they are one big package
file splitted into several, so with -x you will extract *all*
files from the installer files.
-
+
Takes some additional arguments, run extract_kyra --help for
details.
-
+
Example of usage:
extract_kyra -x [-o outputdir] <infile>
-
+
extract_loom_tg16
Extracts data files from the PC-Engine version of Loom.
Use the dumpcd utility at http://www.zeograd.com/misc_download.php
to dump the code tracks on the CD.
-
+
Example of usage:
extract_loom_tg16 [-o outputdir] <infile>
extract_mm_apple
Extracts data files from the Apple II version of Maniac
Mansion.
-
+
Example of usage:
extract_mm_apple [-o outputdir] <disk1.dsk> <disk2.dsk>
@@ -67,7 +67,7 @@
extract_mm_nes
Extracts data files from the NES version of Maniac Mansion.
Japanese version is _not_ supported.
-
+
Example of usage:
extract_mm_nes [-o outputdir] <infile.PRG>
@@ -76,7 +76,7 @@
Example of usage:
extract_parallaction [--small] [-o outputdir] <infile>
-
+
extract_scumm_mac
Extracts Macintosh "single file" SCUMM games into their
component parts, for use with ScummVM.
@@ -104,18 +104,18 @@
Compression Tools:
All compression tools work on the general format
compress [mode] [mode params] [-o output] <infile>
- mode is either --mp3, --vorbis or --flac, the specifci mode params
+ mode is either --mp3, --vorbis or --flac, the specifci mode params
can be found by running the tool with --help.
output and input are for some tools a directory, for some a file.
-
+
compress_agos
Used to compress the Feeble Files or Simon the Sorcerer 1/2
voc/wav files to MP3, Vorbis or FLAC.
Example of usage:
compress_agos [mode params] [--mac] [-o outputfile] <infile>
-
+
Specify --mac for the mac version (obviously).
Default output is input with changed extension.
@@ -141,12 +141,12 @@
Example of usage:
compress_queen [mode params] [-o outputfile] queen.1
-
+
Default output file is "queen.1c"
compress_saga
Used to compress SAGA engine digital sound files to MP3, Vorbis
- or FLAC.
+ or FLAC.
Example of usage:
compress_saga [mode params] [-o outputfile] <infile>
@@ -155,14 +155,14 @@
extension.
Default output file is input file with the extensions ".cmp"
- For Inherit the Earth, the digital music (music.rsc), speech
+ For Inherit the Earth, the digital music (music.rsc), speech
(voices.rsc or "inherit the earth voices") and sound effects
- (sounds.rsc) files can be compressed. For I have no mouth, the
+ (sounds.rsc) files can be compressed. For I have no mouth, the
speech (voices*.res) files can be compressed.
-
- The compressed files have the ".cmp" extension. Once compressed,
- you only need the respective .cmp files.
-
+
+ The compressed files have the ".cmp" extension. Once compressed,
+ you only need the respective .cmp files.
+
There is no compression support yet for the following versions:
- The Mac CD Guild version of Inherit the Earth (uses MacBinary
*.bin files)
@@ -174,7 +174,7 @@
Example of usage:
compress_scumm_bun [mode params] [-o outputfile] <infile>
-
+
Default outputfile is inputfile with the extension ".bun"
Please note that FLAC compression will produce larger files
@@ -184,10 +184,10 @@
Compresses '.san' smush animation files. It uses lossless
zlib for compressing FOBJ gfx chunks inside a san file.
It also can create a separate Ogg file with the audio track.
-
+
Example of usage:
compress_scumm_san [mode params] [-o outputfile] <infile>
-
+
Default output is inputfile with the extension ".san"
In order to use such compressed files, your ScummVM binary
@@ -210,7 +210,7 @@
Example of usage:
compress_scumm_sou [mode params] [-o outpufile] <infile>
-
+
Default output file is inputfile with changed extensions,
depends on the compression method used.
@@ -242,7 +242,7 @@
Example of usage:
compress_touche [mode params] [-o outputfile] <infile>
-
+
Default outpufile is infile with modified extension (depends
on compression method).
@@ -259,7 +259,7 @@
Should work at least with Future Wars and Operation Stealth.
Example of usage:
- decine [type] [version] [filename]
+ decine [type] [version] [filename]
type: -prc or -rel (Use -prc for *.prc-files, -rel for *.rel-files)
version: -v1 or -v2 (Use -v1 for Future Wars, -v2 for Operation Stealth)
filename: The name of the script file to decode
Modified: tools/trunk/TODO
===================================================================
--- tools/trunk/TODO 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/TODO 2009-12-30 15:34:00 UTC (rev 46751)
@@ -9,7 +9,7 @@
------------
* Default Options
- - Things like default games path, default LAME path, default compression
+ - Things like default games path, default LAME path, default compression
type, etc. could be added to a menu and saved to an *.ini file.
* Batch Processing
- Batch processing can be performed by holding a list of jobs to done in
Modified: tools/trunk/common/file.cpp
===================================================================
--- tools/trunk/common/file.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/common/file.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -79,7 +79,7 @@
return getFullName().size() == 0;
}
-bool Filename::exists() const {
+bool Filename::exists() const {
// This fails if we don't have permission to read the file
// but in most cases, that's the same thing for us.
FILE *f = fopen(_path.c_str(), "r");
@@ -203,7 +203,7 @@
}
void File::open(const Filename &filepath, const char *mode) {
-
+
// Clean up previously opened file
close();
@@ -239,7 +239,7 @@
}
int File::readChar() {
- if (!_file)
+ if (!_file)
throw FileException("File is not open");
if ((_mode & FILEMODE_READ) == 0)
throw FileException("Tried to read from file opened in write mode (" + _name.getFullPath() + ")");
@@ -327,7 +327,7 @@
}
size_t File::read_noThrow(void *dataPtr, size_t dataSize) {
- if (!_file)
+ if (!_file)
throw FileException("File is not open");
if ((_mode & FILEMODE_READ) == 0)
throw FileException("Tried to read from file opened in write mode (" + _name.getFullPath() + ")");
@@ -336,7 +336,7 @@
}
std::string File::readString() {
- if (!_file)
+ if (!_file)
throw FileException("File is not open");
if ((_mode & FILEMODE_READ) == 0)
throw FileException("Tried to read from file opened in write mode (" + _name.getFullPath() + ")");
@@ -355,7 +355,7 @@
}
std::string File::readString(size_t len) {
- if (!_file)
+ if (!_file)
throw FileException("File is not open");
if ((_mode & FILEMODE_READ) == 0)
throw FileException("Tried to read from file opened in write mode (" + _name.getFullPath() + ")");
@@ -372,7 +372,7 @@
}
void File::scanString(char *result) {
- if (!_file)
+ if (!_file)
throw FileException("File is not open");
if ((_mode & FILEMODE_READ) == 0)
throw FileException("Tried to write to file opened in read mode (" + _name.getFullPath() + ")");
@@ -381,7 +381,7 @@
}
void File::writeChar(int i) {
- if (!_file)
+ if (!_file)
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() + ")");
@@ -421,7 +421,7 @@
}
size_t File::write(const void *dataPtr, size_t dataSize) {
- if (!_file)
+ if (!_file)
throw FileException("File is not open");
if ((_mode & FILEMODE_WRITE) == 0)
throw FileException("Tried to write to file opened in read mode (" + _name.getFullPath() + ")");
@@ -436,7 +436,7 @@
}
void File::print(const char *format, ...) {
- if (!_file)
+ if (!_file)
throw FileException("File is not open");
if ((_mode & FILEMODE_WRITE) == 0)
throw FileException("Tried to write to file opened in read mode (" + _name.getFullPath() + ")");
@@ -450,7 +450,7 @@
}
void File::seek(long offset, int origin) {
- if (!_file)
+ if (!_file)
throw FileException("File is not open");
if (fseek(_file, offset, origin) != 0)
Modified: tools/trunk/common/file.h
===================================================================
--- tools/trunk/common/file.h 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/common/file.h 2009-12-30 15:34:00 UTC (rev 46751)
@@ -36,7 +36,7 @@
* Usually premature end, or that it could not be opened (write / read protected).
*/
class FileException : public ToolException {
-public:
+public:
FileException(std::string error, int retcode = -1) : ToolException(error, retcode) {}
};
@@ -57,7 +57,7 @@
inline bool operator==(const Filename &fn){
return equals(fn);
}
-
+
/**
* Change the entire path including directory, volume and actual filname.
*
@@ -118,8 +118,8 @@
* @return True if they are equal.
*/
bool equals(const Filename &other) const;
-
+
/**
* Returns the entire path.
*/
@@ -205,7 +205,7 @@
* "read" and "write" methods
*/
void setXorMode(uint8 xormode);
-
+
/**
* Reads a single character (equivalent of fgetc).
*/
@@ -235,7 +235,7 @@
* @throws FileException if file is not open / if read failed.
*/
uint32 readUint32LE();
-
+
/**
* Read a single 16-bit word, big endian.
* @throws FileException if file is not open / if read failed.
@@ -291,7 +291,7 @@
* @return the data read
*/
std::string readString(size_t len);
-
+
/**
* Reads a string, using until NULL or EOF or CR/LF.
* @throws FileException if file is not open / if read failed.
Modified: tools/trunk/compress.cpp
===================================================================
--- tools/trunk/compress.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/compress.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -944,7 +944,7 @@
std::string CompressionTool::getHelp() const {
std::ostringstream os;
-
+
// Standard help text + our additions
os << Tool::getHelp();
Modified: tools/trunk/compress.h
===================================================================
--- tools/trunk/compress.h 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/compress.h 2009-12-30 15:34:00 UTC (rev 46751)
@@ -49,7 +49,7 @@
-/**
+/**
* Different audio formats.
* You can bitwise them to represent several formats.
*/
Modified: tools/trunk/configure
===================================================================
--- tools/trunk/configure 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/configure 2009-12-30 15:34:00 UTC (rev 46751)
@@ -431,7 +431,7 @@
#
# Determine extension used for executables
#
-get_system_exe_extension $_host_os
+get_system_exe_extension $_host_os
HOSTEXEEXT=$_exeext
SEPARATOR=":"
@@ -549,7 +549,7 @@
;;
esac
;;
- *)
+ *)
cxx_version="$cxx_version, bad"
cxx_verc_fail=yes
;;
@@ -1085,7 +1085,7 @@
if test "$have_gcc" = yes ; then
if test "$_cxx_major" -ge "3" ; then
case $_host_os in
- # newlib-based system include files suppress non-C89 function
+ # newlib-based system include files suppress non-C89 function
# declarations under __STRICT_ANSI__
mingw* | amigaos*)
CXXFLAGS="$CXXFLAGS -W -Wno-unused-parameter"
Modified: tools/trunk/create_sjisfnt.cpp
===================================================================
--- tools/trunk/create_sjisfnt.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/create_sjisfnt.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -353,7 +353,7 @@
// before a character, we filter that out over here.
if (ret == 0x0000FEFF)
ret = *(uint32 *)(outBuf + 4);
-
+
return ret;
}
@@ -414,7 +414,7 @@
// that means unused, valid SJIS character codes.
//
// It might be useful to enable that warning again to detect problems with
- // iconv though. An example for such an iconv problem is the
+ // iconv though. An example for such an iconv problem is the
// "FULLWIDTH APOSTROPHE", which iconv refuses to convert to UTF-32.
//warning("Conversion error on: %.2X %.02X", fB, sB);
return false;
Modified: tools/trunk/encode_dxa.cpp
===================================================================
--- tools/trunk/encode_dxa.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/encode_dxa.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -392,7 +392,7 @@
byte subMot[4], subData[16];
int subMotSize = 0, subDataSize = 0;
- static const int subX[4] = {0, 2, 0, 2};
+ static const int subX[4] = {0, 2, 0, 2};
static const int subY[4] = {0, 0, 2, 2};
/* 0: skip
@@ -538,15 +538,15 @@
}
EncodeDXA::EncodeDXA(const std::string &name) : CompressionTool(name, TOOLTYPE_COMPRESSION) {
-
+
ToolInput input;
input.format = "*.*";
_inputPaths.push_back(input);
_shorthelp = "Used to create DXA files from extracted Smacker archives.";
- _helptext =
+ _helptext =
"Usage: " + getName() + " [mode] [mode-params] [-o outpufile = inputfile.san] <inputfile>\n" +
- "Output will be two files, one with .dxa extension and the other depending on the used audio codec.";
+ "Output will be two files, one with .dxa extension and the other depending on the used audio codec.";
}
void EncodeDXA::execute() {
@@ -554,7 +554,7 @@
ScaleMode scaleMode;
Common::Filename inpath(_inputPaths[0].path);
Common::Filename outpath(_outputPath);
-
+
if (outpath.empty())
// Actual change of extension is done later...
outpath = inpath;
Modified: tools/trunk/engines/agos/compress_agos.cpp
===================================================================
--- tools/trunk/engines/agos/compress_agos.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/agos/compress_agos.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -32,7 +32,7 @@
_convertMac = false;
_outputToDirectory = false;
_supportsProgressBar = true;
-
+
ToolInput input;
input.format = "*.*";
_inputPaths.push_back(input);
Modified: tools/trunk/engines/agos/extract_agos.cpp
===================================================================
--- tools/trunk/engines/agos/extract_agos.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/agos/extract_agos.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -29,7 +29,7 @@
ExtractAgos::ExtractAgos(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION) {
_filelen = 0;
-
+
ToolInput input;
input.format = "*.*";
_inputPaths.push_back(input);
@@ -197,7 +197,7 @@
/**
* Saves N bytes from the buffer to the target file.
* Throws FileException on failure
- *
+ *
* @param name The name of the file to save to
* @param mem Where to get data from
* @param length How many bytes to write
Modified: tools/trunk/engines/cine/decine.cpp
===================================================================
--- tools/trunk/engines/cine/decine.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/cine/decine.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -147,7 +147,7 @@
printf("SET localvars[%d], %d", var, value);
} else {
uint8 num = fetchScriptByte();
- switch (type) {
+ switch (type) {
case 1:
printf("localvars[%d] = localvars[%d]", var, num);
break;
Modified: tools/trunk/engines/cine/extract_cine.cpp
===================================================================
--- tools/trunk/engines/cine/extract_cine.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/cine/extract_cine.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -43,13 +43,13 @@
////////////////////////////////////////////////////////////////////////////
ExtractCine::ExtractCine(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION) {
-
+
ToolInput input;
input.format = "*.*";
_inputPaths.push_back(input);
_shorthelp = "Used to unpack Delphine's Cinematique engine's archive files.";
- _helptext =
+ _helptext =
"Usage: " + getName() + " [params] [-o outputdir] <archivefile>\n" +
_shorthelp + "\n" +
"Supports using Operation Stealth's 'vol.cnf' file as input.\n";
@@ -187,7 +187,7 @@
Common::Filename outPath(_outputPath);
outPath.setFullName(fileName);
-
+
uint32 offset = file.readUint32BE();
unsigned int packedSize = file.readUint32BE();
unsigned int unpackedSize = file.readUint32BE();
@@ -270,7 +270,7 @@
uint8 *buf = (uint8 *)calloc(unpackedSize, 1);
assert(buf);
f.read_throwsOnError(buf, packedSize);
-
+
if (packedSize != unpackedSize) {
CineUnpacker cineUnpacker;
if (!cineUnpacker.unpack(buf, packedSize, buf, unpackedSize)) {
@@ -285,7 +285,7 @@
for (unsigned int i = 0; i < resourceFilesCount; ++i) {
memcpy(resourceFileName, &buf[4 + i * entrySize], 8);
resourceFileName[8] = 0;
-
+
Common::File fpResFile(resourceFileName, "rb");
print("--- Unpacking resource file %s:\n", resourceFileName);
unpackFile(fpResFile);
Modified: tools/trunk/engines/cruise/extract_cruise_pc.cpp
===================================================================
--- tools/trunk/engines/cruise/extract_cruise_pc.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/cruise/extract_cruise_pc.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -110,7 +110,7 @@
_parent[kHuffmanRoot] = 0;
}
int getHuffCode() {
- static const int base[] = { 0, 1, 4, 12, 24, 48 };
+ static const int base[] = { 0, 1, 4, 12, 24, 48 };
static const int count[] = { 0, 2, 5, 9, 12, 15 };
static const int length[] = { 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5 };
int index = _stream->getBits(8);
@@ -187,7 +187,7 @@
p = index;
}
p = _parent[p];
- } while (p != 0);
+ } while (p != 0);
}
bool decode() {
resetHuffTables();
Modified: tools/trunk/engines/gob/compress_gob.cpp
===================================================================
--- tools/trunk/engines/gob/compress_gob.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/gob/compress_gob.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -46,7 +46,7 @@
_inputPaths.push_back(input);
_shorthelp = "Compresses Gobliiins! data files.";
- _helptext =
+ _helptext =
"\nUsage: " + getName() + " [-o <output path>] [-f] <conf file>\n"
"<conf file> is a .gob file generated extract_gob_stk\n"
"<-f> forces compression for all files\n\n"
@@ -83,7 +83,7 @@
gobConf.close();
_outputPath.setFullName(inpath.getFullName());
-
+
stk.open(_outputPath, "wb");
// Output in compressed format
@@ -144,7 +144,7 @@
src1.open(srcName, "rb");
src1.seek(0, SEEK_END);
// if file is too small, force 'Store' method
- if ((curChunk->realSize = src1.pos()) < 8)
+ if ((curChunk->realSize = src1.pos()) < 8)
curChunk->packed = 0;
parseChunk = chunks;
@@ -164,7 +164,7 @@
parseChunk = parseChunk->next;
}
src1.close();
-
+
gobConf.scanString(buffer);
if (!gobConf.eos()) {
@@ -182,7 +182,7 @@
*
* This function writes an empty header in the STK archive. This is required as
* the header length is variable and depends on the number of chunks to be written
- * in the archive file.
+ * in the archive file.
*
* This header will be overwritten just before the end of the program execution
*/
@@ -206,7 +206,7 @@
Chunk *curChunk = chunks;
Common::File src;
uint32 tmpSize;
-
+
while (curChunk) {
inpath->setFullName(curChunk->name);
src.open(*inpath, "rb");
@@ -226,7 +226,7 @@
} else
print("Compressing %12s\t%d -> %d bytes\n", curChunk->name, curChunk->realSize, curChunk->size);
- }
+ }
if (curChunk->packed == 0) {
tmpSize = 0;
@@ -242,7 +242,7 @@
* \param chunkCount Number of chunks
* \param chunks List of chunks
*
- * This function rewrites the header of the archive, replacing dummy values
+ * This function rewrites the header of the archive, replacing dummy values
* by the one computed during execution.
* The structure of the header is the following :
* + 2 bytes : numbers of files archived in the .stk/.itk
@@ -252,7 +252,7 @@
* + 4 bytes : size of the chunk
* + 4 bytes : start position of the chunk in the file
* + 1 byte : If 0 : not compressed, if 1 : compressed
- *
+ *
* The duplicate files are defined using the same information
* as the one of the replacement file.
*/
@@ -355,7 +355,7 @@
writeBuffer[3] = size >> 24;
stk.write(writeBuffer, 4);
-// Size is already checked : small files (less than 8 characters)
+// Size is already checked : small files (less than 8 characters)
// are not compressed, so copying the first three bytes is safe.
dicoIndex = 4078;
dico[dicoIndex] = unpacked[0];
@@ -409,7 +409,7 @@
counter -= resultchecklength;
}
-// The command byte is complete when the file is entirely compressed, or
+// The command byte is complete when the file is entirely compressed, or
// when the 8 operation bits are set.
if ((cpt == 7) | (counter == 0)) {
writeBuffer[0] = cmd;
@@ -431,19 +431,19 @@
* \param compChunk Chunk containing information on second file to be compared
* \return whether they are identical or not.
*
- * This function compares a file to another defined in a chunk. The file sizes
+ * This function compares a file to another defined in a chunk. The file sizes
* are already tested outside the function.
*/
bool CompressGob::filcmp(Common::File &src1, Common::Filename &stkName) {
uint16 readCount;
bool checkFl = true;
- char buf1[4096];
+ char buf1[4096];
char buf2[4096];
Common::File src2;
src1.rewind();
src2.open(stkName.getFullPath(), "rb");
-
+
do {
readCount = src1.read_noThrow(buf1, 4096);
src2.read_noThrow(buf2, 4096);
@@ -467,9 +467,9 @@
* \param length Length of the better match found, if any
* \return whether a match has been found or not or not.
*
- * This function search in the dictionary for matches with the characters still to be compressed.
+ * This function search in the dictionary for matches with the characters still to be compressed.
* 'A match' is when at least three characters of the buffer (comparing from the current 'read' position)
- * are found in the dictionary. The match lengths are limited to 18 characters, as the
+ * are found in the dictionary. The match lengths are limited to 18 characters, as the
* length (minus 3) is stored on 4 bits.
*/
bool CompressGob::checkDico(byte *unpacked, uint32 unpackedIndex, int32 counter, byte *dico, uint16 currIndex, uint16 &pos, uint8 &length) {
@@ -485,7 +485,7 @@
for (tmpPos = 0; tmpPos < 0x1000; tmpPos++) {
tmpLength = 0;
for (i = 0; ((i < 18) & (i < counter)); i++)
- if ((unpacked[unpackedIndex + i] == dico[(tmpPos + i) % 4096]) &
+ if ((unpacked[unpackedIndex + i] == dico[(tmpPos + i) % 4096]) &
// avoid dictionary collision
(((tmpPos + i) % 4096 != currIndex) | (i == 0)))
tmpLength++;
Modified: tools/trunk/engines/gob/compress_gob.h
===================================================================
--- tools/trunk/engines/gob/compress_gob.h 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/gob/compress_gob.h 2009-12-30 15:34:00 UTC (rev 46751)
@@ -44,7 +44,7 @@
protected:
struct Chunk;
-
+
uint8 _execMode;
Chunk *_chunks;
Modified: tools/trunk/engines/gob/extract_gob_stk.cpp
===================================================================
--- tools/trunk/engines/gob/extract_gob_stk.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/gob/extract_gob_stk.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -43,7 +43,7 @@
ExtractGobStk::ExtractGobStk(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION) {
_chunks = NULL;
-
+
ToolInput input;
input.format = "*.stk";
_inputPaths.push_back(input);
@@ -378,7 +378,7 @@
newCounter -= 2;
// The 6 first bytes are grouped by 2 :
-// - bytes 0&1 : if set to 0xFFFF, the real size is in bytes 2&3. Else : unknown
+// - bytes 0&1 : if set to 0xFFFF, the real size is in bytes 2&3. Else : unknown
// - bytes 2&3 : Either the real size or 0x007D. Directly related to the size of the file.
// - bytes 4&5 : 0x0000 (files are small) ;)
if (dummy1 == 0xFFFF)
Modified: tools/trunk/engines/groovie/extract_t7g_mac.cpp
===================================================================
--- tools/trunk/engines/groovie/extract_t7g_mac.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/groovie/extract_t7g_mac.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -31,13 +31,13 @@
static uint32 offsetResourceData;
ExtractT7GMac::ExtractT7GMac(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION) {
-
+
ToolInput input;
input.format = "*.*";
_inputPaths.push_back(input);
_shorthelp = "Extract data files from the The 7th Guest Macintosh data file.";
- _helptext =
+ _helptext =
"Usage: " + getName() + " [params] [-o outputdir] <archivefile>\n" +
_shorthelp + "\n";
}
@@ -57,7 +57,7 @@
// Read the resource contents
byte *buf = new byte[fileSize];
-
+
try {
// Dump the resource to the output file
_outputPath.setFullName(name);
@@ -92,7 +92,7 @@
void ExtractT7GMac::execute() {
Common::File infile(_inputPaths[0].path, "rb");
-
+
if (_outputPath.empty())
_outputPath.setFullPath("./");
Modified: tools/trunk/engines/kyra/extract_kyra.cpp
===================================================================
--- tools/trunk/engines/kyra/extract_kyra.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/kyra/extract_kyra.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -32,13 +32,13 @@
isAmiga = false;
isHoFInstaller = false;
singleFilename = "";
-
+
ToolInput input;
input.format = "*.*";
_inputPaths.push_back(input);
_shorthelp = "Extract data files from the The Legend of Kyrandia series of games.";
- _helptext =
+ _helptext =
"Usage: " + getName() + " [-o output] [params] <archivefile>\n" +
_shorthelp + "\n" +
"Default output path is ./out/\n" +
Modified: tools/trunk/engines/kyra/extract_kyra.h
===================================================================
--- tools/trunk/engines/kyra/extract_kyra.h 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/kyra/extract_kyra.h 2009-12-30 15:34:00 UTC (rev 46751)
@@ -32,7 +32,7 @@
ExtractKyra(const std::string &name = "extract_kyra");
virtual void execute();
-
+
void parseExtraArguments();
bool extractAll, extractOne, isAmiga, isHoFInstaller;
Modified: tools/trunk/engines/mohawk/deriven.cpp
===================================================================
--- tools/trunk/engines/mohawk/deriven.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/mohawk/deriven.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -95,26 +95,26 @@
Common::StringList getNameList(MohawkFile *mohawkFile, uint16 id) {
MohawkOutputStream nameResource = mohawkFile->getRawData(ID_NAME, id);
Common::StringList nameList;
-
+
uint16 namesCount = nameResource.stream->readUint16BE();
uint16 *stringOffsets = new uint16[namesCount];
for (uint16 i = 0; i < namesCount; i++)
stringOffsets[i] = nameResource.stream->readUint16BE();
nameResource.stream->seek(namesCount * 2, SEEK_CUR);
int32 curNamesPos = nameResource.stream->pos();
-
+
for (uint32 i = 0; i < namesCount; i++) {
nameResource.stream->seek(curNamesPos + stringOffsets[i]);
-
+
Common::String name = Common::String::emptyString;
for (char c = nameResource.stream->readByte(); c; c = nameResource.stream->readByte())
name += c;
nameList.push_back(name);
}
-
+
delete nameResource.stream;
delete[] stringOffsets;
-
+
return nameList;
}
@@ -125,10 +125,10 @@
void dumpCommands(Common::SeekableReadStream *script, Common::StringList varNames, Common::StringList exNames, byte tabs) {
uint16 commandCount = script->readUint16BE();
-
+
for (uint16 i = 0; i < commandCount; i++) {
uint16 command = script->readUint16BE();
-
+
if (command == 8) { // "Switch" Statement
if (script->readUint16BE() != 2)
warning ("if-then-else unknown value is not 2");
@@ -137,7 +137,7 @@
uint16 logicBlockCount = script->readUint16BE();
for (uint16 j = 0; j < logicBlockCount; j++) {
uint16 varCheck = script->readUint16BE();
- printTabs(tabs + 1);
+ printTabs(tabs + 1);
if (varCheck == 0xFFFF)
printf("default:\n");
else
@@ -183,7 +183,7 @@
void dumpScript(Common::SeekableReadStream *script, Common::StringList varNames, Common::StringList exNames, byte tabs) {
uint16 scriptCount = script->readUint16BE();
-
+
for (uint16 i = 0; i < scriptCount; i++) {
printTabs(tabs); printf ("Stream Type %d:\n", script->readUint16BE());
dumpCommands(script, varNames, exNames, tabs + 1);
@@ -195,54 +195,54 @@
printUsage(argv[0]);
return 1;
}
-
+
FILE *file = fopen(argv[1], "rb");
if (!file) {
printf ("Could not open \'%s\'\n", argv[1]);
return 1;
}
-
+
// Open the file as a Mohawk archive
MohawkFile *mohawkFile = new MohawkFile();
mohawkFile->open(new Common::File(file));
-
+
// Load in Variable/External Command Names'
Common::StringList exNames = getNameList(mohawkFile, 3);
Common::StringList varNames = getNameList(mohawkFile, 4);
-
+
uint32 tag = READ_BE_UINT32(argv[2]);
uint32 cardId = (uint16)atoi(argv[3]);
-
+
if (tag == ID_CARD) {
printf("\n\nDumping scripts for card %d!\n", cardId);
printf("==================================\n\n");
-
+
MohawkOutputStream cardStream = mohawkFile->getRawData(ID_CARD, cardId);
cardStream.stream->readUint32BE(); // Skip first 4 bytes
-
+
dumpScript(cardStream.stream, varNames, exNames, 0);
-
+
delete cardStream.stream;
} else if (tag == ID_HSPT) {
printf("\n\nDumping scripts for card %d hotspots!\n", cardId);
printf("===========================================\n\n");
-
+
MohawkOutputStream hsptStream = mohawkFile->getRawData(ID_HSPT, cardId);
uint16 hotspotCount = hsptStream.stream->readUint16BE();
-
+
for (uint16 i = 0; i < hotspotCount; i++) {
printf("Hotspot %d:\n", i);
hsptStream.stream->seek(22, SEEK_CUR); // Skip non-script related stuff
dumpScript(hsptStream.stream, varNames, exNames, 1);
}
-
+
delete hsptStream.stream;
} else {
printf("That resource (if it exists) doesn't contain script data!\n");
}
-
+
exNames.clear();
varNames.clear();
-
+
return 0;
}
Modified: tools/trunk/engines/mohawk/extract_mohawk.cpp
===================================================================
--- tools/trunk/engines/mohawk/extract_mohawk.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/mohawk/extract_mohawk.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -45,38 +45,38 @@
assert(output.stream->readUint32BE() == ID_MHWK);
output.stream->readUint32BE(); // Skip size
assert(output.stream->readUint32BE() == ID_MIDI);
-
+
uint32 size = output.stream->size() - 12; // Skip MHWK header's size
-
+
byte *midiData = (byte *)malloc(size);
-
+
// Read the MThd Data
output.stream->read(midiData, 14);
-
+
// Skip the unknown Prg# section
assert(output.stream->readUint32BE() == ID_PRG);
output.stream->skip(output.stream->readUint32BE());
-
+
// Read the MTrk Data
uint32 mtrkSize = output.stream->size() - output.stream->pos();
output.stream->read(midiData + 14, mtrkSize);
-
+
// Change the extension to midi
output.name += ".mid";
-
+
printf ("Extracting \'%s\'...\n", output.name.c_str());
-
+
FILE *outputFile = fopen(output.name.c_str(), "wb");
if (!outputFile) {
printf ("Could not open file for output!\n");
free(midiData);
return;
}
-
+
// Output the data to the file.
fwrite(midiData, 1, 14 + mtrkSize, outputFile);
free(midiData);
-
+
fflush(outputFile);
fclose(outputFile);
}
@@ -88,43 +88,43 @@
sprintf(strBuf, "%s_%d", tag2str(output.tag), output.id);
output.name = strBuf;
}
-
+
// Intercept the sound tags
if (output.tag == ID_TWAV || output.tag == ID_MSND || output.tag == ID_SND) {
convertSoundResource(output);
return;
}
-
+
// Intercept the movie tag (need to change the offsets)
// TODO: Actually convert. Just dump for now.
if (output.tag == ID_TMOV) {
convertMovieResource(output);
//return;
}
-
+
// Intercept the MIDI tag (strip out Mohawk header/Prg# stuff)
if (output.tag == ID_TMID) {
convertMIDIResource(output);
return;
}
-
+
// TODO: Convert other resources? PICT/WDIB/tBMP?
-
+
assert(outputBuffer);
-
+
printf ("Extracting \'%s\'...\n", output.name.c_str());
-
+
FILE *outputFile = fopen(output.name.c_str(), "wb");
if (!outputFile) {
printf ("Could not open file for output!\n");
return;
}
-
+
while (output.stream->pos() < output.stream->size()) {
uint32 size = output.stream->read(outputBuffer, MAX_BUF_SIZE);
- fwrite(outputBuffer, 1, size, outputFile);
+ fwrite(outputBuffer, 1, size, outputFile);
}
-
+
fflush(outputFile);
fclose(outputFile);
}
@@ -134,13 +134,13 @@
printUsage(argv[0]);
return 1;
}
-
+
FILE *file = fopen(argv[1], "rb");
if (!file) {
printf ("Could not open \'%s\'\n", argv[1]);
return 1;
}
-
+
// Open the file as a Mohawk archive
MohawkFile *mohawkFile;
if(Common::String(argv[0]).hasSuffix("old"))
@@ -148,16 +148,16 @@
else
mohawkFile = new MohawkFile();
mohawkFile->open(new Common::File(file));
-
+
// Allocate a buffer for the output
outputBuffer = (byte *)malloc(MAX_BUF_SIZE);
-
+
if (argc > 3) {
uint32 tag = READ_BE_UINT32(argv[2]);
uint16 id = (uint16)atoi(argv[3]);
-
+
MohawkOutputStream output = mohawkFile->getRawData(tag, id);
-
+
if (output.stream) {
outputMohawkStream(output);
delete output.stream;
@@ -172,9 +172,9 @@
output = mohawkFile->getNextFile();
}
}
-
+
printf ("Done!\n");
-
+
free(outputBuffer);
return 0;
Modified: tools/trunk/engines/mohawk/mohawk_file.cpp
===================================================================
--- tools/trunk/engines/mohawk/mohawk_file.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/mohawk/mohawk_file.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -39,7 +39,7 @@
delete _mhk; _mhk = NULL;
delete[] _types; _types = NULL;
delete[] _fileTable; _fileTable = NULL;
-
+
_curFile = Common::String::emptyString;
}
@@ -66,7 +66,7 @@
/////////////////////////////////
//Resource Dir
- /////////////////////////////////
+ /////////////////////////////////
// Type Table
_mhk->seek(_rsrc.abs_offset);
@@ -95,12 +95,12 @@
debug (3, "Resources = %04x", _types[i].resTable.resources);
_types[i].resTable.entries = new Type::ResourceTable::Entries[_types[i].resTable.resources];
-
+
for (uint16 j = 0; j < _types[i].resTable.resources; j++) {
_types[i].resTable.entries[j].id = _mhk->readUint16BE();
_types[i].resTable.entries[j].index = _mhk->readUint16BE();
- debug (4, "Entry[%02x]: ID = %04x (%d) Index = %04x", j, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].index);
+ debug (4, "Entry[%02x]: ID = %04x (%d) Index = %04x", j, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].index);
}
// Name Table
@@ -110,7 +110,7 @@
debug (3, "Names = %04x", _types[i].nameTable.num);
_types[i].nameTable.entries = new Type::NameTable::Entries[_types[i].nameTable.num];
-
+
for (uint16 j = 0; j < _types[i].nameTable.num; j++) {
_types[i].nameTable.entries[j].offset = _mhk->readUint16BE();
_types[i].nameTable.entries[j].index = _mhk->readUint16BE();
@@ -141,14 +141,14 @@
_mhk->seek(_rsrc.abs_offset + _rsrc.file_table_offset);
_fileTableAmount = _mhk->readUint32BE();
_fileTable = new FileTable[_fileTableAmount];
-
+
for (uint32 i = 0; i < _fileTableAmount; i++) {
_fileTable[i].offset = _mhk->readUint32BE();
_fileTable[i].dataSize = _mhk->readUint16BE();
_fileTable[i].dataSize += _mhk->readByte() << 16; // Get bits 15-24 of dataSize too
_fileTable[i].flags = _mhk->readByte();
_fileTable[i].unk = _mhk->readUint16BE();
-
+
// Add in another 3 bits for file size from the flags.
// The flags are useless to us except for doing this ;)
_fileTable[i].dataSize += (_fileTable[i].flags & 7) << 24;
@@ -187,7 +187,7 @@
// Note: the fileTableIndex is based off 1, not 0. So, subtract 1
uint16 fileTableIndex = _types[typeIndex].resTable.entries[idIndex].index - 1;
-
+
// WORKAROUND: tMOV resources pretty much ignore the size part of the file table,
// as the original just passed the full Mohawk file to QuickTime and the offset.
// We need to do this because of the way Mohawk is set up (this is much more "proper"
@@ -200,7 +200,7 @@
} else
output.stream = new Common::SeekableSubReadStream(_mhk, _fileTable[fileTableIndex].offset, _fileTable[fileTableIndex].offset + _fileTable[fileTableIndex].dataSize);
output.tag = tag;
- output.id = id;
+ output.id = id;
if (_types[typeIndex].nameTable.num > 0)
output.name = _types[typeIndex].nameTable.entries[idIndex].name;
@@ -209,34 +209,34 @@
MohawkOutputStream MohawkFile::getNextFile() {
MohawkOutputStream output = { 0, 0, 0, "" };
-
+
if (_curExType >= _typeTable.resource_types) // No more!
return output;
-
+
if (_curExTypeIndex >= _types[_curExType].resTable.resources) {
_curExType++;
_curExTypeIndex = 0;
-
+
if (_curExType >= _typeTable.resource_types) // No more!
return output;
}
-
+
uint16 fileTableIndex = _types[_curExType].resTable.entries[_curExTypeIndex].index - 1;
-
+
// For some unknown reason, all tMOV resources have incorrect sizes. We correct this by getting the differences between offsets.
uint32 dataSize = 0;
if (_types[_curExType].tag == ID_TMOV)
dataSize = _fileTable[fileTableIndex + 1].offset - _fileTable[fileTableIndex].offset;
else
dataSize = _fileTable[fileTableIndex].dataSize;
-
+
output.stream = new Common::SeekableSubReadStream(_mhk, _fileTable[fileTableIndex].offset, _fileTable[fileTableIndex].offset + dataSize, false);
output.tag = _types[_curExType].tag;
output.id = _types[_curExType].resTable.entries[_curExTypeIndex].id;
-
+
if (_types[_curExType].nameTable.num > 0)
output.name = _types[_curExType].nameTable.entries[_curExTypeIndex].name;
-
+
_curExTypeIndex++;
return output;
}
@@ -244,48 +244,48 @@
void OldMohawkFile::open(Common::SeekableReadStream *stream) {
close();
_mhk = stream;
-
+
// This is for the "old" Mohawk resource format used in some older
// Living Books. It is very similar, just missing the MHWK tag and
// some other minor differences, especially with the file table
// being merged into the resource table.
-
+
uint32 headerSize = _mhk->readUint32BE();
-
+
// NOTE: There are differences besides endianness! (Subtle changes,
// but different).
-
+
if (headerSize == 6) { // We're in Big Endian mode (Macintosh)
_mhk->readUint16BE(); // Resource Table Size
_typeTable.resource_types = _mhk->readUint16BE();
_types = new OldType[_typeTable.resource_types];
-
+
debug (0, "Old Mohawk File (Macintosh): Number of Resource Types = %04x", _typeTable.resource_types);
-
+
for (uint16 i = 0; i < _typeTable.resource_types; i++) {
_types[i].tag = _mhk->readUint32BE();
_types[i].resource_table_offset = (uint16)_mhk->readUint32BE() + 6;
_mhk->readUint32BE(); // Unknown (always 0?)
-
+
debug (3, "Type[%02d]: Tag = \'%s\' ResTable Offset = %04x", i, tag2str(_types[i].tag), _types[i].resource_table_offset);
uint32 oldPos = _mhk->pos();
-
+
// Resource Table/File Table
_mhk->seek(_types[i].resource_table_offset);
_types[i].resTable.resources = _mhk->readUint16BE();
_types[i].resTable.entries = new OldType::ResourceTable::Entries[_types[i].resTable.resources];
-
+
for (uint16 j = 0; j < _types[i].resTable.resources; j++) {
_types[i].resTable.entries[j].id = _mhk->readUint16BE();
_types[i].resTable.entries[j].offset = _mhk->readUint32BE();
_types[i].resTable.entries[j].size = _mhk->readByte() << 16;
_types[i].resTable.entries[j].size += _mhk->readUint16BE();
_mhk->skip(5); // Unknown (always 0?)
-
+
debug (4, "Entry[%02x]: ID = %04x (%d)\tOffset = %08x, Size = %08x", j, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].offset, _types[i].resTable.entries[j].size);
}
-
+
_mhk->seek(oldPos);
debug (3, "\n");
}
@@ -293,32 +293,32 @@
_mhk->readUint16LE(); // Resource Table Size
_typeTable.resource_types = _mhk->readUint16LE();
_types = new OldType[_typeTable.resource_types];
-
+
debug (0, "Old Mohawk File (Windows): Number of Resource Types = %04x", _typeTable.resource_types);
-
+
for (uint16 i = 0; i < _typeTable.resource_types; i++) {
_types[i].tag = _mhk->readUint32LE();
_types[i].resource_table_offset = _mhk->readUint16LE() + 6;
_mhk->readUint16LE(); // Unknown (always 0?)
-
+
debug (3, "Type[%02d]: Tag = \'%s\' ResTable Offset = %04x", i, tag2str(_types[i].tag), _types[i].resource_table_offset);
-
+
uint32 oldPos = _mhk->pos();
-
+
// Resource Table/File Table
_mhk->seek(_types[i].resource_table_offset);
_types[i].resTable.resources = _mhk->readUint16LE();
_types[i].resTable.entries = new OldType::ResourceTable::Entries[_types[i].resTable.resources];
-
+
for (uint16 j = 0; j < _types[i].resTable.resources; j++) {
_types[i].resTable.entries[j].id = _mhk->readUint16LE();
_types[i].resTable.entries[j].offset = _mhk->readUint32LE();
_types[i].resTable.entries[j].size = _mhk->readUint16LE();
_mhk->readUint32LE(); // Unknown (always 0?)
-
- debug (4, "Entry[%02x]: ID = %04x (%d)\tOffset = %08x, Size = %08x", j, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].offset, _types[i].resTable.entries[j].size);
+
+ debug (4, "Entry[%02x]: ID = %04x (%d)\tOffset = %08x, Size = %08x", j, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].offset, _types[i].resTable.entries[j].size);
}
-
+
_mhk->seek(oldPos);
debug (3, "\n");
}
@@ -352,22 +352,22 @@
MohawkOutputStream OldMohawkFile::getNextFile() {
MohawkOutputStream output = { 0, 0, 0, "" };
-
+
if (_curExType >= _typeTable.resource_types) // No more!
return output;
-
+
if (_curExTypeIndex >= _types[_curExType].resTable.resources) {
_curExType++;
_curExTypeIndex = 0;
-
+
if (_curExType >= _typeTable.resource_types) // No more!
return output;
}
-
+
output.stream = new Common::SeekableSubReadStream(_mhk, _types[_curExType].resTable.entries[_curExTypeIndex].offset, _types[_curExType].resTable.entries[_curExTypeIndex].offset + _types[_curExType].resTable.entries[_curExTypeIndex].size);
output.tag = _types[_curExType].tag;
output.id = _types[_curExType].resTable.entries[_curExTypeIndex].id;
-
+
_curExTypeIndex++;
return output;
}
Modified: tools/trunk/engines/mohawk/mohawk_file.h
===================================================================
--- tools/trunk/engines/mohawk/mohawk_file.h 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/mohawk/mohawk_file.h 2009-12-30 15:34:00 UTC (rev 46751)
@@ -138,7 +138,7 @@
uint32 tag;
uint16 resource_table_offset;
uint16 name_table_offset;
-
+
struct ResourceTable {
uint16 resources;
struct Entries {
@@ -146,7 +146,7 @@
uint16 index;
} *entries;
} resTable;
-
+
struct NameTable {
uint16 num;
struct Entries {
@@ -175,10 +175,10 @@
public:
MohawkFile();
virtual ~MohawkFile() { close(); }
-
+
virtual void open(Common::SeekableReadStream *stream);
void close();
-
+
bool hasResource(uint32 tag, uint16 id);
virtual MohawkOutputStream getRawData(uint32 tag, uint16 id);
virtual MohawkOutputStream getNextFile();
@@ -187,13 +187,13 @@
Common::SeekableReadStream *_mhk;
TypeTable _typeTable;
Common::String _curFile;
-
+
// Extraction Variables
uint32 _curExType;
uint32 _curExTypeIndex;
-
+
FileTable *_fileTable;
-
+
private:
bool _hasData;
uint32 _fileSize;
@@ -222,11 +222,11 @@
public:
OldMohawkFile() : MohawkFile() {}
~OldMohawkFile() {}
-
+
void open(Common::SeekableReadStream *stream);
MohawkOutputStream getRawData(uint32 tag, uint16 id);
MohawkOutputStream getNextFile();
-
+
private:
struct OldType {
uint32 tag;
@@ -240,14 +240,14 @@
} *entries;
} resTable;
} *_types;
-
+
int16 getTypeIndex(uint32 tag) {
for (uint16 i = 0; i < _typeTable.resource_types; i++)
if (_types[i].tag == tag)
return i;
return -1; // not found
}
-
+
int16 getIdIndex(int16 typeIndex, uint16 id) {
for (uint16 i = 0; i < _types[typeIndex].resTable.resources; i++)
if (_types[typeIndex].resTable.entries[i].id == id)
Modified: tools/trunk/engines/parallaction/extract_parallaction.cpp
===================================================================
--- tools/trunk/engines/parallaction/extract_parallaction.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/parallaction/extract_parallaction.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -300,7 +300,7 @@
}
ExtractParallaction::ExtractParallaction(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION) {
-
+
ToolInput input;
input.format = "*.*";
_inputPaths.push_back(input);
Modified: tools/trunk/engines/parallaction/extract_parallaction.h
===================================================================
--- tools/trunk/engines/parallaction/extract_parallaction.h 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/parallaction/extract_parallaction.h 2009-12-30 15:34:00 UTC (rev 46751)
@@ -48,15 +48,15 @@
uint32 _fileSize;
uint32 _filePos;
- char _names[MAX_ARCHIVE_ENTRIES+1][ARCHIVE_FILENAME_LEN];
- uint32 _sizes[MAX_ARCHIVE_ENTRIES];
- uint32 _offsets[MAX_ARCHIVE_ENTRIES];
+ char _names[MAX_ARCHIVE_ENTRIES+1][ARCHIVE_FILENAME_LEN];
+ uint32 _sizes[MAX_ARCHIVE_ENTRIES];
+ uint32 _offsets[MAX_ARCHIVE_ENTRIES];
- void open(const char* filename, bool smallArchive);
+ void open(const char* filename, bool smallArchive);
- void openSubfile(uint32 index);
- void openSubfile(const char* filename);
- void readSubfile(byte* buf, uint32 size);
+ void openSubfile(uint32 index);
+ void openSubfile(const char* filename);
+ void readSubfile(byte* buf, uint32 size);
uint32 getSizeOfSubfile();
Archive(Tool &tool);
Modified: tools/trunk/engines/queen/compress_queen.cpp
===================================================================
--- tools/trunk/engines/queen/compress_queen.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/queen/compress_queen.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -93,7 +93,7 @@
CompressQueen::CompressQueen(const std::string &name) : CompressionTool(name, TOOLTYPE_COMPRESSION) {
_supportsProgressBar = true;
-
+
ToolInput input;
input.format = "queen.1";
_inputPaths.push_back(input);
@@ -111,7 +111,7 @@
if (pgv->dataFileSize == size) {
return pgv;
}
- }
+ }
error("Unknown/unsupported FOTAQ version");
Modified: tools/trunk/engines/saga/compress_saga.cpp
===================================================================
--- tools/trunk/engines/saga/compress_saga.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/saga/compress_saga.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -77,13 +77,13 @@
// Common::Filename swapEndian md5 resourceType frequency stereo
// FIXME: sfx.res is disabled for now, as there are issues when trying to encode it
//{"sfx.res", false, "1c610d543f32ec8b525e3f652536f269", kSoundWAV, -1, false},
- {"voicess.res", false, "-1", kSoundWAV, -1, false},
- {"voices1.res", false, "-1", kSoundWAV, -1, false},
- {"voices2.res", false, "-1", kSoundWAV, -1, false},
- {"voices3.res", false, "-1", kSoundWAV, -1, false},
- {"voices4.res", false, "-1", kSoundWAV, -1, false},
- {"voices5.res", false, "-1", kSoundWAV, -1, false},
- {"voices6.res", false, "-1", kSoundWAV, -1, false},
+ {"voicess.res", false, "-1", kSoundWAV, -1, false},
+ {"voices1.res", false, "-1", kSoundWAV, -1, false},
+ {"voices2.res", false, "-1", kSoundWAV, -1, false},
+ {"voices3.res", false, "-1", kSoundWAV, -1, false},
+ {"voices4.res", false, "-1", kSoundWAV, -1, false},
+ {"voices5.res", false, "-1", kSoundWAV, -1, false},
+ {"voices6.res", false, "-1", kSoundWAV, -1, false},
// Demo
{"voicesd.res", false, "-1", kSoundWAV, -1, false},
};
@@ -117,7 +117,7 @@
_currentGameDescription = NULL;
_currentFileDescription = NULL;
_supportsProgressBar = true;
-
+
ToolInput input;
// We accept many extensions, and the fact that "inherit the earth voices" does not have an extension
// makes it pretty much unsupported by the standard dialogs to open
Modified: tools/trunk/engines/saga/compress_saga.h
===================================================================
--- tools/trunk/engines/saga/compress_saga.h 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/saga/compress_saga.h 2009-12-30 15:34:00 UTC (rev 46751)
@@ -45,7 +45,7 @@
CompressSaga(const std::string &name = "compress_saga");
virtual void execute();
-
+
virtual InspectionMatch inspectInput(const Common::Filename &filename);
// Declarations should be inside the class to prevent linker errors
Modified: tools/trunk/engines/scumm/compress_scumm_bun.cpp
===================================================================
--- tools/trunk/engines/scumm/compress_scumm_bun.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/scumm/compress_scumm_bun.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -1073,7 +1073,7 @@
_cbundleCurIndex = 0;
_supportsProgressBar = true;
-
+
ToolInput input;
input.format = "*.bun";
_inputPaths.push_back(input);
Modified: tools/trunk/engines/scumm/compress_scumm_san.cpp
===================================================================
--- tools/trunk/engines/scumm/compress_scumm_san.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/scumm/compress_scumm_san.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -165,7 +165,7 @@
for (int l = 0; l < COMPRESS_SCUMM_SAN_MAX_TRACKS; l++) {
if (_audioTracks[l].used) {
_audioTracks[l].file.close();
-
+
sprintf(filename, "%s%s_%04d_%03d.tmp", outputDir.c_str(), inputFilename.c_str(), _audioTracks[l].animFrame, _audioTracks[l].trackId);
_audioTracks[l].file.open(filename, "rb");
_audioTracks[l].file.seek(0, SEEK_END);
@@ -578,7 +578,7 @@
flupath.setExtension(".flu");
Common::File flu_in;
-
+
try {
flu_in.open(flupath, "rb");
} catch (...) {
@@ -657,7 +657,7 @@
} catch (...) {
break;
}
-
+
if (input.eos())
break;
if (tag == 'FRME') {
Modified: tools/trunk/engines/scumm/descumm-tool.cpp
===================================================================
--- tools/trunk/engines/scumm/descumm-tool.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/scumm/descumm-tool.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -297,7 +297,7 @@
} else {
if (g_scriptSize <= 9) {
printf("File too small to be a local script\n");
- }
+ }
printf("Script# %d\n", (byte)g_scriptStart[8]);
g_scriptStart += 9;
}
Modified: tools/trunk/engines/scumm/descumm.cpp
===================================================================
--- tools/trunk/engines/scumm/descumm.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/scumm/descumm.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -802,7 +802,7 @@
case 0x0E:
buf = do_tok(buf, "InitAnimNr", ((opcode & 0x80) ? A1V : A1B));
break;
-// case 0x0F: buf=do_tok(buf, "PaletteList", A1LIST); break;
+// case 0x0F: buf=do_tok(buf, "PaletteList", A1LIST); break;
case 0x10:
buf = do_tok(buf, "Width", ((opcode & 0x80) ? A1V : A1B));
break;
Modified: tools/trunk/engines/scumm/descumm6.cpp
===================================================================
--- tools/trunk/engines/scumm/descumm6.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/scumm/descumm6.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -37,8 +37,8 @@
dup - duplicate it
push caseA - push the first case value
eq - compare
-jump if false - if not equal, jump to next case
- kill - we entered this case - kill the switch value from the stack
+jump if false - if not equal, jump to next case
+ kill - we entered this case - kill the switch value from the stack
...
jump AFTER - leave this switch
dup
@@ -1082,7 +1082,7 @@
if (!g_options.haltOnError)
return se_complex("**** INVALID DATA ****");
- exit(1);
+ exit(1);
}
return stack[--num_stack];
}
@@ -4257,7 +4257,7 @@
"\xE6p|makeCursorColorTransparent,"
"\xE7p|initCharset,"
"\xE8l|charsetColors,"
- "\xE9pp|setCursorPosition");
+ "\xE9pp|setCursorPosition");
break;
case 0x9D:
ext(output, "p|loadRoom");
Modified: tools/trunk/engines/scumm/extract_mm_apple.cpp
===================================================================
--- tools/trunk/engines/scumm/extract_mm_apple.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/scumm/extract_mm_apple.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -43,7 +43,7 @@
};
ExtractMMApple::ExtractMMApple(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION) {
-
+
ToolInput input1;
input1.format = "*.dsk";
_inputPaths.push_back(input1);
Modified: tools/trunk/engines/scumm/extract_mm_c64.cpp
===================================================================
--- tools/trunk/engines/scumm/extract_mm_c64.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/scumm/extract_mm_c64.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -44,7 +44,7 @@
};
ExtractMMC64::ExtractMMC64(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION) {
-
+
ToolInput input1;
input1.format = "*.d64";
_inputPaths.push_back(input1);
@@ -61,7 +61,7 @@
int i, j;
unsigned short signature;
char fname[256];
-
+
Common::Filename inpath1(_inputPaths[0].path);
Common::Filename inpath2(_inputPaths[1].path);
Common::Filename &outpath = _outputPath;
@@ -69,7 +69,7 @@
if (outpath.empty())
// Standard output path
outpath.setFullPath("out/");
-
+
Common::File input1(inpath1, "rb");
Common::File input2(inpath2, "rb");
Modified: tools/trunk/engines/scumm/extract_mm_nes.cpp
===================================================================
--- tools/trunk/engines/scumm/extract_mm_nes.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/scumm/extract_mm_nes.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -1228,13 +1228,13 @@
}
ExtractMMNes::ExtractMMNes(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION) {
-
+
ToolInput input;
input.format = "*.prg";
_inputPaths.push_back(input);
_shorthelp = "Extract data files from the NES version of Maniac Mansion.";
- _helptext =
+ _helptext =
"\nUsage: " + _name + " [-o <output dir> = out/] <infile.PRG>\n" +
"\t" + _shorthelp + "\n" +
"\tSupported versions: USA, Europe, Sweden, France, Germany, Spain, Italy\n"
@@ -1311,7 +1311,7 @@
output.setXorMode(0xFF);
#endif
print("Creating %s...\n", fname);
-
+
for (j = 0; lfl->entries[j].type != NULL; j++) {
const struct t_lflentry *entry = &lfl->entries[j];
switch (entry->type->type) {
Modified: tools/trunk/engines/scumm/extract_scumm_mac.cpp
===================================================================
--- tools/trunk/engines/scumm/extract_scumm_mac.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/scumm/extract_scumm_mac.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -29,7 +29,7 @@
#define CHANGECASE
ExtractScummMac::ExtractScummMac(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION) {
-
+
ToolInput input;
input.format = "*.*";
_inputPaths.push_back(input);
@@ -94,7 +94,7 @@
if (!file_name[0])
error("\'%s\'. file has no name.", inpath.getFullPath().c_str());
-
+
print("extracting \'%s\'", file_name);
/* For convenience compatibility with scummvm (and case sensitive
Modified: tools/trunk/engines/scumm/extract_scumm_mac.h
===================================================================
--- tools/trunk/engines/scumm/extract_scumm_mac.h 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/scumm/extract_scumm_mac.h 2009-12-30 15:34:00 UTC (rev 46751)
@@ -31,7 +31,7 @@
ExtractScummMac(const std::string &name = "extract_scumm_mac");
virtual void execute();
-
+
virtual InspectionMatch inspectInput(const Common::Filename &filename);
};
Modified: tools/trunk/engines/scumm/extract_zak_c64.cpp
===================================================================
--- tools/trunk/engines/scumm/extract_zak_c64.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/scumm/extract_zak_c64.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -69,7 +69,7 @@
if (outpath.empty())
// Standard output path
outpath.setFullPath("out/");
-
+
Common::File input1(inpath1, "rb");
Common::File input2(inpath2, "rb");
Modified: tools/trunk/engines/sword1/compress_sword1.cpp
===================================================================
--- tools/trunk/engines/sword1/compress_sword1.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/sword1/compress_sword1.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -574,7 +574,7 @@
_compMusic = true;
_supportsProgressBar = true;
-
+
ToolInput input;
input.format = "*.clu";
_inputPaths.push_back(input);
Modified: tools/trunk/engines/sword2/compress_sword2.cpp
===================================================================
--- tools/trunk/engines/sword2/compress_sword2.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/sword2/compress_sword2.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -65,7 +65,7 @@
uint32 indexSize;
uint32 totalSize;
uint32 length;
-
+
Common::Filename inpath(_inputPaths[0].path);
Common::Filename &outpath = _outputPath;
Modified: tools/trunk/engines/sword2/compress_sword2.h
===================================================================
--- tools/trunk/engines/sword2/compress_sword2.h 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/sword2/compress_sword2.h 2009-12-30 15:34:00 UTC (rev 46751)
@@ -35,7 +35,7 @@
Common::File _input, _output_snd, _output_idx;
std::string _audioOutputFilename;
-
+
uint32 append_to_file(Common::File &f1, const char *filename);
};
Modified: tools/trunk/engines/tinsel/compress_tinsel.cpp
===================================================================
--- tools/trunk/engines/tinsel/compress_tinsel.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/tinsel/compress_tinsel.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -55,7 +55,7 @@
ToolInput input1;
input1.format = "*.smp";
_inputPaths.push_back(input1);
-
+
ToolInput input2;
input2.format = "*.idx";
_inputPaths.push_back(input2);
Modified: tools/trunk/engines/tucker/compress_tucker.cpp
===================================================================
--- tools/trunk/engines/tucker/compress_tucker.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/engines/tucker/compress_tucker.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -293,14 +293,14 @@
};
static const int audio_formats_table[] = {
- 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
- 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
- 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 2,
- 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 2, 3, 1, 1, 2, 1, 1, 1, 1,
- 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
+ 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
+ 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 2,
+ 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 2, 3, 1, 1, 2, 1, 1, 1, 1,
+ 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 1
};
@@ -322,10 +322,10 @@
for (i = 0; i < count; ++i) {
temp_table[i].offset = current_offset;
sprintf(filepath, "%s/audio/%s", inpath->getPath().c_str(), audio_files_list[i]);
-
+
try {
Common::File input(filepath, "rb");
-
+
switch (audio_formats_table[i]) {
case 1:
case 2:
Modified: tools/trunk/example_tool.cpp
===================================================================
--- tools/trunk/example_tool.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/example_tool.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -131,7 +131,7 @@
// Start the 'extraction'
size_t total_files = in1.size() + in2.size();
-
+
// There has to be some roof on this
if (total_files > 1000)
throw ToolException("Input files are too large!");
Modified: tools/trunk/gui/configuration.cpp
===================================================================
--- tools/trunk/gui/configuration.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/gui/configuration.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -35,7 +35,7 @@
selectedAudioFormat = AUDIO_VORBIS;
advancedAudioSettings = false;
-
+
// mp3 params
mp3CompressionType = wxT("VBR");
mp3MpegQuality = wxT("2");
@@ -92,7 +92,7 @@
wxFileName op(outputPath);
filecnf->Write(wxT("outputpath"), op.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR));
-
+
if (all) {
// mp3 params
filecnf->Write(wxT("mp3CompressionType"), mp3CompressionType);
@@ -112,7 +112,7 @@
filecnf->Write(wxT("oggAvgBitrate"), oggAvgBitrate);
filecnf->Write(wxT("oggMaxBitrate"), oggMaxBitrate);
}
-
+
delete filecnf;
}
Modified: tools/trunk/gui/configuration.h
===================================================================
--- tools/trunk/gui/configuration.h 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/gui/configuration.h 2009-12-30 15:34:00 UTC (rev 46751)
@@ -35,7 +35,7 @@
struct Configuration {
Configuration();
~Configuration();
-
+
/**
* Fills this config object with values loaded from the permanent storage method
*/
@@ -94,7 +94,7 @@
// flac
wxString flacCompressionLevel;
wxString flacBlockSize;
-
+
// flac
wxString oggQuality;
wxString oggMinBitrate;
Modified: tools/trunk/gui/gui_tools.cpp
===================================================================
--- tools/trunk/gui/gui_tools.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/gui/gui_tools.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -157,7 +157,7 @@
// flac
compression->_flacCompressionLevel = (const char *)conf.flacCompressionLevel.mb_str();
compression->_flacBlockSize = (const char *)conf.flacBlockSize.mb_str();
-
+
// vorbis
compression->_oggQuality = (const char *)conf.oggQuality.mb_str();
compression->_oggMinBitrate = (const char *)conf.oggMinBitrate.mb_str();
Modified: tools/trunk/gui/gui_tools.h
===================================================================
--- tools/trunk/gui/gui_tools.h 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/gui/gui_tools.h 2009-12-30 15:34:00 UTC (rev 46751)
@@ -65,7 +65,7 @@
void addGame(const wxString &game_name);
/**
- * Returns the list of valid inputs of this tool, along with the
+ * Returns the list of valid inputs of this tool, along with the
* paths already set (if applicable)
*/
ToolInputs getInputList() const;
@@ -91,14 +91,14 @@
ToolType getType() const;
// Helper functions to get info about the tool
-
+
/**
* Returns true if the audio format(s) is supported by this tool
- *
+ *
* @param format The audio format(s) to test for
*/
bool supportsAudioFormat(AudioFormat format) const;
-
+
/**
* Returns true if the tool supports a load bar for displaying progress
*/
Modified: tools/trunk/gui/main.cpp
===================================================================
--- tools/trunk/gui/main.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/gui/main.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -62,7 +62,7 @@
bool ScummVMToolsApp::OnInit() {
// Init tools
g_tools.init();
-
+
SetAppName(wxT("ScummVM Tools"));
// Create window & display
@@ -73,7 +73,7 @@
#endif
frame->SetMinSize(wxSize(600, 420));
SetTopWindow(frame);
-
+
// Create and load configuration
Configuration &configuration = frame->_configuration;
@@ -88,9 +88,9 @@
} else {
frame->switchPage(new IntroPage(configuration));
}
-
+
frame->Show(true);
-
+
return true;
}
@@ -108,26 +108,26 @@
wxStaticText *titletext = new wxStaticText(dialog, wxID_ANY, wxT("ScummTools GUI"));
titletext->SetFont(wxFont(22, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Arial")));
sizer->Add(titletext, wxSizerFlags());
-
+
wxStaticText *versiontext = new wxStaticText(dialog, wxID_ANY, wxT("Development Version"));
versiontext->SetForegroundColour(wxColor(128, 128, 128));
versiontext->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, false, wxT("Arial")));
sizer->Add(versiontext, wxSizerFlags());
-
+
wxHyperlinkCtrl *websitetext = new wxHyperlinkCtrl(dialog, wxID_ANY, wxT("http://www.scummvm.org"), wxT("http://www.scummvm.org"));
sizer->Add(websitetext, wxSizerFlags().Border(wxTOP, 5));
wxStaticText *copyrighttext = new wxStaticText(dialog, wxID_ANY, wxT("Copyright ScummVM Team 2009"));
copyrighttext->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxNORMAL, false, wxT("Arial")));
sizer->Add(copyrighttext, wxSizerFlags());
-
+
wxStaticText *descriptiontext = new wxStaticText(dialog, wxID_ANY,
wxT("This tool allows you to extract data files from several different games \n")
wxT("to be used by ScummVM, it can also compress audio data files into a more \n")
wxT("compact format than the original."));
descriptiontext->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxNORMAL, false, wxT("Arial")));
sizer->Add(descriptiontext, wxSizerFlags().Border(wxTOP, 6));
-
+
wxStaticText *licensetext = new wxStaticText(dialog, wxID_ANY,
wxT("Published under the GNU General Public License\n")
wxT("This program comes with ABSOLUTELY NO WARRANTY\n")
@@ -182,7 +182,7 @@
wxPanel *main = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxT("Wizard Main Panel"));
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
-
+
// Add the top header, it's sweet!
sizer->Add(
new Header(main, wxT("logo.jpg"), wxT("tile.gif"), wxT("Extraction & Compression Wizard")),
@@ -197,21 +197,21 @@
// We split it in two parts over a panel to have a small text there
wxPanel *linepanel = new wxPanel(main, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxT("Wizard Line Panel"));
wxSizer *linesizer = new wxBoxSizer(wxHORIZONTAL);
-
+
wxStaticText *linetext = new wxStaticText(linepanel, wxID_ANY, wxGetApp().GetAppName());
linesizer->Add(linetext, wxSizerFlags());
linetext->Disable();
wxStaticLine *line = new wxStaticLine(
- linepanel, wxID_ANY,
- wxDefaultPosition, wxSize(300, 1),
+ linepanel, wxID_ANY,
+ wxDefaultPosition, wxSize(300, 1),
wxBORDER_SIMPLE | wxLI_HORIZONTAL, wxT("Line Spacer")
);
line->Disable();
linesizer->Add(line, wxSizerFlags(1).Center());
linepanel->SetSizer(linesizer);
-
+
// Add the line to the main panel
sizer->Add(linepanel, wxSizerFlags().Expand().Center().Border());
@@ -236,7 +236,7 @@
#ifdef __WXMAC__
wxApp::s_macHelpMenuTitleName = wxT("Help");
-#endif
+#endif
// Name of this seems really inappropriate
wxMenu *helpmenu = new wxMenu();
@@ -409,7 +409,7 @@
_cancel = new wxButton(this, ID_CANCEL, wxT("Cancel"));
_cancel->SetSize(80, -1);
sizer->Add(_cancel, wxSizerFlags().Right().ReserveSpaceEvenIfHidden());
-
+
topsizer->Add(sizer, wxSizerFlags().Right().Border());
SetSizerAndFit(topsizer);
@@ -533,7 +533,7 @@
// Load font
_font = wxFont(10, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false);
-
+
// Set the text title
_title = title;
}
@@ -543,7 +543,7 @@
int w, h;
this->GetSize(&w, &h);
-
+
if (_logo.IsOk() == false || _tile.IsOk() == false) {
// If we couldn't load the images, use orange instead!
dc.SetBackground(wxBrush(wxColor(213, 114, 0)));
@@ -564,7 +564,7 @@
x += _tile.GetWidth();
}
}
-
+
dc.SetFont(_font);
dc.DrawText(_title, 290, 70);
}
@@ -574,7 +574,7 @@
_defaults(defaults)
{
wxNotebook *notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_TOP);
-
+
_mp3 = new ChooseAudioOptionsMp3Page(defaults);
_flac = new ChooseAudioOptionsFlacPage(defaults);
_vorbis = new ChooseAudioOptionsVorbisPage(defaults);
@@ -582,7 +582,7 @@
notebook->AddPage(_mp3panel = _mp3->CreatePanel(notebook), wxT("MP3"));
notebook->AddPage(_flacpanel = _flac->CreatePanel(notebook), wxT("Flac"));
notebook->AddPage(_vorbispanel = _vorbis->CreatePanel(notebook), wxT("Vorbis"));
-
+
wxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
topsizer->Add(notebook, wxSizerFlags(1).Expand().Border());
Modified: tools/trunk/gui/main.h
===================================================================
--- tools/trunk/gui/main.h 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/gui/main.h 2009-12-30 15:34:00 UTC (rev 46751)
@@ -73,7 +73,7 @@
* Switches page, old page is stored on a stack for going backwards
* Buttons are reset, and state is saved
*
- * @param nextPage The page to switch too, the old page window will be destroyed
+ * @param nextPage The page to switch too, the old page window will be destroyed
* and this page displayed in it's stead.
*/
void switchPage(WizardPage *nextPage) {
@@ -119,7 +119,7 @@
void switchPage(WizardPage *nextPage, bool moveback);
wxPanel *_wizardpane;
-
+
std::vector<WizardPage *> _pages;
DECLARE_EVENT_TABLE()
@@ -173,13 +173,13 @@
/**
* Display the previous/next button.
- */
+ */
void showNavigation(bool show);
/**
* Display the previous button.
* If the showNavigation has been used, this overrides that (for the previous button).
- */
+ */
void showPrevious(bool show);
/**
Modified: tools/trunk/gui/pages.cpp
===================================================================
--- tools/trunk/gui/pages.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/gui/pages.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -126,9 +126,9 @@
sizer->AddSpacer(15);
- sizer->Add(new wxStaticText(panel, wxID_ANY,
+ sizer->Add(new wxStaticText(panel, wxID_ANY,
wxT("Welcome to the ScummVM extraction and compression utility.\nWhat do you want to do?")));
-
+
sizer->AddSpacer(15);
wxSizer *sidesizer = new wxBoxSizer(wxHORIZONTAL);
@@ -142,7 +142,7 @@
buttonpanel = new wxPanel(panel, wxID_ANY);
buttonsizer = new wxBoxSizer(wxVERTICAL);
buttonsizer->Add(new wxButton(buttonpanel, ID_COMPRESS, wxT("Compress")), wxSizerFlags().Expand());
- buttonsizer->Add(new wxStaticText(buttonpanel, wxID_ANY,
+ buttonsizer->Add(new wxStaticText(buttonpanel, wxID_ANY,
wxT("Compress game audio files into archives."),
wxDefaultPosition, wxSize(110, 60), wxALIGN_CENTER));
buttonpanel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(IntroPage::onClickCompress), NULL, this);
@@ -154,7 +154,7 @@
buttonpanel = new wxPanel(panel, wxID_ANY);
buttonsizer = new wxBoxSizer(wxVERTICAL);
buttonsizer->Add(new wxButton(buttonpanel, ID_EXTRACT, wxT("Extract")), wxSizerFlags().Expand());
- buttonsizer->Add(new wxStaticText(buttonpanel, wxID_ANY,
+ buttonsizer->Add(new wxStaticText(buttonpanel, wxID_ANY,
wxT("Extract the contents of archive files."),
wxDefaultPosition, wxSize(110, 60), wxALIGN_CENTER));
buttonpanel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(IntroPage::onClickExtract), NULL, this);
@@ -166,7 +166,7 @@
buttonpanel = new wxPanel(panel, wxID_ANY);
buttonsizer = new wxBoxSizer(wxVERTICAL);
buttonsizer->Add(new wxButton(buttonpanel, ID_ADVANCED, wxT("Advanced")), wxSizerFlags().Expand());
- buttonsizer->Add(new wxStaticText(buttonpanel, wxID_ANY,
+ buttonsizer->Add(new wxStaticText(buttonpanel, wxID_ANY,
wxT("Choose the precise tool you want to use."),
wxDefaultPosition, wxSize(110, 60), wxALIGN_CENTER));
buttonpanel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(IntroPage::onClickAdvanced), NULL, this);
@@ -186,7 +186,7 @@
void IntroPage::updateButtons(wxWindow *panel, WizardButtons *buttons) {
buttons->setLineLabel(wxT("ScummVM Tools"));
-
+
buttons->showNavigation(false);
WizardPage::updateButtons(panel, buttons);
@@ -230,21 +230,21 @@
wxArrayString choices;
if (!_options.empty()) {
- sizer->Add(new wxStaticText(panel, wxID_ANY,
+ sizer->Add(new wxStaticText(panel, wxID_ANY,
wxT("There are multiple possible tools for this input, please select the correct one.\n\n")
wxT("If none of the tools appear to match, you probably supplied the wrong file.")));
choices = _options;
} else {
- sizer->Add(new wxStaticText(panel, wxID_ANY,
+ sizer->Add(new wxStaticText(panel, wxID_ANY,
wxT("Select what tool you'd like to use.")));
choices = g_tools.getToolList(TOOLTYPE_ALL);
}
wxString toolname = choices.front();
-
+
sizer->AddSpacer(20);
- wxChoice *tool = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ wxChoice *tool = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
choices, 0, wxDefaultValidator, wxT("ToolSelection"));
tool->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(ChooseToolPage::onChangeTool), NULL, this);
@@ -277,7 +277,7 @@
}
void ChooseToolPage::save(wxWindow *panel) {
- _configuration.selectedTool =
+ _configuration.selectedTool =
g_tools.get(static_cast<wxChoice *>(panel->FindWindowByName(wxT("ToolSelection")))->GetStringSelection());
}
@@ -299,13 +299,13 @@
void ChooseToolPage::onChangeTool(wxCommandEvent &evt) {
wxChoice *tool = dynamic_cast<wxChoice *>(evt.GetEventObject());
wxStaticText *text = dynamic_cast<wxStaticText *>(tool->GetParent()->FindWindowByName(wxT("ToolText")));
-
+
text->SetLabel(g_tools[tool->GetStringSelection()].getShortHelp());
}
void ChooseToolPage::updateButtons(wxWindow *panel, WizardButtons *buttons) {
buttons->setLineLabel(wxT("ScummVM Tools"));
-
+
WizardPage::updateButtons(panel, buttons);
}
@@ -321,7 +321,7 @@
wxWindow *win = dynamic_cast<wxWindow *>(evt.GetEventObject());
wxPanel *panel = dynamic_cast<wxPanel *>(win->GetParent());
-
+
updateButtons(panel, _topframe->_buttons);
}
@@ -329,7 +329,7 @@
wxWindow *picker = NULL;
if (!picker)
picker = panel->FindWindowByName(wxT("InputPicker"));
-
+
const ToolGUI *tool = _configuration.selectedTool;
if (tool && !picker) {
for (size_t i = 1; i < tool->getInputList().size(); ++i) {
@@ -349,9 +349,9 @@
wxFilePickerCtrl *inFileWindow = dynamic_cast<wxFilePickerCtrl *>(picker);
buttons->enableNext(
- (inDirWindow && inDirWindow->GetPath().size() > 0) ||
+ (inDirWindow && inDirWindow->GetPath().size() > 0) ||
(inFileWindow && inFileWindow->GetPath().size() > 0));
-
+
WizardPage::updateButtons(panel, buttons);
}
@@ -368,9 +368,9 @@
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
sizer->AddSpacer(15);
-
+
// some help perhaps?
- sizer->Add(new wxStaticText(panel, wxID_ANY,
+ sizer->Add(new wxStaticText(panel, wxID_ANY,
wxT("Select an input file, if you have two input files (CD1 and CD2), ")
wxT("you will be queried for the other file later.")
wxT("You can also drag & drop a file on this window.")
@@ -384,10 +384,10 @@
wxSizer *pickersizer = new wxBoxSizer(wxHORIZONTAL);
wxFilePickerCtrl *picker = new wxFilePickerCtrl(
- panel, wxID_ANY, wxEmptyString, wxT("Select a file"),
- wxT("*.*"),
+ panel, wxID_ANY, wxEmptyString, wxT("Select a file"),
+ wxT("*.*"),
wxDefaultPosition, wxSize(300, -1),
- wxFLP_USE_TEXTCTRL | wxFLP_OPEN, wxDefaultValidator,
+ wxFLP_USE_TEXTCTRL | wxFLP_OPEN, wxDefaultValidator,
wxT("InputPicker"));
panel->Connect(wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEventHandler(ChooseIOPage::onSelectFile), NULL, this);
if (_configuration.inputFilePaths.size() > 0)
@@ -398,21 +398,21 @@
sizer->Add(pickersizer, wxSizerFlags().Expand());
sizer->AddSpacer(30);
- /*
+ /*
// TODO: There is no way to select directory input, yet
} else {
inputbox->Add(new wxDirPickerCtrl(
- panel, wxID_ANY, wxEmptyString, wxT("Select a folder"),
- wxDefaultPosition, wxDefaultSize,
- wxFLP_USE_TEXTCTRL | wxFLP_OPEN, wxDefaultValidator,
+ panel, wxID_ANY, wxEmptyString, wxT("Select a folder"),
+ wxDefaultPosition, wxDefaultSize,
+ wxFLP_USE_TEXTCTRL | wxFLP_OPEN, wxDefaultValidator,
wxT("InputPicker")),
wxSizerFlags().Expand());
-
+
}
*/
-
+
SetAlignedSizer(panel, sizer);
-
+
return panel;
}
@@ -486,7 +486,7 @@
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
sizer->AddSpacer(15);
-
+
const ToolGUI &tool = *_configuration.selectedTool;
// some help perhaps?
@@ -514,18 +514,18 @@
if (input.file) {
inputsizer->Add(new wxFilePickerCtrl(
- panel, wxID_ANY, inputFile, wxT("Select a file"),
- wxString(input.format.c_str(), wxConvUTF8),
- wxDefaultPosition, wxDefaultSize,
- wxFLP_USE_TEXTCTRL | wxDIRP_DIR_MUST_EXIST, wxDefaultValidator,
+ panel, wxID_ANY, inputFile, wxT("Select a file"),
+ wxString(input.format.c_str(), wxConvUTF8),
+ wxDefaultPosition, wxDefaultSize,
+ wxFLP_USE_TEXTCTRL | wxDIRP_DIR_MUST_EXIST, wxDefaultValidator,
windowName), wxSizerFlags().Expand());
panel->Connect(wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEventHandler(ChooseIOPage::onSelectFile), NULL, this);
} else {
inputsizer->Add(new wxDirPickerCtrl(
- panel, wxID_ANY, inputFile, wxT("Select a folder"),
- wxDefaultPosition, wxDefaultSize,
- wxFLP_USE_TEXTCTRL | wxFLP_OPEN, wxDefaultValidator,
+ panel, wxID_ANY, inputFile, wxT("Select a folder"),
+ wxDefaultPosition, wxDefaultSize,
+ wxFLP_USE_TEXTCTRL | wxFLP_OPEN, wxDefaultValidator,
windowName), wxSizerFlags().Expand());
panel->Connect(wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler(ChooseIOPage::onSelectFile), NULL, this);
@@ -598,18 +598,18 @@
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
sizer->AddSpacer(15);
-
+
const ToolGUI &tool = *_configuration.selectedTool;
// some help perhaps?
- sizer->Add(new wxStaticText(panel, wxID_ANY,
+ sizer->Add(new wxStaticText(panel, wxID_ANY,
wxT("Select an output directory (using tool ") + _configuration.selectedTool->getName() + wxT(").\n\n") +
wxT("Note: Some tools display file picker here, this should perhaps be changed to always ") +
wxT("be directory output, since often don't want to name the output file.)")
),
wxSizerFlags(1).Expand());
- // Create input selection
+ // Create input selection
sizer->AddSpacer(10);
@@ -618,11 +618,11 @@
if (tool.outputToDirectory()) {
wxStaticBoxSizer *box = new wxStaticBoxSizer(wxHORIZONTAL, panel, wxT("Destination folder"));
-
+
wxDirPickerCtrl *picker = new wxDirPickerCtrl(
- panel, wxID_ANY, _configuration.outputPath, wxT("Select a folder"),
+ panel, wxID_ANY, _configuration.outputPath, wxT("Select a folder"),
wxDefaultPosition, wxSize(300, -1),
- wxFLP_USE_TEXTCTRL | wxDIRP_DIR_MUST_EXIST, wxDefaultValidator,
+ wxFLP_USE_TEXTCTRL | wxDIRP_DIR_MUST_EXIST, wxDefaultValidator,
wxT("OutputPicker"));
box->Add(picker, wxSizerFlags(1).Expand());
@@ -634,16 +634,16 @@
wxStaticBoxSizer *box = new wxStaticBoxSizer(wxHORIZONTAL, panel, wxT("Destination file"));
wxFilePickerCtrl *picker = new wxFilePickerCtrl(
- panel, wxID_ANY, _configuration.outputPath, wxT("Select a file"),
+ panel, wxID_ANY, _configuration.outputPath, wxT("Select a file"),
wxT("*.*"),
wxDefaultPosition, wxSize(300, -1),
- wxFLP_USE_TEXTCTRL | wxFLP_OVERWRITE_PROMPT | wxFLP_SAVE, wxDefaultValidator,
+ wxFLP_USE_TEXTCTRL | wxFLP_OVERWRITE_PROMPT | wxFLP_SAVE, wxDefaultValidator,
wxT("OutputPicker"));
box->Add(picker, wxSizerFlags(1).Expand());
panel->Connect(wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEventHandler(ChooseIOPage::onSelectFile), NULL, this);
picker->SetPath(_configuration.outputPath);
-
+
colsizer->Add(box, wxSizerFlags(2).Expand());
}
@@ -694,14 +694,14 @@
sizer->AddSpacer(15);
- sizer->Add(new wxStaticText(panel, wxID_ANY,
+ sizer->Add(new wxStaticText(panel, wxID_ANY,
wxT("Select target platform (The platform ScummVM will run on)")));
sizer->AddSpacer(20);
-
+
wxArrayString choices = _configuration.getTargetPlatforms();
- wxChoice *platform = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxSize(80, -1),
+ wxChoice *platform = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxSize(80, -1),
choices, 0, wxDefaultValidator, wxT("PlatformSelection"));
sizer->Add(platform, wxSizerFlags().Expand().Border(wxRIGHT, 100));
@@ -746,11 +746,11 @@
sizer->AddSpacer(15);
- sizer->Add(new wxStaticText(panel, wxID_ANY,
+ sizer->Add(new wxStaticText(panel, wxID_ANY,
wxT("Select audio format you want to compress to.")));
sizer->AddSpacer(20);
-
+
wxArrayString choices;
const ToolGUI *tool = _configuration.selectedTool;
@@ -762,13 +762,13 @@
if (tool->supportsAudioFormat(AUDIO_MP3))
choices.Add(wxT("MP3"));
- wxChoice *format = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxSize(80, -1),
+ wxChoice *format = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxSize(80, -1),
choices, 0, wxDefaultValidator, wxT("AudioSelection"));
sizer->Add(format);
-
+
sizer->AddSpacer(10);
- wxCheckBox *advanced = new wxCheckBox(panel, wxID_ANY, wxT("Select advanced audio settings"),
+ wxCheckBox *advanced = new wxCheckBox(panel, wxID_ANY, wxT("Select advanced audio settings"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, wxT("AdvancedAudio"));
sizer->Add(advanced);
@@ -834,7 +834,7 @@
wxWindow *ChooseAudioOptionsMp3Page::CreatePanel(wxWindow *parent) {
wxWindow *panel = WizardPage::CreatePanel(parent);
-
+
/*
"\nMP3 mode params:\n"
" -b <rate> <rate> is the target bitrate(ABR)/minimal bitrate(VBR) (default:" minBitrDef_str "%d)\n"
@@ -853,13 +853,13 @@
// Type of compression
sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Compression Type:")));
- wxRadioButton *abrButton = new wxRadioButton(panel, 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(panel, wxID_ANY, wxT("VBR"),
+
+ wxRadioButton *vbrButton = new wxRadioButton(panel, wxID_ANY, wxT("VBR"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, wxT("VBR"));
radioSizer->Add(vbrButton);
@@ -875,23 +875,23 @@
sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Minimum Bitrate:")));
wxChoice *vbrMinBitrate = new wxChoice(
- panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
possibleBitrateCount, possibleBitrates, 0, wxDefaultValidator, wxT("MinimumBitrate"));
sizer->Add(vbrMinBitrate, wxSizerFlags().Expand().Border(wxRIGHT, 100));
-
+
sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Maximum Bitrate:")));
-
+
wxChoice *vbrMaxBitrate = new wxChoice(
- panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
possibleBitrateCount, possibleBitrates, 0, wxDefaultValidator, wxT("MaximumBitrate"));
sizer->Add(vbrMaxBitrate, wxSizerFlags().Expand().Border(wxRIGHT, 100));
-
+
sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Average Bitrate:")));
-
+
wxChoice *abrAvgBitrate = new wxChoice(
- panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
possibleBitrateCount, possibleBitrates, 0, wxDefaultValidator, wxT("AverageBitrate"));
sizer->Add(abrAvgBitrate, wxSizerFlags().Expand().Border(wxRIGHT, 100));
@@ -906,17 +906,17 @@
}
sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("VBR Quality:")));
-
+
wxChoice *vbrQuality = new wxChoice(
- panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
possibleQualityCount, possibleQualities, 0, wxDefaultValidator, wxT("VBRQuality"));
sizer->Add(vbrQuality, wxSizerFlags().Expand().Border(wxRIGHT, 100));
-
+
sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("MPEG Quality:")));
-
+
wxChoice *mpegQuality = new wxChoice(
- panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
possibleQualityCount, possibleQualities, 0, wxDefaultValidator, wxT("MpegQuality"));
sizer->Add(mpegQuality, wxSizerFlags().Expand().Border(wxRIGHT, 100));
@@ -973,7 +973,7 @@
vbrMinBitrate->Enable(!abr->GetValue());
vbrMaxBitrate->Enable(!abr->GetValue());
vbrQuality->Enable(!abr->GetValue());
-
+
abrAvgBitrate->Enable(abr->GetValue());
}
@@ -996,14 +996,14 @@
wxWindow *ChooseAudioOptionsFlacPage::CreatePanel(wxWindow *parent) {
wxWindow *panel = WizardPage::CreatePanel(parent);
-
+
wxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
topsizer->AddSpacer(15);
- topsizer->Add(new wxStaticText(panel, wxID_ANY,
+ topsizer->Add(new wxStaticText(panel, wxID_ANY,
wxT("Choose advanced audio options, high compression levels means better quality,\nlower faster runtime.")));
topsizer->AddSpacer(10);
-
+
/*
"\nFlac mode params:\n" \
" --fast FLAC uses compression level 0\n" \
@@ -1016,10 +1016,10 @@
wxFlexGridSizer *sizer = new wxFlexGridSizer(2, 2, 10, 25);
sizer->AddGrowableCol(1);
-
- //
+ //
+
// Compression Level
const int possibleLevelCount = 9;
wxString possibleLevels[possibleLevelCount + 1];
@@ -1028,9 +1028,9 @@
}
sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Compression Level:")));
-
+
wxChoice *compressionLevel = new wxChoice(
- panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
possibleLevelCount, possibleLevels, 0, wxDefaultValidator, wxT("CompressionLevel"));
sizer->Add(compressionLevel, wxSizerFlags().Expand().Border(wxRIGHT, 100));
@@ -1047,10 +1047,10 @@
sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Block Size:")));
wxChoice *blockSize = new wxChoice(
- panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
sizeof blockSizes / sizeof *blockSizes, blockSizes, 0, wxDefaultValidator, wxT("BlockSize"));
sizer->Add(blockSize, wxSizerFlags().Expand().Border(wxRIGHT, 100));
-
+
// Finish the window
topsizer->Add(sizer);
SetAlignedSizer(panel, topsizer);
@@ -1085,7 +1085,7 @@
wxWindow *ChooseAudioOptionsVorbisPage::CreatePanel(wxWindow *parent) {
wxWindow *panel = WizardPage::CreatePanel(parent);
-
+
/* Vorbis mode params
" -b <rate> <rate> is the nominal bitrate (default:unset)\n" \
" -m <rate> <rate> is the minimum bitrate (default:unset)\n" \
@@ -1107,23 +1107,23 @@
sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Minimum Bitrate:")));
wxChoice *MinBitrate = new wxChoice(
- panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
possibleBitrateCount, possibleBitrates, 0, wxDefaultValidator, wxT("MinimumBitrate"));
sizer->Add(MinBitrate, wxSizerFlags().Expand().Border(wxRIGHT, 100));
-
+
sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Nominal Bitrate:")));
-
+
wxChoice *AvgBitrate = new wxChoice(
- panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
possibleBitrateCount, possibleBitrates, 0, wxDefaultValidator, wxT("NominalBitrate"));
sizer->Add(AvgBitrate, wxSizerFlags().Expand().Border(wxRIGHT, 100));
-
+
sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Maximum Bitrate:")));
-
+
wxChoice *MaxBitrate = new wxChoice(
- panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
possibleBitrateCount, possibleBitrates, 0, wxDefaultValidator, wxT("MaximumBitrate"));
sizer->Add(MaxBitrate, wxSizerFlags().Expand().Border(wxRIGHT, 100));
@@ -1135,9 +1135,9 @@
}
sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Quality:")));
-
+
wxChoice *quality = new wxChoice(
- panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
possibleQualityCount, possibleQualities, 0, wxDefaultValidator, wxT("Quality"));
sizer->Add(quality, wxSizerFlags().Expand().Border(wxRIGHT, 100));
@@ -1197,12 +1197,12 @@
sizer->AddSpacer(15);
sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Processing data...")), wxSizerFlags().Expand().Border(wxLEFT, 20));
-
- _outwin = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize,
+
+ _outwin = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE | wxTE_READONLY, wxDefaultValidator, wxT("OutputWindow"));
sizer->Add(_outwin, wxSizerFlags(1).Expand().Border(wxTOP | wxLEFT | wxRIGHT, 10));
- _gauge = new wxGauge(panel, wxID_ANY, _output.total, wxDefaultPosition, wxDefaultSize,
+ _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));
@@ -1236,10 +1236,10 @@
bool ProcessPage::onIdle(wxPanel *panel) {
const ToolGUI *tool = _configuration.selectedTool;
-
+
if (!_thread)
return false;
-
+
// This function can be called recursively, by checking if lock is available, we avoid it
if (_output.mutex.TryLock() == wxMUTEX_BUSY)
return false;
@@ -1263,7 +1263,7 @@
if (_output.cmd) {
// We have a waiting subprocess to run, the other thread is sleeping since we could lock the mutex
-
+
#ifdef __WINDOWS__
// Only windows needs this
// It hides the process window, on unix it doesn't appear to work very well
@@ -1282,7 +1282,7 @@
// Check if thread finished
if (_thread && _thread->_finished) {
- // Tool has finished
+ // Tool has finished
_success = _thread->_success;
// Wait deallocates thread resources
_thread->Wait();
@@ -1347,15 +1347,15 @@
// The thread a tool is run in
-ProcessToolThread::ProcessToolThread(const ToolGUI *tool, Configuration &configuration, ThreadCommunicationBuffer &output) :
- wxThread(wxTHREAD_JOINABLE),
+ProcessToolThread::ProcessToolThread(const ToolGUI *tool, Configuration &configuration, ThreadCommunicationBuffer &output) :
+ wxThread(wxTHREAD_JOINABLE),
_configuration(configuration),
- _output(output)
+ _output(output)
{
_tool = tool;
_finished = false;
_success = false;
-
+
_tool->_backend->setPrintFunction(writeToOutput, reinterpret_cast<void *>(this));
_tool->_backend->setProgressFunction(gaugeProgress, reinterpret_cast<void *>(this));
_tool->_backend->setSubprocessFunction(spawnSubprocess, reinterpret_cast<void *>(this));
@@ -1381,14 +1381,14 @@
void ProcessToolThread::writeToOutput(void *udata, const char *text) {
ProcessToolThread *self = reinterpret_cast<ProcessToolThread *>(udata);
-
+
wxMutexLocker lock(self->_output.mutex);
self->_output.buffer += text;
}
void ProcessToolThread::gaugeProgress(void *udata, int done, int total) {
ProcessToolThread *self = reinterpret_cast<ProcessToolThread *>(udata);
-
+
wxMutexLocker lock(self->_output.mutex);
self->_output.done = done;
self->_output.total = total;
@@ -1396,7 +1396,7 @@
int ProcessToolThread::spawnSubprocess(void *udata, const char *cmd) {
ProcessToolThread *self = reinterpret_cast<ProcessToolThread *>(udata);
-
+
wxASSERT_MSG(self->_output.subprocessFinished == NULL, wxT("You can only spawn one subprocess."));
wxMutexLocker mutex(self->_output.mutex);
@@ -1437,7 +1437,7 @@
sizer->AddSpacer(10);
- wxCheckBox *displayOut = new wxCheckBox(panel, wxID_ANY, wxT("Open output folder"), wxDefaultPosition, wxDefaultSize,
+ wxCheckBox *displayOut = new wxCheckBox(panel, wxID_ANY, wxT("Open output folder"), wxDefaultPosition, wxDefaultSize,
0, wxDefaultValidator, wxT("DisplayOutput"));
displayOut->SetValue(true);
sizer->Add(displayOut);
@@ -1469,7 +1469,7 @@
void FinishPage::updateButtons(wxWindow *panel, WizardButtons *buttons) {
buttons->enablePrevious(false);
buttons->showFinish(true);
-
+
WizardPage::updateButtons(panel, buttons);
}
@@ -1504,7 +1504,7 @@
void FailurePage::updateButtons(wxWindow *panel, WizardButtons *buttons) {
buttons->enablePrevious(false);
buttons->showFinish(true);
-
+
WizardPage::updateButtons(panel, buttons);
}
Modified: tools/trunk/gui/pages.h
===================================================================
--- tools/trunk/gui/pages.h 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/gui/pages.h 2009-12-30 15:34:00 UTC (rev 46751)
@@ -29,9 +29,9 @@
class wxFileDirPickerEvent;
/**
- * A backend of a page in the wizard
+ * A backend of a page in the wizard
* This class is decoupled from the UI, and you can spawn as many pages as you like from this template
- *
+ *
* @todo Add the ability to not have to have a ScummToolsFrame as parent, to be able to put the pages
* in a default config window, for example.
*/
@@ -53,7 +53,7 @@
/**
* Creates a visual representation of this page as a child problem of the supplied parent
* Values will be loaded from the configuration object stored by the ScummToolsFrame
- *
+ *
* @param parent The parent window, the page will be a direct child window of this window.
* @return The created window.
*/
@@ -71,9 +71,9 @@
* the ScummToolsFrame that was passed to the constructor
*
* @param panel Panel to read data from, should be a window created by CreatePanel
- */
+ */
virtual void save(wxWindow *panel);
-
+
/**
* Returns the associated help text with this page
*
@@ -82,7 +82,7 @@
virtual wxString getHelp();
// Event handlers
-
+
/**
* This handler is called when the user clicks the Next button, if you overload this
* you should generally just call switchPage with the next page in the wizard
@@ -127,8 +127,8 @@
virtual bool onIdle(wxPanel *panel);
protected:
- /**
- * This adds an offset (about 100px) to the left of the sizer to center the text somewhat, before adding it
+ /**
+ * This adds an offset (about 100px) to the left of the sizer to center the text somewhat, before adding it
* to the panel using wxWindow::SetSizer.
*
* @param panel The panel associated with this page, should have bene created by CreatePanel previously.
@@ -144,18 +144,18 @@
/**
* Introduction page. Introduces the option to extract, compress or the advanced route (choose tool manually)
- *
+ *
* @todo Add the ability to drag & drop files onto this window, to automatically detect whether to compress or extract
*/
class IntroPage : public WizardPage {
public:
IntroPage(Configuration &configuration);
-
+
wxWindow *CreatePanel(wxWindow *parent);
wxString getHelp();
-
+
void updateButtons(wxWindow *panel, WizardButtons *buttons);
void onClickCompress(wxCommandEvent &e);
@@ -181,11 +181,11 @@
void onNext(wxWindow *panel);
void save(wxWindow *panel);
-
+
wxString getHelp();
void onChangeTool(wxCommandEvent &evt);
-
+
void updateButtons(wxWindow *panel, WizardButtons *buttons);
protected:
@@ -201,7 +201,7 @@
ChooseIOPage(Configuration &configuration);
void onSelectFile(wxFileDirPickerEvent &evt);
-
+
void updateButtons(wxWindow *panel, WizardButtons *buttons);
};
@@ -216,11 +216,11 @@
wxWindow *CreatePanel(wxWindow *parent);
void onNext(wxWindow *panel);
-
+
wxString getHelp();
void save(wxWindow *panel);
-
+
void updateButtons(wxWindow *panel, WizardButtons *buttons);
};
@@ -235,7 +235,7 @@
wxWindow *CreatePanel(wxWindow *parent);
void onNext(wxWindow *panel);
-
+
wxString getHelp();
void save(wxWindow *panel);
@@ -255,7 +255,7 @@
wxWindow *CreatePanel(wxWindow *parent);
void onNext(wxWindow *panel);
-
+
wxString getHelp();
void save(wxWindow *panel);
@@ -274,7 +274,7 @@
wxWindow *CreatePanel(wxWindow *parent);
void onNext(wxWindow *panel);
-
+
wxString getHelp();
void save(wxWindow *panel);
@@ -291,7 +291,7 @@
wxWindow *CreatePanel(wxWindow *parent);
void onNext(wxWindow *panel);
-
+
wxString getHelp();
void save(wxWindow *panel);
@@ -401,8 +401,8 @@
void abort();
/**
- * Write to the output window pointed to by udata, this adds
- * the message to a locked queue, and prints it to the GUI from
+ * Write to the output window pointed to by udata, this adds
+ * the message to a locked queue, and prints it to the GUI from
* the main thread, as doing it from another thread can cause weird bugs.
*/
static void writeToOutput(void *udata, const char *text);
@@ -465,7 +465,7 @@
* @param outwin Text control to redirect output to
*/
void runTool();
-
+
wxString getHelp();
bool onIdle(wxPanel *panel);
@@ -486,7 +486,7 @@
FinishPage(Configuration &configuration);
wxWindow *CreatePanel(wxWindow *parent);
-
+
wxString getHelp();
void onNext(wxWindow *panel);
Modified: tools/trunk/scummvm-tools-cli.cpp
===================================================================
--- tools/trunk/scummvm-tools-cli.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/scummvm-tools-cli.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -34,7 +34,7 @@
int ToolsCLI::run(int argc, char *argv[]) {
// No matter what we ouput, we should begin with a newline
- std::cout << std::endl;
+ std::cout << std::endl;
if (argc == 1) {
// Run without any arguments
@@ -90,7 +90,7 @@
std::deque<std::string>::reverse_iterator reader = arguments.rbegin();
std::deque<std::string>::iterator hint_arg;
std::string infile;
-
+
hint_arg = std::find(arguments.begin(), arguments.end(), "compress");
if (hint_arg != arguments.end()) {
type = TOOLTYPE_COMPRESSION;
@@ -113,7 +113,7 @@
// It must be a filename now
choices = inspectInput(*reader, type);
-
+
// If anything matched, we stop
if (choices.size() > 0) {
infile = *reader;
@@ -167,7 +167,7 @@
if (!std::cin) {
// Clear any error flags
std::cin.clear();
-
+
std::string q;
std::cin >> q;
if (q == "q" || q == "exit" || q == "quit" || q == "abort")
@@ -184,7 +184,7 @@
}
std::cout << "\tRunning using " << tool->getName() << std::endl;
-
+
// Run the tool, with the remaining arguments
arguments.push_front(tool->getName());
return tool->run(arguments);
@@ -194,7 +194,7 @@
}
void ToolsCLI::printHelp(const char *exeName) {
- std::cout <<
+ std::cout <<
"\tScummVM Tools master interface" << std::endl <<
std::endl <<
"\tCommon use:" << std::endl <<
Modified: tools/trunk/tool.cpp
===================================================================
--- tools/trunk/tool.cpp 2009-12-30 15:29:52 UTC (rev 46750)
+++ tools/trunk/tool.cpp 2009-12-30 15:34:00 UTC (rev 46751)
@@ -133,8 +133,8 @@
void Tool::run() {
// Reset abort state
_abort = false;
-
+
setTempFileName();
@@ Diff output truncated at 100000 characters. @@
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