};
struct LevelInfo_EM *level_em = level->native_em_level;
struct LEVEL *lev = level_em->lev;
- struct PLAYER *ply1 = level_em->ply1;
- struct PLAYER *ply2 = level_em->ply2;
+ struct PLAYER **ply = level_em->ply;
int i, j, x, y;
+#if 0
+ printf("::: A\n");
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (j = 0; j < 8; j++)
+ printf("::: ball %d, %d: %d\n", i, j,
+ level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]);
+#endif
+
lev->width = MIN(level->fieldx, EM_MAX_CAVE_WIDTH);
lev->height = MIN(level->fieldy, EM_MAX_CAVE_HEIGHT);
map_element_RND_to_EM(level->
ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]);
+#if 0
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (j = 0; j < 8; j++)
+ printf("::: ball %d, %d: %d\n", i, j,
+ level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]);
+#endif
+
map_android_clone_elements_RND_to_EM(level);
#if 0
level_em->cave[x + 1][y + 1] = new_element;
}
+#if 1
+
+ for (i = 0; i < MAX_PLAYERS; i++)
+ {
+ ply[i]->x_initial = 0;
+ ply[i]->y_initial = 0;
+ }
+
+#else
+
ply1->x_initial = 0;
ply1->y_initial = 0;
ply2->x_initial = 0;
ply2->y_initial = 0;
+#endif
+
/* initialize player positions and delete players from the playfield */
for (y = 0; y < lev->height; y++) for (x = 0; x < lev->width; x++)
{
+
+#if 1
+
+ if (ELEM_IS_PLAYER(level->field[x][y]))
+ {
+ int player_nr = GET_PLAYER_NR(level->field[x][y]);
+
+ ply[player_nr]->x_initial = x + 1;
+ ply[player_nr]->y_initial = y + 1;
+
+ level_em->cave[x + 1][y + 1] = map_element_RND_to_EM(EL_EMPTY);
+ }
+
+#else
+
#if 1
/* !!! CURRENTLY ONLY SUPPORT FOR ONE PLAYER !!! */
if (ELEM_IS_PLAYER(level->field[x][y]))
level_em->cave[x + 1][y + 1] = map_element_RND_to_EM(EL_EMPTY);
}
#endif
+
+#endif
+
}
}
};
struct LevelInfo_EM *level_em = level->native_em_level;
struct LEVEL *lev = level_em->lev;
- struct PLAYER *ply1 = level_em->ply1;
- struct PLAYER *ply2 = level_em->ply2;
+ struct PLAYER **ply = level_em->ply;
int i, j, x, y;
level->fieldx = MIN(lev->width, MAX_LEV_FIELDX);
level->wind_direction_initial =
map_direction_EM_to_RND(lev->wind_direction_initial);
+#if 0
+ printf("::: foo\n");
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (j = 0; j < 8; j++)
+ printf("::: ball %d, %d: %d\n", i, j,
+ level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]);
+#endif
+
for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
for (j = 0; j < 8; j++)
level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]] =
map_element_EM_to_RND(lev->ball_array[i][j]);
+#if 0
+ printf("::: bar\n");
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (j = 0; j < 8; j++)
+ printf("::: ball %d, %d: %d\n", i, j,
+ level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]);
+#endif
+
map_android_clone_elements_EM_to_RND(level);
#if 0
level->field[x][y] = new_element;
}
+#if 0
+ printf("::: bar 0\n");
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (j = 0; j < 8; j++)
+ printf("::: ball %d, %d: %d\n", i, j,
+ level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]);
+#endif
+
+#if 1
+
+ for (i = 0; i < MAX_PLAYERS; i++)
+ {
+ /* in case of all players set to the same field, use the first player */
+ int nr = MAX_PLAYERS - i - 1;
+ int jx = ply[nr]->x_initial - 1;
+ int jy = ply[nr]->y_initial - 1;
+
+#if 0
+ printf("::: player %d: %d, %d\n", nr, jx, jy);
+#endif
+
+ if (jx != -1 && jy != -1)
+ level->field[jx][jy] = EL_PLAYER_1 + nr;
+ }
+
+#else
+
/* in case of both players set to the same field, use the first player */
level->field[ply2->x_initial - 1][ply2->y_initial - 1] = EL_PLAYER_2;
level->field[ply1->x_initial - 1][ply1->y_initial - 1] = EL_PLAYER_1;
+#endif
+
#if 0
printf("::: native Emerald Mine file version: %d\n", level_em->file_version);
#endif
+
+#if 0
+ printf("::: bar 2\n");
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (j = 0; j < 8; j++)
+ printf("::: ball %d, %d: %d\n", i, j,
+ level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]);
+#endif
}
static void LoadLevelFromFileInfo_EM(struct LevelInfo *level,
void CopyNativeLevel_Native_to_RND(struct LevelInfo *level)
{
+
+#if 0
+ {
+ static int ball_xy[8][2] =
+ {
+ { 0, 0 },
+ { 1, 0 },
+ { 2, 0 },
+ { 0, 1 },
+ { 2, 1 },
+ { 0, 2 },
+ { 1, 2 },
+ { 2, 2 },
+ };
+ int i, j;
+
+ printf("::: A6\n");
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (j = 0; j < 8; j++)
+ printf("::: ball %d, %d: %d\n", i, j,
+ level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]);
+ }
+#endif
+
if (level->game_engine_type == GAME_ENGINE_TYPE_EM)
CopyNativeLevel_EM_to_RND(level);
}
if (leveldir_current == NULL) /* only when dumping level */
return;
+ /* all engine modifications also valid for levels which use latest engine */
+#if 1
+ if (level->game_version < VERSION_IDENT(3,2,0,5))
+ {
+ /* time bonus score was given for 10 s instead of 1 s before 3.2.0-5 */
+ level->score[SC_TIME_BONUS] /= 10;
+ }
+#endif
+
if (leveldir_current->latest_engine)
{
/* ---------- use latest game engine ----------------------------------- */
/* extra time score was same value as time left score before 3.2.0-5 */
level->extra_time_score = level->score[SC_TIME_BONUS];
+#if 0
/* time bonus score was given for 10 s instead of 1 s before 3.2.0-5 */
level->score[SC_TIME_BONUS] /= 10;
+#endif
}
/* only few elements were able to actively move into acid before 3.1.0 */
i_to_a(element_action_info[i].value));
/* do not store direction index (bit) here, but direction value! */
- for (i = 0; i < NUM_DIRECTIONS; i++)
+ for (i = 0; i < NUM_DIRECTIONS_FULL; i++)
setHashEntry(direction_hash, element_direction_info[i].suffix,
i_to_a(1 << element_direction_info[i].value));