SPK Format

From Staredit Network Wiki
Jump to: navigation, search

Contains the star parallax data for the space platform tileset.

The star references are stored backwards, such that Layer 5 is first, then Layer 4, etc. down to Layer 1. This is most evident in the Remaster format, where the first stars reference the last image in star.dds.grp (0,0 with size 11x11, then 11,0 with size 11x11, etc.). It is true in the pre-remastered format as well, but was previously not documented or well understood.

Header/Bitmap References

  • u16 - Number of Layers
  • u16[n] - (1 for each layer) Number of images in each layer
  • 1 struct for the total number of images in each layers, starting with the last layer:
    • u16 - Star X Position
    • u16 - Star Y Position
    • u32 - Bitmap Offset

Bitmap Structure

Each is positioned at an offset specified by the Bitmap Offset in the layer image lists. These are not necessarily unique and can be referenced multiple times.

  • u16 - Bitmap Width
  • u16 - Bitmap Height
  • u8[n] - (width*height bytes) Image Data, gets drawn over black pixels (effectively making 0 = transparent)

Remaster Format

Remastered now has two files, star.dds.grp and star.spk. Star.spk no longer contains any image data, but instead star.dds.grp contains one sprite sheet of star images corresponding to each parallax layer.

  • u32 - Number of Layers
  • u32 - Offset to first star reference
  • 1 struct for each layer:
    • u32 - Number of images in this layer
    • u16 - Width of parallax layer (648 for SD, 1296 for HD2, 2592 for HD)
    • u16 - Height of parallax layer (488 for SD, 976 for HD2, 1952 for HD)
  • 1 struct for each star in each layer, starting with the last layer:
    • u16 - Layer X Position (where it is positioned on screen)
    • u16 - Layer Y Position
    • u16 - DDS X Position (where the source image is positioned in the corresponding layer's star.dds.grp image)
    • u16 - DDS Y Position
    • u16 - Width
    • u16 - Height