isle/LEGO1/lego/sources/shape/legomesh.h
jonschz af2418e61f
Some checks failed
Analyze / ${{ matrix.who }} annotations (CONFIG) (push) Has been cancelled
Analyze / ${{ matrix.who }} annotations (ISLE) (push) Has been cancelled
Analyze / ${{ matrix.who }} annotations (LEGO1) (push) Has been cancelled
Build / Download original binaries (push) Has been cancelled
Build / Current ${{ matrix.toolchain.name }} (map[clang-tidy:true msys-env:mingw-w64-i686 msystem:mingw32 name:msys2 mingw32 shell:msys2 {0} werror:true]) (push) Has been cancelled
Build / Current ${{ matrix.toolchain.name }} (map[name:MSVC setup-cmake:true setup-msvc:true setup-ninja:true shell:sh]) (push) Has been cancelled
Build / MSVC 4.20 (push) Has been cancelled
Build / MSVC 4.20 (BETA10) (push) Has been cancelled
Format / C++ (push) Has been cancelled
Naming / C++ (push) Has been cancelled
Build / Verify decomp (push) Has been cancelled
Build / Upload artifacts (push) Has been cancelled
Beta match LegoLOD and related classes (#1704)
* beta match LegoLOD, part 1

* Fix name collision for Ghidra

* More LegoLOD matches

* LegoMesh and LegoColor matches

* Various matches

* 73 % beta match on LegoLOD::Read

* Fix LEGO1 regressions, improve match

* 70.93 % on LEGO1

* 72.85 %, stack too small now

* Cleanup

* Cleanup

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2026-01-05 23:45:36 +01:00

102 lines
2.2 KiB
C++

#ifndef __LEGOMESH_H
#define __LEGOMESH_H
#include "decomp.h"
#include "legocolor.h"
#include "misc/legotypes.h"
class LegoStorage;
// SIZE 0x1c
struct LegoMeshUnkComponent {
// FUNCTION: BETA10 0x101905b0
~LegoMeshUnkComponent()
{
if (m_unk0x08) {
delete m_unk0x08;
}
if (m_unk0x0c) {
delete m_unk0x0c;
}
if (m_unk0x10) {
delete m_unk0x10;
}
if (m_unk0x14) {
delete m_unk0x14;
}
if (m_unk0x18) {
delete m_unk0x18;
}
}
undefined m_unk0x00[8]; // 0x00
undefined* m_unk0x08; // 0x08
undefined* m_unk0x0c; // 0x0c
undefined* m_unk0x10; // 0x10
undefined* m_unk0x14; // 0x14
undefined* m_unk0x18; // 0x18
};
// SYNTHETIC: BETA10 0x10190530
// LegoMeshUnkComponent::`scalar deleting destructor'
// VTABLE: LEGO1 0x100dd228
// VTABLE: BETA10 0x101c39c4
// SIZE 0x24
class LegoMesh {
public:
enum {
e_flat,
e_gouraud,
e_wireframe
};
LegoMesh();
virtual ~LegoMesh();
// FUNCTION: BETA10 0x1018e6f0
LegoColor GetColor() { return m_color; }
void SetColor(LegoColor p_color) { m_color = p_color; }
// FUNCTION: BETA10 0x1018e720
LegoFloat GetAlpha() { return m_alpha; }
// FUNCTION: BETA10 0x1018e740
LegoU8 GetShading() { return m_shading; }
void SetShading(LegoU8 p_shading) { m_shading = p_shading; }
// FUNCTION: BETA10 0x1018e760
LegoU8 GetUnknown0x0d() { return m_unk0x0d; }
// FUNCTION: BETA10 0x1018e780
const LegoChar* GetTextureName() { return m_textureName; }
// FUNCTION: BETA10 0x1018e7a0
const LegoChar* GetMaterialName() { return m_materialName; }
// FUNCTION: BETA10 0x1018e7c0
LegoBool GetUseAlias() { return m_useAlias; }
LegoResult Read(LegoStorage* p_storage);
// SYNTHETIC: LEGO1 0x100d3840
// SYNTHETIC: BETA10 0x101904f0
// LegoMesh::`scalar deleting destructor'
protected:
LegoColor m_color; // 0x04
LegoFloat m_alpha; // 0x08
LegoU8 m_shading; // 0x0c
LegoU8 m_unk0x0d; // 0x0d
LegoMeshUnkComponent* m_unk0x10; // 0x10 - unused, except in destructor
undefined4 m_unk0x14; // 0x14 - unused
LegoChar* m_textureName; // 0x18
LegoChar* m_materialName; // 0x1c
undefined m_unk0x20; // 0x20 - unused
LegoBool m_useAlias; // 0x21
};
#endif // __LEGOMESH_H