Add accelerators

This commit is contained in:
Miloslav Ciz 2024-12-15 21:43:43 +01:00
parent 93cc5369bd
commit 6260ef1fcc
4 changed files with 46 additions and 40 deletions

45
map.h
View file

@ -637,6 +637,11 @@ void _LCR_addBlockShapeByte(uint8_t *bytes, uint8_t *byteCount,
*byteCount += 1;
}
uint8_t LCR_mapBlockIsAccelerator(uint8_t block)
{
return block == LCR_BLOCK_FULL_ACCEL;
}
/**
Macro that transforms coordinates according to block transformation.
*/
@ -825,27 +830,27 @@ void LCR_mapGetBlockShape(uint8_t blockType, uint8_t transform,
break;
}
case LCR_BLOCK_CORNER_CONVEX:
case LCR_BLOCK_CORNER_CONCAVE:
{
uint8_t
mx = blockType == LCR_BLOCK_CORNER_CONVEX ? 4 : 2,
mz = blockType == LCR_BLOCK_CORNER_CONVEX ? 2 : 4;
case LCR_BLOCK_CORNER_CONVEX:
case LCR_BLOCK_CORNER_CONCAVE:
{
uint8_t
mx = blockType == LCR_BLOCK_CORNER_CONVEX ? 4 : 2,
mz = blockType == LCR_BLOCK_CORNER_CONVEX ? 2 : 4;
ADD(0,0,0) ADD(0,4,6) ADD(0,0,6) // left
ADD(0,0,0) ADD(0,4,0) ADD(0,4,6) // left
ADD(6,0,6) ADD(0,0,6) ADD(0,4,6) // back
ADD(0,4,6) ADD(6,4,6) ADD(6,0,6) // back
ADD(0,0,0) ADD(mx,4,mz) ADD(0,4,0) // right
ADD(mx,0,mz) ADD(mx,4,mz) ADD(0,0,0)
ADD(6,4,6) ADD(mx,4,mz) ADD(6,0,6)
ADD(6,0,6) ADD(mx,4,mz) ADD(mx,0,mz)
ADD(0,4,0) ADD(mx,4,mz) ADD(0,4,6) // top
ADD(0,4,6) ADD(mx,4,mz) ADD(6,4,6)
ADD(0,0,0) ADD(0,0,6) ADD(mx,0,mz) // bottom
ADD(0,0,6) ADD(6,0,6) ADD(mx,0,mz)
break;
}
ADD(0,0,0) ADD(0,4,6) ADD(0,0,6) // left
ADD(0,0,0) ADD(0,4,0) ADD(0,4,6) // left
ADD(6,0,6) ADD(0,0,6) ADD(0,4,6) // back
ADD(0,4,6) ADD(6,4,6) ADD(6,0,6) // back
ADD(0,0,0) ADD(mx,4,mz) ADD(0,4,0) // right
ADD(mx,0,mz) ADD(mx,4,mz) ADD(0,0,0)
ADD(6,4,6) ADD(mx,4,mz) ADD(6,0,6)
ADD(6,0,6) ADD(mx,4,mz) ADD(mx,0,mz)
ADD(0,4,0) ADD(mx,4,mz) ADD(0,4,6) // top
ADD(0,4,6) ADD(mx,4,mz) ADD(6,4,6)
ADD(0,0,0) ADD(0,0,6) ADD(mx,0,mz) // bottom
ADD(0,0,6) ADD(6,0,6) ADD(mx,0,mz)
break;
}
case LCR_BLOCK_BUMP:
ADD(3,0,0) ADD(6,0,3) ADD(3,1,3) // top