moved initial cave data to level structure for EM engine
[rocksndiamonds.git] / src / game_em / reademc.c
index 0c9e663e9ecc448676b24da36fa193f97af72ccd..ed86409be6b36cb92cb6dfa944128cd105b2396b 100644 (file)
@@ -447,8 +447,8 @@ void convert_em_level(unsigned char *src, int file_version)
   {
     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 */
@@ -456,18 +456,18 @@ void convert_em_level(unsigned char *src, int file_version)
   /* 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[ply[i].x_initial][ply[i].y_initial] = Zplayer;
+    lev.cave_raw[lev.player_x[i]][lev.player_y[i]] = Zplayer;
 
   native_em_level.file_version = file_version;
 }