for (y = 0; y < HEIGHT; y++)
for (x = 0; x < WIDTH; x++)
- Cave[x][y] = native_em_level.cave[x][y];
+ lev.cave[x][y] = native_em_level.cave[x][y];
for (y = 0; y < HEIGHT; y++)
for (x = 0; x < WIDTH; x++)
- Next[x][y] = Cave[x][y];
+ lev.next[x][y] = lev.cave[x][y];
for (y = 0; y < HEIGHT; y++)
for (x = 0; x < WIDTH; x++)
- Draw[x][y] = Cave[x][y];
+ lev.draw[x][y] = lev.cave[x][y];
lev.time_initial = lev.time_seconds;
lev.time = lev.time_initial;
native_em_level.cave[x][y] = Xblank;
- Cave[x][y] = Next[x][y] = Draw[x][y] = Xblank;
+ lev.cave[x][y] = lev.next[x][y] = lev.draw[x][y] = Xblank;
}
}
}
static struct GraphicInfo_EM *getObjectGraphic(int x, int y)
{
- int tile = Draw[x][y];
+ int tile = lev.draw[x][y];
struct GraphicInfo_EM *g = &graphic_info_em_object[tile][frame];
if (!game.use_native_emc_graphics_engine)
if (!game.use_native_emc_graphics_engine)
for (y = 2; y < EM_MAX_CAVE_HEIGHT - 2; y++)
for (x = 2; x < EM_MAX_CAVE_WIDTH - 2; x++)
- SetGfxAnimation_EM(&graphic_info_em_object[Draw[x][y]][frame],
- Draw[x][y], 7 - frame, x - 2, y - 2);
+ SetGfxAnimation_EM(&graphic_info_em_object[lev.draw[x][y]][frame],
+ lev.draw[x][y], 7 - frame, x - 2, y - 2);
for (y = top; y < top + MAX_BUF_YSIZE; y++)
{
{
int sx = x % MAX_BUF_XSIZE;
int sy = y % MAX_BUF_YSIZE;
- int tile = Draw[x][y];
+ int tile = lev.draw[x][y];
struct GraphicInfo_EM *g = &graphic_info_em_object[tile][frame];
int obj = g->unique_identifier;
int crm = 0;
yy < 0 || yy >= EM_MAX_CAVE_HEIGHT)
continue;
- tile_next = Draw[xx][yy];
+ tile_next = lev.draw[xx][yy];
if (!graphic_info_em_object[tile_next][frame].has_crumbled_graphics)
crm |= (1 << i);
struct LEVEL lev;
struct PLAYER ply[MAX_PLAYERS];
-short **Boom;
-short **Cave;
-short **Next;
-short **Draw;
-
-static short *Index[4][WIDTH];
-static short Array[4][WIDTH][HEIGHT];
-
extern int screen_x;
extern int screen_y;
for (y = 0; y < HEIGHT; y++)
for (x = 0; x < WIDTH; x++)
- Array[0][x][y] = Zborder;
+ lev.cavebuf[x][y] = Zborder;
for (y = 0; y < HEIGHT; y++)
for (x = 0; x < WIDTH; x++)
- Array[1][x][y] = Zborder;
+ lev.nextbuf[x][y] = Zborder;
for (y = 0; y < HEIGHT; y++)
for (x = 0; x < WIDTH; x++)
- Array[2][x][y] = Zborder;
+ lev.drawbuf[x][y] = Zborder;
for (y = 0; y < HEIGHT; y++)
for (x = 0; x < WIDTH; x++)
- Array[3][x][y] = Xblank;
+ lev.boombuf[x][y] = Xblank;
for (x = 0; x < WIDTH; x++)
- Index[0][x] = Array[0][x];
+ lev.cavecol[x] = lev.cavebuf[x];
for (x = 0; x < WIDTH; x++)
- Index[1][x] = Array[1][x];
+ lev.nextcol[x] = lev.nextbuf[x];
for (x = 0; x < WIDTH; x++)
- Index[2][x] = Array[2][x];
+ lev.drawcol[x] = lev.drawbuf[x];
for (x = 0; x < WIDTH; x++)
- Index[3][x] = Array[3][x];
+ lev.boomcol[x] = lev.boombuf[x];
- Cave = Index[0];
- Next = Index[1];
- Draw = Index[2];
- Boom = Index[3];
+ lev.cave = lev.cavecol;
+ lev.next = lev.nextcol;
+ lev.draw = lev.drawcol;
+ lev.boom = lev.boomcol;
}
void InitGameEngine_EM(void)
void SaveEngineSnapshotValues_EM(void)
{
- int i, j, k;
+ int i;
engine_snapshot_em.game_em = game_em;
engine_snapshot_em.lev = lev;
engine_snapshot_em.screen_x = screen_x;
engine_snapshot_em.screen_y = screen_y;
- engine_snapshot_em.Boom = Boom;
- engine_snapshot_em.Cave = Cave;
- engine_snapshot_em.Next = Next;
- engine_snapshot_em.Draw = Draw;
-
for (i = 0; i < 4; i++)
engine_snapshot_em.ply[i] = ply[i];
-
- for (i = 0; i < 4; i++)
- for (j = 0; j < HEIGHT; j++)
- for (k = 0; k < WIDTH; k++)
- engine_snapshot_em.Array[i][k][j] = Array[i][k][j];
}
void LoadEngineSnapshotValues_EM(void)
{
- int i, j, k;
+ int i;
game_em = engine_snapshot_em.game_em;
lev = engine_snapshot_em.lev;
screen_x = engine_snapshot_em.screen_x;
screen_y = engine_snapshot_em.screen_y;
- Boom = engine_snapshot_em.Boom;
- Cave = engine_snapshot_em.Cave;
- Next = engine_snapshot_em.Next;
- Draw = engine_snapshot_em.Draw;
-
for (i = 0; i < 4; i++)
ply[i] = engine_snapshot_em.ply[i];
-
- for (i = 0; i < 4; i++)
- for (j = 0; j < HEIGHT; j++)
- for (k = 0; k < WIDTH; k++)
- Array[i][k][j] = engine_snapshot_em.Array[i][k][j];
}