From 184b82abccfff95b18bed81ded1b5a7e98d2dbd3 Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 24 Dec 2008 11:18:01 -0600 Subject: Backed out changeset: ad4f100c0a9d --HG-- branch : trunk --- contrib/extractor/System.cpp | 118 +++++++++++++++++-------------------------- 1 file changed, 47 insertions(+), 71 deletions(-) (limited to 'contrib/extractor/System.cpp') diff --git a/contrib/extractor/System.cpp b/contrib/extractor/System.cpp index 1753f40801a..197c4d35416 100644 --- a/contrib/extractor/System.cpp +++ b/contrib/extractor/System.cpp @@ -16,24 +16,21 @@ extern unsigned int iRes; extern ArchiveSet gOpenArchives; -bool ConvertADT(char*, char*); +bool ConvertADT(char*,char*); -typedef struct -{ +typedef struct{ char name[64]; - uint32 id; -} map_id; + unsigned int id; +}map_id; typedef unsigned char uint8; typedef unsigned short uint16; typedef unsigned int uint32; -map_id *map_ids; -uint16 *areas; -uint16 *LiqType; -char output_path[128] = "."; -char input_path[128] = "."; -uint32 maxAreaId = 0; +map_id * map_ids; +uint16 * areas; +char output_path[128]="."; +char input_path[128]="."; enum Extract { @@ -69,45 +66,46 @@ bool FileExists( const char* FileName ) void Usage(char* prg) { - printf("Usage:\n%s -[var] [value]\n-i set input path\n-o set output path\n-r set resolution\n-e extract only MAP(1)/DBC(2) - standard: both(3)\nExample: %s -r 256 -i \"c:\\games\\game\"", prg, prg); + printf("Usage:\n%s -[var] [value]\n-i set input path\n-o set output path\n-r set resolution\n-e extract only MAP(1)/DBC(2) - standard: both(3)\nExample: %s -r 256 -i \"c:\\games\\game\"", + prg,prg); exit(1); } void HandleArgs(int argc, char * arg[]) { - for(int c = 1; c < argc; ++c) + for(int c=1;c 0 && extract < 4)) Usage(arg[0]); } @@ -124,12 +122,12 @@ uint32 ReadMapDBC() DBCFile dbc("DBFilesClient\\Map.dbc"); dbc.open(); - size_t map_count = dbc.getRecordCount(); - map_ids = new map_id[map_count]; - for(uint32 x = 0; x < map_count; ++x) + uint32 map_count=dbc.getRecordCount(); + map_ids=new map_id[map_count]; + for(unsigned int x=0;xc_str() + strlen("DBFilesClient\\")); - FILE *output = fopen(filename.c_str(), "wb"); + FILE *output=fopen(filename.c_str(), "wb"); if(!output) { printf("Can't create the output file '%s'\n", filename.c_str()); @@ -283,9 +261,7 @@ void LoadCommonMPQFiles() { char filename[512]; - sprintf(filename,"%s/Data/common-2.MPQ", input_path); - new MPQArchive(filename); - sprintf(filename,"%s/Data/lichking.MPQ", input_path); + sprintf(filename,"%s/Data/common.MPQ", input_path); new MPQArchive(filename); sprintf(filename,"%s/Data/expansion.MPQ", input_path); new MPQArchive(filename); @@ -295,7 +271,7 @@ void LoadCommonMPQFiles() if(i > 1) sprintf(ext, "-%i", i); - sprintf(filename, "%s/Data/patch%s.MPQ", input_path, ext); + sprintf(filename,"%s/Data/patch%s.MPQ", input_path, ext); if(FileExists(filename)) new MPQArchive(filename); } -- cgit v1.2.3