rnd-20060816-2-src
[rocksndiamonds.git] / src / init.c
index 647a1d3474a243175172062575806ff6cb0a748f..e8bf10b6882b507396039e60f8e966998f9b457c 100644 (file)
@@ -295,7 +295,7 @@ void InitFontGraphicInfo()
       if (graphic_info[graphic].anim_frames < MIN_NUM_CHARS_PER_FONT)
       {
        graphic_info[graphic].anim_frames = DEFAULT_NUM_CHARS_PER_FONT;
-       graphic_info[graphic].anim_frames_per_line= DEFAULT_NUM_CHARS_PER_LINE;
+       graphic_info[graphic].anim_frames_per_line = DEFAULT_NUM_CHARS_PER_LINE;
       }
 
       /* copy font relevant information from graphics information */
@@ -2907,6 +2907,7 @@ void InitElementPropertiesStatic()
     EL_EXPANDABLE_WALL_VERTICAL,
     EL_EXPANDABLE_WALL_ANY,
     EL_EXPANDABLE_WALL_GROWING,
+    EL_BD_EXPANDABLE_WALL,
     EL_BD_WALL,
     EL_SP_CHIP_SINGLE,
     EL_SP_CHIP_LEFT,
@@ -2956,6 +2957,7 @@ void InitElementPropertiesStatic()
     EL_EXPANDABLE_WALL_HORIZONTAL,
     EL_EXPANDABLE_WALL_VERTICAL,
     EL_EXPANDABLE_WALL_ANY,
+    EL_BD_EXPANDABLE_WALL,
     EL_BD_WALL,
     EL_WALL_SLIPPERY,
     EL_EXIT_CLOSED,
@@ -3535,8 +3537,8 @@ void InitElementPropertiesStatic()
     EL_INTERNAL_CASCADE_CHARS_ACTIVE,
     EL_INTERNAL_CASCADE_CE_ACTIVE,
     EL_INTERNAL_CASCADE_GE_ACTIVE,
+    EL_INTERNAL_CASCADE_REF_ACTIVE,
     EL_INTERNAL_CASCADE_USER_ACTIVE,
-    EL_INTERNAL_CASCADE_GENERIC_ACTIVE,
     EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE,
 
     -1
@@ -3555,8 +3557,8 @@ void InitElementPropertiesStatic()
     EL_INTERNAL_CASCADE_CHARS,
     EL_INTERNAL_CASCADE_CE,
     EL_INTERNAL_CASCADE_GE,
+    EL_INTERNAL_CASCADE_REF,
     EL_INTERNAL_CASCADE_USER,
-    EL_INTERNAL_CASCADE_GENERIC,
     EL_INTERNAL_CASCADE_DYNAMIC,
 
     -1
@@ -4219,6 +4221,45 @@ void Execute_Command(char *command)
       global.convert_level_nr = atoi(str_ptr); /* get level_nr value */
     }
   }
+
+#if DEBUG
+#if defined(TARGET_SDL)
+  else if (strEqual(command, "SDL_ListModes"))
+  {
+    SDL_Rect **modes;
+    int i;
+
+    SDL_Init(SDL_INIT_VIDEO);
+
+    /* get available fullscreen/hardware modes */
+    modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_HWSURFACE);
+
+    /* check if there are any modes available */
+    if (modes == NULL)
+    {
+      printf("No modes available!\n");
+
+      exit(-1);
+    }
+
+    /* check if our resolution is restricted */
+    if (modes == (SDL_Rect **)-1)
+    {
+      printf("All resolutions available.\n");
+    }
+    else
+    {
+      printf("Available Modes:\n");
+
+      for(i = 0; modes[i]; i++)
+       printf("  %d x %d\n", modes[i]->w, modes[i]->h);
+    }
+
+    exit(0);
+  }
+#endif
+#endif
+
   else
   {
     Error(ERR_EXIT_HELP, "unrecognized command '%s'", command);
@@ -4414,6 +4455,7 @@ void InitGfx()
 {
   char *filename_font_initial = NULL;
   Bitmap *bitmap_font_initial = NULL;
+  int font_height;
   int i, j;
 
   /* determine settings for initial font (for displaying startup messages) */
@@ -4454,8 +4496,9 @@ void InitGfx()
     Error(ERR_EXIT, "cannot get filename for '%s'", CONFIG_TOKEN_FONT_INITIAL);
 
   /* create additional image buffers for double-buffering and cross-fading */
-  bitmap_db_title = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH);
+  bitmap_db_cross = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH);
   bitmap_db_field = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH);
+  bitmap_db_panel = CreateBitmap(DXSIZE, DYSIZE, DEFAULT_DEPTH);
   bitmap_db_door  = CreateBitmap(3 * DXSIZE, DYSIZE + VYSIZE, DEFAULT_DEPTH);
 
   /* initialize screen properties */
@@ -4473,8 +4516,11 @@ void InitGfx()
 
   InitFontGraphicInfo();
 
+  font_height = getFontHeight(FC_RED);
+
   DrawInitText(getProgramInitString(), 20, FC_YELLOW);
   DrawInitText(PROGRAM_COPYRIGHT_STRING, 50, FC_RED);
+  DrawInitText(PROGRAM_WEBSITE_STRING, WIN_YSIZE - 20 - font_height, FC_RED);
 
   DrawInitText("Loading graphics:", 120, FC_GREEN);
 }
@@ -4846,7 +4892,11 @@ void OpenAll()
   em_open_all();
 #endif
 
+#if 0
+  DrawMainMenuExt(REDRAW_ALL);
+#else
   DrawMainMenu();
+#endif
 
   InitNetworkServer();
 }
@@ -4872,5 +4922,8 @@ void CloseAllAndExit(int exit_value)
   CloseVideoDisplay();
   ClosePlatformDependentStuff();
 
+  if (exit_value != 0)
+    NotifyUserAboutErrorFile();
+
   exit(exit_value);
 }