feat(texture): load masks from XML and release mask textures

- <Texture mask="path"> applies texture:SetMask(path).
- <MaskTexture> in a <Layer> builds a MaskTexture, and its
  <MaskedTextures> entries (childKey or target) attach it to textures.
  xml/Layers.cpp replaces the engine's layer loader with the same loop
  plus a MaskTexture branch, so the engine no longer warns on the tag.
- SetMask closes the mask texture's handle on replace, clear, region
  reuse and reload, as SetTexture does with the texture it held.
- SetMask keeps its previous mask when the file does not load, using
  SetTexture's own status test, instead of masking with the opaque
  fallback texture.
- API.md documents the XML forms and that a mask with an opaque edge
  does not clip past its rectangle (the device has no border address
  mode).
This commit is contained in:
Brues
2026-10-20 06:08:38 -05:00
parent a446e4cf8c
commit 943597ca0d
8 changed files with 363 additions and 33 deletions
+2 -2
View File
@@ -63,12 +63,12 @@ void LoadNode(void *object, const void *node, void *status) {
Game::Read<NodeLoader_t>(vtable, Offsets::VTBL_XML_NODE_LOADER)(self, node, status);
}
void Warn(void *status, const char *fmt, const char *a, const char *b) {
void Warn(void *status, const char *fmt, const char *a, const char *b, const char *c) {
if (status == nullptr)
return;
const void *vtable = Game::Read<const void *>(status, 0);
Game::Read<StatusAdd_t>(vtable, Offsets::VTBL_XML_STATUS_ADD)(
status, Offsets::XML_STATUS_WARNING, fmt, a, b);
status, Offsets::XML_STATUS_WARNING, fmt, a, b, c);
}
bool PushWrapper(void *L, void *object) {