Skip to content

Bitmap_Z

widberg edited this page Feb 1, 2024 · 28 revisions

Chum World BITMAP
ImZouna Bitmap_Z

Additional reading https://docs.microsoft.com/en-us/windows/win32/direct3ddds/dds-header

struct Bitmap_Z_Header : ResourceObject_Z { // 32
    std::uint16_t multipleImages;
        // 0 for one image
        // 2 for 6 image cubemap
        // Always 0 except for 1 image in SHARED where it's 2
        // used as a loop count
        // 0, 1, 2
        // 2 - 6
        // !2 - 1
        // only 0 and 2 dont lead to a fail return
    std::uint32_t width;
    std::uint32_t height;
    std::uint32_t dataSize;
    std::uint8_t renderFlags;
        // 0, 53, 60, 181
        // Flag masks:
        //   * 0x80 unused
        //   * 0x20 unused
        //   * 0x10 unused
        //   * 0x8 unused
        //   * 0x4 something
        //   * 0x1 unused
        // If u1 & 0x4 == 0, then some bools are set in the renderer
    std::uint8_t bitmapType;
        // Unused?
        // Whether a bitmap is a diffuse, normal, specular, etc...
    std::uint16_t zero;
        // Padding?
        // Always 0
    float layer;
        // lower is higher layer
        // > 0 doesnt get drawn
        // so transparent textures show up on top
        // gets added to something in the renderer
        // usually 0
        // sometimes -1 or -2
        // x + y + u7
        // result of addition is often -1.0
    std::uint8_t inputpixelFormat;
        // Unused?
        // See table
        // always matchs pixelFormat except for the cube map
    std::uint8_t mipMapCount;
    std::uint8_t four;
        // Unused?
        // Always 4
    std::uint8_t inputUnused3;
        // Unused?
        // 3 - normal
        // 0 - multiple input images
        // Always 3 except for the SHARED cubmap where it is 0
    std::uint8_t pixelFormat;
        // See the table
        // used as a loop count
    std::uint8_t rdrRelated;
        // material related
        // 0, 1, 2
        // If 1 material RdrFlag is ORed with 0x40
        // If 2 material RdrFlag is ORed with 0x20
        // Else nothing
        // material RdrFlag Masked with 0x1f
        // 0xFF for the cube map texture
};
struct Bitmap_Z {
    std::uint8_t data[__header.dataSize];
        // image data based on pixelFormat
};
010 Editor Binary Template
//------------------------------------------------
//--- 010 Editor v11.0.1 Binary Template
//------------------------------------------------

struct Bitmap_Z_Header
{
    uint32 friendly_name_crc32;
    uint16 dwCaps2;
    uint32 width;
    uint32 height;
    uint32 dataSize;
    ubyte u1;
    ubyte bitmapType;
    uint16 zero;
    float u7;
    ubyte inputpixelFormat;
    ubyte mipMapCount;
    ubyte u2;
    ubyte u3;
    ubyte pixelFormat;
    ubyte u4;
} bitmap;

pixelFormat

pixelFormat type bytes per pixel
0 BM_NONE 0.0
1 BM_4 0.5
2 BM_8 1.0
3 0.0
4 0.0
5 0.0
6 0.0
7 BM_5551 2.0
8 BM_565 2.0
9 0.0
10 BM_4444 2.0
11 BM_1555 2.0
12 BM_8888 4.0
13 BM_888 3.0
14 BM_DXT1 0.5
15 BM_DXT3 1.0
16 BM_DXT5 1.0
17 BM_DXT5n 1.0
18 BM_CTX1 0.5
19 BM_R16F 2.0
20 BM_R32F 4.0
21 BM_R16G16F 4.0
22 BM_R32G32F 8.0
23 BM_R16G16B16A16F 8.0
24 BM_R32G32B32A32F 16.0
25 BM_D24X8 4.0
26 BM_I8 1.0
27 BM_U12 1.5
28 BM_U16 2.0
29 BM_U16_CP0 2.0
30 BM_JPEG_FILE 0.0

Not handled by the game

The D3DXCreateTextureFromFileInMemory function is used for BM_JPEG_FILE.

Alternate Formats

Formats used in older BigFiles

struct Bitmap_Z_Header_Alt // 13
{
    std::uint32_t friendly_name_crc32;
    std::uint32_t zero0;
    std::uint8_t u3;
        // Always 3
    std::uint8_t pixelFormat;
        // See table
    std::uint8_t u4;
        // 0, 2
    std::uint16_t zero1;
};
struct Bitmap_Z_Alt
{
    std::uint32_t width;
    std::uint32_t height;
    std::uint32_t zero;
    std::uint32_t unknown0;
        // 60
    std::uint16_t pixelFormat;
        // See table
    std::uint8_t unknown2;
        // 4
    std::uint8_t data[data_size - 19];
        // image data based on pixelFormat
};

Home
FAQ

For FMTK Users and Mod Developers

Read the Docs

For FMTK Developers

Asobo BigFile Format Specification
Asobo Classes
      Animation_Z
      Binary_Z
      Bitmap_Z
      Camera_Z
      CollisionVol_Z
      Fonts_Z
      GameObj_Z
      GenWorld_Z
      GwRoad_Z
      Keyframer*_Z
      Light_Z
      LightData_Z
      Lod_Z
      LodData_Z
      Material_Z
      MaterialAnim_Z
      MaterialObj_Z
      Mesh_Z
      MeshData_Z
      Node_Z
      Omni_Z
      Particles_Z
      ParticlesData_Z
      RotShape_Z
      RotShapeData_Z
      Rtc_Z
      Skel_Z
      Skin_Z
      Sound_Z
      Spline_Z
      SplineGraph_Z
      Surface_Z
      SurfaceDatas_Z
      UserDefine_Z
      Warp_Z
      World_Z
      WorldRef_Z
Asobo File Format Idioms
Asobo CRC32
Asobo LZ Compression
Asobo Arithmetic Coding Compression
Asobo Save Game File Format Specification
Asobo Audio Formats
TotemTech/ToonTech/Zouna/ACE/BSSTech/Opal Timeline
Zouna Modding Resources
Miscellaneous

Clone this wiki locally