rnd-20020906-2-src
authorHolger Schemel <info@artsoft.org>
Fri, 6 Sep 2002 17:51:00 +0000 (19:51 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:38:17 +0000 (10:38 +0200)
src/conftime.h
src/init.c
src/main.c
src/tools.c

index b2606371d5b9809ec9346604bba28d575a40cf9f..bd4614a2e17f588dc4e3c4689b185a95aafd1683 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2002-09-06 18:36]"
+#define COMPILE_DATE_STRING "[2002-09-06 19:21]"
index 8f957e30837f16165db67f41dee238b7f5fcc3ca..cef28a3003695c33e83727c29f0e865fe26d322a 100644 (file)
@@ -100,7 +100,6 @@ void OpenAll(void)
   InitGfx();
   InitElementProperties();     /* initializes IS_CHAR() for el2gfx() */
   InitElementInfo();
-  InitGraphicInfo();
 
   InitLevelInfo();
   InitLevelArtworkInfo();
@@ -180,6 +179,7 @@ static void InitImages()
 
   /* load custom images */
   ReloadCustomImages();
+  InitGraphicInfo();
 }
 
 static void InitMixer()
@@ -497,6 +497,7 @@ void ReloadCustomArtwork()
     }
 
     ReloadCustomImages();
+    InitGraphicInfo();
 
     FreeTileClipmasks();
     InitTileClipmasks();
@@ -855,17 +856,16 @@ void InitGraphicInfo()
   /* always start with reliable default values */
   for(i=0; i<MAX_GRAPHICS; i++)
   {
-    graphic_info[i].bitmap = pix[PIX_SP];      /* graphic that ... */
-    graphic_info[i].src_x = 0;                 /* ... contains ... */
-    graphic_info[i].src_y = 0;                 /* ... empty space. */
+    graphic_info[i].bitmap = NULL;
+    graphic_info[i].src_x = 0;
+    graphic_info[i].src_y = 0;
     graphic_info[i].anim_frames = 1;
     graphic_info[i].anim_delay = 0;
     graphic_info[i].anim_mode = ANIM_NORMAL;
-  }
 
-  for(i=0; i<MAX_GRAPHICS; i++)
     getGraphicSource(i, &graphic_info[i].bitmap,
                     &graphic_info[i].src_x, &graphic_info[i].src_y);
+  }
 }
 
 void InitElementProperties()
index 4a5849f816edf4b5fea56721dfb30af988a2aa17..324c4f57cdd805b36c7c70e114122841a68e236a 100644 (file)
@@ -142,6 +142,9 @@ struct ArtworkConfigInfo image_config[] =
   { "bd_diamond",                      "bd_diamond.pcx"        },
   { "bd_diamond.frame_xpos",           "0"                     },
   { "bd_diamond.num_frames",           "1"                     },
+  { "robot_wheel",                     "bd_diamond.pcx"        },
+  { "robot_wheel.frame_xpos",          "0"                     },
+  { "robot_wheel.num_frames",          "4"                     },
 };
 
 struct ArtworkConfigInfo sound_config[] =
index 4df35c22201c2a10b7d2b13f3f3a4fbf7cf4fbf2..7888e606efb015b7d738e2ddf4b60c7984a400db 100644 (file)
@@ -744,7 +744,13 @@ static void DrawGraphicAnimationShiftedThruMask(int sx, int sy,
 
 void getGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y)
 {
-  if (graphic >= GFX_START_ROCKSSCREEN && graphic <= GFX_END_ROCKSSCREEN)
+  if (graphic >= 0 && graphic_info[graphic].bitmap != NULL)
+  {
+    *bitmap = graphic_info[graphic].bitmap;
+    *x = graphic_info[graphic].src_x;
+    *y = graphic_info[graphic].src_y;
+  }
+  else if (graphic >= GFX_START_ROCKSSCREEN && graphic <= GFX_END_ROCKSSCREEN)
   {
     graphic -= GFX_START_ROCKSSCREEN;
     *bitmap = pix[PIX_BACK];
@@ -2713,9 +2719,11 @@ int el2gfx_OLD(int element)
 
 int el2gfx(int element)
 {
-  int graphic_OLD = el2gfx_OLD(element);
   int graphic_NEW = element_info[element].graphic;
 
+#if DEBUG
+  int graphic_OLD = el2gfx_OLD(element);
+
   if (element >= MAX_ELEMENTS)
   {
     Error(ERR_WARN, "el2gfx: element == %d >= MAX_ELEMENTS", element);
@@ -2726,6 +2734,7 @@ int el2gfx(int element)
     Error(ERR_WARN, "el2gfx: graphic_NEW (%d) != graphic_OLD (%d)",
          graphic_NEW, graphic_OLD);
   }
+#endif
 
   return graphic_NEW;
 }