Rename Something -> Unk

This commit is contained in:
Mark Langen 2023-11-29 22:45:53 -08:00
parent 83de02d08d
commit 87a20e1557
6 changed files with 40 additions and 39 deletions

View File

@ -216,7 +216,7 @@ add_library(lego1 SHARED
LEGO1/tgl/d3drm/light.cpp LEGO1/tgl/d3drm/light.cpp
LEGO1/tgl/d3drm/mesh.cpp LEGO1/tgl/d3drm/mesh.cpp
LEGO1/tgl/d3drm/renderer.cpp LEGO1/tgl/d3drm/renderer.cpp
LEGO1/tgl/d3drm/something.cpp LEGO1/tgl/d3drm/unk.cpp
LEGO1/tgl/d3drm/texture.cpp LEGO1/tgl/d3drm/texture.cpp
LEGO1/tgl/d3drm/view.cpp LEGO1/tgl/d3drm/view.cpp
LEGO1/towtrack.cpp LEGO1/towtrack.cpp

View File

@ -33,6 +33,7 @@ class CameraImpl;
class GroupImpl; class GroupImpl;
class MeshImpl; class MeshImpl;
class TextureImpl; class TextureImpl;
class UnkImpl;
// VTABLE 0x100db910 // VTABLE 0x100db910
class RendererImpl : public Renderer { class RendererImpl : public Renderer {
@ -60,7 +61,7 @@ class RendererImpl : public Renderer {
virtual Group* CreateGroup(const Group* p_parent); virtual Group* CreateGroup(const Group* p_parent);
// vtable+0x20 // vtable+0x20
virtual Something* CreateSomething(); virtual Unk* CreateUnk();
virtual Texture* CreateTexture(); virtual Texture* CreateTexture();
virtual Texture* CreateTexture( virtual Texture* CreateTexture(
int p_width, int p_width,
@ -216,10 +217,10 @@ class MeshImpl : public Mesh {
virtual Result GetTexture(Texture*&); virtual Result GetTexture(Texture*&);
virtual Result SetTextureMappingMode(ProjectionType); virtual Result SetTextureMappingMode(ProjectionType);
virtual Result SetShadingModel(ShadingModel); virtual Result SetShadingModel(ShadingModel);
virtual Mesh* DeepClone(Something*); virtual Mesh* DeepClone(Unk*);
// vtable+0x20 // vtable+0x20
virtual Mesh* ShallowClone(Something*); virtual Mesh* ShallowClone(Unk*);
struct MeshData { struct MeshData {
IDirect3DRMMesh* groupMesh; IDirect3DRMMesh* groupMesh;
@ -268,10 +269,10 @@ class GroupImpl : public Group {
}; };
// VTABLE 0x100dbb18 // VTABLE 0x100dbb18
class SomethingImpl : public Something { class UnkImpl : public Unk {
public: public:
SomethingImpl() : m_data(0) {} UnkImpl() : m_data(0) {}
~SomethingImpl(); ~UnkImpl();
virtual void* ImplementationDataPtr(); virtual void* ImplementationDataPtr();
@ -288,7 +289,7 @@ class SomethingImpl : public Something {
virtual Result GetBoundingBox(float p_min[3], float p_max[3]); virtual Result GetBoundingBox(float p_min[3], float p_max[3]);
// vtable+0x10 // vtable+0x10
virtual Something* Clone(); virtual Unk* Clone();
inline IDirect3DRMMesh* ImplementationData() const { return m_data; } inline IDirect3DRMMesh* ImplementationData() const { return m_data; }

View File

@ -82,12 +82,12 @@ Result MeshImpl::SetShadingModel(ShadingModel p_model)
} }
// OFFSET: LEGO1 0x100a4030 // OFFSET: LEGO1 0x100a4030
Mesh* MeshImpl::DeepClone(Something* p_mesh) Mesh* MeshImpl::DeepClone(Unk* p_mesh)
{ {
// Create group // Create group
MeshImpl* newSomething = new MeshImpl(); MeshImpl* newMesh = new MeshImpl();
MeshData* data = new MeshData(); MeshData* data = new MeshData();
newSomething->m_data = data; newMesh->m_data = data;
// Query information from old group // Query information from old group
DWORD dataSize; DWORD dataSize;
@ -105,10 +105,10 @@ Mesh* MeshImpl::DeepClone(Something* p_mesh)
D3DCOLOR color = m_data->groupMesh->GetGroupColor(m_data->groupIndex); D3DCOLOR color = m_data->groupMesh->GetGroupColor(m_data->groupIndex);
// Push information to new group // Push information to new group
SomethingImpl* target = static_cast<SomethingImpl*>(p_mesh); UnkImpl* target = static_cast<UnkImpl*>(p_mesh);
D3DRMGROUPINDEX index; D3DRMGROUPINDEX index;
target->ImplementationData()->AddGroup(vcount, fcount, vperface, faceBuffer, &index); target->ImplementationData()->AddGroup(vcount, fcount, vperface, faceBuffer, &index);
newSomething->m_data->groupIndex = index; newMesh->m_data->groupIndex = index;
target->ImplementationData()->SetVertices(index, 0, vcount, vertexBuffer); target->ImplementationData()->SetVertices(index, 0, vcount, vertexBuffer);
target->ImplementationData()->SetGroupTexture(index, textureRef); target->ImplementationData()->SetGroupTexture(index, textureRef);
target->ImplementationData()->SetGroupMapping(index, mapping); target->ImplementationData()->SetGroupMapping(index, mapping);
@ -119,22 +119,22 @@ Mesh* MeshImpl::DeepClone(Something* p_mesh)
delete[] faceBuffer; delete[] faceBuffer;
delete[] vertexBuffer; delete[] vertexBuffer;
if (result == Error) { if (result == Error) {
delete newSomething; delete newMesh;
newSomething = NULL; newMesh = NULL;
} }
return newSomething; return newMesh;
} }
// OFFSET: LEGO1 0x100a4240 // OFFSET: LEGO1 0x100a4240
Mesh* MeshImpl::ShallowClone(Something* p_mesh) Mesh* MeshImpl::ShallowClone(Unk* p_mesh)
{ {
MeshImpl* newGroup = new MeshImpl(); MeshImpl* newGroup = new MeshImpl();
MeshData* newData = new MeshData(); MeshData* newData = new MeshData();
newGroup->m_data = newData; newGroup->m_data = newData;
if (newData) { if (newData) {
newData->groupIndex = m_data->groupIndex; newData->groupIndex = m_data->groupIndex;
newData->groupMesh = static_cast<SomethingImpl*>(p_mesh)->ImplementationData(); newData->groupMesh = static_cast<UnkImpl*>(p_mesh)->ImplementationData();
} }
else { else {
delete newGroup; delete newGroup;

View File

@ -216,20 +216,20 @@ Light* RendererImpl::CreateLight(LightType p_type, float p_r, float p_g, float p
} }
// OFFSET: LEGO1 0x100a1e90 // OFFSET: LEGO1 0x100a1e90
Something* RendererImpl::CreateSomething() Unk* RendererImpl::CreateUnk()
{ {
// Note: I'm fairly certain that Something is not what Tgl calls a // Note: I'm fairly certain that Unknown is not what Tgl calls a
// "Mesh", because the methods on Mesh in the Tgl leak line up much // "Mesh", because the methods on Mesh in the Tgl leak line up much
// more closely with a different vtable than the one assigned in // more closely with a different vtable than the one assigned in
// this method (meaning this method is not creating a Mesh). // this method (meaning this method is not creating a Mesh).
// Maybe this method is something like CreateMeshBuilder where the // Maybe this method is something like CreateMeshBuilder where the
// Mesh data type in the Tgl leak was split into builder/result? // Mesh data type in the Tgl leak was split into builder/result?
SomethingImpl* something = new SomethingImpl(); UnkImpl* unknown = new UnkImpl();
if (FAILED(m_data->CreateMesh(&something->m_data))) { if (FAILED(m_data->CreateMesh(&unknown->m_data))) {
delete something; delete unknown;
something = NULL; unknown = NULL;
} }
return something; return unknown;
} }
inline Result RendererCreateTexture( inline Result RendererCreateTexture(

View File

@ -2,11 +2,11 @@
using namespace TglImpl; using namespace TglImpl;
DECOMP_SIZE_ASSERT(Something, 0x4); DECOMP_SIZE_ASSERT(Unk, 0x4);
DECOMP_SIZE_ASSERT(SomethingImpl, 0x8); DECOMP_SIZE_ASSERT(UnkImpl, 0x8);
// Inlined only // Inlined only
SomethingImpl::~SomethingImpl() UnkImpl::~UnkImpl()
{ {
if (m_data) { if (m_data) {
m_data->Release(); m_data->Release();
@ -15,13 +15,13 @@ SomethingImpl::~SomethingImpl()
} }
// OFFSET: LEGO1 0x100a3830 // OFFSET: LEGO1 0x100a3830
void* SomethingImpl::ImplementationDataPtr() void* UnkImpl::ImplementationDataPtr()
{ {
return reinterpret_cast<void*>(&m_data); return reinterpret_cast<void*>(&m_data);
} }
// OFFSET: LEGO1 0x100a3840 STUB // OFFSET: LEGO1 0x100a3840 STUB
Result SomethingImpl::SetMeshData( Result UnkImpl::SetMeshData(
unsigned long p_faceCount, unsigned long p_faceCount,
unsigned long p_vertexCount, unsigned long p_vertexCount,
const float (*p_positions)[3], const float (*p_positions)[3],
@ -35,7 +35,7 @@ Result SomethingImpl::SetMeshData(
} }
// OFFSET: LEGO1 0x100a3ae0 // OFFSET: LEGO1 0x100a3ae0
Result SomethingImpl::GetBoundingBox(float p_min[3], float p_max[3]) Result UnkImpl::GetBoundingBox(float p_min[3], float p_max[3])
{ {
D3DRMBOX box; D3DRMBOX box;
Result result = ResultVal(m_data->GetBox(&box)); Result result = ResultVal(m_data->GetBox(&box));
@ -51,9 +51,9 @@ Result SomethingImpl::GetBoundingBox(float p_min[3], float p_max[3])
} }
// OFFSET: LEGO1 0x100a3b40 // OFFSET: LEGO1 0x100a3b40
Something* SomethingImpl::Clone() Unk* UnkImpl::Clone()
{ {
SomethingImpl* mesh = new SomethingImpl(); UnkImpl* mesh = new UnkImpl();
int ret = m_data->Clone(0, IID_IDirect3DRMMeshBuilder, (void**) &mesh->m_data); int ret = m_data->Clone(0, IID_IDirect3DRMMeshBuilder, (void**) &mesh->m_data);
if (ret < 0) { if (ret < 0) {
delete mesh; delete mesh;

View File

@ -96,7 +96,7 @@ class Camera;
class Group; class Group;
class Mesh; class Mesh;
class Texture; class Texture;
class Something; class Unk;
// VTABLE 0x100db980 // VTABLE 0x100db980
class Object { class Object {
@ -127,7 +127,7 @@ class Renderer : public Object {
virtual Group* CreateGroup(const Group* p_parent = 0) = 0; virtual Group* CreateGroup(const Group* p_parent = 0) = 0;
// vtable+0x20 // vtable+0x20
virtual Something* CreateSomething() = 0; virtual Unk* CreateUnk() = 0;
virtual Texture* CreateTexture() = 0; virtual Texture* CreateTexture() = 0;
virtual Texture* CreateTexture( virtual Texture* CreateTexture(
int p_width, int p_width,
@ -243,10 +243,10 @@ class Mesh : public Object {
virtual Result SetShadingModel(ShadingModel) = 0; virtual Result SetShadingModel(ShadingModel) = 0;
// Clone data in underlying group // Clone data in underlying group
virtual Mesh* DeepClone(Something*) = 0; virtual Mesh* DeepClone(Unk*) = 0;
// Just get another Group pointing to the same underlying data // Just get another Group pointing to the same underlying data
virtual Mesh* ShallowClone(Something*) = 0; virtual Mesh* ShallowClone(Unk*) = 0;
}; };
// VTABLE 0x100dbaa0 // VTABLE 0x100dbaa0
@ -272,7 +272,7 @@ class Group : public Object {
// was not in the leaked Tgl code. My suspicion is that it's // was not in the leaked Tgl code. My suspicion is that it's
// some kind of builder class for creating meshes. // some kind of builder class for creating meshes.
// VTABLE 0x100dbb30 // VTABLE 0x100dbb30
class Something : public Object { class Unk : public Object {
public: public:
virtual Result SetMeshData( virtual Result SetMeshData(
unsigned long p_faceCount, unsigned long p_faceCount,
@ -284,7 +284,7 @@ class Something : public Object {
unsigned long* p_faceData unsigned long* p_faceData
) = 0; ) = 0;
virtual Result GetBoundingBox(float p_min[3], float p_max[3]) = 0; virtual Result GetBoundingBox(float p_min[3], float p_max[3]) = 0;
virtual Something* Clone() = 0; virtual Unk* Clone() = 0;
}; };
// VTABLE 0x100dbb68 // VTABLE 0x100dbb68