From f6e44b1c1b73d18e1acde199308c6f2a80507f49 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Tue, 5 Mar 2024 12:38:53 -0500 Subject: [PATCH] Implement LegoROI::Read and geom library (#627) * Implement LegoROI::Read and geom library * Match * Match * Fixes * Fix --- CMakeLists.txt | 16 +- LEGO1/lego/legoomni/include/legogamestate.h | 2 +- .../legoomni/src/common/legogamestate.cpp | 6 +- LEGO1/lego/sources/geom/legobox.cpp | 19 ++ LEGO1/lego/sources/geom/legobox.h | 32 ++ LEGO1/lego/sources/geom/legosphere.cpp | 19 ++ LEGO1/lego/sources/geom/legosphere.h | 21 ++ LEGO1/lego/sources/geom/legovertex.cpp | 30 ++ LEGO1/lego/sources/geom/legovertex.h | 30 ++ LEGO1/lego/sources/roi/legoroi.cpp | 286 +++++++++++++++++- LEGO1/lego/sources/roi/legoroi.h | 17 +- LEGO1/viewmanager/viewlod.h | 1 + 12 files changed, 451 insertions(+), 28 deletions(-) create mode 100644 LEGO1/lego/sources/geom/legobox.cpp create mode 100644 LEGO1/lego/sources/geom/legobox.h create mode 100644 LEGO1/lego/sources/geom/legosphere.cpp create mode 100644 LEGO1/lego/sources/geom/legosphere.h create mode 100644 LEGO1/lego/sources/geom/legovertex.cpp create mode 100644 LEGO1/lego/sources/geom/legovertex.h diff --git a/CMakeLists.txt b/CMakeLists.txt index be58cb6a..2073555c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,8 +141,18 @@ add_library(roi STATIC ) register_lego1_target(roi) set_property(TARGET roi PROPERTY ARCHIVE_OUTPUT_NAME "roi$<$:d>") -target_include_directories(roi PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util") -target_link_libraries(roi PRIVATE viewmanager) +target_include_directories(roi PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util") +target_link_libraries(roi PRIVATE viewmanager Vec::Vec) + +add_library(geom STATIC + LEGO1/lego/sources/geom/legobox.cpp + LEGO1/lego/sources/geom/legosphere.cpp + LEGO1/lego/sources/geom/legovertex.cpp +) +register_lego1_target(geom) +set_property(TARGET geom PROPERTY ARCHIVE_OUTPUT_NAME "geom$<$:d>") +target_include_directories(geom PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util") +target_link_libraries(geom PRIVATE) add_library(anim STATIC LEGO1/lego/sources/anim/legoanim.cpp @@ -409,7 +419,7 @@ target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/lego/legoomni/include") # Link libraries -target_link_libraries(lego1 PRIVATE tglrl viewmanager realtime mxdirectx roi anim Vec::Vec dinput dxguid misc 3dmanager omni) +target_link_libraries(lego1 PRIVATE tglrl viewmanager realtime mxdirectx roi geom anim Vec::Vec dinput dxguid misc 3dmanager omni) if (ISLE_USE_SMARTHEAP) foreach(tgt IN LISTS lego1_targets) diff --git a/LEGO1/lego/legoomni/include/legogamestate.h b/LEGO1/lego/legoomni/include/legogamestate.h index 7358df5f..fcb0be0c 100644 --- a/LEGO1/lego/legoomni/include/legogamestate.h +++ b/LEGO1/lego/legoomni/include/legogamestate.h @@ -195,7 +195,7 @@ class LegoGameState { Area m_unk0x42c; // 0x42c }; -MxBool ROIHandlerFunction(char* p_input, char* p_output, MxU32 p_copyLen); +MxBool ROIHandlerFunction(const char* p_input, char* p_output, MxU32 p_copyLen); // SYNTHETIC: LEGO1 0x1003c860 // LegoGameState::ScoreItem::ScoreItem diff --git a/LEGO1/lego/legoomni/src/common/legogamestate.cpp b/LEGO1/lego/legoomni/src/common/legogamestate.cpp index ccd0a445..9f296ff7 100644 --- a/LEGO1/lego/legoomni/src/common/legogamestate.cpp +++ b/LEGO1/lego/legoomni/src/common/legogamestate.cpp @@ -116,7 +116,7 @@ LegoGameState::LegoGameState() // FUNCTION: LEGO1 0x10039720 LegoGameState::~LegoGameState() { - LegoROI::SetSomeHandlerFunction(NULL); + LegoROI::FUN_100a9d30(NULL); if (m_stateCount) { for (MxS16 i = 0; i < m_stateCount; i++) { @@ -965,11 +965,11 @@ void LegoGameState::SetColors() // FUNCTION: LEGO1 0x1003bac0 void LegoGameState::SetROIHandlerFunction() { - LegoROI::SetSomeHandlerFunction(&ROIHandlerFunction); + LegoROI::FUN_100a9d30(&ROIHandlerFunction); } // FUNCTION: LEGO1 0x1003bad0 -MxBool ROIHandlerFunction(char* p_input, char* p_output, MxU32 p_copyLen) +MxBool ROIHandlerFunction(const char* p_input, char* p_output, MxU32 p_copyLen) { if (p_output != NULL && p_copyLen != 0 && (strnicmp(p_input, "INDIR-F-", strlen("INDIR-F-")) == 0 || diff --git a/LEGO1/lego/sources/geom/legobox.cpp b/LEGO1/lego/sources/geom/legobox.cpp new file mode 100644 index 00000000..0a5f2bdb --- /dev/null +++ b/LEGO1/lego/sources/geom/legobox.cpp @@ -0,0 +1,19 @@ +#include "legobox.h" + +#include "decomp.h" +#include "misc/legoutil.h" + +DECOMP_SIZE_ASSERT(LegoBox, 0x18) + +// FUNCTION: LEGO1 0x100d3740 +LegoResult LegoBox::Read(LegoStorage* p_storage) +{ + LegoResult result; + if ((result = m_min.Read(p_storage)) != SUCCESS) { + return result; + } + if ((result = m_max.Read(p_storage)) != SUCCESS) { + return result; + } + return SUCCESS; +} diff --git a/LEGO1/lego/sources/geom/legobox.h b/LEGO1/lego/sources/geom/legobox.h new file mode 100644 index 00000000..f0816c98 --- /dev/null +++ b/LEGO1/lego/sources/geom/legobox.h @@ -0,0 +1,32 @@ +#ifndef __LEGOBOX_H +#define __LEGOBOX_H + +#include "legovertex.h" + +// SIZE 0x18 +class LegoBox { +public: + LegoVertex& GetMin() { return m_min; } + void SetMin(LegoVertex& p_min) { m_min = p_min; } + LegoVertex& GetMax() { return m_max; } + void SetMax(LegoVertex& p_max) { m_max = p_max; } + // LegoVertex GetCenter() + // { + // return LegoVertex( + // (m_min.GetX() + m_max.GetX()) / 2, + // (m_min.GetY() + m_max.GetY()) / 2, + // (m_min.GetZ() + m_max.GetZ()) / 2 + // ); + // } + LegoFloat GetDX() { return m_max.GetX() - m_min.GetX(); } + LegoFloat GetDY() { return m_max.GetY() - m_min.GetY(); } + LegoFloat GetDZ() { return m_max.GetZ() - m_min.GetZ(); } + LegoBool IsEmpty() { return m_min.IsOrigin() && m_max.IsOrigin(); } + LegoResult Read(LegoStorage* p_storage); + +protected: + LegoVertex m_min; // 0x00 + LegoVertex m_max; // 0x0c +}; + +#endif // __LEGOBOX_H diff --git a/LEGO1/lego/sources/geom/legosphere.cpp b/LEGO1/lego/sources/geom/legosphere.cpp new file mode 100644 index 00000000..7b916326 --- /dev/null +++ b/LEGO1/lego/sources/geom/legosphere.cpp @@ -0,0 +1,19 @@ +#include "legosphere.h" + +#include "decomp.h" +#include "misc/legostorage.h" + +DECOMP_SIZE_ASSERT(LegoSphere, 0x10) + +// FUNCTION: LEGO1 0x100d3770 +LegoResult LegoSphere::Read(LegoStorage* p_storage) +{ + LegoResult result; + if ((result = m_center.Read(p_storage)) != SUCCESS) { + return result; + } + if ((result = p_storage->Read(&m_radius, sizeof(m_radius))) != SUCCESS) { + return result; + } + return SUCCESS; +} diff --git a/LEGO1/lego/sources/geom/legosphere.h b/LEGO1/lego/sources/geom/legosphere.h new file mode 100644 index 00000000..566713a2 --- /dev/null +++ b/LEGO1/lego/sources/geom/legosphere.h @@ -0,0 +1,21 @@ +#ifndef __LEGOSPHERE_H +#define __LEGOSPHERE_H + +#include "legovertex.h" + +// SIZE 0x10 +class LegoSphere { +public: + LegoSphere() { m_radius = 0.0F; } + LegoVertex& GetCenter() { return m_center; } + void SetCenter(LegoVertex& p_center) { m_center = p_center; } + LegoFloat GetRadius() { return m_radius; } + void SetRadius(LegoFloat p_radius) { m_radius = p_radius; } + LegoResult Read(LegoStorage* p_storage); + +protected: + LegoVertex m_center; // 0x00 + LegoFloat m_radius; // 0x0c +}; + +#endif // __LEGOSPHERE_H diff --git a/LEGO1/lego/sources/geom/legovertex.cpp b/LEGO1/lego/sources/geom/legovertex.cpp new file mode 100644 index 00000000..2977d60a --- /dev/null +++ b/LEGO1/lego/sources/geom/legovertex.cpp @@ -0,0 +1,30 @@ +#include "legovertex.h" + +#include "decomp.h" +#include "misc/legostorage.h" + +DECOMP_SIZE_ASSERT(LegoVertex, 0x0c) + +// FUNCTION: LEGO1 0x100d37b0 +LegoVertex::LegoVertex() +{ + m_coordinates[0] = 0.0F; + m_coordinates[1] = 0.0F; + m_coordinates[2] = 0.0F; +} + +// FUNCTION: LEGO1 0x100d37c0 +LegoResult LegoVertex::Read(LegoStorage* p_storage) +{ + LegoResult result; + if ((result = p_storage->Read(&m_coordinates[0], sizeof(m_coordinates[0]))) != SUCCESS) { + return result; + } + if ((result = p_storage->Read(&m_coordinates[1], sizeof(m_coordinates[1]))) != SUCCESS) { + return result; + } + if ((result = p_storage->Read(&m_coordinates[2], sizeof(m_coordinates[2]))) != SUCCESS) { + return result; + } + return SUCCESS; +} diff --git a/LEGO1/lego/sources/geom/legovertex.h b/LEGO1/lego/sources/geom/legovertex.h new file mode 100644 index 00000000..91aca80a --- /dev/null +++ b/LEGO1/lego/sources/geom/legovertex.h @@ -0,0 +1,30 @@ +#ifndef __LEGOVERTEX_H +#define __LEGOVERTEX_H + +#include "misc/legotypes.h" + +class LegoStorage; + +// SIZE 0x0c +class LegoVertex { +public: + LegoVertex(); + LegoFloat GetCoordinate(LegoU32 p_i) { return m_coordinates[p_i]; } + void SetCoordinate(LegoU32 p_i, LegoFloat p_coordinate) { m_coordinates[p_i] = p_coordinate; } + LegoFloat GetX() { return m_coordinates[0]; } + void SetX(LegoFloat p_x) { m_coordinates[0] = p_x; } + LegoFloat GetY() { return m_coordinates[1]; } + void SetY(LegoFloat p_y) { m_coordinates[1] = p_y; } + LegoFloat GetZ() { return m_coordinates[2]; } + void SetZ(LegoFloat p_z) { m_coordinates[2] = p_z; } + LegoBool IsOrigin() { return m_coordinates[0] == 0.0 && m_coordinates[1] == 0.0 && m_coordinates[2] == 0.0; } + LegoResult Read(LegoStorage* p_storage); + + LegoFloat& operator[](int i) { return m_coordinates[i]; } + LegoFloat operator[](int i) const { return m_coordinates[i]; } + +protected: + LegoFloat m_coordinates[3]; // 0x00 +}; + +#endif // __LEGOVERTEX_H diff --git a/LEGO1/lego/sources/roi/legoroi.cpp b/LEGO1/lego/sources/roi/legoroi.cpp index 16051cc4..e6f7aa33 100644 --- a/LEGO1/lego/sources/roi/legoroi.cpp +++ b/LEGO1/lego/sources/roi/legoroi.cpp @@ -1,8 +1,13 @@ #include "legoroi.h" +#include "geom/legobox.h" +#include "geom/legosphere.h" +#include "misc/legocontainer.h" +#include "misc/legostorage.h" #include "tgl/d3drm/impl.h" #include +#include DECOMP_SIZE_ASSERT(LegoROI, 0x108) DECOMP_SIZE_ASSERT(TimeROI, 0x10c) @@ -42,8 +47,17 @@ ROIColorAlias g_roiColorAliases[22] = { // GLOBAL: LEGO1 0x10101368 int g_roiConfig = 100; +// GLOBAL: LEGO1 0x10101370 +const char* g_unk0x10101370[] = {"bike", "moto", NULL}; + +// GLOBAL: LEGO1 0x10101380 +const char* g_unk0x10101380[] = {"bike", "moto", "haus", NULL}; + +// GLOBAL: LEGO1 0x10101390 +const char* g_unk0x10101390[] = {"rcuser", "jsuser", "dunebugy", "chtrblad", "chtrbody", "chtrshld", NULL}; + // GLOBAL: LEGO1 0x101013ac -ROIHandler g_someHandlerFunction = NULL; +ROIHandler g_unk0x101013ac = NULL; // GLOBAL: LEGO1 0x101013d4 LPDIRECT3DRMMATERIAL g_unk0x101013d4 = NULL; @@ -90,7 +104,7 @@ LegoROI::~LegoROI() } } -// STUB: LEGO1 0x100a84a0 +// FUNCTION: LEGO1 0x100a84a0 LegoResult LegoROI::Read( OrientableROI* p_unk0xd4, Tgl::Renderer* p_renderer, @@ -99,12 +113,247 @@ LegoResult LegoROI::Read( LegoStorage* p_storage ) { - return SUCCESS; + LegoResult result = FAILURE; + LegoU32 i, j; + LegoU32 numLODs, surplusLODs; + LegoROI* roi; + LegoLOD* lod; + LegoU32 length, roiLength; + LegoChar *roiName, *textureName; + LegoTextureInfo* textureInfo; + ViewLODList* lodList; + LegoU32 numROIs; + LegoSphere sphere; + LegoBox box; + + m_unk0xd4 = p_unk0xd4; + + if (p_storage->Read(&length, sizeof(length)) != SUCCESS) { + goto done; + } + m_name = new LegoChar[length + 1]; + if (p_storage->Read(m_name, length) != SUCCESS) { + goto done; + } + m_name[length] = '\0'; + strlwr(m_name); + + if (sphere.Read(p_storage) != SUCCESS) { + goto done; + } + + SET3(m_sphere.Center(), sphere.GetCenter()); + m_sphere.Radius() = sphere.GetRadius(); + m_world_bounding_sphere.Radius() = m_sphere.Radius(); + + if (box.Read(p_storage) != SUCCESS) { + goto done; + } + + SET3(m_unk0x80.Min(), box.GetMin()); + SET3(m_unk0x80.Max(), box.GetMax()); + + if (p_storage->Read(&length, sizeof(length)) != SUCCESS) { + goto done; + } + + if (length != 0) { + textureName = new LegoChar[length + 1]; + if (p_storage->Read(textureName, length) != SUCCESS) { + goto done; + } + textureName[length] = '\0'; + strlwr(textureName); + } + else { + textureName = NULL; + } + + if (p_storage->Read(&m_unk0x100, sizeof(m_unk0x100)) != SUCCESS) { + goto done; + } + + if (m_unk0x100) { + for (roiLength = strlen(m_name); roiLength; roiLength--) { + if (m_name[roiLength - 1] < '0' || m_name[roiLength - 1] > '9') { + break; + } + } + + roiName = new LegoChar[roiLength + 1]; + memcpy(roiName, m_name, roiLength); + roiName[roiLength] = '\0'; + + lodList = p_viewLODListManager->Lookup(roiName); + delete[] roiName; + + if (lodList == NULL) { + goto done; + } + } + else { + if (p_storage->Read(&numLODs, sizeof(numLODs)) != SUCCESS) { + goto done; + } + + if (!numLODs) { + lodList = NULL; + } + else { + const LegoChar* roiName = m_name; + LegoU32 offset; + + if (p_storage->Read(&offset, sizeof(offset)) != SUCCESS) { + goto done; + } + + if (numLODs > g_roiConfig) { + surplusLODs = numLODs - g_roiConfig; + numLODs = g_roiConfig; + } + else { + surplusLODs = 0; + } + + if (g_roiConfig <= 2) { + for (i = 0; g_unk0x10101380[i] != NULL; i++) { + if (!strnicmp(m_name, g_unk0x10101380[i], 4)) { + roiName = g_unk0x10101380[i]; + break; + } + } + } + else { + for (i = 0; g_unk0x10101370[i] != NULL; i++) { + if (!strnicmp(m_name, g_unk0x10101370[i], 4)) { + roiName = g_unk0x10101370[i]; + break; + } + } + } + + if ((lodList = p_viewLODListManager->Lookup(roiName))) { + for (j = 0; g_unk0x10101390[j] != NULL; j++) { + if (!strcmpi(g_unk0x10101390[j], roiName)) { + break; + } + } + + if (g_unk0x10101390[j] != NULL) { + while (lodList->Size()) { + delete const_cast(lodList->PopBack()); + } + + for (j = 0; j < numLODs; j++) { + lod = new LegoLOD(p_renderer); + if (lod->Read(p_renderer, p_textureContainer, p_storage) != SUCCESS) { + goto done; + } + + if (j == 0) { + if (surplusLODs != 0 && lod->GetUnknown0x08Test()) { + numLODs++; + } + } + + lodList->PushBack(lod); + } + } + } + else { + for (i = 0; i < numLODs; i++) { + lod = new LegoLOD(p_renderer); + if (lod->Read(p_renderer, p_textureContainer, p_storage) != SUCCESS) { + goto done; + } + + if (i == 0) { + if (surplusLODs != 0 && lod->GetUnknown0x08Test()) { + numLODs++; + } + } + + if (i == 0 && (lodList = p_viewLODListManager->Create(roiName, numLODs)) == NULL) { + goto done; + } + + lodList->PushBack(lod); + } + } + + p_storage->SetPosition(offset); + } + } + + SetLODList(lodList); + + if (lodList != NULL) { + lodList->Release(); + } + + if (textureName != NULL) { + if (!strnicmp(textureName, "t_", 2)) { + textureInfo = p_textureContainer->Get(textureName + 2); + + if (textureInfo == NULL) { + goto done; + } + + FUN_100a9210(textureInfo); + FUN_100a9170(1.0F, 1.0F, 1.0F, 0.0F); + } + else { + LegoFloat red = 1.0F; + LegoFloat green = 0.0F; + LegoFloat blue = 1.0F; + LegoFloat other = 0.0F; + FUN_100a9bf0(textureName, red, green, blue, other); + FUN_100a9170(red, green, blue, other); + } + } + + if (p_storage->Read(&numROIs, sizeof(numROIs)) != SUCCESS) { + goto done; + } + + if (numROIs > 0) { + comp = new CompoundObject; + } + + for (i = 0; i < numROIs; i++) { + // Create and initialize a sub-component + roi = new LegoROI(p_renderer); + if (roi->Read(this, p_renderer, p_viewLODListManager, p_textureContainer, p_storage) != SUCCESS) { + goto done; + } + // Add the new sub-component to this ROI's protected list + comp->push_back(roi); + } + + result = SUCCESS; + +done: + return result; } // STUB: LEGO1 0x100a90f0 LegoResult LegoROI::SetFrame(LegoAnim* p_anim, LegoTime p_time) { + // TODO + return SUCCESS; +} + +// STUB: LEGO1 0x100a9170 +LegoResult LegoROI::FUN_100a9170(LegoFloat, LegoFloat, LegoFloat, LegoFloat) +{ + // TODO + return SUCCESS; +} + +// STUB: LEGO1 0x100a9210 +LegoResult LegoROI::FUN_100a9210(LegoTextureInfo* p_textureInfo) +{ + // TODO return SUCCESS; } @@ -115,22 +364,16 @@ TimeROI::TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, LegoTime p_t } // FUNCTION: LEGO1 0x100a9bf0 -unsigned char LegoROI::CallTheHandlerFunction( - char* p_param, - float& p_red, - float& p_green, - float& p_blue, - float& p_other -) +unsigned char LegoROI::FUN_100a9bf0(const char* p_param, float& p_red, float& p_green, float& p_blue, float& p_other) { // TODO if (p_param == NULL) { return FALSE; } - if (g_someHandlerFunction) { + if (g_unk0x101013ac) { char buf[32]; - if (g_someHandlerFunction(p_param, buf, 32)) { + if (g_unk0x101013ac(p_param, buf, 32)) { p_param = buf; } } @@ -139,7 +382,13 @@ unsigned char LegoROI::CallTheHandlerFunction( } // FUNCTION: LEGO1 0x100a9c50 -unsigned char LegoROI::ColorAliasLookup(char* p_param, float& p_red, float& p_green, float& p_blue, float& p_other) +unsigned char LegoROI::ColorAliasLookup( + const char* p_param, + float& p_red, + float& p_green, + float& p_blue, + float& p_other +) { // TODO: this seems awfully hacky for these devs. is there a dynamic way // to represent `the end of this array` that would improve this? @@ -159,9 +408,9 @@ unsigned char LegoROI::ColorAliasLookup(char* p_param, float& p_red, float& p_gr } // FUNCTION: LEGO1 0x100a9d30 -void LegoROI::SetSomeHandlerFunction(ROIHandler p_func) +void LegoROI::FUN_100a9d30(ROIHandler p_func) { - g_someHandlerFunction = p_func; + g_unk0x101013ac = p_func; } // FUNCTION: LEGO1 0x100a9e10 @@ -202,6 +451,13 @@ LegoLOD::~LegoLOD() // TODO } +// STUB: LEGO1 0x100aa510 +LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_textureContainer, LegoStorage* p_storage) +{ + // TODO + return SUCCESS; +} + inline IDirect3DRM2* GetD3DRM(Tgl::Renderer* pRenderer) { return ((TglImpl::RendererImpl*) pRenderer)->ImplementationData(); diff --git a/LEGO1/lego/sources/roi/legoroi.h b/LEGO1/lego/sources/roi/legoroi.h index 7a9eaf96..5d589608 100644 --- a/LEGO1/lego/sources/roi/legoroi.h +++ b/LEGO1/lego/sources/roi/legoroi.h @@ -5,10 +5,11 @@ #include "viewmanager/viewlod.h" #include "viewmanager/viewroi.h" -typedef unsigned char (*ROIHandler)(char*, char*, unsigned int); +typedef unsigned char (*ROIHandler)(const char*, char*, unsigned int); class LegoEntity; class LegoTextureContainer; +struct LegoTextureInfo; class LegoStorage; class LegoAnim; @@ -25,6 +26,8 @@ class LegoLOD : public ViewLOD { // FUNCTION: LEGO1 0x100aae80 float VTable0x10() override { return 0.0; } // vtable+0x10 + LegoResult Read(Tgl::Renderer*, LegoTextureContainer* p_textureContainer, LegoStorage* p_storage); + // SYNTHETIC: LEGO1 0x100aa430 // LegoLOD::`scalar deleting destructor' @@ -52,6 +55,8 @@ class LegoROI : public ViewROI { LegoTextureContainer* p_textureContainer, LegoStorage* p_storage ); + LegoResult FUN_100a9170(LegoFloat, LegoFloat, LegoFloat, LegoFloat); + LegoResult FUN_100a9210(LegoTextureInfo* p_textureInfo); LegoResult SetFrame(LegoAnim* p_anim, LegoTime p_time); float IntrinsicImportance() const override; // vtable+0x04 @@ -60,15 +65,15 @@ class LegoROI : public ViewROI { void SetDisplayBB(int p_displayBB); static void configureLegoROI(int p_roi); - static void SetSomeHandlerFunction(ROIHandler p_func); - static unsigned char CallTheHandlerFunction( - char* p_param, + static void FUN_100a9d30(ROIHandler p_func); + static unsigned char FUN_100a9bf0(const char* p_param, float& p_red, float& p_green, float& p_blue, float& p_other); + static unsigned char ColorAliasLookup( + const char* p_param, float& p_red, float& p_green, float& p_blue, float& p_other ); - static unsigned char ColorAliasLookup(char* p_param, float& p_red, float& p_green, float& p_blue, float& p_other); inline const LegoChar* GetName() const { return m_name; } inline LegoEntity* GetUnknown0x104() { return m_unk0x104; } @@ -81,7 +86,7 @@ class LegoROI : public ViewROI { private: LegoChar* m_name; // 0xe4 BoundingSphere m_sphere; // 0xe8 - undefined4 m_unk0x100; // 0x100 + undefined m_unk0x100; // 0x100 LegoEntity* m_unk0x104; // 0x104 }; diff --git a/LEGO1/viewmanager/viewlod.h b/LEGO1/viewmanager/viewlod.h index 6bd0959c..1b99b3f2 100644 --- a/LEGO1/viewmanager/viewlod.h +++ b/LEGO1/viewmanager/viewlod.h @@ -24,6 +24,7 @@ class ViewLOD : public LODObject { Tgl::Group* GetGeometry() { return m_meshGroup; } const Tgl::Group* GetGeometry() const { return m_meshGroup; } + unsigned char GetUnknown0x08Test() { return m_unk0x08 & 0xffffff08; } // SYNTHETIC: LEGO1 0x100a6f60 // ViewLOD::`scalar deleting destructor'