mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-22 16:04:17 +00:00
Bootstrap LegoLOD, implement/match ViewManager::FUN_100a66a0 (#625)
* Bootstrap LegoLOD, implement/match ViewManager::FUN_100a66a0 * Fixes * Try fix * Try this * Fix
This commit is contained in:

committed by
GitHub

parent
b8aa16ff80
commit
c9210c02fb
7
LEGO1/viewmanager/viewlod.cpp
Normal file
7
LEGO1/viewmanager/viewlod.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "viewlod.h"
|
||||
|
||||
// FUNCTION: LEGO1 0x100a5e40
|
||||
ViewLOD::~ViewLOD()
|
||||
{
|
||||
delete m_meshGroup;
|
||||
}
|
32
LEGO1/viewmanager/viewlod.h
Normal file
32
LEGO1/viewmanager/viewlod.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#include "decomp.h"
|
||||
#include "realtime/roi.h"
|
||||
#include "tgl/tgl.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ViewLOD
|
||||
//
|
||||
|
||||
// VTABLE: LEGO1 0x100dbd70
|
||||
// SIZE 0x0c
|
||||
class ViewLOD : public LODObject {
|
||||
public:
|
||||
ViewLOD(Tgl::Renderer* pRenderer) : m_meshGroup(NULL), m_unk0x08(3) {}
|
||||
~ViewLOD() override;
|
||||
|
||||
// FUNCTION: LEGO1 0x100a6f30
|
||||
double AveragePolyArea() const override { return 2 * 3.14159 * 10.0 / NumPolys(); } // vtable+0x04
|
||||
|
||||
// FUNCTION: LEGO1 0x100a6f50
|
||||
int NVerts() const override { return NumPolys() * 2; } // vtable+0x08
|
||||
|
||||
Tgl::Group* GetGeometry() { return m_meshGroup; }
|
||||
const Tgl::Group* GetGeometry() const { return m_meshGroup; }
|
||||
|
||||
// SYNTHETIC: LEGO1 0x100a6f60
|
||||
// ViewLOD::`scalar deleting destructor'
|
||||
|
||||
protected:
|
||||
// TODO: m_meshGroup unconfirmed (based on 1996)
|
||||
Tgl::Group* m_meshGroup; // 0x04
|
||||
undefined4 m_unk0x08; // 0x08
|
||||
};
|
@@ -1,11 +1,12 @@
|
||||
#include "viewmanager.h"
|
||||
|
||||
#include "tgl/d3drm/impl.h"
|
||||
#include "viewlod.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(ViewManager, 0x1bc)
|
||||
|
||||
inline undefined4 SetD3DRM(IDirect3DRM2*& d3drm, Tgl::Renderer* pRenderer);
|
||||
inline undefined4 SetFrame(IDirect3DRMFrame2*& frame, Tgl::Group* scene);
|
||||
inline undefined4 GetD3DRM(IDirect3DRM2*& d3drm, Tgl::Renderer* pRenderer);
|
||||
inline undefined4 GetFrame(IDirect3DRMFrame2*& frame, Tgl::Group* scene);
|
||||
|
||||
// FUNCTION: LEGO1 0x100a5eb0
|
||||
ViewManager::ViewManager(Tgl::Renderer* pRenderer, Tgl::Group* scene, const OrientableROI* point_of_view)
|
||||
@@ -13,8 +14,8 @@ ViewManager::ViewManager(Tgl::Renderer* pRenderer, Tgl::Group* scene, const Orie
|
||||
{
|
||||
SetPOVSource(point_of_view);
|
||||
unk0x28 = 0.09;
|
||||
SetD3DRM(d3drm, pRenderer);
|
||||
SetFrame(frame, scene);
|
||||
GetD3DRM(d3drm, pRenderer);
|
||||
GetFrame(frame, scene);
|
||||
width = 0.0;
|
||||
height = 0.0;
|
||||
view_angle = 0.0;
|
||||
@@ -86,10 +87,25 @@ void ViewManager::RemoveAll(ViewROI* p_roi)
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100a66a0
|
||||
// FUNCTION: LEGO1 0x100a66a0
|
||||
void ViewManager::FUN_100a66a0(ViewROI* p_roi)
|
||||
{
|
||||
// TODO
|
||||
const ViewLOD* lod = (const ViewLOD*) p_roi->GetLOD(p_roi->GetUnknown0xe0());
|
||||
|
||||
if (lod != NULL) {
|
||||
const Tgl::Mesh* meshGroup = NULL;
|
||||
Tgl::Group* roiGeometry = p_roi->GetGeometry();
|
||||
|
||||
meshGroup = (const Tgl::Mesh*) lod->GetGeometry();
|
||||
|
||||
if (meshGroup != NULL) {
|
||||
roiGeometry->Remove(meshGroup);
|
||||
}
|
||||
|
||||
scene->Remove(roiGeometry);
|
||||
}
|
||||
|
||||
p_roi->SetUnknown0xe0(-1);
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100a6930
|
||||
@@ -131,13 +147,13 @@ ViewROI* ViewManager::Pick(Tgl::View* p_view, unsigned long x, unsigned long y)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline undefined4 SetD3DRM(IDirect3DRM2*& d3drm, Tgl::Renderer* pRenderer)
|
||||
inline undefined4 GetD3DRM(IDirect3DRM2*& d3drm, Tgl::Renderer* pRenderer)
|
||||
{
|
||||
d3drm = ((TglImpl::RendererImpl*) pRenderer)->ImplementationData();
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline undefined4 SetFrame(IDirect3DRMFrame2*& frame, Tgl::Group* scene)
|
||||
inline undefined4 GetFrame(IDirect3DRMFrame2*& frame, Tgl::Group* scene)
|
||||
{
|
||||
frame = ((TglImpl::GroupImpl*) scene)->ImplementationData();
|
||||
return 0;
|
||||
|
@@ -16,13 +16,13 @@ float ViewROI::IntrinsicImportance() const
|
||||
} // for now
|
||||
|
||||
// FUNCTION: LEGO1 0x100a9ec0
|
||||
const Tgl::Group* ViewROI::GetGeometry() const
|
||||
Tgl::Group* ViewROI::GetGeometry()
|
||||
{
|
||||
return geometry;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100a9ed0
|
||||
Tgl::Group* ViewROI::GetGeometry()
|
||||
const Tgl::Group* ViewROI::GetGeometry() const
|
||||
{
|
||||
return geometry;
|
||||
}
|
||||
|
@@ -53,8 +53,8 @@ public:
|
||||
void VTable0x1c() override; // vtable+0x1c
|
||||
void SetLocalTransform(const Matrix4& p_transform) override; // vtable+0x20
|
||||
void VTable0x24(const Matrix4& p_transform) override; // vtable+0x24
|
||||
virtual const Tgl::Group* GetGeometry() const; // vtable+0x34
|
||||
virtual Tgl::Group* GetGeometry(); // vtable+0x30
|
||||
virtual const Tgl::Group* GetGeometry() const; // vtable+0x34
|
||||
|
||||
inline int GetUnknown0xe0() { return m_unk0xe0; }
|
||||
inline void SetUnknown0xe0(int p_unk0xe0) { m_unk0xe0 = p_unk0xe0; }
|
||||
|
Reference in New Issue
Block a user