Skip to content

libeq_wld: preserve and expose texture animation metadata - #58

Open
djhenry wants to merge 1 commit into
cjab:mainfrom
djhenry:codex/texture-animation-metadata
Open

djhenry wants to merge 1 commit into
cjab:mainfrom
djhenry:codex/texture-animation-metadata

Conversation

@djhenry

@djhenry djhenry commented Oct 8, 2026

Copy link
Copy Markdown

When HAS_CURRENT_FRAME is set, SimpleSpriteDef::parse() consumes the current-frame word but stores None. Serialization then retains the flag while omitting the word, shifting subsequent fields or preventing a round trip. Retain the parsed value and expose optional current_frame() and sleep() accessors on the high-level Texture API.

The accessors preserve absent fields, explicit zero and other raw u32 values. They do not assign timing units or playback semantics. Sleep retains its existing IS_ANIMATED && HAS_SLEEP presence rule. Synthetic tests exercise literal parser/serializer round trips and complete WLD material-to-texture reference resolution across nine flag/value combinations, including non-animated current-frame metadata and HAS_SLEEP without animation.

Closes #57.

Validation: author and independent workspace suites each passed 134 tests, 1 ignored; the serde-enabled WLD suite passed 118 tests, 1 ignored. The original parser failed the literal round-trip regression. Three independent mutations (discarding the parsed value or dropping explicit zero in either accessor) failed their targeted regressions; restored tests passed. A separate public-API probe loaded sixteen independently encoded synthetic WLD artifacts and verified metadata, flag gating and ordered image references. No native assets are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve and expose optional texture animation metadata

1 participant