rebase keyconfig changes
This commit is contained in:
+7
-3
@@ -36,17 +36,20 @@ import qualified SDL
|
||||
import qualified SDL.Mixer as Mix
|
||||
import Graphics.Rendering.OpenGL hiding (color,scale,translate,rotate)
|
||||
|
||||
import LoadConfig
|
||||
|
||||
cursorVis :: Bool -> IO ()
|
||||
cursorVis b = SDL.cursorVisible $= b
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
(sizex,sizey) <- loadConfig
|
||||
keyConfig <- loadKeyConfig
|
||||
setupLoop
|
||||
(sizex,sizey)
|
||||
(cursorVis False >> doPreload >>= resizeSpareFBO sizex sizey)
|
||||
(\x -> cursorVis True >> cleanUpPreload x)
|
||||
(fmap (setWindowSize sizex sizey) firstWorld)
|
||||
(fmap (setWindowSize sizex sizey keyConfig) firstWorld)
|
||||
( \preData w -> do
|
||||
startTicks <- SDL.ticks
|
||||
clear [ColorBuffer,DepthBuffer]
|
||||
@@ -82,6 +85,7 @@ checkForGlErrors = do
|
||||
errs <- errors
|
||||
when (length errs > 0) $ putStrLn $ "GLerror during doLoop: " ++ unwords (map show errs)
|
||||
|
||||
setWindowSize :: Int -> Int -> World -> World
|
||||
setWindowSize x y w = w & windowX .~ fromIntegral x
|
||||
setWindowSize :: Int -> Int -> KeyConfigSDL-> World -> World
|
||||
setWindowSize x y z w = w & windowX .~ fromIntegral x
|
||||
& windowY .~ fromIntegral y
|
||||
& keyConfig .~ z
|
||||
|
||||
Reference in New Issue
Block a user