== Blood .MAP version 6.00 & 6.03 ==

Those formats are used in the Alpha and Demo version of Blood. Even though they are very close in structure to version 7.00, version 6.00 and 6.03 are not encrypted. I ASSUME that the only difference between format 6.00 and 6.03 lies in bitflags values used in extra chunks.

Each entry in the sector/wall/sprite table may directly be followed by an extension. So an entry may either be 40 bytes or 100 bytes. The entry is followed by an extension if its "extra" field is above 0.


Structure:
	header_t	head	43 bytes
		Skies	(2^(numSkies + 1)) bytes, content unknown
		Sectors	40 bytes per entry (sector_t) plus 60 bytes for each extra chunk (sectorExt_t), read numSectors entries
		Walls	32 bytes per entry (wall_t) plus 24 bytes for each extra chunk (wallExt_t), read numWalls entries
		Sprites	44 bytes per entry (sprite_t) plus 56 bytes for each extra chunk (spriteExt_t), read numSprites entries
	UINT32	checksum	Checksum of the whole file


header_t
	UINT32	Signature	0x1A4D4C42 (appears as "BLM" + 0x1A in file)
	UINT8	VersionMin	Minor version, MUST be either 0x00 or 0x03
	UINT8	VersionMaj	Major version, MUST be 0x06
	INT32	posX	Start point, X coordinate
	INT32	posY	Start point, Y coordinate
	INT32	posZ	Start point, Z coordinate
	INT16	ang	Start direction (0 to 4096)
	INT16	curSectNum	Starting sector (-1 if Build didn't compute the starting sector yet)
	UINT16	numSkies	It's used to compute the length of the sky table, but I have no idea what it represents exactly...
	UINT32	skyMisc	Related to sky, maybe the scrolling speed, the width in pixels, the north orientation, some display flags?
	UINT32	Reserved	Appears as "Matt" or 0x00000000 in file
	UINT8	??	0, 1 or 2 ??
	UINT32	mapRevision	Revision number (how many times the map has been saved, includes auto saves)
	UINT16	numSectors	How many sectors
	UINT16	numWalls	How many walls
	UINT16	numSprites	How many sprites

[SKIES] (at least 2 bytes long)
	CHAR[]	??	Read (2^(numSkies + 1)) bytes of info. No idea what it is exactly.

sector_t (40 bytes)
	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	Visibility (?)
	INT8	filler	Always NULL
	INT16	loTag	Sector loTag
	INT16	hiTag	Sector hiTag
	INT16	extra	Extra data index, read sectorExt_t if above 0

sectorExt_t (60 bytes)

wall_t (32 bytes)
	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, read wallExt_t if above 0

wallExt_t (24 bytes)

sprite_t (44 bytes)
	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 the 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, read spriteExt_t if above 0

spriteExt_t (56 bytes)
