Skip to content

Commit 36dab7f

Browse files
authored
Implement/match ImaginaryTool0x368::VTable0x88 (isledecomp#204)
1 parent 619a283 commit 36dab7f

11 files changed

Lines changed: 273 additions & 73 deletions

LEGORacers/include/ceruleanemperor0x4c.h

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "types.h"
88

99
class BronzeFalcon0xc8770;
10+
class PorcelainVeil0x50;
1011

1112
// VTABLE: LEGORACERS 0x004b27cc
1213
// SIZE 0x50
@@ -15,7 +16,7 @@ class CeruleanEmperor0x4c : public CeruleanKnight0x20 {
1516
// SIZE 0x10
1617
struct ResourceLoadParams {
1718
BronzeFalcon0xc8770* m_renderer; // 0x00
18-
undefined4 m_unk0x04; // 0x04
19+
PorcelainVeil0x50* m_unk0x04; // 0x04
1920
const LegoChar* m_fileName; // 0x08
2021
undefined4 m_binary; // 0x0c
2122
};
@@ -32,6 +33,7 @@ class CeruleanEmperor0x4c : public CeruleanKnight0x20 {
3233
// CeruleanEmperor0x4c::`scalar deleting destructor'
3334

3435
private:
36+
void FUN_0046fd30(ResourceLoadParams* p_params);
3537
void FUN_004707e0();
3638
void FUN_00470880();
3739
void FUN_00470920();
@@ -44,17 +46,17 @@ class CeruleanEmperor0x4c : public CeruleanKnight0x20 {
4446
void FUN_00470dc0();
4547

4648
protected:
47-
undefined4 m_unk0x20; // 0x20
48-
undefined* m_unk0x24; // 0x24
49-
undefined* m_unk0x28; // 0x28
50-
undefined* m_unk0x2c; // 0x2c
51-
undefined* m_unk0x30; // 0x30
52-
undefined* m_unk0x34; // 0x34
53-
undefined* m_unk0x38; // 0x38
54-
undefined* m_unk0x3c; // 0x3c
55-
undefined* m_unk0x40; // 0x40
56-
undefined* m_unk0x44; // 0x44
57-
undefined* m_unk0x48; // 0x48
49+
PorcelainVeil0x50* m_unk0x20; // 0x20
50+
undefined* m_unk0x24; // 0x24
51+
undefined* m_unk0x28; // 0x28
52+
undefined* m_unk0x2c; // 0x2c
53+
undefined* m_unk0x30; // 0x30
54+
undefined* m_unk0x34; // 0x34
55+
undefined* m_unk0x38; // 0x38
56+
undefined* m_unk0x3c; // 0x3c
57+
undefined* m_unk0x40; // 0x40
58+
undefined* m_unk0x44; // 0x44
59+
undefined* m_unk0x48; // 0x48
5860
};
5961

6062
#endif // CERULEANEMPEROR0X4C_H

LEGORacers/include/ceruleanknight0x20.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include "golnametable.h"
88
#include "types.h"
99

10+
class BronzeFalcon0xc8770;
11+
1012
// VTABLE: LEGORACERS 0x004b2210
1113
// SIZE 0x20
1214
class CeruleanKnight0x20 : public GolNameTable {
@@ -22,17 +24,18 @@ class CeruleanKnight0x20 : public GolNameTable {
2224
// CeruleanKnight0x20::`scalar deleting destructor'
2325

2426
protected:
27+
LegoBool32 FUN_0046b100();
2528
LegoS32 FUN_0046b130();
2629
LegoS32 FUN_0046b170();
2730
void FUN_0046b1d0(LegoS32* p_ints);
2831
void FUN_0046b210(LegoS8* p_ints);
2932
void FUN_0046b250();
3033

31-
undefined m_unk0x0c; // 0x0c
32-
GolFileParser* m_unk0x10; // 0x10
33-
undefined4 m_unk0x14; // 0x10
34-
undefined4 m_unk0x18; // 0x10
35-
undefined4 m_unk0x1c; // 0x10
34+
LegoBool m_unk0x0c; // 0x0c
35+
GolFileParser* m_unk0x10; // 0x10
36+
BronzeFalcon0xc8770* m_unk0x14; // 0x14
37+
undefined4 m_unk0x18; // 0x18
38+
undefined4 m_unk0x1c; // 0x1c
3639
};
3740

3841
#endif // CERULEANKNIGHT0X20_H

LEGORacers/include/ceruleanqueen0x58.h

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,53 @@
44
#include "ceruleanknight0x20.h"
55
#include "compat.h"
66
#include "decomp.h"
7+
#include "goltxtparser.h"
78
#include "types.h"
89

10+
class BronzeFalcon0xc8770;
11+
912
// VTABLE: LEGORACERS 0x004b2180
10-
// SIZE 0x58
13+
// SIZE 0x5c
1114
class CeruleanQueen0x58 : public CeruleanKnight0x20 {
1215
public:
16+
// VTABLE: LEGORACERS 0x004b2198
17+
// SIZE 0x1fc
18+
class MidTxtParser : public GolTxtParser {
19+
// SYNTHETIC: LEGORACERS 0x0041e920 FOLDED
20+
// CeruleanQueen0x58::MidTxtParser::`scalar deleting destructor'
21+
22+
// SYNTHETIC: LEGORACERS 0x00498840 FOLDED
23+
// CeruleanQueen0x58::MidTxtParser::~MidTxtParser
24+
};
25+
26+
// SIZE 0x74
27+
class Struct0x74 {
28+
public:
29+
undefined m_unk0x00[0x3c - 0x00]; // 0x00
30+
undefined* m_unk0x3c; // 0x3c
31+
undefined m_unk0x40[0x74 - 0x40]; // 0x40
32+
};
33+
34+
// SIZE 0x0c
35+
struct ResourceLoadParams {
36+
BronzeFalcon0xc8770* m_renderer; // 0x00
37+
const LegoChar* m_fileName; // 0x04
38+
undefined4 m_binary; // 0x08
39+
};
40+
1341
CeruleanQueen0x58();
1442
~CeruleanQueen0x58() override; // vtable+0x00
1543
void Clear() override; // vtable+0x08
1644
void VTable0x0c() override; // vtable+0x0c
1745
void VTable0x10(undefined4) override; // vtable+0x10
1846
void VTable0x14(undefined4) override; // vtable+0x14
47+
LegoBool32 Load(ResourceLoadParams* p_params);
1948

2049
// SYNTHETIC: LEGORACERS 0x00469600
2150
// CeruleanQueen0x58::`scalar deleting destructor'
2251

2352
private:
53+
void FUN_00469900(ResourceLoadParams* p_params);
2454
void FUN_0046a750();
2555
void FUN_0046a800();
2656
void FUN_0046a8a0();
@@ -36,20 +66,22 @@ class CeruleanQueen0x58 : public CeruleanKnight0x20 {
3666
void FUN_0046aea0();
3767

3868
protected:
39-
undefined4 m_unk0x20; // 0x20
40-
undefined4 m_unk0x24; // 0x24
41-
undefined4 m_unk0x28; // 0x28
42-
undefined4 m_unk0x2c; // 0x2c
43-
undefined4 m_unk0x30; // 0x30
44-
undefined4 m_unk0x34; // 0x34
45-
undefined4 m_unk0x38; // 0x38
46-
undefined4 m_unk0x3c; // 0x3c
47-
undefined4 m_unk0x40; // 0x40
48-
undefined4 m_unk0x44; // 0x44
49-
undefined4 m_unk0x48; // 0x48
50-
undefined4 m_unk0x4c; // 0x4c
51-
undefined4 m_unk0x50; // 0x50
52-
undefined2 m_unk0x54; // 0x54
69+
undefined* m_unk0x20; // 0x20
70+
undefined* m_unk0x24; // 0x24
71+
undefined* m_unk0x28; // 0x28
72+
undefined* m_unk0x2c; // 0x2c
73+
undefined* m_unk0x30; // 0x30
74+
undefined* m_unk0x34; // 0x34
75+
undefined* m_unk0x38; // 0x38
76+
undefined* m_unk0x3c; // 0x3c
77+
Struct0x74* m_unk0x40; // 0x40
78+
undefined* m_unk0x44; // 0x44
79+
undefined* m_unk0x48; // 0x48
80+
undefined* m_unk0x4c; // 0x4c
81+
undefined* m_unk0x50; // 0x50
82+
undefined2 m_unk0x54; // 0x54
83+
undefined m_unk0x56[2]; // 0x56
84+
LegoS32 m_unk0x58; // 0x58
5385
};
5486

5587
#endif // CERULEANQUEEN0X58_H

LEGORacers/include/imaginarynotion0x290.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ class ImaginaryNotion0x290 : public ImaginaryInterface {
7070
virtual undefined4 VTable0x50(); // vtable+0x50
7171
virtual void VTable0x54(); // vtable+0x54
7272
virtual LegoBool32 VTable0x58(MenuToolCreateParams0x30*); // vtable+0x58
73-
virtual void VTable0x5c(); // vtable+0x5c
73+
virtual CeruleanEmperor0x4c* VTable0x5c(); // vtable+0x5c
7474
virtual void VTable0x60(); // vtable+0x60
75-
virtual void VTable0x64(); // vtable+0x64
75+
virtual CeruleanQueen0x58* VTable0x64(); // vtable+0x64
7676
virtual ~ImaginaryNotion0x290(); // vtable+0x68
7777
virtual void VTable0x6c(); // vtable+0x6c
7878
virtual LegoBool32 VTable0x70(MenuToolCreateParams0x30*); // vtable+0x70
@@ -114,7 +114,6 @@ class ImaginaryNotion0x290 : public ImaginaryInterface {
114114
CeruleanEmperor0x4c m_unk0x08; // 0x008
115115
PorcelainVeil0x50* m_unk0x54; // 0x054
116116
CeruleanQueen0x58 m_unk0x58; // 0x058
117-
undefined4 m_unk0xb0; // 0x0b0
118117
GolExport* m_unk0xb4; // 0x0b4
119118
BronzeFalcon0xc8770* m_unk0xb8; // 0x0b8
120119
AwakeKite0x20* m_unk0xbc; // 0x0bc

LEGORacers/include/imaginarytool0x368.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class ImaginaryTool0x368 : public ImaginaryNotion0x290 {
3131
void VTable0x3c(undefined4) override; // vtable+0x3c
3232
void VTable0x40(undefined4) override; // vtable+0x40
3333
void VTable0x54() override; // vtable+0x54
34-
void VTable0x5c() override; // vtable+0x5c
35-
void VTable0x64() override; // vtable+0x64
34+
CeruleanEmperor0x4c* VTable0x5c() override; // vtable+0x5c
35+
CeruleanQueen0x58* VTable0x64() override; // vtable+0x64
3636
~ImaginaryTool0x368() override; // vtable+0x68
3737
void VTable0x6c() override; // vtable+0x6c
3838
void VTable0x74() override; // vtable+0x74
@@ -51,7 +51,10 @@ class ImaginaryTool0x368 : public ImaginaryNotion0x290 {
5151
// ImaginaryTool0x368::`scalar deleting destructor'
5252

5353
protected:
54-
undefined m_unk0x290[0x354 - 0x290]; // 0x290
54+
CeruleanEmperor0x4c m_unk0x290; // 0x290
55+
undefined4 m_unk0x2dc; // 0x2dc
56+
CeruleanQueen0x58 m_unk0x2e0; // 0x2e0
57+
undefined m_unk0x33c[0x354 - 0x33c]; // 0x33c
5558
MenuToolContext0x4bc8* m_unk0x354; // 0x354
5659
undefined4 m_unk0x358; // 0x358
5760
ObscureVantage0x58* m_unk0x35c; // 0x35c

LEGORacers/include/obscurevantage0x58.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class ObscureVantage0x58 {
4444
ObscureVantage0x58* FUN_00472e60();
4545
SilverDune0x30::Rect* FUN_00472e90();
4646
void FUN_004731b0(undefined4&, undefined4&);
47+
LegoBool GetUnk0x54() const { return m_unk0x54; }
4748

4849
// SYNTHETIC: LEGORACERS 0x004729d0
4950
// ObscureVantage0x58::`scalar deleting destructor'

LEGORacers/src/ceruleanemperor0x4c.cpp

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,18 @@ void CeruleanEmperor0x4c::VTable0x0c()
3737
CeruleanKnight0x20::VTable0x0c();
3838
}
3939

40-
// STUB: LEGORACERS 0x0046fb40
41-
LegoBool32 CeruleanEmperor0x4c::Load(ResourceLoadParams*)
40+
// FUNCTION: LEGORACERS 0x0046fb40
41+
LegoBool32 CeruleanEmperor0x4c::Load(ResourceLoadParams* p_params)
4242
{
43-
// TODO
44-
STUB(0x0046fb40);
45-
return FALSE;
43+
Clear();
44+
m_unk0x14 = p_params->m_renderer;
45+
m_unk0x20 = p_params->m_unk0x04;
46+
47+
if (FUN_0046b100()) {
48+
FUN_0046fd30(p_params);
49+
}
50+
51+
return m_nameEntries != NULL;
4652
}
4753

4854
// FUNCTION: LEGORACERS 0x0046fb80
@@ -106,6 +112,18 @@ void CeruleanEmperor0x4c::VTable0x10(undefined4 p_param)
106112
}
107113
}
108114

115+
// FUNCTION: LEGORACERS 0x0046fd30
116+
void CeruleanEmperor0x4c::FUN_0046fd30(ResourceLoadParams* p_params)
117+
{
118+
VTable0x10(p_params->m_binary);
119+
m_unk0x10->OpenFileForRead(p_params->m_fileName);
120+
FUN_0046b130();
121+
FUN_0046b250();
122+
m_unk0x10->Dispose();
123+
124+
delete m_unk0x10;
125+
}
126+
109127
// FUNCTION: LEGORACERS 0x0046fd80
110128
void CeruleanEmperor0x4c::VTable0x14(undefined4 p_arg1)
111129
{

LEGORacers/src/ceruleanknight0x20.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ void CeruleanKnight0x20::VTable0x0c()
2424
m_unk0x0c = 0;
2525
}
2626

27+
// FUNCTION: LEGORACERS 0x0046b100
28+
LegoBool32 CeruleanKnight0x20::FUN_0046b100()
29+
{
30+
m_unk0x0c = TRUE;
31+
return TRUE;
32+
}
33+
2734
// FUNCTION: LEGORACERS 0x0046b110
2835
void CeruleanKnight0x20::Clear()
2936
{

0 commit comments

Comments
 (0)