summaryrefslogtreecommitdiff
path: root/LoadMesh.hs
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-07-31 11:24:27 -0400
committerJoe Crayne <joe@jerkface.net>2020-01-13 23:59:35 -0500
commit7cad9f6b02e2f71803047235622b9157ff988e75 (patch)
tree36c31805b96ebdc7dd915fc4ce50cfa33f3e5118 /LoadMesh.hs
parent85fb0dd752a8911e8fa14287ab9f8673fd6ffda4 (diff)
faster file loading.
Diffstat (limited to 'LoadMesh.hs')
-rw-r--r--LoadMesh.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/LoadMesh.hs b/LoadMesh.hs
index 423630f..32e4f84 100644
--- a/LoadMesh.hs
+++ b/LoadMesh.hs
@@ -5,6 +5,7 @@
5{-# LANGUAGE TupleSections #-} 5{-# LANGUAGE TupleSections #-}
6module LoadMesh where 6module LoadMesh where
7 7
8import ByteStringUtil
8import LambdaCube.GL as LC -- renderer 9import LambdaCube.GL as LC -- renderer
9import LambdaCube.GL.Mesh as LambdaCubeGL 10import LambdaCube.GL.Mesh as LambdaCubeGL
10import LambdaCube.GL.Type as LC 11import LambdaCube.GL.Type as LC
@@ -54,7 +55,7 @@ relativeFrom path file | isAbsolute file = file
54relativeFrom path file = takeDirectory path </> file 55relativeFrom path file = takeDirectory path </> file
55 56
56loadOBJ :: String -> IO (Either String MeshData) 57loadOBJ :: String -> IO (Either String MeshData)
57loadOBJ fname = L.readFile fname >>= \bs -> do 58loadOBJ fname = readBigFile fname >>= \bs -> do
58 let obj@OBJ{..} = Wavefront.parse bs 59 let obj@OBJ{..} = Wavefront.parse bs
59 -- load materials 60 -- load materials
60 mtlLib <- if V.null objMtlLibs 61 mtlLib <- if V.null objMtlLibs