rnd-20001202-2-src
[rocksndiamonds.git] / src / init.c
index d48e713c51b629d2e2c7a4acb617728d7313cbac..3a0c54ed7bfcc69500e138dba69ba5046b8a1fed 100644 (file)
@@ -38,6 +38,7 @@ static void InitLevelInfo(void);
 static void InitNetworkServer(void);
 static void InitSound(void);
 static void InitSoundServer(void);
+static void InitDisplay(void);
 static void InitGfx(void);
 static void InitGfxBackground(void);
 static void LoadGfx(int, struct PictureFileInfo *);
@@ -73,7 +74,7 @@ void OpenAll(int argc, char *argv[])
   signal(SIGINT, CloseAllAndExit);
   signal(SIGTERM, CloseAllAndExit);
 
-  InitBufferedDisplay(&backbuffer, &window);
+  InitDisplay();
   InitEventFilter(FilterMouseMotionEvents);
 
   InitGfx();
@@ -307,6 +308,26 @@ void InitJoysticks()
 #endif /* !TARGET_SDL */
 }
 
+void InitDisplay()
+{
+  char *gfx_dir = getPath2(options.ro_base_directory, GRAPHICS_DIRECTORY);
+  char *x11_icon_filename = getPath2(gfx_dir, X11_ICON_FILENAME);
+  char *x11_iconmask_filename = getPath2(gfx_dir, X11_ICONMASK_FILENAME);
+  char *msdos_pointer_filename = getPath2(gfx_dir, MSDOS_POINTER_FILENAME);
+
+  free(gfx_dir);
+
+  InitProgramInfo(program_name, PROGRAM_TITLE_STRING, WINDOW_TITLE_STRING,
+                 ICON_TITLE_STRING, x11_icon_filename, x11_iconmask_filename,
+                 msdos_pointer_filename);
+
+  InitScrollbufferSize(FXSIZE, FYSIZE);        /* (only needed for MS-DOS code) */
+
+  InitVideoDisplay();
+  InitVideoBuffer(&backbuffer, &window, WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH,
+                 setup.fullscreen);
+}
+
 void InitGfx()
 {
   int i, j;
@@ -515,7 +536,7 @@ void InitGfxBackground()
 {
   int x, y;
 
-  drawto = backbuffer = pix[PIX_DB_BACK];
+  drawto = backbuffer;
   fieldbuffer = pix[PIX_DB_FIELD];
   SetDrawtoField(DRAW_BACKBUFFER);