mirror of
https://github.com/isledecomp/isle.git
synced 2024-11-26 17:46:38 -05:00
Implement/match Tgl::View::Render (#566)
This commit is contained in:
parent
efcb3cac2a
commit
5d80733cb1
4 changed files with 35 additions and 27 deletions
|
@ -181,8 +181,7 @@ double TglSurface::Render()
|
||||||
m_renderingRateMeter.StartOperation();
|
m_renderingRateMeter.StartOperation();
|
||||||
renderTimer.Start();
|
renderTimer.Start();
|
||||||
|
|
||||||
// TODO: Wrong interface
|
result = m_pView->Render(m_pScene);
|
||||||
result = m_pView->Render((Tgl::Light*) m_pScene);
|
|
||||||
|
|
||||||
renderTimer.Stop();
|
renderTimer.Stop();
|
||||||
assert(Succeeded(result));
|
assert(Succeeded(result));
|
||||||
|
|
|
@ -170,7 +170,7 @@ class ViewImpl : public View {
|
||||||
// vtable+0x20
|
// vtable+0x20
|
||||||
Result GetBackgroundColor(float* r, float* g, float* b) override;
|
Result GetBackgroundColor(float* r, float* g, float* b) override;
|
||||||
Result Clear() override;
|
Result Clear() override;
|
||||||
Result Render(const Light*) override;
|
Result Render(const Group*) override;
|
||||||
Result ForceUpdate(unsigned long x, unsigned long y, unsigned long width, unsigned long height) override;
|
Result ForceUpdate(unsigned long x, unsigned long y, unsigned long width, unsigned long height) override;
|
||||||
|
|
||||||
// vtable+0x30
|
// vtable+0x30
|
||||||
|
@ -319,6 +319,8 @@ class GroupImpl : public Group {
|
||||||
// vtable+0x30
|
// vtable+0x30
|
||||||
Result Unknown() override;
|
Result Unknown() override;
|
||||||
|
|
||||||
|
inline IDirect3DRMFrame2* ImplementationData() const { return m_data; }
|
||||||
|
|
||||||
friend class RendererImpl;
|
friend class RendererImpl;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -244,33 +244,40 @@ inline Result ViewPrepareFrameForRender(
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100a2fd0
|
inline Result ViewRender(IDirect3DRMViewport* pViewport, const IDirect3DRMFrame2* pGroup)
|
||||||
Result ViewImpl::Render(const Light* pCamera)
|
|
||||||
{
|
{
|
||||||
ViewportAppData* appdata = ViewportGetData(m_data);
|
ViewportAppData* pViewportAppData;
|
||||||
|
Result result;
|
||||||
|
|
||||||
IDirect3DRMFrame2* light = static_cast<const LightImpl*>(pCamera)->ImplementationData();
|
pViewportAppData = reinterpret_cast<ViewportAppData*>(pViewport->GetAppData());
|
||||||
|
|
||||||
IDirect3DRMFrame2* lastRendered = appdata->m_pLastRenderedFrame;
|
if (pViewportAppData->m_pLastRenderedFrame != pGroup) {
|
||||||
if (light != lastRendered) {
|
result = ViewRestoreFrameAfterRender(
|
||||||
if (lastRendered) {
|
pViewportAppData->m_pLastRenderedFrame,
|
||||||
lastRendered->DeleteChild(appdata->m_pCamera);
|
pViewportAppData->m_pCamera,
|
||||||
// Some other call goes here, not sure what.
|
pViewportAppData->m_pLightFrame
|
||||||
lastRendered->Release();
|
);
|
||||||
}
|
|
||||||
appdata->m_pLastRenderedFrame = light;
|
pViewportAppData->m_pLastRenderedFrame = const_cast<IDirect3DRMFrame2*>(pGroup);
|
||||||
if (light) {
|
|
||||||
light->SetSceneBackgroundRGB(
|
result = ViewPrepareFrameForRender(
|
||||||
appdata->m_backgroundColorRed,
|
pViewportAppData->m_pLastRenderedFrame,
|
||||||
appdata->m_backgroundColorGreen,
|
pViewportAppData->m_pCamera,
|
||||||
appdata->m_backgroundColorBlue
|
pViewportAppData->m_pLightFrame,
|
||||||
|
pViewportAppData->m_backgroundColorRed,
|
||||||
|
pViewportAppData->m_backgroundColorGreen,
|
||||||
|
pViewportAppData->m_backgroundColorBlue
|
||||||
);
|
);
|
||||||
light->AddChild(appdata->m_pCamera);
|
|
||||||
// Some other call goes here, not sure what.
|
|
||||||
light->AddRef();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ResultVal(m_data->Render(light));
|
result = ResultVal(pViewport->Render(const_cast<IDirect3DRMFrame2*>(pGroup)));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION: LEGO1 0x100a2fd0
|
||||||
|
Result ViewImpl::Render(const Group* pGroup)
|
||||||
|
{
|
||||||
|
return ViewRender(m_data, static_cast<const GroupImpl*>(pGroup)->ImplementationData());
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100a3080
|
// FUNCTION: LEGO1 0x100a3080
|
||||||
|
|
|
@ -189,7 +189,7 @@ class View : public Object {
|
||||||
// vtable+0x20
|
// vtable+0x20
|
||||||
virtual Result GetBackgroundColor(float* r, float* g, float* b) = 0;
|
virtual Result GetBackgroundColor(float* r, float* g, float* b) = 0;
|
||||||
virtual Result Clear() = 0;
|
virtual Result Clear() = 0;
|
||||||
virtual Result Render(const Light*) = 0;
|
virtual Result Render(const Group*) = 0;
|
||||||
virtual Result ForceUpdate(unsigned long x, unsigned long y, unsigned long width, unsigned long height) = 0;
|
virtual Result ForceUpdate(unsigned long x, unsigned long y, unsigned long width, unsigned long height) = 0;
|
||||||
|
|
||||||
// vtable+0x30
|
// vtable+0x30
|
||||||
|
|
Loading…
Reference in a new issue