<commit_before>module Main where

import Graphics.UI.SDL as SDL

import Game.Menu

import Resources
import Settings

main :: IO ()
main = do
    -- Add cmdline params parsing like:
    -- fullscreen, SOD/Classic/Demo, Data path, etc.

    -- Load game resources
    palette <- loadPalette
    config  <- loadConfig

    putStrLn $ "-- Configuration dump --"
    print $ config
    putStrLn $ "-- End of dump --"

    -- Initialize SDL system
    SDL.init [InitAudio, InitVideo]

    screen <- SDL.setVideoMode scrWidth scrHeight scrBpp [HWSurface, HWPalette]

    -- set main palette
    -- @todo Currently we have a limitation with bpp incompatibility.
    -- The VGA uses 6-6-6 scheme while SDL expected 8-8-8. Need to find
    -- a way to transpose the palette.
    _ <- SDL.setColors screen palette 0 -- @todo check for result.

    -- draw [Intro Screen]
    Game.Menu.introScreen screen

    SDL.flip screen

    -- @todo no game loop yet. Just waiting for user input
    _ <- getChar
    return ()<commit_msg>[+] Main: simple event processing added<commit_after>module Main where

import Graphics.UI.SDL as SDL
import System.Exit

import Game.Menu

import Resources
import Settings

doExit = do
    SDL.quit
    exitWith ExitSuccess

gameLoop :: IO ()
gameLoop = do
    ev <- waitEvent
    case ev of
        Quit                     -> doExit
        KeyDown (Keysym _ _ _)   -> doExit
        _                        -> return ()
    gameLoop

main :: IO ()
main = do
    -- Add cmdline params parsing like:1
    -- fullscreen, SOD/Classic/Demo, Data path, etc.

    -- Load game resources
    palette <- loadPalette
    config  <- loadConfig

    putStrLn $ "-- Configuration dump --"
    print $ config
    putStrLn $ "-- End of dump --"

    -- Initialize SDL system
    SDL.init [InitAudio, InitVideo]

    screen <- SDL.setVideoMode scrWidth scrHeight scrBpp [HWSurface, HWPalette]

    -- set main palette
    -- @todo Currently we have a limitation with bpp incompatibility.
    -- The VGA uses 6-6-6 scheme while SDL expected 8-8-8. Need to find
    -- a way to transpose the palette.
    _ <- SDL.setColors screen palette 0 -- @todo check for result.

    -- draw [Intro Screen]
    Game.Menu.introScreen screen

    SDL.flip screen

    gameLoop
{'fraction_non_alphanumeric': 0.08918322295805739, 'fraction_numerical': 0.006622516556291391, 'mean_word_length': 2.2005649717514126, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7604781', 'n_tokens_mistral': 732, 'n_tokens_neox': 657, 'n_words': 243}