Mid strictifying

This commit is contained in:
2021-07-29 23:42:27 +02:00
parent 67aa5c05c7
commit bd8ef3f416
22 changed files with 359 additions and 325 deletions
+8 -6
View File
@@ -10,8 +10,11 @@ tToRender t = map Render3x3 $ polyToTris $ zip ps3 coords3
where
ps = _tilePoly t
coords = map (calcTexCoord (_tileCenter t) (_tileX t) (_tileY t)) ps
ps3 = map (mkTrip 0) ps
coords3 = map (mkTrip (_tileZ t)) coords
ps3 = map (addToV2 0) ps
coords3 = map (addToV2 (_tileZ t)) coords
addToV2 :: a -> V2 a -> V3 a
addToV2 z (V2 x y) = V3 x y z
mkTrip :: c -> (a,b) -> (a,b,c)
mkTrip z (x,y) = (x,y,z)
@@ -22,10 +25,9 @@ calcTexCoord
-> Point2 -- ^ tile (0,1)
-> Point2 -- ^ world point
-> Point2
calcTexCoord cen x' y' p =
( magV (projV (p -.- cen) x) / magV x
, magV (projV (p -.- cen) y) / magV y
)
calcTexCoord cen x' y' p = V2
( magV (projV (p -.- cen) x) / magV x )
( magV (projV (p -.- cen) y) / magV y )
where
x = x' -.- cen
y = y' -.- cen