This change allows for saving and loading negative 16-bit values in
level files (like negatiove values for "gems needed", for example).
As a result, 16-bit and 32-bit micro chunk values are always signed
now, while 8-bit micro chunk values are still always unsigned bytes.
}
else // constant size configuration data (1, 2 or 4 bytes)
{
- int value = (byte_mask == CONF_MASK_1_BYTE ? getFile8Bit (file) :
- byte_mask == CONF_MASK_2_BYTE ? getFile16BitBE(file) :
- byte_mask == CONF_MASK_4_BYTE ? getFile32BitBE(file) : 0);
+ int value = (byte_mask == CONF_MASK_1_BYTE ? (byte) getFile8Bit (file) :
+ byte_mask == CONF_MASK_2_BYTE ? (short) getFile16BitBE(file) :
+ byte_mask == CONF_MASK_4_BYTE ? (int) getFile32BitBE(file) : 0);
for (i = 0; conf[i].data_type != -1; i++)
{