ptr++;
}
+ // remap some (historic, now obsolete) elements
+ element = getMappedElement(element);
+
if (element >= NUM_FILE_ELEMENTS)
element = EL_UNKNOWN;
lev_fieldx = level.fieldx = brush_width;
lev_fieldy = level.fieldy = brush_height;
+ boolean use_em_engine = TRUE;
+ boolean use_sp_engine = TRUE;
+ boolean use_mm_engine = TRUE;
+
+ for (x = 0; x < MAX_LEV_FIELDX; x++)
+ {
+ for (y = 0; y < MAX_LEV_FIELDY; y++)
+ {
+ int element = Tile[x][y];
+
+ if (!IS_EM_ELEMENT(element) && !ELEM_IS_PLAYER(element))
+ use_em_engine = FALSE;
+
+ if (!IS_SP_ELEMENT(element))
+ use_sp_engine = FALSE;
+
+ if (!IS_MM_ELEMENT(element) && element != EL_EMPTY)
+ use_mm_engine = FALSE;
+ }
+ }
+
+ level.game_engine_type = (use_em_engine ? GAME_ENGINE_TYPE_EM :
+ use_sp_engine ? GAME_ENGINE_TYPE_SP :
+ use_mm_engine ? GAME_ENGINE_TYPE_MM :
+ GAME_ENGINE_TYPE_RND);
+
+ // update element selection list
+ ReinitializeElementList();
+ ModifyEditorElementList();
+
SetBorderElement();
DrawEditModeWindow();
// functions for loading R'n'D level
// ----------------------------------------------------------------------------
-static int getMappedElement(int element)
+int getMappedElement(int element)
{
// remap some (historic, now obsolete) elements
char *getLocalLevelTemplateFilename(void);
char *getGlobalLevelTemplateFilename(void);
+int getMappedElement(int);
+
void LoadLevelFromFilename(struct LevelInfo *, char *);
void LoadLevel(int);
void LoadLevelTemplate(int);
#define IS_DC_STEELWALL_2(e) ((e) >= EL_DC_STEELWALL_2_LEFT && \
(e) <= EL_DC_STEELWALL_2_SINGLE)
+// !!! IMPROVE THIS !!!
+#define IS_EM_ELEMENT(e) (map_element_EM_to_RND_cave(map_element_RND_to_EM_cave(e)) == (e))
+
#define MM_WALL_BASE(e) ((e) & 0xfff0)
#define MM_WALL_BITS(e) ((e) & 0x000f)