diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fa4f83..9c8158b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.21) project(PSXEngine LANGUAGES C CXX ASM - VERSION 1.0.0 + VERSION 0.1.0 DESCRIPTION "Platformer Engine for PSX" HOMEPAGE_URL "https://luksamuk.codes") @@ -14,6 +14,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/") include(GetGitRevisionDescription) get_git_head_revision(GIT_REFSPEC GIT_SHA1) +git_get_exact_tag(GIT_TAG) string(SUBSTRING "${GIT_SHA1}" 0 7 GIT_SHORTHASH) string(SUBSTRING "${GIT_REFSPEC}" 11 -1 GIT_BRANCH) @@ -22,6 +23,12 @@ add_definitions("-DGIT_SHA1=\"${GIT_SHA1}\"") add_definitions("-DGIT_REFSPEC=\"${GIT_REFSPEC}\"") add_definitions("-DGIT_COMMIT=\"${GIT_BRANCH}/${GIT_SHORTHASH}\"") +if(GIT_TAG) + add_definitions("-DGIT_VERSION=\"${GIT_TAG}\"") +else() + add_definitions("-DGIT_VERSION=\"GIT ${GIT_SHORTHASH}\"") +endif() + set(CMAKE_C_FLAGS "-Wall") psn00bsdk_add_executable(engine diff --git a/include/util.h b/include/util.h index 1b13454..8b8411c 100644 --- a/include/util.h +++ b/include/util.h @@ -17,6 +17,9 @@ #define GIT_COMMIT "UNKNOWN" #endif +#ifndef GIT_VERSION +#define GIT_VERSION "UNKNOWN" +#endif #define BCD_TO_DEC(x) (((x & 0xF0) >> 4) * 10 + (x & 0x0F)) #define SIGNUM(x) (x < 0 ? -1 : 1) diff --git a/src/screen_title.c b/src/screen_title.c index 4f77c30..8480c4a 100644 --- a/src/screen_title.c +++ b/src/screen_title.c @@ -10,6 +10,7 @@ #include "screen.h" #include "sound.h" #include "timer.h" +#include "basic_font.h" #include "screens/fmv.h" #include "screens/level.h" @@ -228,7 +229,7 @@ screen_title_drawtitle(screen_title_data *data) 255, 0, 0, 174, 255, 174); - sort_prim(poly, 1); + sort_prim(poly, 3); } static void @@ -262,7 +263,7 @@ screen_title_drawtxt(screen_title_data *data, uint8_t idx, int16_t cx, int16_t c u0 + w , v0, u0, v0 + h, u0 + w , v0 + h); - sort_prim(poly, 0); + sort_prim(poly, 1); } static void @@ -300,7 +301,7 @@ screen_title_drawprl(screen_title_data *data) w - 1, v0, 0, v0 + h, w - 1, v0 + h); - sort_prim(poly, 1); + sort_prim(poly, OT_LENGTH - 2); if(s) break; } @@ -396,11 +397,19 @@ screen_title_draw(void *d) if(data->menu_option < 3) screen_title_drawtxt(data, 5, CENTERX + 60, 208); } - - int16_t x; - - snprintf(buffer, 255, "v0.1 Beta"); - x = SCREEN_XRES - (strlen(buffer) * 8) - 8; - draw_text(x, SCREEN_YRES - 14, 0, buffer); } + + int16_t x; + + font_set_color( + LERPC(data->rgb_count, 200), + LERPC(data->rgb_count, 200), + LERPC(data->rgb_count, 200)); + + x = SCREEN_XRES - (strlen(GIT_VERSION) * 8) - 8; + font_draw_sm(GIT_VERSION, x, SCREEN_YRES - 21); + + snprintf(buffer, 255, "2024 luksamuk"); + x = SCREEN_XRES - (strlen(buffer) * 8) - 8; + font_draw_sm(buffer, x, SCREEN_YRES - 14); }