1
0
mirror of https://github.com/ScrelliCopter/tmx2gba.git synced 2025-02-21 03:29:25 +11:00

Added CMake build.

Code changes to support Linux.
Updated documentation & README.md, which were sorely out of date.
Updated copyrights. *yawn*
This commit is contained in:
2018-12-05 23:17:54 +11:00
parent 29b64fffaf
commit 3f8d0d5d2e
7 changed files with 90 additions and 24 deletions

View File

@@ -149,13 +149,6 @@ char *optarg; // global argument pointer
char *next;
int optind = 0; // global argv index
void getoptClear ()
{
optarg = nullptr;
next = nullptr;
optind = 0;
}
int getopt(int argc, char *argv[], char *optstring)
{
if (optind == 0)

View File

@@ -1,7 +1,7 @@
/*
base64.cpp and base64.h
Copyright (C) 2004-2008 René Nyffenegger
Copyright (C) 2004-2008 René Nyffenegger
This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages
@@ -21,7 +21,7 @@
3. This notice may not be removed or altered from any source distribution.
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/

View File

@@ -1,6 +1,6 @@
/* tmx2gba.cpp
Copyright (C) 2015 Nicholas Curtis
Copyright (C) 2015-2018 Nicholas Curtis (a dinosaur)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -31,7 +31,12 @@
#include <string>
#include <cstdint>
#include <algorithm>
#include <XGetopt.h>
#ifdef _MSC_VER
#include <XGetopt.h>
#else
#include <getopt.h>
#endif
using std::cout;
using std::cerr;
@@ -58,7 +63,7 @@ static const string g_strHelpFull = R"(
-m <name;id> -- Map an object name to an ID, will enable object exports.
-i <path> ----- Path to input TMX file.
-o <path> ----- Path to output files.
-f <file> ----- Specify a file to use for flags, will override any options specified in the cmd line.)";
-f <file> ----- Specify a file to use for flags, will override any options specified on the command line.)";
struct SParams
{
@@ -72,10 +77,19 @@ struct SParams
bool objExport = false;
};
void GetoptClear ()
{
optarg = nullptr;
optind = 0;
#ifdef _MSC_VER
next = nullptr;
#endif
}
void ParseArgs ( int argc, char** argv, SParams* params )
{
char cOption;
getoptClear ();
GetoptClear ();
while ( ( cOption = (char)getopt ( argc, argv, "hr:l:c:p:y:m:i:o:f:" ) ) > 0 )
{
switch ( cOption )

View File

@@ -5,11 +5,11 @@
#include <vector>
#include <string>
#include <cstdint>
#include <rapidxml/rapidxml.hpp>
class CTmxTileset;
class CTmxLayer;
class CTmxObject;
namespace rapidxml { template<class Ch = char> class xml_node; }
class CTmxReader
{