From 03a2bbcd76795d97aeeb874079d94b0cdb48e60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 10 May 2017 20:55:13 -0700 Subject: [PATCH] Cleanup. --- include/bimg/bimg.h | 2 +- tools/texturec/texturec.cpp | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/include/bimg/bimg.h b/include/bimg/bimg.h index 7f9cc24..c425852 100644 --- a/include/bimg/bimg.h +++ b/include/bimg/bimg.h @@ -9,7 +9,7 @@ #include // uint32_t #include // NULL -#define BIMG_API_VERSION 1 +#define BIMG_API_VERSION UINT32_C(1) namespace bx { diff --git a/tools/texturec/texturec.cpp b/tools/texturec/texturec.cpp index c18cb76..8fcb48a 100644 --- a/tools/texturec/texturec.cpp +++ b/tools/texturec/texturec.cpp @@ -22,6 +22,9 @@ #include #include +#define BIMG_TEXTUREC_VERSION_MAJOR 1 +#define BIMG_TEXTUREC_VERSION_MINOR 0 + struct Options { Options() @@ -404,14 +407,6 @@ bimg::ImageContainer* convert(bx::AllocatorI* _allocator, const void* _inputData return output; } -#define BIMG_TEXTUREC_VERSION_MAJOR 1 -#define BIMG_TEXTUREC_VERSION_MINOR 0 - -#define BIMG_TEXTUREC_VERSION_STR \ - BX_STRINGIZE(BIMG_TEXTUREC_VERSION_MAJOR) \ - "." BX_STRINGIZE(BIMG_TEXTUREC_VERSION_MINOR) \ - "." BX_STRINGIZE(BIMG_API_VERSION) - void help(const char* _error = NULL) { if (NULL != _error) @@ -420,9 +415,12 @@ void help(const char* _error = NULL) } fprintf(stderr - , "texturec, bgfx texture compiler tool, version " BIMG_TEXTUREC_VERSION_STR "\n" + , "texturec, bgfx texture compiler tool, version %d.%d.%d.\n" "Copyright 2011-2017 Branimir Karadzic. All rights reserved.\n" "License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n\n" + , BIMG_TEXTUREC_VERSION_MAJOR + , BIMG_TEXTUREC_VERSION_MINOR + , BIMG_API_VERSION ); fprintf(stderr @@ -438,6 +436,8 @@ void help(const char* _error = NULL) "\n" "Options:\n" + " -h, --help Help.\n" + " -v, --version Version information only.\n" " -f Input file path.\n" " -o Output file path (file will be written in KTX format).\n" " -t Output format type (BC1/2/3/4/5, ETC1, PVR14, etc.).\n" @@ -460,7 +460,12 @@ int main(int _argc, const char* _argv[]) if (cmdLine.hasArg('v', "version") ) { - fprintf(stderr, "texturec, bgfx texture compiler tool, version " BIMG_TEXTUREC_VERSION_STR "\n"); + fprintf(stderr + , "texturec, bgfx texture compiler tool, version %d.%d.%d.\n" + , BIMG_TEXTUREC_VERSION_MAJOR + , BIMG_TEXTUREC_VERSION_MINOR + , BIMG_API_VERSION + ); return EXIT_SUCCESS; }