diff --git a/include/d/d_2dnumber.h b/include/d/d_2dnumber.h index 031e52deb..9e5c4e7bd 100644 --- a/include/d/d_2dnumber.h +++ b/include/d/d_2dnumber.h @@ -97,6 +97,13 @@ public: void outFontStickAnimePiece(u8, u8); void move(); void setAlpha(u8); + + /* 0x00 */ u8 m00[0x08 - 0x00]; + /* 0x08 */ J2DPane* m08[3]; + /* 0x14 */ J2DPane* m14; + /* 0x18 */ J2DPane* m18; + /* 0x1C */ u8 m1C[0x20 - 0x1C]; + /* 0x20 */ JUTFont* m20; }; #endif /* D_2DNUMBER_H */ diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index e7ec84129..67d3ed3cd 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -480,7 +480,7 @@ fpc_ProcID fopAcM_createChild(s16 procName, fpc_ProcID parentPId, u32 parameters createFunc p_createFunc = NULL); fpc_ProcID fopAcM_createChild(char* pProcNameString, fpc_ProcID parentPcId, u32 parameter, cXyz* pPos, - int roomNo, csXyz* pAngle, cXyz* pScale, createFunc createFunc); + int roomNo, csXyz* pAngle, cXyz* pScale = NULL, createFunc createFunc = NULL); fpc_ProcID fopAcM_createChildFromOffset(s16 procName, fpc_ProcID parentProcID, u32 actorParams, cXyz* p_pos, int roomNo, csXyz* p_angle, diff --git a/src/d/actor/d_a_branch.cpp b/src/d/actor/d_a_branch.cpp index 85feaeb4e..2e603296b 100644 --- a/src/d/actor/d_a_branch.cpp +++ b/src/d/actor/d_a_branch.cpp @@ -11,7 +11,6 @@ #include "m_Do/m_Do_mtx.h" #include "d/d_kankyo.h" #include "JSystem/J3DGraphBase/J3DMaterial.h" -#include "dolphin/mtx/mtx.h" static u16 anim_table[] = { KWOOD_00_BCK_SWING02, KWOOD_00_BAS_SWING02, diff --git a/src/d/actor/d_a_npc_ji1.cpp b/src/d/actor/d_a_npc_ji1.cpp index e797081d6..a1393e993 100644 --- a/src/d/actor/d_a_npc_ji1.cpp +++ b/src/d/actor/d_a_npc_ji1.cpp @@ -3283,7 +3283,7 @@ BOOL daNpc_Ji1_c::CreateInit() { cXyz temp(190.0f, 230.0f, -1100.0f); csXyz temp2(0, 0, 0); - fopAcM_createChild("Kmon", fopAcM_GetID(this), 0, &temp, fopAcM_GetRoomNo(this), &temp2, 0, (createFunc)0); + fopAcM_createChild("Kmon", fopAcM_GetID(this), 0, &temp, fopAcM_GetRoomNo(this), &temp2); fopAcM_SetMtx(this, field_0x330->getModel()->getBaseTRMtx()); fopAcM_setCullSizeBox(this, -70.0f, 0.0f, -70.0f, 70.0f, 200.0f, 70.0f); gravity = -30.0f; diff --git a/src/d/d_2dnumber.cpp b/src/d/d_2dnumber.cpp index 1af74917c..fa2b0b7e0 100644 --- a/src/d/d_2dnumber.cpp +++ b/src/d/d_2dnumber.cpp @@ -17,7 +17,7 @@ dDlst_2DNumber_c::~dDlst_2DNumber_c() { } /* 800C8510-800C8644 .text init__16dDlst_2DNumber_cFissssUc */ -bool dDlst_2DNumber_c::init(int digitNum, s16 x, s16 y, s16 w, s16 h, u8 flag) { /* Nonmatching */ +bool dDlst_2DNumber_c::init(int digitNum, s16 x, s16 y, s16 w, s16 h, u8 flag) { mDigitNum = digitNum; mFlag = flag; mWidth = w; @@ -159,28 +159,25 @@ bool dDlst_2DBattery_c::init(ResTIMG* rule, ResTIMG* battery, ResTIMG* batteryBa /* 800C8FAC-800C90F0 .text setRotate__17dDlst_2DBattery_cFf */ void dDlst_2DBattery_c::setRotate(f32 rot) { - /* Nonmatching */ - // calculate the angle text - int angle = ((rot - 22.5f) / 22.5f) * 35.0f + 15.0f + 0.5f; + f32 angle = ((rot - 22.5f) / 22.5f) * 35.0f + 15.0f; char buf[16]; - sprintf(buf, "rupy_num_%02d.bti", angle / 10); + sprintf(buf, "rupy_num_%02d.bti", (int)(angle + 0.5f) / 10); mNum[2][0]->changeTexture(buf, 0); mNum[2][1]->changeTexture(buf, 0); - sprintf(buf, "rupy_num_%02d.bti", angle % 10); + sprintf(buf, "rupy_num_%02d.bti", (int)(angle + 0.5f) % 10); mNum[1][0]->changeTexture(buf, 0); mNum[1][1]->changeTexture(buf, 0); // calculate the visual angle - f32 deg; if (rot < 20.0f) { - deg = 345.0f; + rot = 345.0f; } else if (rot > 45.0f) { - deg = 310.0f; + rot = 310.0f; } else { - deg = 360.0f - ((rot - 20.0f) * 1.4f + 15.0f); + rot = 360.0f - ((rot - 20.0f) * 1.4f + 15.0f); } - mRotation = deg; + mRotation = rot; } /* 800C90F0-800C9348 .text draw__17dDlst_2DBattery_cFv */ @@ -252,13 +249,15 @@ void dDlst_2DOutFont_c::setPaneEx(JUTFont*, fopMsgM_pane_class*, fopMsgM_pane_cl } /* 800C9844-800C9854 .text setRuby__17dDlst_2DOutFont_cFP7JUTFontP18fopMsgM_pane_class */ -void dDlst_2DOutFont_c::setRuby(JUTFont*, fopMsgM_pane_class*) { - /* Nonmatching */ +void dDlst_2DOutFont_c::setRuby(JUTFont* font, fopMsgM_pane_class* pane) { + m20 = font; + m18 = pane->pane; } /* 800C9854-800C9864 .text setRubyEx__17dDlst_2DOutFont_cFP7JUTFontP18fopMsgM_pane_classPc */ -void dDlst_2DOutFont_c::setRubyEx(JUTFont*, fopMsgM_pane_class*, char*) { - /* Nonmatching */ +void dDlst_2DOutFont_c::setRubyEx(JUTFont* font, fopMsgM_pane_class* pane, char*) { + m20 = font; + m18 = pane->pane; } /* 800C9864-800C9908 .text charWidth__17dDlst_2DOutFont_cFi */ @@ -307,6 +306,13 @@ void dDlst_2DOutFont_c::move() { } /* 800CB474-800CB4B0 .text setAlpha__17dDlst_2DOutFont_cFUc */ -void dDlst_2DOutFont_c::setAlpha(u8) { - /* Nonmatching */ +void dDlst_2DOutFont_c::setAlpha(u8 alpha) { + for (int i = 0; i < ARRAY_SIZE(m08); i++) { + if (m08[i] != NULL) { + m08[i]->setAlpha(alpha); + } + } + if (m14 != NULL) { + m14->setAlpha(alpha); + } } diff --git a/src/d/d_meter.cpp b/src/d/d_meter.cpp index 80ff26a8d..af16a8c1b 100644 --- a/src/d/d_meter.cpp +++ b/src/d/d_meter.cpp @@ -901,9 +901,10 @@ void dMeter_parentPaneTrans(fopMsgM_pane_class* pane, f32 scale) { /* 801F08DC-801F09D8 .text dMeter_childPaneTrans__FP18fopMsgM_pane_classP18fopMsgM_pane_classf */ void dMeter_childPaneTrans(fopMsgM_pane_class* pane, fopMsgM_pane_class* parent, f32 scale) { - /* Nonmatching */ - pane->mPosCenter.x += (pane->mPosCenterOrig.x - parent->mPosCenterOrig.x) * (scale - 1.0f); - pane->mPosCenter.y += (pane->mPosCenterOrig.y - parent->mPosCenterOrig.y) * (scale - 1.0f); + f32 x = pane->mPosCenterOrig.x - parent->mPosCenterOrig.x; + f32 y = pane->mPosCenterOrig.y - parent->mPosCenterOrig.y; + pane->mPosCenter.x += x * (scale - 1.0f); + pane->mPosCenter.y += y * (scale - 1.0f); pane->mPosCenter.x += g_meterHIO.field_0x50; pane->mPosCenter.y += g_meterHIO.field_0x52; fopMsgM_paneScaleXY(pane, scale);