int getMappedElement(int element)
{
- /* map some (historic, now obsolete) elements */
+ /* remap some (historic, now obsolete) elements */
#if 1
switch (element)
return element;
}
+int getMappedElementByVersion(int element, int game_version)
+{
+ /* remap some elements due to certain game version */
+
+ if (game_version <= VERSION_IDENT(2,2,0,0))
+ {
+ /* map game font elements */
+ element = (element == EL_CHAR('[') ? EL_CHAR_AUMLAUT :
+ element == EL_CHAR('\\') ? EL_CHAR_OUMLAUT :
+ element == EL_CHAR(']') ? EL_CHAR_UUMLAUT :
+ element == EL_CHAR('^') ? EL_CHAR_COPYRIGHT : element);
+ }
+
+ if (game_version < VERSION_IDENT(3,0,0,0))
+ {
+ /* map Supaplex gravity tube elements */
+ element = (element == EL_SP_GRAVITY_PORT_LEFT ? EL_SP_PORT_LEFT :
+ element == EL_SP_GRAVITY_PORT_RIGHT ? EL_SP_PORT_RIGHT :
+ element == EL_SP_GRAVITY_PORT_UP ? EL_SP_PORT_UP :
+ element == EL_SP_GRAVITY_PORT_DOWN ? EL_SP_PORT_DOWN :
+ element);
+ }
+
+ return element;
+}
+
static int LoadLevel_VERS(FILE *file, int chunk_size, struct LevelInfo *level)
{
level->file_version = getFileVersion(file);
static void LoadLevel_InitElements(struct LevelInfo *level, char *filename)
{
- int i, j;
+ int i, j, x, y;
/* map custom element change events that have changed in newer versions
(these following values were accidentally changed in version 3.0.1) */
}
}
- /* correct custom element fields (for old levels without these options) */
+ /* correct custom element values (for old levels without these options) */
for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
int element = EL_CUSTOM_START + i;
}
#endif
+ /* map elements that have changed in newer versions */
+ level->amoeba_content = getMappedElementByVersion(level->amoeba_content,
+ level->game_version);
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (x = 0; x < 3; x++)
+ for (y = 0; y < 3; y++)
+ level->yamyam_content[i][x][y] =
+ getMappedElementByVersion(level->yamyam_content[i][x][y],
+ level->game_version);
+
/* initialize element properties for level editor etc. */
InitElementPropertiesEngine(level->game_version);
}
{
int element = level->field[x][y];
+#if 1
+ element = getMappedElementByVersion(element, level->game_version);
+#else
if (level->game_version <= VERSION_IDENT(2,2,0,0))
{
/* map game font elements */
element == EL_SP_GRAVITY_PORT_DOWN ? EL_SP_PORT_DOWN :
element);
}
+#endif
level->field[x][y] = element;
}
recorded_player_action = (tape.playing ? TapePlayAction() : NULL);
+#if 1
+ if (recorded_player_action != NULL)
+ for (i = 0; i < MAX_PLAYERS; i++)
+ stored_player[i].action = recorded_player_action[i];
+#endif
+
for (i = 0; i < MAX_PLAYERS; i++)
{
summarized_player_action |= stored_player[i].action;
#if 0
if (stored_player[i].programmed_action &&
stored_player[i].programmed_action != recorded_player_action[i])
- printf("::: %d <-> %d\n",
+ printf("::: %d: %d <-> %d\n", i,
stored_player[i].programmed_action, recorded_player_action[i]);
#endif
+#if 0
actual_player_action = recorded_player_action[i];
+#endif
}
#if 0