Try to move sound into world, slightly broken now
This commit is contained in:
@@ -14,7 +14,7 @@ import Data.Aeson (encodeFile)
|
||||
{- |
|
||||
Write the current world configuration to disk as a json file.
|
||||
-}
|
||||
saveConfig :: Configuration -> PreloadData SoundOrigin -> IO (PreloadData SoundOrigin)
|
||||
saveConfig :: Configuration -> PreloadData -> IO PreloadData
|
||||
saveConfig cfig d = do
|
||||
putStrLn "Saving config to data/dodge.config.json"
|
||||
encodeFile "data/dodge.config.json" cfig
|
||||
@@ -23,7 +23,7 @@ saveConfig cfig d = do
|
||||
{- |
|
||||
Apply the volume settings from the world configuration to the running game.
|
||||
-}
|
||||
setVol :: Configuration -> PreloadData SoundOrigin -> IO (PreloadData SoundOrigin)
|
||||
setVol :: Configuration -> PreloadData -> IO PreloadData
|
||||
setVol cfig d = do
|
||||
setSoundVolume ( _volume_master cfig * _volume_sound cfig)
|
||||
setMusicVolume ( _volume_master cfig * _volume_music cfig)
|
||||
@@ -34,8 +34,8 @@ Apply /all/ of the values in the world configuration to the running game.
|
||||
-}
|
||||
applyWorldConfig
|
||||
:: Configuration
|
||||
-> PreloadData SoundOrigin
|
||||
-> IO (PreloadData SoundOrigin)
|
||||
-> PreloadData
|
||||
-> IO PreloadData
|
||||
applyWorldConfig cfig pdata = do
|
||||
setVol cfig pdata >>= pdataResizeUpdate (x `div` divRes) (y `div` divRes) x y
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user