Undo excision of streaming

This commit is contained in:
2022-08-22 11:25:45 +01:00
parent 947752b8d5
commit 6a46173fb4
3 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ dependencies:
- directory - directory
- extra - extra
- primitive - primitive
#- streaming - streaming
#- repa #- repa
- monad-parallel - monad-parallel
- parallel - parallel
+2 -2
View File
@@ -12,7 +12,7 @@ import Control.Lens
import Data.Aeson import Data.Aeson
import Data.Aeson.TH import Data.Aeson.TH
import Geometry.Data import Geometry.Data
import Streaming --import Streaming
{-# INLINE shVfromList #-} {-# INLINE shVfromList #-}
@@ -45,7 +45,7 @@ pairToSV = uncurry ShapeV
makeLenses ''ShapeV makeLenses ''ShapeV
makeLenses ''ShapeObj makeLenses ''ShapeObj
type Shape' = Stream (Of ShapeObj) IO () --type Shape' = Stream (Of ShapeObj) IO ()
type Shape = [ShapeObj] type Shape = [ShapeObj]
+2 -3
View File
@@ -26,7 +26,7 @@ import qualified SDL.Mixer as Mix
import Data.Maybe import Data.Maybe
import qualified IntMapHelp as IM import qualified IntMapHelp as IM
import qualified Data.Map as M import qualified Data.Map as M
import qualified Streaming.Prelude as S --import qualified Streaming.Prelude as S
import Control.Monad import Control.Monad
import Control.Monad.Trans import Control.Monad.Trans
import Control.Monad.Trans.Maybe import Control.Monad.Trans.Maybe
@@ -140,9 +140,8 @@ playIfFree c times = do
As for 'playSoundQueue', but with positional information in the form of an Int16. -} As for 'playSoundQueue', but with positional information in the form of an Int16. -}
playPositionalSoundQueue :: IM.IntMap Mix.Chunk -> [(Int,Int16)] -> IO () playPositionalSoundQueue :: IM.IntMap Mix.Chunk -> [(Int,Int16)] -> IO ()
playPositionalSoundQueue chunkMap playPositionalSoundQueue chunkMap
= S.mapM_ ( \(n,a) -> = mapM_ ( \(n,a) ->
runMaybeT $ playIfFree (chunkMap IM.! n) Mix.Once >>= setChannelPos a ) runMaybeT $ playIfFree (chunkMap IM.! n) Mix.Once >>= setChannelPos a )
. S.each
setChannelPos :: Int16 -> Mix.Channel -> MaybeT IO Mix.Channel setChannelPos :: Int16 -> Mix.Channel -> MaybeT IO Mix.Channel
setChannelPos a i = do setChannelPos a i = do