diff --git a/.gitignore b/.gitignore index a796d55..1e1f29b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -build-fx/* build-cg/* - -assets-fx/__pycache__/* -assets-cg/__pycache__/* \ No newline at end of file +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..771d8af Binary files /dev/null and b/assets-cg/explosion.png differ diff --git a/assets-cg/fxconv-metadata.txt b/assets-cg/fxconv-metadata.txt index f5f6e06..b2552b9 100644 --- a/assets-cg/fxconv-metadata.txt +++ b/assets-cg/fxconv-metadata.txt @@ -1,13 +1,13 @@ *.png: type: bopti-image + profile:p4 name_regex: (.*)\.png img_\1 plague.png: type: font name: font_plague charset: print - grid.size: 5x5 - grid.padding: 1 - proportional: True + grid.size: 13x16 + grid.padding: 0 diff --git a/assets-cg/icon-sel.png b/assets-cg/icon-sel.png new file mode 100644 index 0000000..28bc308 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..73fe494 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..85b5cd9 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..545b734 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..63ca5dc 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); @@ -108,32 +109,31 @@ static void title_screen(void) extern bopti_image_t img_explosion; dclear(C_BLACK); - dupdate(); - sleep_ms(250); - dsubimage(0, 0, &img_title, 0, 0, 128, 64, DIMAGE_NONE); - dprint_opt(32, 29, C_WHITE, C_BLACK, 0, 0, "VERSION %s", VERSION, -1); + dsubimage(0, 0, &img_title, 0, 0, DWIDTH, DHEIGHT, DIMAGE_NONE); + dprint_opt(32, 120, C_BLACK, C_WHITE, 0, 0, "VERSION %s", VERSION, -1); dupdate(); sleep_ms(1000); for (int frame = 0; frame < 5; frame ++) { - dclear(C_BLACK); - dsubimage(0, 0, &img_title, 0, 0, 128, 64, DIMAGE_NONE); - dsubimage(76, 9, &img_explosion, 41 * frame, 0, 40, 40, DIMAGE_NONE); + dsubimage(0, 0, &img_title, 0, 0, DWIDTH, DHEIGHT, DIMAGE_NONE); + dsubimage(225, 70, &img_explosion, 123 * frame, 0, 120, 120, DIMAGE_NONE); dupdate(); - sleep_ms(100); + sleep_ms(80); } - dclear(C_BLACK); - dsubimage(0, 0, &img_title, 0, 65, 128, 64, DIMAGE_NONE); - dupdate(); - sleep_ms(750); - - dclear(C_BLACK); - dsubimage(0, 0, &img_title, 0, 130, 128, 64, DIMAGE_NONE); - dupdate(); + sleep_ms(120); + for (int times = 0; times < 5; times ++) + { + dsubimage(0, 0, &img_title, 0, DHEIGHT, DWIDTH, DHEIGHT, DIMAGE_NONE); + dupdate(); + sleep_ms(200); + dsubimage(0, 0, &img_title, 0, DHEIGHT*2, DWIDTH, DHEIGHT, DIMAGE_NONE); + dupdate(); + sleep_ms(200); + } getkey(); }