Skip to content

Commit 4006bc7

Browse files
authored
Implement CopperCrest0x40 and related (isledecomp#194)
1 parent 98534a2 commit 4006bc7

30 files changed

Lines changed: 951 additions & 303 deletions

GolDP/include/bronzefalcon0xc8770.h

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ class GolDrawDPState;
1919
// SIZE 0xc8770
2020
class BronzeFalcon0xc8770 : public WhiteFalcon0x140 {
2121
public:
22+
// SIZE 0x18
23+
struct TextureFormat : public FalconTextureFormat {
24+
TextureFormat();
25+
};
26+
27+
// SIZE 0x10
28+
struct Field0xc83b4 {
29+
undefined4 m_unk0x00; // 0x00
30+
undefined4 m_unk0x04; // 0x04
31+
undefined4 m_unk0x08; // 0x08
32+
undefined4 m_unk0x0c; // 0x0c
33+
};
34+
2235
BronzeFalcon0xc8770();
2336

2437
void ReleaseResources() override; // vtable+0x04
@@ -52,8 +65,14 @@ class BronzeFalcon0xc8770 : public WhiteFalcon0x140 {
5265
void VTable0x70() override; // vtable+0x70
5366
void VTable0x74() override; // vtable+0x74
5467
void VTable0x78() override; // vtable+0x78
55-
void VTable0x7c() override; // vtable+0x7c
56-
void VTable0x80() override; // vtable+0x80
68+
undefined4 VTable0x7c(
69+
UtopianPan0xa4* p_image,
70+
undefined4 p_unk0x08,
71+
SilverDune0x30::Rect* p_destRect,
72+
SilverDune0x30::Rect* p_sourceRect,
73+
undefined4 p_unk0x14
74+
) override; // vtable+0x7c
75+
void VTable0x80() override; // vtable+0x80
5776
void DrawTriangle(
5877
const TexturedVertex* p_vertex0,
5978
const TexturedVertex* p_vertex1,
@@ -108,10 +127,6 @@ class BronzeFalcon0xc8770 : public WhiteFalcon0x140 {
108127
friend class SlatePeak0x58;
109128

110129
private:
111-
struct TextureFormat : public FalconTextureFormat {
112-
TextureFormat();
113-
};
114-
115130
void FUN_100082e0();
116131
void FUN_1000a2c0(undefined*);
117132
void FUN_1000a950(undefined*);
@@ -120,13 +135,6 @@ class BronzeFalcon0xc8770 : public WhiteFalcon0x140 {
120135
static HRESULT CALLBACK CountTextureFormatsCallback(DDPIXELFORMAT* p_format, void* p_context);
121136
static HRESULT CALLBACK EnumerateTextureFormatsCallback(DDPIXELFORMAT* p_format, void* p_context);
122137

123-
struct Field0xc83b4 {
124-
undefined4 m_unk0x00;
125-
undefined4 m_unk0x04;
126-
undefined4 m_unk0x08;
127-
undefined4 m_unk0x0c;
128-
};
129-
130138
GolDrawDPState* m_drawState; // 0x140
131139
LPDIRECT3DDEVICE3 m_d3dDevice; // 0x144
132140
D3DDEVICEDESC m_d3dDeviceDesc; // 0x148

GolDP/include/whitefalcon0x140.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "color.h"
55
#include "decomp.h"
66
#include "falcontextureformat.h"
7+
#include "silverdune0x30.h"
78
#include "types.h"
89

910
class AmberHaze0x1c;
@@ -91,8 +92,14 @@ class WhiteFalcon0x140 {
9192
virtual void VTable0x70() = 0; // vtable+0x70
9293
virtual void VTable0x74() = 0; // vtable+0x74
9394
virtual void VTable0x78() = 0; // vtable+0x78
94-
virtual void VTable0x7c() = 0; // vtable+0x7c
95-
virtual void VTable0x80() = 0; // vtable+0x80
95+
virtual undefined4 VTable0x7c(
96+
UtopianPan0xa4* p_image,
97+
undefined4 p_unk0x08,
98+
SilverDune0x30::Rect* p_destRect,
99+
SilverDune0x30::Rect* p_sourceRect,
100+
undefined4 p_unk0x14
101+
) = 0; // vtable+0x7c
102+
virtual void VTable0x80() = 0; // vtable+0x80
96103
virtual void DrawTriangle(
97104
const TexturedVertex* p_vertex0,
98105
const TexturedVertex* p_vertex1,

GolDP/src/bronzefalcon0xc8770.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <stdio.h>
1010

1111
DECOMP_SIZE_ASSERT(BronzeFalcon0xc8770, 0xc8770)
12+
DECOMP_SIZE_ASSERT(BronzeFalcon0xc8770::TextureFormat, 0x18)
13+
DECOMP_SIZE_ASSERT(BronzeFalcon0xc8770::Field0xc83b4, 0x10)
1214
DECOMP_SIZE_ASSERT(ColorRGBA, 0x4)
1315

1416
// GLOBAL: GOLDP 0x10056560
@@ -500,9 +502,16 @@ const SlatePeak0x58* BronzeFalcon0xc8770::GetRenderTargetInfo()
500502
}
501503

502504
// STUB: GOLDP 0x10009960
503-
void BronzeFalcon0xc8770::VTable0x7c()
505+
undefined4 BronzeFalcon0xc8770::VTable0x7c(
506+
UtopianPan0xa4*,
507+
undefined4,
508+
SilverDune0x30::Rect*,
509+
SilverDune0x30::Rect*,
510+
undefined4
511+
)
504512
{
505513
STUB(0x10009960);
514+
return 0;
506515
}
507516

508517
// STUB: GOLDP 0x10009990

LEGORacers/include/coppercrest0x40.h

Lines changed: 88 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,38 @@
22
#define COPPERCREST0X40_H
33

44
#include "decomp.h"
5+
#include "onyxcircularbuffer0x1c.h"
6+
#include "silverdune0x30.h"
57
#include "types.h"
68

79
class BronzeFalcon0xc8770;
810
class GolExport;
11+
class GolCommonDrawState;
12+
class ImaginaryTool0x368;
913
class InputManager;
10-
class OnyxCircularBuffer0x1c;
14+
class MouseInputDevice;
15+
class ObscureIcon0x1a8;
1116
class UtopianPan0xa4;
1217

1318
// VTABLE: LEGORACERS 0x004b2164
14-
// SIZE 0x40
19+
// SIZE 0x60
1520
class CopperCrest0x40 {
1621
public:
22+
enum {
23+
c_keyboardTab = 0x1000000f,
24+
c_keyboardLeftControl = 0x1000001d,
25+
c_keyboardLeftShift = 0x1000002a,
26+
c_keyboardRightShift = 0x10000036,
27+
c_keyboardRightControl = 0x1000009d,
28+
c_keyboardUp = 0x100000c8,
29+
c_keyboardDown = 0x100000d0,
30+
c_joystick1Button1 = 0x30000001,
31+
c_joystick1Button6 = 0x30000006,
32+
c_joystick1Button8 = 0x30000008,
33+
c_joystick2Button2 = 0x40000002,
34+
c_joystick2Button3 = 0x40000003
35+
};
36+
1737
// SIZE 0x18
1838
struct InitStruct {
1939
GolExport* m_golExport; // 0x00
@@ -24,26 +44,81 @@ class CopperCrest0x40 {
2444
undefined4 m_unk0x14; // 0x14
2545
};
2646

47+
// SIZE 0x44
48+
class Helper0x44 {
49+
public:
50+
// SIZE 0x24
51+
struct InitStruct {
52+
InputManager* m_inputManager; // 0x00
53+
GolExport* m_golExport; // 0x04
54+
BronzeFalcon0xc8770* m_renderer; // 0x08
55+
UtopianPan0xa4* m_rendererObject; // 0x0c
56+
SilverDune0x30::Rect* m_bounds; // 0x10
57+
undefined4 m_unk0x14; // 0x14
58+
undefined4 m_unk0x18; // 0x18
59+
undefined4 m_unk0x1c; // 0x1c
60+
undefined4 m_unk0x20; // 0x20
61+
};
62+
63+
Helper0x44();
64+
~Helper0x44();
65+
66+
void FUN_00467c80();
67+
LegoS32 FUN_00467cc0(InitStruct* p_initStruct);
68+
LegoS32 FUN_00467d70();
69+
LegoS32 FUN_00467d80(undefined4 p_elapsedMs);
70+
LegoS32 FUN_00467e00();
71+
72+
InputManager* m_inputManager; // 0x00
73+
GolExport* m_golExport; // 0x04
74+
BronzeFalcon0xc8770* m_renderer; // 0x08
75+
UtopianPan0xa4* m_rendererObject; // 0x0c
76+
SilverDune0x30::Rect m_bounds; // 0x10
77+
SilverDune0x30::Rect m_sourceRect; // 0x20
78+
LegoS32 m_unk0x30; // 0x30
79+
LegoS32 m_unk0x34; // 0x34
80+
LegoS32 m_unk0x38; // 0x38
81+
LegoS32 m_unk0x3c; // 0x3c
82+
LegoU8 m_unk0x40; // 0x40
83+
LegoU8 m_unk0x41; // 0x41
84+
undefined m_unk0x42[0x44 - 0x42]; // 0x42
85+
};
86+
2787
CopperCrest0x40();
28-
virtual LegoS32 VTable0x00(); // vtable+0x00
29-
virtual LegoS32 VTable0x04(undefined4); // vtable+0x04
30-
virtual ~CopperCrest0x40(); // vtable+0x08
31-
virtual LegoS32 VTable0x0c(); // vtable+0x0c
32-
virtual LegoS32 VTable0x10(undefined4); // vtable+0x10
33-
virtual void VTable0x14(); // vtable+0x14
34-
virtual void VTable0x18(); // vtable+0x18
88+
virtual LegoS32 VTable0x00(); // vtable+0x00
89+
virtual LegoS32 VTable0x04(ObscureIcon0x1a8*); // vtable+0x04
90+
virtual ~CopperCrest0x40(); // vtable+0x08
91+
virtual LegoS32 VTable0x0c(); // vtable+0x0c
92+
virtual LegoS32 VTable0x10(undefined4); // vtable+0x10
93+
virtual void VTable0x14(); // vtable+0x14
94+
virtual void VTable0x18(); // vtable+0x18
3595

3696
// SYNTHETIC: LEGORACERS 0x00468f10
3797
// CopperCrest0x40::`scalar deleting destructor'
3898

3999
LegoS32 FUN_00469040(InitStruct* p_initStruct);
40100
void FUN_00469550();
41-
undefined4* GetUnk0x10() { return &m_unk0x10; }
101+
void* GetUnk0x10() { return &m_unk0x10; }
102+
void SetUnk0x54(ImaginaryTool0x368* p_unk0x54) { m_unk0x54 = p_unk0x54; }
103+
void SetCursorInside(LegoU8 p_cursorInside) { m_unk0x10.m_unk0x40 = p_cursorInside; }
104+
void SetCursorPosition(undefined4 p_x, undefined4 p_y)
105+
{
106+
m_unk0x10.m_unk0x30 = p_x - m_unk0x10.m_unk0x38;
107+
m_unk0x10.m_unk0x34 = p_y - m_unk0x10.m_unk0x3c;
108+
}
42109

43110
private:
44-
undefined m_unk0x04[0x10 - 0x04]; // 0x04
45-
undefined4 m_unk0x10; // 0x10
46-
undefined m_unk0x14[0x40 - 0x14]; // 0x14
111+
LegoS32 FUN_00468fa0(InitStruct* p_initStruct);
112+
LegoS32 FUN_004690f0(OnyxCircularBuffer0x1c::Item* p_item);
113+
void FUN_004691e0(MouseInputDevice* p_mouse);
114+
115+
GolCommonDrawState* m_drawState; // 0x04
116+
InputManager* m_inputManager; // 0x08
117+
OnyxCircularBuffer0x1c* m_inputBindingContainer; // 0x0c
118+
Helper0x44 m_unk0x10; // 0x10
119+
ImaginaryTool0x368* m_unk0x54; // 0x54
120+
LegoS32 m_unk0x58; // 0x58
121+
LegoS32 m_unk0x5c; // 0x5c
47122
};
48123

49124
#endif // COPPERCREST0X40_H

LEGORacers/include/imaginarybolt0x4774.h

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,22 @@ class ImaginaryBolt0x4774 : public ImaginaryTool0x368 {
1111
public:
1212
ImaginaryBolt0x4774();
1313

14-
undefined4 VTable0x18(undefined4, undefined4, undefined4, undefined4) override; // vtable+0x18
15-
void VTable0x38(undefined4) override; // vtable+0x38
16-
void VTable0x44(undefined4) override; // vtable+0x44
17-
void VTable0x4c(undefined4) override; // vtable+0x4c
18-
void VTable0x54() override; // vtable+0x54
19-
~ImaginaryBolt0x4774() override; // vtable+0x68
20-
void VTable0x74() override; // vtable+0x74
21-
LegoBool32 VTable0x78(undefined4) override; // vtable+0x78
22-
void VTable0x84() override; // vtable+0x84
23-
void VTable0x88() override; // vtable+0x88
24-
void VTable0x8c(MenuToolContext0x4bc8*, MenuToolCreateParams0x30*) override; // vtable+0x8c
14+
undefined4 VTable0x18(
15+
ObscureIcon0x1a8*,
16+
OnyxCircularBuffer0x1c::Item*,
17+
undefined4,
18+
undefined4
19+
) override; // vtable+0x18
20+
void VTable0x38(undefined4) override; // vtable+0x38
21+
void VTable0x44(undefined4) override; // vtable+0x44
22+
void VTable0x4c(undefined4) override; // vtable+0x4c
23+
void VTable0x54() override; // vtable+0x54
24+
~ImaginaryBolt0x4774() override; // vtable+0x68
25+
void VTable0x74() override; // vtable+0x74
26+
LegoBool32 VTable0x78(undefined4) override; // vtable+0x78
27+
void VTable0x84() override; // vtable+0x84
28+
void VTable0x88() override; // vtable+0x88
29+
void VTable0x8c(MenuToolContext0x4bc8*, MenuToolCreateParams0x30*) override; // vtable+0x8c
2530

2631
// SYNTHETIC: LEGORACERS 0x0047cf70
2732
// ImaginaryBolt0x4774::`scalar deleting destructor'

LEGORacers/include/imaginarycube0x3c34.h

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,34 @@ class ImaginaryCube0x3c34 : public ImaginaryTool0x368 {
1111
public:
1212
ImaginaryCube0x3c34();
1313

14-
void VTable0x10(undefined4) override; // vtable+0x10
15-
undefined4 VTable0x14(undefined4, undefined4, undefined4, undefined4) override; // vtable+0x14
16-
undefined4 VTable0x18(undefined4, undefined4, undefined4, undefined4) override; // vtable+0x18
17-
undefined4 VTable0x1c(undefined4, undefined4, undefined4, undefined4) override; // vtable+0x1c
18-
void VTable0x20(undefined4) override; // vtable+0x20
19-
void VTable0x24(undefined4) override; // vtable+0x24
20-
undefined4 VTable0x28(undefined4, undefined4, undefined4, undefined4) override; // vtable+0x28
21-
void VTable0x34(undefined4) override; // vtable+0x34
22-
void VTable0x38(undefined4) override; // vtable+0x38
23-
void VTable0x44(undefined4) override; // vtable+0x44
24-
void VTable0x4c(undefined4) override; // vtable+0x4c
25-
void VTable0x54() override; // vtable+0x54
26-
~ImaginaryCube0x3c34() override; // vtable+0x68
27-
LegoBool32 VTable0x78(undefined4) override; // vtable+0x78
28-
LegoBool32 VTable0x7c(undefined4 p_arg1, undefined4 p_arg2) override; // vtable+0x7c
29-
void VTable0x80() override; // vtable+0x80
30-
void VTable0x84() override; // vtable+0x84
31-
void VTable0x8c(MenuToolContext0x4bc8*, MenuToolCreateParams0x30*) override; // vtable+0x8c
14+
void VTable0x10(undefined4) override; // vtable+0x10
15+
undefined4 VTable0x14(ObscureIcon0x1a8*, void*, undefined4, undefined4) override; // vtable+0x14
16+
undefined4 VTable0x18(
17+
ObscureIcon0x1a8*,
18+
OnyxCircularBuffer0x1c::Item*,
19+
undefined4,
20+
undefined4
21+
) override; // vtable+0x18
22+
undefined4 VTable0x1c(
23+
ObscureIcon0x1a8*,
24+
OnyxCircularBuffer0x1c::Item*,
25+
undefined4,
26+
undefined4
27+
) override; // vtable+0x1c
28+
void VTable0x20(undefined4) override; // vtable+0x20
29+
void VTable0x24(undefined4) override; // vtable+0x24
30+
undefined4 VTable0x28(ObscureIcon0x1a8*, void*, undefined4, undefined4) override; // vtable+0x28
31+
void VTable0x34(undefined4) override; // vtable+0x34
32+
void VTable0x38(undefined4) override; // vtable+0x38
33+
void VTable0x44(undefined4) override; // vtable+0x44
34+
void VTable0x4c(undefined4) override; // vtable+0x4c
35+
void VTable0x54() override; // vtable+0x54
36+
~ImaginaryCube0x3c34() override; // vtable+0x68
37+
LegoBool32 VTable0x78(undefined4) override; // vtable+0x78
38+
LegoBool32 VTable0x7c(SilverDune0x30::Rect* p_arg1, SilverDune0x30::Rect* p_arg2) override; // vtable+0x7c
39+
void VTable0x80() override; // vtable+0x80
40+
void VTable0x84() override; // vtable+0x84
41+
void VTable0x8c(MenuToolContext0x4bc8*, MenuToolCreateParams0x30*) override; // vtable+0x8c
3242

3343
// SYNTHETIC: LEGORACERS 0x00473790
3444
// ImaginaryCube0x3c34::`scalar deleting destructor'

LEGORacers/include/imaginarydrill0x2450.h

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,26 @@ class ImaginaryDrill0x2450 : public ImaginaryTool0x368 {
1111
public:
1212
ImaginaryDrill0x2450();
1313

14-
undefined4 VTable0x18(undefined4, undefined4, undefined4, undefined4) override; // vtable+0x18
15-
undefined4 VTable0x1c(undefined4, undefined4, undefined4, undefined4) override; // vtable+0x1c
16-
void VTable0x38(undefined4) override; // vtable+0x38
17-
void VTable0x4c(undefined4) override; // vtable+0x4c
18-
void VTable0x54() override; // vtable+0x54
19-
~ImaginaryDrill0x2450() override; // vtable+0x68
20-
void VTable0x74() override; // vtable+0x74
21-
LegoBool32 VTable0x78(undefined4) override; // vtable+0x78
22-
void VTable0x84() override; // vtable+0x84
23-
void VTable0x8c(MenuToolContext0x4bc8*, MenuToolCreateParams0x30*) override; // vtable+0x84
14+
undefined4 VTable0x18(
15+
ObscureIcon0x1a8*,
16+
OnyxCircularBuffer0x1c::Item*,
17+
undefined4,
18+
undefined4
19+
) override; // vtable+0x18
20+
undefined4 VTable0x1c(
21+
ObscureIcon0x1a8*,
22+
OnyxCircularBuffer0x1c::Item*,
23+
undefined4,
24+
undefined4
25+
) override; // vtable+0x1c
26+
void VTable0x38(undefined4) override; // vtable+0x38
27+
void VTable0x4c(undefined4) override; // vtable+0x4c
28+
void VTable0x54() override; // vtable+0x54
29+
~ImaginaryDrill0x2450() override; // vtable+0x68
30+
void VTable0x74() override; // vtable+0x74
31+
LegoBool32 VTable0x78(undefined4) override; // vtable+0x78
32+
void VTable0x84() override; // vtable+0x84
33+
void VTable0x8c(MenuToolContext0x4bc8*, MenuToolCreateParams0x30*) override; // vtable+0x84
2434

2535
// SYNTHETIC: LEGORACERS 0x00480cb0
2636
// ImaginaryDrill0x2450::`scalar deleting destructor'

0 commit comments

Comments
 (0)