Pause and resume sounds when pausing game

This commit is contained in:
2025-06-02 12:43:37 +01:00
parent 6706ac494a
commit 1851dcc5d6
8 changed files with 74 additions and 63 deletions
+12 -6
View File
@@ -27,23 +27,29 @@ import Control.Lens
import Data.Int (Int16)
import qualified Data.Map as M
import Data.Maybe
import Dodge.Data.World
import Dodge.Data.Universe
import Dodge.SoundLogic.LoadSound
import Geometry.Data
import Geometry.Vector
import Sound.Data
import SDL.Mixer as Mix
-- | Placeholder...
haltSound :: World -> World
haltSound w = w
haltSound = id
-- | Placeholder...
pauseSound :: World -> World
pauseSound w = w
pauseSound :: Universe -> Universe
pauseSound = uvIOEffects %~ \f u -> do
Mix.pause (-1)
f u
-- | Placeholder...
resumeSound :: World -> World
resumeSound w = w
resumeSound :: Universe -> Universe
resumeSound = uvIOEffects %~ \f u -> do
Mix.resume (-1)
f u
soundWithStatusVolume ::
-- | Volume factor, 0 - 1