Enemy/hanasambo: match 73 of the TU's 95 functions from the map - #179
gitRasheed wants to merge 16 commits into
Conversation
2d59caf to
7593d04
Compare
Report for GMSJ01 (748cea4 - e782f4d)📈 Matched code: 41.88% (+0.33%, +11676 bytes) ✅ 79 new matches
...and 49 more new matches 📈 23 improvements in unmatched items
Report for GMSP01 (748cea4 - e782f4d)📈 Matched code: 41.04% (+0.32%, +11476 bytes) ✅ 78 new matches
...and 48 more new matches 📈 25 improvements in unmatched items
|
Mrkol
left a comment
There was a problem hiding this comment.
What about the rest of the functions in the TU?
| TMapObjBase* obj = TMapObjBaseManager::newAndRegisterObj( | ||
| "coin", JGeometry::TVec3<f32>(0.0f, 0.0f, 0.0f), | ||
| JGeometry::TVec3<f32>(0.0f, 0.0f, 0.0f), | ||
| JGeometry::TVec3<f32>(1.0f, 1.0f, 1.0f)); |
There was a problem hiding this comment.
these SRT args are defaulted so you don't have to specify them
| u32 id = MSD_SE_OBJ_FLOWER_OPEN_0 + unk164->unk0; | ||
| if (gpMSound->gateCheck(id)) | ||
| MSoundSESystem::MSoundSE::startSoundActor(id, &mPosition, 0, | ||
| nullptr, 0, 4); |
There was a problem hiding this comment.
always use SMSGetMSound()->startSoundActor
| actor->getModel()->lock(); | ||
| } | ||
|
|
||
| // TODO: frame 8 bytes short of the original around the sound block. |
There was a problem hiding this comment.
Lets not leave these clanker comments about missing stack everywhere -- missing stack is all over the codebase and changes all the time. The numbers specified in these comments will constantly go out of date so it will poison clanker thoughts with out-of-date info rather than provide useful context
|
|
||
| void TSamboFlower::hide() { } | ||
|
|
||
| // TODO: default values are placeholders; names and offsets are from the object. |
There was a problem hiding this comment.
huh? just use the actual default values
|
|
||
| JPABaseEmitter* emitter; | ||
| if (mSpine->getCurrentNerve() == &TNerveHanaSamboWait::theNerve()) { | ||
| emitter = gpMarioParticleManager->emit(0xB2, &pos, 0, nullptr); |
There was a problem hiding this comment.
7593d04 to
f3df623
Compare
…ining stubs Existing inlines everywhere the review asked (sound, defaults omitted, named particles, >>), the two params ctors carry the defaults the manager loads store, and the eighteen stub bodies are written from the target; nine of the UNUSED helpers land at the map's size.
|
every functio should have a body now, pulled the real param defaults out of the manager loads, and dropped 4 unused bodies that had the Kumokun problem where the sizes didn't match the map so made them stubs |
| { | ||
| if (param_2 == HIT_MESSAGE_SPRAYED_BY_WATER) { | ||
| if (!unk150) { | ||
| unk150 = true; |
There was a problem hiding this comment.
This is TSamboFlower::bloom but inlined. Look for other such cases where functions from this TU got inlined into other functions.
| nullptr); | ||
| mMActor->setBck("flower_hit"); | ||
| if (unk160 && unk164) { | ||
| *unk164 = *unk164 - 1; |
There was a problem hiding this comment.
Wouldn't *unk164 -= 1; work?
|
|
||
| TSpineEnemy* THanaSamboManager::createEnemyInstance() | ||
| { | ||
| return new THanaSambo("ハナサンボ"); |
There was a problem hiding this comment.
From my experience they almost always used defaulted argument for the "usual" names of these actor classes -- lets use that everywhere. I.e. this is just the class name spelled out in japanese, so it's probably the default name with room left for "overriding" the name in the caller
| ++i) { } | ||
| } | ||
|
|
||
| unk194 = new THanaSamboHead(); |
There was a problem hiding this comment.
no need to write () for no-arg constructor call, this ain't java
…lined by hand checkHit, generate and setCrashAnm get their bodies; each compiles to its mario.MAP size.
…LHideDist The map puts MtxCalcTypeName in this TU. The Hide nerve pushes Appear on the 0x2FC distance and the Wait nerve pushes Hide on 0x310, so 0x2FC is the appear distance.
It is weak in both maps, and the PAL map emits it from this TU.
Sambo, its head and the flower are reconstructed from the map and the object, with the two sound includes that place the static initializer. Every function has a body, the params ctors carry the defaults the manager loads store, and the ones still short are frame gaps.