== Build .MAP version 7 ==

  This is the most common format for Build maps. It is used by Duke Nukem 3D,
  Witchaven II, Fate, Redneck Rampage, Shadow Warrior, Nam, PaintBrawl, and
  WWII GI.


Structure:
  INT32     mapVersion      Map format version, must be 7
  INT32     posX            Starting position, X coordinate
  INT32     posY            Starting position, Y coordinate
  INT32     posZ            Starting position, Z coordinate
  INT16     ang             Starting position, angle
  INT16     curSectNum      Starting position, current sector
  INT16     numSectors      How many sectors
  sector_t  sector[]        Each sector, read numSectors entries
  INT16     numWalls        How many walls
  wall_t    wall[]          Each wall, read numWalls entries
  INT16     numSprites      How many sprites
  sprite_t  sprite[]        Each sprite, read numSprites entries


sector_t:
  INT16  wallPtr            Index of first wall
  INT16  wallNum            How many walls
  INT32  ceilingZ           Ceiling elevation
  INT32  floorZ             Floor elevation
  INT16  ceilingStat        Ceiling flags
  INT16  floorStat          Floor flags
  INT16  ceilingPicNum      Ceiling texture number
  INT16  ceilingHeiNum      Ceiling slope value
  INT8   ceilingShade       Ceiling shading level
  INT8   ceilingPal         Ceiling palette swap index
  INT8   ceilingXPanning    Ceiling texture panning (horizontal)
  INT8   ceilingYPanning    Ceiling texture panning (vertical)
  INT16  floorPicNum        Floor texture number
  INT16  floorHeiNum        Floor slope value
  INT8   floorShade         Floor shading level
  INT8   floorPal           Floor palette swap index
  INT8   floorXPanning      Floor texture panning (horizontal)
  INT8   floorYPanning      Floor texture panning (vertical)
  INT8   visibility         How much distance affects shading
  INT8   filler             Always NULL
  INT16  loTag              Sector loTag
  INT16  hiTag              Sector hiTag
  INT16  extra              Extra data index

wall_t:
  INT32  x                  First point, X coordinate
  INT32  y                  First point, Y coordinate
  INT16  point2             Index of second point
  INT16  nextWall           Wall located behind wall
  INT16  nextSector         Sector located behind wall
  INT16  cstat              Wall flags
  INT16  picNum             Wall tile number
  INT16  overpicNum         Wall tile number (for masks)
  INT8   shade              Wall shading level
  INT8   pal                Wall palette swap index
  UINT8  xRepeat            Texture scale (horizontal)
  UINT8  yRepeat            Texture scale (vertical)
  UINT8  xPanning           Texture panning (horizontal)
  UINT8  yPanning           Texture panning (vertical)
  INT16  loTag              Wall loTag
  INT16  hiTag              Wall hiTag
  INT16  extra              Extra data index

sprite_t:
  INT32  x                  X coordinate
  INT32  y                  Y coordinate
  INT32  z                  Z coordinate
  INT16  cstat              Sprite flags
  INT16  picNum             Sprite tile number
  INT8   shade              Sprite shading level
  INT8   pal                Sprite palette swap index
  INT8   clipDist           Collision radius
  INT8   filler             Always NULL
  UINT8  xRepeat            Sprite scale (horizontal)
  UINT8  yRepeat            Sprite scale (vertical)
   INT8  xOffset            X-axis offset
   INT8  yOffset            Y-axis offset
  INT16  sectNum            Current position (in sector)
  INT16  statNum            Current action (used by game code)
  INT16  ang                Angle
  INT16  owner              Owner (for projectiles)
  INT16  xvel               Velocity, X axis
  INT16  yvel               Velocity, Y axis
  INT16  zvel               Vertical velocity
  INT16  loTag              Sprite loTag
  INT16  hiTag              Sprite hiTag
  INT16  extra              Extra data index

Sector flags (used by ceilingStat and floorStat):
  stat_cParallaxing   0x0001  Parallax sky
  stat_cSloped        0x0002  This surface is sloped
  stat_cSwap          0x0004  Swap X/Y
  stat_cSmoosh        0x0008  Texture appears smaller
  stat_cFlipX         0x0010  Flip texture X axis
  stat_cFlipY         0x0020  Flip texture Y axis
  stat_cAlign         0x0040  Align texture to first wall

Wall flags (bits 10-15 are reserved):
  cstat_wBlocking     0x0001  Both sides blocked
  cstat_wSwapWalls    0x0002  Bottom wall uses wall texture and alignment from sector located behind the wall
  cstat_wBottomAlign  0x0004  Bottom-aligned texture
  cstat_wFlipX        0x0008  Flip texture X axis
  cstat_wMasked       0x0010  Display wall between floor and ceiling levels
  cstat_wOneWay       0x0020  One side blocked
  cstat_wHitscan      0x0040  Catch hit-scan (bullets)
  cstat_wTrans1       0x0080  Translucence (+25%)
  cstat_wFlipY        0x0100  Flip texture Y axis
  cstat_wTrans2       0x0200  Translucence (+50%)

Sprite flags (bits 10-14 are reserved):
  cstat_sBlocking     0x0001  Sprite is solid
  cstat_sTrans1       0x0002  Translucence (+25%)
  cstat_sFlipX        0x0004  Flip X axis
  cstat_sFlipY        0x0008  Flip Y axis
  cstat_sFaceSprite   0x0010  Default (follows view angle)
  cstat_sWallSprite   0x0020  Wall sprite ("flat")
  cstat_sFloorSprite  0x0040  Flat sprite (parallel to floor/ceiling)
  cstat_sOneSided     0x0080  Displayed only from one side (wall sprites)
  cstat_sRealCentered 0x0100  Real centering
  cstat_sHitscan      0x0200  Catch hit-scan (bullets)
  cstat_sTrans2       0x0400  Translucence (+50%)
  cstat_sInvisible    0x8000  Sprite is invisible