From 2547f82238871bbad34f6c67da9a3f2bc5cefd70 Mon Sep 17 00:00:00 2001 From: mibi88 <76903855+mibi88@users.noreply.github.com> Date: Thu, 25 Jul 2024 13:20:56 +0200 Subject: [PATCH] Bug fixes --- CMakeLists.txt | 48 ++++++++++++++++++++++-------------------------- src/config.h | 8 ++++++++ src/dialogs.c | 8 -------- src/game.c | 1 + 4 files changed, 31 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b8644c..3d1d7c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,8 @@ include(GenerateG1A) include(GenerateG3A) include(Fxconv) -find_package(Gint 2.10 REQUIRED) +find_package(Gint 2.11 REQUIRED) +# Gint 2.11 is required, because we're using the new macros like GINT_RENDER_RGB find_package(LibProf 2.4 REQUIRED) #set the color mode either to 1b or 2b @@ -90,36 +91,19 @@ elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G_G3A) add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE_fx}} ) endif() - -# fx colormode -if("${COLORMODE_fx}" STREQUAL 1b) - target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT) -endif() - -if("${COLORMODE_fx}" STREQUAL 2b) - target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR2BIT) -endif() - - -# cg colormode -if("${COLORMODE_cg}" STREQUAL 1b) - target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT) -endif() - -if("${COLORMODE_cg}" STREQUAL 2b) - target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR2BIT) -endif() - -if("${COLORMODE_cg}" STREQUAL EGA64) - target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOREGA) -endif() - - target_link_options(myaddin PRIVATE -Wl,-Map=Build_Addin.map -Wl,--print-memory-usage) target_link_libraries(myaddin LibProf::LibProf Gint::Gint) if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G) + # fx colormode + if("${COLORMODE_fx}" STREQUAL 1b) + target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT) + endif() + + if("${COLORMODE_fx}" STREQUAL 2b) + target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR2BIT) + endif() if("${COLORMODE_fx}" STREQUAL 1b) generate_g1a(TARGET myaddin OUTPUT "RPG_1b.g1a" @@ -134,6 +118,18 @@ if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G) elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50) + # cg colormode + if("${COLORMODE_cg}" STREQUAL 1b) + target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT) + endif() + + if("${COLORMODE_cg}" STREQUAL 2b) + target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR2BIT) + endif() + + if("${COLORMODE_cg}" STREQUAL EGA64) + target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOREGA) + endif() if("${COLORMODE_cg}" STREQUAL 1b) generate_g3a(TARGET myaddin OUTPUT "RPG_1b.g3a" diff --git a/src/config.h b/src/config.h index 3b9761e..a899255 100644 --- a/src/config.h +++ b/src/config.h @@ -45,4 +45,12 @@ #define F_WIDTH (32*PXSIZE) #define F_HEIGHT (32*PXSIZE) +/* the color of the text to go to the next dialog phase */ +/* it improves readability to have something lighter */ +#if GRAYMODEOK || (GINT_RENDER_RGB && !defined(COLOR1BIT)) + #define NEXT_COLOR C_DARK +#else + #define NEXT_COLOR C_BLACK +#endif + #endif diff --git a/src/dialogs.c b/src/dialogs.c index ae3bb0d..0a2f0f0 100644 --- a/src/dialogs.c +++ b/src/dialogs.c @@ -26,14 +26,6 @@ extern font_t fontRPG; uint32_t *lightVRAMcurrent, *darkVRAMcurrent; #endif //GRAYMODEOK -/* the color of the text to go to the next dialog phase */ -/* it improves readability to have somathing lighter */ -#if GRAYMODEOK || (defined(GINT_RENDER_RGB) && !defined(COLOR1BIT)) - #define NEXT_COLOR C_DARK -#else - #define NEXT_COLOR C_BLACK -#endif - void blit() { dupdate(); diff --git a/src/game.c b/src/game.c index 35b7335..32b4104 100644 --- a/src/game.c +++ b/src/game.c @@ -87,6 +87,7 @@ void game_render_indicator(Game *game) { void game_draw(Game *game) { /* Draw everything. */ + dclear(C_WHITE); map_render_by_layer(game, BACKGROUND); npc_draw(game); player_draw(game);