2023-07-05 23:22:15 +02:00
|
|
|
# Configure with [fxsdk build-fx] or [fxsdk build-cg], which provide the
|
|
|
|
# toolchain file and module path of the fxSDK
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 3.15)
|
|
|
|
project(MyAddin)
|
|
|
|
|
|
|
|
include(GenerateG1A)
|
2023-07-07 18:22:39 +02:00
|
|
|
include(GenerateG3A)
|
|
|
|
|
2023-07-05 23:22:15 +02:00
|
|
|
include(Fxconv)
|
|
|
|
find_package(Gint 2.9 REQUIRED)
|
|
|
|
find_package(LibProf 2.4 REQUIRED)
|
|
|
|
|
2023-07-10 20:22:54 +02:00
|
|
|
#set the color mode either to 1b or 2b
|
2023-08-16 23:12:16 +02:00
|
|
|
set(COLORMODE_fx 1b)
|
2023-08-15 12:55:06 +02:00
|
|
|
#set the color mode either to 1b, 2b or EGA64
|
2023-08-16 23:12:16 +02:00
|
|
|
set(COLORMODE_cg EGA64)
|
2023-07-06 21:16:07 +02:00
|
|
|
|
2023-07-07 18:22:39 +02:00
|
|
|
fxconv_declare_converters(assets/converters.py)
|
2023-07-05 23:22:15 +02:00
|
|
|
|
|
|
|
set(SOURCES
|
|
|
|
src/main.c
|
|
|
|
src/map.c
|
2023-07-06 22:02:37 +02:00
|
|
|
src/player.c
|
2023-07-08 15:55:06 +02:00
|
|
|
src/memory.c
|
|
|
|
src/game.c
|
2023-07-09 22:02:59 +02:00
|
|
|
src/dialogs.c
|
2023-07-05 23:22:15 +02:00
|
|
|
# ...
|
|
|
|
)
|
|
|
|
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
|
|
|
|
set(ASSETS
|
2023-08-08 09:46:07 +02:00
|
|
|
assets/WorldRPG.world
|
2023-07-05 23:22:15 +02:00
|
|
|
# ...
|
|
|
|
)
|
2023-07-07 18:22:39 +02:00
|
|
|
|
|
|
|
set(ASSETS_cg
|
2023-07-08 20:07:34 +02:00
|
|
|
assets-cg/demo_player.png
|
2023-08-15 12:55:06 +02:00
|
|
|
assets-cg/demo_PNJ.png
|
2023-08-16 19:25:24 +02:00
|
|
|
assets-cg/SignAction.png
|
|
|
|
assets-cg/NPC_Icon.png
|
|
|
|
assets-cg/SGN_Icon.png
|
|
|
|
assets-cg/INFO_Icon.png
|
2023-07-09 22:02:59 +02:00
|
|
|
assets-cg/player_face.png
|
2023-07-10 20:55:27 +02:00
|
|
|
assets-cg/font.png
|
2023-07-07 18:22:39 +02:00
|
|
|
)
|
|
|
|
|
2023-08-15 12:55:06 +02:00
|
|
|
set(ASSETS_cg_1b
|
|
|
|
assets-cg/levels/tileset1b_CG.png
|
|
|
|
)
|
|
|
|
|
2023-07-09 12:39:08 +02:00
|
|
|
set(ASSETS_cg_2b
|
|
|
|
assets-cg/levels/tileset2b_CG.png
|
|
|
|
)
|
|
|
|
|
|
|
|
set(ASSETS_cg_EGA64
|
|
|
|
assets-cg/levels/tilesetEGA64_CG.png
|
|
|
|
)
|
|
|
|
|
2023-07-05 23:22:15 +02:00
|
|
|
set(ASSETS_fx
|
2023-07-08 20:07:34 +02:00
|
|
|
assets-fx/demo_player.png
|
2023-08-15 12:55:06 +02:00
|
|
|
assets-fx/demo_PNJ.png
|
2023-08-16 19:25:24 +02:00
|
|
|
assets-fx/SignAction.png
|
|
|
|
assets-fx/NPC_Icon.png
|
|
|
|
assets-fx/SGN_Icon.png
|
|
|
|
assets-fx/INFO_Icon.png
|
2023-07-09 22:02:59 +02:00
|
|
|
assets-fx/player_face.png
|
2023-07-10 20:55:27 +02:00
|
|
|
assets-fx/font.png
|
2023-07-05 23:22:15 +02:00
|
|
|
# ...
|
|
|
|
)
|
|
|
|
|
2023-07-06 21:16:07 +02:00
|
|
|
set(ASSETS_fx_1b
|
2023-07-08 18:02:05 +02:00
|
|
|
assets-fx/levels/tileset1b.png
|
2023-07-06 21:16:07 +02:00
|
|
|
# ...
|
|
|
|
)
|
|
|
|
|
|
|
|
set(ASSETS_fx_2b
|
|
|
|
assets-fx/levels/tileset2b.png
|
|
|
|
# ...
|
|
|
|
)
|
|
|
|
|
2023-08-15 12:55:06 +02:00
|
|
|
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} ${ASSETS_fx_1b} ${ASSETS_fx_2b} ${ASSETS_cg_1b} ${ASSETS_cg_2b} ${ASSETS_cg_EGA64} WITH_METADATA)
|
2023-07-06 21:16:07 +02:00
|
|
|
|
2023-07-09 12:39:08 +02:00
|
|
|
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
|
|
|
|
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE_fx}} )
|
|
|
|
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
|
|
|
|
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE_cg}} )
|
|
|
|
endif()
|
2023-07-07 18:22:39 +02:00
|
|
|
|
2023-07-09 12:39:08 +02:00
|
|
|
# fx colormode
|
|
|
|
if("${COLORMODE_fx}" STREQUAL 1b)
|
2023-07-06 21:16:07 +02:00
|
|
|
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2023-07-09 12:39:08 +02:00
|
|
|
if("${COLORMODE_fx}" STREQUAL 2b)
|
2023-07-06 21:16:07 +02:00
|
|
|
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR2BIT)
|
|
|
|
endif()
|
|
|
|
|
2023-07-09 12:39:08 +02:00
|
|
|
# cg colormode
|
2023-08-15 12:55:06 +02:00
|
|
|
if("${COLORMODE_cg}" STREQUAL 1b)
|
|
|
|
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT)
|
|
|
|
endif()
|
|
|
|
|
2023-07-09 12:39:08 +02:00
|
|
|
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()
|
2023-07-05 23:22:15 +02:00
|
|
|
|
|
|
|
target_link_options(myaddin PRIVATE -Wl,-Map=Build_Addin.map -Wl,--print-memory-usage)
|
|
|
|
target_link_libraries(myaddin LibProf::LibProf Gint::Gint)
|
|
|
|
|
2023-07-06 21:16:07 +02:00
|
|
|
|
2023-07-05 23:22:15 +02:00
|
|
|
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
|
2023-07-07 18:22:39 +02:00
|
|
|
|
2023-07-09 12:39:08 +02:00
|
|
|
if("${COLORMODE_fx}" STREQUAL 1b)
|
|
|
|
generate_g1a(TARGET myaddin OUTPUT "PrjPC1b.g1a"
|
|
|
|
NAME "Col RPG NB" ICON assets-fx/icon1.png)
|
2023-07-06 21:16:07 +02:00
|
|
|
endif()
|
|
|
|
|
2023-07-09 12:39:08 +02:00
|
|
|
if("${COLORMODE_fx}" STREQUAL 2b)
|
|
|
|
generate_g1a(TARGET myaddin OUTPUT "PrjPC2b.g1a"
|
|
|
|
NAME "Col RPG Grey" ICON assets-fx/icon2.png)
|
2023-07-06 21:16:07 +02:00
|
|
|
endif()
|
2023-07-07 18:22:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
|
|
|
|
|
2023-08-15 12:55:06 +02:00
|
|
|
if("${COLORMODE_cg}" STREQUAL 1b)
|
|
|
|
generate_g3a(TARGET myaddin OUTPUT "PrjPC1b.g3a"
|
|
|
|
NAME "Col RPG 1bit" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
|
|
|
|
endif()
|
|
|
|
|
2023-07-09 12:39:08 +02:00
|
|
|
if("${COLORMODE_cg}" STREQUAL 2b)
|
|
|
|
generate_g3a(TARGET myaddin OUTPUT "PrjPC2b.g3a"
|
|
|
|
NAME "Col RPG Grey" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if("${COLORMODE_cg}" STREQUAL EGA64)
|
|
|
|
generate_g3a(TARGET myaddin OUTPUT "PrjPCega.g3a"
|
|
|
|
NAME "Col RPG EGA" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
|
|
|
|
endif()
|
2023-07-07 18:22:39 +02:00
|
|
|
|
2023-08-08 09:46:07 +02:00
|
|
|
endif()
|