From e39db2ad9a58195138c80db5a5b6842175d2b4c9 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Sat, 29 Aug 2015 09:39:56 -0700 Subject: [PATCH] Get version from tag. --- Makefile | 3 ++- source/main.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 87d6303..bc89d11 100644 --- a/Makefile +++ b/Makefile @@ -7,5 +7,6 @@ endif # ENABLE_EXCEPTIONS: Enable C++ exceptions. # NO_CITRUS: Do not include citrus. #--------------------------------------------------------------------------------- +BUILD_FLAGS := -DVERSION_STRING="\"`git describe --tags --abbrev=0`\"" -include $(DEVKITPRO)/citrus/tools/make_base \ No newline at end of file +include $(DEVKITPRO)/citrus/tools/make_base diff --git a/source/main.cpp b/source/main.cpp index 0f755e0..beca451 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -391,13 +391,17 @@ bool onLoop() { stream << "\n" << "START - Exit to launcher"; } + std::string str = stream.str(); + + std::stringstream titleStream; + titleStream << "FBI " << VERSION_STRING; + std::string title = titleStream.str(); + u32 screenWidth; u32 screenHeight; gpu::getViewportWidth(&screenWidth); gpu::getViewportHeight(&screenHeight); - std::string str = stream.str(); - const std::string title = "FBI v1.4.10"; gput::drawString(title, (screenWidth - gput::getStringWidth(title, 16)) / 2, (screenHeight - gput::getStringHeight(title, 16) + gput::getStringHeight(str, 8)) / 2, 16, 16); gput::drawString(str, (screenWidth - gput::getStringWidth(str, 8)) / 2, 4, 8, 8);