Implement SetLightPosition and related (#757)

* Implement SetLightPosition and related

* Update p name

* style
This commit is contained in:
Christian Semmler
2024-03-29 16:42:39 -04:00
committed by GitHub
parent f447397eef
commit 369f3fba22
4 changed files with 68 additions and 12 deletions

View File

@@ -182,3 +182,24 @@ void LegoView1::Destroy()
LegoView::Destroy();
}
// FUNCTION: LEGO1 0x100abb60
void LegoView1::SetLight(BOOL bDirectionalLight, Tgl::FloatMatrix4& rMatrix)
{
Tgl::Light* pLight;
if (bDirectionalLight == FALSE) {
pLight = m_pSunLight;
}
else {
pLight = m_pDirectionalLight;
}
SetLight(pLight, rMatrix);
}
// FUNCTION: LEGO1 0x100abb80
void LegoView1::SetLight(Tgl::Light* pLight, Tgl::FloatMatrix4& rMatrix)
{
pLight->SetTransformation(rMatrix);
}

View File

@@ -8,7 +8,8 @@
namespace Tgl
{
class Camera;
}
class Light;
} // namespace Tgl
/////////////////////////////////////////////////////////////////////////////
// LegoView
@@ -64,7 +65,11 @@ public:
BOOL Create(const TglSurface::CreateStruct&, Tgl::Renderer*);
void Destroy() override; // vtable+0x08
void SetLight(BOOL bDirectionalLight, Tgl::FloatMatrix4& rMatrix);
private:
void SetLight(Tgl::Light* pLight, Tgl::FloatMatrix4& rMatrix);
Tgl::Light* m_pSunLight; // 0x78
Tgl::Light* m_pDirectionalLight; // 0x7c
Tgl::Light* m_pAmbientLight; // 0x80