rnd-20001204-3-src
[rocksndiamonds.git] / src / init.c
index 8f30094d77fec06f1ff6edbfc9c09c265b02211f..d83b754235cc37dce7569864cbae08d712a1bc94 100644 (file)
@@ -148,14 +148,16 @@ void InitSound()
 
   OpenAudio(&audio);
 
+  AllocSoundArray(NUM_SOUNDS);
+
   for(i=0; i<NUM_SOUNDS; i++)
   {
-    Sound[i].name = sound_name[i];
-
-    if (!LoadSound(&Sound[i]))
+    if (!LoadSound(i, sound_name[i]))
     {
       audio.sound_available = FALSE;
       audio.loops_available = FALSE;
+      audio.sound_enabled = FALSE;
+
       return;
     }
   }
@@ -636,6 +638,8 @@ void LoadGfx(int pos, struct PictureFileInfo *pic)
     if (!pix[pos]->drawable)
       Error(ERR_EXIT, "cannot get graphics for '%s'", pic->picture_filename);
 
+    pix[pos]->gc = window->gc;
+
 #if 0
     /* setting pix_masked[] to pix[] allows BlitBitmapMasked() to always
        use pix_masked[], although they are the same when not using SDL */