Add frame clock
This commit is contained in:
+9
-5
@@ -53,7 +53,8 @@ soundMenuOptions =
|
||||
where
|
||||
dec x = max 0 (x - 0.1)
|
||||
inc x = min 1 (x + 0.1)
|
||||
sw w = w & sideEffects %~ (setVol (_config w) : )
|
||||
--sw w = w & sideEffects %~ (setVol (_config w) : )
|
||||
sw w = w & sideEffects %~ setVol' (_config w)
|
||||
master g = Just . (config . volume_master %~ g)
|
||||
soundEffs g = Just . (config . volume_sound %~ g)
|
||||
music g = Just . (config . volume_music %~ g)
|
||||
@@ -70,7 +71,7 @@ popScreen :: World -> Maybe World
|
||||
popScreen = Just . (menuLayers %~ tail)
|
||||
|
||||
writeConfig :: World -> World
|
||||
writeConfig w = w & sideEffects %~ (saveConfig (_config w) :)
|
||||
writeConfig w = w & sideEffects %~ saveConfig (_config w)
|
||||
|
||||
graphicsMenu :: ScreenLayer
|
||||
graphicsMenu = OptionScreen
|
||||
@@ -138,12 +139,15 @@ charToScode :: Char -> Scancode
|
||||
charToScode = Scancode . fromIntegral . (\x -> x - 61) . fromEnum
|
||||
|
||||
updateFramebufferSize :: World -> World
|
||||
updateFramebufferSize w = w & sideEffects
|
||||
%~ (pdataResizeUpdate (x `div` divRes) (y `div` divRes) x y : )
|
||||
updateFramebufferSize w = w & sideEffects %~ up
|
||||
where
|
||||
(x,y) = (round $ getWindowX w, round $ getWindowY w)
|
||||
divRes = w ^. config . resolution_factor
|
||||
|
||||
up :: (World -> IO World) -> World -> IO World
|
||||
up f w' = do
|
||||
pdata <- pdataResizeUpdate (x `div` divRes) (y `div` divRes) x y (_preloadData w')
|
||||
f $ w' & preloadData .~ pdata
|
||||
|
||||
levelMenu :: Int -> ScreenLayer
|
||||
levelMenu x = OptionScreen
|
||||
{ _scTitle = const $ "LEVEL "++ show x
|
||||
|
||||
Reference in New Issue
Block a user