Clear unknowns in ViewLOD (#1599)

This commit is contained in:
Fabian Neundorf
2025-07-02 02:02:03 +02:00
committed by GitHub
parent f825b053ff
commit 805c57b6aa
5 changed files with 20 additions and 20 deletions

View File

@@ -14,10 +14,10 @@
class ViewLOD : public LODObject {
public:
enum {
c_bit4 = 0x10
c_hasMesh = 0x10
};
ViewLOD(Tgl::Renderer* pRenderer) : m_meshBuilder(NULL), m_unk0x08(3) {}
ViewLOD(Tgl::Renderer* pRenderer) : m_meshBuilder(NULL), m_flags(3) {}
~ViewLOD() override;
// FUNCTION: LEGO1 0x100a6f30
@@ -28,19 +28,19 @@ public:
Tgl::MeshBuilder* GetMeshBuilder() { return m_meshBuilder; }
const Tgl::MeshBuilder* GetMeshBuilder() const { return m_meshBuilder; }
undefined4 GetUnknown0x08() { return m_unk0x08; }
unsigned char GetUnknown0x08Test4() { return m_unk0x08 & 0xffffff04; }
unsigned char GetUnknown0x08Test8() { return m_unk0x08 & 0xffffff08; }
unsigned int GetFlags() { return m_flags; }
unsigned char SkipReadingData() { return m_flags & 0xffffff04; }
unsigned char IsExtraLOD() { return m_flags & 0xffffff08; }
void SetFlag(unsigned char p_flag) { m_unk0x08 |= p_flag; }
void ClearFlag(unsigned char p_flag) { m_unk0x08 &= ~p_flag; }
void SetFlag(unsigned char p_flag) { m_flags |= p_flag; }
void ClearFlag(unsigned char p_flag) { m_flags &= ~p_flag; }
// SYNTHETIC: LEGO1 0x100a6f60
// ViewLOD::`scalar deleting destructor'
protected:
Tgl::MeshBuilder* m_meshBuilder; // 0x04
undefined4 m_unk0x08; // 0x08
unsigned int m_flags; // 0x08
};
#endif // VIEWLOD_H

View File

@@ -165,7 +165,7 @@ void ViewManager::UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_lodLevel)
if (lodLevel < 0) {
lod = (ViewLOD*) p_roi->GetLOD(p_lodLevel);
if (lod->GetUnknown0x08() & ViewLOD::c_bit4) {
if (lod->GetFlags() & ViewLOD::c_hasMesh) {
scene->Add((Tgl::MeshBuilder*) group);
SetAppData(p_roi, reinterpret_cast<LPD3DRM_APPDATA>(p_roi));
}
@@ -184,7 +184,7 @@ void ViewManager::UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_lodLevel)
lod = (ViewLOD*) p_roi->GetLOD(p_lodLevel);
}
if (lod->GetUnknown0x08() & ViewLOD::c_bit4) {
if (lod->GetFlags() & ViewLOD::c_hasMesh) {
meshBuilder = lod->GetMeshBuilder();
if (meshBuilder != NULL) {
@@ -389,7 +389,7 @@ inline int ViewManager::GetFirstLODIndex(ViewROI* p_roi)
const LODListBase* lods = p_roi->GetLODs();
if (lods != NULL && lods->Size() > 0) {
if (((ViewLOD*) p_roi->GetLOD(0))->GetUnknown0x08Test8()) {
if (((ViewLOD*) p_roi->GetLOD(0))->IsExtraLOD()) {
return 1;
}
else {
@@ -404,7 +404,7 @@ inline int ViewManager::GetFirstLODIndex(ViewROI* p_roi)
const LODListBase* lods = ((ViewROI*) *it)->GetLODs();
if (lods != NULL && lods->Size() > 0) {
if (((ViewLOD*) ((ViewROI*) *it)->GetLOD(0))->GetUnknown0x08Test8()) {
if (((ViewLOD*) ((ViewROI*) *it)->GetLOD(0))->IsExtraLOD()) {
return 1;
}
else {