Match Lego3DView::Create (#431)

This commit is contained in:
Christian Semmler 2024-01-13 14:58:10 -05:00 committed by GitHub
parent 0edbd9dab9
commit 7d2629318c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 14 deletions

View file

@ -25,27 +25,31 @@ Lego3DView::~Lego3DView()
Destroy();
}
// STUB: LEGO1 0x100aaf90
// FUNCTION: LEGO1 0x100aaf90
BOOL Lego3DView::Create(const TglSurface::CreateStruct& rCreateStruct, Tgl::Renderer* pRenderer)
{
double viewAngle = 45;
double frontClippingDistance = 1;
double backClippingDistance = 5000;
if (rCreateStruct.m_isWideViewAngle)
viewAngle = 90;
float frontClippingDistance = 0.1;
float backClippingDistance = 500;
if (!LegoView1::Create(rCreateStruct, pRenderer)) {
return FALSE;
}
// assert(GetView());
// GetView()->SetFrustrum(frontClippingDistance, backClippingDistance, viewAngle);
assert(GetView());
GetView()->SetFrustrum(frontClippingDistance, backClippingDistance, viewAngle);
// assert(GetScene());
// assert(!m_pViewManager);
assert(GetScene());
assert(!m_pViewManager);
// m_pViewManager = new ViewManager(GetScene(), 0);
// m_pViewManager->SetResolution(GetWidth(), GetHeight());
// m_pViewManager->SetFrustrum(viewAngle, -frontClippingDistance, -backClippingDistance);
// m_previousRenderTime = 0;
m_pViewManager = new ViewManager(pRenderer, GetScene(), 0);
m_pViewManager->SetResolution(GetWidth(), GetHeight());
m_pViewManager->SetFrustrum(viewAngle, frontClippingDistance, backClippingDistance);
m_previousRenderTime = 0;
m_unk0x98 = 0;
// // NOTE: a derived class must inform view manager when it configures
// // its (Tgl) view: calling Tgl::View::SetFrustrum() should be

View file

@ -103,7 +103,7 @@ MxResult MxBitmap::ImportBitmapInfo(MxBITMAPINFO* p_info)
}
if (this->m_data) {
delete this->m_data;
delete[] this->m_data;
this->m_data = NULL;
}
}

View file

@ -1,7 +1,7 @@
#include "viewmanager.h"
// STUB: LEGO1 0x100a5eb0
ViewManager::ViewManager(Tgl::Group* scene, const OrientableROI* point_of_view)
ViewManager::ViewManager(Tgl::Renderer* pRenderer, Tgl::Group* scene, const OrientableROI* point_of_view)
{
}
@ -16,6 +16,16 @@ void ViewManager::RemoveAll(ViewROI*)
// TODO
}
// STUB: LEGO1 0x100a6d50
void ViewManager::SetResolution(int width, int height)
{
}
// STUB: LEGO1 0x100a6d70
void ViewManager::SetFrustrum(float fov, float front, float back)
{
}
// STUB: LEGO1 0x100a6da0
void ViewManager::SetPOVSource(const OrientableROI* point_of_view)
{

View file

@ -7,12 +7,17 @@
// SIZE 0x1bc
class ViewManager {
public:
ViewManager(Tgl::Group* scene, const OrientableROI* point_of_view);
ViewManager(Tgl::Renderer* pRenderer, Tgl::Group* scene, const OrientableROI* point_of_view);
virtual ~ViewManager();
__declspec(dllexport) void RemoveAll(ViewROI*);
void SetPOVSource(const OrientableROI* point_of_view);
void SetResolution(int width, int height);
void SetFrustrum(float fov, float front, float back);
private:
undefined m_pad[0x1b8];
};
#endif // VIEWMANAGER_H