d_a_obj_dmelevator fully matching#2404
d_a_obj_dmelevator fully matching#2404hatal175 merged 5 commits intozeldaret:mainfrom TheHood-AI:main
Conversation
Logic in functions should all be matching, data is not matching
Report for GZ2E01 (9194774 - 2b81705)📈 Matched code: 57.20% (+0.36%, +41600 bytes) ✅ |
d_a_obj_dmelevator matching
Should make the code a bit more readable
hatal175
left a comment
There was a problem hiding this comment.
Overall pretty good. Mostly just cosmetics and calls to various wrapper functions that should be the same as debug rom (unless they make you not match)
include/d/actor/d_a_obj_dmelevator.h
Outdated
| /* 80BDDD38 */ void initBaseMtx(); | ||
| /* 80BDDD90 */ void setBaseMtx(); | ||
| /* 80BDDEFC */ int Create(); | ||
| /* 80BDDEFC */ virtual int Create() /*override*/; |
There was a problem hiding this comment.
While I am a fan of the override keyword in c++11, I don't think we need the comment here (just not in our code standards).
src/d/actor/d_a_obj_dmelevator.cpp
Outdated
| UNK_BSS(1014); | ||
| UNK_BSS(1012); | ||
| UNK_BSS(1010); | ||
| UNK_BSS(1009); |
There was a problem hiding this comment.
Use UNK_REL_BSS instead of this block
src/d/actor/d_a_obj_dmelevator.cpp
Outdated
|
|
||
| cXyz local_2c = param_2->current.pos - pthis->mXyz; | ||
| mDoMtx_YrotS(mDoMtx_stack_c::now, -param_1->current.angle.y); | ||
| PSMTXMultVec(mDoMtx_stack_c::now, &local_2c, &local_2c); |
There was a problem hiding this comment.
This is
mDoMtx_stack_c::YrotS
mDoMtx_stack_c::multVec
(See debug rom)
src/d/actor/d_a_obj_dmelevator.cpp
Outdated
| if (l_push_check_pos0[2].x >= local_2c.x) { | ||
| if (l_push_check_pos0[0].z <= local_2c.z) { | ||
| if (l_push_check_pos0[2].z >= local_2c.z) { | ||
| if ((pdVar1->checkEquipHeavyBoots()) != 0) { |
There was a problem hiding this comment.
Unless needed for match, we usually leave functions like check* and is* without the != 0 or with ! instead of ==0
src/d/actor/d_a_obj_dmelevator.cpp
Outdated
| J3DModel* pmodel = j3dSys.getModel(); | ||
| daObjDmElevator_c* puser_area = (daObjDmElevator_c*)pmodel->mUserArea; | ||
|
|
||
| PSMTXCopy(pmodel->mMtxBuffer->getAnmMtx(jnt_no), mDoMtx_stack_c::now); |
There was a problem hiding this comment.
cMtx_copy, mDoMtx_stack_c::get()
src/d/actor/d_a_obj_dmelevator.cpp
Outdated
| // NONMATCHING | ||
| if (eventInfo.mCommand == 2) { | ||
| mAction = 2; | ||
| field_0x5dc = dComIfGp_getEventManager().getMyStaffId(l_staffName, NULL, 0); |
There was a problem hiding this comment.
dComIfGp_evmng_getMyStaffId
src/d/actor/d_a_obj_dmelevator.cpp
Outdated
| void daObjDmElevator_c::actionEvent() { | ||
| // NONMATCHING | ||
| dEvent_manager_c& evt_manager = dComIfGp_getEventManager(); | ||
| if (evt_manager.endCheck(mEventIndex) != 0) { |
src/d/actor/d_a_obj_dmelevator.cpp
Outdated
| /* 80BDF068-80BDF0A0 0017E8 0038+00 1/0 0/0 0/0 .text actionStartEvent__17daObjDmElevator_cFv */ | ||
| void daObjDmElevator_c::actionStartEvent() { | ||
| // NONMATCHING | ||
| if ((actor_status & 0x1000) != 0) { |
src/d/actor/d_a_obj_dmelevator.cpp
Outdated
|
|
||
| /* 80BDF818-80BDF844 001F98 002C+00 1/0 0/0 0/0 .text | ||
| * daObjDmElevator_MoveBGDraw__FP17daObjDmElevator_c */ | ||
| static void daObjDmElevator_MoveBGDraw(daObjDmElevator_c* i_this) { |
There was a problem hiding this comment.
return type should be int and should return the inside call
src/d/actor/d_a_obj_dmelevator.cpp
Outdated
|
|
||
| /* 80BDF7F8-80BDF818 001F78 0020+00 1/0 0/0 0/0 .text | ||
| * daObjDmElevator_MoveBGExecute__FP17daObjDmElevator_c */ | ||
| static void daObjDmElevator_MoveBGExecute(daObjDmElevator_c* i_this) { |
There was a problem hiding this comment.
return type should be int and should return the inside call
This should address the feedback from the pull request review
|
Thanks @hatal175 for the feedback! Should have addressed it now. I'm not too familliar with the github workflow, so I don't know if I'm the one that resolved the conversations, or you do it? |
|
When you submit changes that address PR comments, those comments will be marked as automatically resolved. |
Logic in functions should all be matching, data is not matching
Edit: The file should now be fully matching, thanks to the help of @ItsNiklas