fix more UserData stuff

This commit is contained in:
nek0 2020-05-05 01:23:40 +02:00
parent adf5eefcdc
commit 808ab1db06
2 changed files with 24 additions and 19 deletions

View file

@ -11,6 +11,7 @@ import Codec.Picture as CP
import Codec.Picture.Extra
import Control.Concurrent.STM
import Control.Concurrent.MVar
import Data.String
import qualified Data.Set as S
@ -36,21 +37,25 @@ init = do
<*> (SubTranslator <$> newTVarIO [])
_ <- glewInit
nvg <- createGL3 (S.fromList [NanoVG.Debug, Antialias, StencilStrokes])
return UserData
{ state = Load
, subsystems = subs
, assetImages = M.empty
, assetAnimations = M.empty
, assetFonts = M.empty
, assetIcons = M.empty
, nano = nvg
, uuid = []
, stateData = None
, threadContext = Nothing
, controls = NoController
, translation = NoTranslation
, joyCache = []
}
UserData
<$> newMVar Load
<*> pure subs
<*> newMVar M.empty
<*> newMVar M.empty
<*> newMVar M.empty
<*> newMVar M.empty
<*> newMVar NoController
<*> newMVar NoTranslation
<*> pure nvg
<*> newMVar []
<*> newEmptyMVar
<*> newMVar None
<*> newEmptyMVar
<*> newMVar (0, "foobar!")
<*> newMVar Nothing
<*> newMVar Nothing
<*> newMVar []
<*> newEmptyMVar
loadPlayerSprite
:: FilePath -- Path to spritemap

View file

@ -30,19 +30,19 @@ data UserData = UserData
, assetImages :: MVar (M.Map ImgId Image)
, assetFonts :: MVar (M.Map FontId T.Text)
, assetAnimations :: MVar (M.Map AnimId Animation)
, controls :: Controller
, controls :: MVar Controller
, translation :: MVar Translation
, nano :: Context
, uuid :: MVar [UUID]
, worldState :: SystemState Entity (AffectionState AffectionData IO)
, worldState :: MVar (SystemState Entity (AffectionState AffectionData IO))
, stateData :: MVar StateData
, stateMVar :: MVar
( SystemState Entity (AffectionState AffectionData IO)
, StateData
)
, stateProgress :: MVar (Float, T.Text)
, threadContext :: Maybe SDL.GLContext
, window :: Maybe SDL.Window
, threadContext :: MVar (Maybe SDL.GLContext)
, window :: MVar (Maybe SDL.Window)
, joyCache :: MVar [JoystickMessage]
, joyUUID :: MVar UUID
}