This code was taken from a TXT file I backup A LONG TIME AGO so if it embaresses me by looking retarded, just remember that PLEASE.I don't have access to my current version of my source code and will not for at least a week. To be honest I havent touched the source code in a few months
(she must be gagging for it) due to the lack of information of the data structures.
Remember; this will benefit the community (without compromising the integrity of the engines best kept secrets).
NOTE: I have since forgotten the meaning behind some data, such as bsp_blocks, which is just (in my case) and array of 20 32-bit integers.
NOTE: I do remember that this map only had 5 regions.
NOTE: I did my best using the manual.
////////////////////////////////////////////////////////////////
// bsp_leafs
typedef struct {
unsigned long type; // root = 0xFFFFFF80, child = 0xFFFFFF00
long region;
float plane[4];
long _unused_;
long lBlockIndex; // x = block offset
long lNumBlocks; // y = num blocks
} WMB7_BSP_LEAFS;
// NOTE: x+y = next leaf x
// x = block offset
// y = num blocks
WMB7_BSP_LEAFS bsp_leafs[5];
// NOTE: Number of leafs = Number of regions
// Each leaf is 36 bytes. There is always one leaf (the root) even without BSP.
file.Seek(header.bsp_leafs.offset);
file.Read(&bsp_leafs, header.bsp_leafs.length);
////////////////////////////////////////////////////////////////
// bsp_blocks
typedef struct {
long a;
long unused0; // 0
float c[3];
long unused1; // 0
long next; // ?
long prev; // ?
long lSurfaceOffset; // ?
long lVisibleSurfaces; // ?
} WMB7_BSP_NODES;
WMB7_BSP_NODES bsp_nodes[15];
file.Seek(header.bsp_nodes.offset);
file.Read(&bsp_nodes, header.bsp_nodes.length);
////////////////////////////////////////////////////////////////
// aabb_hulls
file.Skip(header.aabb_hulls.length);
////////////////////////////////////////////////////////////////
// bsp_blocks
unsigned long bsp_blocks[20];
file.Seek(header.bsp_blocks.offset);
file.Read(&bsp_blocks, header.bsp_blocks.length);
////////////////////////////////////////////////////////////////
// pvs
file.Skip(header.pvs.length);
////////////////////////////////////////////////////////////////
// objects
file.Skip(header.objects.length);
////////////////////////////////////////////////////////////////
Many, many thanks!