Skip to content

Commit d18f417

Browse files
authored
Merge branch 'master' into implement-BronzeFalcon0xc8770-FUN_1000a2c0
2 parents c271fa8 + 7808803 commit d18f417

5 files changed

Lines changed: 70 additions & 15 deletions

File tree

GolDP/include/amberlens0x344.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class AmberLens0x344 : public AmberLensBase0x120 {
1717
enum {
1818
c_flagBit0 = 1 << 0,
1919
c_flagBit1 = 1 << 1,
20+
c_flagBit3 = 1 << 3,
2021
};
2122

2223
AmberLens0x344();
@@ -38,7 +39,9 @@ class AmberLens0x344 : public AmberLensBase0x120 {
3839
JadeOrbit0x220* GetUnk0x04() { return (JadeOrbit0x220*) m_unk0x04; }
3940

4041
protected:
41-
void FUN_10001f60(undefined*);
42+
friend class BronzeFalcon0xc8770;
43+
44+
void FUN_10001f60(BronzeFalcon0xc8770*);
4245

4346
JadeOrbit0x220 m_unk0x120; // 0x120
4447
BronzeFalcon0xc8770* m_unk0x340; // 0x340

GolDP/include/amberlensbase0x120.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ class AmberLensBase0x120 {
3838
undefined4 m_unk0x2c; // 0x2c
3939
LegoU32 m_flags; // 0x30
4040
undefined m_unk0x34[0x110 - 0x34]; // 0x34
41-
undefined4 m_unk0x110; // 0x110
42-
undefined4 m_unk0x114; // 0x114
43-
undefined4 m_unk0x118; // 0x118
44-
undefined4 m_unk0x11c; // 0x11c
41+
LegoS32 m_unk0x110; // 0x110
42+
LegoS32 m_unk0x114; // 0x114
43+
LegoS32 m_unk0x118; // 0x118
44+
LegoS32 m_unk0x11c; // 0x11c
4545
};
4646

4747
#endif // AMBERLENSBASE0X120_H

GolDP/include/jadeorbit0x220.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ class JadeOrbit0x220 : public JadeOrbitBase0x10 {
7878
LegoFloat m_unk0xc4; // 0xc4
7979
LegoFloat m_unk0xc8; // 0xc8
8080
LegoFloat m_unk0xcc; // 0xcc
81-
undefined m_unk0xd0[0x220 - 0xd0]; // 0xd0
81+
undefined m_unk0xd0[0x210 - 0xd0]; // 0xd0
82+
LegoFloat m_unk0x210; // 0x210
83+
LegoFloat m_unk0x214; // 0x214
84+
LegoFloat m_unk0x218; // 0x218
85+
LegoFloat m_unk0x21c; // 0x21c
8286
};
8387

8488
#endif // JADEORBIT0X220_H

GolDP/src/amberlens0x344.cpp

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "amberlens0x344.h"
22

33
#include "bronzefalcon0xc8770.h"
4+
#include "slatepeak0x58.h"
45

56
DECOMP_SIZE_ASSERT(AmberLens0x344, 0x344)
67

@@ -19,11 +20,31 @@ AmberLens0x344::~AmberLens0x344()
1920
}
2021
}
2122

22-
// STUB: GOLDP 0x10001f60
23-
void AmberLens0x344::FUN_10001f60(undefined*)
23+
// FUNCTION: GOLDP 0x10001f60
24+
void AmberLens0x344::FUN_10001f60(BronzeFalcon0xc8770* p_renderer)
2425
{
25-
// TODO
26-
STUB(0x10001f60);
26+
m_unk0x340 = p_renderer;
27+
if (p_renderer != NULL) {
28+
const SlatePeak0x58* renderTargetInfo = p_renderer->GetRenderTargetInfo();
29+
if (m_unk0x11c == 0 || m_unk0x118 == 0) {
30+
m_unk0x110 = 0;
31+
m_unk0x114 = 0;
32+
m_unk0x118 = renderTargetInfo->GetWidth();
33+
m_unk0x11c = renderTargetInfo->GetHeight();
34+
}
35+
36+
if (!(m_flags & c_flagBit3)) {
37+
LegoFloat width = static_cast<LegoFloat>(m_unk0x118 - m_unk0x110);
38+
LegoFloat height = static_cast<LegoFloat>(m_unk0x11c - m_unk0x114);
39+
m_unk0x0c = width / height;
40+
}
41+
42+
m_unk0x120.m_unk0x210 = static_cast<LegoFloat>(m_unk0x118 - m_unk0x110);
43+
m_unk0x120.m_unk0x214 = static_cast<LegoFloat>(m_unk0x11c - m_unk0x114);
44+
m_unk0x120.m_unk0x218 = static_cast<LegoFloat>(m_unk0x110);
45+
m_unk0x120.m_unk0x21c = static_cast<LegoFloat>(m_unk0x114);
46+
m_flags |= c_flagBit0 | c_flagBit1;
47+
}
2748
}
2849

2950
// STUB: GOLDP 0x10002060

GolDP/src/bronzefalcon0xc8770.cpp

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "bronzefalcon0xc8770.h"
22

3+
#include "amberlens0x344.h"
34
#include "bronzefalconsurface0x5c.h"
45
#include "falcondunebag0x10.h"
56
#include "falcontextureformat.h"
@@ -302,16 +303,42 @@ void BronzeFalcon0xc8770::ReleaseResources()
302303
STUB(0x10008680);
303304
}
304305

305-
// STUB: GOLDP 0x10008740
306+
// FUNCTION: GOLDP 0x10008740
306307
void BronzeFalcon0xc8770::VTable0x18()
307308
{
308-
STUB(0x10008740);
309+
if (m_unk0x0c != NULL) {
310+
m_unk0x0c->FUN_10001f60(NULL);
311+
m_unk0x0c = NULL;
312+
}
313+
314+
WhiteFalcon0x140::Destroy();
315+
ReleaseResources();
316+
317+
BronzeFalconSurface0x5c* surface = m_unk0x30c;
318+
while (surface != NULL) {
319+
BronzeFalconSurface0x5c* next = surface->m_next;
320+
surface->VTable0x34();
321+
delete surface;
322+
surface = next;
323+
}
324+
325+
if (m_drawState != NULL) {
326+
m_drawState->RemoveRenderer(this);
327+
}
328+
329+
Reset();
330+
m_unk0x04 = 0;
309331
}
310332

311-
// STUB: GOLDP 0x100087b0
312-
void BronzeFalcon0xc8770::VTable0x20(AmberLens0x344*)
333+
// FUNCTION: GOLDP 0x100087b0
334+
void BronzeFalcon0xc8770::VTable0x20(AmberLens0x344* p_lens)
313335
{
314-
STUB(0x100087b0);
336+
if (m_unk0x0c != NULL) {
337+
m_unk0x0c->FUN_10001f60(NULL);
338+
}
339+
340+
m_unk0x0c = p_lens;
341+
p_lens->FUN_10001f60(this);
315342
}
316343

317344
// STUB: GOLDP 0x100087e0

0 commit comments

Comments
 (0)