From e794580ea8bd9b1d6a05622c29b572ccde4e66ed Mon Sep 17 00:00:00 2001 From: fallenoak Date: Mon, 27 Oct 2025 21:14:33 -0500 Subject: [PATCH] feat(model): handle texture replacement model calls on model load --- src/model/CM2Model.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/model/CM2Model.cpp b/src/model/CM2Model.cpp index 1b9122f..d7bfe09 100644 --- a/src/model/CM2Model.cpp +++ b/src/model/CM2Model.cpp @@ -1181,7 +1181,11 @@ int32_t CM2Model::InitializeLoaded() { switch (modelCall->type) { case 0: { - // TODO + auto textureId = modelCall->args[0]; + auto texture = *reinterpret_cast(&modelCall->args[1]); + + this->ReplaceTexture(textureId, texture); + break; } @@ -1268,7 +1272,7 @@ int32_t CM2Model::InitializeLoaded() { this->m_modelCallList = modelCall->modelCallNext; if (modelCall->type == 0) { - HTEXTURE texture = reinterpret_cast(&modelCall->args[1]); + auto texture = *reinterpret_cast(&modelCall->args[1]); if (texture) { HandleClose(texture);