General cleanup, remove Drawing type synonym

This commit is contained in:
2021-03-23 15:48:14 +01:00
parent b13467053a
commit 451ef98b9f
8 changed files with 100 additions and 48 deletions
+27 -29
View File
@@ -64,7 +64,7 @@ data World = World
, _buttons :: IM.IntMap Button
, _soundQueue :: [Int]
, _sounds :: M.Map SoundOrigin Sound
, _decorations :: IM.IntMap Drawing
, _decorations :: IM.IntMap Picture
, _corpses :: IM.IntMap (IM.IntMap [Corpse])
, _lbClickMousePos :: (Float,Float)
, _lbRotation :: Float
@@ -84,11 +84,9 @@ data World = World
, _remap :: Keycode -> Keycode
} --deriving (Show)
type Drawing = Picture
data Corpse = Corpse
{ _cpPos :: Point2
, _cpPict :: Drawing
, _cpPict :: Picture
, _cpRes :: Creature
}
@@ -103,7 +101,7 @@ data Cloud = Cloud
{ _clID :: Int
, _clPos :: Point2
, _clVel :: Point2
, _clPict :: Cloud -> Drawing
, _clPict :: Cloud -> Picture
, _clRad :: Float
, _clTimer :: Int
, _clEffect :: Cloud -> World -> World
@@ -130,7 +128,7 @@ data Creature = Creature
, _crOldPos :: Point2
, _crDir :: Float
, _crID :: Int
, _crPict :: Creature -> Drawing
, _crPict :: Creature -> Picture
, _crUpdate :: World -> (World -> World,StdGen) -> Creature
-> ((World -> World,StdGen), Maybe Creature)
, _crRad :: Float
@@ -140,7 +138,7 @@ data Creature = Creature
, _crInv :: IM.IntMap Item
, _crInvSel :: Int
, _crState :: CreatureState
, _crCorpse :: Drawing
, _crCorpse :: Picture
}
data CreatureState
@@ -243,7 +241,7 @@ data MenuState
deriving (Eq,Ord)
data Button = Button
{ _btPict :: Drawing
{ _btPict :: Picture
, _btPos :: Point2
, _btRot :: Float
, _btEvent :: Button -> World -> World
@@ -255,7 +253,7 @@ data Button = Button
data ButtonState = BtOn | BtOff | BtNoLabel
deriving (Eq, Show)
data PressPlate = PressPlate { _ppPict :: Drawing
data PressPlate = PressPlate { _ppPict :: Picture
, _ppPos :: Point2
, _ppRot :: Float
, _ppEvent :: PressPlate -> World -> World
@@ -283,13 +281,13 @@ data Item = Weapon
, _wpSpread :: Float
, _wpRange :: Float
, _itHammer :: HammerPosition
, _itFloorPict :: Drawing
, _itFloorPict :: Picture
, _itMaxStack :: Int
, _itAmount :: Int
, _itAimingSpeed :: Float
, _itAimingRange :: Float
, _itZoom :: ItZoom
, _itEquipPict :: Creature -> Int -> Drawing
, _itEquipPict :: Creature -> Int -> Picture
, _itScrollUp :: Int -> World -> World
, _itScrollDown :: Int -> World -> World
, _itIdentity :: ItemIdentity
@@ -304,8 +302,8 @@ data Item = Weapon
, _itMaxStack :: Int
, _itAmount :: Int
, _cnEffect :: Int -> World -> Maybe World
, _itFloorPict :: Drawing
, _itEquipPict :: Creature -> Int -> Drawing
, _itFloorPict :: Picture
, _itEquipPict :: Creature -> Int -> Picture
, _itIdentity :: ItemIdentity
, _itID :: Maybe Int
, _itInvDisplay :: Item -> String
@@ -317,8 +315,8 @@ data Item = Weapon
{ _itName :: String
, _itMaxStack :: Int
, _itAmount :: Int
, _itFloorPict :: Drawing
, _itEquipPict :: Creature -> Int -> Drawing
, _itFloorPict :: Picture
, _itEquipPict :: Creature -> Int -> Picture
, _itIdentity :: ItemIdentity
, _itID :: Maybe Int
, _itInvDisplay :: Item -> String
@@ -328,8 +326,8 @@ data Item = Weapon
{ _itName :: String
, _itMaxStack :: Int
, _itAmount :: Int
, _itFloorPict :: Drawing
, _itEquipPict :: Creature -> Int -> Drawing
, _itFloorPict :: Picture
, _itEquipPict :: Creature -> Int -> Picture
, _itIdentity :: ItemIdentity
, _itEffect :: ItEffect
, _itID :: Maybe Int
@@ -344,14 +342,14 @@ data Item = Weapon
{ _itName :: String
, _itMaxStack :: Int
, _itAmount :: Int
, _itFloorPict :: Drawing
, _itFloorPict :: Picture
, _twMaxRange :: Float
, _twAccuracy :: Float
, _twFire :: Int -> World -> World
, _itAimingSpeed :: Float
, _itAimingRange :: Float
, _itZoom :: ItZoom
, _itEquipPict :: Creature -> Int -> Drawing
, _itEquipPict :: Creature -> Int -> Picture
, _itIdentity :: ItemIdentity
, _itID :: Maybe Int
, _itAttachment :: Maybe ItAttachment
@@ -432,10 +430,10 @@ data ItemIdentity
data Particle' =
Particle'
{ _ptPict' :: Drawing
{ _ptPict' :: Picture
, _ptUpdate' :: World -> Particle' -> (World, Maybe Particle')
}
| Bul' { _ptPict' :: Drawing
| Bul' { _ptPict' :: Picture
, _ptUpdate' :: World -> Particle' -> (World, Maybe Particle')
, _btVel' :: Point2
, _btColor' :: Color
@@ -445,7 +443,7 @@ data Particle' =
, _btTimer' :: Int
, _btHitEffect' :: HitEffect
}
| Pt' { _ptPict' :: Drawing
| Pt' { _ptPict' :: Picture
, _ptUpdate' :: World -> Particle' -> (World, Maybe Particle')
, _btVel' :: Point2
, _btColor' :: Color
@@ -456,7 +454,7 @@ data Particle' =
, _btHitEffect' :: HitEffect
}
| Shockwave'
{ _ptPict' :: Drawing
{ _ptPict' :: Picture
, _ptUpdate' :: World -> Particle' -> (World, Maybe Particle')
, _btColor' :: Color
, _btPos' :: Point2
@@ -479,7 +477,7 @@ data Projectile =
Projectile { _ptPos :: Point2
, _ptStartPos :: Point2
, _ptVel :: Point2
, _ptPict :: Drawing
, _ptPict :: Picture
, _ptID :: Int
, _ptUpdate :: World -> World
}
@@ -515,7 +513,7 @@ data Wall
= Wall
{ _wlLine :: [Point2] , _wlID :: Int
, _wlColor :: Color
, _wlDraw :: Maybe (Wall -> Drawing)
, _wlDraw :: Maybe (Wall -> Picture)
, _wlSeen :: Bool
, _wlIsSeeThrough :: Bool
}
@@ -524,7 +522,7 @@ data Wall
, _wlID :: Int
, _doorMech :: World -> World
, _wlColor :: Color
, _wlDraw :: Maybe (Wall -> Drawing)
, _wlDraw :: Maybe (Wall -> Picture)
, _wlSeen :: Bool
, _blIDs :: [Int]
, _blHP :: Int
@@ -534,7 +532,7 @@ data Wall
{ _wlLine :: [Point2] , _wlID :: Int
, _doorMech :: World -> World
, _wlColor :: Color
, _wlDraw :: Maybe (Wall -> Drawing)
, _wlDraw :: Maybe (Wall -> Picture)
, _wlSeen :: Bool
, _wlIsSeeThrough :: Bool
, _doorPathable :: Bool
@@ -543,7 +541,7 @@ data Wall
{ _wlLine :: [Point2]
, _wlID :: Int
, _wlColor :: Color
, _wlDraw :: Maybe (Wall -> Drawing)
, _wlDraw :: Maybe (Wall -> Picture)
, _wlSeen :: Bool
, _blIDs :: [Int]
, _blHP :: Int
@@ -579,7 +577,7 @@ data SoundOrigin = InventorySound
type Poly = [Point2]
data PSType = PutCrit Creature
| PutLS LightSource Drawing
| PutLS LightSource Picture
| PutButton Button
| PutFlIt FloorItem
| PutPressPlate PressPlate