diff options
author | Joe Crayne <joe@jerkface.net> | 2019-07-31 11:24:27 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2020-01-13 23:59:35 -0500 |
commit | 7cad9f6b02e2f71803047235622b9157ff988e75 (patch) | |
tree | 36c31805b96ebdc7dd915fc4ce50cfa33f3e5118 /CubeMap.hs | |
parent | 85fb0dd752a8911e8fa14287ab9f8673fd6ffda4 (diff) |
faster file loading.
Diffstat (limited to 'CubeMap.hs')
-rw-r--r-- | CubeMap.hs | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -4,6 +4,7 @@ module CubeMap | |||
4 | , cubeMesh | 4 | , cubeMesh |
5 | ) where | 5 | ) where |
6 | 6 | ||
7 | import ByteStringUtil | ||
7 | import LambdaCube.GL as LC | 8 | import LambdaCube.GL as LC |
8 | import LambdaCube.GL.Data (uploadCubeMapToGPU) | 9 | import LambdaCube.GL.Data (uploadCubeMapToGPU) |
9 | import LambdaCube.GL.Mesh as LC | 10 | import LambdaCube.GL.Mesh as LC |
@@ -70,7 +71,7 @@ loadSkyboxes = do | |||
70 | , skyboxLoad = \n -> do | 71 | , skyboxLoad = \n -> do |
71 | let fn = zips !! mod n len | 72 | let fn = zips !! mod n len |
72 | putStrLn $ "Loading skybox " ++ show n ++ ": " ++ fn ++ "..." | 73 | putStrLn $ "Loading skybox " ++ show n ++ ": " ++ fn ++ "..." |
73 | archive <- toArchive <$> Lazy.readFile (dir </> fn) | 74 | archive <- toArchive <$> readBigFile (dir </> fn) |
74 | let es = mapMaybe (`findEntryByPath` archive) $ filterImageNames (filesInArchive archive) | 75 | let es = mapMaybe (`findEntryByPath` archive) $ filterImageNames (filesInArchive archive) |
75 | imgs <- fmap sequence $ forM es $ \entry -> do | 76 | imgs <- fmap sequence $ forM es $ \entry -> do |
76 | return $ Juicy.decodeImage $ Lazy.toStrict $ fromEntry entry | 77 | return $ Juicy.decodeImage $ Lazy.toStrict $ fromEntry entry |