mirror of
https://github.com/zeldaret/oot.git
synced 2025-02-13 08:54:32 +00:00
Fix misc 18 (#1423)
* two more ABS * fixup item_name_static texs outnames * fixup CollisionCheck_SetOCvsOC docs * Cleanup int comments alignments * collsion -> collision * `SQ*` macros fixup * use `LERP` more * static -> `s` prefix * grammar: dont -> don't * 3
This commit is contained in:
parent
efe485f017
commit
abb4201e57
20 changed files with 93 additions and 101 deletions
|
@ -12,7 +12,7 @@
|
|||
<Texture Name="gBombchuItemNameENGTex" OutName="bombchu_item_name_eng" Format="ia4" Width="128" Height="16" Offset="0x2400"/>
|
||||
<Texture Name="gHookshotItemNameENGTex" OutName="hookshot_item_name_eng" Format="ia4" Width="128" Height="16" Offset="0x2800"/>
|
||||
<Texture Name="gLongshotItemNameENGTex" OutName="longshot_item_name_eng" Format="ia4" Width="128" Height="16" Offset="0x2C00"/>
|
||||
<Texture Name="gIceArrowItemNameENGTex" OutName="icearrow_item_name_eng" Format="ia4" Width="128" Height="16" Offset="0x3000"/>
|
||||
<Texture Name="gIceArrowItemNameENGTex" OutName="ice_arrow_item_name_eng" Format="ia4" Width="128" Height="16" Offset="0x3000"/>
|
||||
<Texture Name="gFaroresWindItemNameENGTex" OutName="farores_wind_item_name_eng" Format="ia4" Width="128" Height="16" Offset="0x3400"/>
|
||||
<Texture Name="gBoomerangItemNameENGTex" OutName="boomerang_item_name_eng" Format="ia4" Width="128" Height="16" Offset="0x3800"/>
|
||||
<Texture Name="gLensItemNameENGTex" OutName="lens_item_name_eng" Format="ia4" Width="128" Height="16" Offset="0x3C00"/>
|
||||
|
@ -124,7 +124,7 @@
|
|||
<Texture Name="gUnusedBossKeyItemName7JPNTex" OutName="boss_key_item_name_unused_jpn_7" Format="ia4" Width="128" Height="16" Offset="0x1E400"/>
|
||||
<Texture Name="gBiggoronsSwordItemNameENGTex" OutName="biggorons_sword_item_name_eng" Format="ia4" Width="128" Height="16" Offset="0x1E800"/>
|
||||
<Texture Name="gDekuStickItemNameGERTex" OutName="deku_stick_item_name_ger" Format="ia4" Width="128" Height="16" Offset="0x1EC00"/>
|
||||
<Texture Name="gDekuNutItemNameGERTex" OutName="dekunut_item_name_ger" Format="ia4" Width="128" Height="16" Offset="0x1F000"/>
|
||||
<Texture Name="gDekuNutItemNameGERTex" OutName="deku_nut_item_name_ger" Format="ia4" Width="128" Height="16" Offset="0x1F000"/>
|
||||
<Texture Name="gBombItemNameItemNameGERTex" OutName="bomb_item_name_item_name_ger" Format="ia4" Width="128" Height="16" Offset="0x1F400"/>
|
||||
<Texture Name="gFairyBowItemNameGERTex" OutName="fairy_bow_item_name_ger" Format="ia4" Width="128" Height="16" Offset="0x1F800"/>
|
||||
<Texture Name="gFireArrowItemNameUnk2GERTex" OutName="fire_arrow_item_name_unk2_ger" Format="ia4" Width="128" Height="16" Offset="0x1FC00"/>
|
||||
|
@ -135,7 +135,7 @@
|
|||
<Texture Name="gBombchuItemNameGERTex" OutName="bombchu_item_name_ger" Format="ia4" Width="128" Height="16" Offset="0x21000"/>
|
||||
<Texture Name="gHookshotItemNameGERTex" OutName="hookshot_item_name_ger" Format="ia4" Width="128" Height="16" Offset="0x21400"/>
|
||||
<Texture Name="gLongshotItemNameGERTex" OutName="longshot_item_name_ger" Format="ia4" Width="128" Height="16" Offset="0x21800"/>
|
||||
<Texture Name="gIceArrowItemNameGERTex" OutName="icearrow_item_name_ger" Format="ia4" Width="128" Height="16" Offset="0x21C00"/>
|
||||
<Texture Name="gIceArrowItemNameGERTex" OutName="ice_arrow_item_name_ger" Format="ia4" Width="128" Height="16" Offset="0x21C00"/>
|
||||
<Texture Name="gFaroresWindItemNameGERTex" OutName="farores_wind_item_name_ger" Format="ia4" Width="128" Height="16" Offset="0x22000"/>
|
||||
<Texture Name="gBoomerangItemNameGERTex" OutName="boomerang_item_name_ger" Format="ia4" Width="128" Height="16" Offset="0x22400"/>
|
||||
<Texture Name="gLensItemNameGERTex" OutName="lens_item_name_ger" Format="ia4" Width="128" Height="16" Offset="0x22800"/>
|
||||
|
|
|
@ -111,9 +111,9 @@ typedef VecSphGeo VecGeo;
|
|||
#define BINANG_TO_RAD_ALT2(binang) (((f32)(binang) * M_PI) / 0x8000)
|
||||
|
||||
// Vector macros
|
||||
#define SQXZ(vec) ((vec.x) * (vec.x) + (vec.z) * (vec.z))
|
||||
#define DOTXZ(vec1, vec2) ((vec1.x) * (vec2.x) + (vec1.z) * (vec2.z))
|
||||
#define SQXYZ(vec) ((vec.x) * (vec.x) + (vec.y) * (vec.y) + (vec.z) * (vec.z))
|
||||
#define DOTXYZ(vec1, vec2) ((vec1.x) * (vec2.x) + (vec1.y) * (vec2.y) + (vec1.z) * (vec2.z))
|
||||
#define SQXZ(vec) ((vec).x * (vec).x + (vec).z * (vec).z)
|
||||
#define DOTXZ(vec1, vec2) ((vec1).x * (vec2).x + (vec1).z * (vec2).z)
|
||||
#define SQXYZ(vec) ((vec).x * (vec).x + (vec).y * (vec).y + (vec).z * (vec).z)
|
||||
#define DOTXYZ(vec1, vec2) ((vec1).x * (vec2).x + (vec1).y * (vec2).y + (vec1).z * (vec2).z)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -816,10 +816,10 @@ Vec3f* Camera_BGCheckCorner(Vec3f* dst, Vec3f* linePointA, Vec3f* linePointB, Ca
|
|||
}
|
||||
|
||||
/**
|
||||
* Checks collision between at and eyeNext, if `checkEye` is set, if there is no collsion between
|
||||
* Checks collision between at and eyeNext, if `checkEye` is set, if there is no collision between
|
||||
* eyeNext->at, then eye->at is also checked.
|
||||
* Returns:
|
||||
* 0 if no collsion is found between at->eyeNext
|
||||
* 0 if no collision is found between at->eyeNext
|
||||
* 2 if the angle between the polys is between 60 degrees and 120 degrees
|
||||
* 3 ?
|
||||
* 6 if the angle between the polys is greater than 120 degrees
|
||||
|
@ -2531,7 +2531,7 @@ s32 Camera_Jump2(Camera* camera) {
|
|||
Camera_AddVecGeoToVec3f(&camBgChk.pos, at, &bgChkPara);
|
||||
if (Camera_BGCheckInfo(camera, at, &camBgChk)) {
|
||||
// Collision found between parallel at->eyeNext, set eye position to
|
||||
// first collsion point.
|
||||
// first collision point.
|
||||
*eye = bgChkPos;
|
||||
} else {
|
||||
// no collision found with the parallel at->eye, animate to be parallel
|
||||
|
|
|
@ -2648,8 +2648,8 @@ void CollisionCheck_SetOCvsOC(Collider* left, ColliderInfo* leftInfo, Vec3f* lef
|
|||
f32 zDelta;
|
||||
Actor* leftActor = left->actor;
|
||||
Actor* rightActor = right->actor;
|
||||
s32 leftMassType;
|
||||
s32 rightMassType;
|
||||
s32 leftMassType;
|
||||
|
||||
left->ocFlags1 |= OC1_HIT;
|
||||
left->oc = rightActor;
|
||||
|
@ -2666,8 +2666,8 @@ void CollisionCheck_SetOCvsOC(Collider* left, ColliderInfo* leftInfo, Vec3f* lef
|
|||
if (leftActor == NULL || rightActor == NULL || left->ocFlags1 & OC1_NO_PUSH || right->ocFlags1 & OC1_NO_PUSH) {
|
||||
return;
|
||||
}
|
||||
rightMassType = CollisionCheck_GetMassType(leftActor->colChkInfo.mass);
|
||||
leftMassType = CollisionCheck_GetMassType(rightActor->colChkInfo.mass);
|
||||
leftMassType = CollisionCheck_GetMassType(leftActor->colChkInfo.mass);
|
||||
rightMassType = CollisionCheck_GetMassType(rightActor->colChkInfo.mass);
|
||||
leftMass = leftActor->colChkInfo.mass;
|
||||
rightMass = rightActor->colChkInfo.mass;
|
||||
totalMass = leftMass + rightMass;
|
||||
|
@ -2679,30 +2679,30 @@ void CollisionCheck_SetOCvsOC(Collider* left, ColliderInfo* leftInfo, Vec3f* lef
|
|||
zDelta = rightPos->z - leftPos->z;
|
||||
xzDist = sqrtf(SQ(xDelta) + SQ(zDelta));
|
||||
|
||||
if (rightMassType == MASSTYPE_IMMOVABLE) {
|
||||
if (leftMassType == MASSTYPE_IMMOVABLE) {
|
||||
if (rightMassType == MASSTYPE_IMMOVABLE) {
|
||||
return;
|
||||
} else { // leftMassType == MASS_HEAVY | MASS_NORMAL
|
||||
} else { // rightMassType == MASSTYPE_HEAVY or MASSTYPE_NORMAL
|
||||
leftDispRatio = 0;
|
||||
rightDispRatio = 1;
|
||||
}
|
||||
} else if (rightMassType == MASSTYPE_HEAVY) {
|
||||
if (leftMassType == MASSTYPE_IMMOVABLE) {
|
||||
} else if (leftMassType == MASSTYPE_HEAVY) {
|
||||
if (rightMassType == MASSTYPE_IMMOVABLE) {
|
||||
leftDispRatio = 1;
|
||||
rightDispRatio = 0;
|
||||
} else if (leftMassType == MASSTYPE_HEAVY) {
|
||||
} else if (rightMassType == MASSTYPE_HEAVY) {
|
||||
leftDispRatio = 0.5f;
|
||||
rightDispRatio = 0.5f;
|
||||
} else { // leftMassType == MASS_NORMAL
|
||||
} else { // rightMassType == MASSTYPE_NORMAL
|
||||
leftDispRatio = 0;
|
||||
rightDispRatio = 1;
|
||||
}
|
||||
} else { // rightMassType == MASS_NORMAL
|
||||
if (leftMassType == MASSTYPE_NORMAL) {
|
||||
} else { // leftMassType == MASSTYPE_NORMAL
|
||||
if (rightMassType == MASSTYPE_NORMAL) {
|
||||
inverseTotalMass = 1 / totalMass;
|
||||
leftDispRatio = rightMass * inverseTotalMass;
|
||||
rightDispRatio = leftMass * inverseTotalMass;
|
||||
} else { // leftMassType == MASS_HEAVY | MASS_IMMOVABLE
|
||||
} else { // rightMassType == MASSTYPE_HEAVY or MASSTYPE_IMMOVABLE
|
||||
leftDispRatio = 1;
|
||||
rightDispRatio = 0;
|
||||
}
|
||||
|
@ -3494,7 +3494,7 @@ s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* a
|
|||
}
|
||||
radSqDiff = SQXZ(actorToItem) - SQ(radius);
|
||||
if (!IS_ZERO(SQXZ(itemStep))) {
|
||||
actorDotItemXZ = DOTXZ(2.0f * itemStep, actorToItem);
|
||||
actorDotItemXZ = (2.0f * itemStep.x * actorToItem.x) + (2.0f * itemStep.z * actorToItem.z);
|
||||
if (SQ(actorDotItemXZ) < (4.0f * SQXZ(itemStep) * radSqDiff)) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -3511,10 +3511,10 @@ s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* a
|
|||
if (intersect2 == true) {
|
||||
frac2 = (-actorDotItemXZ - closeDist) / (2.0f * SQXZ(itemStep));
|
||||
}
|
||||
} else if (!IS_ZERO(DOTXZ(2.0f * itemStep, actorToItem))) {
|
||||
} else if (!IS_ZERO((2.0f * itemStep.x * actorToItem.x) + (2.0f * itemStep.z * actorToItem.z))) {
|
||||
intersect1 = true;
|
||||
intersect2 = false;
|
||||
frac1 = -radSqDiff / DOTXZ(2.0f * itemStep, actorToItem);
|
||||
frac1 = -radSqDiff / ((2.0f * itemStep.x * actorToItem.x) + (2.0f * itemStep.z * actorToItem.z));
|
||||
} else {
|
||||
if (radSqDiff <= 0.0f) {
|
||||
test1 = (0.0f < actorToItem.y) && (actorToItem.y < height);
|
||||
|
|
|
@ -748,7 +748,7 @@ void EffectSsFhgFlash_SpawnLightBall(PlayState* play, Vec3f* pos, Vec3f* velocit
|
|||
* Spawn a shock effect
|
||||
*
|
||||
* param determines where the ligntning should go
|
||||
* 0: dont attach to any actor. spawns at the position specified by pos
|
||||
* 0: don't attach to any actor. spawns at the position specified by pos
|
||||
* 1: spawn at one of Player's body parts, chosen at random
|
||||
* 2: spawn at one of Phantom Ganon's body parts, chosen at random
|
||||
*/
|
||||
|
|
|
@ -134,7 +134,7 @@ void func_808BB0AC(BgTokiSwd* this, PlayState* play) {
|
|||
if (Actor_HasParent(&this->actor, play)) {
|
||||
if (!LINK_IS_ADULT) {
|
||||
Audio_PlayActorSfx2(&this->actor, NA_SE_IT_SWORD_PUTAWAY_STN);
|
||||
this->actor.draw = NULL; // sword has been pulled, dont draw sword
|
||||
this->actor.draw = NULL; // sword has been pulled, don't draw sword
|
||||
} else {
|
||||
this->actor.draw = BgTokiSwd_Draw; // sword has been placed, draw the master sword
|
||||
}
|
||||
|
|
|
@ -812,7 +812,7 @@ void func_809691BC(Demo6K* this, PlayState* play, s32 params) {
|
|||
|
||||
temp = Environment_LerpWeight(csAction->endFrame, csAction->startFrame, play->csCtx.frames);
|
||||
|
||||
this->actor.world.pos.x = (((endPos.x - startPos.x) * temp) + startPos.x);
|
||||
this->actor.world.pos.y = (((endPos.y - startPos.y) * temp) + startPos.y);
|
||||
this->actor.world.pos.z = (((endPos.z - startPos.z) * temp) + startPos.z);
|
||||
this->actor.world.pos.x = LERP(startPos.x, endPos.x, temp);
|
||||
this->actor.world.pos.y = LERP(startPos.y, endPos.y, temp);
|
||||
this->actor.world.pos.z = LERP(startPos.z, endPos.z, temp);
|
||||
}
|
||||
|
|
|
@ -454,9 +454,9 @@ void DemoDu_CsGoronsRuby_DaruniaFalling(DemoDu* this, PlayState* play) {
|
|||
endPos.y = npcAction->endPos.y;
|
||||
endPos.z = npcAction->endPos.z;
|
||||
|
||||
pos->x = ((endPos.x - startPos.x) * traveledPercent) + startPos.x;
|
||||
pos->y = ((endPos.y - startPos.y) * traveledPercent) + startPos.y;
|
||||
pos->z = ((endPos.z - startPos.z) * traveledPercent) + startPos.z;
|
||||
pos->x = LERP(startPos.x, endPos.x, traveledPercent);
|
||||
pos->y = LERP(startPos.y, endPos.y, traveledPercent);
|
||||
pos->z = LERP(startPos.z, endPos.z, traveledPercent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ void EnEg_Draw(Actor* thisx, PlayState* play);
|
|||
|
||||
void func_809FFDC8(EnEg* this, PlayState* play);
|
||||
|
||||
static s32 voided = false;
|
||||
static s32 sVoided = false;
|
||||
|
||||
static EnEgActionFunc sActionFuncs[] = {
|
||||
func_809FFDC8,
|
||||
|
@ -48,14 +48,14 @@ void EnEg_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_809FFDC8(EnEg* this, PlayState* play) {
|
||||
if (!voided && (gSaveContext.timer2Value < 1) && Flags_GetSwitch(play, 0x36) && (kREG(0) == 0)) {
|
||||
if (!sVoided && (gSaveContext.timer2Value < 1) && Flags_GetSwitch(play, 0x36) && (kREG(0) == 0)) {
|
||||
// Void the player out
|
||||
Play_TriggerRespawn(play);
|
||||
gSaveContext.respawnFlag = -2;
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0);
|
||||
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
||||
EnEg_PlayVoidOutSFX();
|
||||
voided = true;
|
||||
sVoided = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@ struct ObjMakekinsuta;
|
|||
typedef void (*ObjMakekinsutaActionFunc)(struct ObjMakekinsuta*, PlayState*);
|
||||
|
||||
typedef struct ObjMakekinsuta {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ ObjMakekinsutaActionFunc actionFunc;
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x14C */ ObjMakekinsutaActionFunc actionFunc;
|
||||
/* 0x150 */ s16 timer;
|
||||
/* 0x152 */ s16 unk_152;
|
||||
} ObjMakekinsuta; // size = 0x0154
|
||||
} ObjMakekinsuta; // size = 0x154
|
||||
|
||||
#endif
|
||||
|
|
|
@ -849,8 +849,8 @@ void ObjectKankyo_DrawSunGraveSpark(Actor* thisx, PlayState* play2) {
|
|||
|
||||
weight = Environment_LerpWeight(play->csCtx.npcActions[1]->endFrame, play->csCtx.npcActions[1]->startFrame,
|
||||
play->csCtx.frames);
|
||||
Matrix_Translate((end.x - start.x) * weight + start.x, (end.y - start.y) * weight + start.y,
|
||||
(end.z - start.z) * weight + start.z, MTXMODE_NEW);
|
||||
Matrix_Translate(LERP(start.x, end.x, weight), LERP(start.y, end.y, weight), LERP(start.z, end.z, weight),
|
||||
MTXMODE_NEW);
|
||||
Matrix_Scale(this->effects[0].size, this->effects[0].size, this->effects[0].size, MTXMODE_APPLY);
|
||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
|
|
|
@ -5401,11 +5401,7 @@ s32 func_8083B644(Player* this, PlayState* play) {
|
|||
this->targetActor = NULL;
|
||||
|
||||
if (sp28 || !sp24) {
|
||||
if (this->naviTextId >= 0) {
|
||||
sp2C->textId = this->naviTextId;
|
||||
} else {
|
||||
sp2C->textId = -this->naviTextId;
|
||||
}
|
||||
sp2C->textId = ABS(this->naviTextId);
|
||||
} else {
|
||||
if (sp2C->naviEnemyId != NAVI_ENEMY_NONE) {
|
||||
sp2C->textId = sp2C->naviEnemyId + 0x600;
|
||||
|
@ -12891,11 +12887,7 @@ void func_8084F104(Player* this, PlayState* play) {
|
|||
GetItemEntry* giEntry = &sGetItemTable[D_80854528[this->exchangeItemId - 1] - 1];
|
||||
|
||||
if (this->itemAction >= PLAYER_IA_LETTER_ZELDA) {
|
||||
if (giEntry->gi >= 0) {
|
||||
this->unk_862 = giEntry->gi;
|
||||
} else {
|
||||
this->unk_862 = -giEntry->gi;
|
||||
}
|
||||
this->unk_862 = ABS(giEntry->gi);
|
||||
}
|
||||
|
||||
if (this->unk_850 == 0) {
|
||||
|
|
|
@ -128,7 +128,7 @@ void EffectSsGSpk_Update(PlayState* play, u32 index, EffectSs* this) {
|
|||
}
|
||||
|
||||
// this update mode is unused in the original game
|
||||
// with this update mode, the sparks dont move randomly in the xz plane, appearing to be on top of each other
|
||||
// with this update mode, the sparks don't move randomly in the xz plane, appearing to be on top of each other
|
||||
void EffectSsGSpk_UpdateNoAccel(PlayState* play, u32 index, EffectSs* this) {
|
||||
if (this->actor != NULL) {
|
||||
if ((this->actor->category == ACTORCAT_EXPLOSIVE) && (this->actor->update != NULL)) {
|
||||
|
|
|
@ -561,7 +561,7 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) {
|
|||
this->kbdY--;
|
||||
|
||||
if (this->kbdY < 0) {
|
||||
// dont go to bottom row
|
||||
// don't go to bottom row
|
||||
if (this->kbdX < 8) {
|
||||
this->kbdY = 4;
|
||||
this->charIndex = (s32)(this->kbdX + 52);
|
||||
|
|
Loading…
Add table
Reference in a new issue