Move debug flags to config, various perf improvements
This commit is contained in:
@@ -48,7 +48,7 @@ soundWithStatus
|
||||
-> Maybe Int -- ^ Frames to play sound for, Nothing for until finished
|
||||
-> World
|
||||
-> World
|
||||
soundWithStatus status so pos sType mtime w = over sounds (M.insertWith f so sound) w
|
||||
soundWithStatus status so pos sType mtime w = over toPlaySounds (M.insertWith f so sound) w
|
||||
where
|
||||
sound = Sound
|
||||
{ _soundChunkID = sType
|
||||
@@ -86,7 +86,7 @@ soundFromGeneral
|
||||
-> Maybe Int -- ^ Frames to play sound for, Nothing for until finished
|
||||
-> World
|
||||
-> World
|
||||
soundFromGeneral so fpos sType mtime w = over sounds (M.insertWith f so sound) w
|
||||
soundFromGeneral so fpos sType mtime w = over toPlaySounds (M.insertWith f so sound) w
|
||||
where
|
||||
sound = Sound
|
||||
{ _soundChunkID = sType
|
||||
@@ -126,7 +126,7 @@ soundMultiFrom
|
||||
-> World
|
||||
soundMultiFrom [] _ _ _ w = w
|
||||
soundMultiFrom [so] pos sType mtime w
|
||||
= over sounds (M.insert so sound) w
|
||||
= over toPlaySounds (M.insert so sound) w
|
||||
where
|
||||
sound = Sound
|
||||
{ _soundChunkID = sType
|
||||
@@ -140,7 +140,7 @@ soundMultiFrom [so] pos sType mtime w
|
||||
a = soundAngle pos w
|
||||
soundMultiFrom (so:sos) pos sType mtime w
|
||||
| so `M.member` _playingSounds w = soundMultiFrom sos pos sType mtime w
|
||||
| otherwise = over sounds (M.insert so sound) w
|
||||
| otherwise = over toPlaySounds (M.insert so sound) w
|
||||
where
|
||||
sound = Sound
|
||||
{ _soundChunkID = sType
|
||||
@@ -154,5 +154,5 @@ soundMultiFrom (so:sos) pos sType mtime w
|
||||
a = soundAngle pos w
|
||||
{- | Sets '_soundTime' to 0. -}
|
||||
stopSoundFrom :: SoundOrigin -> World -> World
|
||||
stopSoundFrom so = over (sounds . ix so . soundTime) (fmap $ min 0)
|
||||
stopSoundFrom so = over (playingSounds . ix so . soundTime) (fmap $ min 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user