1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Public Sub PlaySound(ByVal SOUND As String)
Dim volume As Byte, x As Long, y As Long
x = -1
y = -1
If INIT_SOUND = False Then Exit Sub
If ReadINI("GAME", "Sound", App.Path & "\DataGame\Account\private.ini") = 0 Then Exit Sub
If Not FileExist(App.Path & SOUND_PATH & SOUND) Then Exit Sub
CurrentSound = CurrentSound + 1
If CurrentSound > Max_Sounds Or CurrentSound < 1 Then
CurrentSound = 1
End If
s
' load the sound
Sounds(CurrentSound).handle = LoadSound(SOUND)
If Sounds(CurrentSound).handle > -1 Then
Sounds(CurrentSound).x = x
Sounds(CurrentSound).y = y
volume = volsound
Sounds(CurrentSound).channel = FSOUND_PlaySound(FSOUND_FREE, Sounds(CurrentSound).handle)
FSOUND_SetVolume Sounds(CurrentSound).channel, volume
Else
CurrentSound = CurrentSound - 2
End If
End Sub |
Partager