hunting warnings

This commit is contained in:
nek0 2019-03-28 20:59:31 +01:00
parent daac9470e5
commit 9cdec48044
3 changed files with 12 additions and 13 deletions

View file

@ -22,7 +22,6 @@ import NanoVG hiding (V2(..))
import Menu.Connect
import Types
import MainGame.WorldMap
import Util
loadLoad :: Affection UserData ()

View file

@ -46,7 +46,7 @@ loadMap :: Affection UserData ()
loadMap = do
ud <- getAffection
ad <- get
let (Subsystems _ m k j t) = subsystems ud
let (Subsystems _ _ k j t) = subsystems ud
uu0 <- partSubscribe k emitKbdActionMessage
uu1 <- partSubscribe j emitJoyActionMessage
uu2 <- partSubscribe t movePlayer2
@ -285,8 +285,8 @@ loadMapFork ud ad future progress = do
, V2 0 (-1)
]
wall = Prelude.filter
(\delta ->
let V2 r c = door + delta
(\ddelta ->
let V2 r c = door + ddelta
in
fromMaybe False (isWall <$> imgmat M.! (r, c)))
deltas
@ -421,7 +421,6 @@ movePlayer2 (ActionMessage mov _) = do
putAffection ud
{ worldState = nws
}
movePlayer2 _ = return ()
playerInteract2 :: ActionMessage -> Affection UserData ()
playerInteract2 (ActionMessage ActActivate _) = do
@ -476,7 +475,7 @@ drawMap = do
efor allEnts $ do
with pos
pos' <- query pos
player <- queryMaybe player
player' <- queryMaybe player
stat <- queryMaybe anim
mbnds <- queryMaybe obstacle
t <- queryMaybe objType
@ -484,7 +483,7 @@ drawMap = do
pa <- queryMaybe objPlayerActivated
ttl <- queryMaybe objStateTime
let maxt = fromMaybe 1 (actionTime <$> t <*> s)
first = if isJust player
first = if isJust player'
then Just
pos'
else Nothing
@ -571,7 +570,7 @@ drawMap = do
)
(zip [1..] (toLists mat))
filterList = Prelude.filter
(\((frow, fcol), tile) ->
(\((frow, fcol), _) ->
((realToFrac (sx frow fcol) > -tileWidth &&
realToFrac (sy frow fcol) > -tileHeight) &&
((realToFrac (sx frow fcol) :: Double) < 1280 &&
@ -585,8 +584,8 @@ drawMap = do
(fromIntegral row - pr)) * (tileWidth / 2) :: CFloat
sy row col = realToFrac $ 360 - (tileHeight / 2) + ((fromIntegral row - pr) -
(fromIntegral col - pc)) * (tileHeight / 2) :: CFloat
-- void $ sequence $ parMap rpar
mapM_
void $ sequence $ parMap rpar
-- mapM_
(\((row, col), tile, posanim) ->
drawTile ud ctx posanim pr pc row col tile
)
@ -673,7 +672,8 @@ drawTile ud ctx posanims pr pc row col img =
tileWidth = 64 :: Double
tileHeight = 32 :: Double
sorted = sortOn (\(V2 sr sc, _, mbnds) ->
let comp srow scol = (floor $ (1 - scol) * 100) + (floor $ srow * 100)
let comp srow scol =
((floor $ (1 - scol) * 100) :: Int) + ((floor $ srow * 100) :: Int)
in
case mbnds of
Just (Boundaries (minr, minc) (maxr, maxc)) ->
@ -839,7 +839,7 @@ updateMap dt = do
{ aiDirection = fromMaybe rot' (direction velo)
}
}
x -> nstat
_ -> nstat
ent = unchanged
{ pos = Set $ pos' + colldpos
, rot = Set $ fromMaybe rot' (direction (fromMaybe (V2 0 0) vel'))

View file

@ -16,7 +16,7 @@ import Util
instance StateMachine State UserData where
smLoad Load = loadLoad
smLoad (Menu Connect) = loadMenu
-- smLoad (Menu (Adjust _)) = loadAdjust
smLoad (Menu (Adjust a c)) = loadAdjust a c loadMenu
smLoad (Main _) = loadMap
smUpdate Load = updateLoad