diff options
author | Joe Crayne <joe@jerkface.net> | 2019-07-31 02:50:26 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-07-31 02:50:57 -0400 |
commit | 85fb0dd752a8911e8fa14287ab9f8673fd6ffda4 (patch) | |
tree | c2215f76ff767834960de82b36988031406ab5bd | |
parent | a57a6b55532587a4d8ecc93bea21e5c85a986c1f (diff) |
Always include null material.
-rw-r--r-- | MtlParser.hs | 4 |
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 | ||
73 | parseMtl :: String -> MtlLib | 73 | parseMtl :: String -> MtlLib |
74 | parseMtl src = Map.fromList [(mtl_Name m,m) | m <- evalState (execWriterT (mapM_ parseLine (lines src) >> addMaterial)) Nothing] | 74 | parseMtl 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 | ||
76 | readMtl :: String -> IO MtlLib | 78 | readMtl :: String -> IO MtlLib |
77 | readMtl fname = parseMtl <$> readFile fname | 79 | readMtl fname = parseMtl <$> readFile fname |