live-Coding
This commit is contained in:
parent
91ad0f5e38
commit
b3323ef054
@ -18,6 +18,7 @@ import Control.Concurrent.STM.TVar (newTVarIO, writeTVar, rea
|
|||||||
import Control.Monad.RWS.Strict (ask, evalRWST, get, liftIO, modify)
|
import Control.Monad.RWS.Strict (ask, evalRWST, get, liftIO, modify)
|
||||||
import Data.Functor ((<$>))
|
import Data.Functor ((<$>))
|
||||||
import Data.Monoid (mappend)
|
import Data.Monoid (mappend)
|
||||||
|
import qualified Data.HashMap.Strict as Map
|
||||||
|
|
||||||
-- FFI
|
-- FFI
|
||||||
import Foreign.Marshal.Array (pokeArray)
|
import Foreign.Marshal.Array (pokeArray)
|
||||||
@ -110,6 +111,7 @@ main =
|
|||||||
game' <- newTVarIO GameState
|
game' <- newTVarIO GameState
|
||||||
{ _currentMap = curMap
|
{ _currentMap = curMap
|
||||||
}
|
}
|
||||||
|
camStack' <- newTVarIO Map.empty
|
||||||
glHud' <- initHud
|
glHud' <- initHud
|
||||||
let zDistClosest' = 2
|
let zDistClosest' = 2
|
||||||
zDistFarthest' = zDistClosest' + 10
|
zDistFarthest' = zDistClosest' + 10
|
||||||
@ -138,6 +140,7 @@ main =
|
|||||||
, _tessClockFactor = 0
|
, _tessClockFactor = 0
|
||||||
}
|
}
|
||||||
, _camera = cam'
|
, _camera = cam'
|
||||||
|
, _camStack = camStack'
|
||||||
, _mouse = MouseState
|
, _mouse = MouseState
|
||||||
{ _isDown = False
|
{ _isDown = False
|
||||||
, _isDragging = False
|
, _isDragging = False
|
||||||
|
@ -180,6 +180,7 @@ data UIState = UIState
|
|||||||
data State = State
|
data State = State
|
||||||
{ _window :: !WindowState
|
{ _window :: !WindowState
|
||||||
, _camera :: TVar CameraState
|
, _camera :: TVar CameraState
|
||||||
|
, _camStack :: TVar (Map.HashMap UIId (CameraState, TextureObject))
|
||||||
, _io :: !IOState
|
, _io :: !IOState
|
||||||
, _mouse :: !MouseState
|
, _mouse :: !MouseState
|
||||||
, _keyboard :: !KeyboardState
|
, _keyboard :: !KeyboardState
|
||||||
@ -188,6 +189,7 @@ data State = State
|
|||||||
, _ui :: !UIState
|
, _ui :: !UIState
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type Pioneers = RWST Env () State IO
|
type Pioneers = RWST Env () State IO
|
||||||
|
|
||||||
-- when using TemplateHaskell order of declaration matters
|
-- when using TemplateHaskell order of declaration matters
|
||||||
|
Loading…
Reference in New Issue
Block a user