Files
Dave Johnson 9dbcef7557 EBX writer: a new array takes the hash of its own field
An array record's hash is one per field type in a document (every
array the base game's files hold follows this, and each such hash is a
key of the document's reflection group table, now read). A new array
takes the hash of an existing array of the same holding type and field;
callers can ask the writer to refuse when there is none, and the mod
merge keeps the old fallback. Checked on the game's own
level documents.
2026-10-16 20:58:02 +00:00

19 lines
707 B
C++

#pragma once
#include "ebx_document.h"
#include <cstdint>
#include <vector>
namespace dingosdk::frostbite::ebx {
[[nodiscard]] std::uint16_t ensure_fixup_type(Document& document, std::int32_t descriptor);
// A new array (one no record was read for) takes the hash of an array the document read for the
// same field of the same type. Without one it borrows another array's hash (the merge's way), or,
// with refuseNewArrayHashes (the map builder's), the write is refused: the RFL2 group table would
// need a new entry. A hash that is not a key of that table is refused the same way.
[[nodiscard]] std::vector<std::byte> write_document(const Document& document, bool refuseNewArrayHashes = false);
}