Commit before looking into pathfinding

This commit is contained in:
2022-06-25 18:57:50 +01:00
parent dc78561c20
commit c56e53d33f
+6 -8
View File
@@ -89,12 +89,12 @@ pokeShape
-> IO ()
pokeShape ptr iptr ieptr counts = VS.mapM_ (pokeShapeObj ptr iptr ieptr counts) . VS.fromList
pokeShapeObj
pokeShapeObj
:: Ptr Float
-> Ptr GLushort
-> Ptr GLushort
-> UMV.MVector (PrimState IO) Int
-> ShapeObj
-> ShapeObj
-> IO ()
pokeShapeObj ptr iptr ieptr counts (ShapeObj shType shVerts) = case shType of
TopPrism size -> pokeTopPrism (size - 2) ptr iptr ieptr counts shVerts
@@ -130,14 +130,12 @@ pokeTopPrismIndex nv iptr counts ioff = do
UMV.unsafeModify counts (+1) 1
memoTopPrismEdgeIndices :: V.Vector (UV.Vector Int)
memoTopPrismEdgeIndices = V.generate 10 f
where
f n = UV.fromList $ topPrismEdgeIndices (n + 2)
memoTopPrismEdgeIndices = V.generate 10
$ UV.fromList . topPrismEdgeIndices . (+ 2)
memoTopPrismIndices :: V.Vector (UV.Vector Int)
memoTopPrismIndices = V.generate 10 f
where
f n = UV.fromList $ topPrismIndices (n + 2)
memoTopPrismIndices = V.generate 10
$ UV.fromList . topPrismIndices . (+ 2)
topPrismEdgeIndices :: Int -> [Int]
topPrismEdgeIndices n = concatMap f [0..n-1]