Tweak sound
This commit is contained in:
@@ -19,9 +19,10 @@ soundOnceOrigin :: Int -> SoundOrigin -> World -> World
|
||||
soundOnceOrigin sType so = over sounds (M.insertWith (flip const) so sound)
|
||||
where
|
||||
sound = Sound
|
||||
{ _soundType = sType
|
||||
{ _soundChunkID = sType
|
||||
, _soundTime = Nothing
|
||||
, _soundFadeTime = 0
|
||||
, _soundIsFadingOut = False
|
||||
, _soundChannel = Nothing
|
||||
, _soundPos = Nothing
|
||||
}
|
||||
@@ -30,8 +31,9 @@ soundFrom :: SoundOrigin -> Int -> Int -> Int -> World -> World
|
||||
soundFrom so sType time fadeTime w = over sounds (M.insertWith f so sound) w
|
||||
where
|
||||
sound = Sound
|
||||
{ _soundType = sType
|
||||
{ _soundChunkID = sType
|
||||
, _soundTime = Just time
|
||||
, _soundIsFadingOut = False
|
||||
, _soundFadeTime = fadeTime
|
||||
, _soundChannel = Nothing
|
||||
, _soundPos = Nothing
|
||||
@@ -43,7 +45,7 @@ soundMultiFrom [] _ _ _ w = w
|
||||
soundMultiFrom (so:sos) sType time fadeTime w
|
||||
| so `M.member` _sounds w = soundMultiFrom sos sType time fadeTime w
|
||||
| otherwise = over sounds (M.insert so sound) w
|
||||
where sound = Sound { _soundType = sType
|
||||
where sound = Sound { _soundChunkID = sType
|
||||
, _soundTime = Nothing
|
||||
, _soundFadeTime = fadeTime
|
||||
, _soundChannel = Nothing
|
||||
|
||||
Reference in New Issue
Block a user