dm2-graphics: image_offset implements only one of DM2_QUERY_GDAT_PICT_OFFSET's three displacement paths; 8-bit header offset bytes discarded #191
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Archive::image_offset(crates/dm2-graphics/src/lib.rs~296) implements only one of the three displacement paths of the engine'sDM2_QUERY_GDAT_PICT_OFFSET([SKPROJECT] v5/skgdtqdb.cpp:188-226):x_mark == -32cls3 = 0x0Cinline recordimage_offset)y_mark == 31)[4],[5](s84prg5->b_04/b_05)(x_mark, y_mark)from the header marksImage, butimage_offsetreturnsNoneSo a caller placing sprites via
image_offsetgetsNonefor every non-sentinel record even though the engine has a real displacement, and for 8-bit records the information isn't recoverable at all —decode_8bitskips bytes[4..6]entirely (crates/dm2-graphics/src/image/decoders.rs~89).Fix direction
Surface the 8-bit header bytes
[4],[5]onImage(they're currently parsed past), and extendimage_offset(or addsprite_offset(rec, image)) to reproduce the full engine dispatch:x_mark == -32→ 0x0C record; 8-bit →(b4, b5); otherwise →(x_mark, y_mark). The engine composes the result as(X << 8) | Y— same packing the 0x0C inline records already use, so the existing unpack helper generalises.Fixed by #208 (merged into
main).