This commit is contained in:
Miloslav Ciz 2025-01-28 22:27:19 +01:00
parent e695921c5c
commit 6986028e33
4 changed files with 171 additions and 155 deletions

20
map.h
View file

@ -94,7 +94,7 @@
#define LCR_BLOCK_RAMP_34 '/' ///< plain ramp, 3/4 size
#define LCR_BLOCK_RAMP_12 '<' ///< plain ramp, 1/2 size
#define LCR_BLOCK_RAMP_14 '_' ///< plain ramp, 1/4 size
#define LCR_BLOCK_RAMP_CORNER 'v' ///< corner of ramp
#define LCR_BLOCK_RAMP_CORNER 'v' ///< corner of a ramp
#define LCR_BLOCK_RAMP_CURVED_PLAT ']' ///< curved ramp with top platgform
#define LCR_BLOCK_RAMP_CURVED ')' ///< curv. ramp without top platf.
#define LCR_BLOCK_RAMP_CURVED_WALL '}' ///< curved ramp plus small wall
@ -103,6 +103,8 @@
#define LCR_BLOCK_CORNER_12 '\\' ///< diagonal corner (1/2 wide)
#define LCR_BLOCK_HILL '(' ///< curved "hill"
#define LCR_BLOCK_BUMP '~' ///< small bump on the road
#define LCR_BLOCK_CORNER_CONVEX 'n' ///< curved corner (convex)
#define LCR_BLOCK_CORNER_CONCAVE 'l' ///< curved corner (concave)
#define LCR_BLOCK_FULL_ACCEL '>'
#define LCR_BLOCK_BOTTOM_ACCEL 'z'
@ -111,9 +113,6 @@
#define LCR_BLOCK_FULL_FAN 'o'
#define LCR_BLOCK_RAMP_FAN 'V'
#define LCR_BLOCK_CORNER_CONVEX 'n'
#define LCR_BLOCK_CORNER_CONCAVE 'l'
#define LCR_BLOCK_CHECKPOINT_0 '+' ///< checkpoint, not taken
#define LCR_BLOCK_CHECKPOINT_1 '\'' ///< checkpoint, taken
@ -131,15 +130,10 @@
/*
TODO:
- ramp corner???
- curved corner?
- curved out corner?
- curved "hill"
- bumpy road
- bigger structures like a loop, sloped road etc?
*/
#define LCR_MAP_BLOCK_CACHE_SIZE (8 * 2) /// do not change
#define LCR_MAP_BLOCK_CACHE_SIZE (8 * 2) ///< Do not change.
/**
Cache for accelerating LCR_mapGetBlockAtFast, consists of 8 2-item records,
@ -154,12 +148,12 @@ struct
{
uint16_t blockCount;
uint8_t blocks[LCR_SETTING_MAP_MAX_BLOCKS * LCR_BLOCK_SIZE];
uint8_t startPos[4]; ///< Initial position and rotation.
uint8_t startPos[4]; ///< Initial position and rotation.
uint8_t environment;
uint8_t checkpointCount;
uint32_t hash; ///< Hash of the processed binary map.
uint32_t hash; ///< Hash of the processed binary map.
uint32_t targetTime;
char name[LCR_MAP_NAME_MAX_LEN + 1];
@ -249,7 +243,7 @@ void LCR_rampGetDimensions(uint8_t rampType, uint8_t *height4ths,
uint8_t *LCR_getMapBlockAtCoordNumber(uint32_t coord)
{
// binary search the block:
// Binary search the block:
uint16_t a = 0, b = LCR_currentMap.blockCount - 1;