Skip to content

Commit 0f5bf67

Browse files
d_magma OK (#947)
Co-authored-by: Roland <roland@wildpaws.xyz>
1 parent 49d51e3 commit 0f5bf67

File tree

6 files changed

+104
-69
lines changed

6 files changed

+104
-69
lines changed

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def EquivalentFor(*versions):
518518
Object(Matching, "d/d_event.cpp"),
519519
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_event_data.cpp"),
520520
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_event_manager.cpp"),
521-
Object(NonMatching, "d/d_magma.cpp"),
521+
Object(Matching, "d/d_magma.cpp"),
522522
Object(Matching, "d/d_boss_magma.cpp"),
523523
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_grass.cpp"),
524524
Object(NonMatching, "d/d_tree.cpp"),

include/d/d_magma.h

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ class dMagma_ball_c {
1111
virtual ~dMagma_ball_c() {}
1212
virtual void calc(f32, u8, int) = 0;
1313
virtual void update() = 0;
14-
1514
virtual void setup(f32, u8, int) = 0;
16-
void draw();
1715

16+
void draw();
1817
BOOL rangeCheck(cXyz&, f32*);
1918

20-
public:
19+
protected:
2120
/* 0x04 */ cXyz mPos;
2221
/* 0x10 */ f32 mScale;
2322
/* 0x14 */ f32 mBaseY;
@@ -35,7 +34,7 @@ class dMagma_ballPath_c : public dMagma_ball_c {
3534
virtual void update();
3635
virtual void setup(f32, u8, int);
3736

38-
public:
37+
private:
3938
/* 0x7C */ u8 mWaveTimer;
4039
};
4140

@@ -47,7 +46,7 @@ class dMagma_ballBoss_c : public dMagma_ball_c {
4746
virtual void update();
4847
virtual void setup(f32, u8, int);
4948

50-
public:
49+
private:
5150
/* 0x7C */ s16 field_0x7C;
5251
};
5352

@@ -65,11 +64,13 @@ class dMagma_floor_c {
6564
dMagma_floor_c* getNext() { return mpNext; }
6665
void setNext(dMagma_floor_c* v) { mpNext = v; }
6766
dMagma_ball_c** getBall() { return mpBalls; }
68-
s32 getBallNum() { return mBallNum; }
69-
cXyz& getPos() { return mPos; }
67+
int getBallNum() { return mBallNum; }
68+
cXyz* getPos() { return &mPos; }
7069
f32 getScaleX() { return mScaleX; }
7170
f32 getScaleZ() { return mScaleZ; }
71+
void setYpos(f32 y) { mPos.y = y; }
7272

73+
private:
7374
/* 0x00 */ dMagma_ball_c** mpBalls;
7475
/* 0x04 */ u8 mBallNum;
7576
/* 0x05 */ u8 mPathNo;
@@ -91,6 +92,7 @@ class dMagma_room_c {
9192

9293
dMagma_room_c();
9394

95+
private:
9496
/* 0x0 */ dMagma_floor_c* mpFirst;
9597
};
9698

@@ -101,25 +103,26 @@ class dMagma_packet_c : public J3DPacket {
101103
void update();
102104
f32 checkYpos(cXyz&);
103105
dMagma_floor_c* newFloor(cXyz&, cXyz&, int, s16);
104-
void deleteRoom(s32 roomNo) { mRoom[roomNo].deleteFloor(); }
106+
void deleteRoom(int roomNo) { mRoom[roomNo].deleteFloor(); }
105107

106108
virtual void draw();
107109
virtual ~dMagma_packet_c();
108110

109-
static GXTexObj& getKuroTexObj() { return mKuroTexObj; }
110-
static GXTexObj& getColTexObj() { return mColTexObj; }
111-
static Mtx& getKuroMtx() { return mKuroMtx; }
111+
static GXTexObj* getKuroTexObj() { return &mKuroTexObj; }
112+
static GXTexObj* getColTexObj() { return &mColTexObj; }
113+
static MtxP getKuroMtx() { return mKuroMtx; }
112114

113115
static GXTexObj mKuroTexObj;
114116
static Mtx mKuroMtx;
115117
static GXTexObj mColTexObj;
116118
static Mtx mBallMtx;
117119
static Mtx mFloorMtx;
118120

121+
private:
119122
/* 0x010 */ dMagma_floor_c mFloor[8];
120123
/* 0x590 */ dMagma_room_c mRoom[64];
121124
/* 0x690 */ GXColor mColor1;
122125
/* 0x694 */ f32 mTimer;
123126
};
124127

125-
#endif /* D_MAGMA_H */
128+
#endif /* D_MAGMA_H */

include/dolphin/gx/GXTexture.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ void GXInitTexObjLOD(GXTexObj* obj, GXTexFilter min_filter, GXTexFilter max_filt
1717
f32 max_lod, f32 lod_bias, GXBool bias_clamp, GXBool edge_lod,
1818
GXAnisotropy aniso);
1919
void* GXGetTexObjData(GXTexObj* obj);
20-
u16 GXGetTexObjWidth(GXTexObj* obj);
21-
u16 GXGetTexObjHeight(GXTexObj* obj);
20+
u16 GXGetTexObjWidth(const GXTexObj* obj);
21+
u16 GXGetTexObjHeight(const GXTexObj* obj);
2222
GXTexFmt GXGetTexObjFmt(const GXTexObj* obj);
2323
GXTexWrapMode GXGetTexObjWrapS(GXTexObj* obj);
2424
GXTexWrapMode GXGetTexObjWrapT(GXTexObj* obj);

src/d/actor/d_a_btd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2400,7 +2400,7 @@ static BOOL daBtd_Execute(btd_class* i_this) {
24002400
}
24012401
i_this->m6E88 = 1;
24022402
fVar12 = i_this->m6E80;
2403-
i_this->floor->getPos().y = fVar12;
2403+
i_this->floor->setYpos(fVar12);
24042404
i_this->m6E7C += REG0_F(15) + 30.0f;
24052405
if (i_this->m6E7C > REG0_F(18) + 2300.0f) {
24062406
i_this->m6E7C = REG0_F(18) + 2300.0f;

0 commit comments

Comments
 (0)