Skip to content

Commit 944a86f

Browse files
authored
Merge pull request #284 from robojumper/d_lyt_drop_line
d_lyt_drop_line OK
2 parents 551fc3d + 48ffb80 commit 944a86f

File tree

7 files changed

+561
-112
lines changed

7 files changed

+561
-112
lines changed

config/SOUE01/splits.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,6 +1600,7 @@ d/lyt/d_lyt_drop_line.cpp:
16001600
.ctors start:0x804DB868 end:0x804DB86C
16011601
.data start:0x80538498 end:0x80538658
16021602
.sbss start:0x80575958 end:0x80575960
1603+
.sdata2 start:0x8057C6B0 end:0x8057C6C8
16031604
.bss start:0x805B6000 end:0x805B60C0
16041605

16051606
d/lyt/d_lyt_force_line.cpp:

config/SOUE01/symbols.txt

Lines changed: 95 additions & 81 deletions
Large diffs are not rendered by default.

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ def MatchingFor(*versions):
647647
Object(Matching, "d/lyt/d_lyt_pause.cpp"),
648648
Object(NonMatching, "d/lyt/d_lyt_game_over.cpp"),
649649
Object(Matching, "d/lyt/d_lyt_save_mgr.cpp"),
650-
Object(NonMatching, "d/lyt/d_lyt_drop_line.cpp"),
650+
Object(Matching, "d/lyt/d_lyt_drop_line.cpp"),
651651
Object(Matching, "d/lyt/d_lyt_force_line.cpp"),
652652
Object(NonMatching, "d/lyt/d_lyt_enemy_icon.cpp"),
653653
Object(NonMatching, "d/lyt/d_lyt_mini_game.cpp"),

include/d/lyt/d_lyt_drop_line.h

Lines changed: 91 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,74 @@
33

44
#include "common.h"
55
#include "d/a/d_a_item.h"
6+
#include "d/d_base.h"
7+
#include "m/m_vec.h"
68
#include "nw4r/lyt/lyt_pane.h"
9+
#include "s/s_State.hpp"
10+
#include "toBeSorted/d_emitter.h"
711

8-
class dLytDropLine_c {
12+
class dLytDropLine_c;
13+
14+
class dLytDropLineParts_c {
15+
public:
16+
dLytDropLineParts_c() : mStateMgr(*this) {}
17+
18+
int create(dLytDropLine_c *main);
19+
int doDelete();
20+
int execute();
21+
int draw();
22+
23+
/** Starts a line from the tear's world position to the tear slot, when picking up a tear. */
24+
void startPickup(mVec3_c tearWorldPos, s32 trial);
25+
26+
/** Starts a line from the tear slot to the flower. */
27+
void startChange(mVec3_c startPos, s32 trial, bool leftRight);
28+
29+
bool isMoveRequest() const {
30+
return mMoveRequest;
31+
}
32+
33+
bool isDone() const {
34+
return mIsDone;
35+
}
36+
37+
void setTargetPane(nw4r::lyt::Pane *pane) {
38+
mIsDone = false;
39+
mIsChangeAnim = false;
40+
mpTargetPane = pane;
41+
}
42+
43+
void finish() {
44+
mIsDone = false;
45+
mIsChangeAnim = false;
46+
}
47+
48+
nw4r::lyt::Pane *getTargetPane() const {
49+
return mpTargetPane;
50+
}
51+
52+
private:
53+
STATE_FUNC_DECLARE(dLytDropLineParts_c, Wait);
54+
STATE_FUNC_DECLARE(dLytDropLineParts_c, Move);
55+
56+
void reset();
57+
58+
/* 0x00 */ UI_STATE_MGR_DECLARE(dLytDropLineParts_c);
59+
/* 0x3C */ nw4r::lyt::Pane *mpTargetPane;
60+
/* 0x40 */ dEmitter_c mEmitter;
61+
/* 0x74 */ mVec3_c mStartPos;
62+
/* 0x80 */ mVec3_c mEffectPos;
63+
/* 0x8C */ mVec3_c mMoveLinearCoeff;
64+
/* 0x98 */ s32 mTrial;
65+
/* 0x9C */ s32 mMoveTimer;
66+
/* 0xA0 */ bool mMoveRequest;
67+
/* 0xA1 */ bool mIsDone;
68+
/* 0xA2 */ bool mLeftRight;
69+
/* 0xA3 */ bool mIsChangeAnim;
70+
};
71+
72+
/** 2D UI - Silent realm tear trail. */
73+
class dLytDropLine_c : public dBase_c {
974
public:
1075
dLytDropLine_c() {
1176
sInstance = this;
@@ -18,13 +83,35 @@ class dLytDropLine_c {
1883
return sInstance;
1984
}
2085

86+
virtual int create() override;
87+
virtual int doDelete() override;
88+
virtual int execute() override;
89+
virtual int draw() override;
90+
91+
static bool finishPart();
92+
static void setPane(nw4r::lyt::Pane *pane);
2193
static nw4r::lyt::Pane *getActivePane();
22-
static nw4r::lyt::Pane *setPane(nw4r::lyt::Pane *pane);
23-
static nw4r::lyt::Pane *update(nw4r::lyt::Pane *pane, nw4r::lyt::Pane *otherPane, dAcItem_c::Trial_e, bool);
24-
static bool finishPartMaybe();
94+
static void startPickup(mVec3_c tearWorldPos, dAcItem_c::Trial_e trial);
95+
static void startChange(nw4r::lyt::Pane *tearSlotPane, nw4r::lyt::Pane *flowerPane, dAcItem_c::Trial_e trial, bool leftRight);
2596

2697
private:
2798
static dLytDropLine_c *sInstance;
99+
100+
static const s32 NUM_PARTS = 15;
101+
102+
int createInternal();
103+
int doDeleteInternal();
104+
int executeInternal();
105+
int drawInternal();
106+
107+
bool finishPartInternal();
108+
void setPaneInternal(nw4r::lyt::Pane *pane);
109+
nw4r::lyt::Pane *getActivePaneInternal();
110+
111+
void startPickupInternal(mVec3_c tearWorldPos, dAcItem_c::Trial_e trial);
112+
void startChangeInternal(nw4r::lyt::Pane *tearSlotPane, nw4r::lyt::Pane *flowerPane, dAcItem_c::Trial_e trial, bool leftRight);
113+
114+
/* 0x68 */ dLytDropLineParts_c mParts[NUM_PARTS];
28115
};
29116

30117
#endif

include/d/lyt/meter/d_lyt_meter_timer.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class LytMeterTimerPart1_c : public d2d::dSubPane {
1212
public:
1313
LytMeterTimerPart1_c()
14-
: mActualTearCount(0), mDisplayedTearCount(0), field_0x760(0), mTrial(dAcItem_c::TRIAL_NONE), field_0x780(0) {
14+
: mActualTearCount(0), mDisplayedTearCount(0), field_0x760(0), mTrial(dAcItem_c::TRIAL_NONE), mChangeFruitIndex(0) {
1515
sInstance = this;
1616
}
1717
virtual bool build(d2d::ResAccIf_c *resAcc) override;
@@ -50,7 +50,7 @@ class LytMeterTimerPart1_c : public d2d::dSubPane {
5050
bool isOutAnimFinished();
5151
void startFruitAnim(s32 index);
5252
void resetBowlNuts();
53-
void updateDropLine(nw4r::lyt::Pane *pane);
53+
void startDropLineChange(nw4r::lyt::Pane *pane);
5454

5555
void startEffect(s32 fruitIndex);
5656
bool incrementTearCount();
@@ -64,12 +64,12 @@ class LytMeterTimerPart1_c : public d2d::dSubPane {
6464
return mDisplayedTearCount;
6565
}
6666

67-
s32 getField0x780() const {
68-
return field_0x780;
67+
s32 getChangeFruitIndex() const {
68+
return mChangeFruitIndex;
6969
}
7070

71-
void setField0x780(s32 val) {
72-
field_0x780 = val;
71+
void setChangeFruitIndex(s32 val) {
72+
mChangeFruitIndex = val;
7373
}
7474

7575
private:
@@ -92,7 +92,7 @@ class LytMeterTimerPart1_c : public d2d::dSubPane {
9292
/* 0x764 */ dAcItem_c::Trial_e mTrial;
9393
/* 0x768 */ mColor mColors1[3];
9494
/* 0x774 */ mColor mColors2[3];
95-
/* 0x780 */ s32 field_0x780;
95+
/* 0x780 */ s32 mChangeFruitIndex;
9696
};
9797

9898
class LytMeterTimerPart2_c : public d2d::dSubPane {

0 commit comments

Comments
 (0)