mirror of
https://github.com/isledecomp/isle.git
synced 2025-12-09 23:53:02 +00:00
BETA10: Fix reccmp regressions, match RealtimeView (#1696)
--------- Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
DECOMP_SIZE_ASSERT(ViewManager, 0x1bc)
|
||||
|
||||
// GLOBAL: LEGO1 0x100dbc78
|
||||
// GLOBAL: BETA10 0x101c3398
|
||||
int g_boundingBoxCornerMap[8][3] =
|
||||
{{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {1, 0, 0}, {0, 1, 1}, {1, 0, 1}, {1, 1, 0}, {1, 1, 1}};
|
||||
|
||||
@@ -16,12 +17,15 @@ int g_boundingBoxCornerMap[8][3] =
|
||||
int g_planePointIndexMap[18] = {0, 1, 5, 6, 2, 3, 3, 0, 4, 1, 2, 6, 0, 3, 2, 4, 5, 6};
|
||||
|
||||
// GLOBAL: LEGO1 0x10101050
|
||||
// GLOBAL: BETA10 0x10205914
|
||||
float g_LODScaleFactor = 4.0F;
|
||||
|
||||
// GLOBAL: LEGO1 0x10101054
|
||||
float g_minLODThreshold = 0.00097656297;
|
||||
// GLOBAL: BETA10 0x10205918
|
||||
float g_minLODThreshold = 1.0000005F / 1024;
|
||||
|
||||
// GLOBAL: LEGO1 0x10101058
|
||||
// GLOBAL: BETA10 0x1020591c
|
||||
int g_maxLODLevels = 6;
|
||||
|
||||
// GLOBAL: LEGO1 0x1010105c
|
||||
@@ -32,16 +36,51 @@ float g_elapsedSeconds = 0;
|
||||
|
||||
inline void SetAppData(ViewROI* p_roi, LPD3DRM_APPDATA data);
|
||||
inline undefined4 GetD3DRM(IDirect3DRM2*& d3drm, Tgl::Renderer* pRenderer);
|
||||
inline undefined4 GetFrame(IDirect3DRMFrame2*& frame, Tgl::Group* scene);
|
||||
inline undefined4 GetFrame(IDirect3DRMFrame2** frame, Tgl::Group* scene);
|
||||
|
||||
// STUB: BETA10 0x1017202e
|
||||
int userVisualCallback(
|
||||
LPDIRECT3DRMUSERVISUAL obj,
|
||||
LPVOID arg,
|
||||
D3DRMUSERVISUALREASON reason,
|
||||
LPDIRECT3DRMDEVICE dev,
|
||||
LPDIRECT3DRMVIEWPORT view
|
||||
)
|
||||
{
|
||||
// This function calls into LegoBSP.cpp, which has likely been removed in LEGO1
|
||||
return 0;
|
||||
}
|
||||
|
||||
// FUNCTION: BETA10 0x10172074
|
||||
void addDestroyCallback(LPDIRECT3DRMOBJECT obj, LPVOID arg)
|
||||
{
|
||||
// intentionally empty
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100a5eb0
|
||||
// FUNCTION: BETA10 0x10171cb3
|
||||
ViewManager::ViewManager(Tgl::Renderer* pRenderer, Tgl::Group* scene, const OrientableROI* point_of_view)
|
||||
: scene(scene), flags(c_bit1 | c_bit2 | c_bit3 | c_bit4)
|
||||
{
|
||||
SetPOVSource(point_of_view);
|
||||
prev_render_time = 0.09;
|
||||
GetD3DRM(d3drm, pRenderer);
|
||||
GetFrame(frame, scene);
|
||||
GetFrame(&frame, scene);
|
||||
|
||||
#ifdef BETA10
|
||||
LPDIRECT3DRMUSERVISUAL userVisual;
|
||||
if (d3drm->CreateUserVisual(userVisualCallback, this, &userVisual)) {
|
||||
assert(0);
|
||||
}
|
||||
if (userVisual->AddDestroyCallback(addDestroyCallback, this)) {
|
||||
assert(0);
|
||||
}
|
||||
if (frame->AddVisual(userVisual)) {
|
||||
assert(0);
|
||||
}
|
||||
userVisual->Release();
|
||||
#endif
|
||||
|
||||
width = 0.0;
|
||||
height = 0.0;
|
||||
view_angle = 0.0;
|
||||
@@ -366,6 +405,7 @@ inline int ViewManager::CalculateLODLevel(float p_maximumScale, float p_initialS
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
// LINE: BETA10 0x10172c4d
|
||||
lodLevel = 1;
|
||||
}
|
||||
}
|
||||
@@ -476,6 +516,7 @@ void ViewManager::SetFrustrum(float fov, float front, float back)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100a6da0
|
||||
// FUNCTION: BETA10 0x10173977
|
||||
void ViewManager::SetPOVSource(const OrientableROI* point_of_view)
|
||||
{
|
||||
if (point_of_view != NULL) {
|
||||
@@ -554,19 +595,28 @@ inline void SetAppData(ViewROI* p_roi, LPD3DRM_APPDATA data)
|
||||
{
|
||||
IDirect3DRMFrame2* frame = NULL;
|
||||
|
||||
if (GetFrame(frame, p_roi->GetGeometry()) == 0) {
|
||||
if (GetFrame(&frame, p_roi->GetGeometry()) == 0) {
|
||||
frame->SetAppData(data);
|
||||
}
|
||||
}
|
||||
|
||||
inline undefined4 GetD3DRM(IDirect3DRM2*& d3drm, Tgl::Renderer* pRenderer)
|
||||
// FUNCTION: BETA10 0x10171f30
|
||||
inline undefined4 GetD3DRM(IDirect3DRM2*& d3drm, Tgl::Renderer* p_tglRenderer)
|
||||
{
|
||||
d3drm = ((TglImpl::RendererImpl*) pRenderer)->ImplementationData();
|
||||
assert(p_tglRenderer);
|
||||
TglImpl::RendererImpl* renderer = (TglImpl::RendererImpl*) p_tglRenderer;
|
||||
// Note: Diff in BETA10 (thunked in recompile but not in orig)
|
||||
d3drm = renderer->ImplementationData();
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline undefined4 GetFrame(IDirect3DRMFrame2*& frame, Tgl::Group* scene)
|
||||
// FUNCTION: BETA10 0x10171f82
|
||||
inline undefined4 GetFrame(IDirect3DRMFrame2** p_f, Tgl::Group* p_group)
|
||||
{
|
||||
frame = ((TglImpl::GroupImpl*) scene)->ImplementationData();
|
||||
assert(p_f && p_group);
|
||||
TglImpl::GroupImpl* cast = (TglImpl::GroupImpl*) p_group;
|
||||
assert(cast);
|
||||
*p_f = cast->ImplementationData();
|
||||
assert(p_f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <d3drm.h>
|
||||
|
||||
// VTABLE: LEGO1 0x100dbd88
|
||||
// VTABLE: BETA10 0x101c34bc
|
||||
// SIZE 0x1bc
|
||||
class ViewManager {
|
||||
public:
|
||||
@@ -46,6 +47,7 @@ public:
|
||||
void Add(ViewROI* p_roi) { rois.push_back(p_roi); }
|
||||
|
||||
// SYNTHETIC: LEGO1 0x100a6000
|
||||
// SYNTHETIC: BETA10 0x10174410
|
||||
// ViewManager::`scalar deleting destructor'
|
||||
|
||||
private:
|
||||
@@ -73,10 +75,17 @@ private:
|
||||
// TEMPLATE: LEGO1 0x10022030
|
||||
// list<ROI *,allocator<ROI *> >::insert
|
||||
|
||||
// TEMPLATE: BETA10 0x1007b0b0
|
||||
// List<ROI *>::List<ROI *>
|
||||
|
||||
// TEMPLATE: LEGO1 0x100a6020
|
||||
// List<ROI *>::~List<ROI *>
|
||||
|
||||
// TEMPLATE: BETA10 0x101755d0
|
||||
// Vector<ROI const *>::Vector<ROI const *>
|
||||
|
||||
// TEMPLATE: LEGO1 0x100a6070
|
||||
// TEMPLATE: BETA10 0x10174510
|
||||
// Vector<ROI const *>::~Vector<ROI const *>
|
||||
|
||||
// TEMPLATE: LEGO1 0x100a6f80
|
||||
|
||||
Reference in New Issue
Block a user