X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_em%2Fconvert.c;h=65efdcc13f78f88ee89ed9a0851bb08e68620126;hb=a19843471dc3ebab17890f54cb2eb8aa82a7ac8a;hp=5553772e62f6ece5654cf91c702e8cf14adfbed9;hpb=4354b26149582cc6daf9e08205b740d96ef6bc16;p=rocksndiamonds.git diff --git a/src/game_em/convert.c b/src/game_em/convert.c index 5553772e..65efdcc1 100644 --- a/src/game_em/convert.c +++ b/src/game_em/convert.c @@ -938,22 +938,20 @@ void prepare_em_level(void) /* reset all runtime variables to their initial values */ + game_init_cave_buffers(); + lev.left = CAVE_BUFFER_XOFFSET; lev.top = CAVE_BUFFER_YOFFSET; lev.right = lev.left + lev.width; lev.bottom = lev.top + lev.height; - for (y = 0; y < CAVE_HEIGHT; y++) - for (x = 0; x < CAVE_WIDTH; x++) + 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]; - for (y = 0; y < CAVE_BUFFER_HEIGHT; y++) - for (x = 0; x < CAVE_BUFFER_WIDTH; x++) - lev.next[x][y] = lev.cave[x][y]; - - for (y = 0; y < CAVE_BUFFER_HEIGHT; y++) - for (x = 0; x < CAVE_BUFFER_WIDTH; x++) - lev.draw[x][y] = lev.cave[x][y]; + for (x = lev.left; x < lev.right; x++) + for (y = lev.top; y < lev.bottom; y++) + lev.next[x][y] = lev.draw[x][y] = lev.cave[x][y]; lev.time_initial = lev.time_seconds; lev.time = lev.time_initial;