#define LEVEL_HEADER_UNUSED 13 /* unused level header bytes */
#define LEVEL_CHUNK_CNT2_SIZE 160 /* size of level CNT2 chunk */
#define LEVEL_CHUNK_CNT2_UNUSED 11 /* unused CNT2 chunk bytes */
-#define LEVEL_CPART_CUS3_SIZE 102 /* size of CUS3 chunk part */
+#define LEVEL_CPART_CUS3_SIZE 134 /* size of CUS3 chunk part */
#define LEVEL_CPART_CUS3_UNUSED 16 /* unused CUS3 bytes / part */
#define TAPE_HEADER_SIZE 20 /* size of tape file header */
#define TAPE_HEADER_UNUSED 3 /* unused tape header bytes */
{
int element = EL_CUSTOM_START + i;
+ for(j=0; j<MAX_ELEMENT_NAME_LEN + 1; j++)
+ element_info[element].description[j] = '\0';
+ if (element_info[element].custom_description != NULL)
+ strncpy(element_info[element].description,
+ element_info[element].custom_description, MAX_ELEMENT_NAME_LEN);
+ else
+ strcpy(element_info[element].description,
+ element_info[element].editor_description);
+
element_info[element].use_gfx_element = FALSE;
element_info[element].gfx_element = EL_EMPTY_SPACE;
for(y=0; y<3; y++)
element_info[element].change.content[x][y] = EL_EMPTY_SPACE;
+ element_info[element].access_type = 0;
+ element_info[element].access_layer = 0;
+ element_info[element].walk_to_action = 0;
+ element_info[element].smash_targets = 0;
+ element_info[element].deadliness = 0;
+ element_info[element].consistency = 0;
+ element_info[element].change_player_action = 0;
+ element_info[element].change_collide_action = 0;
+ element_info[element].change_other_action = 0;
+
+ element_info[element].can_explode_by_fire = FALSE;
+ element_info[element].can_explode_smashed = FALSE;
+ element_info[element].can_explode_impact = FALSE;
+
/* start with no properties at all */
for (j=0; j < NUM_EP_BITFIELDS; j++)
Properties[element][j] = EP_BITMASK_DEFAULT;
{
int num_changed_custom_elements = getFile16BitBE(file);
int chunk_size_expected = LEVEL_CHUNK_CUS3_SIZE(num_changed_custom_elements);
- int i, x, y;
+ int i, j, x, y;
if (chunk_size_expected != chunk_size)
{
element = EL_DEFAULT; /* dummy element used for artwork config */
}
+ for(j=0; j<MAX_ELEMENT_NAME_LEN; j++)
+ element_info[element].description[j] = getFile8Bit(file);
+ element_info[element].description[MAX_ELEMENT_NAME_LEN] = 0;
+
Properties[element][EP_BITFIELD_BASE] = getFile32BitBE(file);
/* some free bytes for future properties and padding */
static void SaveLevel_CUS3(FILE *file, struct LevelInfo *level,
int num_changed_custom_elements)
{
- int i, x, y, check = 0;
+ int i, j, x, y, check = 0;
putFile16BitBE(file, num_changed_custom_elements);
if (check < num_changed_custom_elements)
{
putFile16BitBE(file, element);
+
+ for(j=0; j<MAX_ELEMENT_NAME_LEN; j++)
+ putFile8Bit(file, element_info[element].description[j]);
+
putFile32BitBE(file, Properties[element][EP_BITFIELD_BASE]);
/* some free bytes for future properties and padding */