Difference between revisions of "SPK Format"

From Staredit Network Wiki
Jump to: navigation, search
m (1 revision imported: Restoring SC1 backup)
(Added remaster format)
Line 1: Line 1:
*Word = 2 Bytes
+
Contains the star parallax data for the space platform tileset.
*Long = 4 Bytes
+
 
 +
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==
 
==Header/Bitmap References==
*word - Number of Layers
+
*'''u16''' - Number of Layers
*n words - (1 word for each layer) Number of images in the layer
+
*'''u16[n]''' - (1 for each layer) Number of images in each layer
*1 struct for the total number of images in all layers:
+
*1 struct for the total number of images in each layers, starting with the last layer:
*word - Star X Position
+
**'''u16''' - Star X Position
*word - Star Y Position
+
**'''u16''' - Star Y Position
*long - Bitmap Offset
+
**'''u32''' - Bitmap Offset
  
 
==Bitmap Structure==
 
==Bitmap Structure==
*word - Bitmap Width
+
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.
*word - Bitmap Height
+
*'''u16''' - Bitmap Width
*n bytes - (width*height bytes) Image Data (0 = transparent)
+
*'''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
 +
 
  
 
[[Category:StarCraft]]
 
[[Category:StarCraft]]
 
[[Category:Reference]]
 
[[Category:Reference]]
 
[[Category:Modding]]
 
[[Category:Modding]]

Revision as of 19:09, 26 January 2023

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