Skip to content

Commit bdd14f5

Browse files
authored
PurpleDune0x7c::VTable0x30 (isledecomp#230)
1 parent f9416f6 commit bdd14f5

11 files changed

Lines changed: 304 additions & 21 deletions

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ add_library(goldp SHARED
186186
GolDP/src/softwarerenderer0x58.cpp
187187
GolDP/src/falcondunebag0x10.cpp
188188
GolDP/src/boundingshape0x2c.cpp
189+
GolDP/src/moonlitcanvas0x5b0.cpp
189190
util/decomp.cpp
190191
$<TARGET_OBJECTS:common_goldp>
191192
)

GolDP/include/bronzedune0x4c.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
class BronzeDune0x4c : public GoldDune0x38 {
1111
public:
1212
BronzeDune0x4c();
13-
~BronzeDune0x4c() override; // vtable+0x00
14-
IPalette0x4* GetPalette() override; // vtable+0x1c
15-
void VTable0x30(WhiteFalcon0x140& p_renderer, undefined4*) override; // vtable+0x30
13+
~BronzeDune0x4c() override; // vtable+0x00
14+
IPalette0x4* GetPalette() override; // vtable+0x1c
15+
void VTable0x30(WhiteFalcon0x140& p_renderer, MoonlitCanvas0x5b0* p_source) override; // vtable+0x30
1616
void VTable0x34(
1717
WhiteFalcon0x140& p_renderer,
1818
const FalconTextureFormat& p_textureFormat,

GolDP/include/bronzefalcon0xc8770.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ class BronzeFalcon0xc8770 : public WhiteFalcon0x140 {
169169
LPDIRECTDRAW4 GetDirectDraw4() const;
170170
LPDIRECT3DDEVICE3 GetDirect3DDevice() const { return m_d3dDevice; }
171171
SoftwareRenderer0x58& GetSoftwareRenderer() { return m_softwareRenderer; }
172+
undefined4 GetUnk0xc8704() const { return m_unk0xc8704; }
172173

173174
// SYNTHETIC: GOLDP 0x10007960
174175
// BronzeFalcon0xc8770::`scalar deleting destructor'

GolDP/include/golddune0x38.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@
44
#include "silverdune0x30.h"
55

66
class WhiteFalcon0x140;
7+
class MoonlitCanvas0x5b0;
78

89
// VTABLE: GOLDP 0x1005766c
910
// SIZE 0x38
1011
class GoldDune0x38 : public SilverDune0x30 {
1112
public:
1213
enum {
14+
c_unk0x36Bit2 = 0x04,
1315
c_unk0x36Bit5 = 0x20,
16+
c_unk0x36Bit6 = 0x40,
1417
c_unk0x36Bit7 = 0x80,
1518
c_unk0x36Bit10 = 0x400,
1619
c_unk0x36Bit11 = 0x800,
1720
};
1821
GoldDune0x38();
1922

20-
virtual void VTable0x30(WhiteFalcon0x140& p_renderer, undefined4*); // vtable+0x30
23+
virtual void VTable0x30(WhiteFalcon0x140& p_renderer, MoonlitCanvas0x5b0* p_source); // vtable+0x30
2124
virtual void VTable0x34(
2225
WhiteFalcon0x140& p_renderer,
2326
const FalconTextureFormat& p_textureFormat,

GolDP/include/moonlitcanvas0x5b0.h

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#ifndef MOONLITCANVAS0X5B0_H
2+
#define MOONLITCANVAS0X5B0_H
3+
4+
#include "compat.h"
5+
#include "decomp.h"
6+
#include "falcontextureformat.h"
7+
#include "golfile.h"
8+
#include "types.h"
9+
10+
class GoldDune0x38;
11+
12+
// VTABLE: GOLDP 0x10056f04
13+
// SIZE 0x5b0
14+
class MoonlitCanvas0x5b0 {
15+
public:
16+
MoonlitCanvas0x5b0();
17+
virtual void VTable0x00(); // vtable+0x00
18+
virtual ~MoonlitCanvas0x5b0(); // vtable+0x04
19+
virtual void VTable0x08(const LegoChar* p_fileName); // vtable+0x08
20+
virtual void VTable0x0c(); // vtable+0x0c
21+
virtual const LegoChar* VTable0x10(); // vtable+0x10
22+
virtual void VTable0x14(undefined4, undefined4, undefined4, undefined4); // vtable+0x14
23+
virtual void VTable0x18(undefined4* p_arg1); // vtable+0x18
24+
virtual void VTable0x1c(GoldDune0x38* p_texture, LegoU32 p_flags, undefined4 p_arg3); // vtable+0x1c
25+
virtual void VTable0x20(GoldDune0x38* p_texture, LegoU32 p_flags, undefined4 p_arg3); // vtable+0x20
26+
27+
void FUN_100226c0(
28+
const FalconTextureFormat& p_textureFormat,
29+
LegoU32 p_width,
30+
LegoU32 p_height,
31+
LegoU32 p_pitch,
32+
const ColorRGBA* p_palette,
33+
LegoU32 p_paletteCount
34+
);
35+
36+
const FalconTextureFormat& GetTextureFormat() const { return m_textureFormat; }
37+
LegoU32 GetWidth() const { return m_width; }
38+
LegoU32 GetHeight() const { return m_height; }
39+
void SetUnk0x5a8(undefined4 p_unk0x5a8) { m_unk0x5a8 = p_unk0x5a8; }
40+
void SetUnk0x5ac(undefined4 p_unk0x5ac) { m_unk0x5ac = p_unk0x5ac; }
41+
42+
// SYNTHETIC: GOLDP 0x1001ff30
43+
// MoonlitCanvas0x5b0::`scalar deleting destructor'
44+
45+
private:
46+
undefined4 m_unk0x04; // 0x04
47+
undefined4 m_unk0x08; // 0x08
48+
undefined4 m_unk0x0c; // 0x0c
49+
LegoU8* m_unk0x10; // 0x10
50+
GolFile m_file; // 0x14
51+
LegoU32 m_width; // 0x44
52+
LegoU32 m_height; // 0x48
53+
undefined4 m_unk0x4c; // 0x4c
54+
FalconTextureFormat m_textureFormat; // 0x50
55+
undefined4 m_unk0x68; // 0x68
56+
undefined4 m_unk0x6c; // 0x6c
57+
undefined m_unk0x70[0x74 - 0x70]; // 0x70
58+
undefined4 m_unk0x74; // 0x74
59+
undefined m_unk0x78[0x98 - 0x78]; // 0x78
60+
undefined4 m_unk0x98; // 0x98
61+
ColorRGBA m_unk0x9c; // 0x9c
62+
ColorRGBA m_unk0xa0; // 0xa0
63+
undefined4 m_unk0xa4; // 0xa4
64+
undefined m_unk0xa8[0x5a8 - 0xa8]; // 0xa8
65+
undefined4 m_unk0x5a8; // 0x5a8
66+
undefined4 m_unk0x5ac; // 0x5ac
67+
};
68+
69+
#endif // MOONLITCANVAS0X5B0_H

GolDP/include/purpledune0x7c.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <ddraw.h>
1010

1111
class IPalette0x4;
12+
class GolCommonDrawState;
1213

1314
// VTABLE: GOLDP 0x1005681c
1415
// SIZE 0x7c
@@ -17,10 +18,10 @@ class PurpleDune0x7c : public GoldDune0x38 {
1718
PurpleDune0x7c();
1819
~PurpleDune0x7c() override; // vtable+0x00
1920

20-
void LockPixels(LegoU8** p_pixels, LegoU32* p_pitch, LegoU32 p_flags) override; // vtable+0x04
21-
void UnlockPixels() override; // vtable+0x08
22-
IPalette0x4* GetPalette() override; // vtable+0x1c
23-
void VTable0x30(WhiteFalcon0x140& p_renderer, undefined4*) override; // vtable+0x30
21+
void LockPixels(LegoU8** p_pixels, LegoU32* p_pitch, LegoU32 p_flags) override; // vtable+0x04
22+
void UnlockPixels() override; // vtable+0x08
23+
IPalette0x4* GetPalette() override; // vtable+0x1c
24+
void VTable0x30(WhiteFalcon0x140& p_renderer, MoonlitCanvas0x5b0* p_source) override; // vtable+0x30
2425
void VTable0x34(
2526
WhiteFalcon0x140& p_renderer,
2627
const FalconTextureFormat& p_textureFormat,
@@ -33,7 +34,9 @@ class PurpleDune0x7c : public GoldDune0x38 {
3334
void FUN_10016100();
3435
void FUN_10016380();
3536
void FUN_10016440(BronzeFalcon0xc8770& p_renderer);
36-
void FUN_10016460(BronzeFalcon0xc8770& p_renderer);
37+
undefined4 FUN_10016460(BronzeFalcon0xc8770& p_renderer);
38+
undefined4 FUN_100165c0(GolCommonDrawState* p_drawState, BronzeFalcon0xc8770& p_renderer);
39+
undefined4 FUN_100168c0(BronzeFalcon0xc8770& p_renderer);
3740

3841
LPDIRECT3DTEXTURE2 GetDirect3DTexture() const { return reinterpret_cast<LPDIRECT3DTEXTURE2>(m_unk0x4c); }
3942

GolDP/src/bronzedune0x4c.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ DECOMP_SIZE_ASSERT(BronzeDune0x4c, 0x4c)
88
BronzeDune0x4c g_bronzeDune0x4c;
99

1010
// STUB: GOLDP 0x10004f80
11-
void BronzeDune0x4c::VTable0x30(WhiteFalcon0x140& p_renderer, undefined4* p_arg2)
11+
void BronzeDune0x4c::VTable0x30(WhiteFalcon0x140& p_renderer, MoonlitCanvas0x5b0* p_source)
1212
{
13-
GoldDune0x38::VTable0x30(p_renderer, p_arg2);
13+
GoldDune0x38::VTable0x30(p_renderer, p_source);
1414
}
1515

1616
// FUNCTION: GOLDP 0x1001de50

GolDP/src/golddune0x38.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ GoldDune0x38::GoldDune0x38()
1010
}
1111

1212
// STUB: GOLDP 0x1002bb20
13-
void GoldDune0x38::VTable0x30(WhiteFalcon0x140& p_renderer, undefined4*)
13+
void GoldDune0x38::VTable0x30(WhiteFalcon0x140& p_renderer, MoonlitCanvas0x5b0*)
1414
{
1515
// TODO
1616
STUB(0x1002bb20);

GolDP/src/moonlitcanvas0x5b0.cpp

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
#include "moonlitcanvas0x5b0.h"
2+
3+
#include <string.h>
4+
5+
DECOMP_SIZE_ASSERT(MoonlitCanvas0x5b0, 0x5b0)
6+
7+
// GLOBAL: GOLDP 0x1005cdfc
8+
LegoChar g_moonlitCanvasExtension[] = ".img";
9+
10+
// FUNCTION: GOLDP 0x1001fe90
11+
MoonlitCanvas0x5b0::MoonlitCanvas0x5b0()
12+
{
13+
m_width = 0;
14+
m_height = 0;
15+
m_unk0x4c = 0;
16+
m_unk0x98 = 0;
17+
m_unk0x6c = 0;
18+
m_unk0x9c.m_red = 0;
19+
m_unk0x9c.m_grn = 0;
20+
m_unk0x9c.m_blu = 0;
21+
m_unk0x9c.m_alp = 0;
22+
m_unk0x74 = 0;
23+
m_unk0x68 = 0;
24+
m_unk0xa0.m_red = 0;
25+
m_unk0xa0.m_grn = 0;
26+
m_unk0xa0.m_blu = 0;
27+
m_unk0xa0.m_alp = 0;
28+
m_unk0xa4 = 0;
29+
m_unk0x5a8 = 0;
30+
m_unk0x5ac = 0;
31+
m_unk0x04 = 0;
32+
m_unk0x08 = 0;
33+
m_unk0x0c = 0;
34+
m_unk0x10 = NULL;
35+
}
36+
37+
// FUNCTION: GOLDP 0x10029920 FOLDED
38+
void MoonlitCanvas0x5b0::VTable0x00()
39+
{
40+
// empty
41+
}
42+
43+
// FUNCTION: GOLDP 0x1001ff50
44+
MoonlitCanvas0x5b0::~MoonlitCanvas0x5b0()
45+
{
46+
m_file.Dispose();
47+
48+
if (m_unk0x10 != NULL) {
49+
delete[] m_unk0x10;
50+
m_unk0x10 = NULL;
51+
}
52+
}
53+
54+
// STUB: GOLDP 0x1001ffc0
55+
void MoonlitCanvas0x5b0::VTable0x08(const LegoChar*)
56+
{
57+
STUB(0x1001ffc0);
58+
}
59+
60+
// FUNCTION: GOLDP 0x100200c0
61+
void MoonlitCanvas0x5b0::VTable0x0c()
62+
{
63+
m_file.Dispose();
64+
65+
if (m_unk0x10 != NULL) {
66+
delete[] m_unk0x10;
67+
m_unk0x10 = NULL;
68+
}
69+
}
70+
71+
// FUNCTION: GOLDP 0x100226a0
72+
const LegoChar* MoonlitCanvas0x5b0::VTable0x10()
73+
{
74+
return g_moonlitCanvasExtension;
75+
}
76+
77+
// FUNCTION: GOLDP 0x100226b0
78+
void MoonlitCanvas0x5b0::VTable0x14(undefined4, undefined4, undefined4, undefined4)
79+
{
80+
// empty
81+
}
82+
83+
// FUNCTION: GOLDP 0x100226c0
84+
void MoonlitCanvas0x5b0::FUN_100226c0(
85+
const FalconTextureFormat& p_textureFormat,
86+
LegoU32 p_width,
87+
LegoU32 p_height,
88+
LegoU32 p_pitch,
89+
const ColorRGBA* p_palette,
90+
LegoU32 p_paletteCount
91+
)
92+
{
93+
if (m_file.GetFlags() & GolStream::c_flagOpen) {
94+
VTable0x0c();
95+
}
96+
97+
m_textureFormat = p_textureFormat;
98+
m_width = p_width;
99+
m_height = p_height;
100+
m_unk0x4c = p_pitch;
101+
m_unk0x5a8 = 0;
102+
m_unk0x5ac = 0;
103+
m_unk0x6c = 1 << static_cast<LegoU8>(m_textureFormat.m_bitsPerPixel);
104+
105+
if (p_palette != NULL && p_paletteCount != 0) {
106+
::memcpy(m_unk0xa8, p_palette, sizeof(ColorRGBA) * p_paletteCount);
107+
}
108+
}
109+
110+
// FUNCTION: GOLDP 0x1002c020 FOLDED
111+
void MoonlitCanvas0x5b0::VTable0x18(undefined4*)
112+
{
113+
// empty
114+
}
115+
116+
// FUNCTION: GOLDP 0x100294f0 FOLDED
117+
void MoonlitCanvas0x5b0::VTable0x1c(GoldDune0x38*, LegoU32, undefined4)
118+
{
119+
// empty
120+
}
121+
122+
// FUNCTION: GOLDP 0x100294f0 FOLDED
123+
void MoonlitCanvas0x5b0::VTable0x20(GoldDune0x38*, LegoU32, undefined4)
124+
{
125+
// empty
126+
}

0 commit comments

Comments
 (0)