Add support for one time sounds, crashes if more than 8 play at once
This commit is contained in:
+8
-2
@@ -1,7 +1,13 @@
|
||||
module Sound
|
||||
where
|
||||
import Sound.Preload
|
||||
|
||||
-- ok, the problem here is that we need to be able to return the playing channel
|
||||
-- so this thread cannot be a simple observer
|
||||
import Control.Monad
|
||||
|
||||
import qualified SDL.Mixer as Mix
|
||||
|
||||
import qualified Data.IntMap as IM
|
||||
|
||||
playSoundQueue :: SoundData -> [Int] -> IO ()
|
||||
playSoundQueue sd ns =
|
||||
forM_ ns $ \n -> Mix.play (sd IM.! n)
|
||||
|
||||
Reference in New Issue
Block a user