Refactor sound

This commit is contained in:
2021-04-06 14:53:40 +02:00
parent f7e0b40cd5
commit ebcac39069
5 changed files with 250 additions and 181 deletions
+7 -1
View File
@@ -7,6 +7,12 @@ import qualified Data.Map as M
import Control.Lens
import Geometry
data SoundStatus
= Playing
| FadingOut
| ToStart
deriving (Eq,Ord,Show)
data SoundData a = SoundData
{_loadedChunks :: IM.IntMap Mix.Chunk
,_playingSounds :: M.Map a Sound
@@ -14,7 +20,7 @@ data SoundData a = SoundData
data Sound = Sound
{ _soundTime :: Maybe Int
, _soundFadeTime :: Int
, _soundIsFadingOut :: Bool
, _soundStatus :: SoundStatus
, _soundChannel :: Maybe Mix.Channel
, _soundPos :: Maybe Point2
, _soundChunkID :: Int