summaryrefslogtreecommitdiff
path: root/CubeMap.hs
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-05-02 18:31:03 -0400
committerJoe Crayne <joe@jerkface.net>2019-05-02 18:31:03 -0400
commitd78081b4c9486a7b1ef4211a175bf4f32e66d1f8 (patch)
tree7f85342823083e1a7438765178b163dbf6a9edd7 /CubeMap.hs
parent44ec6fa45b71d95650d05ea4e16550698ca7fb93 (diff)
Cope with missing skybox.
Diffstat (limited to 'CubeMap.hs')
-rw-r--r--CubeMap.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/CubeMap.hs b/CubeMap.hs
index 10ba9e0..cfa6b0d 100644
--- a/CubeMap.hs
+++ b/CubeMap.hs
@@ -18,6 +18,8 @@ import Data.Maybe
18import qualified Data.Vector as V 18import qualified Data.Vector as V
19import System.Directory 19import System.Directory
20import System.FilePath 20import System.FilePath
21import System.IO
22import System.IO.Error
21 23
22image_names_xyz_dir :: [String] 24image_names_xyz_dir :: [String]
23image_names_xyz_dir = 25image_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
76cubeMesh :: Mesh 90cubeMesh :: Mesh
77cubeMesh = Mesh 91cubeMesh = Mesh