fix(erf): drop NWN2 formats gr2, wlk and xml from the restype table
ci / ci (pull_request) Successful in 3m21s
ci / ci (pull_request) Successful in 3m21s
Follow-up to the mdb removal in the previous commit. Three of the six extensions #64 listed as deliberate local additions are NWN2 formats, not NWN:EE ones, and belong in an NWN:EE tool no more than mdb did. Checked against xoreos (src/aurora/types.h), which covers every Aurora game and so distinguishes the games' tables: gr2 4003, sits in the NWN2 block (MDB2 4000, MDA2 4001, SPT2 4002, GR2 4003, PWC 4008). Granny is NWN2; NWN:EE does not use it. wlk xoreos numbers it 20004 and xml 20003, both above xml kFileTypeMAXArchive in the section headed "Entries for files not found in archives with numerical type IDs / Found in NWN2's ZIP files". Neither has an archive restype in any Aurora game, so Crucible's 0x0BCC and 0x0BCD were invented outright, in a band Aurora does use elsewhere (3022 FSM, 3023 ART). NWN:EE covers those jobs with formats already in the table: wok, pwk and dwk for walkmeshes, and EE's own UI XML loads from ui/ovr rather than from a HAK by restype, which is consistent with upstream neverwinter.nim registering no xml number. The remaining three local additions stay. lyt 3000, vis 3001 and mdx 3008 are real Aurora archive types that NWN1 ships in its own data/*.bif; xoreos gives the same numbers. Upstream simply does not list them. No asset in the corpus uses gr2, wlk or xml, so nothing stops building. Also drops them from AssetExtensions, and records the rule in a comment on the table plus a test, so the next NWN2 format gets caught. Refs ShadowsOverWestgate/sow-tools#64 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+12
-9
@@ -68,9 +68,18 @@ type resourceEntry struct {
|
||||
}
|
||||
|
||||
// extensionTypes and typeExtensions must stay exact inverses of each other;
|
||||
// init() panics if they drift apart. Numbers below 0x0BB8 follow upstream
|
||||
// neverwinter.nim (neverwinter/restype.nim). The 0x0BB8 and up entries are
|
||||
// local additions for source formats upstream does not register.
|
||||
// init() panics if they drift apart.
|
||||
//
|
||||
// Numbers below 0x0BB8 follow upstream neverwinter.nim
|
||||
// (neverwinter/restype.nim). The 0x0BB8 and up entries are lyt/vis/mdx: real
|
||||
// Aurora archive types that NWN1 ships in its own data/*.bif but upstream
|
||||
// happens not to register. xoreos corroborates those three numbers
|
||||
// (src/aurora/types.h).
|
||||
//
|
||||
// This table is NWN:EE only. Do not add NWN2 formats (mdb, gr2, wlk, xml):
|
||||
// NWN:EE either gives that number to something else (2070 is xbc here and mdb
|
||||
// in NWN2) or has no number for it at all, so packing one into a HAK writes a
|
||||
// resource the game misreads. See the reserved list in erf_test.go.
|
||||
var extensionTypes = map[string]uint16{
|
||||
"res": 0x0000,
|
||||
"bmp": 0x0001,
|
||||
@@ -131,9 +140,6 @@ var extensionTypes = map[string]uint16{
|
||||
"lyt": 0x0BB8,
|
||||
"vis": 0x0BB9,
|
||||
"mdx": 0x0BC0,
|
||||
"wlk": 0x0BCC,
|
||||
"xml": 0x0BCD,
|
||||
"gr2": 0x0FA3,
|
||||
}
|
||||
|
||||
var typeExtensions = map[uint16]string{
|
||||
@@ -196,9 +202,6 @@ var typeExtensions = map[uint16]string{
|
||||
0x0BB8: "lyt",
|
||||
0x0BB9: "vis",
|
||||
0x0BC0: "mdx",
|
||||
0x0BCC: "wlk",
|
||||
0x0BCD: "xml",
|
||||
0x0FA3: "gr2",
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
Reference in New Issue
Block a user