packages feed

free-game 0.9.4.1 → 0.9.4.2

raw patch · 3 files changed

+15/−6 lines, 3 filesdep ~linear

Dependency ranges changed: linear

Files

Graphics/UI/FreeGame/GUI/GLFW.hs view
@@ -56,7 +56,7 @@     liftIO $ do
         GL.matrixMode $= GL.Projection
         GLFW.swapBuffers
-        performGC
+        -- performGC
         t <- GLFW.getTime
         n <- readIORef (refFrame given)
         GLFW.sleep $ fromIntegral n / fromIntegral (_framePerSecond $ theParameter given) - t
Graphics/UI/FreeGame/Util.hs view
@@ -42,6 +42,7 @@ import System.FilePath
 import System.IO.Unsafe
 import System.Random
+import System.Environment
 
 -- | An infinite loop that run 'tick' every frame after the given action.
 foreverTick :: MonadFree (UI n) m => m a -> m any
@@ -84,7 +85,7 @@ loadPictureFromFile = embedIO . fmap fromBitmap . loadBitmapFromFile
 
 -- | The type of the given 'Name' must be @String -> IO String@
-loadBitmapsWith :: Name -> FilePath -> Q [Dec]
+loadBitmapsWith :: ExpQ -> FilePath -> Q [Dec]
 loadBitmapsWith getFullPath path = do
     loc <- (</>path) <$> takeDirectory <$> loc_filename <$> location
     paths <- runIO $ getFileList loc
@@ -98,13 +99,21 @@     where
         load name fp = do
             runIO $ putStrLn $ "Defined: " ++ fp ++ " as `" ++ name ++ "'"
-            appE (varE 'unsafePerformIO) $ uInfixE (appE (varE getFullPath) (litE $ StringL fp))
+
+            appE (varE 'unsafePerformIO) $ uInfixE (appE getFullPath $ litE $ StringL fp)
                 (varE '(>>=))
                 (varE 'loadBitmapFromFile)
 
 -- | Load and define all pictures in the specified directory.
 loadBitmaps :: FilePath -> Q [Dec]
-loadBitmaps = loadBitmapsWith 'canonicalizePath
+loadBitmaps path = do
+    v <- newName "v"
+    loadBitmapsWith (lamE [varP v] $
+        appsE [varE 'fmap, uInfixE
+                    (infixE Nothing (varE '(</>)) (Just (varE v)))
+                    (varE '(.))
+                    (varE 'takeDirectory)
+                , varE 'getExecutablePath]) path
 
 getFileList :: FilePath -> IO [FilePath]
 getFileList path = do
free-game.cabal view
@@ -1,5 +1,5 @@ name:                free-game
-version:             0.9.4.1
+version:             0.9.4.2
 synopsis:            Cross-platform GUI library based on free monads
 description:         free-game is a library that abstracts graphical applications with simple interfaces. Twitter: #hs_free_game
 homepage:            https://github.com/fumieval/free-game/tree/maintainance0.9
@@ -53,7 +53,7 @@     transformers >= 0.3,
     void >= 0.5,
     template-haskell,
-    linear >= 1.1 && < 1.3,
+    linear >= 1.1 && < 1.4,
     vector == 0.10.*,
     JuicyPixels-repa >= 0.5.1,
     data-default,