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)
|
2024-07-25 13:20:56 +02:00
|
|
|
find_package(Gint 2.11 REQUIRED)
|
|
|
|
# Gint 2.11 is required, because we're using the new macros like GINT_RENDER_RGB
|
2023-07-05 23:22:15 +02:00
|
|
|
find_package(LibProf 2.4 REQUIRED)
|
|
|
|
|
2023-07-10 20:22:54 +02:00
|
|
|
#set the color mode either to 1b or 2b
|
2024-07-25 17:03:34 +02:00
|
|
|
set(COLORMODE_fx 2b)
|
2023-08-15 12:55:06 +02:00
|
|
|
#set the color mode either to 1b, 2b or EGA64
|
2023-08-19 14:18:41 +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-08-19 14:18:41 +02:00
|
|
|
src/npc.c
|
2024-07-20 16:53:13 +02:00
|
|
|
src/events.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
|
2024-07-27 16:51:47 +02:00
|
|
|
assets-cg/player_male.png
|
|
|
|
assets-cg/player_female.png
|
2024-07-25 17:03:34 +02:00
|
|
|
assets-cg/npc/char/npc_male.png
|
2024-07-27 17:20:06 +02:00
|
|
|
assets-cg/npc/char/npc_female.png
|
|
|
|
assets-cg/npc/char/npc_milkman.png
|
|
|
|
assets-cg/npc/char/npc_police.png
|
2023-08-16 19:25:24 +02:00
|
|
|
assets-cg/SignAction.png
|
2024-07-25 17:03:34 +02:00
|
|
|
assets-cg/npc/face/npc_male.png
|
2024-07-26 17:01:51 +02:00
|
|
|
assets-cg/npc/face/npc_female.png
|
|
|
|
assets-cg/npc/face/npc_milkman.png
|
|
|
|
assets-cg/npc/face/npc_police.png
|
2023-08-16 19:25:24 +02:00
|
|
|
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
|
2023-08-17 18:43:55 +02:00
|
|
|
assets-cg/1b/tileset/tileset1b_CG.png
|
2023-08-15 12:55:06 +02:00
|
|
|
)
|
|
|
|
|
2023-07-09 12:39:08 +02:00
|
|
|
set(ASSETS_cg_2b
|
2023-08-17 18:43:55 +02:00
|
|
|
assets-cg/2b/tileset/tileset2b_CG.png
|
2023-07-09 12:39:08 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
set(ASSETS_cg_EGA64
|
2023-08-17 18:43:55 +02:00
|
|
|
assets-cg/ega64/tileset/tilesetEGA64_CG.png
|
2023-07-09 12:39:08 +02:00
|
|
|
)
|
|
|
|
|
2023-07-05 23:22:15 +02:00
|
|
|
set(ASSETS_fx
|
2024-07-27 16:51:47 +02:00
|
|
|
assets-fx/player_male.png
|
2024-07-25 17:03:34 +02:00
|
|
|
assets-fx/npc/char/npc_male.png
|
2024-07-27 17:20:06 +02:00
|
|
|
assets-fx/npc/char/npc_female.png
|
|
|
|
assets-fx/npc/char/npc_milkman.png
|
|
|
|
assets-fx/npc/char/npc_police.png
|
2023-08-16 19:25:24 +02:00
|
|
|
assets-fx/SignAction.png
|
2024-07-25 17:03:34 +02:00
|
|
|
assets-fx/npc/face/npc_male.png
|
2024-07-26 17:01:51 +02:00
|
|
|
assets-fx/npc/face/npc_female.png
|
|
|
|
assets-fx/npc/face/npc_milkman.png
|
|
|
|
assets-fx/npc/face/npc_police.png
|
2023-08-16 19:25:24 +02:00
|
|
|
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-08-17 18:43:55 +02:00
|
|
|
assets-fx/1b/tileset/tileset1b.png
|
2023-07-06 21:16:07 +02:00
|
|
|
# ...
|
|
|
|
)
|
|
|
|
|
|
|
|
set(ASSETS_fx_2b
|
2023-08-17 18:43:55 +02:00
|
|
|
assets-fx/2b/tileset/tileset2b.png
|
2023-07-06 21:16:07 +02:00
|
|
|
# ...
|
|
|
|
)
|
|
|
|
|
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}} )
|
2024-03-26 21:19:52 +01:00
|
|
|
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G_G3A)
|
|
|
|
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE_fx}} )
|
2023-07-09 12:39:08 +02:00
|
|
|
endif()
|
2023-07-07 18:22:39 +02:00
|
|
|
|
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)
|
2024-07-25 13:20:56 +02:00
|
|
|
# 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()
|
2023-07-07 18:22:39 +02:00
|
|
|
|
2023-07-09 12:39:08 +02:00
|
|
|
if("${COLORMODE_fx}" STREQUAL 1b)
|
2023-08-17 18:43:55 +02:00
|
|
|
generate_g1a(TARGET myaddin OUTPUT "RPG_1b.g1a"
|
|
|
|
NAME "RPG PC 1b" ICON assets-fx/1b/icon1b.png)
|
2023-07-06 21:16:07 +02:00
|
|
|
endif()
|
|
|
|
|
2023-07-09 12:39:08 +02:00
|
|
|
if("${COLORMODE_fx}" STREQUAL 2b)
|
2023-08-17 18:43:55 +02:00
|
|
|
generate_g1a(TARGET myaddin OUTPUT "RPG_2b.g1a"
|
|
|
|
NAME "RPG PC 2b" ICON assets-fx/2b/icon2b.png)
|
2023-07-06 21:16:07 +02:00
|
|
|
endif()
|
2023-07-07 18:22:39 +02:00
|
|
|
|
|
|
|
|
2024-03-26 21:19:52 +01:00
|
|
|
|
2023-07-07 18:22:39 +02:00
|
|
|
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
|
2024-07-25 13:20:56 +02:00
|
|
|
# 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()
|
2023-07-07 18:22:39 +02:00
|
|
|
|
2023-08-15 12:55:06 +02:00
|
|
|
if("${COLORMODE_cg}" STREQUAL 1b)
|
2023-08-17 18:43:55 +02:00
|
|
|
generate_g3a(TARGET myaddin OUTPUT "RPG_1b.g3a"
|
|
|
|
NAME "RPG PC 1b" ICONS assets-cg/1b/icon-uns-1b.png assets-cg/1b/icon-sel-1b.png)
|
2023-08-15 12:55:06 +02:00
|
|
|
endif()
|
|
|
|
|
2023-07-09 12:39:08 +02:00
|
|
|
if("${COLORMODE_cg}" STREQUAL 2b)
|
2023-08-17 18:43:55 +02:00
|
|
|
generate_g3a(TARGET myaddin OUTPUT "RPG_2b.g3a"
|
|
|
|
NAME "RPG PC 2b" ICONS assets-cg/2b/icon-uns-2b.png assets-cg/2b/icon-sel-2b.png)
|
2023-07-09 12:39:08 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if("${COLORMODE_cg}" STREQUAL EGA64)
|
2023-08-17 18:43:55 +02:00
|
|
|
generate_g3a(TARGET myaddin OUTPUT "RPG_ega.g3a"
|
|
|
|
NAME "RPG PC EGA" ICONS assets-cg/ega64/icon-uns-ega64.png assets-cg/ega64/icon-sel-ega64.png)
|
2023-07-09 12:39:08 +02:00
|
|
|
endif()
|
2023-07-07 18:22:39 +02:00
|
|
|
|
2024-03-26 21:19:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G_G3A)
|
|
|
|
|
|
|
|
if("${COLORMODE_fx}" STREQUAL 1b)
|
|
|
|
generate_g3a(TARGET myaddin OUTPUT "RPG_1bfx.g3a"
|
|
|
|
NAME "RPG PC 1b fx" ICONS assets-cg/1b/icon-uns-1b.png assets-cg/1b/icon-sel-1b.png)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if("${COLORMODE_fx}" STREQUAL 2b)
|
|
|
|
generate_g3a(TARGET myaddin OUTPUT "RPG_2bfx.g3a"
|
|
|
|
NAME "RPG PC 2b fx" ICONS assets-cg/2b/icon-uns-2b.png assets-cg/2b/icon-sel-2b.png)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2023-08-08 09:46:07 +02:00
|
|
|
endif()
|