1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 06:24:30 +00:00

Fix misc 17 (#1392)

* Some cleanup on bgcheck waterbox y funcs

* Fix some typo/spelling

* EnFz_ApplyDamage match fixup

* Turn another sus construction into a switch

* Fixup comment on restoring MS as adult

* "doesnt, isnt" -> "doesn't, isn't"

* Hunt down whitespace at end of lines

* Format (clang-format does not like figs bug comment on bongo cutscene unskip sadge)

* Viewport z scale/translation: `0x1FF` -> `G_MAXZ/2` (see proman "9.7 Mixing CPU and SP Addresses", "12.7.6 Depth Source")

* static symbols: g -> s prefix

* Link young/old -> child/adult

* Fixups

* Get rid of signed vs unsigned comparison warning by changing room temps to s32

* waterbox search funcs consistency

* Revert "waterbox search funcs consistency"

This reverts commit 8f386e038f.

* `curWaterBox` -> `waterBox`
This commit is contained in:
Dragorn421 2022-10-13 10:06:49 +02:00 committed by GitHub
parent c3dc299448
commit 22b78f169f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 118 additions and 114 deletions

View file

@ -114,10 +114,10 @@ static ColliderQuadInit sQuadInit = {
typedef enum {
/* 00 */ AM_DMGEFF_NONE, // used by anything that cant kill the armos
/* 01 */ AM_DMGEFF_NUT,
/* 06 */ AM_DMGEFF_STUN = 6, // doesnt include deku nuts
/* 06 */ AM_DMGEFF_STUN = 6, // doesn't include deku nuts
/* 13 */ AM_DMGEFF_ICE = 13,
/* 14 */ AM_DMGEFF_MAGIC_FIRE_LIGHT,
/* 15 */ AM_DMGEFF_KILL // any damage source that can kill the armos (and isnt a special case)
/* 15 */ AM_DMGEFF_KILL // any damage source that can kill the armos (and isn't a special case)
} ArmosDamageEffect;
static DamageTable sDamageTable = {
@ -246,7 +246,7 @@ void EnAm_Destroy(Actor* thisx, PlayState* play) {
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
Collider_DestroyCylinder(play, &this->hurtCollider);
Collider_DestroyCylinder(play, &this->blockCollider);
//! @bug Quad collider is not destroyed (though destroy doesnt really do anything anyway)
//! @bug Quad collider is not destroyed (though destroy doesn't really do anything anyway)
}
void EnAm_SpawnEffects(EnAm* this, PlayState* play) {

View file

@ -272,7 +272,7 @@ void EnBom_Update(Actor* thisx, PlayState* play2) {
thisx->shape.rot.z = 0;
} else {
// if a lit stick touches the bomb, set timer to 100
// these bombs never have a timer over 70, so this isnt used
// these bombs never have a timer over 70, so this isn't used
if ((this->timer > 100) && Player_IsBurningStickInRange(play, &thisx->world.pos, 30.0f, 50.0f)) {
this->timer = 100;
}

View file

@ -341,11 +341,11 @@ void EnFz_ApplyDamage(EnFz* this, PlayState* play) {
this->collider1.base.acFlags &= ~AC_HIT;
} else if (this->collider1.base.acFlags & AC_HIT) {
this->collider1.base.acFlags &= ~AC_HIT;
if (this->actor.colChkInfo.damageEffect != 2) {
if (this->actor.colChkInfo.damageEffect == 0xF) {
switch (this->actor.colChkInfo.damageEffect) {
case 0xF:
Actor_ApplyDamage(&this->actor);
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8);
if (this->actor.colChkInfo.health) {
if (this->actor.colChkInfo.health != 0) {
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DAMAGE);
vec.x = this->actor.world.pos.x;
vec.y = this->actor.world.pos.y;
@ -361,16 +361,21 @@ void EnFz_ApplyDamage(EnFz* this, PlayState* play) {
EnFz_Damaged(this, play, &vec, 30, 10.0f);
EnFz_SetupDespawn(this, play);
}
}
} else {
Actor_ApplyDamage(&this->actor);
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8);
if (this->actor.colChkInfo.health == 0) {
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DEAD);
EnFz_SetupMelt(this);
} else {
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DAMAGE);
}
break;
case 2:
Actor_ApplyDamage(&this->actor);
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8);
if (this->actor.colChkInfo.health == 0) {
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DEAD);
EnFz_SetupMelt(this);
} else {
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DAMAGE);
}
break;
default:
break;
}
}
}

View file

@ -451,7 +451,7 @@ void EnHeishi1_Update(Actor* thisx, PlayState* play) {
// sidehops onto the next screen and prevent getting caught.
if (!(player->actor.velocity.y > -3.9f)) {
this->linkDetected = false;
// this 60 unit height check is so the player doesnt get caught when on the upper path
// this 60 unit height check is so the player doesn't get caught when on the upper path
if (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 60.0f) {
func_80078884(NA_SE_SY_FOUND);
// "Discovered!"

View file

@ -18,7 +18,7 @@ typedef struct EnHeishi2 {
/* 0x0260 */ Vec3s unk_260;
/* 0x0266 */ char unk_266[0x06];
/* 0x026C */ Vec3s unk_26C; // padding inbetween these
/* 0x0274 */ Vec3f unk_274;
/* 0x0274 */ Vec3f unk_274;
/* 0x0280 */ Vec3f subCamEye;
/* 0x028C */ Vec3f subCamAt;
/* 0x0298 */ Vec3f subCamAtInit;

View file

@ -3598,7 +3598,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) {
this->cyl1.base.atFlags &= ~AT_ON;
}
if (gSaveContext.entranceIndex != 343 || gSaveContext.sceneLayer != 9) {
if (gSaveContext.entranceIndex != ENTR_SPOT20_0 || gSaveContext.sceneLayer != 9) {
if (this->dustFlags & 1) {
this->dustFlags &= ~1;
func_800287AC(play, &this->frontRightHoof, &dustVel, &dustAcc, EnHorse_RandInt(100) + 200,

View file

@ -579,8 +579,8 @@ s32 EnSkj_CollisionCheck(EnSkj* this, PlayState* play) {
if (!((this->unk_2D3 == 0) || (D_80B01EA0 != 0) || !(this->collider.base.acFlags & AC_HIT))) {
this->collider.base.acFlags &= ~AC_HIT;
if (this->actor.colChkInfo.damageEffect != 0) {
if (this->actor.colChkInfo.damageEffect == 0xF) {
switch (this->actor.colChkInfo.damageEffect) {
case 0xF:
effectPos.x = this->collider.info.bumper.hitPos.x;
effectPos.y = this->collider.info.bumper.hitPos.y;
effectPos.z = this->collider.info.bumper.hitPos.z;
@ -612,11 +612,14 @@ s32 EnSkj_CollisionCheck(EnSkj* this, PlayState* play) {
}
EnSkj_SetupDie(this);
return 1;
}
} else {
this->backflipFlag = 1;
EnSkj_Backflip(this);
return 1;
case 0:
this->backflipFlag = 1;
EnSkj_Backflip(this);
return 1;
default:
break;
}
}
return 0;

View file

@ -506,7 +506,7 @@ void EnZo_Dialog(EnZo* this, PlayState* play) {
this->unk_194.unk_18 = player->actor.world.pos;
if (this->actionFunc == EnZo_Standing) {
// Look down at link if young, look up if old
// Look down at link if child, look up if adult
this->unk_194.unk_14 = !LINK_IS_ADULT ? 10.0f : -10.0f;
} else {
this->unk_194.unk_18.y = this->actor.world.pos.y;

View file

@ -72,9 +72,9 @@ u32 ObjTimeblock_CalculateIsVisible(ObjTimeblock* this) {
if (this->unk_177 == 1) {
return this->unk_174 ^ temp;
} else {
u8 linkIsYoung = (LINK_AGE_IN_YEARS == YEARS_CHILD) ? true : false;
u8 linkIsChild = (LINK_AGE_IN_YEARS == YEARS_CHILD) ? true : false;
return this->unk_174 ^ temp ^ linkIsYoung;
return this->unk_174 ^ temp ^ linkIsChild;
}
}
} else {

View file

@ -346,7 +346,7 @@ void FileSelect_RotateToMain(GameState* thisx) {
}
}
static void (*gConfigModeUpdateFuncs[])(GameState*) = {
static void (*sConfigModeUpdateFuncs[])(GameState*) = {
FileSelect_StartFadeIn, FileSelect_FinishFadeIn,
FileSelect_UpdateMainMenu, FileSelect_SetupCopySource,
FileSelect_SelectCopySource, FileSelect_SetupCopyDest1,
@ -441,7 +441,7 @@ void FileSelect_PulsateCursor(GameState* thisx) {
void FileSelect_ConfigModeUpdate(GameState* thisx) {
FileSelectState* this = (FileSelectState*)thisx;
gConfigModeUpdateFuncs[this->configMode](&this->state);
sConfigModeUpdateFuncs[this->configMode](&this->state);
}
void FileSelect_SetWindowVtx(GameState* thisx) {
@ -1514,7 +1514,7 @@ void FileSelect_LoadGame(GameState* thisx) {
}
}
static void (*gSelectModeUpdateFuncs[])(GameState*) = {
static void (*sSelectModeUpdateFuncs[])(GameState*) = {
FileSelect_FadeMainToSelect, FileSelect_MoveSelectedFileToTop, FileSelect_FadeInFileInfo, FileSelect_ConfirmFile,
FileSelect_FadeOutFileInfo, FileSelect_MoveSelectedFileToSlot, FileSelect_FadeOut, FileSelect_LoadGame,
};
@ -1522,7 +1522,7 @@ static void (*gSelectModeUpdateFuncs[])(GameState*) = {
void FileSelect_SelectModeUpdate(GameState* thisx) {
FileSelectState* this = (FileSelectState*)thisx;
gSelectModeUpdateFuncs[this->selectMode](&this->state);
sSelectModeUpdateFuncs[this->selectMode](&this->state);
}
void FileSelect_SelectModeDraw(GameState* thisx) {
@ -1577,13 +1577,13 @@ void FileSelect_SelectModeDraw(GameState* thisx) {
CLOSE_DISPS(this->state.gfxCtx, "../z_file_choose.c", 2834);
}
static void (*gFileSelectDrawFuncs[])(GameState*) = {
static void (*sFileSelectDrawFuncs[])(GameState*) = {
FileSelect_InitModeDraw,
FileSelect_ConfigModeDraw,
FileSelect_SelectModeDraw,
};
static void (*gFileSelectUpdateFuncs[])(GameState*) = {
static void (*sFileSelectUpdateFuncs[])(GameState*) = {
FileSelect_InitModeUpdate,
FileSelect_ConfigModeUpdate,
FileSelect_SelectModeUpdate,
@ -1670,8 +1670,8 @@ void FileSelect_Main(GameState* thisx) {
this->emptyFileTextAlpha = 0;
FileSelect_PulsateCursor(&this->state);
gFileSelectUpdateFuncs[this->menuMode](&this->state);
gFileSelectDrawFuncs[this->menuMode](&this->state);
sFileSelectUpdateFuncs[this->menuMode](&this->state);
sFileSelectDrawFuncs[this->menuMode](&this->state);
// do not draw controls text in the options menu
if ((this->configMode <= CM_NAME_ENTRY_TO_MAIN) || (this->configMode >= CM_UNUSED_DELAY)) {

View file

@ -734,7 +734,7 @@ typedef struct {
/* 0x12 */ u16 height;
} OptionsMenuTextureInfo; // size = 0x14
static OptionsMenuTextureInfo gOptionsMenuHeaders[] = {
static OptionsMenuTextureInfo sOptionsMenuHeaders[] = {
{
{ gFileSelOptionsENGTex, gFileSelOptionsGERTex, gFileSelOptionsENGTex },
{ 128, 128, 128 },
@ -757,7 +757,7 @@ static OptionsMenuTextureInfo gOptionsMenuHeaders[] = {
},
};
static OptionsMenuTextureInfo gOptionsMenuSettings[] = {
static OptionsMenuTextureInfo sOptionsMenuSettings[] = {
{
{ gFileSelStereoENGTex, gFileSelStereoENGTex, gFileSelStereoFRATex },
{ 48, 48, 48 },
@ -890,9 +890,9 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) {
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
for (i = 0, vtx = 0; i < 4; i++, vtx += 4) {
gDPLoadTextureBlock(POLY_OPA_DISP++, gOptionsMenuHeaders[i].texture[gSaveContext.language], G_IM_FMT_IA,
G_IM_SIZ_8b, gOptionsMenuHeaders[i].width[gSaveContext.language],
gOptionsMenuHeaders[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
gDPLoadTextureBlock(POLY_OPA_DISP++, sOptionsMenuHeaders[i].texture[gSaveContext.language], G_IM_FMT_IA,
G_IM_SIZ_8b, sOptionsMenuHeaders[i].width[gSaveContext.language],
sOptionsMenuHeaders[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0);
}
@ -919,9 +919,9 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) {
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
}
gDPLoadTextureBlock(POLY_OPA_DISP++, gOptionsMenuSettings[i].texture[gSaveContext.language], G_IM_FMT_IA,
G_IM_SIZ_8b, gOptionsMenuSettings[i].width[gSaveContext.language],
gOptionsMenuHeaders[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
gDPLoadTextureBlock(POLY_OPA_DISP++, sOptionsMenuSettings[i].texture[gSaveContext.language], G_IM_FMT_IA,
G_IM_SIZ_8b, sOptionsMenuSettings[i].width[gSaveContext.language],
sOptionsMenuHeaders[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0);
}
@ -943,9 +943,9 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) {
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
}
gDPLoadTextureBlock(POLY_OPA_DISP++, gOptionsMenuSettings[i].texture[gSaveContext.language], G_IM_FMT_IA,
G_IM_SIZ_8b, gOptionsMenuSettings[i].width[gSaveContext.language],
gOptionsMenuHeaders[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
gDPLoadTextureBlock(POLY_OPA_DISP++, sOptionsMenuSettings[i].texture[gSaveContext.language], G_IM_FMT_IA,
G_IM_SIZ_8b, sOptionsMenuSettings[i].width[gSaveContext.language],
sOptionsMenuHeaders[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0);
}