added B&W vs Grayscale switch

This commit is contained in:
SlyVTT 2023-07-06 21:16:07 +02:00
parent 87ad8b697d
commit 5195cdba49
7 changed files with 55 additions and 11 deletions

View file

@ -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()

BIN
assets-fx/icon1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets-fx/icon2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View file

@ -1,10 +1,10 @@
#include <gint/display.h>
#include <gint/keyboard.h>
#include <gint/gray.h>
#include "map.h"
#ifdef COLOR2BIT
#include <gint/gray.h>
#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;
}