Implement custom poking for vertices--speed regression?
This commit is contained in:
@@ -214,17 +214,6 @@ wallsAndWindows w
|
||||
wallsToList :: [((Point2,Point2),Point4)] -> [Float]
|
||||
wallsToList = concatMap (\(((a,b),(c,d)),(e,f,g,h)) -> [a,b,c,d,e,f,g,h])
|
||||
|
||||
pokePoint3s :: Ptr Float -> [Point3] -> IO Int
|
||||
pokePoint3s ptr vals0 = go vals0 0
|
||||
where
|
||||
go [] n = return n
|
||||
go ( (a,b,c):vals) n = do
|
||||
pokeElemOff ptr (off 0) a
|
||||
pokeElemOff ptr (off 1) b
|
||||
pokeElemOff ptr (off 2) c
|
||||
go vals (n+1)
|
||||
where
|
||||
off i = n*3 + i
|
||||
|
||||
pokeWalls :: Ptr Float -> [((Point2,Point2),Point4)] -> IO Int
|
||||
pokeWalls ptr vals0 = go vals0 0
|
||||
|
||||
Reference in New Issue
Block a user