Skip to content

Commit

Permalink
ALL: Use initPlatform() in every single tool
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 19, 2016
1 parent efe43ed commit c1018fa
Show file tree
Hide file tree
Showing 21 changed files with 82 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cbgt2tga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

#include "src/images/cbgt.h"

#include "src/util.h"

void printUsage(FILE *stream, const Common::UString &name);
bool parseCommandLine(const std::vector<Common::UString> &argv, int &returnValue,
Common::UString &cbgtFile , Common::UString &palFile,
Expand All @@ -48,6 +50,8 @@ void convert(const Common::UString &cbgtFile , const Common::UString &palFile,
const Common::UString &twoDAFile, const Common::UString &outFile);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
4 changes: 4 additions & 0 deletions src/cdpth2tga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

#include "src/images/cdpth.h"

#include "src/util.h"

void printUsage(FILE *stream, const Common::UString &name);
bool parseCommandLine(const std::vector<Common::UString> &argv, int &returnValue,
Common::UString &cdpthFile, Common::UString &twoDAFile,
Expand All @@ -49,6 +51,8 @@ void convert(const Common::UString &cdpthFile, const Common::UString &twoDAFile,
const Common::UString &outFile);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
4 changes: 4 additions & 0 deletions src/convert2da.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#include "src/aurora/2dafile.h"
#include "src/aurora/gdafile.h"

#include "src/util.h"

enum Format {
kFormat2DA,
kFormat2DAb,
Expand All @@ -58,6 +60,8 @@ void convert2DA(const Common::UString &file, const Common::UString &outFile, For
void convert2DA(const std::vector<Common::UString> &files, const Common::UString &outFile, Format format);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
4 changes: 4 additions & 0 deletions src/desmall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@

#include "src/aurora/smallfile.h"

#include "src/util.h"

void printUsage(FILE *stream, const Common::UString &name);
bool parseCommandLine(const std::vector<Common::UString> &argv, int &returnValue,
Common::UString &inFile, Common::UString &outFile);

void desmall(const Common::UString &inFile, const Common::UString &outFile);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
4 changes: 4 additions & 0 deletions src/fixpremiumgff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@

#include "src/aurora/types.h"

#include "src/util.h"

void printUsage(FILE *stream, const Common::UString &name);
bool parseCommandLine(const std::vector<Common::UString> &argv, int &returnValue,
Common::UString &inFile, Common::UString &outFile, Common::UString &id);

void fixPremiumGFF(Common::UString &inFile, Common::UString &outFile, Common::UString &id);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
4 changes: 4 additions & 0 deletions src/gff2xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

#include "src/xml/gffdumper.h"

#include "src/util.h"

typedef std::map<uint32, Common::Encoding> EncodingOverrides;

void printUsage(FILE *stream, const Common::UString &name);
Expand All @@ -56,6 +58,8 @@ void dumpGFF(const Common::UString &inFile, const Common::UString &outFile,
Common::Encoding encoding, bool nwnPremium);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
4 changes: 4 additions & 0 deletions src/nbfs2tga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

#include "src/images/nbfs.h"

#include "src/util.h"

void printUsage(FILE *stream, const Common::UString &name);
bool parseCommandLine(const std::vector<Common::UString> &argv, int &returnValue,
Common::UString &nbfsFile, Common::UString &nbfpFile,
Expand All @@ -49,6 +51,8 @@ void convert(const Common::UString &nbfsFile, const Common::UString &nbfpFile,
const Common::UString &outFile, uint32 width, uint32 height);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
4 changes: 4 additions & 0 deletions src/ncgr2tga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

#include "src/images/ncgr.h"

#include "src/util.h"

void printUsage(FILE *stream, const Common::UString &name);
bool parseCommandLine(const std::vector<Common::UString> &argv, int &returnValue,
uint32 &width, uint32 &height, std::vector<Common::UString> &ncgrFiles,
Expand All @@ -50,6 +52,8 @@ void convert(std::vector<Common::UString> &ncgrFiles, Common::UString &nclrFile,
Common::UString &outFile, uint32 width, uint32 height);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
4 changes: 4 additions & 0 deletions src/ncsdis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

#include "src/nwscript/disassembler.h"

#include "src/util.h"

enum Command {
kCommandNone = -1,
kCommandListing = 0,
Expand All @@ -60,6 +62,8 @@ void disNCS(const Common::UString &inFile, const Common::UString &outFile,
Aurora::GameID &game, Command &command, bool printStack, bool printControlTypes);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
14 changes: 14 additions & 0 deletions src/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ noinst_HEADERS += \
bin_PROGRAMS += src/gff2xml
src_gff2xml_SOURCES = \
src/gff2xml.cpp \
src/util.cpp \
$(EMPTY)
src_gff2xml_LDADD = \
src/xml/libxml.la \
Expand All @@ -44,6 +45,7 @@ src_gff2xml_LDADD = \
bin_PROGRAMS += src/tlk2xml
src_tlk2xml_SOURCES = \
src/tlk2xml.cpp \
src/util.cpp \
$(EMPTY)
src_tlk2xml_LDADD = \
src/xml/libxml.la \
Expand All @@ -56,6 +58,7 @@ src_tlk2xml_LDADD = \
bin_PROGRAMS += src/ssf2xml
src_ssf2xml_SOURCES = \
src/ssf2xml.cpp \
src/util.cpp \
$(EMPTY)
src_ssf2xml_LDADD = \
src/xml/libxml.la \
Expand All @@ -68,6 +71,7 @@ src_ssf2xml_LDADD = \
bin_PROGRAMS += src/xml2tlk
src_xml2tlk_SOURCES = \
src/xml2tlk.cpp \
src/util.cpp \
$(EMPTY)
src_xml2tlk_LDADD = \
src/xml/libxml.la \
Expand All @@ -80,6 +84,7 @@ src_xml2tlk_LDADD = \
bin_PROGRAMS += src/xml2ssf
src_xml2ssf_SOURCES = \
src/xml2ssf.cpp \
src/util.cpp \
$(EMPTY)
src_xml2ssf_LDADD = \
src/xml/libxml.la \
Expand All @@ -92,6 +97,7 @@ src_xml2ssf_LDADD = \
bin_PROGRAMS += src/convert2da
src_convert2da_SOURCES = \
src/convert2da.cpp \
src/util.cpp \
$(EMPTY)
src_convert2da_LDADD = \
src/aurora/libaurora.la \
Expand All @@ -103,6 +109,7 @@ src_convert2da_LDADD = \
bin_PROGRAMS += src/fixpremiumgff
src_fixpremiumgff_SOURCES = \
src/fixpremiumgff.cpp \
src/util.cpp \
$(EMPTY)
src_fixpremiumgff_LDADD = \
src/aurora/libaurora.la \
Expand Down Expand Up @@ -189,6 +196,7 @@ src_unnsbtx_LDADD = \
bin_PROGRAMS += src/desmall
src_desmall_SOURCES = \
src/desmall.cpp \
src/util.cpp \
$(EMPTY)
src_desmall_LDADD = \
src/aurora/libaurora.la \
Expand All @@ -200,6 +208,7 @@ src_desmall_LDADD = \
bin_PROGRAMS += src/xoreostex2tga
src_xoreostex2tga_SOURCES = \
src/xoreostex2tga.cpp \
src/util.cpp \
$(EMPTY)
src_xoreostex2tga_LDADD = \
src/images/libimages.la \
Expand All @@ -212,6 +221,7 @@ src_xoreostex2tga_LDADD = \
bin_PROGRAMS += src/nbfs2tga
src_nbfs2tga_SOURCES = \
src/nbfs2tga.cpp \
src/util.cpp \
$(EMPTY)
src_nbfs2tga_LDADD = \
src/images/libimages.la \
Expand All @@ -224,6 +234,7 @@ src_nbfs2tga_LDADD = \
bin_PROGRAMS += src/ncgr2tga
src_ncgr2tga_SOURCES = \
src/ncgr2tga.cpp \
src/util.cpp \
$(EMPTY)
src_ncgr2tga_LDADD = \
src/images/libimages.la \
Expand All @@ -236,6 +247,7 @@ src_ncgr2tga_LDADD = \
bin_PROGRAMS += src/cbgt2tga
src_cbgt2tga_SOURCES = \
src/cbgt2tga.cpp \
src/util.cpp \
$(EMPTY)
src_cbgt2tga_LDADD = \
src/images/libimages.la \
Expand All @@ -248,6 +260,7 @@ src_cbgt2tga_LDADD = \
bin_PROGRAMS += src/cdpth2tga
src_cdpth2tga_SOURCES = \
src/cdpth2tga.cpp \
src/util.cpp \
$(EMPTY)
src_cdpth2tga_LDADD = \
src/images/libimages.la \
Expand All @@ -260,6 +273,7 @@ src_cdpth2tga_LDADD = \
bin_PROGRAMS += src/ncsdis
src_ncsdis_SOURCES = \
src/ncsdis.cpp \
src/util.cpp \
$(EMPTY)
src_ncsdis_LDADD = \
src/nwscript/libnwscript.la \
Expand Down
4 changes: 4 additions & 0 deletions src/ssf2xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@

#include "src/xml/ssfdumper.h"

#include "src/util.h"

void printUsage(FILE *stream, const Common::UString &name);
bool parseCommandLine(const std::vector<Common::UString> &argv, int &returnValue,
Common::UString &inFile, Common::UString &outFile);

void dumpSSF(const Common::UString &inFile, const Common::UString &outFile);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
4 changes: 4 additions & 0 deletions src/tlk2xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

#include "src/xml/tlkdumper.h"

#include "src/util.h"

void printUsage(FILE *stream, const Common::UString &name);
bool parseCommandLine(const std::vector<Common::UString> &argv, int &returnValue,
Common::UString &inFile, Common::UString &outFile,
Expand All @@ -50,6 +52,8 @@ bool parseCommandLine(const std::vector<Common::UString> &argv, int &returnValue
void dumpTLK(const Common::UString &inFile, const Common::UString &outFile, Common::Encoding encoding);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
2 changes: 2 additions & 0 deletions src/unerf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ void extractFiles(Aurora::ERFFile &erf, Aurora::GameID game,
std::set<Common::UString> &files, ExtractMode mode);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
2 changes: 2 additions & 0 deletions src/unherf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ void listFiles(Aurora::HERFFile &rim);
void extractFiles(Aurora::HERFFile &rim);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
2 changes: 2 additions & 0 deletions src/unkeybif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ void extractFiles(const Aurora::BIFFile &bif, Aurora::GameID game);
void extractFiles(const std::vector<Aurora::BIFFile *> &bifs, const std::vector<Common::UString> &bifFiles, Aurora::GameID game);

int main(int argc, char **argv) {
initPlatform();

std::vector<Aurora::KEYFile *> keys;
std::vector<Aurora::BIFFile *> bifs;

Expand Down
2 changes: 2 additions & 0 deletions src/unnds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ void listFiles(Aurora::NDSFile &nds);
void extractFiles(Aurora::NDSFile &nds);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
2 changes: 2 additions & 0 deletions src/unnsbtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ void listFiles(Aurora::NSBTXFile &nsbtx);
void extractFiles(Aurora::NSBTXFile &nsbtx);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
2 changes: 2 additions & 0 deletions src/unrim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ void listFiles(Aurora::RIMFile &rim, Aurora::GameID game);
void extractFiles(Aurora::RIMFile &rim, Aurora::GameID);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
4 changes: 4 additions & 0 deletions src/xml2ssf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@

#include "src/xml/ssfcreator.h"

#include "src/util.h"

void printUsage(FILE *stream, const Common::UString &name);
bool parseCommandLine(const std::vector<Common::UString> &argv, int &returnValue,
Common::UString &inFile, Common::UString &outFile, Aurora::GameID &game);

void createSSF(const Common::UString &inFile, const Common::UString &outFile, Aurora::GameID game);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down
4 changes: 4 additions & 0 deletions src/xml2tlk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

#include "src/xml/tlkcreator.h"

#include "src/util.h"

void printUsage(FILE *stream, const Common::UString &name);
bool parseCommandLine(const std::vector<Common::UString> &argv, int &returnValue,
Common::UString &inFile, Common::UString &outFile,
Expand All @@ -52,6 +54,8 @@ void createTLK(const Common::UString &inFile, const Common::UString &outFile, Co
XML::TLKCreator::Version &version, uint32 &language);

int main(int argc, char **argv) {
initPlatform();

try {
std::vector<Common::UString> args;
Common::Platform::getParameters(argc, argv, args);
Expand Down

0 comments on commit c1018fa

Please sign in to comment.