Output replays

This commit is contained in:
Miloslav Ciz 2025-01-14 13:40:22 +01:00
parent 17c182f474
commit 2dfad249ad
3 changed files with 100 additions and 18 deletions

17
map.h
View file

@ -56,6 +56,8 @@
- last if C7 is set, the block is flipped vertically
*/
#define LCR_MAP_NAME_MAX_LEN 15 /**< Maximum map name length (without
terminating zero. */
#define LCR_BLOCK_START_CHAR ':'
#define LCR_BLOCK_TRANSFORM_FLIP_H 0x10
@ -153,6 +155,8 @@ struct
uint8_t checkpointCount;
uint32_t hash; ///< Hash of the processed binary map.
char name[LCR_MAP_NAME_MAX_LEN + 1];
} LCR_currentMap;
void LCR_makeMapBlock(uint8_t type, uint8_t x, uint8_t y, uint8_t z,
@ -373,10 +377,21 @@ void _LCR_mapComputeHash(void)
(LCR_currentMap.hash >> 13)) * 113;
}
uint8_t LCR_mapLoadFromStr(char (*getNextCharFunc)(void))
uint8_t LCR_mapLoadFromStr(char (*getNextCharFunc)(void), const char *name)
{
LCR_LOG0("loading map string");
for (int i = 0; i < LCR_MAP_NAME_MAX_LEN; ++i)
{
LCR_currentMap.name[i] = *name;
LCR_currentMap.name[i + 1] = 0;
if (*name == 0)
break;
name++;
}
char c;
uint8_t prevBlock[LCR_BLOCK_SIZE];