get dbpf
v0.1.0

Module dbpf.files.fsh

Source

src/files/fsh.d

Franks PC Shapes (Textures)

See Also

Authors

Chance Snow

License

MIT License

Members

  • FshGroup

    enum FshGroup: uint;
  • DirectoryId

    enum DirectoryId: immutable(ubyte)[];
    • building

      building

      Building textures

    • generic

      generic

      Network textures, Sim textures, Sim heads, Sim animations, Trees, props, Base textures, Misc. colors

    • _3dAnimation

      _3dAnimation

      3D Animation textures (e.g. the green rotating diamond in loteditor.dat)

    • dispatch

      dispatch

      Dispatch marker textures

    • simThumbOrNetworkModel

      simThumbOrNetworkModel

      Small Sim texture, Network Transport Model textures (trains, etc.)

    • ui

      ui

      UI Editor textures

    • bat

      bat

      BAT generator texture maps

  • Header

    struct Header;
  • EntryName

    enum EntryName: immutable(ubyte)[];
    • palette

      palette

      Global palette for 8-bit Indexed Bitmaps.

    • zero

      zero

      Buildings, props, network intersections, and terrain textures.

    • rail

      rail

      Always used for a rail texture, whereas for street/road intersections it's always by instance.

    • tb2

      tb2

      First sprite animation entry in a directory.

    • tb3

      tb3

      Any sprite animation entries in a directory after TB2.

  • Directory

    struct Directory;
    • entryName

      str!4 entryName;

      Remarks

      When searching for a global palette for 8-bit bitmaps, the directory entry name for the global palette will always '!pal'. Once the '!pal' directory entry has been found, the global palette can be extracted and used for any bitmaps that use 8-bit indexed color. If no global palette is found, FSH decoders should look for a local palette directly following the indexed bitmap. If no palette is found, then no palette will be created or associated with the bitmap.

      Most tools, like FSHTool, simply ignore missing palettes and save the bitmap with an empty palette with all indices set to black.

      See Also

      EntryName

    • offset

      uint offset;

      Offset of the entry in the FSH file, in bytes.

  • EntryHeader

    struct EntryHeader;

    See Also

    FSH Entry Header (SC4D Encyclopedia)

    • recordId

      ubyte recordId;

      Record ID

      Logically ANDed by 0x7f for bitmap code or 0x80 to check if the entry is QFS compressed (unused by SC4).

    • size

      int24 size;

      Size of an entry including this header.

      Only used if the file contains an attachment or embedded mipmaps. It is zero otherwise.

      Remarks

      For single images this is usually: width x height + 0x10h.

      For images with embedded mipmaps, this is the total size of the original image, plus all mipmaps, plus the header.

      In either case, it may include additional data as a binary attachment with unknown format.

    • width

      ushort width;
    • height

      ushort height;
    • centerX

      ushort centerX;
    • centerY

      ushort centerY;
    • positionX

      ushort positionX;
    • positionY

      ushort positionY;
  • Entry

    alias Entry = std.typecons.Tuple!(EntryHeader, "header", ubyte[], "data").Tuple;

    A tuple of an entry's header and its data. data is either palette or bitmap data.

    Remarks

    After an entry's header is its bitmap, palette, or pixel color data.

    Authors

    Palettes are generally arrays of 256 colors, each 1 byte. Bitmaps may store their pixel data in one of many ways, either raw bitmap pixel data, or they can make use of Microsoft DXTC compressed formats.

    See Also

  • BitmapType

    enum BitmapType: ushort;

    FSH images can store their pixel data raw, or they can make use of Microsoft DXTC compressed formats.

    See Also

    Bitmap data (SC4D Encyclopedia)

    • indexed

      indexed

      8-bit indexed

      Directly follows bitmap or uses global palette.

    • a8r8g8b8

      a8r8g8b8

      32-bit A8R8G8B8

    • a0r8g8b8

      a0r8g8b8

      24-bit A0R8G8B8

    • a1r5g5b5

      a1r5g5b5

      16-bit A1R5G5B5

    • a0r5g6b5

      a0r5g6b5

      16-bit A0R5G6B5

    • a4r4g4b4

      a4r4g4b4

      16-bit A4R4G4B4

    • dxt3

      dxt3

      DXT3 4x4 packed, 4-bit alpha

      4x4 grid compressed, half-byte per pixel

    • dxt1

      dxt1

      DXT1 4x4 packed, 1-bit alpha

      4x4 grid compressed, half-byte per pixel

  • Palette

    enum Palette: ushort;

    See Also

    Palette codes (SC4D Encyclopedia)

  • Text

    enum Text: ushort;

    See Also

    Text codes (SC4D Encyclopedia)

    • text

      text

      Standard Text file

    • etxt

      etxt

      ETXT of arbitrary length with full entry header

    • etxt16

      etxt16

      ETXT of 16 bytes or less including the header

    • hotspot

      hotspot

      Defined Pixel region hot-spot data for image

  • Fsh

    alias Fsh = std.typecons.Tuple!(Header, "header", Directory[], "directories", Tuple!(EntryHeader, "header", ubyte[], "data")[], "entries").Tuple;

    A FSH document.

    See Also

  • read

    Fsh read(ubyte[] file);
  • write

    ubyte[] write(Fsh document);