// first fill the complete playfield with the default border element
for (y = 0; y < EM_MAX_CAVE_HEIGHT; y++)
for (x = 0; x < EM_MAX_CAVE_WIDTH; x++)
- level_em->cave[x][y] = Zborder;
+ cav->cave_raw[x][y] = Zborder;
// then copy the real level contents from level file into the playfield
for (y = 0; y < cav->height; y++) for (x = 0; x < cav->width; x++)
if (level->field[x][y] == EL_AMOEBA_DEAD)
new_element = map_element_RND_to_EM(EL_AMOEBA_WET);
- level_em->cave[x][y] = new_element;
+ cav->cave_raw[x][y] = new_element;
}
for (i = 0; i < MAX_PLAYERS; i++)
cav->player_x[player_nr] = x;
cav->player_y[player_nr] = y;
- level_em->cave[x][y] = map_element_RND_to_EM(EL_EMPTY);
+ cav->cave_raw[x][y] = map_element_RND_to_EM(EL_EMPTY);
}
}
}
// convert the playfield (some elements need special treatment)
for (y = 0; y < level->fieldy; y++) for (x = 0; x < level->fieldx; x++)
{
- int new_element = map_element_EM_to_RND(level_em->cave[x][y]);
+ int new_element = map_element_EM_to_RND(cav->cave_raw[x][y]);
if (new_element == EL_AMOEBA_WET && level->amoeba_speed == 0)
new_element = EL_AMOEBA_DEAD;
for (x = 0; x < lev.width; x++)
for (y = 0; y < lev.height; y++)
- lev.cave[lev.left + x][lev.top + y] = native_em_level.cave[x][y];
+ lev.cave[lev.left + x][lev.top + y] = lev.cave_raw[x][y];
for (x = lev.left; x < lev.right; x++)
for (y = lev.top; y < lev.bottom; y++)
int x = lev.player_x[i];
int y = lev.player_y[i];
- native_em_level.cave[x][y] = Xblank;
+ lev.cave_raw[x][y] = Xblank;
lev.cave[lev.left + x][lev.top + y] = Xblank;
lev.next[lev.left + x][lev.top + y] = Xblank;
short ball_array[8][8]; /* ball data */
short android_array[TILE_MAX]; /* android clone table */
+ short cave_raw[CAVE_WIDTH][CAVE_HEIGHT];
+
short cavebuf[CAVE_BUFFER_WIDTH][CAVE_BUFFER_HEIGHT];
short nextbuf[CAVE_BUFFER_WIDTH][CAVE_BUFFER_HEIGHT];
short drawbuf[CAVE_BUFFER_WIDTH][CAVE_BUFFER_HEIGHT];
{
int file_version;
- short cave[CAVE_WIDTH][CAVE_HEIGHT];
-
struct LEVEL *cav;
};
/* first fill the complete playfield with the default border element */
for (y = 0; y < CAVE_HEIGHT; y++)
for (x = 0; x < CAVE_WIDTH; x++)
- native_em_level.cave[x][y] = Zborder;
+ lev.cave_raw[x][y] = Zborder;
/* then copy the real level contents from level file into the playfield */
temp = 0;
for (y = 0; y < lev.height; y++)
for (x = 0; x < lev.width; x++)
- native_em_level.cave[x][y] = map_emc[src[temp++]];
+ lev.cave_raw[x][y] = map_emc[src[temp++]];
/* 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[lev.player_x[i]][lev.player_y[i]] = Zplayer;
+ lev.cave_raw[lev.player_x[i]][lev.player_y[i]] = Zplayer;
native_em_level.file_version = file_version;
}