PMF - PlatinumSrc Map File/Format

- .pmf file extension
- Current version is 0.0
- All data should be little endian

Format:

    <Header>
    <u64: Size of compressed <Data>> <u64: Size of <Data> before compression> <Compressed <Data>>
    <u64: Size of compressed <Server data>> <u64: Size of <Server data> before compression> <Compressed <Server data>>
    <u64: Size of compressed <Client data>> <u64: Size of <Client data> before compression> <Compressed <Client data>>

    Header:
        <char[4]: {'P', 'M', 'F', 0}>
        <u8: Major version> <u8: Minor version>
        <char[... 0]: Name> <char[... 0]: Authors> <char[... 0]: Description>
        <u64: Creation time (the time at which the map finished compiling in UTC Unix seconds)>
        <<u8: 0..16>: Gamemode count> [char[... 0]: Gamemode]...

    Data:
        <u8: Zone count> <u32: Index in array of <Cube>>...
        <u32: Cube count (must be at least 1)> <Cube>... <Cube data>...
        <u32: Prop count> [Prop]...
        <u32: Prop reference count> [Prop reference]...
        <u32: String table size> <<char: 0> <char[... 0]>...: String table>
    Server data:
        <u8: Team count> [Team data]...
        <Entity data (see 'entities.txt')>
        <u32: Server string table size> <<char: 0> <char[... 0]>...: Server string table>
        <u32: Script count> [Embedded script]...
    Client data:
        <u32: Triangle count> [Triangle]...

    Cube: <u8: <Cube type>> <Cube data>
    Cube type: <u8:
                   <2 bits: 0>
                   <1 bit: Is chunk>
                   <1 bit: Has lighting>
                   <4 bits: { CUBE_EMPTY | CUBE_PARENT | CUBE_SOLID | CUBE_ANGLED }>
               >
    Cube data: [ <Cube lighting data> ]
               [ <Cube chunk data> ]
               [ { <Parent cube data> | <Solid cube data> | <Angled cube data> } ]

    Parent cube data:
        <u32: (+X, +Y, +Z) child index in array of <Cube>>
        <u32: (-X, +Y, +Z) child index in array of <Cube>>
        <u32: (+X, +Y, -Z) child index in array of <Cube>>
        <u32: (-X, +Y, -Z) child index in array of <Cube>>
        <u32: (+X, -Y, +Z) child index in array of <Cube>>
        <u32: (-X, -Y, +Z) child index in array of <Cube>>
        <u32: (+X, -Y, -Z) child index in array of <Cube>>
        <u32: (-X, -Y, -Z) child index in array of <Cube>>
    Solid cube data:
        <<Client resource>: Material>
        <u32: Triangle index>
        <u16:
            <4 bits: 0>
            <2 bits: +X # of triangles> <2 bits: +Y # of triangles> <2 bits: +Z # of triangles>
            <2 bits: -X # of triangles> <2 bits: -Y # of triangles> <2 bits: -Z # of triangles>
        >
    Angled cube data:
        <<Client resource>: Material>
        <u32: Triangle index>
        <u16:
            <2 bits: 0>
            <2 bits: Plane # of triangles>
            <2 bits: +X # of triangles> <2 bits: +Y # of triangles> <2 bits: +Z # of triangles>
            <2 bits: -X # of triangles> <2 bits: -Y # of triangles> <2 bits: -Z # of triangles>
        >
        <float: Fill (0 is empty, 1 is full)>
        <float: Pitch (0 points up, 1 and -1 point down, positive rolls forward, negative rolls backward)>
        <float: Yaw (0 aims forward, 1 and -1 aim backward, positive goes clockwise, negative goes counterclockwise)>

    Cube lighting data:
        <u8[3]: Base light>
        <u32: Index in array of <Light reference>> <u8: # of dynamic lights>
    Cube chunk data:
        <u16: Index in array of <Prop reference>> <u16: # of props>
        <u32: Index in visibility data> <u32: # of cubes>

    String: <u32: Byte index in the string table>
    Server string: <u32: Byte index in the server string table>
    Client string: <u32: Byte index in the server string table>
    Resource: <<String>: Byte index to a resource path in the string table>
    Server resource: <<Server string>: Byte index to a resource path in the server string table>
    Client resource: <<Client string>: Byte index to a resource path in the client string table>

    Prop reference: <u32: Index in array of <Prop>>

    Team: <u32: Byte index in [Team data]...>
    Team data: <<Server string>: Name> <float[3]: Color>

    Triangle: <<Point>[3]>
    Point: <float[3]: XYZ> <float[2]: Texture XY> <float[2]: Lightmap XY>


