Fix a few things

This commit is contained in:
Miloslav Ciz 2025-02-01 14:10:22 +01:00
parent 1f0d3587f6
commit 19d3c1cbe5
5 changed files with 37 additions and 37 deletions

34
map.h
View file

@ -30,7 +30,7 @@
- X, Y and Z are block coordinates, each one a single character. The
following are characters signifying numbers 0 to 63:
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$@
- M is block material ('0' to '3').
- M is optional block material ('0' to '3', 0 is default).
- T is an optinal transform string (for more detail see the binary format)
consisting from 0 to 3 characters, which may be:
- '|': flip horizontally
@ -107,12 +107,12 @@
#define LCR_BLOCK_CORNER_CONVEX 'n' ///< curved corner (convex)
#define LCR_BLOCK_CORNER_CONCAVE 'l' ///< curved corner (concave)
#define LCR_BLOCK_FULL_ACCEL '>'
#define LCR_BLOCK_BOTTOM_ACCEL 'z'
#define LCR_BLOCK_RAMP_ACCEL 'y'
#define LCR_BLOCK_FULL_ACCEL '>' ///< full block with accelerator
#define LCR_BLOCK_BOTTOM_ACCEL 'z' ///< bottom half block with accelerator
#define LCR_BLOCK_RAMP_ACCEL 'y' ///< ramp block with accelerator
#define LCR_BLOCK_FULL_FAN 'o'
#define LCR_BLOCK_RAMP_FAN 'V'
#define LCR_BLOCK_FULL_FAN 'o' ///< full block with fan
#define LCR_BLOCK_RAMP_FAN 'V' ///< ramp block with fan
#define LCR_BLOCK_CHECKPOINT_0 '+' ///< checkpoint, not taken
#define LCR_BLOCK_CHECKPOINT_1 '\t' ///< checkpoint, taken
@ -120,13 +120,13 @@
#define LCR_BLOCK_FINISH '!' ///< finish
// special blocks:
#define LCR_BLOCK_NONE 'x' ///< no block, e.g to make holes
#define LCR_BLOCK_NONE 'x' ///< no block (to make holes etc.)
#define LCR_BLOCK_CUBOID_FILL 'f' /**< makes a cuboid from the
previously specified block, the
size is given by block coords */
previously specified block, the
size is given by block coords */
#define LCR_BLOCK_CUBOID_HOLLOW 'h' /**< same as cuboid special block,
but makes a hollow one */
but makes a hollow one */
#define LCR_BLOCK_START '*' ///< specifies start block position
/*
@ -450,18 +450,14 @@ uint8_t LCR_mapLoadFromStr(char (*getNextCharFunc)(void), const char *name)
c = getNextCharFunc();
if (c < '0' || c > '3')
if (c > '0' && c <= '3')
{
LCR_LOG0("bad material");
return 0;
mat = c - '0';
c = getNextCharFunc();
}
mat = c - '0';
while (1)
{
c = getNextCharFunc();
if (c == '|')
trans |= LCR_BLOCK_TRANSFORM_FLIP_H;
else if (c == '-')
@ -474,8 +470,10 @@ uint8_t LCR_mapLoadFromStr(char (*getNextCharFunc)(void), const char *name)
trans |= LCR_BLOCK_TRANSFORM_ROT_270;
else
break;
c = getNextCharFunc();
}
while (c && c != LCR_BLOCK_START_CHAR)
c = getNextCharFunc();