rnd-20140818-1-src
[rocksndiamonds.git] / src / tools.c
index 0eb8ab1422e6cc985ca1646d7c8919ef5b86120c..66796da98780e401a25d3c90a10a152e2f5a70a9 100644 (file)
@@ -1587,6 +1587,7 @@ inline void getGraphicSourceExt(int graphic, int frame, Bitmap **bitmap,
   int src_y = g->src_y + (get_backside ? g->offset2_y : 0);
 
 #if NEW_TILESIZE
+
   if (TILESIZE_VAR != TILESIZE)
     return getSizedGraphicSourceExt(graphic, frame, TILESIZE_VAR, bitmap, x, y,
                                    get_backside);
@@ -11498,6 +11499,7 @@ void ChangeViewportPropertiesIfNeeded()
   boolean init_gfx_buffers = FALSE;
   boolean init_video_buffer = FALSE;
   boolean init_gadgets_and_toons = FALSE;
+  boolean init_em_graphics = FALSE;
 
 #if 0
   /* !!! TEST ONLY !!! */
@@ -11585,12 +11587,15 @@ void ChangeViewportPropertiesIfNeeded()
       )
   {
 #if 1
-    // changing tile size invalidates scroll values of engine snapshots
     if (new_tilesize_var != TILESIZE_VAR)
     {
       // printf("::: new_tilesize_var != TILESIZE_VAR\n");
 
+      // changing tile size invalidates scroll values of engine snapshots
       FreeEngineSnapshot();
+
+      // changing tile size requires update of graphic mapping for EM engine
+      init_em_graphics = TRUE;
     }
 #endif
 
@@ -11683,6 +11688,11 @@ void ChangeViewportPropertiesIfNeeded()
     InitToons();
   }
 
+  if (init_em_graphics)
+  {
+      InitGraphicInfo_EM();
+  }
+
 #if 0
   printf("::: %d, %d  /  %d, %d [%d]\n", VX, VY, EX, EY, game_status);
 #endif