Copyright | (c) 2015 Martin Grabmueller |
---|---|
License | BSD3 |
Maintainer | martin@grabmueller.de |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
All public data types used by the Waddle library. The Wad
type
is a good entry point into understanding the types.
I recommend the Unofficial Doom Specification by Matthew S Fell, available at http://aiforge.net/test/wadview/dmspec16.txt and the Doom Wiki at http://doomwiki.org for details.
- data WadException
- data Wad = Wad {
- wadHeader :: WadHeader
- wadDirectory :: [WadEntry]
- wadLumps :: [ByteString]
- wadLumpLookup :: Map (CI LumpName) ByteString
- wadFlats :: Map (CI LumpName) Flat
- wadSprites :: Map (CI LumpName) Sprite
- wadPatches :: Map (CI LumpName) Patch
- wadTextures :: Map (CI LumpName) Texture
- wadLevels :: Map (CI LumpName) Level
- wadPNames :: Map Int LumpName
- wadColormap :: Maybe Colormap
- wadPalettes :: Maybe Palettes
- type LumpName = ByteString
- data WadHeader = WadHeader {}
- data WadEntry = WadEntry {}
- data Sprite = Sprite {}
- data Picture = Picture {
- pictureWidth :: Int
- pictureHeight :: Int
- pictureLeftOffset :: Int
- pictureTopOffset :: Int
- picturePosts :: [[Post]]
- data Post = Post {
- postTop :: Word8
- postPixels :: ByteString
- data Texture = Texture {}
- data Patch = Patch {}
- data PatchDescriptor = PatchDescriptor {}
- data Flat = Flat {}
- data Colormap = Colormap [ByteString]
- data Palettes = Palettes [[(Word8, Word8, Word8)]]
- data Level = Level {
- levelName :: LumpName
- levelThings :: [Thing]
- levelVertices :: [Vertex]
- levelLineDefs :: [LineDef]
- levelSideDefs :: [SideDef]
- levelSegs :: [Seg]
- levelSSectors :: [SSector]
- levelSectors :: [Sector]
- levelNodes :: [Node]
- levelReject :: Maybe Reject
- levelBlockmap :: Maybe Blockmap
- data Thing = Thing {
- thingX :: Int16
- thingY :: Int16
- thingAngle :: Int16
- thingType :: ThingType
- thingFlags :: Int16
- data ThingType
- = ZeroThing
- | Player1StartPos
- | Player2StartPos
- | Player3StartPos
- | Player4StartPos
- | DeathMatchStartPos
- | FormerHuman
- | WolfensteinOfficer
- | FormerHumanSergeant
- | FormerHumanCommando
- | Imp
- | Demon
- | Spectre
- | LostSoul
- | Cacodemon
- | HellKnight
- | BaronOfHell
- | Arachnotron
- | PainElemental
- | Revenant
- | Mancubus
- | ArchVile
- | Spiderdemon
- | Cyberdemon
- | BossBrain
- | TeleportLanding
- | BossShooter
- | SpawnSpot
- | Chainsaw
- | Shotgun
- | SuperShotgun
- | Chaingun
- | RocketLauncher
- | Plasmagun
- | BFG9000
- | AmmoClip
- | ShotgunShells
- | Rocket
- | CellCharge
- | BoxOfAmmo
- | BoxOfShells
- | BoxOfRockets
- | CellChargePack
- | Backpack
- | StimPack
- | Medikit
- | HealthPotion
- | SpiritArmor
- | SecurityArmor
- | CombatArmor
- | MegaSphere
- | SoulSphere
- | Invulnerability
- | BerserkPack
- | Invisibility
- | RadiationSuit
- | ComputerMap
- | LightAmplificationGoggles
- | BlueKeyCard
- | RedKeyCard
- | YellowKeyCard
- | BlueSkullKey
- | RedSkullKey
- | YellowSkullKey
- | Barrel
- | BurningBarrel
- | Candle
- | Candelabra
- | TallTechnocolumn
- | TallGreenPillar
- | TallRedPillar
- | ShortGreenPillar
- | ShortGreenPillarWithHeart
- | ShortGreenPillarWithBeatingHeart
- | ShortRedPillar
- | ShortRedPillarWithSkull
- | Stalagmite
- | BurntGrayTree
- | LargeBrownTree
- | TallBlueFirestick
- | TallGreenFirestick
- | TallRedFirestick
- | ShortBlueFirestick
- | ShortGreenFirestick
- | ShortRedFirestick
- | FloorLamp
- | TallTechnoLamp
- | ShortTechnoLamp
- | EvilEyeSymbol
- | FlamingSkullRock
- | ImpaledHuman
- | TwitchingImpaledHuman
- | SkullOnPole
- | FiveSkullShishKebap
- | PileOfSkullsAndCandles
- | HangingVictim
- | HangingVictimTwitching
- | HangingPairOfLegs
- | HangingVictim1Leg
- | HangingLeg
- | HangingVictimNoGuts
- | HangingVictimNoGutsBrain
- | HangingTorsoLookingDown
- | HangingTorsoOpenSkull
- | HangingTorsoLookingUp
- | HangingTorsoNoBrain
- | HangingBilly
- | DeadPlayer
- | DeadFormerHuman
- | DeadFormerSergeant
- | DeadImp
- | DeadDemon
- | DeadCacodemon
- | DeadLostSoulInvisible
- | BloodyMessExplodedPlayer
- | BloodyMessAsAbove
- | PoolOfBlood
- | PoolOfGuts
- | SmallPoolOfGuts
- | PoolOfBrains
- | HangingVictimTwitching2
- | HangingVictimArmsSpread
- | HangingVictim1Legged
- | HangingPairOfLegs2
- | HangingLeg2
- | ThingTypeOther Int
- thingTypeFromNumber :: Integral a => a -> ThingType
- data Vertex = Vertex {}
- data SideDef = SideDef {}
- data LineDef = LineDef {}
- data Sector = Sector {}
- data Node = Node {
- nodeX :: Int16
- nodeY :: Int16
- nodeDX :: Int16
- nodeDY :: Int16
- nodeRightBBUY :: Int16
- nodeRightBBLY :: Int16
- nodeRightBBLX :: Int16
- nodeRightBBUX :: Int16
- nodeLeftBBUY :: Int16
- nodeLeftBBLY :: Int16
- nodeLeftBBLX :: Int16
- nodeLeftBBUX :: Int16
- nodeRightNodeOrSSector :: Either Int16 Int16
- nodeLeftNodeOrSSector :: Either Int16 Int16
- data SSector = SSector {}
- data Seg = Seg {
- segStartVertex :: Int16
- segEndVertex :: Int16
- segAngle :: Int16
- segLineDef :: Int16
- segDirection :: Int16
- segOffset :: Int16
- data Reject = Reject {}
- type Blocklist = [Int16]
- data Blockmap = Blockmap {}
Exceptions
data WadException Source
Exception thrown when reading and decoding WAD files.
WadExceptionFormatError String String | General WAD file format error. The first string is the context where the error occured, the second contains details on the error. |
WadExceptionDecodeError String String | Decoding of the general WAD format or individual lumps failed. The first string is the context where the error occured, the second contains details on the error. |
WAD file structures
WAD structure, including the file contents and decoded common lumps.
Wad | |
|
type LumpName = ByteString Source
Lump name. This is at mot 8 bytes long, and internally, all trailing NULs are stripped.
WAD file header.
WadHeader | |
|
Entry in WAd directory.
WadEntry | |
|
Sprites and textures
Sprites are used for players, monsters, and things in general.
Sprite | |
|
Picture. Sprites and wall patches are stored in this format.
Picture | |
|
A Post
is a part of a column. There can (and often will) be
gaps in columns for transparent parts in sprites and walls.
Post | |
|
Wall texture.
Texture | |
|
A wall patch. Wall textures are made up of one or more patches,
which are positioned as defined by the patch descriptors in the
Texture
value.
Patch | |
|
data PatchDescriptor Source
Patch descriptor.
PatchDescriptor | |
|
Flats are images for texturing floors and ceiling.
Flat | |
|
Palettes and colormaps
Level geometry and details
One level.
Level | |
|
Things are parts of levels. When a level is loaded, the things define where to place players, monsters, items and so on.
Thing | |
|
All supported thing types. Unrecogized types are encoded as
ThingTypeOther
.
thingTypeFromNumber :: Integral a => a -> ThingType Source
Convert an integer thing type as found in the WAD file to Haskell.
A vertex defines the X/Y coordinates of linedefs, segs etc.
They are referenced by their position in the VERTEXES lump of the level they are used in.
A sidedef defines the textures to use on walls and to what sector the wall is connected.
Linedefs can have one or two sidedefs.
SideDef | |
|
Linedefs make up the geometry of a level and additionally define most of the interactivity.
LineDef | |
|
Sectors are defined by enclosing linedefs, and the properties below. In WADs, each region of a map with different ceiling or floor heights or textures, or different specials and tags need to be their own sectors.
Sector | |
|
Node of the BSP tree. This is created by the BSP construction process and is used to speed up rendering.
Node | |
|
A SSector (sub-sector?) is also produced by the BSP construction process. All sectors are split into ssectors (convex polygons).
SSector | |
|
Segs are split up linedefs that are produced by the BSP construction process. Whenever a BSP node splits a linedef, two segs are created representing both sides of the split.
Seg | |
|
Reject array. This is a bit map and not decoded yet.
Blockmap, determines which blocks intersect with linedefs.
Blockmap | |
|