Difference for arch/win32/digi.c from version 1.9 to 1.10


version 1.9 version 1.10
Line 186
 
Line 186
  return 0;   return 0;
  }   }
  IDirectSoundBuffer_Release(SoundSlots[slot].lpsb);   IDirectSoundBuffer_Release(SoundSlots[slot].lpsb);
  SoundSlots[slot].playing = 0;  
  SoundSlots[slot].lpsb = NULL;   SoundSlots[slot].lpsb = NULL;
  return 1;  
  }   }
  return 0;   SoundSlots[slot].playing = 0;
    return 1;
 }  }
   
 static int get_free_slot()  static int get_free_slot()
Line 198
 
Line 197
  int i;   int i;
  for (i=0; i<MAX_SOUND_SLOTS; i++)   for (i=0; i<MAX_SOUND_SLOTS; i++)
  {   {
   if (!SoundSlots[i].playing) return i;  
   if (DS_release_slot(i,0))    if (DS_release_slot(i,0))
    return i;     return i;
  }   }
Line 243
 
Line 241
           goto TryNextChannel;            goto TryNextChannel;
         }          }
       //mprintf(( 0, "[SS:%d]", next_handle ));        //mprintf(( 0, "[SS:%d]", next_handle ));
       SoundSlots[SampleHandles[next_handle]].playing = 0;  
       DS_release_slot(SampleHandles[next_handle],1);        DS_release_slot(SampleHandles[next_handle],1);
       SampleHandles[next_handle] = -1;        SampleHandles[next_handle] = -1;
     }      }
Line 421
 
Line 418
    for (i=0; i < MAX_SOUND_SLOTS; i++)     for (i=0; i < MAX_SOUND_SLOTS; i++)
     if (SoundSlots[i].soundno == soundno)      if (SoundSlots[i].soundno == soundno)
      {       {
        SoundSlots[i].playing = 0;  
        DS_release_slot(i,1);         DS_release_slot(i,1);
      }       }
   
Line 634
 
Line 630
      {       {
         if ( SoundObjects[i].flags & SOF_PLAYING )          if ( SoundObjects[i].flags & SOF_PLAYING )
          {           {
            SoundSlots[SoundObjects[i].handle].playing = 0;  
            DS_release_slot(SoundObjects[i].handle,1);             DS_release_slot(SoundObjects[i].handle,1);
          }           }
        SoundObjects[i].flags = 0;      // Mark as dead, so some other sound can use this sound         SoundObjects[i].flags = 0;      // Mark as dead, so some other sound can use this sound
Line 661
 
Line 656
  if ( (SoundObjects[i].flags & SOF_USED) && (SoundObjects[i].flags & SOF_LINK_TO_OBJ ) ) {   if ( (SoundObjects[i].flags & SOF_USED) && (SoundObjects[i].flags & SOF_LINK_TO_OBJ ) ) {
  if (SoundObjects[i].lo_objnum == objnum)   {   if (SoundObjects[i].lo_objnum == objnum)   {
  if ( SoundObjects[i].flags & SOF_PLAYING ) {   if ( SoundObjects[i].flags & SOF_PLAYING ) {
  SoundSlots[SoundObjects[i].handle].playing = 0;  
  DS_release_slot(SoundObjects[i].handle,1);   DS_release_slot(SoundObjects[i].handle,1);
  }   }
  SoundObjects[i].flags = 0; // Mark as dead, so some other sound can use this sound   SoundObjects[i].flags = 0; // Mark as dead, so some other sound can use this sound
Line 712
 
Line 706
  if ((objp->type==OBJ_NONE) || (objp->signature!=SoundObjects[i].lo_objsignature))  {   if ((objp->type==OBJ_NONE) || (objp->signature!=SoundObjects[i].lo_objsignature))  {
  // The object that this is linked to is dead, so just end this sound if it is looping.   // The object that this is linked to is dead, so just end this sound if it is looping.
  if ( (SoundObjects[i].flags & SOF_PLAYING)  && (SoundObjects[i].flags & SOF_PLAY_FOREVER)) {   if ( (SoundObjects[i].flags & SOF_PLAYING)  && (SoundObjects[i].flags & SOF_PLAY_FOREVER)) {
       SoundSlots[SoundObjects[i].handle].playing = 0;  
  DS_release_slot(SoundObjects[i].handle,1);   DS_release_slot(SoundObjects[i].handle,1);
  }   }
  SoundObjects[i].flags = 0; // Mark as dead, so some other sound can use this sound   SoundObjects[i].flags = 0; // Mark as dead, so some other sound can use this sound
Line 728
 
Line 721
  if ( SoundObjects[i].volume < MIN_VOLUME ) {   if ( SoundObjects[i].volume < MIN_VOLUME ) {
  // Sound is too far away, so stop it from playing.   // Sound is too far away, so stop it from playing.
  if ((SoundObjects[i].flags & SOF_PLAYING)&&(SoundObjects[i].flags & SOF_PLAY_FOREVER)) {   if ((SoundObjects[i].flags & SOF_PLAYING)&&(SoundObjects[i].flags & SOF_PLAY_FOREVER)) {
  SoundSlots[SoundObjects[i].handle].playing = 0;  
  DS_release_slot(SoundObjects[i].handle,1);   DS_release_slot(SoundObjects[i].handle,1);
  SoundObjects[i].flags &= ~SOF_PLAYING; // Mark sound as not playing   SoundObjects[i].flags &= ~SOF_PLAYING; // Mark sound as not playing
  }   }
Line 760
 
Line 752
  for (i=0; i<MAX_SOUND_OBJECTS; i++ ) {   for (i=0; i<MAX_SOUND_OBJECTS; i++ ) {
  if (digi_sounds_initialized) {   if (digi_sounds_initialized) {
  if ( SoundObjects[i].flags & SOF_PLAYING ) {   if ( SoundObjects[i].flags & SOF_PLAYING ) {
          SoundSlots[SoundObjects[i].handle].playing=0;  
  DS_release_slot(SoundObjects[i].handle,1);   DS_release_slot(SoundObjects[i].handle,1);
  }   }
  }   }
Line 834
 
Line 825
  int i;   int i;
   
  for (i=0; i< MAX_SOUND_SLOTS; i++) {   for (i=0; i< MAX_SOUND_SLOTS; i++) {
   SoundSlots[i].playing=0;  
   DS_release_slot(i,1);    DS_release_slot(i,1);
  }   }
    

Legend:
line(s) removed in v.1.9 
line(s) changed
 line(s) added in v.1.10