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

cut a versioned release before making potentially breaking changes

This commit is contained in:
2024-03-21 04:38:23 +11:00
parent a222235605
commit d59fb39857
3 changed files with 16 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.1 FATAL_ERROR) cmake_minimum_required(VERSION "3.5" FATAL_ERROR)
project(tmx2gba) project(tmx2gba VERSION "0.3")
# Options # Options
option(TMX2GBA_DKP_INSTALL "Install into DEVKITPRO prefix" OFF) option(TMX2GBA_DKP_INSTALL "Install into DEVKITPRO prefix" OFF)

View File

@@ -20,6 +20,7 @@ tmx2gba [-h] [-r offset] [-lyc name] [-p 0-15] <-i inpath> <-o outpath>
| Command | Required | Notes | | Command | Required | Notes |
|--------------|----------|-----------------------------------------------------------------------| |--------------|----------|-----------------------------------------------------------------------|
| -h | N/A | Display help & command info. | | -h | N/A | Display help & command info. |
| -v | No | Display version & quit. |
| -l (name) | No | Name of layer to use (default first layer in TMX). | | -l (name) | No | Name of layer to use (default first layer in TMX). |
| -y (name) | No | Layer for palette mappings. | | -y (name) | No | Layer for palette mappings. |
| -c (name) | No | Output a separate 8bit collision map of the specified layer. | | -c (name) | No | Output a separate 8bit collision map of the specified layer. |

View File

@@ -15,8 +15,10 @@
const std::string helpUsage = "Usage: tmx2gba [-h] [-f file] [-r offset] [-lyc name] [-p 0-15] [-m name;id] <-i inpath> <-o outpath>"; const std::string helpUsage = "Usage: tmx2gba [-h] [-f file] [-r offset] [-lyc name] [-p 0-15] [-m name;id] <-i inpath> <-o outpath>";
const std::string helpShort = "Run 'tmx2gba -h' to view all available options."; const std::string helpShort = "Run 'tmx2gba -h' to view all available options.";
const std::string versionStr = "tmx2gba version 0.3, (c) 2015-2022 a dinosaur";
const std::string helpFull = R"( const std::string helpFull = R"(
-h ------------ Display this help & command info. -h ------------ Display this help & command info.
-v ------------ Display version & quit.
-l <name> ----- Name of layer to use (default first layer in TMX). -l <name> ----- Name of layer to use (default first layer in TMX).
-y <name> ----- Layer for palette mappings. -y <name> ----- Layer for palette mappings.
-c <name> ----- Output a separate 8bit collision map of the specified layer. -c <name> ----- Output a separate 8bit collision map of the specified layer.
@@ -29,7 +31,7 @@ const std::string helpFull = R"(
struct Arguments struct Arguments
{ {
bool help = false; bool help = false, showVersion = false;
std::string inPath, outPath; std::string inPath, outPath;
std::string layer, collisionlay, paletteLay; std::string layer, collisionlay, paletteLay;
std::string flagFile; std::string flagFile;
@@ -43,13 +45,16 @@ void ParseArgs(int argc, char** argv, Arguments& p)
{ {
int opt; int opt;
optreset = 1; optreset = 1;
while ((opt = getopt(argc, argv, "hr:l:c:p:y:m:i:o:f:")) > 0) while ((opt = getopt(argc, argv, "hvr:l:c:p:y:m:i:o:f:")) > 0)
{ {
switch (opt) switch (opt)
{ {
case ('h'): case ('h'):
p.help = true; p.help = true;
return; return;
case ('v'):
p.showVersion = true;
return;
case ('l'): p.layer = optarg; break; case ('l'): p.layer = optarg; break;
case ('c'): p.collisionlay = optarg; break; case ('c'): p.collisionlay = optarg; break;
@@ -146,6 +151,11 @@ int main(int argc, char** argv)
std::cout << helpUsage << std::endl << helpFull << std::endl; std::cout << helpUsage << std::endl << helpFull << std::endl;
return 0; return 0;
} }
if (p.showVersion)
{
std::cout << versionStr << std::endl;
return 0;
}
if (!p.flagFile.empty()) if (!p.flagFile.empty())
{ {
@@ -155,7 +165,7 @@ int main(int argc, char** argv)
std::cerr << "Failed to open param file." << std::endl; std::cerr << "Failed to open param file." << std::endl;
return -1; return -1;
} }
std::vector<std::string> fileArgTokens; std::vector<std::string> fileArgTokens;
fileArgTokens.push_back("auu~~"); fileArgTokens.push_back("auu~~");
bool carry = false; bool carry = false;