mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-06 14:20:11 +00:00
z_bgcheck.c, 800430A0.c, 80043480.c (#256)
* beginning of migrating changes * got matching * changed order a bit * clean up bgcheck * fix conflict * fix conflict again * first stab at identifying types, some oks * Clean up most bad structs/pointer math, move relevant structs to z64bgcheck.h, get some OKs * more OKs, z_bgcheck.bss migration, update some sys_math3d.c args * couple more OKs * pushing some OKs * fix compilation issues * code_800430A0.c OK, more files decomp'd * 8003A3E0 big OK :) * Decomp most of func_8003C614, decomp helper funcs * Decomp SurfaceType, CamData, and WaterBox property related functions * more OKs, big OK in 8003C078 * more OKs, more progress, move a function definition in z_collision_check to functions.h * more clean-ups, more OKs, dyn_vtx is now defined as u8* * 8003A5B8, 8003A7D8, 8003C614, 8003DD6C OK, document function args better * data migrated, more OKs * 80041240 OK, func_8003B3C8 and func_8003BB18 disassembled * func_80040284, 800409A8 non_matching, add IS_ZERO macro * All asm files have C representations, some big OKs, lots of minor tweaks * More OKs, non-matching code cleanup * 8003FBF4 and 80040BE4 OK, improve codegen for most functions * format z_bgcheck.c * fix warnings, compile errors on NON_MATCHING * func_8003EE80 is now NON_MATCHING * begin documenting some functions * formatting * more documentation, func_8003A95C OK * fix PHYSICAL_TO_VIRTUAL changes * fix var rename * More documentation, functions 80040E40, 80041648 OK, change types to not be compatible with ZAP * func_8004239C ok, more NON_MATCHING improvements, more documentation * Implement most suggested changes * Convert comments to slower comments * /** * Implement ZAP2 changes * my anti-virus ate my format.sh results * Rename a couple hundred functions, fix minor stuff * rename var so that clang formats correctly * run format.sh * implement Petrie's matches/suggestions * format * matches * and the asm * slight error * Add SSList * two more matches * stuff * implement code changes * clean up Petrie's matchings Co-authored-by: Arthur <arthurtilly413@gmail.com> Co-authored-by: fig02 <fig02srl@gmail.com> Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
This commit is contained in:
parent
209f0d21b8
commit
3cef03f5ff
416 changed files with 6610 additions and 13487 deletions
|
@ -67,7 +67,7 @@ void EffectSsBubble_Update(GlobalContext* globalCtx, u32 index, EffectSs* this)
|
|||
waterSurfaceY = this->pos.y;
|
||||
|
||||
// kill bubble if its out of range of a water box
|
||||
if (!func_8004213C(globalCtx, &globalCtx->colCtx, this->pos.x, this->pos.z, &waterSurfaceY, &waterBox)) {
|
||||
if (!WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->pos.x, this->pos.z, &waterSurfaceY, &waterBox)) {
|
||||
this->life = -1;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -72,12 +72,12 @@ void EffectSsDeadDs_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
|||
sp44.y = pos.y - this->velocity.y;
|
||||
sp44.z = pos.z - this->velocity.z;
|
||||
|
||||
if (func_8003D464(&globalCtx->colCtx, &this->pos, &pos, &sp44, 1.5f, &floorPoly, 1.0f)) {
|
||||
if (BgCheck_EntitySphVsWall1(&globalCtx->colCtx, &this->pos, &pos, &sp44, 1.5f, &floorPoly, 1.0f)) {
|
||||
func_80038A28(floorPoly, this->pos.x, this->pos.y, this->pos.z, &mf);
|
||||
Matrix_Put(&mf);
|
||||
} else {
|
||||
pos.y++;
|
||||
temp = func_8003C890(&globalCtx->colCtx, &floorPoly, &pos);
|
||||
temp = BgCheck_EntityRaycastFloor1(&globalCtx->colCtx, &floorPoly, &pos);
|
||||
|
||||
if (floorPoly != NULL) {
|
||||
func_80038A28(floorPoly, this->pos.x, temp + 1.5f, this->pos.z, &mf);
|
||||
|
|
|
@ -56,7 +56,7 @@ u32 EffectSsGRipple_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, vo
|
|||
this->rEnvColorG = 255;
|
||||
this->rEnvColorB = 255;
|
||||
this->rEnvColorA = 255;
|
||||
this->rWaterBoxNum = func_8004239C(globalCtx, &globalCtx->colCtx, &initParams->pos, 3.0f, &waterBox);
|
||||
this->rWaterBoxNum = WaterBox_GetSurface2(globalCtx, &globalCtx->colCtx, &initParams->pos, 3.0f, &waterBox);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -77,8 +77,8 @@ void EffectSsGRipple_DrawRipple(GlobalContext* globalCtx, EffectSs* this, UNK_PT
|
|||
|
||||
radius = this->rRadius * 0.0025f;
|
||||
|
||||
if ((this->rWaterBoxNum != -1) && (this->rWaterBoxNum < globalCtx->colCtx.stat.colHeader->nbWaterBoxes)) {
|
||||
yPos = (this->rWaterBoxNum + globalCtx->colCtx.stat.colHeader->waterBoxes)->ySurface;
|
||||
if ((this->rWaterBoxNum != -1) && (this->rWaterBoxNum < globalCtx->colCtx.colHeader->nbWaterBoxes)) {
|
||||
yPos = (this->rWaterBoxNum + globalCtx->colCtx.colHeader->waterBoxes)->ySurface;
|
||||
} else {
|
||||
yPos = this->pos.y;
|
||||
}
|
||||
|
|
|
@ -373,7 +373,7 @@ void func_809AA230(EffectSs* this, GlobalContext* globalCtx) {
|
|||
break;
|
||||
case 1:
|
||||
if (this->velocity.y < 0.0f) {
|
||||
if (func_8003E30C(&globalCtx->colCtx, &this->pos, D_809AA5B0[(this->rReg4 >> 2) & 3])) {
|
||||
if (BgCheck_SphVsFirstPoly(&globalCtx->colCtx, &this->pos, D_809AA5B0[(this->rReg4 >> 2) & 3])) {
|
||||
this->velocity.x *= func_809A9818(0.9f, 0.2f);
|
||||
this->velocity.y *= -0.8f;
|
||||
this->velocity.z *= func_809A9818(0.9f, 0.2f);
|
||||
|
@ -385,7 +385,7 @@ void func_809AA230(EffectSs* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
break;
|
||||
case 2:
|
||||
if (func_8003E30C(&globalCtx->colCtx, &this->pos, D_809AA5B0[(this->rReg4 >> 2) & 3])) {}
|
||||
if (BgCheck_SphVsFirstPoly(&globalCtx->colCtx, &this->pos, D_809AA5B0[(this->rReg4 >> 2) & 3])) {}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ void EffectSsSolderSrchBall_Update(GlobalContext* globalCtx, u32 index, EffectSs
|
|||
playerPosDiffY = player->actor.posRot.pos.y - this->pos.y;
|
||||
playerPosDiffZ = player->actor.posRot.pos.z - this->pos.z;
|
||||
|
||||
if (!func_8003E30C(&globalCtx->colCtx, &this->pos, 30.0f)) {
|
||||
if (!BgCheck_SphVsFirstPoly(&globalCtx->colCtx, &this->pos, 30.0f)) {
|
||||
if (sqrtf(SQ(playerPosDiffX) + SQ(playerPosDiffY) + SQ(playerPosDiffZ)) < 70.0f) {
|
||||
*linkDetected = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue