Kaynağa Gözat

Modified code path for SOUND_STREAM.

Brucey 5 yıl önce
ebeveyn
işleme
c0cec8be59
2 değiştirilmiş dosya ile 17 ekleme ve 15 silme
  1. 1 1
      modloader.mod/modloader.bmx
  2. 16 14
      soloudaudio.mod/soloudaudio.bmx

+ 1 - 1
modloader.mod/modloader.bmx

@@ -186,7 +186,7 @@ New TSoloudModLoader(1)
 
 Type TSoloudModLoader Extends TAudioSourceLoader
 
-	Method LoadAudioSource:TSLLoadableAudioSource( stream:TStream ) Override
+	Method LoadAudioSource:TSLLoadableAudioSource( stream:TStream, flags:Int ) Override
 		Local sound:TSLLoadableAudioSource = New TSLOpenmpt
 		If sound.loadStream(stream) = SO_NO_ERROR Then
 			Return sound

+ 16 - 14
soloudaudio.mod/soloudaudio.bmx

@@ -229,16 +229,8 @@ Type TSoloudSound Extends TSound
 	Function TryLoadSound:TSLLoadableAudioSource(stream:TStream, flags:Int)
 		Local sound:TSLLoadableAudioSource
 		
-		If flags & SOUND_STREAM Then
-			sound = New TSLWavStream
-			If sound.loadStream(stream) = SO_NO_ERROR Then
-				Return sound
-			End If
-			sound.destroy()
-		End If
-		
 		While audio_loaders
-			sound = audio_loaders.LoadAudioSource(stream)
+			sound = audio_loaders.LoadAudioSource(stream, flags)
 			If sound Then
 				Return sound
 			End If
@@ -435,13 +427,23 @@ Type TAudioSourceLoader
 	returns: A new audio sample object, or Null if sample could not be loaded
 	about: Extending types must implement this method.
 	End Rem
-	Method LoadAudioSource:TSLLoadableAudioSource( stream:TStream ) Abstract
+	Method LoadAudioSource:TSLLoadableAudioSource( stream:TStream, flags:Int ) Abstract
 End Type
 
 Type TSoloudWavLoader Extends TAudioSourceLoader
 
-	Method LoadAudioSource:TSLLoadableAudioSource( stream:TStream )
-		Local sound:TSLLoadableAudioSource = New TSLWav
+	Method LoadAudioSource:TSLLoadableAudioSource( stream:TStream, flags:Int )
+		Local sound:TSLLoadableAudioSource
+
+		If flags & SOUND_STREAM Then
+			sound = New TSLWavStream
+			If sound.loadStream(stream) = SO_NO_ERROR Then
+				Return sound
+			End If
+			sound.destroy()
+		End If
+		
+		sound = New TSLWav
 		If sound.loadStream(stream) = SO_NO_ERROR Then
 			Return sound
 		End If
@@ -452,7 +454,7 @@ End Type
 
 Type TSoloudMonotoneLoader Extends TAudioSourceLoader
 
-	Method LoadAudioSource:TSLLoadableAudioSource( stream:TStream )
+	Method LoadAudioSource:TSLLoadableAudioSource( stream:TStream, flags:Int )
 		Local sound:TSLLoadableAudioSource = New TSLMonotone
 		If sound.loadStream(stream) = SO_NO_ERROR Then
 			Return sound
@@ -464,7 +466,7 @@ End Type
 
 Type TSoloudAyLoader Extends TAudioSourceLoader
 
-	Method LoadAudioSource:TSLLoadableAudioSource( stream:TStream )
+	Method LoadAudioSource:TSLLoadableAudioSource( stream:TStream, flags:Int )
 		Local sound:TSLLoadableAudioSource = New TSLAy
 		If sound.loadStream(stream) = SO_NO_ERROR Then
 			Return sound