rnd-20020508-1-src
[rocksndiamonds.git] / src / libgame / sdl.c
index c4e15425714a15688d48be46db37e1762cb58a96..ae4e41ea7c3159ffd0decfefb452fa8e1874a9cc 100644 (file)
@@ -853,6 +853,9 @@ Bitmap *SDLLoadImage(char *filename)
   /* free temporary surface */
   SDL_FreeSurface(sdl_image_tmp);
 
+  new_bitmap->width = new_bitmap->surface->w;
+  new_bitmap->height = new_bitmap->surface->h;
+
   return new_bitmap;
 }
 
@@ -870,7 +873,7 @@ inline void SDLOpenAudio(void)
   }
 
   if (Mix_OpenAudio(DEFAULT_AUDIO_SAMPLE_RATE, AUDIO_S16,
-                   AUDIO_STEREO_CHANNELS,
+                   AUDIO_NUM_CHANNELS_STEREO,
                    DEFAULT_AUDIO_FRAGMENT_SIZE) < 0)
   {
     Error(ERR_WARN, "Mix_OpenAudio() failed: %s", SDL_GetError());
@@ -882,16 +885,14 @@ inline void SDLOpenAudio(void)
   audio.loops_available = TRUE;
   audio.sound_enabled = TRUE;
 
-  /* determine number of available channels */
-  audio.channels = Mix_AllocateChannels(MIX_CHANNELS);
+  /* set number of available mixer channels */
+  audio.channels = Mix_AllocateChannels(NUM_MIXER_CHANNELS);
 
-  if (!audio.mods_available)   /* reserve first channel for music loops */
-  {
-    if (Mix_ReserveChannels(1) == 1)
-      audio.music_channel = 0;
-    else
-      audio.music_available = FALSE;
-  }
+  /* reserve first channel for music loops */
+  if (Mix_ReserveChannels(1) == 1)
+    audio.music_channel = 0;
+  else
+    audio.music_available = FALSE;
 
   Mix_Volume(-1, SOUND_MAX_VOLUME);
   Mix_VolumeMusic(SOUND_MAX_VOLUME);