mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-26 09:54:18 +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
@@ -331,11 +331,11 @@ MxResult LegoWorldPresenter::FUN_10067360(ModelDbPart& p_part, FILE* p_wdbFile)
|
||||
chunk.SetLength(p_part.m_partDataLength);
|
||||
chunk.SetData(buff);
|
||||
|
||||
LegoPartPresenter part;
|
||||
result = part.Read(chunk);
|
||||
LegoPartPresenter partPresenter;
|
||||
result = partPresenter.Read(chunk);
|
||||
|
||||
if (result == SUCCESS) {
|
||||
part.FUN_1007df20();
|
||||
partPresenter.FUN_1007df20();
|
||||
}
|
||||
|
||||
delete[] buff;
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
#include "legoroi.h"
|
||||
|
||||
#include "tgl/d3drm/impl.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoROI, 0x108)
|
||||
DECOMP_SIZE_ASSERT(TimeROI, 0x10c)
|
||||
DECOMP_SIZE_ASSERT(LODObject, 0x04)
|
||||
DECOMP_SIZE_ASSERT(ViewLOD, 0x0c)
|
||||
DECOMP_SIZE_ASSERT(LegoLOD, 0x20)
|
||||
|
||||
inline IDirect3DRM2* GetD3DRM(Tgl::Renderer* pRenderer);
|
||||
|
||||
// SIZE 0x14
|
||||
typedef struct {
|
||||
@@ -38,6 +45,9 @@ int g_roiConfig = 100;
|
||||
// GLOBAL: LEGO1 0x101013ac
|
||||
ROIHandler g_someHandlerFunction = NULL;
|
||||
|
||||
// GLOBAL: LEGO1 0x101013d4
|
||||
LPDIRECT3DRMMATERIAL g_unk0x101013d4 = NULL;
|
||||
|
||||
// FUNCTION: LEGO1 0x100a81c0
|
||||
void LegoROI::configureLegoROI(int p_roiConfig)
|
||||
{
|
||||
@@ -99,7 +109,7 @@ LegoResult LegoROI::SetFrame(LegoAnim* p_anim, LegoTime p_time)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100a9a50
|
||||
TimeROI::TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, int p_time) : LegoROI(p_renderer, p_lodList)
|
||||
TimeROI::TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, LegoTime p_time) : LegoROI(p_renderer, p_lodList)
|
||||
{
|
||||
m_time = p_time;
|
||||
}
|
||||
@@ -171,3 +181,28 @@ void LegoROI::UpdateWorldBoundingVolumes()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100aa380
|
||||
LegoLOD::LegoLOD(Tgl::Renderer* p_renderer) : ViewLOD(p_renderer)
|
||||
{
|
||||
if (g_unk0x101013d4 == NULL) {
|
||||
GetD3DRM(p_renderer)->CreateMaterial(10.0, &g_unk0x101013d4);
|
||||
}
|
||||
|
||||
m_unk0x0c = 0;
|
||||
m_unk0x10 = 0;
|
||||
m_unk0x14 = 0;
|
||||
m_numPolys = 0;
|
||||
m_unk0x1c = 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100aa450
|
||||
LegoLOD::~LegoLOD()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
inline IDirect3DRM2* GetD3DRM(Tgl::Renderer* pRenderer)
|
||||
{
|
||||
return ((TglImpl::RendererImpl*) pRenderer)->ImplementationData();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define LEGOROI_H
|
||||
|
||||
#include "misc/legotypes.h"
|
||||
#include "viewmanager/viewlod.h"
|
||||
#include "viewmanager/viewroi.h"
|
||||
|
||||
typedef unsigned char (*ROIHandler)(char*, char*, unsigned int);
|
||||
@@ -11,6 +12,31 @@ class LegoTextureContainer;
|
||||
class LegoStorage;
|
||||
class LegoAnim;
|
||||
|
||||
// VTABLE: LEGO1 0x100dbf10
|
||||
// SIZE 0x20
|
||||
class LegoLOD : public ViewLOD {
|
||||
public:
|
||||
LegoLOD(Tgl::Renderer*);
|
||||
~LegoLOD() override;
|
||||
|
||||
// FUNCTION: LEGO1 0x100aae70
|
||||
int NumPolys() const override { return m_numPolys; } // vtable+0x0c
|
||||
|
||||
// FUNCTION: LEGO1 0x100aae80
|
||||
float VTable0x10() override { return 0.0; } // vtable+0x10
|
||||
|
||||
// SYNTHETIC: LEGO1 0x100aa430
|
||||
// LegoLOD::`scalar deleting destructor'
|
||||
|
||||
protected:
|
||||
// TODO: Review 1996 version
|
||||
undefined4 m_unk0x0c; // 0x0c
|
||||
undefined4 m_unk0x10; // 0x10
|
||||
undefined4 m_unk0x14; // 0x14
|
||||
LegoU32 m_numPolys; // 0x18
|
||||
undefined4 m_unk0x1c; // 0x1c
|
||||
};
|
||||
|
||||
// VTABLE: LEGO1 0x100dbe38
|
||||
// SIZE 0x108
|
||||
class LegoROI : public ViewROI {
|
||||
@@ -44,7 +70,7 @@ public:
|
||||
);
|
||||
static unsigned char ColorAliasLookup(char* p_param, float& p_red, float& p_green, float& p_blue, float& p_other);
|
||||
|
||||
inline const char* GetName() const { return m_name; }
|
||||
inline const LegoChar* GetName() const { return m_name; }
|
||||
inline LegoEntity* GetUnknown0x104() { return m_unk0x104; }
|
||||
|
||||
inline void SetUnknown0x104(LegoEntity* p_unk0x104) { m_unk0x104 = p_unk0x104; }
|
||||
@@ -63,13 +89,13 @@ private:
|
||||
// SIZE 0x10c
|
||||
class TimeROI : public LegoROI {
|
||||
public:
|
||||
TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, int p_time);
|
||||
TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, LegoTime p_time);
|
||||
|
||||
// SYNTHETIC: LEGO1 0x100a9ad0
|
||||
// TimeROI::`scalar deleting destructor'
|
||||
|
||||
private:
|
||||
int m_time; // 0x108
|
||||
LegoTime m_time; // 0x108
|
||||
};
|
||||
|
||||
#endif // LEGOROI_H
|
||||
|
||||
Reference in New Issue
Block a user