replaced preprocessor constants with enum values
[rocksndiamonds.git] / src / files.c
index 0b0c37d340981bac3395684ad0d48a4c0262fe19..322c5165a91ec4641555ca84aadc4b35e6e32c25 100644 (file)
@@ -818,6 +818,18 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] =
     &li.num_ball_contents,             4, MAX_ELEMENT_CONTENTS
   },
 
+  {
+    EL_SOKOBAN_FIELD_EMPTY,            -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(1),
+    &li.sb_fields_needed,              TRUE
+  },
+
+  {
+    EL_SOKOBAN_OBJECT,                 -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(1),
+    &li.sb_objects_needed,             TRUE
+  },
+
   {
     EL_MM_MCDUFFIN,                    -1,
     TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(1),
@@ -6314,10 +6326,6 @@ static void LoadLevel_InitVersion(struct LevelInfo *level)
     level->extra_time_score = level->score[SC_TIME_BONUS];
   }
 
-  // game logic of "game of life" and "biomaze" was buggy before 4.1.1.1
-  if (level->game_version < VERSION_IDENT(4,1,1,1))
-    level->use_life_bugs = TRUE;
-
   if (level->game_version < VERSION_IDENT(3,2,0,7))
   {
     // default behaviour for snapping was "not continuous" before 3.2.0-7
@@ -6415,6 +6423,14 @@ static void LoadLevel_InitVersion(struct LevelInfo *level)
   // levels were solved by the first player entering an exit up to 4.1.0.0
   if (level->game_version <= VERSION_IDENT(4,1,0,0))
     level->solved_by_one_player = TRUE;
+
+  // game logic of "game of life" and "biomaze" was buggy before 4.1.1.1
+  if (level->game_version < VERSION_IDENT(4,1,1,1))
+    level->use_life_bugs = TRUE;
+
+  // only Sokoban fields (but not objects) had to be solved before 4.1.1.1
+  if (level->game_version < VERSION_IDENT(4,1,1,1))
+    level->sb_objects_needed = FALSE;
 }
 
 static void LoadLevel_InitStandardElements(struct LevelInfo *level)
@@ -11027,7 +11043,6 @@ void ConvertLevels(void)
 
 void CreateLevelSketchImages(void)
 {
-#if defined(TARGET_SDL)
   Bitmap *bitmap1;
   Bitmap *bitmap2;
   int i;
@@ -11083,7 +11098,6 @@ void CreateLevelSketchImages(void)
   Error(ERR_INFO, "%d normal and small images created", NUM_FILE_ELEMENTS);
 
   CloseAllAndExit(0);
-#endif
 }
 
 
@@ -11093,7 +11107,6 @@ void CreateLevelSketchImages(void)
 
 void CreateCustomElementImages(char *directory)
 {
-#if defined(TARGET_SDL)
   char *src_basename = "RocksCE-template.ilbm";
   char *dst_basename = "RocksCE.bmp";
   char *src_filename = getPath2(directory, src_basename);
@@ -11185,5 +11198,4 @@ void CreateCustomElementImages(char *directory)
   FreeBitmap(bitmap);
 
   CloseAllAndExit(0);
-#endif
 }