summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-07-31 02:50:26 -0400
committerJoe Crayne <joe@jerkface.net>2019-07-31 02:50:57 -0400
commit85fb0dd752a8911e8fa14287ab9f8673fd6ffda4 (patch)
treec2215f76ff767834960de82b36988031406ab5bd
parenta57a6b55532587a4d8ecc93bea21e5c85a986c1f (diff)
Always include null material.
-rw-r--r--MtlParser.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/MtlParser.hs b/MtlParser.hs
index a59c0eb..488ec4e 100644
--- a/MtlParser.hs
+++ b/MtlParser.hs
@@ -71,7 +71,9 @@ parseLine s = case words $ takeWhile (/='#') s of
71 _ -> return () 71 _ -> return ()
72 72
73parseMtl :: String -> MtlLib 73parseMtl :: String -> MtlLib
74parseMtl src = Map.fromList [(mtl_Name m,m) | m <- evalState (execWriterT (mapM_ parseLine (lines src) >> addMaterial)) Nothing] 74parseMtl src =
75 Map.insert mempty (newMaterial mempty)
76 $ Map.fromList [(mtl_Name m,m) | m <- evalState (execWriterT (mapM_ parseLine (lines src) >> addMaterial)) Nothing]
75 77
76readMtl :: String -> IO MtlLib 78readMtl :: String -> IO MtlLib
77readMtl fname = parseMtl <$> readFile fname 79readMtl fname = parseMtl <$> readFile fname