Add quit block

This commit is contained in:
Miloslav Ciz 2025-02-03 18:57:53 +01:00
parent 7f00b5aa5f
commit 2a84afa981
4 changed files with 85 additions and 86 deletions

5
map.h
View file

@ -129,6 +129,8 @@
but makes a hollow one */
#define LCR_BLOCK_START '*' ///< specifies start block position
#define LCR_BLOCK_QUIT 'e' /**< special block, ends reading the
map (useful when creating maps) */
/*
TODO:
- bigger structures like a loop, sloped road etc?
@ -436,6 +438,9 @@ uint8_t LCR_mapLoadFromStr(char (*getNextCharFunc)(void), const char *name)
uint8_t mat = 0;
int coords[3];
if (block == LCR_BLOCK_QUIT)
break;
for (int i = 0; i < 3; ++i)
{
c = getNextCharFunc();