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 Menu.Connect
import Types import Types
import MainGame.WorldMap
import Util import Util
loadLoad :: Affection UserData () loadLoad :: Affection UserData ()

View File

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

View File

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