Skip to content

Commit

Permalink
Added graphical OpenGL mode
Browse files Browse the repository at this point in the history
  • Loading branch information
u-quark committed Jul 21, 2012
1 parent 7f48115 commit be4277f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ cabal-dev
*.chi
*.chs.h
*~
*.swp
5 changes: 4 additions & 1 deletion Game.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import System.Environment (getArgs)
import System.IO

import LLifter.PlayGame
import LLifter.OpenGL

main :: IO ()
main = hSetBuffering stdin NoBuffering >> getArgs >>= runGame . head
main = do
getArgs >>= (return . head) >>= openGLmain
hSetBuffering stdin NoBuffering >> getArgs >>= runGame . head
9 changes: 7 additions & 2 deletions LLifter/Parser.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module LLifter.Parser (parser) where
module LLifter.Parser (parser, parserIO) where

import Control.Monad.State
import Data.Array.IO
Expand All @@ -11,7 +11,7 @@ import LLifter.Internal

-- ---------------------------
-- The parser itself
parser :: String -> Game ()
parser :: String -> Game GameState
parser file = do
contents <- liftIO $ liftM BSC.lines $ BSC.readFile file
let ((size_x,size_y), fld, tramp_assoc, grth, rzr) =
Expand All @@ -21,6 +21,11 @@ parser file = do
put $ initGS tbl (size_x,size_y) fld grth rzr
(tramp_map, target_map) <- fillMap size_y ([], []) contents tbl
putTramps $ createTramps tramp_map target_map tramp_assoc
get >>= return

parserIO :: String -> IO GameState
parserIO file = do
evalStateT (parser file) undefined

fillMap :: Int -> (TrampMap, TargetMap) -> [BS.ByteString]
-> Table -> Game (TrampMap, TargetMap)
Expand Down
7 changes: 6 additions & 1 deletion lambda-lifting.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@ Executable Game
transformers >= 0.3,
mtl >= 2.1,
bytestring >= 0.9,
monad-loops >= 0.3
monad-loops >= 0.3,
StateVar >= 1.0,
OpenGL >= 2.2,
GLUT >= 2.1,
graphics-drawingcombinators >= 1.1
ghc-options: -Wall -O2
extensions: ScopedTypeVariables

0 comments on commit be4277f

Please sign in to comment.