Skip to content

Commit 65db312

Browse files
committed
match and link StringObj
1 parent 2cc93b7 commit 65db312

File tree

4 files changed

+187
-90
lines changed

4 files changed

+187
-90
lines changed

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ def MatchingFor(*versions):
13081308
Object(Matching, "Sato/ItemKinoko.cpp"),
13091309
Object(NonMatching, "Sato/ItemStar.cpp"),
13101310
Object(NonMatching, "Sato/J3DEffectMgr.cpp"),
1311-
Object(NonMatching, "Sato/StringObj.cpp"),
1311+
Object(Matching, "Sato/StringObj.cpp"),
13121312
Object(NonMatching, "Sato/ItemWanWan.cpp"),
13131313
Object(NonMatching, "Sato/ItemBomb.cpp"),
13141314
Object(NonMatching, "Sato/ObjUtility.cpp"),

include/JSystem/JGeometry/Matrix.h

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,27 @@ namespace JGeometry {
8282
TRotation3() {}
8383
void identity33();
8484

85-
void getXDir(TVec3f &rDest) const
86-
{
87-
rDest.set<f32>(this->mMtx[0][0], this->mMtx[1][0], this->mMtx[2][0]);
88-
};
85+
// TODO: seems fakematch to me but that's a problem for later i guess
86+
inline void getXDir(TVec3f &rDest) const {
87+
f32 z = this->mMtx[2][0];
88+
f32 y = this->mMtx[1][0];
89+
f32 x = this->mMtx[0][0];
90+
rDest.set(x, y, z);
91+
}
8992

90-
void getYDir(TVec3f &rDest) const
91-
{
92-
rDest.set<f32>(this->mMtx[0][1], this->mMtx[1][1], this->mMtx[2][1]);
93-
};
93+
inline void getYDir(TVec3f &rDest) const {
94+
f32 z = this->mMtx[2][1];
95+
f32 y = this->mMtx[1][1];
96+
f32 x = this->mMtx[0][1];
97+
rDest.set(x, y, z);
98+
}
9499

95-
void getZDir(TVec3f &rDest) const
96-
{
97-
rDest.set<f32>(this->mMtx[0][2], this->mMtx[1][2], this->mMtx[2][2]);
98-
};
100+
inline void getZDir(TVec3f &rDest) const {
101+
f32 z = this->mMtx[2][2];
102+
f32 y = this->mMtx[1][2];
103+
f32 x = this->mMtx[0][2];
104+
rDest.set(x, y, z);
105+
}
99106

100107
void getXYZDir(TVec3f &rDestX, TVec3f &rDestY, TVec3f &rDestZ) const;
101108
void setXDir(const TVec3f &rSrc);
@@ -186,30 +193,6 @@ namespace JGeometry {
186193
void mult33(TVec3f &) const;
187194
void mult33(const TVec3f &, TVec3f &) const;
188195

189-
inline void getXDirInline(TVec3f &rDest) const
190-
{
191-
f32 z = this->mMtx[2][0];
192-
f32 y = this->mMtx[1][0];
193-
f32 x = this->mMtx[0][0];
194-
rDest.set(x, y, z);
195-
}
196-
197-
inline void getYDirInline(TVec3f &rDest) const
198-
{
199-
f32 z = this->mMtx[2][1];
200-
f32 y = this->mMtx[1][1];
201-
f32 x = this->mMtx[0][1];
202-
rDest.set(x, y, z);
203-
}
204-
205-
inline void getZDirInline(TVec3f &rDest) const
206-
{
207-
f32 z = this->mMtx[2][2];
208-
f32 y = this->mMtx[1][2];
209-
f32 x = this->mMtx[0][2];
210-
rDest.set(x, y, z);
211-
}
212-
213196
#ifdef NON_MATCHING
214197
inline void mult33Inline(const TVec3f &rSrc, TVec3f &rDest) const
215198
{

include/Sato/StringObj.h

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "JSystem/JSupport/JSUList.h"
88
#include "Kaneshige/DarkAnmMgr.h"
99
#include "Kaneshige/ExModel.h"
10+
#include "Sato/ObjCollision.h"
1011

1112
// Forward declarations
1213
class ExStringNodeManager;
@@ -23,22 +24,36 @@ class StringObj {
2324
void setCurrentViewNo(u32);
2425
void drawSimpleModel(u32, Mtx, J3DUClipper *, Mtx);
2526

27+
// Inline/Unused
28+
void createShadowBrk(J3DAnmTevRegKey *);
29+
void viewCalc(u32);
30+
void viewCalcClipOn(u32);
31+
void viewCalcClipOff(u32);
32+
2633
public:
2734
// VTBL: 0x0
2835
StringNodeManager *mStringNodeMgr; // 0x4
2936
ExModel *mExModel; // 0x8
3037
u32 _c;
3138
f32 mScale; // 0x10
32-
Mtx *_14;
39+
MtxPtr _14;
3340
u8 _18;
3441
u8 _19[3]; // Padding?
3542
ItemDarkAnmPlayer **mItemDarkAnmPlayer; // 0x1c
3643
};
3744

3845
class StringNode {
3946
public:
40-
StringNode();
41-
~StringNode();
47+
StringNode() : _38(this) {
48+
mVel.zero();
49+
mPos.zero();
50+
_18.zero();
51+
_24.zero();
52+
_30 = true;
53+
_31 = false;
54+
_34 = 0.0f;
55+
}
56+
~StringNode() {}
4257
void calc();
4358

4459
JGeometry::TVec3f mVel; // 0x0
@@ -54,8 +69,10 @@ class StringNode {
5469

5570
class StringNodeManager {
5671
public:
57-
StringNodeManager(u8, f32, bool, bool, u8);
58-
virtual ~StringNodeManager();
72+
StringNodeManager(u8 count, f32 speed, bool makeSoundMgr, bool makeCrsGround, u8 someFlag);
73+
virtual ~StringNodeManager() {
74+
delete[] _34;
75+
}
5976

6077
void setAllNodePos(const JGeometry::TVec3f &);
6178
void calc();
@@ -72,6 +89,17 @@ class StringNodeManager {
7289
void addNodePos(u32, JGeometry::TVec3f);
7390
void setNodePos(u32, JGeometry::TVec3f);
7491

92+
// Inline/Unused
93+
void calcBetweenNodeVelAll(f32);
94+
void calcBetweenNodeVel(StringNode *, StringNode *, f32);
95+
void collideSphereAll(f32, ObjColSphere *, const JGeometry::TVec3f &);
96+
void collideCylinderAll(f32, ObjColCylinder *, const JGeometry::TVec3f &);
97+
void dispose();
98+
99+
void set_3c(u32 val) {
100+
_3c = val;
101+
}
102+
75103
// VTBL: 0x0
76104
JSUList<StringNode> mStrNodeList; // 0x4
77105
f32 _10;
@@ -94,12 +122,12 @@ class StringNodeManager {
94122

95123
class ExStringNodeManager : public StringNodeManager {
96124
public:
97-
ExStringNodeManager();
98-
~ExStringNodeManager();
125+
ExStringNodeManager(u8 count, f32 speed, bool makeSoundMgr, bool makeCrsGround, u8 someFlag) : StringNodeManager(count, speed, makeSoundMgr, makeCrsGround, someFlag) {
126+
setNodeLengthAll(speed);
127+
}
128+
~ExStringNodeManager() {}
99129
virtual void calcBetweenNodePosAll(f32);
100130
void setNodeLengthAll(f32);
101-
102-
f32 _50;
103131
};
104132

105133
#endif // STRINGOBJ_H

0 commit comments

Comments
 (0)