Clean a bit and stuff

This commit is contained in:
Miloslav Ciz 2024-12-18 20:45:35 +01:00
parent e42212d7c1
commit b79b83e56a
6 changed files with 99 additions and 88 deletions

8
map.h
View file

@ -235,8 +235,7 @@ uint32_t LCR_mapBlockCoordsToCoordNumber(uint8_t x, uint8_t y, uint8_t z)
void LCR_rampGetDimensions(uint8_t rampType, uint8_t *height4ths,
uint8_t *length6ths)
{
*height4ths =
(rampType == LCR_BLOCK_RAMP_14) +
*height4ths = (rampType == LCR_BLOCK_RAMP_14) +
(rampType == LCR_BLOCK_RAMP || rampType == LCR_BLOCK_RAMP_ACCEL ||
rampType == LCR_BLOCK_RAMP_FAN || rampType == LCR_BLOCK_RAMP_STEEP) * 4 +
(rampType == LCR_BLOCK_RAMP_12 || rampType == LCR_BLOCK_RAMP_34) * 2 +
@ -254,11 +253,8 @@ uint8_t *LCR_getMapBlockAtCoordNumber(uint32_t coord)
while (b >= a)
{
uint16_t mid = (a + b) / 2;
uint8_t *block = LCR_currentMap.blocks + mid * LCR_BLOCK_SIZE;
uint32_t coord2 =
LCR_mapBlockGetCoordNumber(block);
uint32_t coord2 = LCR_mapBlockGetCoordNumber(block);
if (coord2 == coord)
return block;