diff options
-rw-r--r-- | axis.hs | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -228,6 +228,9 @@ data Env = Env { | |||
228 | _warpMouse :: IO () | 228 | _warpMouse :: IO () |
229 | } | 229 | } |
230 | 230 | ||
231 | fontFile :: FilePath | ||
232 | fontFile = "/usr/share/fonts/truetype/liberation/LiberationMono-Bold.ttf" | ||
233 | |||
231 | main :: IO () | 234 | main :: IO () |
232 | main = | 235 | main = |
233 | withAlsaInit $ \h public private q publicAddr privateAddr -> do | 236 | withAlsaInit $ \h public private q publicAddr privateAddr -> do |
@@ -243,7 +246,7 @@ main = | |||
243 | _ <- setVideoMode sWidth sHeight | 246 | _ <- setVideoMode sWidth sHeight |
244 | 247 | ||
245 | _ <- SDL.TTF.init | 248 | _ <- SDL.TTF.init |
246 | font <- SDL.TTF.openFont "LiberationMono-Bold.ttf" (chooseFontSize sWidth sHeight) | 249 | font <- SDL.TTF.openFont fontFile (chooseFontSize sWidth sHeight) |
247 | -- _ <- SDL.showCursor False _ <- SDL.grabInput True warpMouse _ <- SDL.setRelativeMouseMode True -- | 250 | -- _ <- SDL.showCursor False _ <- SDL.grabInput True warpMouse _ <- SDL.setRelativeMouseMode True -- |
248 | -- SDL2. Should I use it? using the pixelFormat methods gives the wrong color, with both the real | 251 | -- SDL2. Should I use it? using the pixelFormat methods gives the wrong color, with both the real |
249 | -- pixelFormat or the faked one, so fuck it. See colorToPixel let pixelFormat = | 252 | -- pixelFormat or the faked one, so fuck it. See colorToPixel let pixelFormat = |
@@ -261,7 +264,7 @@ setFont :: (MonadIO m, MonadState LoopState m) => (Int, Int) -> m () | |||
261 | setFont resolution = do | 264 | setFont resolution = do |
262 | let (w, h) = resolution | 265 | let (w, h) = resolution |
263 | fontSize = chooseFontSize w h | 266 | fontSize = chooseFontSize w h |
264 | font' <- liftIO $ SDL.TTF.openFont "LiberationMono-Bold.ttf" fontSize | 267 | font' <- liftIO $ SDL.TTF.openFont fontFile fontSize |
265 | modify $ \s -> s { _sdlFont = font' } | 268 | modify $ \s -> s { _sdlFont = font' } |
266 | 269 | ||
267 | parseEvents :: RWST Env () LoopState IO (Bool, Set.Set SDLKey, MidiPitchSet, (Int, Int), Integer) | 270 | parseEvents :: RWST Env () LoopState IO (Bool, Set.Set SDLKey, MidiPitchSet, (Int, Int), Integer) |