Name unknown fields and functions

This commit is contained in:
Fabian Neundorf 2025-04-29 13:31:49 +02:00 committed by Florian Kaiser
parent 611fc0619c
commit e12a3ca96f
7 changed files with 75 additions and 75 deletions

View File

@ -1373,7 +1373,7 @@ void LegoCarBuild::FUN_10025350(MxS32 p_objectId)
m_Paint_Sound->Enable(FALSE);
m_Paint_Sound->Enable(TRUE);
m_unk0x110->FUN_100a93b0(color);
m_unk0x110->SetColorNamed2(color);
sprintf(buffer, "c_%s", m_unk0x110->GetName());
VariableTable()->SetVariable(buffer, color);
}

View File

@ -220,8 +220,8 @@ void LegoCarBuildAnimPresenter::StreamingTickle()
LegoROI* roi = m_roiMap[j];
if (roi && roi->GetName() && (strcmpi(name, roi->GetName()) == 0)) {
roi->FUN_100a9dd0();
roi->FUN_100a9350("lego red");
roi->ClearLodUnk0x1c();
roi->SetColorNamed("lego red");
}
}
}

View File

@ -567,14 +567,14 @@ LegoROI* LegoCharacterManager::CreateActorROI(const char* p_key)
LegoTextureInfo* textureInfo = textureContainer->Get(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]]);
if (textureInfo != NULL) {
childROI->FUN_100a9210(textureInfo);
childROI->FUN_100a9170(1.0F, 1.0F, 1.0F, 0.0F);
childROI->SetTexture(textureInfo);
childROI->SetLodColor(1.0F, 1.0F, 1.0F, 0.0F);
}
}
else if (g_actorLODs[i + 1].m_flags & LegoActorLOD::c_flag2 || (i == 0 && part.m_unk0x00[part.m_unk0x08] == 0)) {
LegoFloat red, green, blue, alpha;
childROI->GetColorFromGlobalHandlerOrAlias(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]], red, green, blue, alpha);
childROI->FUN_100a9170(red, green, blue, alpha);
childROI->SetLodColor(red, green, blue, alpha);
}
comp->push_back(childROI);
@ -634,7 +634,7 @@ MxBool LegoCharacterManager::FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_tex
LegoLOD* clone = lod->Clone(renderer);
if (p_texture != NULL) {
clone->FUN_100aad70(p_texture);
clone->SetTextureInfoUncolored(p_texture);
}
dupLodList->PushBack(clone);
@ -797,7 +797,7 @@ MxBool LegoCharacterManager::SwitchColor(LegoROI* p_roi, LegoROI* p_targetROI)
LegoFloat red, green, blue, alpha;
LegoROI::GetColorFromGlobalHandlerOrAlias(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]], red, green, blue, alpha);
p_targetROI->FUN_100a9170(red, green, blue, alpha);
p_targetROI->SetLodColor(red, green, blue, alpha);
return TRUE;
}
@ -837,7 +837,7 @@ MxBool LegoCharacterManager::SwitchVariant(LegoROI* p_roi)
for (MxS32 i = 0; i < lodSize; i++) {
LegoLOD* lod = (LegoLOD*) (*lodList)[i];
LegoLOD* clone = lod->Clone(renderer);
clone->FUN_100aacb0(red, green, blue, alpha);
clone->SetMeshColor(red, green, blue, alpha);
dupLodList->PushBack(clone);
}

View File

@ -16,7 +16,7 @@ DECOMP_SIZE_ASSERT(LegoLOD::Mesh, 0x08)
LPDIRECT3DRMMATERIAL g_d3d_material = NULL;
// GLOBAL: LEGO1 0x101013dc
const char* g_unk0x101013dc = "inh";
const char* g_InhPrefix = "inh";
inline IDirect3DRM2* GetD3DRM(Tgl::Renderer* pRenderer);
inline BOOL GetMeshData(IDirect3DRMMesh*& mesh, D3DRMGROUPINDEX& index, Tgl::Mesh* pMesh);
@ -32,7 +32,7 @@ LegoLOD::LegoLOD(Tgl::Renderer* p_renderer) : ViewLOD(p_renderer)
m_numMeshes = 0;
m_numVertices = 0;
m_numPolys = 0;
m_unk0x1c = 0;
m_meshOffset = 0;
}
// FUNCTION: LEGO1 0x100aa450
@ -66,7 +66,7 @@ LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_text
LegoU32(*textureIndices)[3] = NULL;
LegoTextureInfo* textureInfo = NULL;
LegoU32 i, meshUnd1, meshUnd2, tempNumVertsAndNormals;
LegoU32 i, meshIndexCounterDown, meshIndexCounterUp, tempNumVertsAndNormals;
unsigned char paletteEntries[256];
if (p_storage->Read(&m_unk0x08, sizeof(m_unk0x08)) != SUCCESS) {
@ -93,8 +93,8 @@ LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_text
m_melems = new Mesh[m_numMeshes];
memset(m_melems, 0, sizeof(*m_melems) * m_numMeshes);
meshUnd1 = m_numMeshes - 1;
meshUnd2 = 0;
meshIndexCounterDown = m_numMeshes - 1;
meshIndexCounterUp = 0;
if (p_storage->Read(&tempNumVertsAndNormals, sizeof(tempNumVertsAndNormals)) != SUCCESS) {
goto done;
@ -184,13 +184,13 @@ LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_text
textureName = mesh->GetTextureName();
materialName = mesh->GetMaterialName();
if (FUN_100aae20(textureName) || FUN_100aae20(materialName)) {
meshIndex = meshUnd1;
meshUnd1--;
if (StartWithInhPrefix(textureName) || StartWithInhPrefix(materialName)) {
meshIndex = meshIndexCounterDown;
meshIndexCounterDown--;
}
else {
meshIndex = meshUnd2;
meshUnd2++;
meshIndex = meshIndexCounterUp;
meshIndexCounterUp++;
}
m_melems[meshIndex].m_tglMesh = m_meshBuilder->CreateMesh(
@ -212,7 +212,7 @@ LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_text
if (textureName != NULL) {
if (mesh->GetUseColorAlias()) {
LegoROI::FUN_100a9cf0(textureName, paletteEntries, sizeOfArray(paletteEntries));
LegoROI::GetPaletteEntriesFromGlobalHandler(textureName, paletteEntries, sizeOfArray(paletteEntries));
}
textureInfo = p_textureContainer->Get(mesh->GetTextureName());
@ -223,7 +223,7 @@ LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_text
m_melems[meshIndex].m_tglMesh->SetColor(1.0F, 1.0F, 1.0F, 0.0F);
LegoTextureInfo::SetGroupTexture(m_melems[meshIndex].m_tglMesh, textureInfo);
m_melems[meshIndex].m_unk0x04 = TRUE;
m_melems[meshIndex].m_Textured = TRUE;
}
else {
LegoFloat red = 1.0F;
@ -265,7 +265,7 @@ LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_text
}
}
m_unk0x1c = meshUnd2;
m_meshOffset = meshIndexCounterUp;
if (textureVertices != NULL) {
delete[] textureVertices;
@ -312,23 +312,23 @@ LegoLOD* LegoLOD::Clone(Tgl::Renderer* p_renderer)
for (LegoU32 i = 0; i < m_numMeshes; i++) {
dupLod->m_melems[i].m_tglMesh = m_melems[i].m_tglMesh->ShallowClone(dupLod->m_meshBuilder);
dupLod->m_melems[i].m_unk0x04 = m_melems[i].m_unk0x04;
dupLod->m_melems[i].m_Textured = m_melems[i].m_Textured;
}
dupLod->m_unk0x08 = m_unk0x08;
dupLod->m_numMeshes = m_numMeshes;
dupLod->m_numVertices = m_numVertices;
dupLod->m_numPolys = m_numPolys;
dupLod->m_unk0x1c = m_unk0x1c;
dupLod->m_meshOffset = m_meshOffset;
return dupLod;
}
// FUNCTION: LEGO1 0x100aacb0
LegoResult LegoLOD::FUN_100aacb0(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha)
LegoResult LegoLOD::SetMeshColor(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha)
{
for (LegoU32 i = m_unk0x1c; i < m_numMeshes; i++) {
if (!m_melems[i].m_unk0x04) {
for (LegoU32 i = m_meshOffset; i < m_numMeshes; i++) {
if (!m_melems[i].m_Textured) {
m_melems[i].m_tglMesh->SetColor(p_red, p_green, p_blue, p_alpha);
}
}
@ -337,13 +337,13 @@ LegoResult LegoLOD::FUN_100aacb0(LegoFloat p_red, LegoFloat p_green, LegoFloat p
}
// FUNCTION: LEGO1 0x100aad00
LegoResult LegoLOD::FUN_100aad00(LegoTextureInfo* p_textureInfo)
LegoResult LegoLOD::SetTextureInfo(LegoTextureInfo* p_textureInfo)
{
for (LegoU32 i = m_unk0x1c; i < m_numMeshes; i++) {
if (m_melems[i].m_unk0x04) {
for (LegoU32 i = m_meshOffset; i < m_numMeshes; i++) {
if (m_melems[i].m_Textured) {
LegoTextureInfo::SetGroupTexture(m_melems[i].m_tglMesh, p_textureInfo);
m_melems[i].m_tglMesh->SetColor(1.0F, 1.0F, 1.0F, 0.0F);
m_melems[i].m_unk0x04 = TRUE;
m_melems[i].m_Textured = TRUE;
}
}
@ -351,10 +351,10 @@ LegoResult LegoLOD::FUN_100aad00(LegoTextureInfo* p_textureInfo)
}
// FUNCTION: LEGO1 0x100aad70
LegoResult LegoLOD::FUN_100aad70(LegoTextureInfo* p_textureInfo)
LegoResult LegoLOD::SetTextureInfoUncolored(LegoTextureInfo* p_textureInfo)
{
for (LegoU32 i = m_unk0x1c; i < m_numMeshes; i++) {
if (m_melems[i].m_unk0x04) {
for (LegoU32 i = m_meshOffset; i < m_numMeshes; i++) {
if (m_melems[i].m_Textured) {
LegoTextureInfo::SetGroupTexture(m_melems[i].m_tglMesh, p_textureInfo);
}
}
@ -365,8 +365,8 @@ LegoResult LegoLOD::FUN_100aad70(LegoTextureInfo* p_textureInfo)
// FUNCTION: LEGO1 0x100aadc0
LegoResult LegoLOD::GetTexture(LegoTextureInfo*& p_textureInfo)
{
for (LegoU32 i = m_unk0x1c; i < m_numMeshes; i++) {
if (m_melems[i].m_unk0x04) {
for (LegoU32 i = m_meshOffset; i < m_numMeshes; i++) {
if (m_melems[i].m_Textured) {
if (LegoTextureInfo::GetGroupTexture(m_melems[i].m_tglMesh, p_textureInfo) == TRUE) {
return SUCCESS;
}
@ -377,10 +377,10 @@ LegoResult LegoLOD::GetTexture(LegoTextureInfo*& p_textureInfo)
}
// FUNCTION: LEGO1 0x100aae20
LegoBool LegoLOD::FUN_100aae20(const LegoChar* p_name)
LegoBool LegoLOD::StartWithInhPrefix(const LegoChar* p_name)
{
if (p_name != NULL) {
if (!strnicmp(p_name, g_unk0x101013dc, strlen(g_unk0x101013dc))) {
if (!strnicmp(p_name, g_InhPrefix, strlen(g_InhPrefix))) {
return TRUE;
}
}
@ -390,9 +390,9 @@ LegoBool LegoLOD::FUN_100aae20(const LegoChar* p_name)
// FUNCTION: LEGO1 0x100aae60
// FUNCTION: BETA10 0x1018e50f
void LegoLOD::FUN_100aae60()
void LegoLOD::ClearMeshOffset()
{
m_unk0x1c = 0;
m_meshOffset = 0;
}
inline BOOL GetMeshData(IDirect3DRMMesh*& mesh, D3DRMGROUPINDEX& index, Tgl::Mesh* pMesh)

View File

@ -15,7 +15,7 @@ class LegoLOD : public ViewLOD {
// SIZE 0x08
struct Mesh {
Tgl::Mesh* m_tglMesh; // 0x00
BOOL m_unk0x04; // 0x04
BOOL m_Textured; // 0x04
};
LegoLOD(Tgl::Renderer*);
@ -29,13 +29,13 @@ class LegoLOD : public ViewLOD {
LegoResult Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_textureContainer, LegoStorage* p_storage);
LegoLOD* Clone(Tgl::Renderer* p_renderer);
LegoResult FUN_100aacb0(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha);
LegoResult FUN_100aad00(LegoTextureInfo* p_textureInfo);
LegoResult FUN_100aad70(LegoTextureInfo* p_textureInfo);
void FUN_100aae60();
LegoResult SetMeshColor(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha);
LegoResult SetTextureInfo(LegoTextureInfo* p_textureInfo);
LegoResult SetTextureInfoUncolored(LegoTextureInfo* p_textureInfo);
void ClearMeshOffset();
LegoResult GetTexture(LegoTextureInfo*& p_textureInfo);
static LegoBool FUN_100aae20(const LegoChar* p_name);
static LegoBool StartWithInhPrefix(const LegoChar* p_name);
// SYNTHETIC: LEGO1 0x100aa430
// LegoLOD::`scalar deleting destructor'
@ -45,7 +45,7 @@ class LegoLOD : public ViewLOD {
LegoU32 m_numMeshes; // 0x10
LegoU32 m_numVertices; // 0x14
LegoU32 m_numPolys; // 0x18
undefined4 m_unk0x1c; // 0x1c
LegoU32 m_meshOffset; // 0x1c
};
#endif // LEGOLOD_H

View File

@ -55,7 +55,7 @@ const char* g_unk0x10101390[] = {"rcuser", "jsuser", "dunebugy", "chtrblad", "ch
ROIHandler g_roi_handler = NULL;
// GLOBAL: LEGO1 0x101013b0
TextureHandler g_unk0x101013b0 = NULL;
TextureHandler g_palette_entry_handler = NULL;
// FUNCTION: LEGO1 0x100a81b0
void LegoROI::FUN_100a81b0(const LegoChar* p_error, const LegoChar* p_name)
@ -299,8 +299,8 @@ LegoResult LegoROI::Read(
goto done;
}
FUN_100a9210(textureInfo);
FUN_100a9170(1.0F, 1.0F, 1.0F, 0.0F);
SetTexture(textureInfo);
SetLodColor(1.0F, 1.0F, 1.0F, 0.0F);
}
else {
LegoFloat red = 1.0F;
@ -308,7 +308,7 @@ LegoResult LegoROI::Read(
LegoFloat blue = 1.0F;
LegoFloat alpha = 0.0F;
GetColorFromGlobalHandlerOrAlias(textureName, red, green, blue, alpha);
FUN_100a9170(red, green, blue, alpha);
SetLodColor(red, green, blue, alpha);
}
}
@ -481,7 +481,7 @@ LegoResult LegoROI::SetFrame(LegoAnim* p_anim, LegoTime p_time)
// FUNCTION: LEGO1 0x100a9170
// FUNCTION: BETA10 0x1018ae09
LegoResult LegoROI::FUN_100a9170(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha)
LegoResult LegoROI::SetLodColor(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha)
{
LegoResult result = SUCCESS;
CompoundObject::iterator it;
@ -490,14 +490,14 @@ LegoResult LegoROI::FUN_100a9170(LegoFloat p_red, LegoFloat p_green, LegoFloat p
for (LegoU32 i = 0; i < lodCount; i++) {
LegoLOD* lod = (LegoLOD*) GetLOD(i);
if (lod->FUN_100aacb0(p_red, p_green, p_blue, p_alpha) != SUCCESS) {
if (lod->SetMeshColor(p_red, p_green, p_blue, p_alpha) != SUCCESS) {
result = FAILURE;
}
}
if (comp != NULL) {
for (it = comp->begin(); it != comp->end(); it++) {
if (((LegoROI*) *it)->FUN_100a9170(p_red, p_green, p_blue, p_alpha) != SUCCESS) {
if (((LegoROI*) *it)->SetLodColor(p_red, p_green, p_blue, p_alpha) != SUCCESS) {
result = FAILURE;
}
}
@ -507,7 +507,7 @@ LegoResult LegoROI::FUN_100a9170(LegoFloat p_red, LegoFloat p_green, LegoFloat p
}
// FUNCTION: LEGO1 0x100a9210
LegoResult LegoROI::FUN_100a9210(LegoTextureInfo* p_textureInfo)
LegoResult LegoROI::SetTexture(LegoTextureInfo* p_textureInfo)
{
LegoResult result = SUCCESS;
CompoundObject::iterator it;
@ -516,14 +516,14 @@ LegoResult LegoROI::FUN_100a9210(LegoTextureInfo* p_textureInfo)
for (LegoU32 i = 0; i < lodCount; i++) {
LegoLOD* lod = (LegoLOD*) GetLOD(i);
if (lod->FUN_100aad00(p_textureInfo) != SUCCESS) {
if (lod->SetTextureInfo(p_textureInfo) != SUCCESS) {
result = FAILURE;
}
}
if (comp != NULL) {
for (it = comp->begin(); it != comp->end(); it++) {
if (((LegoROI*) *it)->FUN_100a9210(p_textureInfo) != SUCCESS) {
if (((LegoROI*) *it)->SetTexture(p_textureInfo) != SUCCESS) {
result = FAILURE;
}
}
@ -560,18 +560,18 @@ LegoResult LegoROI::GetTexture(LegoTextureInfo*& p_textureInfo)
// FUNCTION: LEGO1 0x100a9330
// FUNCTION: BETA10 0x1018b22c
LegoResult LegoROI::FUN_100a9330(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha)
LegoResult LegoROI::SetCustomLodColor2(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha)
{
return FUN_100a9170(p_red, p_green, p_blue, p_alpha);
return SetLodColor(p_red, p_green, p_blue, p_alpha);
}
// FUNCTION: LEGO1 0x100a9350
// FUNCTION: BETA10 0x1018b25c
LegoResult LegoROI::FUN_100a9350(const LegoChar* p_color)
LegoResult LegoROI::SetColorNamed(const LegoChar* p_color)
{
MxFloat red, green, blue, alpha;
if (ColorAliasLookup(p_color, red, green, blue, alpha)) {
return FUN_100a9170(red, green, blue, alpha);
return SetLodColor(red, green, blue, alpha);
}
return SUCCESS;
@ -579,11 +579,11 @@ LegoResult LegoROI::FUN_100a9350(const LegoChar* p_color)
// FUNCTION: LEGO1 0x100a93b0
// FUNCTION: BETA10 0x1018b2c0
LegoResult LegoROI::FUN_100a93b0(const LegoChar* p_color)
LegoResult LegoROI::SetColorNamed2(const LegoChar* p_color)
{
MxFloat red, green, blue, alpha;
if (ColorAliasLookup(p_color, red, green, blue, alpha)) {
return FUN_100a9330(red, green, blue, alpha);
return SetCustomLodColor2(red, green, blue, alpha);
}
return 0;
@ -789,14 +789,14 @@ LegoBool LegoROI::ColorAliasLookup(const LegoChar* p_param, float& p_red, float&
}
// FUNCTION: LEGO1 0x100a9cf0
LegoBool LegoROI::FUN_100a9cf0(const LegoChar* p_param, unsigned char* paletteEntries, LegoU32 p_numEntries)
LegoBool LegoROI::GetPaletteEntriesFromGlobalHandler(const LegoChar* p_param, unsigned char* paletteEntries, LegoU32 p_numEntries)
{
if (p_param == NULL) {
return FALSE;
}
if (g_unk0x101013b0 != NULL) {
return g_unk0x101013b0(p_param, paletteEntries, p_numEntries);
if (g_palette_entry_handler != NULL) {
return g_palette_entry_handler(p_param, paletteEntries, p_numEntries);
}
paletteEntries[0] = '\0';
@ -828,12 +828,12 @@ void LegoROI::SetName(const LegoChar* p_name)
// FUNCTION: LEGO1 0x100a9dd0
// FUNCTION: BETA10 0x1018bfdb
void LegoROI::FUN_100a9dd0()
void LegoROI::ClearLodUnk0x1c()
{
int lodCount = GetLODCount();
for (LegoS32 i = 0; i < lodCount; i++) {
LegoLOD* lod = (LegoLOD*) GetLOD(i);
lod->FUN_100aae60();
lod->ClearMeshOffset();
}
}

View File

@ -36,19 +36,19 @@ class LegoROI : public ViewROI {
static void FUN_100a8e80(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_time, LegoROI** p_roiMap);
static void FUN_100a8fd0(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_time, LegoROI** p_roiMap);
LegoResult SetFrame(LegoAnim* p_anim, LegoTime p_time);
LegoResult FUN_100a9170(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha);
LegoResult FUN_100a9210(LegoTextureInfo* p_textureInfo);
LegoResult SetLodColor(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha);
LegoResult SetTexture(LegoTextureInfo* p_textureInfo);
LegoResult GetTexture(LegoTextureInfo*& p_textureInfo);
LegoResult FUN_100a9330(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha);
LegoResult FUN_100a9350(const LegoChar* p_color);
LegoResult FUN_100a93b0(const LegoChar* p_color);
LegoResult SetCustomLodColor2(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha);
LegoResult SetColorNamed(const LegoChar* p_color);
LegoResult SetColorNamed2(const LegoChar* p_color);
LegoU32 FUN_100a9410(Vector3& p_v1, Vector3& p_v2, float p_f1, float p_f2, Vector3& p_v3, LegoBool p_collideBox);
void SetName(const LegoChar* p_name);
float IntrinsicImportance() const override; // vtable+0x04
void UpdateWorldBoundingVolumes() override; // vtable+0x18
void FUN_100a9dd0();
void ClearLodUnk0x1c();
void SetDisplayBB(int p_displayBB);
static LegoResult FUN_100a8cb0(LegoAnimNodeData* p_data, LegoTime p_time, Matrix4& p_matrix);
@ -63,7 +63,7 @@ class LegoROI : public ViewROI {
float& p_blue,
float& p_alpha
);
static LegoBool FUN_100a9cf0(const LegoChar* p_param, unsigned char* paletteEntries, LegoU32 p_numEntries);
static LegoBool GetPaletteEntriesFromGlobalHandler(const LegoChar* p_param, unsigned char* paletteEntries, LegoU32 p_numEntries);
// FUNCTION: BETA10 0x1000f320
const LegoChar* GetName() const { return m_name; }