diff --git a/src/NPC.hs b/src/NPC.hs index 87fc3d2..5fd63f0 100644 --- a/src/NPC.hs +++ b/src/NPC.hs @@ -25,15 +25,15 @@ import Types.ReachPoint drawNPCs :: Context + -> UserData -> [V2 Double] -> Double -> Double -> Int -> Int -> Maybe ImgId - -> Affection UserData () -drawNPCs ctx npcposs prow pcol row col img = do - ud <- getAffection + -> IO () +drawNPCs ctx ud npcposs prow pcol row col img = do let fnpcposs = filter (\(V2 nr nc) -> let x = realToFrac $ 640 + ((nc - pcol) + (nr - prow)) * 32 @@ -47,7 +47,7 @@ drawNPCs ctx npcposs prow pcol row col img = do (floor nr == row && floor nc == col) ) npcposs - liftIO $ mapM_ + mapM_ (\(V2 nr nc) -> do let x = realToFrac $ 640 + ((nc - pcol) + (nr - prow)) * 32 y = realToFrac $ 360 + ((nr - prow) - (nc - pcol)) * 16 diff --git a/src/Test.hs b/src/Test.hs index 0ac4620..48cd435 100644 --- a/src/Test.hs +++ b/src/Test.hs @@ -161,15 +161,15 @@ drawMap = do closePath ctx fillColor ctx (rgb 255 255 255) fill ctx - mapM_ (\(i, ls) -> mapM_ - (\(j, t) -> do - liftIO $ drawTile - (assetImages ud) ctx pr pc i j t - drawNPCs ctx npcposs pr pc i j t - ) - (reverse $ zip [1..] ls)) - (zip [1..] (toLists mat)) - liftIO $ do -- draw FPS + mapM_ (\(i, ls) -> mapM_ + (\(j, t) -> do + drawTile + (assetImages ud) ctx pr pc i j t + drawNPCs ctx ud npcposs pr pc i j t + ) + (reverse $ zip [1..] ls)) + (zip [1..] (toLists mat)) + -- liftIO $ do -- draw FPS fontSize ctx 20 fontFace ctx (assetFonts ud Map.! FontBedstead) textAlign ctx (S.fromList [AlignCenter,AlignTop])