diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1e1f29b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build-cg/* +assets-cg/__pycache__/* +*.g3a diff --git a/CMakeLists.txt b/CMakeLists.txt index 458af89..1f76656 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,41 +1,58 @@ # 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) +cmake_minimum_required(VERSION 3.18) +project(Plague) -include(GenerateG1A) include(GenerateG3A) include(Fxconv) find_package(Gint 2.1 REQUIRED) set(SOURCES src/main.c - # ... + src/core.c + src/display_engine.c + src/mutation_engine.c + src/data.c + src/epidemic_engine.c + src/save.c ) + # Shared assets, fx-9860G-only assets and fx-CG-50-only assets set(ASSETS - # ... -) -set(ASSETS_fx - assets-fx/example.png - # ... + ) + set(ASSETS_cg - assets-cg/example.png - # ... + assets-cg/plague.png + assets-cg/planes.png + assets-cg/bground.png + assets-cg/mutations.png + assets-cg/cursor.png + assets-cg/title.png + assets-cg/dna.png + assets-cg/explosion.png + assets-cg/mutations_table/abilities_1.txt + assets-cg/mutations_table/abilities_2.txt + assets-cg/mutations_table/abilities_3.txt + assets-cg/mutations_table/symptoms_1.txt + assets-cg/mutations_table/symptoms_2.txt + assets-cg/mutations_table/symptoms_3.txt + assets-cg/mutations_table/symptoms_4.txt + assets-cg/mutations_table/transmissions_1.txt + assets-cg/mutations_table/transmissions_2.txt + assets-cg/mutations_table/transmissions_3.txt ) fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA) +fxconv_declare_converters(assets-cg/converters.py) + add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}}) target_compile_options(myaddin PRIVATE -Wall -Wextra -Os) target_link_libraries(myaddin Gint::Gint) -if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G) - generate_g1a(TARGET myaddin OUTPUT "MyAddin.g1a" - NAME "MyAddin" ICON assets-fx/icon.png) -elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50) - generate_g3a(TARGET myaddin OUTPUT "MyAddin.g3a" - NAME "MyAddin" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png) +if("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50) + generate_g3a(TARGET myaddin OUTPUT "Plague.g3a" + NAME "Plague" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png) endif() diff --git a/assets-cg/bground.png b/assets-cg/bground.png new file mode 100644 index 0000000..b40d9a0 Binary files /dev/null and b/assets-cg/bground.png differ diff --git a/assets-cg/cursor.png b/assets-cg/cursor.png new file mode 100644 index 0000000..c16cb9b Binary files /dev/null and b/assets-cg/cursor.png differ diff --git a/assets-cg/dna.png b/assets-cg/dna.png new file mode 100644 index 0000000..02cffb0 Binary files /dev/null and b/assets-cg/dna.png differ diff --git a/assets-cg/explosion.png b/assets-cg/explosion.png new file mode 100644 index 0000000..cd70249 Binary files /dev/null and b/assets-cg/explosion.png differ diff --git a/assets-cg/icon-sel.png b/assets-cg/icon-sel.png new file mode 100644 index 0000000..72339b6 Binary files /dev/null and b/assets-cg/icon-sel.png differ diff --git a/assets-cg/icon-uns.png b/assets-cg/icon-uns.png new file mode 100644 index 0000000..e9fc416 Binary files /dev/null and b/assets-cg/icon-uns.png differ diff --git a/assets-cg/mutations.png b/assets-cg/mutations.png new file mode 100644 index 0000000..8ebacb6 Binary files /dev/null and b/assets-cg/mutations.png differ diff --git a/assets-cg/plague.png b/assets-cg/plague.png new file mode 100644 index 0000000..2c3b91d Binary files /dev/null and b/assets-cg/plague.png differ diff --git a/assets-cg/planes.png b/assets-cg/planes.png new file mode 100644 index 0000000..5995dc0 Binary files /dev/null and b/assets-cg/planes.png differ diff --git a/assets-cg/title.png b/assets-cg/title.png new file mode 100644 index 0000000..dcc8c29 Binary files /dev/null and b/assets-cg/title.png differ diff --git a/src/core.c b/src/core.c index e9df5f6..71fb5cb 100644 --- a/src/core.c +++ b/src/core.c @@ -66,7 +66,7 @@ int next_frame(struct game *current_game, int *dna_animation, int *vaccine) current_game->time = 0; // Display message on research - if (!current_game->research && current_game->priority) message("LA RECHERHCE CONTRE VOTRE VIRUS COMMENCE !"); + if (!current_game->research && current_game->priority) message("LA RECHERCHE CONTRE VOTRE VIRUS COMMENCE !"); else if (!*vaccine && (current_game->research == current_game->limit)) {*vaccine = 1; message("LE VACCIN EST TERMINE."); } // Update the game diff --git a/src/main.c b/src/main.c index 2a3a8df..b2b5307 100644 --- a/src/main.c +++ b/src/main.c @@ -32,6 +32,7 @@ int main_loop(struct game *current_game); int main(void) { + extern font_t font_plague; dfont(&font_plague);