Better name for LegoActorLOD's flags (#1537)

This commit is contained in:
Fabian Neundorf 2025-06-02 23:21:12 +02:00 committed by GitHub
parent f48dd8c912
commit b4fb9f3a15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 15 deletions

View File

@ -31,8 +31,8 @@ struct LegoActorInfo {
// SIZE 0x58
struct LegoActorLOD {
enum {
c_flag1 = 0x01,
c_flag2 = 0x02
c_useTexture = 0x01,
c_useColor = 0x02
};
const char* m_name; // 0x00

View File

@ -10,7 +10,7 @@ DECOMP_SIZE_ASSERT(LegoActorLOD, 0x58)
LegoActorLOD g_actorLODs[] = {
{"top", "top", 0, 0.000267f, 0.780808f, -0.01906f, 0.951612f, -0.461166f, -0.002794f, -0.299442f, 0.4617f,
1.56441f, 0.261321f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f},
{"body", "body", LegoActorLOD::c_flag1,
{"body", "body", LegoActorLOD::c_useTexture,
0.00158332f, 0.401828f, -0.00048697f,
0.408071f, -0.287507f, 0.150419f,
-0.147452f, 0.289219f, 0.649774f,
@ -18,7 +18,7 @@ LegoActorLOD g_actorLODs[] = {
0.007277f, 0.0f, 0.0f,
1.0f, 0.0f, 1.0f,
0.0f},
{"infohat", "infohat", LegoActorLOD::c_flag2,
{"infohat", "infohat", LegoActorLOD::c_useColor,
0.0f, -0.00938f, -0.01955f,
0.35f, -0.231822f, -0.140237f,
-0.320954f, 0.234149f, 0.076968f,
@ -26,7 +26,7 @@ LegoActorLOD g_actorLODs[] = {
0.001767f, 0.0f, 0.0f,
1.0f, 0.0f, 1.0f,
0.0f},
{"infogron", "infogron", LegoActorLOD::c_flag2,
{"infogron", "infogron", LegoActorLOD::c_useColor,
0.0f, 0.11477f, 0.00042f,
0.26f, -0.285558f, -0.134391f,
-0.142231f, 0.285507f, 0.152986f,
@ -34,7 +34,7 @@ LegoActorLOD g_actorLODs[] = {
0.007277f, 0.0f, 0.0f,
1.0f, 0.0f, 1.0f,
0.0f},
{"head", "head", LegoActorLOD::c_flag1,
{"head", "head", LegoActorLOD::c_useTexture,
0.0f, -0.03006f, 0.0f,
0.3f, -0.189506f, -0.209665f,
-0.189824f, 0.189532f, 0.228822f,
@ -42,7 +42,7 @@ LegoActorLOD g_actorLODs[] = {
0.001781f, 0.0f, 0.0f,
1.0f, 0.0f, 1.0f,
0.0f},
{"arm-lft", "arm-lft", LegoActorLOD::c_flag2,
{"arm-lft", "arm-lft", LegoActorLOD::c_useColor,
-0.06815f, -0.0973747f, 0.0154655f,
0.237f, -0.137931f, -0.282775f,
-0.105316f, 0.000989f, 0.100221f,
@ -50,7 +50,7 @@ LegoActorLOD g_actorLODs[] = {
0.023286f, -0.003031f, -0.017187f,
0.999848f, 0.173622f, 0.984658f,
0.017453f},
{"arm-rt", "arm-rt", LegoActorLOD::c_flag2,
{"arm-rt", "arm-rt", LegoActorLOD::c_useColor,
0.0680946f, -0.097152f, 0.0152722f,
0.237f, 0.00141f, -0.289604f,
-0.100831f, 0.138786f, 0.09291f,
@ -58,7 +58,7 @@ LegoActorLOD g_actorLODs[] = {
0.018302f, 0.0f, 0.0f,
1.0f, -0.173648f, 0.984808f,
0.0f},
{"claw-lft", "claw-lft", LegoActorLOD::c_flag2,
{"claw-lft", "claw-lft", LegoActorLOD::c_useColor,
0.000773381f, -0.101422f, -0.0237761f,
0.15f, -0.089838f, -0.246208f,
-0.117735f, 0.091275f, 0.000263f,
@ -66,7 +66,7 @@ LegoActorLOD g_actorLODs[] = {
0.092779f, 0.000001f, 0.000003f,
1.0f, 0.190812f, 0.981627f,
-0.000003f},
{"claw-rt", "claw-lft", LegoActorLOD::c_flag2,
{"claw-rt", "claw-lft", LegoActorLOD::c_useColor,
0.000773381f, -0.101422f, -0.0237761f,
0.15f, -0.095016f, -0.245349f,
-0.117979f, 0.086528f, 0.00067f,
@ -74,7 +74,7 @@ LegoActorLOD g_actorLODs[] = {
0.096123f, 0.00606f, -0.034369f,
0.999391f, -0.190704f, 0.981027f,
0.034894f},
{"leg-lft", "leg", LegoActorLOD::c_flag2,
{"leg-lft", "leg", LegoActorLOD::c_useColor,
0.00433584f, -0.177404f, -0.0313928f,
0.33f, -0.129782f, -0.440428f,
-0.184207f, 0.13817f, 0.118415f,
@ -82,7 +82,7 @@ LegoActorLOD g_actorLODs[] = {
0.006822f, 0.0f, 0.0f,
1.0f, 0.0f, 1.0f,
0.0f},
{"leg-rt", "leg", LegoActorLOD::c_flag2,
{"leg-rt", "leg", LegoActorLOD::c_useColor,
0.00433584f, -0.177404f, -0.0313928f,
0.33f, -0.132864f, -0.437138f,
-0.183944f, 0.134614f, 0.12043f,

View File

@ -553,7 +553,8 @@ LegoROI* LegoCharacterManager::CreateActorROI(const char* p_key)
);
childROI->WrappedSetLocal2WorldWithWorldDataUpdate(mat);
if (g_actorLODs[i + 1].m_flags & LegoActorLOD::c_flag1 && (i != 0 || part.m_unk0x00[part.m_unk0x08] != 0)) {
if (g_actorLODs[i + 1].m_flags & LegoActorLOD::c_useTexture &&
(i != 0 || part.m_unk0x00[part.m_unk0x08] != 0)) {
LegoTextureInfo* textureInfo = textureContainer->Get(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]]);
@ -562,7 +563,7 @@ LegoROI* LegoCharacterManager::CreateActorROI(const char* p_key)
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)) {
else if (g_actorLODs[i + 1].m_flags & LegoActorLOD::c_useColor || (i == 0 && part.m_unk0x00[part.m_unk0x08] == 0)) {
LegoFloat red, green, blue, alpha;
childROI->GetRGBAColor(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]], red, green, blue, alpha);
childROI->SetLodColor(red, green, blue, alpha);
@ -765,7 +766,7 @@ MxBool LegoCharacterManager::SwitchColor(LegoROI* p_roi, LegoROI* p_targetROI)
findChild = FALSE;
}
if (!(g_actorLODs[partIndex + 1].m_flags & LegoActorLOD::c_flag2)) {
if (!(g_actorLODs[partIndex + 1].m_flags & LegoActorLOD::c_useColor)) {
return FALSE;
}