Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

HG‐2 Image

Robert Jordan edited this page Mar 17, 2019 · 7 revisions

Some values unknown but still much more readable than other implementations

File Structure

This header uses the same structure as HG‐3 Image's header.

Data Type Value Description
char[4] "HG-2" File Signature
uint32 HeaderSize Size of this header, always 12
uint32 Format(?) Some sort of format applied to the file structure
0x20 if no Base info, and 0x25 if there is Base info

StartPosition = stream.Position

Frame

Position = StartPosition + Frame.OffsetNext
StartPosition = stream.Position
do while Frame.OffsetNext != 0

This always immediately precedes Tag "stdinfo".

Data Type Value Description
uint32 Width Condensed width of the image (without transparency)
uint32 Height Condensed height of the image (without transparency)
uint32 BitDepth Number of bits per pixel, 24 or 32
uint32 Unknown Unknown 4-byte value 1
uint32 Unknown Unknown 4-byte value 2
uint32 CompressedDataLength Compressed length of unrle copy data
uint32 DecompressedDataLength Decompressed length of unrle copy data
uint32 CompressedCmdLength Compressed length of unrle copy cmd bits
uint32 DecompressedCmdLength Decompressed length of unrle copy cmd bits
uint32 ExtraLength Presumably offset before this field to the image data
uint32 ID Identifier for the frame used in game
uint32 TotalWidth Total width of the image with OffsetX applied
uint32 TotalHeight Total height of the image with OffsetY applied
int32 OffsetX Horizontal offset of the image from the left
int32 OffsetY Vertical offset of the image from the top
bool32 IsTransparent True if transparency is used in the image
uint32 OffsetNext Offset to the next frame

Frame Base

This always immediately precedes the Frame info.

if (Header.Format == 0x25)

Data Type Value Description
int32 BaseX Horizontal center of the image, used for drawing in-game
int32 BaseY Vertical center of the image, used for drawing in-game

Image Data

This always immediately precedes the Frame info/Frame Base.

Data Type Value Description
byte[CompressedDataLength] UnrleData Compressed unrle copy data
byte[CompressedCmdLength] UnrleCmd Compressed unrle copy cmd bits

See ProcessImage for how standard HG-2 and HG-3 images are processed.

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /