+static void InitMixer()
+{
+ OpenAudio();
+ StartMixer();
+}
+
+static void ReinitializeGraphics()
+{
+ InitElementGraphicInfo(); /* element game graphic mapping */
+ InitElementSpecialGraphicInfo(); /* element special graphic mapping */
+ InitGraphicInfo(); /* graphic properties mapping */
+
+ InitElementSmallImages(); /* create editor and preview images */
+ InitFontGraphicInfo(); /* initialize text drawing functions */
+
+ SetMainBackgroundImage(IMG_BACKGROUND);
+ SetDoorBackgroundImage(IMG_BACKGROUND_DOOR);
+
+ InitGadgets();
+ InitToons();
+}
+
+static void ReinitializeSounds()
+{
+ InitElementSoundInfo(); /* element game sound mapping */
+ InitSoundInfo(); /* sound properties mapping */
+
+ InitPlaySoundLevel(); /* internal game sound settings */
+}
+
+static void ReinitializeMusic()
+{
+ /* currently nothing to do */
+}
+
+static void InitImages()
+{
+ ReloadCustomImages();
+
+ LoadCustomElementDescriptions();
+ LoadSpecialMenuDesignSettings();
+
+ ReinitializeGraphics();
+}
+
+static void InitSound()
+{
+ InitReloadCustomSounds(artwork.snd_current->identifier);
+ ReinitializeSounds();
+}
+
+static void InitMusic()
+{
+ InitReloadCustomMusic(artwork.mus_current->identifier);
+ ReinitializeMusic();
+}
+
+static void InitTileClipmasks()
+{
+#if 0
+#if defined(TARGET_X11)
+ XGCValues clip_gc_values;
+ unsigned long clip_gc_valuemask;
+
+#if defined(TARGET_X11_NATIVE)
+
+#if 0
+ GC copy_clipmask_gc;
+
+ static struct
+ {
+ int start;
+ int count;
+ }
+ tile_needs_clipping[] =
+ {
+ { GFX_SPIELER1_UP, 4 },
+ { GFX_SPIELER1_DOWN, 4 },
+ { GFX_SPIELER1_LEFT, 4 },
+ { GFX_SPIELER1_RIGHT, 4 },
+ { GFX_SPIELER1_PUSH_LEFT, 4 },
+ { GFX_SPIELER1_PUSH_RIGHT, 4 },
+ { GFX_SPIELER2_UP, 4 },
+ { GFX_SPIELER2_DOWN, 4 },
+ { GFX_SPIELER2_LEFT, 4 },
+ { GFX_SPIELER2_RIGHT, 4 },
+ { GFX_SPIELER2_PUSH_LEFT, 4 },
+ { GFX_SPIELER2_PUSH_RIGHT, 4 },
+ { GFX_SPIELER3_UP, 4 },
+ { GFX_SPIELER3_DOWN, 4 },
+ { GFX_SPIELER3_LEFT, 4 },
+ { GFX_SPIELER3_RIGHT, 4 },
+ { GFX_SPIELER3_PUSH_LEFT, 4 },
+ { GFX_SPIELER3_PUSH_RIGHT, 4 },
+ { GFX_SPIELER4_UP, 4 },
+ { GFX_SPIELER4_DOWN, 4 },
+ { GFX_SPIELER4_LEFT, 4 },
+ { GFX_SPIELER4_RIGHT, 4 },
+ { GFX_SPIELER4_PUSH_LEFT, 4 },
+ { GFX_SPIELER4_PUSH_RIGHT, 4 },
+ { GFX_SP_MURPHY, 1 },
+ { GFX_MURPHY_GO_LEFT, 3 },
+ { GFX_MURPHY_GO_RIGHT, 3 },
+ { GFX_MURPHY_SNAP_UP, 1 },
+ { GFX_MURPHY_SNAP_DOWN, 1 },
+ { GFX_MURPHY_SNAP_RIGHT, 1 },
+ { GFX_MURPHY_SNAP_LEFT, 1 },
+ { GFX_MURPHY_PUSH_RIGHT, 1 },
+ { GFX_MURPHY_PUSH_LEFT, 1 },
+ { GFX_GEBLUBBER, 4 },
+ { GFX_DYNAMIT, 7 },
+ { GFX_DYNABOMB, 4 },
+ { GFX_EXPLOSION, 8 },
+ { GFX_SOKOBAN_OBJEKT, 1 },
+ { GFX_FUNKELN_BLAU, 3 },
+ { GFX_FUNKELN_WEISS, 3 },
+ { GFX2_SHIELD_PASSIVE, 3 },
+ { GFX2_SHIELD_ACTIVE, 3 },
+ { -1, 0 }
+ };
+#endif
+
+#endif /* TARGET_X11_NATIVE */
+#endif /* TARGET_X11 */
+
+ int i;
+
+ /* initialize pixmap array for special X11 tile clipping to Pixmap 'None' */
+ for (i=0; i<NUM_TILES; i++)
+ tile_clipmask[i] = None;
+
+#if defined(TARGET_X11)
+ /* This stuff is needed because X11 (XSetClipOrigin(), to be precise) is
+ often very slow when preparing a masked XCopyArea() for big Pixmaps.
+ To prevent this, create small (tile-sized) mask Pixmaps which will then
+ be set much faster with XSetClipOrigin() and speed things up a lot. */
+
+ clip_gc_values.graphics_exposures = False;
+ clip_gc_valuemask = GCGraphicsExposures;
+ tile_clip_gc = XCreateGC(display, window->drawable,
+ clip_gc_valuemask, &clip_gc_values);
+
+#if 0
+ for (i=0; i<NUM_BITMAPS; i++)
+ {
+ if (pix[i]->clip_mask)
+ {
+ clip_gc_values.graphics_exposures = False;
+ clip_gc_values.clip_mask = pix[i]->clip_mask;
+ clip_gc_valuemask = GCGraphicsExposures | GCClipMask;
+ pix[i]->stored_clip_gc = XCreateGC(display, window->drawable,
+ clip_gc_valuemask, &clip_gc_values);
+ }
+ }
+#endif
+
+#if defined(TARGET_X11_NATIVE)
+
+#if 0
+ /* create graphic context structures needed for clipping */
+ clip_gc_values.graphics_exposures = False;
+ clip_gc_valuemask = GCGraphicsExposures;
+ copy_clipmask_gc = XCreateGC(display, pix[PIX_BACK]->clip_mask,
+ clip_gc_valuemask, &clip_gc_values);
+
+ /* create only those clipping Pixmaps we really need */
+ for (i=0; tile_needs_clipping[i].start>=0; i++)
+ {
+ int j;
+
+ for (j=0; j<tile_needs_clipping[i].count; j++)
+ {
+ int tile = tile_needs_clipping[i].start + j;
+ int graphic = tile;
+ int src_x, src_y;
+ Bitmap *src_bitmap;
+ Pixmap src_pixmap;
+
+ getGraphicSource(graphic, &src_bitmap, &src_x, &src_y);
+ src_pixmap = src_bitmap->clip_mask;
+
+ tile_clipmask[tile] = XCreatePixmap(display, window->drawable,
+ TILEX, TILEY, 1);
+
+ XCopyArea(display, src_pixmap, tile_clipmask[tile], copy_clipmask_gc,
+ src_x, src_y, TILEX, TILEY, 0, 0);
+ }
+ }
+
+ XFreeGC(display, copy_clipmask_gc);
+#endif
+
+#endif /* TARGET_X11_NATIVE */
+#endif /* TARGET_X11 */
+#endif
+}
+
+void FreeTileClipmasks()