isle/LEGO1/viewmanager/viewmanager.cpp

84 lines
1.8 KiB
C++
Raw Normal View History

#include "viewmanager.h"
#include "tgl/d3drm/impl.h"
DECOMP_SIZE_ASSERT(ViewManager, 0x1bc)
inline undefined4 SetD3DRM(IDirect3DRM2*& d3drm, Tgl::Renderer* pRenderer);
inline undefined4 SetFrame(IDirect3DRMFrame2*& frame, Tgl::Group* scene);
// FUNCTION: LEGO1 0x100a5eb0
2024-01-13 14:58:10 -05:00
ViewManager::ViewManager(Tgl::Renderer* pRenderer, Tgl::Group* scene, const OrientableROI* point_of_view)
: scene(scene), flags(c_bit1 | c_bit2 | c_bit3 | c_bit4)
2024-01-10 17:40:24 -05:00
{
SetPOVSource(point_of_view);
unk0x28 = 0.09;
SetD3DRM(d3drm, pRenderer);
SetFrame(frame, scene);
width = 0.0;
height = 0.0;
view_angle = 0.0;
pov.SetIdentity();
front = 0.0;
back = 0.0;
memset(unk0xf0, 0, sizeof(unk0xf0));
seconds_allowed = 1.0;
2024-01-10 17:40:24 -05:00
}
// FUNCTION: LEGO1 0x100a60c0
2024-01-10 17:40:24 -05:00
ViewManager::~ViewManager()
{
SetPOVSource(NULL);
2024-01-10 17:40:24 -05:00
}
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// STUB: LEGO1 0x100a64d0
2023-10-24 19:38:27 -04:00
void ViewManager::RemoveAll(ViewROI*)
{
2023-10-24 19:38:27 -04:00
// TODO
}
2024-01-10 17:40:24 -05:00
// STUB: LEGO1 0x100a6930
void ViewManager::Update(float p_previousRenderTime, float p_und2)
{
// TODO
}
// FUNCTION: LEGO1 0x100a6d50
2024-01-13 14:58:10 -05:00
void ViewManager::SetResolution(int width, int height)
{
flags |= c_bit3;
this->width = width;
this->height = height;
2024-01-13 14:58:10 -05:00
}
// FUNCTION: LEGO1 0x100a6d70
2024-01-13 14:58:10 -05:00
void ViewManager::SetFrustrum(float fov, float front, float back)
{
this->front = front;
this->back = back;
flags |= c_bit3;
view_angle = fov * 0.017453292519944444;
2024-01-13 14:58:10 -05:00
}
// FUNCTION: LEGO1 0x100a6da0
2024-01-10 17:40:24 -05:00
void ViewManager::SetPOVSource(const OrientableROI* point_of_view)
{
if (point_of_view != NULL) {
pov = point_of_view->GetLocal2World();
flags |= c_bit2;
}
}
inline undefined4 SetD3DRM(IDirect3DRM2*& d3drm, Tgl::Renderer* pRenderer)
{
d3drm = ((TglImpl::RendererImpl*) pRenderer)->ImplementationData();
return 0;
}
inline undefined4 SetFrame(IDirect3DRMFrame2*& frame, Tgl::Group* scene)
{
frame = ((TglImpl::GroupImpl*) scene)->ImplementationData();
return 0;
2024-01-10 17:40:24 -05:00
}