};
struct LevelInfo_EM *level_em = level->native_em_level;
struct LEVEL *lev = level_em->lev;
- struct PLAYER **ply = level_em->ply;
int i, j, x, y;
lev->width = MIN(level->fieldx, MAX_PLAYFIELD_WIDTH);
for (i = 0; i < MAX_PLAYERS; i++)
{
- ply[i]->x_initial = -1;
- ply[i]->y_initial = -1;
+ lev->player_x[i] = -1;
+ lev->player_y[i] = -1;
}
// initialize player positions and delete players from the playfield
{
int player_nr = GET_PLAYER_NR(level->field[x][y]);
- ply[player_nr]->x_initial = x;
- ply[player_nr]->y_initial = y;
+ lev->player_x[player_nr] = x;
+ lev->player_y[player_nr] = y;
level_em->cave[x][y] = map_element_RND_to_EM(EL_EMPTY);
}
};
struct LevelInfo_EM *level_em = level->native_em_level;
struct LEVEL *lev = level_em->lev;
- struct PLAYER **ply = level_em->ply;
int i, j, x, y;
level->fieldx = MIN(lev->width, MAX_LEV_FIELDX);
{
// 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;
- int jy = ply[nr]->y_initial;
+ int jx = lev->player_x[nr];
+ int jy = lev->player_y[nr];
if (jx != -1 && jy != -1)
level->field[jx][jy] = EL_PLAYER_1 + nr;
int i;
native_em_level.file_version = FILE_VERSION_EM_ACTUAL;
-
native_em_level.lev = &lev;
- for (i = 0; i < MAX_PLAYERS; i++)
- native_em_level.ply[i] = &ply[i];
game_em.lev = &lev;
for (i = 0; i < MAX_PLAYERS; i++)
for (i = 0; i < MAX_PLAYERS; i++)
{
- ply[i].x_initial = -1;
- ply[i].y_initial = -1;
+ lev.player_x[i] = -1;
+ lev.player_y[i] = -1;
}
lev.lenses_cnt_initial = 0;
ply[i].exists = 0;
ply[i].alive_initial = FALSE;
- if (ply[i].x_initial != -1 && ply[i].y_initial != -1)
+ if (lev.player_x[i] != -1 &&
+ lev.player_y[i] != -1)
{
ply[i].exists = 1;
}
else
{
- int x = ply[i].x_initial;
- int y = ply[i].y_initial;
+ int x = lev.player_x[i];
+ int y = lev.player_y[i];
native_em_level.cave[x][y] = Xblank;
ply[i].dynamite_cnt = 0;
ply[i].keys = 0;
ply[i].anim = 0;
- ply[i].oldx = ply[i].x = ply[i].x_initial + lev.left;
- ply[i].oldy = ply[i].y = ply[i].y_initial + lev.top;
+ ply[i].oldx = ply[i].x = lev.player_x[i] + lev.left;
+ ply[i].oldy = ply[i].y = lev.player_y[i] + lev.top;
ply[i].last_move_dir = MV_NONE;
ply[i].joy_n = ply[i].joy_e = ply[i].joy_s = ply[i].joy_w = 0;
ply[i].joy_snap = ply[i].joy_drop = 0;
int right; /* playfield right edge */
int bottom; /* playfield bottom edge */
+ int player_x[MAX_PLAYERS]; /* player x pos */
+ int player_y[MAX_PLAYERS]; /* player y pos */
+
int time_seconds; /* available time (seconds) */
int time_initial; /* available time (initial) */
int time; /* time remaining (runtime) */
int keys;
int anim;
- int x_initial;
- int y_initial;
int x;
int y;
int oldx;
short cave[CAVE_WIDTH][CAVE_HEIGHT];
struct LEVEL *lev;
- struct PLAYER *ply[MAX_PLAYERS];
};
struct GraphicInfo_EM
{
temp = GET_BE16(src[2096 + i * 2]);
- ply[i].x_initial = (temp & 63);
- ply[i].y_initial = (temp >> 6 & 31);
+ lev.player_x[i] = (temp & 63);
+ lev.player_y[i] = (temp >> 6 & 31);
}
/* cave */
/* at last, set the two players at their positions in the playfield */
/* (native EM[C] levels always have exactly two players in a level) */
for (i = 0; i < 2; i++)
- native_em_level.cave[ply[i].x_initial][ply[i].y_initial] = Zplayer;
+ native_em_level.cave[lev.player_x[i]][lev.player_y[i]] = Zplayer;
native_em_level.file_version = file_version;
}