module MB.Gladtex
    ( gladTex
    , checkForGladtex
    )
where
import System.Exit
    ( ExitCode(..)
    , exitFailure
    )
import System.Process
    ( readProcessWithExitCode
    )
import Control.Monad
    ( when
    )
import MB.Types

gladtexProgName :: String
gladtexProgName = "gladtex"

gladTex :: Config -> FilePath -> String -> IO ()
gladTex config htexPath color = do
  let args = [ "-d"
             , imageDir config
             , "-u"
             , "/generated-images/"
             , "-r"
             , "120"
             , "-s"
             , "10"
             , "-b"
             , "FFFFFF"
             , "-c"
             , color
             , htexPath
             ]

  (ecode, _, err) <- readProcessWithExitCode gladtexProgName args ""

  when (ecode /= ExitSuccess) $ do
    putStrLn $ "Error processing " ++ (show htexPath) ++ " with " ++ gladtexProgName ++ ":"
    putStrLn err
    exitFailure

checkForGladtex :: IO ()
checkForGladtex = do
  (code, _, _) <- readProcessWithExitCode gladtexProgName [] ""
  case code of
    (ExitFailure c) ->
        do
          putStrLn $ "This program requires '" ++ gladtexProgName ++
                       "'; I attempted to run it but " ++
                       "got exit status " ++ (show c)
          exitFailure
    _ -> return ()

module MB.Gladtex
    ( gladTex
    , checkForGladtex
    )
where
import System.Exit
    ( ExitCode(..)
    , exitFailure
    )
import System.Process
    ( readProcessWithExitCode
    )
import Control.Monad
    ( when
    )
import MB.Types

gladtexProgName :: String
gladtexProgName = "gladtex"

gladTex :: Config -> FilePath -> String -> IO ()
gladTex config htexPath color = do
  let args = [ "-d"
             , imageDir config
             , "-u"
             , "/generated-images/"
             , "-r"
             , "120"
             , "-b"
             , "FFFFFF"
             , "-c"
             , color
             , htexPath
             ]

  (ecode, _, err) <- readProcessWithExitCode gladtexProgName args ""

  when (ecode /= ExitSuccess) $ do
    putStrLn $ "Error processing " ++ (show htexPath) ++ " with " ++ gladtexProgName ++ ":"
    putStrLn err
    exitFailure

checkForGladtex :: IO ()
checkForGladtex = do
  (code, _, _) <- readProcessWithExitCode gladtexProgName [] ""
  case code of
    (ExitFailure c) ->
        do
          putStrLn $ "This program requires '" ++ gladtexProgName ++
                       "'; I attempted to run it but " ++
                       "got exit status " ++ (show c)
          exitFailure
    _ -> return ()

Remove antialiasing parameter to gladtex
Remove antialiasing parameter to gladtex

Ignore-this: 3e0bcef06d2703f79d9cc23d002e2f30

darcs-hash:20100815064239-e018d-3cf2b500898517207877689c9b1da489216763df.gz
