rnd-20020825-1-src
[rocksndiamonds.git] / src / tools.c
index e5055eda6513d061b8f6eaab76c1922a3f4f6158..230f529995363fe10f8c762b7d9035b0333f7a0b 100644 (file)
@@ -2433,7 +2433,7 @@ int get_next_element(int element)
   }
 }
 
-int el2gfx(int element)
+int el2gfx_OLD(int element)
 {
   switch(element)
   {
@@ -2714,3 +2714,22 @@ int el2gfx(int element)
     }
   }
 }
+
+int el2gfx(int element)
+{
+  int graphic_OLD = el2gfx_OLD(element);
+  int graphic_NEW = element_info[element].graphic;
+
+  if (element >= MAX_ELEMENTS)
+  {
+    Error(ERR_WARN, "el2gfx: element == %d >= MAX_ELEMENTS", element);
+  }
+
+  if (graphic_NEW != graphic_OLD)
+  {
+    Error(ERR_WARN, "el2gfx: graphic_NEW (%d) != graphic_OLD (%d)",
+         graphic_NEW, graphic_OLD);
+  }
+
+  return graphic_NEW;
+}