fix draw ordering
This commit is contained in:
parent
bfeb8a6fde
commit
5b911ab3ec
1 changed files with 16 additions and 5 deletions
21
src/Test.hs
21
src/Test.hs
|
@ -238,16 +238,27 @@ drawTile ud ctx posanims pr pc row col img =
|
||||||
((realToFrac x :: Double) < 1280 &&
|
((realToFrac x :: Double) < 1280 &&
|
||||||
(realToFrac (y - (74 - (realToFrac tileHeight :: CFloat))) :: Double) < 720)) $
|
(realToFrac (y - (74 - (realToFrac tileHeight :: CFloat))) :: Double) < 720)) $
|
||||||
do
|
do
|
||||||
let (lt, ge) = L.partition delimiter sorted
|
let (bef, beh) = L.partition delimiter posanims
|
||||||
save ctx
|
save ctx
|
||||||
mapM_ drawAnim lt
|
mapM_ drawAnim beh
|
||||||
when (isJust img) drawImage
|
when (isJust img) drawImage
|
||||||
mapM_ drawAnim ge
|
mapM_ drawAnim bef
|
||||||
restore ctx
|
restore ctx
|
||||||
where
|
where
|
||||||
delimiter (V2 nr nc, _) =
|
delimiter (V2 nr nc, _) =
|
||||||
any (\m -> nr < fromIntegral (floor nr :: Int) + m) maxrs &&
|
all delimit mb
|
||||||
any (\m -> nc > fromIntegral (floor nc :: Int) + m) mincs
|
where
|
||||||
|
delimit b
|
||||||
|
| nnr > fst (matmin b) && nnr < fst (matmax b) =
|
||||||
|
nnc < snd (matmin b)
|
||||||
|
| nnc > snd (matmin b) && nnc < snd (matmax b) =
|
||||||
|
nnr > fst (matmax b)
|
||||||
|
| otherwise =
|
||||||
|
True
|
||||||
|
nnr = nr - fromIntegral (floor nr)
|
||||||
|
nnc = nc - fromIntegral (floor nc)
|
||||||
|
-- any (\m -> nr < fromIntegral (floor nr :: Int) + m) maxrs &&
|
||||||
|
-- any (\m -> nc > fromIntegral (floor nc :: Int) + m) mincs
|
||||||
ai = assetImages ud
|
ai = assetImages ud
|
||||||
anims = assetAnimations ud
|
anims = assetAnimations ud
|
||||||
tileWidth = 64 :: Double
|
tileWidth = 64 :: Double
|
||||||
|
|
Loading…
Reference in a new issue