moved code to count bits to separate function
[rocksndiamonds.git] / src / editor.c
index d4e2bc8e8015cde39b646a1587ed700c69fd5639..25edbb4b764a0735aacb4fa98ffa4c97d9b361e1 100644 (file)
@@ -12054,19 +12054,10 @@ static boolean isHiresDrawElement(int element)
 
 static int numHiresTiles(int element)
 {
-  if (!IS_MM_WALL(element))
-    return 1;
-
-  int bits = MM_WALL_BITS(element);
-  int num_bits = 0;
-
-  while (bits)
-  {
-    bits &= bits - 1;
-    num_bits++;
-  }
+  if (IS_MM_WALL(element))
+    return get_number_of_bits(MM_WALL_BITS(element));
 
-  return num_bits;
+  return 1;
 }
 
 static void SetDrawModeHiRes(int element)