(HG2, HG3): use image ID entry names, fix HG2 archive view.#479
Open
trigger-segfault wants to merge 1 commit into
Open
(HG2, HG3): use image ID entry names, fix HG2 archive view.#479trigger-segfault wants to merge 1 commit into
trigger-segfault wants to merge 1 commit into
Conversation
* Fix bug in `ArcHG2.cs` where opened images would not pass `Version` to `Hg2MetaData`, causing the reader to unpack everything as version `0x10` instead.
* Add support for viewing HG2 version `0x20` as archive, and read **real** data offset when assigning the `HeaderSize` field in `Hg2MetaData`.
* HG2 and HG3 archive image names now use **real** IDs in names, instead of image index: Aside from HG2 version `0x10`, all HG\* images contain frame IDs, which are considered part of the name (at least when used in a multi-image fashion).
* 90% of the time, these IDs will just be the index of the frame. But the other 10%, these IDs are very specifically chosen when working with user interface layers and image variations (like a button highlight state).
* When used for user interfaces, image IDs usually follow a pattern of reserving the lower **decimal** digits for image **variations**, and higher decimal digits for different UI elements (i.e. save/load/title/config button, background, etc.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change HG2/HG3 archive view entry names to use real ID names.
Fix multiple errors in
ArcHG2.csimage view, and add version0x20support.Changes
ArcHG2.cswhere opened images would not passVersiontoHg2MetaData, causing the reader to unpack everything as version0x10instead.0x20as archive, and read real data offset when assigning theHeaderSizefield inHg2MetaData.0x10, all HG* images contain frame IDs, which are considered part of the name (at least when used in a multi-image fashion).Example of new frame ID names:
About new fields referenced
HG3 fields referenced
Frame Header
uint32uint32"stdinfo"tagHG2 fields referenced
See Version 0x20 fields: ID and OffsetData (referenced for the
HeaderSizefield assignment)Frame Metadata: Version 0x10
uint32uint32uint32uint32uint32uint32uint32uint32uint32Frame Metadata: Version 0x20 (extended)
uint320x20)Alternatively consider as extra metadata size
uint32uint32uint32int32int32bool32uint32Value is
0if no more framesFrame Metadata: Version 0x25 (extended)
int32int32