Implement LegoVideoManager::Create and related (#393)

* WIP

* Match

* Changes

* Fix format

* Style fixes

* Update naming.yml

* Match to ~85%
This commit is contained in:
Christian Semmler
2024-01-01 19:17:38 -05:00
committed by GitHub
parent 1e43f20af5
commit 935ebe6910
33 changed files with 742 additions and 199 deletions

View File

@@ -0,0 +1,28 @@
#include "viewlodlist.h"
#include "decomp.h"
DECOMP_SIZE_ASSERT(ViewLODListManager, 0x14);
// FUNCTION: LEGO1 0x100a6fd0
ViewLODListManager::ViewLODListManager()
{
}
// STUB: LEGO1 0x100a7130
ViewLODListManager::~ViewLODListManager()
{
// TODO
}
// STUB: LEGO1 0x100a72c0
ViewLODList* ViewLODListManager::Create(const ROIName&, int lodCount)
{
// TODO
return NULL;
}
// STUB: LEGO1 0x100a7680
void ViewLODListManager::Destroy(ViewLODList* lodList)
{
}

View File

@@ -1,6 +1,7 @@
#ifndef VIEWLODLIST_H
#define VIEWLODLIST_H
#include "../mxstl/stlcompat.h"
#include "../realtime/lodlist.h"
#include "assert.h"
#include "compat.h"
@@ -59,6 +60,8 @@ struct ROINameComparator {
// It stores ViewLODLists under a name, the name of the ROI where
// the ViewLODList belongs.
// VTABLE: LEGO1 0x100dbdbc
// SIZE 0x14
class ViewLODListManager {
typedef map<ROIName, ViewLODList*, ROINameComparator> ViewLODListMap;

View File

@@ -4,6 +4,9 @@
DECOMP_SIZE_ASSERT(ViewROI, 0xe0)
// GLOBAL: LEGO1 0x101013d8
undefined g_unk101013d8 = 0;
// FUNCTION: LEGO1 0x100a9eb0
float ViewROI::IntrinsicImportance() const
{
@@ -34,9 +37,10 @@ void ViewROI::UpdateWorldData(const Matrix4Data& parent2world)
}
}
inline ViewROI::~ViewROI()
// FUNCTION: LEGO1 0x100aa500
undefined ViewROI::SetUnk101013d8(undefined p_flag)
{
// SetLODList() will decrease refCount of LODList
SetLODList(0);
delete geometry;
undefined oldFlag = g_unk101013d8;
g_unk101013d8 = p_flag;
return oldFlag;
}

View File

@@ -3,6 +3,7 @@
#include "../realtime/orientableroi.h"
#include "../tgl/tgl.h"
#include "decomp.h"
#include "viewlodlist.h"
/*
@@ -10,6 +11,9 @@
etc. Basically, anything which can be placed in a scene and manipilated
by the view manager is a ViewROI.
*/
// VTABLE: LEGO1 0x100dbe70
// SIZE 0xe0
class ViewROI : public OrientableROI {
public:
inline ViewROI(Tgl::Renderer* pRenderer, ViewLODList* lodList)
@@ -17,7 +21,12 @@ public:
SetLODList(lodList);
geometry = pRenderer->CreateGroup();
}
inline ~ViewROI();
inline ~ViewROI()
{
// SetLODList() will decrease refCount of LODList
SetLODList(0);
delete geometry;
}
inline void SetLODList(ViewLODList* lodList)
{
// ??? inherently type unsafe - kind of... because, now, ROI
@@ -39,6 +48,8 @@ public:
virtual Tgl::Group* GetGeometry();
virtual const Tgl::Group* GetGeometry() const;
static undefined SetUnk101013d8(undefined p_flag);
protected:
Tgl::Group* geometry;
void UpdateWorldData(const Matrix4Data& parent2world);