Commit before attempting to stream worldSPic more effectively

This commit is contained in:
2022-07-04 11:04:09 +01:00
parent 7fa391eb6c
commit 1e32b05406
9 changed files with 51 additions and 44 deletions
+3 -3
View File
@@ -26,7 +26,7 @@ import qualified SDL.Mixer as Mix
import Data.Maybe
import qualified Data.IntMap.Strict as IM
import qualified Data.Map as M
import qualified Data.Vector.Fusion.Stream.Monadic as VS
import qualified Streaming.Prelude as S
import Control.Monad
import Control.Monad.Trans
import Control.Monad.Trans.Maybe
@@ -140,9 +140,9 @@ playIfFree c times = do
As for 'playSoundQueue', but with positional information in the form of an Int16. -}
playPositionalSoundQueue :: IM.IntMap Mix.Chunk -> [(Int,Int16)] -> IO ()
playPositionalSoundQueue chunkMap
= VS.mapM_ ( \(n,a) ->
= S.mapM_ ( \(n,a) ->
runMaybeT $ playIfFree (chunkMap IM.! n) Mix.Once >>= setChannelPos a )
. VS.fromList
. S.each
setChannelPos :: Int16 -> Mix.Channel -> MaybeT IO Mix.Channel
setChannelPos a i = do