diff --git a/CMakeLists.txt b/CMakeLists.txt index 546de15..3936853 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,10 @@ include(Fxconv) find_package(Gint 2.9 REQUIRED) find_package(LibProf 2.4 REQUIRED) +#set the color mode either to 1bit or 2bits +set(COLORMODE 1b) + + fxconv_declare_converters(assets-fx/converters.py) add_custom_command( @@ -37,19 +41,46 @@ set(ASSETS # ... ) set(ASSETS_fx - assets-fx/levels/tileset.png assets-fx/levels/level0.json # ... ) -fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA) +set(ASSETS_fx_1b + assets-fx/levels/tileset1b.png + # ... +) + +set(ASSETS_fx_2b + assets-fx/levels/tileset2b.png + # ... +) + +fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_fx_1b} ${ASSETS_fx_2b} WITH_METADATA) + +add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE}} ) + +if("${COLORMODE}" STREQUAL 1b) + target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT) +endif() + + +if("${COLORMODE}" STREQUAL 2b) + target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR2BIT) +endif() + -add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}}) -target_compile_options(myaddin PRIVATE -Wall -Wextra -Os) 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) - generate_g1a(TARGET myaddin OUTPUT "Prj_PC.g1a" - NAME "Collab RPG" ICON assets-fx/icon.png) + if("${COLORMODE}" STREQUAL 1b) + generate_g1a(TARGET myaddin OUTPUT "PrjPC1b.g1a" + NAME "Col RPG NB" ICON assets-fx/icon1.png) + endif() + + if("${COLORMODE}" STREQUAL 2b) + generate_g1a(TARGET myaddin OUTPUT "PrjPC2b.g1a" + NAME "Col RPG Grey" ICON assets-fx/icon2.png) + endif() endif() diff --git a/assets-fx/icon1.png b/assets-fx/icon1.png new file mode 100644 index 0000000..33dc4c6 Binary files /dev/null and b/assets-fx/icon1.png differ diff --git a/assets-fx/icon2.png b/assets-fx/icon2.png new file mode 100644 index 0000000..a5f1a72 Binary files /dev/null and b/assets-fx/icon2.png differ diff --git a/assets-fx/levels/fxconv-metadata.txt b/assets-fx/levels/fxconv-metadata.txt index 156bf1a..f49ab52 100644 --- a/assets-fx/levels/fxconv-metadata.txt +++ b/assets-fx/levels/fxconv-metadata.txt @@ -2,6 +2,11 @@ custom-type: map name_regex: (.*)\.json map_\1 -tileset.png: +tileset1b.png: type: bopti-image name: img_tilesetnpp + + +tileset2b.png: + type: bopti-image + name: img_tilesetnpp \ No newline at end of file diff --git a/assets-fx/levels/tileset1b.png b/assets-fx/levels/tileset1b.png new file mode 100644 index 0000000..2a94191 Binary files /dev/null and b/assets-fx/levels/tileset1b.png differ diff --git a/assets-fx/levels/tileset2b.png b/assets-fx/levels/tileset2b.png new file mode 100644 index 0000000..2c2ad04 Binary files /dev/null and b/assets-fx/levels/tileset2b.png differ diff --git a/src/main.c b/src/main.c index 9c286a9..ff84a97 100644 --- a/src/main.c +++ b/src/main.c @@ -1,10 +1,10 @@ #include #include -#include #include "map.h" - - +#ifdef COLOR2BIT + #include +#endif @@ -14,12 +14,20 @@ int main(void) { dclear(C_WHITE); - dgray( DGRAY_ON ); + #ifdef COLOR2BIT + dgray( DGRAY_ON ); + #endif RenderMap(); dupdate(); getkey(); + + + #ifdef COLOR2BIT + dgray( DGRAY_OFF ); + #endif + return 1; }