OutRun/src/include/circuit.h

92 lines
1.8 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
{
L_VERYSHORT = 50,
L_SHORT = 100,
L_MEDIUM = 200,
L_LONG = 400,
L_VERYLONG = 1000
};
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
{
PALMTREE = 0,
DEADTREE = 1,
2022-03-11 22:44:47 +01:00
OAKTREE = 2,
CACTUS = 3,
BIGLEAF = 4,
2022-03-12 21:56:55 +01:00
SMALLLEAF = 5,
LEFTTURN = 6,
RIGHTTURN = 7,
UPHILL = 8,
DOWNHILL = 9
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-11 22:44:47 +01:00
void updateTraffic( float dt );
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 );
void prepareDecoration( void );
2022-03-06 20:21:22 +01:00
2022-03-11 22:44:47 +01:00
void freeTraffic( void );
void prepareTraffic( void );
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 );