diff options
author | Joe Crayne <joe@jerkface.net> | 2019-05-02 18:31:03 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-05-02 18:31:03 -0400 |
commit | d78081b4c9486a7b1ef4211a175bf4f32e66d1f8 (patch) | |
tree | 7f85342823083e1a7438765178b163dbf6a9edd7 /CubeMap.hs | |
parent | 44ec6fa45b71d95650d05ea4e16550698ca7fb93 (diff) |
Cope with missing skybox.
Diffstat (limited to 'CubeMap.hs')
-rw-r--r-- | CubeMap.hs | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -18,6 +18,8 @@ import Data.Maybe | |||
18 | import qualified Data.Vector as V | 18 | import qualified Data.Vector as V |
19 | import System.Directory | 19 | import System.Directory |
20 | import System.FilePath | 20 | import System.FilePath |
21 | import System.IO | ||
22 | import System.IO.Error | ||
21 | 23 | ||
22 | image_names_xyz_dir :: [String] | 24 | image_names_xyz_dir :: [String] |
23 | image_names_xyz_dir = | 25 | image_names_xyz_dir = |
@@ -72,6 +74,18 @@ loadSkyboxes = do | |||
72 | return $ Juicy.decodeImage $ Lazy.toStrict $ fromEntry entry | 74 | return $ Juicy.decodeImage $ Lazy.toStrict $ fromEntry entry |
73 | return $ sequence imgs | 75 | return $ sequence imgs |
74 | } | 76 | } |
77 | `catchIOError` \e -> do | ||
78 | hPutStrLn stderr $ unlines | ||
79 | [ "Unable to load skybox." | ||
80 | , "Download a .zip archive from http://www.humus.name/index.php?page=Textures&start=0" | ||
81 | , "and save it into the ./skyboxes directory." | ||
82 | ] | ||
83 | return Skyboxes | ||
84 | { skyboxCount = 1 | ||
85 | , skyboxNames = ["(null)"] | ||
86 | , skyboxLoad = \_ -> do | ||
87 | return $ Left (show e) | ||
88 | } | ||
75 | 89 | ||
76 | cubeMesh :: Mesh | 90 | cubeMesh :: Mesh |
77 | cubeMesh = Mesh | 91 | cubeMesh = Mesh |