diff --git a/CMakeLists.txt b/CMakeLists.txt index 92edc74..f3a74f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,18 +29,39 @@ set(ASSETS_cg assets-cg/traffic/car6.png assets-cg/traffic/car7.png assets-cg/traffic/car8.png - assets-cg/trees/tree1.png - assets-cg/trees/tree2.png - assets-cg/trees/tree3.png - assets-cg/trees/tree4.png - assets-cg/trees/tree5.png - assets-cg/trees/tree6.png + + assets-cg/decos/plains/pl_tree1.png + assets-cg/decos/plains/pl_tree2.png + assets-cg/decos/plains/pl_tree3.png + assets-cg/decos/plains/pl_tree4.png + + assets-cg/decos/desert/dt_tree1.png + assets-cg/decos/desert/dt_tree2.png + assets-cg/decos/desert/dt_tree3.png + assets-cg/decos/desert/dt_tree4.png + assets-cg/decos/desert/dt_smallleaf.png + + assets-cg/decos/usa/us_tree4.png + + assets-cg/decos/finland/fi_tree1.png + assets-cg/decos/finland/fi_tree2.png + assets-cg/decos/finland/fi_tree4.png + assets-cg/decos/finland/fi_rocks.png + + assets-cg/decos/africa/af_bigleaf.png + + assets-cg/decos/common/cc_bigleaf.png + assets-cg/decos/common/cc_smallleaf.png + assets-cg/decos/common/cc_rocks.png + assets-cg/player/player.png assets-cg/clouds/sky1.png assets-cg/clouds/sky2.png assets-cg/clouds/sky3.png + assets-cg/backgrnd/mountain.png assets-cg/backgrnd/treeline.png + assets-cg/billboard/leftturn.png assets-cg/billboard/rightturn.png assets-cg/billboard/uphill.png @@ -49,12 +70,23 @@ set(ASSETS_cg assets-cg/billboard/startlights.png assets-cg/billboard/stoplights.png assets-cg/billboard/waitlights.png + assets-cg/fonts/speedfont.png assets-cg/fonts/auto15.png assets-cg/fonts/auto20.png + assets-cg/menus/flag.png + assets-cg/hud/speedhud.png + assets-cg/screens/mainscreen.png + + assets-cg/miniscreen/africa1.png + assets-cg/miniscreen/desert1.png + assets-cg/miniscreen/finland1.png + assets-cg/miniscreen/plains1.png + assets-cg/miniscreen/usa1.png + ) fxconv_declare_assets(${ASSETS_cg} WITH_METADATA) diff --git a/CppOutRun.cscope_file_list b/CppOutRun.cscope_file_list new file mode 100644 index 0000000..58dca7f --- /dev/null +++ b/CppOutRun.cscope_file_list @@ -0,0 +1,22 @@ +"/home/sylvain/Programmes/Casio/CppOutRun/assets-cg/fxconv-metadata.txt" +"/home/sylvain/Programmes/Casio/CppOutRun/src/src/cars.cc" +"/home/sylvain/Programmes/Casio/CppOutRun/src/colors.h" +"/home/sylvain/Programmes/Casio/CppOutRun/src/include/drawstuff.h" +"/home/sylvain/Programmes/Casio/CppOutRun/src/src/segment.cc" +"/home/sylvain/Programmes/Casio/CppOutRun/src/parameters.h" +"/home/sylvain/Programmes/Casio/CppOutRun/assets-cg/traffic/fxconv-metadata.txt" +"/home/sylvain/Programmes/Casio/CppOutRun/src/src/circuit.cc" +"/home/sylvain/Programmes/Casio/CppOutRun/TODO.txt" +"/home/sylvain/Programmes/Casio/CppOutRun/src/src/drawstuff.cc" +"/home/sylvain/Programmes/Casio/CppOutRun/src/src/camera.cc" +"/home/sylvain/Programmes/Casio/CppOutRun/src/fixed.h" +"/home/sylvain/Programmes/Casio/CppOutRun/src/include/camera.h" +"/home/sylvain/Programmes/Casio/CppOutRun/src/main.cc" +"/home/sylvain/Programmes/Casio/CppOutRun/CMakeLists.txt" +"/home/sylvain/Programmes/Casio/CppOutRun/src/src/clouds.cc" +"/home/sylvain/Programmes/Casio/CppOutRun/src/include/segment.h" +"/home/sylvain/Programmes/Casio/CppOutRun/src/src/menus.cc" +"/home/sylvain/Programmes/Casio/CppOutRun/src/include/cars.h" +"/home/sylvain/Programmes/Casio/CppOutRun/src/include/clouds.h" +"/home/sylvain/Programmes/Casio/CppOutRun/src/include/circuit.h" +"/home/sylvain/Programmes/Casio/CppOutRun/src/include/menus.h" diff --git a/CppOutRun.layout b/CppOutRun.layout index c79b1f2..71f5a82 100644 --- a/CppOutRun.layout +++ b/CppOutRun.layout @@ -2,25 +2,23 @@ - + - + - + - + - + - - - - - - + + + + @@ -32,44 +30,9 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -82,34 +45,37 @@ - + - + + + + + + + + + + + + + + - + - + - + - + - + - - - - - - - - - - - + @@ -117,4 +83,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TODO.txt b/TODO.txt index f24443e..0247efa 100644 --- a/TODO.txt +++ b/TODO.txt @@ -6,17 +6,29 @@ Add Checkpoints Menus and Options + + Add Player name (3 letters on car plate) Traffic AI + Collision from front + Collision from behind + Circuit editor ? Various circuit -Additional landscapes / sprites / biomes +Additional landscapes / sprites / +Biomes: + PLAINS + DESERT + USA + FINLAND + AFRICA ? + Color Palet transformation for vegetation depending on biomes (plains = greenish / desert = yellowish / ... ) diff --git a/assets-cg/decos/africa/af_bigleaf.png b/assets-cg/decos/africa/af_bigleaf.png new file mode 100755 index 0000000..b5419c9 Binary files /dev/null and b/assets-cg/decos/africa/af_bigleaf.png differ diff --git a/assets-cg/trees/fxconv-metadata.txt b/assets-cg/decos/africa/fxconv-metadata.txt similarity index 100% rename from assets-cg/trees/fxconv-metadata.txt rename to assets-cg/decos/africa/fxconv-metadata.txt diff --git a/assets-cg/trees/tree5.png b/assets-cg/decos/common/cc_bigleaf.png similarity index 100% rename from assets-cg/trees/tree5.png rename to assets-cg/decos/common/cc_bigleaf.png diff --git a/assets-cg/decos/common/cc_rocks.png b/assets-cg/decos/common/cc_rocks.png new file mode 100755 index 0000000..d7befd0 Binary files /dev/null and b/assets-cg/decos/common/cc_rocks.png differ diff --git a/assets-cg/trees/tree6.png b/assets-cg/decos/common/cc_smallleaf.png similarity index 100% rename from assets-cg/trees/tree6.png rename to assets-cg/decos/common/cc_smallleaf.png diff --git a/assets-cg/decos/common/fxconv-metadata.txt b/assets-cg/decos/common/fxconv-metadata.txt new file mode 100644 index 0000000..7e05b58 --- /dev/null +++ b/assets-cg/decos/common/fxconv-metadata.txt @@ -0,0 +1,5 @@ +*.png: + type: bopti-image + profile: p4 + name_regex: (.*)\.png \1 + diff --git a/assets-cg/decos/desert/dt_smallleaf.png b/assets-cg/decos/desert/dt_smallleaf.png new file mode 100644 index 0000000..6388764 Binary files /dev/null and b/assets-cg/decos/desert/dt_smallleaf.png differ diff --git a/assets-cg/trees/tree1.png b/assets-cg/decos/desert/dt_tree1.png similarity index 100% rename from assets-cg/trees/tree1.png rename to assets-cg/decos/desert/dt_tree1.png diff --git a/assets-cg/trees/tree4.png b/assets-cg/decos/desert/dt_tree2.png similarity index 100% rename from assets-cg/trees/tree4.png rename to assets-cg/decos/desert/dt_tree2.png diff --git a/assets-cg/decos/desert/dt_tree3.png b/assets-cg/decos/desert/dt_tree3.png new file mode 100644 index 0000000..122606f Binary files /dev/null and b/assets-cg/decos/desert/dt_tree3.png differ diff --git a/assets-cg/decos/desert/dt_tree4.png b/assets-cg/decos/desert/dt_tree4.png new file mode 100644 index 0000000..b637d5f Binary files /dev/null and b/assets-cg/decos/desert/dt_tree4.png differ diff --git a/assets-cg/decos/desert/fxconv-metadata.txt b/assets-cg/decos/desert/fxconv-metadata.txt new file mode 100644 index 0000000..7e05b58 --- /dev/null +++ b/assets-cg/decos/desert/fxconv-metadata.txt @@ -0,0 +1,5 @@ +*.png: + type: bopti-image + profile: p4 + name_regex: (.*)\.png \1 + diff --git a/assets-cg/decos/finland/fi_rocks.png b/assets-cg/decos/finland/fi_rocks.png new file mode 100644 index 0000000..22f48a1 Binary files /dev/null and b/assets-cg/decos/finland/fi_rocks.png differ diff --git a/assets-cg/decos/finland/fi_tree1.png b/assets-cg/decos/finland/fi_tree1.png new file mode 100755 index 0000000..6887350 Binary files /dev/null and b/assets-cg/decos/finland/fi_tree1.png differ diff --git a/assets-cg/decos/finland/fi_tree2.png b/assets-cg/decos/finland/fi_tree2.png new file mode 100755 index 0000000..9d99829 Binary files /dev/null and b/assets-cg/decos/finland/fi_tree2.png differ diff --git a/assets-cg/decos/finland/fi_tree4.png b/assets-cg/decos/finland/fi_tree4.png new file mode 100644 index 0000000..c059ba4 Binary files /dev/null and b/assets-cg/decos/finland/fi_tree4.png differ diff --git a/assets-cg/decos/finland/fxconv-metadata.txt b/assets-cg/decos/finland/fxconv-metadata.txt new file mode 100644 index 0000000..7e05b58 --- /dev/null +++ b/assets-cg/decos/finland/fxconv-metadata.txt @@ -0,0 +1,5 @@ +*.png: + type: bopti-image + profile: p4 + name_regex: (.*)\.png \1 + diff --git a/assets-cg/decos/plains/fxconv-metadata.txt b/assets-cg/decos/plains/fxconv-metadata.txt new file mode 100644 index 0000000..7e05b58 --- /dev/null +++ b/assets-cg/decos/plains/fxconv-metadata.txt @@ -0,0 +1,5 @@ +*.png: + type: bopti-image + profile: p4 + name_regex: (.*)\.png \1 + diff --git a/assets-cg/decos/plains/pl_tree1.png b/assets-cg/decos/plains/pl_tree1.png new file mode 100644 index 0000000..5f8c093 Binary files /dev/null and b/assets-cg/decos/plains/pl_tree1.png differ diff --git a/assets-cg/trees/tree3.png b/assets-cg/decos/plains/pl_tree2.png similarity index 100% rename from assets-cg/trees/tree3.png rename to assets-cg/decos/plains/pl_tree2.png diff --git a/assets-cg/decos/plains/pl_tree3.png b/assets-cg/decos/plains/pl_tree3.png new file mode 100644 index 0000000..8ec1c12 Binary files /dev/null and b/assets-cg/decos/plains/pl_tree3.png differ diff --git a/assets-cg/decos/plains/pl_tree4.png b/assets-cg/decos/plains/pl_tree4.png new file mode 100644 index 0000000..20d3863 Binary files /dev/null and b/assets-cg/decos/plains/pl_tree4.png differ diff --git a/assets-cg/decos/usa/fxconv-metadata.txt b/assets-cg/decos/usa/fxconv-metadata.txt new file mode 100644 index 0000000..7e05b58 --- /dev/null +++ b/assets-cg/decos/usa/fxconv-metadata.txt @@ -0,0 +1,5 @@ +*.png: + type: bopti-image + profile: p4 + name_regex: (.*)\.png \1 + diff --git a/assets-cg/trees/tree2.png b/assets-cg/decos/usa/us_tree4.png similarity index 100% rename from assets-cg/trees/tree2.png rename to assets-cg/decos/usa/us_tree4.png diff --git a/assets-cg/miniscreen/africa1.png b/assets-cg/miniscreen/africa1.png new file mode 100644 index 0000000..fc734a6 Binary files /dev/null and b/assets-cg/miniscreen/africa1.png differ diff --git a/assets-cg/miniscreen/desert1.png b/assets-cg/miniscreen/desert1.png new file mode 100644 index 0000000..786e5a5 Binary files /dev/null and b/assets-cg/miniscreen/desert1.png differ diff --git a/assets-cg/miniscreen/finland1.png b/assets-cg/miniscreen/finland1.png new file mode 100644 index 0000000..6c348ca Binary files /dev/null and b/assets-cg/miniscreen/finland1.png differ diff --git a/assets-cg/miniscreen/fxconv-metadata.txt b/assets-cg/miniscreen/fxconv-metadata.txt new file mode 100644 index 0000000..ac7543f --- /dev/null +++ b/assets-cg/miniscreen/fxconv-metadata.txt @@ -0,0 +1,5 @@ +*.png: + type: bopti-image + profile: p8 + name_regex: (.*)\.png \1 + diff --git a/assets-cg/miniscreen/plains1.png b/assets-cg/miniscreen/plains1.png new file mode 100644 index 0000000..832a7aa Binary files /dev/null and b/assets-cg/miniscreen/plains1.png differ diff --git a/assets-cg/miniscreen/usa1.png b/assets-cg/miniscreen/usa1.png new file mode 100644 index 0000000..edff2ae Binary files /dev/null and b/assets-cg/miniscreen/usa1.png differ diff --git a/src/colors.h b/src/colors.h index 9eb8c39..1cc8b3b 100644 --- a/src/colors.h +++ b/src/colors.h @@ -4,9 +4,13 @@ #define LIGHT_GREY_ROAD 0xC638 #define DARK_GREY_ROAD 0xBDD7 //0xB5B6 +#define BLACK_ROAD 0x528A +#define OCRE_ROAD 0xCBA4 +#define SNOW_ROAD 0xF79F #define WHITE_STRIPE 0xFFFF #define RED_STRIPE 0xF800 +#define YELLOW_STRIPE 0xEF40 #define LIGHT_GREEN_GRASS 0x07E5 #define DARK_GREEN_GRASS 0x0680 @@ -14,6 +18,12 @@ #define LIGHT_YELLOW_GRASS 0xFFE0 #define DARK_YELLOW_GRASS 0xD6A0 -#define DAY_BLUE_SKY 0x017F +#define LIGHT_SNOW_GRASS 0xF79F +#define DARK_SNOW_GRASS 0xE73C + +#define LIGHT_EARTH 0xFDC6 +#define DARK_EARTH 0xCC40 + +#define DAY_BLUE_SKY 0x017F #endif // PARAMETERS_H diff --git a/src/include/circuit.h b/src/include/circuit.h index ad8fa6c..16a974a 100644 --- a/src/include/circuit.h +++ b/src/include/circuit.h @@ -42,20 +42,21 @@ enum CurveType enum Decoration { - PALMTREE = 0, - DEADTREE = 1, - OAKTREE = 2, - CACTUS = 3, - BIGLEAF = 4, - SMALLLEAF = 5, - LEFTTURN = 6, - RIGHTTURN = 7, - UPHILL = 8, - DOWNHILL = 9, - CHECK = 10, - STARTLIGHT = 11, - STOPLIGHT = 12, - WAITLIGHT = 13 + TREE1 = 0, + TREE2 = 1, + TREE3 = 2, + TREE4 = 3, + LEAF1 = 4, + LEAF2 = 5, + ROCKS = 6, + LEFTTURN = 7, + RIGHTTURN = 8, + UPHILL = 9, + DOWNHILL = 10, + CHECK = 11, + STARTLIGHT = 12, + STOPLIGHT = 13, + WAITLIGHT = 14 }; void initData( void ); @@ -80,7 +81,7 @@ void drawFarBackground( int offset ); void drawNearBackground( int offset ); void freeDecoration( void ); -void prepareDecoration( void ); +void prepareDecoration( int biometoload ); void freeTraffic( void ); void prepareTraffic( void ); diff --git a/src/include/segment.h b/src/include/segment.h index 494a538..e2da4ce 100644 --- a/src/include/segment.h +++ b/src/include/segment.h @@ -12,7 +12,10 @@ enum BiomeType { PLAINS = 0, - DESERT = 1 + DESERT = 1, + USA = 2, + FINLAND = 3, + AFRICA = 4 }; enum Specialty diff --git a/src/main.cc b/src/main.cc index 92272c7..9e174e7 100644 --- a/src/main.cc +++ b/src/main.cc @@ -25,17 +25,21 @@ #include "include/menus.h" -extern bopti_image_t car1, car2, car3, car4, car5, car6, car7, car8; -extern bopti_image_t tree1, tree2, tree3, tree4, tree5, tree6; -extern bopti_image_t leftturn, rightturn, uphill, downhill; -extern bopti_image_t checkpoint, startlights, stoplights, waitlights; +//extern bopti_image_t car1, car2, car3, car4, car5, car6, car7, car8; +//extern bopti_image_t tree1, tree2, tree3, tree4, tree5, tree6; +//extern bopti_image_t leftturn, rightturn, uphill, downhill; +//extern bopti_image_t checkpoint, startlights, stoplights, waitlights; extern bopti_image_t player; -extern bopti_image_t sky1, sky2, sky3; -extern bopti_image_t mountain, treeline; -extern bopti_image_t mainscreen; +//extern bopti_image_t sky1, sky2, sky3; +//extern bopti_image_t mountain, treeline; +//extern bopti_image_t mainscreen; extern font_t speedfont; extern bopti_image_t speedhud; + +int CurrentCircuitBiome = PLAINS; + + std::vector circuit; int MAX_SEGMENT=0; camera *cam; @@ -276,6 +280,21 @@ int main(void) } while (!exitflag); + stage = selectedCircuit; + + if (selectedCircuit==0) CurrentCircuitBiome = PLAINS; + else if (selectedCircuit==1) CurrentCircuitBiome = DESERT; + else if (selectedCircuit==2) CurrentCircuitBiome = USA; + else if (selectedCircuit==3) CurrentCircuitBiome = FINLAND; + else if (selectedCircuit==4) CurrentCircuitBiome = AFRICA; + else if (selectedCircuit==5) CurrentCircuitBiome = PLAINS; + else if (selectedCircuit==6) CurrentCircuitBiome = DESERT; + else if (selectedCircuit==7) CurrentCircuitBiome = USA; + else if (selectedCircuit==8) CurrentCircuitBiome = FINLAND; + else if (selectedCircuit==9) CurrentCircuitBiome = AFRICA; + else CurrentCircuitBiome = PLAINS; + + int nbInterestingSegments = (MAX_RENDER_DISTANCE / SEGMENT_LENGTH); // the number of segments to be projected considering the rendering distance @@ -290,7 +309,7 @@ int main(void) createClouds(); // Creates the Sky and Clouds createTraffic(); // Creates the cas - prepareDecoration(); // Prepares the multiple variations of Decoration (image scaling) + prepareDecoration( CurrentCircuitBiome ); // Prepares the multiple variations of Decoration (image scaling) prepareTraffic(); // Prepares the multiple variations of Cars (image scaling) prof_leave(perf_create); diff --git a/src/parameters.h b/src/parameters.h index 19ad88c..83c2cf2 100644 --- a/src/parameters.h +++ b/src/parameters.h @@ -22,7 +22,7 @@ #define NB_CARS_TRAFFIC 100 #define MAX_SUBIMAGES_TREES 12 -#define NB_TREES_TYPES 14 +#define NB_TREES_TYPES 15 #define MAX_SUBIMAGES_CARS 12 #define NB_CARS_TYPES 8 diff --git a/src/src/circuit.cc b/src/src/circuit.cc index ab31137..32ff3a4 100644 --- a/src/src/circuit.cc +++ b/src/src/circuit.cc @@ -26,7 +26,10 @@ extern bool ShowDebug1; extern bopti_image_t car1, car2, car3, car4, car5, car6, car7, car8; -extern bopti_image_t tree1, tree2, tree3, tree4, tree5, tree6; + +extern bopti_image_t pl_tree1, pl_tree2, pl_tree3, pl_tree4, dt_tree1, dt_tree2, dt_tree3, dt_tree4, us_tree4, fi_tree1, fi_tree2, fi_tree4; +extern bopti_image_t cc_bigleaf, cc_smallleaf, cc_rocks, af_bigleaf, dt_smallleaf, fi_rocks; + extern bopti_image_t sky1, sky2, sky3; extern bopti_image_t mountain; extern bopti_image_t treeline; @@ -38,6 +41,9 @@ bopti_image_t *scaledTrees[NB_TREES_TYPES][MAX_SUBIMAGES_TREES] = { 0 }; bopti_image_t *scaledCars[NB_CARS_TYPES][MAX_SUBIMAGES_CARS] = { 0 }; +extern int CurrentCircuitBiome; + + size_t image_size_profile(int profile, int width, int height) { size_t size = sizeof(bopti_image_t); @@ -144,6 +150,11 @@ void createCircuit( void ) { addStartLine( PLAINS ); addStraightLine( L_VERYSHORT, PLAINS ); + addStraightLine( L_VERYSHORT, DESERT ); + addStraightLine( L_VERYSHORT, USA ); + addStraightLine( L_VERYSHORT, FINLAND ); + addStraightLine( L_VERYSHORT, AFRICA ); + addCurvyHill( L_MEDIUM, H_BIG, UP_HILL, C_HARD, LEFT_CURVE, USA ); addCurvyHill( L_MEDIUM, H_BIG, UP_HILL, C_HARD, LEFT_CURVE, DESERT ); addStraightLine( L_VERYSHORT, DESERT ); addCurvyHill( L_MEDIUM, H_BIG, DOWN_HILL, C_HARD, RIGHT_CURVE, DESERT ); @@ -429,13 +440,17 @@ void addStraightLine( Length l, int8_t biome ) for( int i=0; iEnvironment == PLAINS) { if (index%2==0) { - //drawGrass( Y2, Y1, DARK_GREEN_GRASS ); - drawPolygon( 0, X2-W2/16-W2+currentcurve, Y2, 0, X1-W1/16-W1+currentcurve, Y1, DARK_GREEN_GRASS ); - drawPolygon( X2-W2+currentcurve, X2+W2+currentcurve, Y2, X1-W1+currentcurve, X1+W1+currentcurve, Y1, LIGHT_GREY_ROAD ); - drawPolygon( X2-W2/16-W2+currentcurve, X2-W2+currentcurve, Y2, X1-W1/16-W1+currentcurve, X1-W1+currentcurve, Y1, WHITE_STRIPE ); - drawPolygon( X2-W2/50+currentcurve, X2+W2/50+currentcurve, Y2, X1-W1/50+currentcurve, X1+W1/50+currentcurve, Y1, WHITE_STRIPE ); drawPolygon( X2-W2/50-W2/2+currentcurve, X2+W2/50-W2/2+currentcurve, Y2, X1-W1/50-W1/2+currentcurve, X1+W1/50-W1/2+currentcurve, Y1, WHITE_STRIPE ); drawPolygon( X2-W2/50+currentcurve, X2+W2/50+currentcurve, Y2, X1-W1/50+currentcurve, X1+W1/50+currentcurve, Y1, WHITE_STRIPE ); drawPolygon( X2-W2/50+W2/2+currentcurve, X2+W2/50+W2/2+currentcurve, Y2, X1-W1/50+W1/2+currentcurve, X1+W1/50+W1/2+currentcurve, Y1, WHITE_STRIPE ); drawPolygon( X2+W2+currentcurve, X2+W2+W2/16+currentcurve, Y2, X1+W1+currentcurve, X1+W1+W1/16+currentcurve, Y1, WHITE_STRIPE ); - drawPolygon( X2+W2/16+W2+currentcurve, 396, Y2, X1+W1/16+W1+currentcurve, 396, Y1, DARK_GREEN_GRASS ); } else { - //drawGrass( Y2, Y1, LIGHT_GREEN_GRASS ); drawPolygon( 0, X2-W2/16-W2+currentcurve, Y2, 0, X1-W1/16-W1+currentcurve, Y1, LIGHT_GREEN_GRASS ); - drawPolygon( X2-W2+currentcurve, X2+W2+currentcurve, Y2, X1-W1+currentcurve, X1+W1+currentcurve, Y1, DARK_GREY_ROAD ); drawPolygon( X2-W2/16-W2+currentcurve, X2-W2+currentcurve, Y2, X1-W1/16-W1+currentcurve, X1-W1+currentcurve, Y1, RED_STRIPE ); drawPolygon( X2+W2+currentcurve, X2+W2+W2/16+currentcurve, Y2, X1+W1+currentcurve, X1+W1+W1/16+currentcurve, Y1, RED_STRIPE ); - drawPolygon( X2+W2/16+W2+currentcurve, 396, Y2, X1+W1/16+W1+currentcurve, 396, Y1, LIGHT_GREEN_GRASS ); } } @@ -647,24 +646,133 @@ void drawCircuitSegment( uint16_t index ) { if (index%2==0) { - drawGrass( Y2, Y1, DARK_YELLOW_GRASS ); + drawPolygon( 0, X2-W2/16-W2+currentcurve, Y2, 0, X1-W1/16-W1+currentcurve, Y1, DARK_YELLOW_GRASS ); drawPolygon( X2-W2+currentcurve, X2+W2+currentcurve, Y2, X1-W1+currentcurve, X1+W1+currentcurve, Y1, LIGHT_GREY_ROAD ); - drawPolygon( X2-W2/50+currentcurve, X2+W2/50+currentcurve, Y2, X1-W1/50+currentcurve, X1+W1/50+currentcurve, Y1, WHITE_STRIPE ); drawPolygon( X2-W2/16-W2+currentcurve, X2-W2+currentcurve, Y2, X1-W1/16-W1+currentcurve, X1-W1+currentcurve, Y1, WHITE_STRIPE ); drawPolygon( X2-W2/50-W2/2+currentcurve, X2+W2/50-W2/2+currentcurve, Y2, X1-W1/50-W1/2+currentcurve, X1+W1/50-W1/2+currentcurve, Y1, WHITE_STRIPE ); drawPolygon( X2-W2/50+currentcurve, X2+W2/50+currentcurve, Y2, X1-W1/50+currentcurve, X1+W1/50+currentcurve, Y1, WHITE_STRIPE ); drawPolygon( X2-W2/50+W2/2+currentcurve, X2+W2/50+W2/2+currentcurve, Y2, X1-W1/50+W1/2+currentcurve, X1+W1/50+W1/2+currentcurve, Y1, WHITE_STRIPE ); drawPolygon( X2+W2+currentcurve, X2+W2+W2/16+currentcurve, Y2, X1+W1+currentcurve, X1+W1+W1/16+currentcurve, Y1, WHITE_STRIPE ); + drawPolygon( X2+W2/16+W2+currentcurve, 396, Y2, X1+W1/16+W1+currentcurve, 396, Y1, DARK_YELLOW_GRASS ); } else { - drawGrass( Y2, Y1, LIGHT_YELLOW_GRASS ); + drawPolygon( 0, X2-W2/16-W2+currentcurve, Y2, 0, X1-W1/16-W1+currentcurve, Y1, LIGHT_YELLOW_GRASS ); drawPolygon( X2-W2+currentcurve, X2+W2+currentcurve, Y2, X1-W1+currentcurve, X1+W1+currentcurve, Y1, DARK_GREY_ROAD ); drawPolygon( X2-W2/16-W2+currentcurve, X2-W2+currentcurve, Y2, X1-W1/16-W1+currentcurve, X1-W1+currentcurve, Y1, RED_STRIPE ); drawPolygon( X2+W2+currentcurve, X2+W2+W2/16+currentcurve, Y2, X1+W1+currentcurve, X1+W1+W1/16+currentcurve, Y1, RED_STRIPE ); + drawPolygon( X2+W2/16+W2+currentcurve, 396, Y2, X1+W1/16+W1+currentcurve, 396, Y1, LIGHT_YELLOW_GRASS ); } } + else if (circuit[index]->Environment == USA) + { + if (index%2==0) + { + drawPolygon( 0, X2-W2/16-W2+currentcurve, Y2, 0, X1-W1/16-W1+currentcurve, Y1, DARK_GREEN_GRASS ); + drawPolygon( X2-W2+currentcurve, X2+W2+currentcurve, Y2, X1-W1+currentcurve, X1+W1+currentcurve, Y1, BLACK_ROAD ); + drawPolygon( X2-W2/16-W2+currentcurve, X2-W2+currentcurve, Y2, X1-W1/16-W1+currentcurve, X1-W1+currentcurve, Y1, WHITE_STRIPE ); + drawPolygon( X2-W2/50-W2/2+currentcurve, X2+W2/50-W2/2+currentcurve, Y2, X1-W1/50-W1/2+currentcurve, X1+W1/50-W1/2+currentcurve, Y1, WHITE_STRIPE ); + drawPolygon( X2-W2/25+currentcurve, X2-W2/50+currentcurve, Y2, X1-W1/25+currentcurve, X1-W1/50+currentcurve, Y1, YELLOW_STRIPE ); + drawPolygon( X2+W2/50+currentcurve, X2+W2/25+currentcurve, Y2, X1+W1/50+currentcurve, X1+W1/25+currentcurve, Y1, YELLOW_STRIPE ); + drawPolygon( X2-W2/50+W2/2+currentcurve, X2+W2/50+W2/2+currentcurve, Y2, X1-W1/50+W1/2+currentcurve, X1+W1/50+W1/2+currentcurve, Y1, WHITE_STRIPE ); + drawPolygon( X2+W2+currentcurve, X2+W2+W2/16+currentcurve, Y2, X1+W1+currentcurve, X1+W1+W1/16+currentcurve, Y1, WHITE_STRIPE ); + drawPolygon( X2+W2/16+W2+currentcurve, 396, Y2, X1+W1/16+W1+currentcurve, 396, Y1, DARK_GREEN_GRASS ); + } + else + { + drawPolygon( 0, X2-W2/16-W2+currentcurve, Y2, 0, X1-W1/16-W1+currentcurve, Y1, LIGHT_GREEN_GRASS ); + drawPolygon( X2-W2+currentcurve, X2+W2+currentcurve, Y2, X1-W1+currentcurve, X1+W1+currentcurve, Y1, BLACK_ROAD ); + drawPolygon( X2-W2/16-W2+currentcurve, X2-W2+currentcurve, Y2, X1-W1/16-W1+currentcurve, X1-W1+currentcurve, Y1, WHITE_STRIPE ); + drawPolygon( X2-W2/25+currentcurve, X2-W2/50+currentcurve, Y2, X1-W1/25+currentcurve, X1-W1/50+currentcurve, Y1, YELLOW_STRIPE ); + drawPolygon( X2+W2/50+currentcurve, X2+W2/25+currentcurve, Y2, X1+W1/50+currentcurve, X1+W1/25+currentcurve, Y1, YELLOW_STRIPE ); + drawPolygon( X2+W2+currentcurve, X2+W2+W2/16+currentcurve, Y2, X1+W1+currentcurve, X1+W1+W1/16+currentcurve, Y1, WHITE_STRIPE ); + drawPolygon( X2+W2/16+W2+currentcurve, 396, Y2, X1+W1/16+W1+currentcurve, 396, Y1, LIGHT_GREEN_GRASS ); + } + } + else if (circuit[index]->Environment == FINLAND) + { + if (index%2==0) + { + drawPolygon( 0, X2-W2+currentcurve, Y2, 0, X1-W1+currentcurve, Y1, DARK_SNOW_GRASS ); + drawPolygon( X2-W2+currentcurve, X2+W2+currentcurve, Y2, X1-W1+currentcurve, X1+W1+currentcurve, Y1, SNOW_ROAD ); + drawPolygon( X2-W2/2-W2/12+currentcurve, X2-W2/2-W2/12-W2/25+currentcurve, Y2, X1-W1/2-W1/12+currentcurve, X1-W1/2-W1/12-W1/25+currentcurve, Y1, DARK_GREY_ROAD ); + drawPolygon( X2-W2+W2/12+W2/25+currentcurve, X2-W2+W2/12+currentcurve, Y2, X1-W1+W1/12+W1/25+currentcurve, X1-W1+W1/12+currentcurve, Y1, DARK_GREY_ROAD ); + + drawPolygon( X2-W2/12+currentcurve, X2-W2/12-W2/25+currentcurve, Y2, X1-W1/12+currentcurve, X1-W1/12-W1/25+currentcurve, Y1, DARK_GREY_ROAD ); + drawPolygon( X2-W2/2+W2/12+W2/25+currentcurve, X2-W2/2+W2/12+currentcurve, Y2, X1-W1/2+W1/12+W1/25+currentcurve, X1-W1/2+W1/12+currentcurve, Y1, DARK_GREY_ROAD ); + + drawPolygon( X2+W2/12+currentcurve, X2+W2/12+W2/25+currentcurve, Y2, X1+W1/12+currentcurve, X1+W1/12+W1/25+currentcurve, Y1, DARK_GREY_ROAD ); + drawPolygon( X2+W2/2-W2/12-W2/25+currentcurve, X2+W2/2-W2/12+currentcurve, Y2, X1+W1/2-W1/12-W1/25+currentcurve, X1+W1/2-W1/12+currentcurve, Y1, DARK_GREY_ROAD ); + + drawPolygon( X2+W2/2+W2/12+currentcurve, X2+W2/2+W2/12+W2/25+currentcurve, Y2, X1+W1/2+W1/12+currentcurve, X1+W1/2+W1/12+W1/25+currentcurve, Y1, DARK_GREY_ROAD ); + drawPolygon( X2+W2-W2/12-W2/25+currentcurve, X2+W2-W2/12+currentcurve, Y2, X1+W1-W1/12-W1/25+currentcurve, X1+W1-W1/12+currentcurve, Y1, DARK_GREY_ROAD ); + + drawPolygon( X2+W2+currentcurve, 396, Y2, X1+W1+currentcurve, 396, Y1, DARK_SNOW_GRASS ); + } + else + { + drawPolygon( 0, X2-W2+currentcurve, Y2, 0, X1-W1+currentcurve, Y1, LIGHT_SNOW_GRASS ); + drawPolygon( X2-W2+currentcurve, X2+W2+currentcurve, Y2, X1-W1+currentcurve, X1+W1+currentcurve, Y1, SNOW_ROAD ); + + drawPolygon( X2-W2/2-W2/12+currentcurve, X2-W2/2-W2/12-W2/25+currentcurve, Y2, X1-W1/2-W1/12+currentcurve, X1-W1/2-W1/12-W1/25+currentcurve, Y1, DARK_GREY_ROAD ); + drawPolygon( X2-W2+W2/12+W2/25+currentcurve, X2-W2+W2/12+currentcurve, Y2, X1-W1+W1/12+W1/25+currentcurve, X1-W1+W1/12+currentcurve, Y1, DARK_GREY_ROAD ); + + drawPolygon( X2-W2/12+currentcurve, X2-W2/12-W2/25+currentcurve, Y2, X1-W1/12+currentcurve, X1-W1/12-W1/25+currentcurve, Y1, DARK_GREY_ROAD ); + drawPolygon( X2-W2/2+W2/12+W2/25+currentcurve, X2-W2/2+W2/12+currentcurve, Y2, X1-W1/2+W1/12+W1/25+currentcurve, X1-W1/2+W1/12+currentcurve, Y1, DARK_GREY_ROAD ); + + drawPolygon( X2+W2/12+currentcurve, X2+W2/12+W2/25+currentcurve, Y2, X1+W1/12+currentcurve, X1+W1/12+W1/25+currentcurve, Y1, DARK_GREY_ROAD ); + drawPolygon( X2+W2/2-W2/12-W2/25+currentcurve, X2+W2/2-W2/12+currentcurve, Y2, X1+W1/2-W1/12-W1/25+currentcurve, X1+W1/2-W1/12+currentcurve, Y1, DARK_GREY_ROAD ); + + drawPolygon( X2+W2/2+W2/12+currentcurve, X2+W2/2+W2/12+W2/25+currentcurve, Y2, X1+W1/2+W1/12+currentcurve, X1+W1/2+W1/12+W1/25+currentcurve, Y1, DARK_GREY_ROAD ); + drawPolygon( X2+W2-W2/12-W2/25+currentcurve, X2+W2-W2/12+currentcurve, Y2, X1+W1-W1/12-W1/25+currentcurve, X1+W1-W1/12+currentcurve, Y1, DARK_GREY_ROAD ); + + drawPolygon( X2+W2+currentcurve, 396, Y2, X1+W1+currentcurve, 396, Y1, LIGHT_SNOW_GRASS ); + } + } + else if (circuit[index]->Environment == AFRICA) + { + if (index%2==0) + { + drawPolygon( 0, X2-W2+currentcurve, Y2, 0, X1-W1+currentcurve, Y1, DARK_EARTH ); + drawPolygon( X2-W2+currentcurve, X2+W2+currentcurve, Y2, X1-W1+currentcurve, X1+W1+currentcurve, Y1, OCRE_ROAD ); + + drawPolygon( X2-W2/2-W2/12+currentcurve, X2-W2/2-W2/12-W2/25+currentcurve, Y2, X1-W1/2-W1/12+currentcurve, X1-W1/2-W1/12-W1/25+currentcurve, Y1, DARK_EARTH ); + drawPolygon( X2-W2+W2/12+W2/25+currentcurve, X2-W2+W2/12+currentcurve, Y2, X1-W1+W1/12+W1/25+currentcurve, X1-W1+W1/12+currentcurve, Y1, DARK_EARTH ); + + drawPolygon( X2-W2/12+currentcurve, X2-W2/12-W2/25+currentcurve, Y2, X1-W1/12+currentcurve, X1-W1/12-W1/25+currentcurve, Y1, DARK_EARTH ); + drawPolygon( X2-W2/2+W2/12+W2/25+currentcurve, X2-W2/2+W2/12+currentcurve, Y2, X1-W1/2+W1/12+W1/25+currentcurve, X1-W1/2+W1/12+currentcurve, Y1, DARK_EARTH ); + + drawPolygon( X2+W2/12+currentcurve, X2+W2/12+W2/25+currentcurve, Y2, X1+W1/12+currentcurve, X1+W1/12+W1/25+currentcurve, Y1, DARK_EARTH ); + drawPolygon( X2+W2/2-W2/12-W2/25+currentcurve, X2+W2/2-W2/12+currentcurve, Y2, X1+W1/2-W1/12-W1/25+currentcurve, X1+W1/2-W1/12+currentcurve, Y1, DARK_EARTH ); + + drawPolygon( X2+W2/2+W2/12+currentcurve, X2+W2/2+W2/12+W2/25+currentcurve, Y2, X1+W1/2+W1/12+currentcurve, X1+W1/2+W1/12+W1/25+currentcurve, Y1, DARK_EARTH ); + drawPolygon( X2+W2-W2/12-W2/25+currentcurve, X2+W2-W2/12+currentcurve, Y2, X1+W1-W1/12-W1/25+currentcurve, X1+W1-W1/12+currentcurve, Y1, DARK_EARTH ); + + drawPolygon( X2-W2/50+currentcurve, X2+W2/50+currentcurve, Y2, X1-W1/50+currentcurve, X1+W1/50+currentcurve, Y1, LIGHT_GREEN_GRASS ); + drawPolygon( X2+W2+currentcurve, 396, Y2, X1+W1+currentcurve, 396, Y1, DARK_EARTH ); + } + else + { + drawPolygon( 0, X2-W2+currentcurve, Y2, 0, X1-W1+currentcurve, Y1, LIGHT_EARTH ); + drawPolygon( X2-W2+currentcurve, X2+W2+currentcurve, Y2, X1-W1+currentcurve, X1+W1+currentcurve, Y1, OCRE_ROAD ); + + drawPolygon( X2-W2/2-W2/12+currentcurve, X2-W2/2-W2/12-W2/25+currentcurve, Y2, X1-W1/2-W1/12+currentcurve, X1-W1/2-W1/12-W1/25+currentcurve, Y1, DARK_EARTH ); + drawPolygon( X2-W2+W2/12+W2/25+currentcurve, X2-W2+W2/12+currentcurve, Y2, X1-W1+W1/12+W1/25+currentcurve, X1-W1+W1/12+currentcurve, Y1, DARK_EARTH ); + + drawPolygon( X2-W2/12+currentcurve, X2-W2/12-W2/25+currentcurve, Y2, X1-W1/12+currentcurve, X1-W1/12-W1/25+currentcurve, Y1, DARK_EARTH ); + drawPolygon( X2-W2/2+W2/12+W2/25+currentcurve, X2-W2/2+W2/12+currentcurve, Y2, X1-W1/2+W1/12+W1/25+currentcurve, X1-W1/2+W1/12+currentcurve, Y1, DARK_EARTH ); + + drawPolygon( X2+W2/12+currentcurve, X2+W2/12+W2/25+currentcurve, Y2, X1+W1/12+currentcurve, X1+W1/12+W1/25+currentcurve, Y1, DARK_EARTH ); + drawPolygon( X2+W2/2-W2/12-W2/25+currentcurve, X2+W2/2-W2/12+currentcurve, Y2, X1+W1/2-W1/12-W1/25+currentcurve, X1+W1/2-W1/12+currentcurve, Y1, DARK_EARTH ); + + drawPolygon( X2+W2/2+W2/12+currentcurve, X2+W2/2+W2/12+W2/25+currentcurve, Y2, X1+W1/2+W1/12+currentcurve, X1+W1/2+W1/12+W1/25+currentcurve, Y1, DARK_EARTH ); + drawPolygon( X2+W2-W2/12-W2/25+currentcurve, X2+W2-W2/12+currentcurve, Y2, X1+W1-W1/12-W1/25+currentcurve, X1+W1-W1/12+currentcurve, Y1, DARK_EARTH ); + + drawPolygon( X2-W2/50+currentcurve, X2+W2/50+currentcurve, Y2, X1-W1/50+currentcurve, X1+W1/50+currentcurve, Y1, LIGHT_GREEN_GRASS ); + drawPolygon( X2+W2+currentcurve, 396, Y2, X1+W1+currentcurve, 396, Y1, LIGHT_EARTH ); + } + } } @@ -720,7 +828,7 @@ uint16_t findIndex( double currentZ ) } -void prepareDecoration( void ) +void prepareDecoration( int biometoload ) { bopti_image_t const *src; @@ -731,20 +839,65 @@ void prepareDecoration( void ) { scale=3.0f/((float) (i+2)); - if(k==0) src = &tree1; - else if (k==1) src = &tree2; - else if (k==2) src = &tree3; - else if (k==3) src = &tree4; - else if (k==4) src = &tree5; - else if (k==5) src = &tree6; - else if (k==6) src = &leftturn; - else if (k==7) src = &rightturn; - else if (k==8) src = &uphill; - else if (k==9) src = &downhill; - else if (k==10) src = &checkpoint; - else if (k==11) src = &startlights; - else if (k==12) src = &stoplights; - else if (k==13) src = &waitlights; + if (biometoload==PLAINS) + { + if(k==0) src = &pl_tree1; + else if (k==1) src = &pl_tree2; + else if (k==2) src = &pl_tree3; + else if (k==3) src = &pl_tree4; + else if (k==4) src = &cc_bigleaf; + else if (k==5) src = &cc_smallleaf; + else if (k==6) src = &cc_rocks; + } + else if (biometoload==DESERT) + { + if(k==0) src = &dt_tree1; + else if (k==1) src = &dt_tree2; + else if (k==2) src = &dt_tree3; + else if (k==3) src = &dt_tree4; + else if (k==4) src = &cc_bigleaf; + else if (k==5) src = &dt_smallleaf; + else if (k==6) src = &cc_rocks; + } + else if (biometoload==USA) + { + if(k==0) src = &pl_tree1; + else if (k==1) src = &pl_tree2; + else if (k==2) src = &pl_tree3; + else if (k==3) src = &us_tree4; + else if (k==4) src = &cc_bigleaf; + else if (k==5) src = &cc_smallleaf; + else if (k==6) src = &cc_rocks; + } + else if (biometoload==FINLAND) + { + if(k==0) src = &fi_tree1; + else if (k==1) src = &fi_tree2; + else if (k==2) src = &pl_tree3; // to be added + else if (k==3) src = &fi_tree4; + else if (k==4) src = &cc_bigleaf; // to be added + else if (k==5) src = &cc_smallleaf; // to be added + else if (k==6) src = &fi_rocks; // to be added + } + else if (biometoload==AFRICA) + { + if(k==0) src = &pl_tree1; + else if (k==1) src = &pl_tree2; + else if (k==2) src = &pl_tree3; + else if (k==3) src = &pl_tree4; + else if (k==4) src = &af_bigleaf; + else if (k==5) src = &cc_smallleaf; + else if (k==6) src = &cc_rocks; + } + + if (k==7) src = &leftturn; + else if (k==8) src = &rightturn; + else if (k==9) src = &uphill; + else if (k==10) src = &downhill; + else if (k==11) src = &checkpoint; + else if (k==12) src = &startlights; + else if (k==13) src = &stoplights; + else if (k==14) src = &waitlights; int width = (int) ((float) src->width * scale); int height = (int) ((float) src->height * scale); diff --git a/src/src/menus.cc b/src/src/menus.cc index 401149a..95a4f5d 100644 --- a/src/src/menus.cc +++ b/src/src/menus.cc @@ -4,6 +4,7 @@ extern bopti_image_t mainscreen; +extern bopti_image_t africa1, desert1, finland1, plains1, usa1; extern bopti_image_t flag; extern font_t autofont, autofontsmall; @@ -80,18 +81,23 @@ int drawMainMenu( void ) dfont(&autofont); + dprint_opt(102, 22, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "ARCADE GAME" ); if (MainMenuSelection!=0) dprint_opt(100, 20, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "ARCADE GAME" ); else dprint_opt(100, 20, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "ARCADE GAME" ); + dprint_opt(102, 62, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "TIME ATTACK" ); if (MainMenuSelection!=1) dprint_opt(100, 60, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "TIME ATTACK" ); else dprint_opt(100, 60, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "TIME ATTACK" ); + dprint_opt(102, 102, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPTIONS" ); if (MainMenuSelection!=2) dprint_opt(100, 100, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPTIONS" ); else dprint_opt(100, 100, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPTIONS" ); + dprint_opt(102, 142, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CREDITS" ); if (MainMenuSelection!=3) dprint_opt(100, 140, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CREDITS" ); else dprint_opt(100, 140, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CREDITS" ); + dprint_opt(102, 182, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "QUIT TO OS" ); if (MainMenuSelection!=4) dprint_opt(100, 180, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "QUIT TO OS" ); else dprint_opt(100, 180, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "QUIT TO OS" ); @@ -169,6 +175,7 @@ int drawMenuCircuitSelect( void ) dprint_opt(198, 2, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_CENTER, DTEXT_TOP, "SELECT A CIRCUIT" ); + dimage( 16, 45, &plains1 ); if (CircuitSelection!=0) drawRectangle( 16, 45, 60, 60, C_WHITE, 3 ); else { @@ -176,6 +183,7 @@ int drawMenuCircuitSelect( void ) dprint_opt(198, 222, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_CENTER, DTEXT_BOTTOM, ">> CIRCUIT #1" ); } + dimage( 92, 45, &desert1 ); if (CircuitSelection!=1) drawRectangle( 92, 45, 60, 60, C_WHITE, 3 ); else { @@ -183,6 +191,7 @@ int drawMenuCircuitSelect( void ) dprint_opt(198, 222, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_CENTER, DTEXT_BOTTOM, ">> CIRCUIT #2" ); } + dimage( 168, 45, &usa1 ); if (CircuitSelection!=2) drawRectangle( 168, 45, 60, 60, C_WHITE, 3 ); else { @@ -190,6 +199,7 @@ int drawMenuCircuitSelect( void ) dprint_opt(198, 222, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_CENTER, DTEXT_BOTTOM, ">> CIRCUIT #3" ); } + dimage( 244, 45, &finland1 ); if (CircuitSelection!=3) drawRectangle( 244, 45, 60, 60, C_WHITE, 3 ); else { @@ -197,6 +207,7 @@ int drawMenuCircuitSelect( void ) dprint_opt(198, 222, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_CENTER, DTEXT_BOTTOM, ">> CIRCUIT #4" ); } + dimage( 320, 45, &africa1 ); if (CircuitSelection!=4) drawRectangle( 320, 45, 60, 60, C_WHITE, 3 ); else { @@ -250,9 +261,11 @@ int drawMenuCircuitSelect( void ) pulse++; getInputCircuitSelect(); + + if (CircuitSelection==-1) return -1; } - return MainMenuSelection; + return CircuitSelection; } void getInputCircuitSelect( void ) @@ -270,6 +283,10 @@ void getInputCircuitSelect( void ) if (key==KEY_EXE) doneMenuCircuit = true; + if (key==KEY_EXIT) + CircuitSelection = -1; + + if (key==KEY_UP || key==KEY_LEFT) { if (CircuitSelection==0) CircuitSelection=9;