Add BETA10 addresses for LegoROI and others (#1569)

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
jonschz
2025-06-21 07:52:24 +02:00
committed by GitHub
parent 72eb194424
commit f64af166c8
8 changed files with 79 additions and 23 deletions

View File

@@ -725,6 +725,7 @@ void LegoAnimNodeData::SetName(LegoChar* p_name)
} }
// FUNCTION: LEGO1 0x100a03c0 // FUNCTION: LEGO1 0x100a03c0
// FUNCTION: BETA10 0x1017f254
LegoResult LegoAnimNodeData::CreateLocalTransform(LegoFloat p_time, Matrix4& p_matrix) LegoResult LegoAnimNodeData::CreateLocalTransform(LegoFloat p_time, Matrix4& p_matrix)
{ {
LegoU32 index; LegoU32 index;

View File

@@ -58,8 +58,12 @@ ColorOverride g_colorOverride = NULL;
TextureHandler g_textureHandler = NULL; TextureHandler g_textureHandler = NULL;
// FUNCTION: LEGO1 0x100a81b0 // FUNCTION: LEGO1 0x100a81b0
void LegoROI::FUN_100a81b0(const LegoChar* p_error, const LegoChar* p_name) // FUNCTION: BETA10 0x101898c0
// FUNCTION: ALPHA 0x100bb1c0
void LegoROI::FUN_100a81b0(const LegoChar* p_error, ...)
{ {
// Probably a printf-like debug function that was removed early.
// No known implementation in any of the binaries.
} }
// FUNCTION: LEGO1 0x100a81c0 // FUNCTION: LEGO1 0x100a81c0
@@ -69,6 +73,7 @@ void LegoROI::configureLegoROI(int p_roiConfig)
} }
// FUNCTION: LEGO1 0x100a81d0 // FUNCTION: LEGO1 0x100a81d0
// FUNCTION: BETA10 0x101898e8
LegoROI::LegoROI(Tgl::Renderer* p_renderer) : ViewROI(p_renderer, NULL) LegoROI::LegoROI(Tgl::Renderer* p_renderer) : ViewROI(p_renderer, NULL)
{ {
m_parentROI = NULL; m_parentROI = NULL;
@@ -77,6 +82,7 @@ LegoROI::LegoROI(Tgl::Renderer* p_renderer) : ViewROI(p_renderer, NULL)
} }
// FUNCTION: LEGO1 0x100a82d0 // FUNCTION: LEGO1 0x100a82d0
// FUNCTION: BETA10 0x10189994
LegoROI::LegoROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList) : ViewROI(p_renderer, p_lodList) LegoROI::LegoROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList) : ViewROI(p_renderer, p_lodList)
{ {
m_parentROI = NULL; m_parentROI = NULL;
@@ -85,6 +91,7 @@ LegoROI::LegoROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList) : ViewROI(p_
} }
// FUNCTION: LEGO1 0x100a83c0 // FUNCTION: LEGO1 0x100a83c0
// FUNCTION: BETA10 0x10189a42
LegoROI::~LegoROI() LegoROI::~LegoROI()
{ {
if (comp) { if (comp) {
@@ -105,6 +112,7 @@ LegoROI::~LegoROI()
} }
// FUNCTION: LEGO1 0x100a84a0 // FUNCTION: LEGO1 0x100a84a0
// FUNCTION: BETA10 0x10189b99
LegoResult LegoROI::Read( LegoResult LegoROI::Read(
OrientableROI* p_unk0xd4, OrientableROI* p_unk0xd4,
Tgl::Renderer* p_renderer, Tgl::Renderer* p_renderer,
@@ -337,6 +345,7 @@ done:
} }
// FUNCTION: LEGO1 0x100a8cb0 // FUNCTION: LEGO1 0x100a8cb0
// FUNCTION: BETA10 0x1018a7e8
LegoResult LegoROI::CreateLocalTransform(LegoAnimNodeData* p_data, LegoTime p_time, Matrix4& p_matrix) LegoResult LegoROI::CreateLocalTransform(LegoAnimNodeData* p_data, LegoTime p_time, Matrix4& p_matrix)
{ {
p_matrix.SetIdentity(); p_matrix.SetIdentity();
@@ -379,6 +388,7 @@ LegoROI* LegoROI::FindChildROI(const LegoChar* p_name, LegoROI* p_roi)
} }
// FUNCTION: LEGO1 0x100a8da0 // FUNCTION: LEGO1 0x100a8da0
// FUNCTION: BETA10 0x1018a9fb
LegoResult LegoROI::ApplyAnimationTransformation( LegoResult LegoROI::ApplyAnimationTransformation(
LegoTreeNode* p_node, LegoTreeNode* p_node,
const Matrix4& p_matrix, const Matrix4& p_matrix,
@@ -473,6 +483,7 @@ void LegoROI::FUN_100a8fd0(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_t
} }
// FUNCTION: LEGO1 0x100a90f0 // FUNCTION: LEGO1 0x100a90f0
// FUNCTION: BETA10 0x1018ada8
LegoResult LegoROI::SetFrame(LegoAnim* p_anim, LegoTime p_time) LegoResult LegoROI::SetFrame(LegoAnim* p_anim, LegoTime p_time)
{ {
LegoTreeNode* root = p_anim->GetRoot(); LegoTreeNode* root = p_anim->GetRoot();
@@ -512,6 +523,7 @@ LegoResult LegoROI::SetLodColor(LegoFloat p_red, LegoFloat p_green, LegoFloat p_
} }
// FUNCTION: LEGO1 0x100a9210 // FUNCTION: LEGO1 0x100a9210
// FUNCTION: BETA10 0x1018af25
LegoResult LegoROI::SetTextureInfo(LegoTextureInfo* p_textureInfo) LegoResult LegoROI::SetTextureInfo(LegoTextureInfo* p_textureInfo)
{ {
LegoResult result = SUCCESS; LegoResult result = SUCCESS;
@@ -735,6 +747,7 @@ LegoU32 LegoROI::FUN_100a9410(
} }
// FUNCTION: LEGO1 0x100a9a50 // FUNCTION: LEGO1 0x100a9a50
// FUNCTION: BETA10 0x1018bb6b
TimeROI::TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, LegoTime p_time) : LegoROI(p_renderer, p_lodList) TimeROI::TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, LegoTime p_time) : LegoROI(p_renderer, p_lodList)
{ {
m_time = p_time; m_time = p_time;
@@ -760,6 +773,7 @@ void TimeROI::FUN_100a9b40(Matrix4& p_matrix, LegoTime p_time)
} }
// FUNCTION: LEGO1 0x100a9bf0 // FUNCTION: LEGO1 0x100a9bf0
// FUNCTION: BETA10 0x1018bc93
LegoBool LegoROI::GetRGBAColor(const LegoChar* p_name, float& p_red, float& p_green, float& p_blue, float& p_alpha) LegoBool LegoROI::GetRGBAColor(const LegoChar* p_name, float& p_red, float& p_green, float& p_blue, float& p_alpha)
{ {
if (p_name == NULL) { if (p_name == NULL) {
@@ -850,12 +864,14 @@ void LegoROI::SetDisplayBB(int p_displayBB)
} }
// FUNCTION: LEGO1 0x100aa340 // FUNCTION: LEGO1 0x100aa340
// FUNCTION: BETA10 0x1018cca0
float LegoROI::IntrinsicImportance() const float LegoROI::IntrinsicImportance() const
{ {
return .5; return .5;
} }
// FUNCTION: LEGO1 0x100aa350 // FUNCTION: LEGO1 0x100aa350
// FUNCTION: BETA10 0x1018ccc0
void LegoROI::UpdateWorldBoundingVolumes() void LegoROI::UpdateWorldBoundingVolumes()
{ {
CalcWorldBoundingVolumes(m_sphere, m_local2world, m_world_bounding_box, m_world_bounding_sphere); CalcWorldBoundingVolumes(m_sphere, m_local2world, m_world_bounding_box, m_world_bounding_sphere);

View File

@@ -17,6 +17,7 @@ class LegoTreeNode;
struct LegoAnimActorEntry; struct LegoAnimActorEntry;
// VTABLE: LEGO1 0x100dbe38 // VTABLE: LEGO1 0x100dbe38
// VTABLE: BETA10 0x101c3898
// SIZE 0x108 // SIZE 0x108
class LegoROI : public ViewROI { class LegoROI : public ViewROI {
public: public:
@@ -57,7 +58,7 @@ public:
void SetDisplayBB(int p_displayBB); void SetDisplayBB(int p_displayBB);
static LegoResult CreateLocalTransform(LegoAnimNodeData* p_data, LegoTime p_time, Matrix4& p_matrix); static LegoResult CreateLocalTransform(LegoAnimNodeData* p_data, LegoTime p_time, Matrix4& p_matrix);
static void FUN_100a81b0(const LegoChar* p_error, const LegoChar* p_name); static void FUN_100a81b0(const LegoChar* p_error, ...);
static void configureLegoROI(int p_roi); static void configureLegoROI(int p_roi);
static void SetColorOverride(ColorOverride p_colorOverride); static void SetColorOverride(ColorOverride p_colorOverride);
static LegoBool GetRGBAColor(const LegoChar* p_name, float& p_red, float& p_green, float& p_blue, float& p_alpha); static LegoBool GetRGBAColor(const LegoChar* p_name, float& p_red, float& p_green, float& p_blue, float& p_alpha);
@@ -86,6 +87,7 @@ public:
void SetBoundingBox(const BoundingBox& p_box) { m_bounding_box = p_box; } void SetBoundingBox(const BoundingBox& p_box) { m_bounding_box = p_box; }
// SYNTHETIC: LEGO1 0x100a82b0 // SYNTHETIC: LEGO1 0x100a82b0
// SYNTHETIC: BETA10 0x1018c490
// LegoROI::`scalar deleting destructor' // LegoROI::`scalar deleting destructor'
private: private:
@@ -96,15 +98,20 @@ private:
}; };
// VTABLE: LEGO1 0x100dbea8 // VTABLE: LEGO1 0x100dbea8
// VTABLE: BETA10 0x101c38d0
// SIZE 0x10c // SIZE 0x10c
class TimeROI : public LegoROI { class TimeROI : public LegoROI {
public: public:
TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, LegoTime p_time); TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, LegoTime p_time);
void FUN_100a9b40(Matrix4& p_matrix, LegoTime p_time);
// SYNTHETIC: LEGO1 0x100a9ad0 // SYNTHETIC: LEGO1 0x100a9ad0
// SYNTHETIC: BETA10 0x1018c540
// TimeROI::`scalar deleting destructor' // TimeROI::`scalar deleting destructor'
void FUN_100a9b40(Matrix4& p_matrix, LegoTime p_time); // SYNTHETIC: BETA10 0x1018c580
// TimeROI::~TimeROI
private: private:
LegoTime m_time; // 0x108 LegoTime m_time; // 0x108

View File

@@ -108,6 +108,7 @@ void OrientableROI::SetLocal2World(const Matrix4& p_local2world)
} }
// FUNCTION: LEGO1 0x100a5910 // FUNCTION: LEGO1 0x100a5910
// FUNCTION: BETA10 0x10167bac
void OrientableROI::UpdateWorldData() void OrientableROI::UpdateWorldData()
{ {
UpdateWorldBoundingVolumes(); UpdateWorldBoundingVolumes();
@@ -115,6 +116,7 @@ void OrientableROI::UpdateWorldData()
} }
// FUNCTION: LEGO1 0x100a5930 // FUNCTION: LEGO1 0x100a5930
// FUNCTION: BETA10 0x10167bd8
void OrientableROI::SetLocal2WorldWithWorldDataUpdate(const Matrix4& p_transform) void OrientableROI::SetLocal2WorldWithWorldDataUpdate(const Matrix4& p_transform)
{ {
m_local2world = p_transform; m_local2world = p_transform;
@@ -123,6 +125,7 @@ void OrientableROI::SetLocal2WorldWithWorldDataUpdate(const Matrix4& p_transform
} }
// FUNCTION: LEGO1 0x100a5960 // FUNCTION: LEGO1 0x100a5960
// FUNCTION: BETA10 0x10167c19
void OrientableROI::UpdateWorldDataWithTransform(const Matrix4& p_transform) void OrientableROI::UpdateWorldDataWithTransform(const Matrix4& p_transform)
{ {
MxMatrix l_matrix(m_local2world); MxMatrix l_matrix(m_local2world);
@@ -132,6 +135,7 @@ void OrientableROI::UpdateWorldDataWithTransform(const Matrix4& p_transform)
} }
// FUNCTION: LEGO1 0x100a59b0 // FUNCTION: LEGO1 0x100a59b0
// FUNCTION: BETA10 0x10167c6d
void OrientableROI::UpdateWorldDataWithTransformAndChildren(const Matrix4& p_transform) void OrientableROI::UpdateWorldDataWithTransformAndChildren(const Matrix4& p_transform)
{ {
MxMatrix l_matrix(m_local2world); MxMatrix l_matrix(m_local2world);
@@ -155,11 +159,13 @@ void OrientableROI::SetWorldVelocity(const Vector3& p_world_velocity)
} }
// FUNCTION: LEGO1 0x100a5a50 // FUNCTION: LEGO1 0x100a5a50
// FUNCTION: BETA10 0x10167d65
void OrientableROI::UpdateWorldVelocity() void OrientableROI::UpdateWorldVelocity()
{ {
} }
// FUNCTION: LEGO1 0x100a5a60 // FUNCTION: LEGO1 0x100a5a60
// FUNCTION: BETA10 0x10167d7b
void CalcWorldBoundingVolumes( void CalcWorldBoundingVolumes(
const BoundingSphere& modelling_sphere, const BoundingSphere& modelling_sphere,
const Matrix4& local2world, const Matrix4& local2world,
@@ -186,18 +192,21 @@ void CalcWorldBoundingVolumes(
} }
// FUNCTION: LEGO1 0x100a5d80 // FUNCTION: LEGO1 0x100a5d80
// FUNCTION: BETA10 0x10168760
const float* OrientableROI::GetWorldVelocity() const const float* OrientableROI::GetWorldVelocity() const
{ {
return m_world_velocity.GetData(); return m_world_velocity.GetData();
} }
// FUNCTION: LEGO1 0x100a5d90 // FUNCTION: LEGO1 0x100a5d90
// FUNCTION: BETA10 0x10168790
const BoundingBox& OrientableROI::GetWorldBoundingBox() const const BoundingBox& OrientableROI::GetWorldBoundingBox() const
{ {
return m_world_bounding_box; return m_world_bounding_box;
} }
// FUNCTION: LEGO1 0x100a5da0 // FUNCTION: LEGO1 0x100a5da0
// FUNCTION: BETA10 0x101687b0
const BoundingSphere& OrientableROI::GetWorldBoundingSphere() const const BoundingSphere& OrientableROI::GetWorldBoundingSphere() const
{ {
return m_world_bounding_sphere; return m_world_bounding_sphere;

View File

@@ -23,6 +23,7 @@ public:
const BoundingSphere& GetWorldBoundingSphere() const override; // vtable+0x10 const BoundingSphere& GetWorldBoundingSphere() const override; // vtable+0x10
// FUNCTION: LEGO1 0x100a5db0 // FUNCTION: LEGO1 0x100a5db0
// FUNCTION: BETA10 0x101687d0
virtual void WrappedUpdateWorldData() { UpdateWorldData(); } // vtable+0x14 virtual void WrappedUpdateWorldData() { UpdateWorldData(); } // vtable+0x14
virtual void UpdateWorldBoundingVolumes() = 0; // vtable+0x18 virtual void UpdateWorldBoundingVolumes() = 0; // vtable+0x18
@@ -81,6 +82,7 @@ protected:
// OrientableROI::`scalar deleting destructor' // OrientableROI::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x100aa2f0 // SYNTHETIC: LEGO1 0x100aa2f0
// SYNTHETIC: BETA10 0x10168600
// OrientableROI::~OrientableROI // OrientableROI::~OrientableROI
#endif // ORIENTABLEROI_H #endif // ORIENTABLEROI_H

View File

@@ -15,9 +15,16 @@
// SIZE 0x28 // SIZE 0x28
class BoundingBox { class BoundingBox {
public: public:
// The BETA10 matches may reference the wrong version
// FUNCTION: BETA10 0x1004a7a0
const Vector3& Min() const { return min; } const Vector3& Min() const { return min; }
Vector3& Min() { return min; } Vector3& Min() { return min; }
// FUNCTION: BETA10 0x1004a7c0
const Vector3& Max() const { return max; } const Vector3& Max() const { return max; }
Vector3& Max() { return max; } Vector3& Max() { return max; }
private: private:
@@ -31,14 +38,26 @@ private:
// SIZE 0x18 // SIZE 0x18
class BoundingSphere { class BoundingSphere {
public: public:
// The BETA10 matches may reference the wrong version
// FUNCTION: BETA10 0x1001fac0
const Vector3& Center() const { return center; } const Vector3& Center() const { return center; }
// FUNCTION: BETA10 0x100d55a0
Vector3& Center() { return center; } Vector3& Center() { return center; }
// FUNCTION: BETA10 0x1001fd30
const float& Radius() const { return radius; } const float& Radius() const { return radius; }
// FUNCTION: BETA10 0x1001fae0
float& Radius() { return radius; } float& Radius() { return radius; }
// SYNTHETIC: BETA10 0x1001fb90 // SYNTHETIC: BETA10 0x1001fb90
// BoundingSphere::operator= // BoundingSphere::operator=
// SYNTHETIC: BETA10 0x1001fc50
// BoundingSphere::BoundingSphere
private: private:
Mx3DPointFloat center; // 0x00 Mx3DPointFloat center; // 0x00
float radius; // 0x14 float radius; // 0x14
@@ -136,6 +155,7 @@ protected:
// list<ROI *,allocator<ROI *> >::~list<ROI *,allocator<ROI *> > // list<ROI *,allocator<ROI *> >::~list<ROI *,allocator<ROI *> >
// SYNTHETIC: LEGO1 0x100a5d50 // SYNTHETIC: LEGO1 0x100a5d50
// SYNTHETIC: BETA10 0x101686a0
// ROI::~ROI // ROI::~ROI
#endif // ROI_H #endif // ROI_H

View File

@@ -16,65 +16,60 @@ float ViewROI::IntrinsicImportance() const
} // for now } // for now
// FUNCTION: LEGO1 0x100a9ec0 // FUNCTION: LEGO1 0x100a9ec0
// FUNCTION: BETA10 0x1018c740
Tgl::Group* ViewROI::GetGeometry() Tgl::Group* ViewROI::GetGeometry()
{ {
return geometry; return geometry;
} }
// FUNCTION: LEGO1 0x100a9ed0 // FUNCTION: LEGO1 0x100a9ed0
// FUNCTION: BETA10 0x1018c760
const Tgl::Group* ViewROI::GetGeometry() const const Tgl::Group* ViewROI::GetGeometry() const
{ {
return geometry; return geometry;
} }
// FUNCTION: LEGO1 0x100a9ee0 // FUNCTION: LEGO1 0x100a9ee0
// FUNCTION: BETA10 0x1018c780
void ViewROI::UpdateWorldDataWithTransformAndChildren(const Matrix4& parent2world) void ViewROI::UpdateWorldDataWithTransformAndChildren(const Matrix4& parent2world)
{ {
OrientableROI::UpdateWorldDataWithTransformAndChildren(parent2world); OrientableROI::UpdateWorldDataWithTransformAndChildren(parent2world);
SetGeometryTransformation();
}
// FUNCTION: BETA10 0x1018c7b0
inline void ViewROI::SetGeometryTransformation()
{
if (geometry) { if (geometry) {
Tgl::FloatMatrix4 matrix; Tgl::FloatMatrix4 matrix;
Matrix4 in(matrix); Matrix4 in(matrix);
SETMAT4(in, m_local2world); SETMAT4(in, m_local2world);
Tgl::Result result = geometry->SetTransformation(matrix); geometry->SetTransformation(matrix);
// assert(Tgl::Succeeded(result));
} }
} }
// FUNCTION: LEGO1 0x100a9fc0 // FUNCTION: LEGO1 0x100a9fc0
// FUNCTION: BETA10 0x1018cad0
void ViewROI::UpdateWorldDataWithTransform(const Matrix4& p_transform) void ViewROI::UpdateWorldDataWithTransform(const Matrix4& p_transform)
{ {
OrientableROI::UpdateWorldDataWithTransform(p_transform); OrientableROI::UpdateWorldDataWithTransform(p_transform);
if (geometry) { SetGeometryTransformation();
Tgl::FloatMatrix4 matrix;
Matrix4 in(matrix);
SETMAT4(in, m_local2world);
geometry->SetTransformation(matrix);
}
} }
// FUNCTION: LEGO1 0x100aa0a0 // FUNCTION: LEGO1 0x100aa0a0
// FUNCTION: BETA10 0x1018cb00
void ViewROI::SetLocal2WorldWithWorldDataUpdate(const Matrix4& p_transform) void ViewROI::SetLocal2WorldWithWorldDataUpdate(const Matrix4& p_transform)
{ {
OrientableROI::SetLocal2WorldWithWorldDataUpdate(p_transform); OrientableROI::SetLocal2WorldWithWorldDataUpdate(p_transform);
if (geometry) { SetGeometryTransformation();
Tgl::FloatMatrix4 matrix;
Matrix4 in(matrix);
SETMAT4(in, m_local2world);
geometry->SetTransformation(matrix);
}
} }
// FUNCTION: LEGO1 0x100aa180 // FUNCTION: LEGO1 0x100aa180
// FUNCTION: BETA10 0x1018cb30
void ViewROI::UpdateWorldData() void ViewROI::UpdateWorldData()
{ {
OrientableROI::UpdateWorldData(); OrientableROI::UpdateWorldData();
if (geometry) { SetGeometryTransformation();
Tgl::FloatMatrix4 matrix;
Matrix4 in(matrix);
SETMAT4(in, m_local2world);
geometry->SetTransformation(matrix);
}
} }
// FUNCTION: LEGO1 0x100aa500 // FUNCTION: LEGO1 0x100aa500

View File

@@ -13,6 +13,7 @@
*/ */
// VTABLE: LEGO1 0x100dbe70 // VTABLE: LEGO1 0x100dbe70
// VTABLE: BETA10 0x101c3908
// SIZE 0xe4 // SIZE 0xe4
class ViewROI : public OrientableROI { class ViewROI : public OrientableROI {
public: public:
@@ -21,6 +22,7 @@ public:
c_lodLevelInvisible = -2, c_lodLevelInvisible = -2,
}; };
// FUNCTION: BETA10 0x1018c5e0
ViewROI(Tgl::Renderer* pRenderer, ViewLODList* lodList) ViewROI(Tgl::Renderer* pRenderer, ViewLODList* lodList)
{ {
SetLODList(lodList); SetLODList(lodList);
@@ -29,6 +31,7 @@ public:
} }
// FUNCTION: LEGO1 0x100a9e20 // FUNCTION: LEGO1 0x100a9e20
// FUNCTION: BETA10 0x1018c680
~ViewROI() override ~ViewROI() override
{ {
// SetLODList() will decrease refCount of LODList // SetLODList() will decrease refCount of LODList
@@ -36,6 +39,7 @@ public:
delete geometry; delete geometry;
} }
// FUNCTION: BETA10 0x1007b540
void SetLODList(ViewLODList* lodList) void SetLODList(ViewLODList* lodList)
{ {
// ??? inherently type unsafe - kind of... because, now, ROI // ??? inherently type unsafe - kind of... because, now, ROI
@@ -69,6 +73,8 @@ public:
protected: protected:
void UpdateWorldDataWithTransformAndChildren(const Matrix4& parent2world) override; // vtable+0x28 void UpdateWorldDataWithTransformAndChildren(const Matrix4& parent2world) override; // vtable+0x28
void SetGeometryTransformation();
Tgl::Group* geometry; // 0xdc Tgl::Group* geometry; // 0xdc
int m_lodLevel; // 0xe0 int m_lodLevel; // 0xe0
}; };