Partially working ellipse shader

This commit is contained in:
jgk
2021-03-10 03:29:10 +01:00
parent bfbd0b6fef
commit cddf7d1f8f
12 changed files with 229 additions and 172 deletions
+14
View File
@@ -21,6 +21,20 @@ import qualified Data.Set as S
-- }}}
--
leftPad :: Int -> a -> [a] -> [a]
leftPad i x xs = reverse $ take i $ reverse xs ++ repeat x
rightPad :: Int -> a -> [a] -> [a]
rightPad i x xs = take i $ xs ++ repeat x
midPad :: Int -> a -> [a] -> [a] -> [a]
midPad i x xs ys = xs ++ replicate j x ++ ys
where j = i - (length xs + length ys)
midPadL :: Int -> a -> [a] -> [a] -> [a]
midPadL i x xs ys = take j (xs ++ repeat x) ++ ys
where j = i - length ys
you :: World -> Creature
you w = _creatures w IM.! _yourID w