diff --git a/CMakeLists.txt b/CMakeLists.txt index 725b16e..cddb72b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,8 +12,8 @@ find_package(Gint 2.9 REQUIRED) find_package(LibProf 2.4 REQUIRED) #set the color mode either to 1bit or 2bits -set(COLORMODE 1b) - +set(COLORMODE_fx 2b) +set(COLORMODE_cg EGA64) fxconv_declare_converters(assets/converters.py) @@ -48,10 +48,17 @@ set(ASSETS ) set(ASSETS_cg - assets-cg/tileset2b_CG.png assets-cg/demo_player.png ) +set(ASSETS_cg_2b + assets-cg/levels/tileset2b_CG.png +) + +set(ASSETS_cg_EGA64 + assets-cg/levels/tilesetEGA64_CG.png +) + set(ASSETS_fx assets-fx/demo_player.png # ... @@ -67,20 +74,33 @@ set(ASSETS_fx_2b # ... ) -fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} ${ASSETS_fx_1b} ${ASSETS_fx_2b} WITH_METADATA) +fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} ${ASSETS_fx_1b} ${ASSETS_fx_2b} ${ASSETS_cg_2b} ${ASSETS_cg_EGA64} WITH_METADATA) -add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE}} ) +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() - -if("${COLORMODE}" STREQUAL 1b) +# fx colormode +if("${COLORMODE_fx}" STREQUAL 1b) target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT) endif() -if("${COLORMODE}" STREQUAL 2b) +if("${COLORMODE_fx}" STREQUAL 2b) target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR2BIT) endif() +# cg colormode +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() target_link_options(myaddin PRIVATE -Wl,-Map=Build_Addin.map -Wl,--print-memory-usage) target_link_libraries(myaddin LibProf::LibProf Gint::Gint) @@ -88,20 +108,27 @@ target_link_libraries(myaddin LibProf::LibProf Gint::Gint) if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G) - if("${COLORMODE}" STREQUAL 1b) - generate_g1a(TARGET myaddin OUTPUT "PrjPC1b.g1a" - NAME "Col RPG NB" ICON assets-fx/icon1.png) + if("${COLORMODE_fx}" 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) + if("${COLORMODE_fx}" STREQUAL 2b) + generate_g1a(TARGET myaddin OUTPUT "PrjPC2b.g1a" + NAME "Col RPG Grey" ICON assets-fx/icon2.png) endif() elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50) - generate_g3a(TARGET myaddin OUTPUT "PRJPC_CG.g3a" - NAME "Col_RPG_CG" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png) + 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() endif() \ No newline at end of file diff --git a/assets-cg/fxconv-metadata.txt b/assets-cg/fxconv-metadata.txt index 114c15f..cd2d082 100644 --- a/assets-cg/fxconv-metadata.txt +++ b/assets-cg/fxconv-metadata.txt @@ -1,7 +1,3 @@ -tileset2b_CG.png: - type: bopti-image - name: img_tilesetnpp - demo_player.png: type: bopti-image name: demo_player_img diff --git a/assets-cg/levels/fxconv-metadata.txt b/assets-cg/levels/fxconv-metadata.txt new file mode 100644 index 0000000..5caafd2 --- /dev/null +++ b/assets-cg/levels/fxconv-metadata.txt @@ -0,0 +1,8 @@ +tileset2b_CG.png: + type: bopti-image + name: img_tilesetnpp + +tilesetEGA64_CG.png: + type: bopti-image + name: img_tilesetnpp + diff --git a/assets-cg/tileset2b_CG.png b/assets-cg/levels/tileset2b_CG.png similarity index 100% rename from assets-cg/tileset2b_CG.png rename to assets-cg/levels/tileset2b_CG.png diff --git a/assets-cg/levels/tilesetEGA64_CG.png b/assets-cg/levels/tilesetEGA64_CG.png new file mode 100644 index 0000000..5fd8503 Binary files /dev/null and b/assets-cg/levels/tilesetEGA64_CG.png differ diff --git a/assets-fx/fxconv-metadata.txt b/assets-fx/fxconv-metadata.txt index db0f145..cd2d082 100644 --- a/assets-fx/fxconv-metadata.txt +++ b/assets-fx/fxconv-metadata.txt @@ -1,12 +1,3 @@ -tileset1b.png: - type: bopti-image - name: img_tilesetnpp - - -tileset2b.png: - type: bopti-image - name: img_tilesetnpp - demo_player.png: type: bopti-image name: demo_player_img diff --git a/assets-fx/levels/tileset1b_bak.png b/assets-fx/levels/tileset1b_bak.png deleted file mode 100644 index 2a94191..0000000 Binary files a/assets-fx/levels/tileset1b_bak.png and /dev/null differ diff --git a/assets/level0.tmx b/assets/level0.tmx index ada6b7b..34df826 100644 --- a/assets/level0.tmx +++ b/assets/level0.tmx @@ -3,33 +3,33 @@ -257,297,298,299,300,257,386,297,298,299,300,2,2,2,2,2,257,2,2,225,226,227,228,201,202,203,204,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -253,205,229,205,229,280,179,180,179,156,156,156,158,157,179,180,253,2,2,249,250,251,252,225,226,227,228,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -301,125,126,127,128,2,385,303,350,351,303,2,2,2,350,351,301,2,2,273,274,275,276,249,250,251,252,201,202,203,204,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -325,149,150,151,152,2,2,327,374,375,327,2,184,185,374,375,325,2,279,297,298,299,300,273,274,275,276,225,226,227,228,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -257,2,2,385,2,2,385,2,265,266,2,2,208,209,352,353,257,2,302,2,130,129,166,297,298,299,300,249,250,251,252,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -281,176,2,2,278,2,2,385,289,290,2,2,232,233,376,377,281,2,326,2,154,153,190,201,202,203,204,273,274,275,276,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -201,202,203,204,302,385,2,2,265,266,2,385,2,2,2,2,2,2,2,2,2,2,166,225,226,227,228,297,298,299,300,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -225,226,227,228,326,2,385,2,265,266,2,2,2,2,214,215,2,2,2,2,2,2,190,249,250,251,252,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -249,250,251,252,201,202,203,204,289,290,2,258,259,260,238,239,260,260,261,262,262,263,264,273,274,275,276,2,93,94,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -273,274,275,276,225,226,227,228,265,266,2,282,283,284,285,285,285,285,285,285,286,287,288,297,298,299,300,2,117,118,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -297,298,299,300,249,250,251,252,290,2,2,306,307,308,309,308,309,308,309,310,310,311,312,131,2,339,340,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -202,203,204,386,273,274,275,276,2,2,2,330,331,332,333,332,333,332,333,334,334,335,336,132,2,363,364,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -226,227,228,386,297,298,299,300,2,290,2,162,163,164,165,162,163,164,165,162,163,164,165,132,2,201,202,203,204,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -250,251,252,2,2,2,2,2,2,2,2,86,87,88,89,186,187,188,189,86,87,88,89,132,2,225,226,227,228,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -274,275,276,2,270,271,271,271,272,2,2,110,111,112,113,210,211,212,213,110,111,112,113,133,2,249,250,251,252,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -298,299,300,2,294,1,1,1,296,2,2,136,137,0,0,234,290,265,237,2,2,339,340,2,2,273,274,275,276,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -202,203,204,2,294,1,1,1,296,2,2,160,161,265,266,266,265,266,2,2,2,363,364,2,2,297,298,299,300,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -226,227,228,2,318,319,319,319,320,2,2,2,2,289,290,265,266,290,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -250,251,252,2,2,2,2,2,2,385,386,2,2,265,265,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -274,275,276,201,202,203,204,257,2,2,2,257,2,265,265,2,257,2,2,2,257,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -298,299,300,225,226,227,228,253,205,229,205,253,2,290,265,2,253,205,229,205,253,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,386,249,250,251,252,345,346,347,348,277,2,265,266,2,301,386,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -202,203,204,273,274,275,276,369,370,371,372,301,2,289,290,2,325,387,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -226,227,228,297,298,299,300,393,394,395,396,325,2,265,266,2,301,386,2,2,2,2,257,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 +257,297,298,299,300,257,386,297,298,299,300,2,2,2,2,2,257,337,338,225,226,227,228,201,202,203,204,273,274,275,276,249,250,251,252,297,298,299,93,94,2,345,346,347,348,2,337,338, +253,205,229,205,229,280,179,180,179,156,156,156,158,157,179,180,253,361,362,249,250,251,252,225,226,227,228,297,298,299,300,273,274,275,276,25,26,27,117,118,28,369,370,371,372,2,361,362, +301,125,126,127,128,2,385,303,350,351,303,2,2,2,350,351,301,2,386,273,274,275,276,249,250,251,252,201,202,203,204,297,298,299,300,49,9,10,134,135,52,393,394,395,396,337,338,2, +325,149,150,151,152,2,2,327,374,375,327,2,184,185,374,375,325,387,279,297,298,299,300,273,274,275,276,225,226,227,228,2,2,2,2,73,33,34,74,219,76,2,2,2,2,361,362,2, +257,2,2,385,2,2,385,2,265,266,2,2,208,209,352,353,257,2,302,2,130,129,166,297,298,299,300,249,250,251,252,25,26,27,27,97,98,99,98,99,100,26,26,27,28,131,201,202, +281,176,2,2,278,2,2,385,289,290,2,2,232,233,376,377,281,2,326,2,154,153,190,201,202,203,204,273,274,275,276,49,356,357,2,121,59,60,60,61,124,2,354,355,52,132,225,226, +201,202,203,204,302,385,2,2,265,266,2,385,2,2,2,2,2,2,2,2,2,2,166,225,226,227,228,297,298,299,300,73,380,381,2,145,83,84,84,85,148,2,378,379,76,132,249,250, +225,226,227,228,326,2,385,2,265,266,2,2,2,2,214,215,2,2,2,2,2,2,190,249,250,251,252,2,2,385,2,49,404,405,2,169,107,108,108,109,172,2,402,403,76,132,273,274, +249,250,251,252,201,202,203,204,289,290,2,258,259,260,238,239,260,260,261,262,262,263,264,273,274,275,276,2,93,94,385,49,134,135,2,2,166,2,2,166,2,2,134,135,52,132,297,298, +273,274,275,276,225,226,227,228,265,266,2,282,283,284,285,285,285,285,285,285,286,287,288,297,298,299,300,2,117,118,2,73,373,2,217,2,190,373,373,190,2,219,2,373,76,132,201,203, +297,298,299,300,249,250,251,252,290,2,2,306,307,308,309,308,309,308,309,310,310,311,312,131,2,339,340,2,134,135,2,97,98,99,99,98,99,2,2,98,98,99,98,99,100,132,225,227, +202,203,204,386,273,274,275,276,2,2,2,330,331,332,333,332,333,332,333,334,334,335,336,132,2,363,364,2,2,2,2,121,122,122,122,123,124,81,82,121,122,123,122,123,124,132,249,251, +226,227,228,386,297,298,299,300,2,290,2,162,163,164,165,162,163,164,165,162,163,164,165,132,2,201,202,203,204,2,2,145,146,146,146,147,148,57,58,145,146,147,146,147,148,132,273,275, +250,251,252,2,2,2,2,2,2,2,2,86,87,88,89,186,187,188,189,86,87,88,89,132,385,225,226,227,228,2,2,169,170,170,170,171,172,81,82,169,170,171,14,15,27,26,27,27, +274,275,276,2,270,271,271,271,272,2,2,110,111,112,113,210,211,212,213,110,111,112,113,133,2,249,250,251,252,2,2,303,2,2,2,136,137,290,265,265,266,266,38,39,2,2,2,51, +298,299,300,2,294,1,1,1,296,2,2,136,137,2,2,234,290,265,237,2,2,2,339,340,385,273,274,275,276,2,2,327,2,2,2,160,161,386,266,289,290,265,62,63,73,74,75,75, +202,203,204,2,294,1,1,1,296,2,2,160,161,265,266,266,265,266,290,2,2,2,363,364,2,297,298,299,300,2,2,2,2,2,2,2,2,266,290,2,2,2,398,399,97,98,99,99, +226,227,228,2,318,319,319,319,320,2,386,266,266,289,290,265,266,241,265,266,266,265,266,241,385,2,2,2,241,265,266,266,265,386,265,266,266,265,266,2,2,2,206,207,121,122,123,123, +250,251,252,2,2,2,2,2,2,385,289,290,386,265,265,2,2,241,289,290,265,266,290,266,265,266,266,386,266,289,290,265,266,290,289,385,265,266,290,2,2,2,230,231,145,146,147,147, +274,275,276,201,202,203,204,257,2,2,2,257,2,265,386,2,257,2,2,2,257,2,241,241,289,290,265,266,290,241,2,2,2,2,2,2,21,22,23,24,2,2,254,255,169,170,171,171, +298,299,300,225,226,227,228,253,205,229,205,253,2,290,265,2,253,205,229,205,253,201,202,203,204,2,2,2,2,2,2,2,2,2,2,2,45,46,47,48,2,2,2,2,2,201,202,203, +2,2,386,249,250,251,252,345,346,347,348,277,2,265,266,2,301,386,2,2,2,225,226,227,228,2,2,2,2,2,2,2,2,2,339,340,69,70,71,72,387,201,202,203,204,225,226,227, +202,203,204,273,274,275,276,369,370,371,372,301,2,289,290,2,325,387,201,202,204,249,250,251,252,201,203,204,2,2,2,2,387,2,363,364,2,2,2,2,2,225,226,227,228,249,250,251, +226,227,228,297,298,299,300,393,394,395,396,325,2,265,266,2,301,386,225,226,228,273,274,275,276,225,227,228,201,202,203,204,201,202,203,204,387,201,202,203,204,249,250,251,252,273,274,275 - + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, diff --git a/src/mapstruct.h b/src/mapstruct.h index bcf1c77..321107b 100644 --- a/src/mapstruct.h +++ b/src/mapstruct.h @@ -3,6 +3,17 @@ #include + + +typedef struct { + /* the ID of the tile, as per tiled configuration, first is ID=0, then line by line, each line left to right, +1 at each tile.*/ + int tileID; + /* maximum speed on that tile for the player */ + /* Note : Speed = 0 means that the tile is not walkable */ + int speed; +} Tile_Data; + + typedef struct { /* width, height and the number of layer of the map */ int w, h, nblayers; @@ -15,4 +26,5 @@ typedef struct { short *layers[]; } Map; + #endif