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

View File

@ -1,7 +1,7 @@
#include "viewmanager.h" #include "viewmanager.h"
// STUB: LEGO1 0x100a5eb0 // 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 // 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 // STUB: LEGO1 0x100a6da0
void ViewManager::SetPOVSource(const OrientableROI* point_of_view) void ViewManager::SetPOVSource(const OrientableROI* point_of_view)
{ {

View File

@ -7,12 +7,17 @@
// SIZE 0x1bc // SIZE 0x1bc
class ViewManager { class ViewManager {
public: public:
ViewManager(Tgl::Group* scene, const OrientableROI* point_of_view); ViewManager(Tgl::Renderer* pRenderer, Tgl::Group* scene, const OrientableROI* point_of_view);
virtual ~ViewManager(); virtual ~ViewManager();
__declspec(dllexport) void RemoveAll(ViewROI*); __declspec(dllexport) void RemoveAll(ViewROI*);
void SetPOVSource(const OrientableROI* point_of_view); 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 #endif // VIEWMANAGER_H