#include "libgame/libgame.h"
#include "files.h"
+#include "init.h"
#include "tools.h"
#include "tape.h"
for (i=0; i < NUM_CUSTOM_ELEMENTS; i++)
{
level.custom_element_successor[i] = EL_EMPTY_SPACE;
- Properties1[EL_CUSTOM_START + i] = EP_BITMASK_DEFAULT;
+ Properties[EL_CUSTOM_START + i][EP_BITFIELD_BASE] = EP_BITMASK_DEFAULT;
}
BorderElement = EL_STEELWALL;
int properties = getFile32BitBE(file);
if (IS_CUSTOM_ELEMENT(element))
- Properties1[element] = properties;
+ Properties[element][EP_BITFIELD_BASE] = properties;
else
Error(ERR_WARN, "invalid custom element number %d", element);
}
char *filename = getLevelFilename(level_nr);
LoadLevelFromFilename(filename);
+ InitElementPropertiesEngine(level.game_version);
}
static void SaveLevel_VERS(FILE *file, struct LevelInfo *level)
{
int element = EL_CUSTOM_START + i;
- if (Properties1[element] != EP_BITMASK_DEFAULT)
+ if (Properties[element][EP_BITFIELD_BASE] != EP_BITMASK_DEFAULT)
{
if (check < num_changed_custom_elements)
{
putFile16BitBE(file, element);
- putFile32BitBE(file, Properties1[element]);
+ putFile32BitBE(file, Properties[element][EP_BITFIELD_BASE]);
}
check++;
/* check for non-standard custom elements and calculate "CUS1" chunk size */
for (i=0; i < NUM_CUSTOM_ELEMENTS; i++)
- if (Properties1[EL_CUSTOM_START + i] != EP_BITMASK_DEFAULT)
+ if (Properties[EL_CUSTOM_START +i][EP_BITFIELD_BASE] != EP_BITMASK_DEFAULT)
num_changed_custom_elements1++;
/* check for non-standard custom elements and calculate "CUS2" chunk size */