* stuffextract is now officially cross-platform as far as linux is concerned
* libbz2 is required to successfully compile stuffextract * the compiled executable has to be renamed because it creates a folder named stuffextract ;)
This commit is contained in:
parent
0b7511bf27
commit
860b1ef7cd
@ -65,6 +65,9 @@ AC_CHECK_FUNCS([floor ftime ftruncate getcwd gethostbyaddr gethostbyname gethost
|
||||
# src/dep/src/irrlicht/libpng])
|
||||
AC_CONFIG_FILES([Makefile
|
||||
src/Makefile
|
||||
src/tools/Makefile
|
||||
src/tools/stuffextract/Makefile
|
||||
src/tools/stuffextract/StormLib/Makefile
|
||||
src/shared/Makefile
|
||||
src/shared/Auth/Makefile
|
||||
src/shared/Network/Makefile
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
## Makefile.am - process this file with automake
|
||||
AM_CPPFLAGS = -I$(top_builddir)/src/Client -I$(top_builddir)/src/shared -I$(top_builddir)/src/Client/DefScript -I$(top_builddir)/src/Client/World -I$(top_builddir)/src/Client/Realm -Wall
|
||||
SUBDIRS = shared Client
|
||||
SUBDIRS = shared Client tools
|
||||
## End Makefile.am
|
||||
|
||||
4
src/tools/Makefile.am
Normal file
4
src/tools/Makefile.am
Normal file
@ -0,0 +1,4 @@
|
||||
## Makefile.am - process this file with automake
|
||||
AM_CPPFLAGS = -I$(top_builddir)/src/Client -I$(top_builddir)/src/shared -I$(top_builddir)/src/Client/DefScript -I$(top_builddir)/src/Client/World -I$(top_builddir)/src/Client/Realm -Wall
|
||||
SUBDIRS = stuffextract
|
||||
## End Makefile.am
|
||||
8
src/tools/stuffextract/Makefile.am
Normal file
8
src/tools/stuffextract/Makefile.am
Normal file
@ -0,0 +1,8 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
SUBDIRS = StormLib
|
||||
AM_CPPFLAGS = -I$(top_builddir)/src/Client -I$(top_builddir)/src/shared -I$(top_builddir)/src/Client/DefScript -I$(top_builddir)/src/Client/World -I$(top_builddir)/src/Client/Realm -Wall
|
||||
## Build pseuwow
|
||||
bin_PROGRAMS = stuffextract
|
||||
stuffextract_SOURCES = dbcfile.cpp Locale.cpp MPQFile.cpp MPQHelper.cpp StuffExtract.cpp
|
||||
|
||||
stuffextract_LDADD = StormLib/libstormlib.a ../../shared/Auth/libauth.a ../../shared/libshared.a -lbz2
|
||||
11
src/tools/stuffextract/StormLib/Makefile.am
Normal file
11
src/tools/stuffextract/StormLib/Makefile.am
Normal file
@ -0,0 +1,11 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
AM_CPPFLAGS = -I$(top_builddir)/src/Client -I$(top_builddir)/src/shared -I$(top_builddir)/src/Client/DefScript -I$(top_builddir)/src/Client/World -I$(top_builddir)/src/Client/Realm -Wall -D__SYS_ZLIB
|
||||
AM_CFLAGS = -fPIC
|
||||
## Build pseuwow
|
||||
noinst_LIBRARIES = libstormlib.a
|
||||
libstormlib_a_SOURCES =huffman/huff.cpp\
|
||||
wave/wave.cpp\
|
||||
StormPortLinux.cpp\
|
||||
SFileReadFile.cpp SCommon.cpp SCompression.cpp SFileCompactArchive.cpp SFileCreateArchiveEx.cpp SFileExtractFile.cpp SFileFindFile.cpp SFileOpenArchive.cpp\
|
||||
SFileOpenFileEx.cpp SListFile.cpp\
|
||||
pklib/crc32_pk.c pklib/explode.c pklib/implode.c
|
||||
@ -114,7 +114,11 @@
|
||||
typedef long LONG_PTR;
|
||||
typedef long long LONGLONG;
|
||||
#ifndef __OBJC__
|
||||
#ifdef __cplusplus
|
||||
#define BOOL bool
|
||||
#else
|
||||
#define BOOL int
|
||||
#endif
|
||||
#endif
|
||||
typedef void * HANDLE;
|
||||
typedef void * LPOVERLAPPED; // Unsupported on Linux
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
#include "DBCFieldData.h"
|
||||
#include "Locale.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "../../Client/Gui/CM2MeshFileLoader.h"
|
||||
#include "../../Client/GUI/CM2MeshFileLoader.h"
|
||||
|
||||
int replaceSpaces (int i) { return i==(int)' ' ? (int)'_' : i; }
|
||||
|
||||
@ -605,7 +605,7 @@ void ExtractMaps(void)
|
||||
char wdt_name[300], wdt_out[300];
|
||||
sprintf(wdt_name,"World\\Maps\\%s\\%s.wdt",it->second.c_str(),it->second.c_str());
|
||||
sprintf(wdt_out,MAPSDIR"/%u.wdt",it->first);
|
||||
ByteBuffer& wdt_bb = mpq.ExtractFile(wdt_name);
|
||||
const ByteBuffer& wdt_bb = mpq.ExtractFile(wdt_name);
|
||||
std::fstream wdt_fh;
|
||||
wdt_fh.open(wdt_out, std::ios_base::out|std::ios_base::binary);
|
||||
if(!wdt_fh.is_open())
|
||||
@ -631,7 +631,7 @@ void ExtractMaps(void)
|
||||
sprintf(outbuf,MAPSDIR"/%u_%u_%u.adt",it->first,x,y);
|
||||
if(mpq.FileExists(namebuf))
|
||||
{
|
||||
ByteBuffer& bb = mpq.ExtractFile(namebuf);
|
||||
const ByteBuffer& bb = mpq.ExtractFile(namebuf);
|
||||
if(bb.size())
|
||||
{
|
||||
std::fstream fh;
|
||||
@ -726,7 +726,7 @@ void ExtractMapDependencies(void)
|
||||
fh.open(realfn.c_str(),std::ios_base::out | std::ios_base::binary);
|
||||
if(fh.is_open())
|
||||
{
|
||||
ByteBuffer& bb = mpqmodel.ExtractFile((char*)mpqfn.c_str());
|
||||
ByteBuffer bb = mpqmodel.ExtractFile((char*)mpqfn.c_str());
|
||||
fh.write((const char*)bb.contents(),bb.size());
|
||||
if (doTextures)
|
||||
FetchTexturesFromModel(bb);
|
||||
@ -770,7 +770,7 @@ void ExtractMapDependencies(void)
|
||||
std::string copy = NormalizeFilename(mpqfn);
|
||||
if (copy.find_first_of("/") != std::string::npos)
|
||||
{
|
||||
std::string copy2 = copy;
|
||||
std::string copy2 = copy.c_str();
|
||||
char* tok = strtok((char*)copy2.c_str(),"/");
|
||||
std::string fullpath = pathtex;
|
||||
while (tok && !strstr(tok, ".blp"))
|
||||
@ -787,7 +787,7 @@ void ExtractMapDependencies(void)
|
||||
fh.open(realfn.c_str(),std::ios_base::out | std::ios_base::binary);
|
||||
if(fh.is_open())
|
||||
{
|
||||
ByteBuffer& bb = mpqtex.ExtractFile((char*)mpqfn.c_str());
|
||||
const ByteBuffer& bb = mpqtex.ExtractFile((char*)mpqfn.c_str());
|
||||
fh.write((const char*)bb.contents(),bb.size());
|
||||
if(doMd5)
|
||||
{
|
||||
@ -828,7 +828,7 @@ void ExtractMapDependencies(void)
|
||||
fh.open(realfn.c_str(),std::ios_base::out | std::ios_base::binary);
|
||||
if(fh.is_open())
|
||||
{
|
||||
ByteBuffer& bb = mpqwmo.ExtractFile((char*)mpqfn.c_str());
|
||||
const ByteBuffer& bb = mpqwmo.ExtractFile((char*)mpqfn.c_str());
|
||||
fh.write((const char*)bb.contents(),bb.size());
|
||||
if(doMd5)
|
||||
{
|
||||
@ -877,7 +877,7 @@ void ExtractSoundFiles(void)
|
||||
fh.open(outfn.c_str(), std::ios_base::out | std::ios_base::binary);
|
||||
if(fh.is_open())
|
||||
{
|
||||
ByteBuffer& bb = smpq.ExtractFile((char*)i->name.c_str());
|
||||
const ByteBuffer& bb = smpq.ExtractFile((char*)i->name.c_str());
|
||||
if(bb.size())
|
||||
{
|
||||
fh.write((const char*)bb.contents(),bb.size());
|
||||
@ -943,7 +943,7 @@ void ADT_FillModelData(const uint8* data,std::set<NameAndAlt>& st)
|
||||
ADT_ExportStringSetByOffset(data,OFFSET_MODELS,st,"DIMM");
|
||||
}
|
||||
|
||||
void FetchTexturesFromModel(ByteBuffer& bb)
|
||||
void FetchTexturesFromModel(ByteBuffer bb)
|
||||
{
|
||||
bb.rpos(0);
|
||||
irr::scene::ModelHeader header;
|
||||
|
||||
@ -39,7 +39,7 @@ void ExtractMaps(void);
|
||||
void ExtractMapDependencies(void);
|
||||
void ExtractSoundFiles(void);
|
||||
|
||||
void FetchTexturesFromModel(ByteBuffer&);
|
||||
void FetchTexturesFromModel(ByteBuffer);
|
||||
|
||||
void ADT_ExportStringSetByOffset(const uint8*, uint32, std::set<NameAndAlt>&, char*);
|
||||
void ADT_FillTextureData(const uint8*,std::set<NameAndAlt>&);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user