Start pruning tris

This commit is contained in:
Miloslav Ciz 2024-07-24 23:16:13 +02:00
parent 5567863745
commit 2d99091cf1
4 changed files with 147 additions and 9 deletions

14
map.h
View file

@ -45,8 +45,6 @@
coordinate number.
*/
#define LCR_BLOCK_TRANSFORM_ROT_MASK 0x60
#define LCR_BLOCK_TRANSFORM_FLIP_H 0x10
#define LCR_BLOCK_TRANSFORM_ROT_90 0x20
#define LCR_BLOCK_TRANSFORM_ROT_180 0x40
@ -59,10 +57,9 @@
#define LCR_MAP_MAGIC_NUMBER2 'M'
#define LCR_MAP_MAGIC_NUMBER LCR_MAP_MAGIC_NUMBER1, LCR_MAP_MAGIC_NUMBER2
#define LCR_MAP_TERMINATOR 0xff
#define LCR_MAP_BLOCK(t,x,y,z,m,r) t,(unsigned char) (x | (y << 6)), \
(unsigned char) ((y >> 2) | (z << 4)), \
(unsigned char) ((z >> 4) | (m << 2) | \
(r << 4))
#define LCR_MAP_BLOCK(t,x,y,z,m,r) t,(uint8_t) (x | (y << 6)), \
(uint8_t) ((y >> 2) | (z << 4)), \
(uint8_t) ((z >> 4) | (m << 2) | (r))
#define LCR_BLOCK_SIZE 4 ///< size of map block, in bytes
@ -136,6 +133,11 @@ void LCR_mapBlockGetCoords(const uint8_t block[LCR_BLOCK_SIZE],
*z = (block[2] >> 4) | ((block[3] & 0x03) << 4);
}
uint8_t LCR_mapBlockGetTransform(const uint8_t block[LCR_BLOCK_SIZE])
{
return block[3] & 0xf0;
}
uint32_t LCR_mapBlockGetCoordNumber(const uint8_t block[LCR_BLOCK_SIZE])
{
return block[1] | (((uint32_t) block[2]) << 8) |