feat(drawing): PaletteResolver — shared legacy palette resolution (.epf + khan) - #21
Merged
Conversation
Implements comhaigne's palette-resolution.md (transcribed from ChaosAssetManager)
as the single source of truth all consumers (foscail, Brigid, dalib-ts, Taliesin)
can share instead of re-deriving. Selects a palette; does not decode or draw.
Scope this PR: .epf archive rules + the khan family — the immediate UI-extraction
need, and conflict-free with existing code.
- Contract: ResolvedPalette record (palette, paletteNumber, isLuminanceBlended,
kind, ruleId), PaletteSourceKind {Table,Indexed,Fixed,Constant}, ArchiveProvider
delegate for sibling access (no hardcoded paths). Instance-scoped caches (the
spec's answer to CAM's 27-field static Reset()).
- Rules: legend.dat (9 branches), setoa.dat (25 hand-mapped gui rules, order
hazards preserved, field000 wart), roh.dat (efct/mefc), national/misc (sibling
legend.pal), and khan (letter remap a->b/g->c/j->c/o->m/s->p, table letters with
male/female override, body -> lowest palm, pants -> color0.tbl dye index 0).
- Luminance >=1000 reported via the flag; the arithmetic stays in PaletteLookup.
- 22 tests: first-match order hazards (dlgcre01/emot00/lsbackm/setup12), the four
kinds, khan remap+override+luminance, sibling legend.pal, the field000 wart.
Deferred (own follow-up): .hpf/.mpf/tileset rules — the tileset mpt +1 (spec) vs
+2 (DALib RenderMap) keying needs reconciling against retail first. Then wire
foscail's ConvertEpf to the resolver (supersedes PR #20) and agree the shared
conformance fixture + ruleId strings with dalib-ts.
Co-Authored-By: Imbas <imbas@eris.co>
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.
feat(drawing): PaletteResolver — shared legacy palette resolution
Implements comhaigne's palette-resolution.md (transcribed from ChaosAssetManager)
as the single source of truth all consumers (foscail, Brigid, dalib-ts, Taliesin)
can share instead of re-deriving. Selects a palette; does not decode or draw.
Scope this PR: .epf archive rules + the khan family — the immediate UI-extraction
need, and conflict-free with existing code.
kind, ruleId), PaletteSourceKind {Table,Indexed,Fixed,Constant}, ArchiveProvider
delegate for sibling access (no hardcoded paths). Instance-scoped caches (the
spec's answer to CAM's 27-field static Reset()).
hazards preserved, field000 wart), roh.dat (efct/mefc), national/misc (sibling
legend.pal), and khan (letter remap a->b/g->c/j->c/o->m/s->p, table letters with
male/female override, body -> lowest palm, pants -> color0.tbl dye index 0).
kinds, khan remap+override+luminance, sibling legend.pal, the field000 wart.
Deferred (own follow-up): .hpf/.mpf/tileset rules — the tileset mpt +1 (spec) vs
+2 (DALib RenderMap) keying needs reconciling against retail first. Then wire
foscail's ConvertEpf to the resolver (supersedes PR #20) and agree the shared
conformance fixture + ruleId strings with dalib-ts.
Co-Authored-By: Imbas imbas@eris.co
Generated with Imbas imbas@eris.co