From 69dbda73062fc8d509e2c9072df6d15d7b4e9d2f Mon Sep 17 00:00:00 2001 From: Ramen2X Date: Thu, 28 Mar 2024 16:45:34 -0400 Subject: [PATCH] implement/match ReadNamedTexture() --- LEGO1/lego/legoomni/src/common/legoutils.cpp | 24 ++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/LEGO1/lego/legoomni/src/common/legoutils.cpp b/LEGO1/lego/legoomni/src/common/legoutils.cpp index 8491f736..8dbb1b97 100644 --- a/LEGO1/lego/legoomni/src/common/legoutils.cpp +++ b/LEGO1/lego/legoomni/src/common/legoutils.cpp @@ -377,10 +377,30 @@ void SetLightPosition(MxU32) { } -// STUB: LEGO1 0x1003f3b0 +// FUNCTION: LEGO1 0x1003f3b0 LegoNamedTexture* ReadNamedTexture(LegoFile* p_file) { - return NULL; + LegoTexture* texture = NULL; + LegoNamedTexture* namedTexture = NULL; + MxString string; + + p_file->ReadString(string); + + texture = new LegoTexture(); + if (texture != NULL) { + if (texture->Read(p_file, 0) != SUCCESS) { + delete texture; + + return namedTexture; + } + + namedTexture = new LegoNamedTexture(string.GetData(), texture); + if (namedTexture == NULL && texture != NULL) { + delete texture; + } + } + + return namedTexture; } // STUB: LEGO1 0x1003f540