This commit is contained in:
nek0 2018-07-30 15:34:45 +02:00
parent afca12ebc0
commit f025b92ef4
6 changed files with 30 additions and 6 deletions

View file

@ -59,7 +59,7 @@ loadFork
-> MVar (Float, T.Text)
-> IO ()
loadFork ws win glc nvg future progress = do
let stateSteps = 25
let stateSteps = 26
increment = 1 / stateSteps
SDL.glMakeCurrent win glc
modifyMVar_ progress (return . (\(p, _) ->
@ -147,6 +147,11 @@ loadFork ws win glc nvg future progress = do
, "Loading asset \"tableCorner\""
)))
mmisctableC <- createImage nvg (FileName "assets/misc/tableCorner.png") 0
modifyMVar_ progress (return . (\(p, _) ->
( p + increment
, "Loading asset \"flipchart\""
)))
mmiscFlipchart <- createImage nvg (FileName "assets/misc/flipchart.png") 0
modifyMVar_ progress (return . (\(p, _) ->
( p + increment
, "Loading Animation \"intruder: standing\""
@ -155,7 +160,8 @@ loadFork ws win glc nvg future progress = do
mwallcornern, mwallcornere, mwallcorners, mwallcornerw,
mwalltne, mwalltse, mwalltsw, mwalltnw, mwallcross,
mmiscbox1,
mmisctable1, mmisctable2, mmisctable3, mmisctable4, mmisctableC
mmisctable1, mmisctable2, mmisctable3, mmisctable4, mmisctableC,
mmiscFlipchart
]
when (any isNothing mimgs) $ do
liftIO $logIO Error "Failed to load image assets"
@ -180,6 +186,7 @@ loadFork ws win glc nvg future progress = do
, ImgMiscTable3
, ImgMiscTable4
, ImgMiscTableCorner
, ImgMiscFlipchart
]
mimgs
directions = [E .. N] ++ [NE]

View file

@ -370,10 +370,10 @@ drawTile ud ctx posanims pr pc row col img =
)
mapM_ drawAnim bef
restore ctx
when (floor pr == row && floor pc == col) $ do
A.logIO A.Debug ("sorted: " ++ show sorted)
A.logIO A.Debug ("beh: " ++ show beh)
A.logIO A.Debug ("bef: " ++ show bef)
-- when (floor pr == row && floor pc == col) $ do
-- A.logIO A.Debug ("sorted: " ++ show sorted)
-- A.logIO A.Debug ("beh: " ++ show beh)
-- A.logIO A.Debug ("bef: " ++ show bef)
where
delimiter (V2 nr nc, as, mbnds) =
animFloats (asId as) ||

View file

@ -24,3 +24,5 @@ instance ObjectAction UserData ObjType where
putAffection ud
{ worldState = nws
}
objectAction _ _ = return ()

View file

@ -76,6 +76,9 @@ instance Collidible ImgId where
[ Boundaries (0, 0) (0.63, 1)
, Boundaries (0, 0.34) (1, 1)
]
collisionObstacle ImgMiscFlipchart =
[ Boundaries (0, 7/36) (18/36, 28/36)
]
collisionObstacle ImgEmptyNoWalk =
[ Boundaries (0, 0) (1, 1) ]
collisionObstacle _ = []

View file

@ -22,6 +22,7 @@ data ImgId
| ImgMiscTable3
| ImgMiscTable4
| ImgMiscTableCorner
| ImgMiscFlipchart
-- | ImgIntrNE
-- | ImgIntrE
-- | ImgIntrSE
@ -39,4 +40,5 @@ isWall ImgMiscTable2 = False
isWall ImgMiscTable3 = False
isWall ImgMiscTable4 = False
isWall ImgMiscTableCorner = False
isWall ImgMiscFlipchart = False
isWall _ = True

View file

@ -20,6 +20,7 @@ data Cluster
| ClusterCornerTable
| ClusterTableGroup
| ClusterCopier
| ClusterFlipchart
deriving (Enum, Bounded)
clusterMat :: Cluster -> Matrix (Maybe ImgId)
@ -73,6 +74,11 @@ clusterMat ClusterCopier =
[ [ Just ImgEmptyNoWalk]
, [ Just ImgEmpty]
]
clusterMat ClusterFlipchart =
M.fromLists
[ [ Just ImgMiscFlipchart]
, [ Just ImgEmpty]
]
clusterRoom :: Cluster -> TileState
clusterRoom ClusterBox1 = Offi
@ -83,6 +89,7 @@ clusterRoom ClusterTable4 = Offi
clusterRoom ClusterCornerTable = Offi
clusterRoom ClusterTableGroup = Offi
clusterRoom ClusterCopier = Offi
clusterRoom ClusterFlipchart = Offi
clusterPoints :: Cluster -> [ReachPoint]
clusterPoints ClusterBox1 = []
@ -105,6 +112,9 @@ clusterPoints ClusterTableGroup =
clusterPoints ClusterCopier =
[ ReachPoint Copier (V2 2 1) NW
]
clusterPoints ClusterFlipchart =
[ ReachPoint Table (V2 2 1) NW
]
instance Size Cluster where
size c =