Browse Source

To many changes to be listed

master V0.60
Sylvain PILLOT 4 months ago
parent
commit
14d1eb0e33
  1. 44
      CMakeLists.txt
  2. 22
      CppOutRun.cscope_file_list
  3. 111
      CppOutRun.layout
  4. 14
      TODO.txt
  5. BIN
      assets-cg/decos/africa/af_bigleaf.png
  6. 0
      assets-cg/decos/africa/fxconv-metadata.txt
  7. 0
      assets-cg/decos/common/cc_bigleaf.png
  8. BIN
      assets-cg/decos/common/cc_rocks.png
  9. 0
      assets-cg/decos/common/cc_smallleaf.png
  10. 5
      assets-cg/decos/common/fxconv-metadata.txt
  11. BIN
      assets-cg/decos/desert/dt_smallleaf.png
  12. 0
      assets-cg/decos/desert/dt_tree1.png
  13. 0
      assets-cg/decos/desert/dt_tree2.png
  14. BIN
      assets-cg/decos/desert/dt_tree3.png
  15. BIN
      assets-cg/decos/desert/dt_tree4.png
  16. 5
      assets-cg/decos/desert/fxconv-metadata.txt
  17. BIN
      assets-cg/decos/finland/fi_rocks.png
  18. BIN
      assets-cg/decos/finland/fi_tree1.png
  19. BIN
      assets-cg/decos/finland/fi_tree2.png
  20. BIN
      assets-cg/decos/finland/fi_tree4.png
  21. 5
      assets-cg/decos/finland/fxconv-metadata.txt
  22. 5
      assets-cg/decos/plains/fxconv-metadata.txt
  23. BIN
      assets-cg/decos/plains/pl_tree1.png
  24. 0
      assets-cg/decos/plains/pl_tree2.png
  25. BIN
      assets-cg/decos/plains/pl_tree3.png
  26. BIN
      assets-cg/decos/plains/pl_tree4.png
  27. 5
      assets-cg/decos/usa/fxconv-metadata.txt
  28. 0
      assets-cg/decos/usa/us_tree4.png
  29. BIN
      assets-cg/miniscreen/africa1.png
  30. BIN
      assets-cg/miniscreen/desert1.png
  31. BIN
      assets-cg/miniscreen/finland1.png
  32. 5
      assets-cg/miniscreen/fxconv-metadata.txt
  33. BIN
      assets-cg/miniscreen/plains1.png
  34. BIN
      assets-cg/miniscreen/usa1.png
  35. 12
      src/colors.h
  36. 31
      src/include/circuit.h
  37. 5
      src/include/segment.h
  38. 35
      src/main.cc
  39. 2
      src/parameters.h
  40. 285
      src/src/circuit.cc
  41. 19
      src/src/menus.cc

44
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)

22
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"

111
CppOutRun.layout

@ -2,25 +2,23 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Release" />
<File name="src/src/camera.cc" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="370" topLine="0" />
</Cursor>
</File>
<File name="src/include/cars.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/src/cars.cc" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="443" topLine="0" />
<Cursor1 position="1019" topLine="8" />
</Cursor>
</File>
<File name="src/parameters.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/include/menus.h" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="399" topLine="0" />
<Cursor1 position="251" topLine="0" />
</Cursor>
</File>
<File name="src/include/drawstuff.h" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/src/menus.cc" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="622" topLine="0" />
<Cursor1 position="7903" topLine="146" />
</Cursor>
<Folding>
<Collapse line="309" />
</Folding>
</File>
<File name="src/src/drawstuff.cc" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
@ -32,69 +30,72 @@
<Collapse line="76" />
</Folding>
</File>
<File name="src/include/circuit.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="TODO.txt" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="778" topLine="44" />
<Cursor1 position="251" topLine="0" />
</Cursor>
</File>
<File name="src/src/cars.cc" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/fixed.h" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="778" topLine="0" />
</Cursor>
</File>
<File name="src/include/clouds.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1019" topLine="4" />
<Cursor1 position="306" topLine="0" />
</Cursor>
</File>
<File name="src/src/menus.cc" open="1" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/src/circuit.cc" open="1" top="1" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="9984" topLine="7" />
<Cursor1 position="30741" topLine="513" />
</Cursor>
<Folding>
<Collapse line="23" />
<Collapse line="48" />
<Collapse line="68" />
<Collapse line="110" />
<Collapse line="142" />
<Collapse line="154" />
<Collapse line="257" />
<Collapse line="334" />
<Collapse line="178" />
<Collapse line="246" />
<Collapse line="262" />
<Collapse line="288" />
<Collapse line="333" />
<Collapse line="379" />
</Folding>
</File>
<File name="src/include/camera.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/include/segment.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="221" topLine="0" />
<Cursor1 position="210" topLine="0" />
</Cursor>
</File>
<File name="src/main.cc" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="1" zoom_2="0">
<File name="src/include/drawstuff.h" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="5802" topLine="233" />
<Cursor1 position="622" topLine="0" />
</Cursor>
</File>
<File name="src/src/circuit.cc" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/include/cars.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="9078" topLine="251" />
<Cursor1 position="332" topLine="0" />
</Cursor>
</File>
<File name="src/fixed.h" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/src/camera.cc" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="778" topLine="0" />
<Cursor1 position="370" topLine="0" />
</Cursor>
</File>
<File name="src/include/clouds.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/src/segment.cc" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="2" zoom_2="0">
<Cursor>
<Cursor1 position="306" topLine="0" />
<Cursor1 position="230" topLine="30" />
</Cursor>
</File>
<File name="src/colors.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/include/camera.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="352" topLine="0" />
<Cursor1 position="221" topLine="0" />
</Cursor>
</File>
<File name="src/include/menus.h" open="1" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/colors.h" open="1" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="251" topLine="0" />
<Cursor1 position="607" topLine="0" />
</Cursor>
</File>
<File name="TODO.txt" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/parameters.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="71" topLine="0" />
<Cursor1 position="399" topLine="0" />
</Cursor>
</File>
<File name="src/src/clouds.cc" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@ -102,19 +103,35 @@
<Cursor1 position="203" topLine="0" />
</Cursor>
</File>
<File name="CMakeLists.txt" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/main.cc" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="429" topLine="0" />
<Cursor1 position="5823" topLine="162" />
</Cursor>
<Folding>
<Collapse line="99" />
<Collapse line="104" />
<Collapse line="110" />
<Collapse line="118" />
<Collapse line="126" />
<Collapse line="146" />
<Collapse line="169" />
<Collapse line="175" />
<Collapse line="181" />
<Collapse line="187" />
<Collapse line="204" />
<Collapse line="217" />
<Collapse line="228" />
<Collapse line="233" />
</Folding>
</File>
<File name="src/include/segment.h" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/include/circuit.h" open="1" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="625" topLine="6" />
<Cursor1 position="1423" topLine="48" />
</Cursor>
</File>
<File name="src/src/segment.cc" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="2" zoom_2="0">
<File name="CMakeLists.txt" open="1" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="230" topLine="30" />
<Cursor1 position="1215" topLine="18" />
</Cursor>
</File>
</CodeBlocks_layout_file>

14
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 / ... )

BIN
assets-cg/decos/africa/af_bigleaf.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

0
assets-cg/trees/fxconv-metadata.txt → assets-cg/decos/africa/fxconv-metadata.txt

0
assets-cg/trees/tree5.png → assets-cg/decos/common/cc_bigleaf.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets-cg/decos/common/cc_rocks.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

0
assets-cg/trees/tree6.png → assets-cg/decos/common/cc_smallleaf.png

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

5
assets-cg/decos/common/fxconv-metadata.txt

@ -0,0 +1,5 @@
*.png:
type: bopti-image
profile: p4
name_regex: (.*)\.png \1

BIN
assets-cg/decos/desert/dt_smallleaf.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

0
assets-cg/trees/tree1.png → assets-cg/decos/desert/dt_tree1.png

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

0
assets-cg/trees/tree4.png → assets-cg/decos/desert/dt_tree2.png

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
assets-cg/decos/desert/dt_tree3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets-cg/decos/desert/dt_tree4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

5
assets-cg/decos/desert/fxconv-metadata.txt

@ -0,0 +1,5 @@
*.png:
type: bopti-image
profile: p4
name_regex: (.*)\.png \1

BIN
assets-cg/decos/finland/fi_rocks.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

BIN
assets-cg/decos/finland/fi_tree1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
assets-cg/decos/finland/fi_tree2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
assets-cg/decos/finland/fi_tree4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

5
assets-cg/decos/finland/fxconv-metadata.txt

@ -0,0 +1,5 @@
*.png:
type: bopti-image
profile: p4
name_regex: (.*)\.png \1

5
assets-cg/decos/plains/fxconv-metadata.txt

@ -0,0 +1,5 @@
*.png:
type: bopti-image
profile: p4
name_regex: (.*)\.png \1

BIN
assets-cg/decos/plains/pl_tree1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

0
assets-cg/trees/tree3.png → assets-cg/decos/plains/pl_tree2.png

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

BIN
assets-cg/decos/plains/pl_tree3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
assets-cg/decos/plains/pl_tree4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

5
assets-cg/decos/usa/fxconv-metadata.txt

@ -0,0 +1,5 @@
*.png:
type: bopti-image
profile: p4
name_regex: (.*)\.png \1

0
assets-cg/trees/tree2.png → assets-cg/decos/usa/us_tree4.png

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

BIN
assets-cg/miniscreen/africa1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

BIN
assets-cg/miniscreen/desert1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
assets-cg/miniscreen/finland1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

5
assets-cg/miniscreen/fxconv-metadata.txt

@ -0,0 +1,5 @@
*.png:
type: bopti-image
profile: p8
name_regex: (.*)\.png \1

BIN
assets-cg/miniscreen/plains1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
assets-cg/miniscreen/usa1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

12
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

31
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 );

5
src/include/segment.h

@ -12,7 +12,10 @@
enum BiomeType
{
PLAINS = 0,
DESERT = 1
DESERT = 1,
USA = 2,
FINLAND = 3,
AFRICA = 4
};
enum Specialty

35
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<Segment*> 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);

2
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

285
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; i<l; i++)
{
//Segment *s=new Segment( i );
int deco = rand() % 4;
int deco = rand() % 8;
Segment *seg;
if (deco==0) seg=new Segment( 0, lastY, lastZ + i*SEGMENT_LENGTH, 0, 0, SMALLLEAF, -1 );
else if (deco==1) seg=new Segment( 0, lastY, lastZ + i*SEGMENT_LENGTH, 0, 0, -1, DEADTREE );
else if (deco==2) seg=new Segment( 0, lastY, lastZ + i*SEGMENT_LENGTH, 0, 0, PALMTREE, -1 );
else if (deco==3) seg=new Segment( 0, lastY, lastZ + i*SEGMENT_LENGTH, 0, 0, CACTUS, BIGLEAF );
if (deco==0) seg=new Segment( 0, lastY, lastZ + i*SEGMENT_LENGTH, 0, 0, TREE1, -1 );
else if (deco==1) seg=new Segment( 0, lastY, lastZ + i*SEGMENT_LENGTH, 0, 0, -1, TREE2 );
else if (deco==2) seg=new Segment( 0, lastY, lastZ + i*SEGMENT_LENGTH, 0, 0, TREE3, LEAF1 );
else if (deco==3) seg=new Segment( 0, lastY, lastZ + i*SEGMENT_LENGTH, 0, 0, LEAF2, TREE1 );
else if (deco==4) seg=new Segment( 0, lastY, lastZ + i*SEGMENT_LENGTH, 0, 0, TREE4, TREE2 );
else if (deco==5) seg=new Segment( 0, lastY, lastZ + i*SEGMENT_LENGTH, 0, 0, ROCKS, -1 );
else if (deco==6) seg=new Segment( 0, lastY, lastZ + i*SEGMENT_LENGTH, 0, 0, TREE2, TREE1 );
else if (deco==7) seg=new Segment( 0, lastY, lastZ + i*SEGMENT_LENGTH, 0, 0, TREE3, TREE4 );
if (seg!=nullptr)
{
@ -462,14 +477,18 @@ void addCurve( Length l, CurveStrength s, CurveType t, int8_t biome )
for( int i=0; i<l; i++)
{
//Segment *s=new Segment( i );
int deco = rand() % 4;
int deco = rand() % 8;
Segment *seg;
if (deco==0) seg=new Segment( 0, lastY, lastZ+i*SEGMENT_LENGTH, s*t, 0, -1, -1 );
else if (deco==1) seg=new Segment( 0, lastY, lastZ+i*SEGMENT_LENGTH, s*t, 0, -1, OAKTREE );
else if (deco==2) seg=new Segment( 0, lastY, lastZ+i*SEGMENT_LENGTH, s*t, 0, DEADTREE, -1 );
else if (deco==3) seg=new Segment( 0, lastY, lastZ+i*SEGMENT_LENGTH, s*t, 0, DEADTREE, OAKTREE );
else if (deco==1) seg=new Segment( 0, lastY, lastZ+i*SEGMENT_LENGTH, s*t, 0, -1, TREE1 );
else if (deco==2) seg=new Segment( 0, lastY, lastZ+i*SEGMENT_LENGTH, s*t, 0, TREE2, ROCKS );
else if (deco==3) seg=new Segment( 0, lastY, lastZ+i*SEGMENT_LENGTH, s*t, 0, TREE3, LEAF1 );
else if (deco==4) seg=new Segment( 0, lastY, lastZ+i*SEGMENT_LENGTH, s*t, 0, -1, -1 );
else if (deco==5) seg=new Segment( 0, lastY, lastZ+i*SEGMENT_LENGTH, s*t, 0, TREE3, -1 );
else if (deco==6) seg=new Segment( 0, lastY, lastZ+i*SEGMENT_LENGTH, s*t, 0, TREE4, LEAF1 );
else if (deco==7) seg=new Segment( 0, lastY, lastZ+i*SEGMENT_LENGTH, s*t, 0, -1, LEAF2 );
if (seg!=nullptr)
{
@ -497,13 +516,17 @@ void addHill( Length l, HillSize s, HillType t, int8_t biome )
for( int i=0; i<l; i++)
{
//Segment *s=new Segment( i );
int deco = rand() % 4;
int deco = rand() % 8;
Segment *seg;
if (deco==0) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, 0, s*t, -1, -1 );
else if (deco==1) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, 0, s*t, -1, PALMTREE );
else if (deco==2) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, 0, s*t, OAKTREE, -1 );
else if (deco==3) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, 0, s*t, OAKTREE, PALMTREE );
if (deco==0) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, 0, s*t, -1, ROCKS );
else if (deco==1) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, 0, s*t, -1, TREE2 );
else if (deco==2) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, 0, s*t, TREE3, -1 );
else if (deco==3) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, 0, s*t, TREE1, LEAF2 );
else if (deco==4) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, 0, s*t, ROCKS, LEAF1 );
else if (deco==5) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, 0, s*t, TREE1, -1 );
else if (deco==6) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, 0, s*t, TREE3, TREE1 );
else if (deco==7) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, 0, s*t, TREE2, TREE4 );
if (seg!=nullptr)
{
@ -531,13 +554,18 @@ void addCurvyHill( Length l, HillSize s, HillType t, CurveStrength cs, CurveType
for( int i=0; i<l; i++)
{
//Segment *s=new Segment( i );
int deco = rand() % 4;
int deco = rand() % 8;
Segment *seg;
if (deco==0) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, cs*ct, s*t, -1, -1 );
else if (deco==1) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, cs*ct, s*t, -1, PALMTREE );
else if (deco==2) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, cs*ct, s*t, OAKTREE, -1 );
else if (deco==3) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, cs*ct, s*t, OAKTREE, PALMTREE );
else if (deco==1) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, cs*ct, s*t, -1, TREE1 );
else if (deco==2) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, cs*ct, s*t, TREE2, -1 );
else if (deco==3) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, cs*ct, s*t, TREE3, LEAF2 );
else if (deco==4) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, cs*ct, s*t, ROCKS, LEAF2 );
else if (deco==5) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, cs*ct, s*t, TREE1, TREE2 );
else if (deco==6) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, cs*ct, s*t, TREE3, LEAF2 );
else if (deco==7) seg=new Segment( 0, lastY+i*t*s, lastZ+i*SEGMENT_LENGTH, cs*ct, s*t, -1, TREE4 );
if (seg!=nullptr)
{
@ -592,54 +620,25 @@ void drawCircuitSegment( uint16_t index )
if (Y1==Y2) return;
/*
if (index==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, C_RED );
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 );
return;
}
*/
if (circuit[index]->Environment == 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);

19
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, "