+void CreateBitmapWithSmallBitmaps(Bitmap *src_bitmap)
+{
+ Bitmap *tmp_bitmap, *tmp_bitmap_2, *tmp_bitmap_4, *tmp_bitmap_8;
+ int src_width, src_height;
+ int tmp_width, tmp_height;
+
+ src_width = src_bitmap->width;
+ src_height = src_bitmap->height;
+
+ tmp_width = src_width;
+ tmp_height = src_height + src_height / 2;
+
+ tmp_bitmap = CreateBitmap(tmp_width, tmp_height, DEFAULT_DEPTH);
+
+ tmp_bitmap_2 = ZoomBitmap(src_bitmap, src_width / 2, src_height / 2);
+ tmp_bitmap_4 = ZoomBitmap(src_bitmap, src_width / 4, src_height / 4);
+ tmp_bitmap_8 = ZoomBitmap(src_bitmap, src_width / 8, src_height / 8);
+
+ BlitBitmap(src_bitmap, tmp_bitmap, 0, 0, src_width, src_height, 0, 0);
+ BlitBitmap(tmp_bitmap_2, tmp_bitmap, 0, 0, src_width / 2, src_height / 2,
+ 0, src_height);
+ BlitBitmap(tmp_bitmap_4, tmp_bitmap, 0, 0, src_width / 4, src_height / 4,
+ src_width / 2, src_height);
+ BlitBitmap(tmp_bitmap_8, tmp_bitmap, 0, 0, src_width / 8, src_height / 8,
+ 3 * src_width / 4, src_height);
+
+ FreeBitmap(tmp_bitmap_2);
+ FreeBitmap(tmp_bitmap_4);
+ FreeBitmap(tmp_bitmap_8);
+
+#ifdef TARGET_SDL
+ src_bitmap->surface = tmp_bitmap->surface;
+ tmp_bitmap->surface = NULL;
+#else
+ src_bitmap->drawable = tmp_bitmap->drawable;
+ tmp_bitmap->drawable = None;
+#endif
+
+ src_bitmap->height = tmp_bitmap->height;
+
+ FreeBitmap(tmp_bitmap);
+}
+
+
+/* ========================================================================= */
+/* audio functions */
+/* ========================================================================= */
+
+inline void OpenAudio(void)
+{
+ /* always start with reliable default values */
+ audio.sound_available = FALSE;
+ audio.music_available = FALSE;
+ audio.loops_available = FALSE;
+
+ audio.sound_enabled = FALSE;
+ audio.sound_deactivated = FALSE;
+
+ audio.mixer_pipe[0] = audio.mixer_pipe[1] = 0;
+ audio.mixer_pid = 0;
+ audio.device_name = NULL;
+ audio.device_fd = -1;
+
+ audio.num_channels = 0;
+ audio.music_channel = 0;
+ audio.first_sound_channel = 0;
+
+#if defined(TARGET_SDL)
+ SDLOpenAudio();
+#elif defined(PLATFORM_UNIX)
+ UnixOpenAudio();
+#elif defined(PLATFORM_MSDOS)
+ MSDOSOpenAudio();
+#endif
+}
+
+inline void CloseAudio(void)