OutRun/src/include/circuit.h

100 lines
2.0 KiB
C
Raw Normal View History

2022-03-04 21:58:14 +01:00
#include <vector>
2022-03-06 20:21:22 +01:00
#include "../fixed.h"
enum Length
{
2022-03-15 22:02:53 +01:00
L_VERYSHORT = 25,
L_SHORT = 50,
L_MEDIUM = 100,
L_LONG = 200,
L_VERYLONG = 400
2022-03-06 20:21:22 +01:00
};
enum HillSize
{
2022-03-11 22:44:47 +01:00
H_VERYSMALL = 20,
H_SMALL = 40,
H_MEDIUM = 60,
H_BIG = 80,
H_VERYBIG = 100
2022-03-06 20:21:22 +01:00
};
enum HillType
{
UP_HILL = +1,
DOWN_HILL = -1
};
enum CurveStrength
{
2022-03-11 22:44:47 +01:00
C_VERYEASY = 2,
C_EASY = 4,
C_MEDIUM = 6,
C_HARD = 8,
C_VERYHARD = 10
2022-03-06 20:21:22 +01:00
};
enum CurveType
{
LEFT_CURVE = -1,
RIGHT_CURVE = +1
};
2022-03-06 22:06:48 +01:00
enum Decoration
{
2022-03-16 23:18:18 +01:00
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
2022-03-06 22:06:48 +01:00
};
2022-03-04 21:58:14 +01:00
void initData( void );
void createCircuit( void );
2022-03-12 21:56:55 +01:00
void putBillBoards( void );
2022-03-07 15:24:04 +01:00
void createClouds( void );
2022-03-11 22:44:47 +01:00
void createTraffic( void );
2022-03-04 21:58:14 +01:00
void projectCircuitFP( void );
void projectCircuitFP( uint16_t index );
2022-03-15 22:02:53 +01:00
void updateTraffic( float dt, uint32_t maxdistance );
2022-03-11 22:44:47 +01:00
2022-03-04 21:58:14 +01:00
void printCircuit( void );
void printCircuit( int i );
void drawCircuitSegment( uint16_t index );
2022-03-06 22:06:48 +01:00
void drawDecoration( uint16_t index );
2022-03-11 22:44:47 +01:00
void drawTraffic( uint16_t index );
2022-03-07 15:24:04 +01:00
void drawClouds( int offset );
2022-03-11 22:44:47 +01:00
void drawFarBackground( int offset );
void drawNearBackground( int offset );
2022-03-06 22:06:48 +01:00
void freeDecoration( void );
2022-03-16 23:18:18 +01:00
void prepareDecoration( int biometoload );
2022-03-06 20:21:22 +01:00
2022-03-11 22:44:47 +01:00
void freeTraffic( void );
void prepareTraffic( void );
2022-03-15 20:20:28 +01:00
void addCheckPoint( int8_t biome );
2022-03-15 22:02:53 +01:00
void addStartLine( int8_t biome );
void addFinishLine( int8_t biome );
2022-03-11 22:44:47 +01:00
void addStraightLine( Length l, int8_t biome );
void addCurve( Length l, CurveStrength s, CurveType t, int8_t biome );
void addHill( Length l, HillSize s, HillType t, int8_t biome );
2022-03-12 21:56:55 +01:00
void addCurvyHill( Length l, HillSize s, HillType t, CurveStrength cs, CurveType ct, int8_t biome );
2022-03-06 20:21:22 +01:00
fixed_t interpolatePositionX( double currentZ );
fixed_t interpolatePositionY( double currentZ );
2022-03-11 22:44:47 +01:00
uint16_t findIndex( double currentZ );