LambdaHack-0.11.0.1: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Common.Misc

Description

Hacks that haven't found their home yet.

Synopsis

- data FontDefinition
  - = FontProportional Text Int HintingMode
  - | FontMonospace Text Int HintingMode
  - | FontMapScalable Text Int HintingMode Int
  - | FontMapBitmap Text Int
- data HintingMode
  - = HintingHeavy
  - | HintingLight
- data FontSet = FontSet {
  - fontMapScalable :: Text
  - fontMapBitmap :: Text
  - fontPropRegular :: Text
  - fontPropBold :: Text
  - fontMono :: Text
  }
- makePhrase :: [Part] -> Text
- makeSentence :: [Part] -> Text
- squashedWWandW :: [Part] -> (Part, Person)
- appDataDir :: IO FilePath
- xM :: Int -> Int64
- xD :: Double -> Double
- minusM :: Int64
- minusM1 :: Int64
- minusM2 :: Int64
- oneM :: Int64
- tenthM :: Int64
- show64With2 :: Int64 -> Text
- workaroundOnMainThreadMVar :: MVar (IO ())

# Documentation

data FontDefinition Source #

Constructors

FontProportional Text Int HintingMode | filename, size, hinting mode
FontMonospace Text Int HintingMode |
FontMapScalable Text Int HintingMode Int | extra cell extension
FontMapBitmap Text Int | size ignored for bitmap fonts and no hinting

#### Instances

Instances details

Binary FontDefinition Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods put :: FontDefinition -> Put Source # get :: Get FontDefinition Source # putList :: [FontDefinition] -> Put Source #
NFData FontDefinition Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods rnf :: FontDefinition -> () Source #
Generic FontDefinition Source # |

Instance details

Defined in Game.LambdaHack.Common.Misc

Associated Types

type Rep FontDefinition |

Instance details

Defined in Game.LambdaHack.Common.Misc

type Rep FontDefinition = D1 ('MetaData "FontDefinition" "Game.LambdaHack.Common.Misc" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) ((C1 ('MetaCons "FontProportional" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HintingMode))) :+: C1 ('MetaCons "FontMonospace" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HintingMode)))) :+: (C1 ('MetaCons "FontMapScalable" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HintingMode) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))) :+: C1 ('MetaCons "FontMapBitmap" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

Methods

from :: FontDefinition -> Rep FontDefinition x Source #

to :: Rep FontDefinition x -> FontDefinition Source #

Read FontDefinition Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods readsPrec :: Int -> ReadS FontDefinition Source # readList :: ReadS [FontDefinition] Source # readPrec :: ReadPrec FontDefinition Source # readListPrec :: ReadPrec [FontDefinition] Source #
Show FontDefinition Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods showsPrec :: Int -> FontDefinition -> ShowS Source # show :: FontDefinition -> String Source # showList :: [FontDefinition] -> ShowS Source #
Eq FontDefinition Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods (==) :: FontDefinition -> FontDefinition -> Bool Source # (/=) :: FontDefinition -> FontDefinition -> Bool Source #
type Rep FontDefinition Source # |

Instance details

Defined in Game.LambdaHack.Common.Misc

type Rep FontDefinition = D1 ('MetaData "FontDefinition" "Game.LambdaHack.Common.Misc" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) ((C1 ('MetaCons "FontProportional" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HintingMode))) :+: C1 ('MetaCons "FontMonospace" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HintingMode)))) :+: (C1 ('MetaCons "FontMapScalable" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HintingMode) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))) :+: C1 ('MetaCons "FontMapBitmap" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

data HintingMode Source #

Constructors

HintingHeavy | current libfreetype6 default, thin, large letter spacing
HintingLight | mimics OTF, blurry, thick, tight tracking, accurate shape

#### Instances

Instances details

Binary HintingMode Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods put :: HintingMode -> Put Source # get :: Get HintingMode Source # putList :: [HintingMode] -> Put Source #
NFData HintingMode Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods rnf :: HintingMode -> () Source #
Generic HintingMode Source # |

Instance details

Defined in Game.LambdaHack.Common.Misc

Associated Types

type Rep HintingMode |
Instance details Defined in Game.LambdaHack.Common.Misc type Rep HintingMode = D1 ('MetaData "HintingMode" "Game.LambdaHack.Common.Misc" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "HintingHeavy" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "HintingLight" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: HintingMode -> Rep HintingMode x Source #

to :: Rep HintingMode x -> HintingMode Source #

Read HintingMode Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods readsPrec :: Int -> ReadS HintingMode Source # readList :: ReadS [HintingMode] Source # readPrec :: ReadPrec HintingMode Source # readListPrec :: ReadPrec [HintingMode] Source #
Show HintingMode Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods showsPrec :: Int -> HintingMode -> ShowS Source # show :: HintingMode -> String Source # showList :: [HintingMode] -> ShowS Source #
Eq HintingMode Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods (==) :: HintingMode -> HintingMode -> Bool Source # (/=) :: HintingMode -> HintingMode -> Bool Source #
type Rep HintingMode Source # |
Instance details Defined in Game.LambdaHack.Common.Misc type Rep HintingMode = D1 ('MetaData "HintingMode" "Game.LambdaHack.Common.Misc" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "HintingHeavy" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "HintingLight" 'PrefixI 'False) (U1 :: Type -> Type))

data FontSet Source #

Constructors

FontSet |

Fields

- fontMapScalable :: Text
- fontMapBitmap :: Text
- fontPropRegular :: Text
- fontPropBold :: Text
- fontMono :: Text

#### Instances

Instances details

Binary FontSet Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods put :: FontSet -> Put Source # get :: Get FontSet Source # putList :: [FontSet] -> Put Source #
NFData FontSet Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods rnf :: FontSet -> () Source #
Generic FontSet Source # |

Instance details

Defined in Game.LambdaHack.Common.Misc

Associated Types

type Rep FontSet |

Instance details

Defined in Game.LambdaHack.Common.Misc

type Rep FontSet = D1 ('MetaData "FontSet" "Game.LambdaHack.Common.Misc" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "FontSet" 'PrefixI 'True) ((S1 ('MetaSel ('Just "fontMapScalable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "fontMapBitmap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "fontPropRegular") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "fontPropBold") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "fontMono") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

Methods

from :: FontSet -> Rep FontSet x Source #

to :: Rep FontSet x -> FontSet Source #

Read FontSet Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods readsPrec :: Int -> ReadS FontSet Source # readList :: ReadS [FontSet] Source # readPrec :: ReadPrec FontSet Source # readListPrec :: ReadPrec [FontSet] Source #
Show FontSet Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods showsPrec :: Int -> FontSet -> ShowS Source # show :: FontSet -> String Source # showList :: [FontSet] -> ShowS Source #
Eq FontSet Source # |
Instance details Defined in Game.LambdaHack.Common.Misc Methods (==) :: FontSet -> FontSet -> Bool Source # (/=) :: FontSet -> FontSet -> Bool Source #
type Rep FontSet Source # |

Instance details

Defined in Game.LambdaHack.Common.Misc

type Rep FontSet = D1 ('MetaData "FontSet" "Game.LambdaHack.Common.Misc" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "FontSet" 'PrefixI 'True) ((S1 ('MetaSel ('Just "fontMapScalable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "fontMapBitmap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "fontPropRegular") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "fontPropBold") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "fontMono") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

makePhrase :: [Part] -> Text Source #

Re-exported English phrase creation functions, applied to our custom irregular word sets.

makeSentence :: [Part] -> Text Source #

Re-exported English phrase creation functions, applied to our custom irregular word sets.

squashedWWandW :: [Part] -> (Part, Person) Source #

Apply the `WWandW` constructor, first representing repetitions as `CardinalWs`. The parts are not sorted, only grouped, to keep the order. The internal structure of speech parts is compared, not their string rendering, so some coincidental clashes are avoided (and code is simpler).

appDataDir :: IO FilePath Source #

Personal data directory for the game. Depends on the OS and the game, e.g., for LambdaHack under Linux it's `~/.LambdaHack/`.

xM :: Int -> Int64 Source #

Multiplies by a million.

xD :: Double -> Double Source #

Multiplies by a million, double precision.

minusM :: Int64 Source #

minusM1 :: Int64 Source #

minusM2 :: Int64 Source #

oneM :: Int64 Source #

tenthM :: Int64 Source #

show64With2 :: Int64 -> Text Source #

workaroundOnMainThreadMVar :: MVar (IO ()) Source #