Beta addrs for TglSurface and related (#905)

This commit is contained in:
MS 2024-05-11 12:27:06 -04:00 committed by GitHub
parent f442f1a2f7
commit b3d6319656
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 55 additions and 6 deletions

View file

@ -26,6 +26,7 @@ float g_ambientLightRGB = 0.3;
// LegoView // LegoView
// FUNCTION: LEGO1 0x100ab510 // FUNCTION: LEGO1 0x100ab510
// FUNCTION: BETA10 0x1017bb90
LegoView::LegoView() LegoView::LegoView()
{ {
m_pScene = 0; m_pScene = 0;
@ -33,18 +34,17 @@ LegoView::LegoView()
} }
// FUNCTION: LEGO1 0x100ab5a0 // FUNCTION: LEGO1 0x100ab5a0
// FUNCTION: BETA10 0x1017bc19
LegoView::~LegoView() LegoView::~LegoView()
{ {
Destroy(); Destroy();
} }
// FUNCTION: LEGO1 0x100ab600 // FUNCTION: LEGO1 0x100ab600
// FUNCTION: BETA10 0x1017bc89
BOOL LegoView::Create(const TglSurface::CreateStruct& rCreateStruct, Tgl::Renderer* pRenderer) BOOL LegoView::Create(const TglSurface::CreateStruct& rCreateStruct, Tgl::Renderer* pRenderer)
{ {
float viewAngle = 45; float viewAngle = 45;
if (rCreateStruct.m_isWideViewAngle) {
viewAngle = 90;
}
float frontClippingDistance = 0.1; float frontClippingDistance = 0.1;
float backClippingDistance = 500; float backClippingDistance = 500;
@ -53,6 +53,10 @@ BOOL LegoView::Create(const TglSurface::CreateStruct& rCreateStruct, Tgl::Render
assert(!m_pCamera); assert(!m_pCamera);
assert(pRenderer); assert(pRenderer);
if (rCreateStruct.m_isWideViewAngle) {
viewAngle = 90;
}
m_pScene = pRenderer->CreateGroup(); m_pScene = pRenderer->CreateGroup();
assert(m_pScene); assert(m_pScene);
// TglSurface::Create() calls CreateView(), and we need the camera in // TglSurface::Create() calls CreateView(), and we need the camera in
@ -78,6 +82,7 @@ BOOL LegoView::Create(const TglSurface::CreateStruct& rCreateStruct, Tgl::Render
} }
// FUNCTION: LEGO1 0x100ab6c0 // FUNCTION: LEGO1 0x100ab6c0
// FUNCTION: BETA10 0x1017befd
Tgl::View* LegoView::CreateView(Tgl::Renderer* pRenderer, Tgl::Device* pDevice) Tgl::View* LegoView::CreateView(Tgl::Renderer* pRenderer, Tgl::Device* pDevice)
{ {
assert(pRenderer); assert(pRenderer);
@ -87,6 +92,7 @@ Tgl::View* LegoView::CreateView(Tgl::Renderer* pRenderer, Tgl::Device* pDevice)
} }
// FUNCTION: LEGO1 0x100ab6f0 // FUNCTION: LEGO1 0x100ab6f0
// FUNCTION: BETA10 0x1017bf96
void LegoView::Destroy() void LegoView::Destroy()
{ {
delete m_pScene; delete m_pScene;
@ -102,6 +108,7 @@ void LegoView::Destroy()
// LegoView1 // LegoView1
// FUNCTION: LEGO1 0x100ab730 // FUNCTION: LEGO1 0x100ab730
// FUNCTION: BETA10 0x1017c028
LegoView1::LegoView1() LegoView1::LegoView1()
{ {
m_pSunLight = 0; m_pSunLight = 0;
@ -110,14 +117,17 @@ LegoView1::LegoView1()
} }
// FUNCTION: LEGO1 0x100ab7c0 // FUNCTION: LEGO1 0x100ab7c0
// FUNCTION: BETA10 0x1017c0be
LegoView1::~LegoView1() LegoView1::~LegoView1()
{ {
Destroy(); Destroy();
} }
// FUNCTION: LEGO1 0x100ab820 // FUNCTION: LEGO1 0x100ab820
// FUNCTION: BETA10 0x1017c12e
BOOL LegoView1::AddLightsToViewport() BOOL LegoView1::AddLightsToViewport()
{ {
assert(GetView());
GetView()->Add(m_pSunLight); GetView()->Add(m_pSunLight);
GetView()->Add(m_pDirectionalLight); GetView()->Add(m_pDirectionalLight);
GetView()->Add(m_pAmbientLight); GetView()->Add(m_pAmbientLight);
@ -125,6 +135,7 @@ BOOL LegoView1::AddLightsToViewport()
} }
// FUNCTION: LEGO1 0x100ab860 // FUNCTION: LEGO1 0x100ab860
// FUNCTION: BETA10 0x1017c1ea
BOOL LegoView1::Create(const TglSurface::CreateStruct& rCreateStruct, Tgl::Renderer* pRenderer) BOOL LegoView1::Create(const TglSurface::CreateStruct& rCreateStruct, Tgl::Renderer* pRenderer)
{ {
if (!LegoView::Create(rCreateStruct, pRenderer)) { if (!LegoView::Create(rCreateStruct, pRenderer)) {
@ -154,12 +165,13 @@ BOOL LegoView1::Create(const TglSurface::CreateStruct& rCreateStruct, Tgl::Rende
SETMAT4(in, transform); SETMAT4(in, transform);
m_pSunLight->SetTransformation(matrix); m_pSunLight->SetTransformation(matrix);
assert(GetView()); // assert(GetView());
return AddLightsToViewport(); return AddLightsToViewport();
} }
// FUNCTION: LEGO1 0x100abad0 // FUNCTION: LEGO1 0x100abad0
// FUNCTION: BETA10 0x1017c912
void LegoView1::Destroy() void LegoView1::Destroy()
{ {
if (m_pSunLight) { if (m_pSunLight) {
@ -184,6 +196,7 @@ void LegoView1::Destroy()
} }
// FUNCTION: LEGO1 0x100abb60 // FUNCTION: LEGO1 0x100abb60
// FUNCTION: BETA10 0x1017ca80
void LegoView1::SetLightTransform(BOOL bDirectionalLight, Tgl::FloatMatrix4& rMatrix) void LegoView1::SetLightTransform(BOOL bDirectionalLight, Tgl::FloatMatrix4& rMatrix)
{ {
Tgl::Light* pLight; Tgl::Light* pLight;
@ -199,12 +212,14 @@ void LegoView1::SetLightTransform(BOOL bDirectionalLight, Tgl::FloatMatrix4& rMa
} }
// FUNCTION: LEGO1 0x100abb80 // FUNCTION: LEGO1 0x100abb80
// FUNCTION: BETA10 0x1017cacf
void LegoView1::SetLightTransform(Tgl::Light* pLight, Tgl::FloatMatrix4& rMatrix) void LegoView1::SetLightTransform(Tgl::Light* pLight, Tgl::FloatMatrix4& rMatrix)
{ {
pLight->SetTransformation(rMatrix); pLight->SetTransformation(rMatrix);
} }
// FUNCTION: LEGO1 0x100abba0 // FUNCTION: LEGO1 0x100abba0
// FUNCTION: BETA10 0x1017caf6
void LegoView1::SetLightColor(BOOL bDirectionalLight, float red, float green, float blue) void LegoView1::SetLightColor(BOOL bDirectionalLight, float red, float green, float blue)
{ {
Tgl::Light* pLight; Tgl::Light* pLight;
@ -220,6 +235,7 @@ void LegoView1::SetLightColor(BOOL bDirectionalLight, float red, float green, fl
} }
// FUNCTION: LEGO1 0x100abbd0 // FUNCTION: LEGO1 0x100abbd0
// FUNCTION: BETA10 0x1017cb4d
void LegoView1::SetLightColor(Tgl::Light* pLight, float red, float green, float blue) void LegoView1::SetLightColor(Tgl::Light* pLight, float red, float green, float blue)
{ {
pLight->SetColor(red, green, blue); pLight->SetColor(red, green, blue);

View file

@ -15,6 +15,7 @@ class Light;
// LegoView // LegoView
// VTABLE: LEGO1 0x100dc000 // VTABLE: LEGO1 0x100dc000
// VTABLE: BETA10 0x101c3578
// SIZE 0x78 // SIZE 0x78
class LegoView : public TglSurface { class LegoView : public TglSurface {
public: public:
@ -49,12 +50,14 @@ inline Tgl::Camera* LegoView::GetCamera() const
} }
// SYNTHETIC: LEGO1 0x100ab580 // SYNTHETIC: LEGO1 0x100ab580
// SYNTHETIC: BETA10 0x1017cb80
// LegoView::`scalar deleting destructor' // LegoView::`scalar deleting destructor'
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// LegoView1 // LegoView1
// VTABLE: LEGO1 0x100dc018 // VTABLE: LEGO1 0x100dc018
// VTABLE: BETA10 0x101c3590
// SIZE 0x88 // SIZE 0x88
class LegoView1 : public LegoView { class LegoView1 : public LegoView {
public: public:
@ -78,6 +81,7 @@ class LegoView1 : public LegoView {
}; };
// SYNTHETIC: LEGO1 0x100ab7a0 // SYNTHETIC: LEGO1 0x100ab7a0
// SYNTHETIC: BETA10 0x1017cc00
// LegoView1::`scalar deleting destructor' // LegoView1::`scalar deleting destructor'
#endif /* _LegoView1_h */ #endif /* _LegoView1_h */

View file

@ -12,6 +12,7 @@ using namespace Tgl;
// TglSurface // TglSurface
// FUNCTION: LEGO1 0x100abbf0 // FUNCTION: LEGO1 0x100abbf0
// FUNCTION: BETA10 0x1017d490
TglSurface::TglSurface() TglSurface::TglSurface()
{ {
m_pRenderer = 0; m_pRenderer = 0;
@ -33,12 +34,14 @@ TglSurface::TglSurface()
} }
// FUNCTION: LEGO1 0x100abd60 // FUNCTION: LEGO1 0x100abd60
// FUNCTION: BETA10 0x1017d5a2
TglSurface::~TglSurface() TglSurface::~TglSurface()
{ {
Destroy(); Destroy();
} }
// FUNCTION: LEGO1 0x100abde0 // FUNCTION: LEGO1 0x100abde0
// FUNCTION: BETA10 0x1017d647
void TglSurface::Destroy() void TglSurface::Destroy()
{ {
DestroyView(); DestroyView();
@ -52,6 +55,7 @@ void TglSurface::Destroy()
// ??? // ???
// FUNCTION: LEGO1 0x100abe10 // FUNCTION: LEGO1 0x100abe10
// FUNCTION: BETA10 0x1017d6b0
int GetBitsPerPixel(IDirectDrawSurface* pSurface) int GetBitsPerPixel(IDirectDrawSurface* pSurface)
{ {
DDPIXELFORMAT pixelFormat; DDPIXELFORMAT pixelFormat;
@ -68,6 +72,7 @@ int GetBitsPerPixel(IDirectDrawSurface* pSurface)
} }
// FUNCTION: LEGO1 0x100abe50 // FUNCTION: LEGO1 0x100abe50
// FUNCTION: BETA10 0x1017d742
BOOL TglSurface::Create(const CreateStruct& rCreateStruct, Renderer* pRenderer, Group* pScene) BOOL TglSurface::Create(const CreateStruct& rCreateStruct, Renderer* pRenderer, Group* pScene)
{ {
DeviceDirect3DCreateData createData = {rCreateStruct.m_direct3d, rCreateStruct.m_d3dDevice}; DeviceDirect3DCreateData createData = {rCreateStruct.m_direct3d, rCreateStruct.m_d3dDevice};
@ -97,15 +102,16 @@ BOOL TglSurface::Create(const CreateStruct& rCreateStruct, Renderer* pRenderer,
textureShadeCount = 4; textureShadeCount = 4;
} }
else if (bitsPerPixel == 8) { else if (bitsPerPixel == 8) {
shadeCount = 32;
shadeCount = 16; shadeCount = 16;
dither = FALSE; dither = FALSE;
textureShadeCount = 16; textureShadeCount = shadeCount;
textureColorCount = 256; textureColorCount = 256;
} }
else if (bitsPerPixel == 16) { else if (bitsPerPixel == 16) {
shadeCount = 32; shadeCount = 32;
dither = FALSE; dither = FALSE;
textureShadeCount = 32; textureShadeCount = shadeCount;
textureColorCount = 256; textureColorCount = 256;
} }
else if (bitsPerPixel >= 24) { else if (bitsPerPixel >= 24) {
@ -161,6 +167,7 @@ BOOL TglSurface::Create(const CreateStruct& rCreateStruct, Renderer* pRenderer,
} }
// FUNCTION: LEGO1 0x100ac030 // FUNCTION: LEGO1 0x100ac030
// FUNCTION: BETA10 0x1017db86
void TglSurface::DestroyView() void TglSurface::DestroyView()
{ {
delete m_pView; delete m_pView;
@ -168,6 +175,7 @@ void TglSurface::DestroyView()
} }
// FUNCTION: LEGO1 0x100ac050 // FUNCTION: LEGO1 0x100ac050
// FUNCTION: BETA10 0x1017dbd0
double TglSurface::Render() double TglSurface::Render()
{ {
MxStopWatch renderTimer; MxStopWatch renderTimer;

View file

@ -16,6 +16,7 @@ class Group;
// TglSurface // TglSurface
// VTABLE: LEGO1 0x100dc060 // VTABLE: LEGO1 0x100dc060
// VTABLE: BETA10 0x101c3648
// SIZE 0x70 // SIZE 0x70
class TglSurface { class TglSurface {
public: public:
@ -43,10 +44,15 @@ class TglSurface {
Tgl::Renderer* GetRenderer() const { return m_pRenderer; } Tgl::Renderer* GetRenderer() const { return m_pRenderer; }
Tgl::Device* GetDevice() const { return m_pDevice; } Tgl::Device* GetDevice() const { return m_pDevice; }
// FUNCTION: BETA10 0x100d5570
Tgl::View* GetView() const { return m_pView; } Tgl::View* GetView() const { return m_pView; }
Tgl::Group* GetScene() const { return m_pScene; } Tgl::Group* GetScene() const { return m_pScene; }
// FUNCTION: BETA10 0x1017cbc0
unsigned long GetWidth() const { return m_width; } unsigned long GetWidth() const { return m_width; }
// FUNCTION: BETA10 0x1017cbe0
unsigned long GetHeight() const { return m_height; } unsigned long GetHeight() const { return m_height; }
double GetRenderingRate() const { return m_renderingRateMeter.Frequency(); } double GetRenderingRate() const { return m_renderingRateMeter.Frequency(); }
@ -85,6 +91,7 @@ class TglSurface {
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// SYNTHETIC: LEGO1 0x100abcf0 // SYNTHETIC: LEGO1 0x100abcf0
// SYNTHETIC: BETA10 0x1017de00
// TglSurface::`scalar deleting destructor' // TglSurface::`scalar deleting destructor'
#endif /* _TglSurface_h */ #endif /* _TglSurface_h */

View file

@ -39,17 +39,20 @@ class MxStopWatch {
unsigned long m_ticksPerSeconds; // 0x14 unsigned long m_ticksPerSeconds; // 0x14
}; };
// FUNCTION: BETA10 0x100d8ba0
inline MxStopWatch::MxStopWatch() inline MxStopWatch::MxStopWatch()
{ {
Reset(); Reset();
m_ticksPerSeconds = TicksPerSeconds(); m_ticksPerSeconds = TicksPerSeconds();
} }
// FUNCTION: BETA10 0x100d8be0
inline void MxStopWatch::Start() inline void MxStopWatch::Start()
{ {
QueryPerformanceCounter(&m_startTick); QueryPerformanceCounter(&m_startTick);
} }
// FUNCTION: BETA10 0x100d8f50
inline void MxStopWatch::Stop() inline void MxStopWatch::Stop()
{ {
LARGE_INTEGER endTick; LARGE_INTEGER endTick;
@ -67,6 +70,7 @@ inline void MxStopWatch::Stop()
} }
} }
// FUNCTION: BETA10 0x100d8c10
inline void MxStopWatch::Reset() inline void MxStopWatch::Reset()
{ {
m_startTick.LowPart = 0; m_startTick.LowPart = 0;
@ -74,6 +78,7 @@ inline void MxStopWatch::Reset()
m_elapsedSeconds = 0; m_elapsedSeconds = 0;
} }
// FUNCTION: BETA10 0x100d8c60
inline unsigned long MxStopWatch::TicksPerSeconds() const inline unsigned long MxStopWatch::TicksPerSeconds() const
{ {
LARGE_INTEGER ticksPerSeconds; LARGE_INTEGER ticksPerSeconds;
@ -93,12 +98,14 @@ inline unsigned long MxStopWatch::TicksPerSeconds() const
} }
} }
// FUNCTION: BETA10 0x100d9020
inline double MxStopWatch::ElapsedSeconds() const inline double MxStopWatch::ElapsedSeconds() const
{ {
return m_elapsedSeconds; return m_elapsedSeconds;
} }
// SYNTHETIC: LEGO1 0x100a6fc0 // SYNTHETIC: LEGO1 0x100a6fc0
// SYNTHETIC: BETA10 0x100d8e70
// MxStopWatch::~MxStopWatch // MxStopWatch::~MxStopWatch
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@ -131,15 +138,18 @@ class MxFrequencyMeter {
// MxFrequencyMeter implementation // MxFrequencyMeter implementation
// //
// FUNCTION: BETA10 0x1017dd80
inline MxFrequencyMeter::MxFrequencyMeter() : m_operationCount(0) inline MxFrequencyMeter::MxFrequencyMeter() : m_operationCount(0)
{ {
} }
// FUNCTION: BETA10 0x1017deb0
inline void MxFrequencyMeter::StartOperation() inline void MxFrequencyMeter::StartOperation()
{ {
m_stopWatch.Start(); m_stopWatch.Start();
} }
// FUNCTION: BETA10 0x1017df10
inline void MxFrequencyMeter::EndOperation() inline void MxFrequencyMeter::EndOperation()
{ {
m_stopWatch.Stop(); m_stopWatch.Stop();
@ -165,6 +175,7 @@ inline double MxFrequencyMeter::Frequency() const
} }
} }
// FUNCTION: BETA10 0x1017dee0
inline void MxFrequencyMeter::Reset() inline void MxFrequencyMeter::Reset()
{ {
m_stopWatch.Reset(); m_stopWatch.Reset();
@ -176,17 +187,20 @@ inline unsigned long MxFrequencyMeter::OperationCount() const
return m_operationCount; return m_operationCount;
} }
// FUNCTION: BETA10 0x1017df40
inline void MxFrequencyMeter::IncreaseOperationCount(unsigned long delta) inline void MxFrequencyMeter::IncreaseOperationCount(unsigned long delta)
{ {
m_operationCount += delta; m_operationCount += delta;
} }
// FUNCTION: BETA10 0x1017df60
inline double MxFrequencyMeter::ElapsedSeconds() const inline double MxFrequencyMeter::ElapsedSeconds() const
{ {
return m_stopWatch.ElapsedSeconds(); return m_stopWatch.ElapsedSeconds();
} }
// SYNTHETIC: LEGO1 0x100abd10 // SYNTHETIC: LEGO1 0x100abd10
// SYNTHETIC: BETA10 0x1017de40
// MxFrequencyMeter::~MxFrequencyMeter // MxFrequencyMeter::~MxFrequencyMeter
#endif /* _MxStopWatch_h */ #endif /* _MxStopWatch_h */