From b3323ef0541b4a744418a5ded1cc1eff522f93e0 Mon Sep 17 00:00:00 2001 From: Stefan Dresselhaus Date: Fri, 30 May 2014 15:26:12 +0200 Subject: [PATCH] live-Coding --- src/Main.hs | 3 +++ src/Types.hs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/Main.hs b/src/Main.hs index f4d401c..3d4f3a6 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -18,6 +18,7 @@ import Control.Concurrent.STM.TVar (newTVarIO, writeTVar, rea import Control.Monad.RWS.Strict (ask, evalRWST, get, liftIO, modify) import Data.Functor ((<$>)) import Data.Monoid (mappend) +import qualified Data.HashMap.Strict as Map -- FFI import Foreign.Marshal.Array (pokeArray) @@ -110,6 +111,7 @@ main = game' <- newTVarIO GameState { _currentMap = curMap } + camStack' <- newTVarIO Map.empty glHud' <- initHud let zDistClosest' = 2 zDistFarthest' = zDistClosest' + 10 @@ -138,6 +140,7 @@ main = , _tessClockFactor = 0 } , _camera = cam' + , _camStack = camStack' , _mouse = MouseState { _isDown = False , _isDragging = False diff --git a/src/Types.hs b/src/Types.hs index d29b848..53b1175 100644 --- a/src/Types.hs +++ b/src/Types.hs @@ -180,6 +180,7 @@ data UIState = UIState data State = State { _window :: !WindowState , _camera :: TVar CameraState + , _camStack :: TVar (Map.HashMap UIId (CameraState, TextureObject)) , _io :: !IOState , _mouse :: !MouseState , _keyboard :: !KeyboardState @@ -188,6 +189,7 @@ data State = State , _ui :: !UIState } + type Pioneers = RWST Env () State IO -- when using TemplateHaskell order of declaration matters