Created and implemented PosType enum (#5046)
* Created and implemented PosType enum * fixed formatting --------- Co-authored-by: link5669 <acqmiles@gmail.com>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
|
||||
#include "objects/object_bdoor/object_bdoor.h"
|
||||
#include "soh/frame_interpolation.h"
|
||||
#include "soh/Enhancements/cosmetics/cosmeticsTypes.h"
|
||||
#include "soh/Enhancements/enemyrandomizer.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
@@ -365,7 +366,7 @@ void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorCategory, Pl
|
||||
} else {
|
||||
sNaviColorList[ACTORCAT_PLAYER].outer = defaultIdleSecondaryColor;
|
||||
}
|
||||
|
||||
|
||||
if (CVarGetInteger(CVAR_COSMETIC("Navi.NPCPrimary.Changed"), 0)) {
|
||||
sNaviColorList[ACTORCAT_NPC].inner = CVarGetColor(CVAR_COSMETIC("Navi.NPCPrimary.Value"), defaultNPCPrimaryColor);
|
||||
} else {
|
||||
@@ -625,7 +626,7 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Pl
|
||||
}
|
||||
|
||||
lockOnSfxId = CHECK_FLAG_ALL(actorArg->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) ? NA_SE_SY_LOCK_ON
|
||||
: NA_SE_SY_LOCK_ON_HUMAN;
|
||||
: NA_SE_SY_LOCK_ON_HUMAN;
|
||||
Sfx_PlaySfxCentered(lockOnSfxId);
|
||||
}
|
||||
|
||||
@@ -834,7 +835,7 @@ void func_8002CDE4(PlayState* play, TitleCardContext* titleCtx) {
|
||||
void TitleCard_InitBossName(PlayState* play, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width,
|
||||
u8 height, s16 hasTranslation) {
|
||||
static char newName[512];
|
||||
|
||||
|
||||
if (gSaveContext.language != LANGUAGE_ENG) {
|
||||
size_t length = strlen(texture);
|
||||
strcpy(newName, texture);
|
||||
@@ -864,7 +865,7 @@ void TitleCard_InitBossName(PlayState* play, TitleCardContext* titleCtx, void* t
|
||||
void TitleCard_InitPlaceName(PlayState* play, TitleCardContext* titleCtx, void* texture, s32 x, s32 y,
|
||||
s32 width, s32 height, s32 delay) {
|
||||
SceneTableEntry* loadedScene = play->loadedScene;
|
||||
// size_t size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart;
|
||||
// size_t size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart;
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_DEKU_TREE:
|
||||
texture = gDekuTreeTitleCardENGTex;
|
||||
@@ -1093,7 +1094,7 @@ void TitleCard_Update(PlayState* play, TitleCardContext* titleCtx) {
|
||||
if (titleCtx->durationTimer == 80) {
|
||||
GameInteractor_ExecuteOnPresentTitleCard();
|
||||
}
|
||||
|
||||
|
||||
if (DECR(titleCtx->durationTimer) == 0) {
|
||||
Math_StepToS(&titleCtx->alpha, 0, 30);
|
||||
Math_StepToS(&titleCtx->intensityR, 0, 70);
|
||||
@@ -1127,15 +1128,15 @@ void TitleCard_Draw(PlayState* play, TitleCardContext* titleCtx) {
|
||||
s16 TitleCard_PosY = titleCtx->y;
|
||||
if (TitleCard_PosType_Checker != 0) {
|
||||
TitleCard_PosY = TitleCard_PosY_Modifier;
|
||||
if (TitleCard_PosType_Checker == 1) {//Anchor Left
|
||||
if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVarGetInteger(CVAR_COSMETIC("HUD.Margin.L"), 0)*-1;};
|
||||
TitleCard_PosX = OTRGetDimensionFromLeftEdge(TitleCard_PosX_Modifier+TitleCard_MarginX)-11;
|
||||
} else if (TitleCard_PosType_Checker == 2) {//Anchor Right
|
||||
if (TitleCard_PosType_Checker == ANCHOR_LEFT) {
|
||||
if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVarGetInteger(CVAR_COSMETIC("HUD.Margin.L"), 0) * -1;};
|
||||
TitleCard_PosX = OTRGetDimensionFromLeftEdge(TitleCard_PosX_Modifier + TitleCard_MarginX) - 11;
|
||||
} else if (TitleCard_PosType_Checker == ANCHOR_RIGHT) {
|
||||
if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVarGetInteger(CVAR_COSMETIC("HUD.Margin.R"), 0);};
|
||||
TitleCard_PosX = OTRGetDimensionFromRightEdge(TitleCard_PosX_Modifier+TitleCard_MarginX);
|
||||
} else if (TitleCard_PosType_Checker == 3) {//Anchor None
|
||||
TitleCard_PosX = OTRGetDimensionFromRightEdge(TitleCard_PosX_Modifier + TitleCard_MarginX);
|
||||
} else if (TitleCard_PosType_Checker == ANCHOR_NONE) {
|
||||
TitleCard_PosX = TitleCard_PosX_Modifier;
|
||||
} else if (TitleCard_PosType_Checker == 4) {//Hidden
|
||||
} else if (TitleCard_PosType_Checker == HIDDEN) {
|
||||
TitleCard_PosX = -9999;
|
||||
}
|
||||
}
|
||||
@@ -1156,7 +1157,7 @@ void TitleCard_Draw(PlayState* play, TitleCardContext* titleCtx) {
|
||||
width, 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);
|
||||
gSPWideTextureRectangle(OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4),
|
||||
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
|
||||
height = titleCtx->height - height;
|
||||
|
||||
@@ -1987,7 +1988,7 @@ u32 Actor_HasParent(Actor* actor, PlayState* play) {
|
||||
* Uses the given `GetItemEntry` to prepare the player to receive an item via the animation
|
||||
* where Link holds an item over his head. This function does not require an actor for giving
|
||||
* the player an item, instead setting the player as their own interactRangeActor and getItemDirection.
|
||||
*
|
||||
*
|
||||
* \param play the Global Context
|
||||
* \param getItemEntry the GetItemEntry for the item you want the player to receive.
|
||||
* \return true if the player can receive an item, false if not.
|
||||
@@ -1995,12 +1996,12 @@ u32 Actor_HasParent(Actor* actor, PlayState* play) {
|
||||
s32 GiveItemEntryWithoutActor(PlayState* play, GetItemEntry getItemEntry) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (!(player->stateFlags1 &
|
||||
if (!(player->stateFlags1 &
|
||||
(PLAYER_STATE1_DEAD | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_HANGING_OFF_LEDGE | PLAYER_STATE1_CLIMBING_LEDGE |
|
||||
PLAYER_STATE1_JUMPING | PLAYER_STATE1_FREEFALL | PLAYER_STATE1_FIRST_PERSON | PLAYER_STATE1_CLIMBING_LADDER)) &&
|
||||
Player_GetExplosiveHeld(player) < 0) {
|
||||
if (((player->heldActor != NULL) && ((getItemEntry.getItemId > GI_NONE) && (getItemEntry.getItemId < GI_MAX)) ||
|
||||
(IS_RANDO && (getItemEntry.getItemId > RG_NONE) && (getItemEntry.getItemId < RG_MAX))) ||
|
||||
Player_GetExplosiveHeld(player) < 0) {
|
||||
if (((player->heldActor != NULL) && ((getItemEntry.getItemId > GI_NONE) && (getItemEntry.getItemId < GI_MAX)) ||
|
||||
(IS_RANDO && (getItemEntry.getItemId > RG_NONE) && (getItemEntry.getItemId < RG_MAX))) ||
|
||||
(!(player->stateFlags1 & (PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_IN_CUTSCENE)))) {
|
||||
if ((getItemEntry.getItemId != GI_NONE)) {
|
||||
player->getItemEntry = getItemEntry;
|
||||
@@ -2034,14 +2035,14 @@ s32 GiveItemEntryWithoutActor(PlayState* play, GetItemEntry getItemEntry) {
|
||||
s32 GiveItemEntryFromActor(Actor* actor, PlayState* play, GetItemEntry getItemEntry, f32 xzRange, f32 yRange) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (!(player->stateFlags1 &
|
||||
if (!(player->stateFlags1 &
|
||||
(PLAYER_STATE1_DEAD | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_HANGING_OFF_LEDGE | PLAYER_STATE1_CLIMBING_LEDGE |
|
||||
PLAYER_STATE1_JUMPING | PLAYER_STATE1_FREEFALL | PLAYER_STATE1_FIRST_PERSON | PLAYER_STATE1_CLIMBING_LADDER)) &&
|
||||
Player_GetExplosiveHeld(player) < 0) {
|
||||
if ((((player->heldActor != NULL) || (actor == player->talkActor)) &&
|
||||
((!IS_RANDO && ((getItemEntry.getItemId > GI_NONE) && (getItemEntry.getItemId < GI_MAX))) ||
|
||||
(IS_RANDO && ((getItemEntry.getItemId > RG_NONE) && (getItemEntry.getItemId < RG_MAX))))) ||
|
||||
(!(player->stateFlags1 & (PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_IN_CUTSCENE)))) {
|
||||
Player_GetExplosiveHeld(player) < 0) {
|
||||
if ((((player->heldActor != NULL) || (actor == player->talkActor)) &&
|
||||
((!IS_RANDO && ((getItemEntry.getItemId > GI_NONE) && (getItemEntry.getItemId < GI_MAX))) ||
|
||||
(IS_RANDO && ((getItemEntry.getItemId > RG_NONE) && (getItemEntry.getItemId < RG_MAX))))) ||
|
||||
(!(player->stateFlags1 & (PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_IN_CUTSCENE)))) {
|
||||
if ((actor->xzDistToPlayer < xzRange) && (fabsf(actor->yDistToPlayer) < yRange)) {
|
||||
s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y;
|
||||
s32 absYawDiff = ABS(yawDiff);
|
||||
@@ -2078,11 +2079,11 @@ s32 GiveItemEntryFromActorWithFixedRange(Actor* actor, PlayState* play, GetItemE
|
||||
s32 Actor_OfferGetItem(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 yRange) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (!(player->stateFlags1 &
|
||||
if (!(player->stateFlags1 &
|
||||
(PLAYER_STATE1_DEAD | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_HANGING_OFF_LEDGE | PLAYER_STATE1_CLIMBING_LEDGE |
|
||||
PLAYER_STATE1_JUMPING | PLAYER_STATE1_FREEFALL | PLAYER_STATE1_FIRST_PERSON | PLAYER_STATE1_CLIMBING_LADDER)) &&
|
||||
Player_GetExplosiveHeld(player) < 0) {
|
||||
if ((((player->heldActor != NULL) || (actor == player->talkActor)) &&
|
||||
Player_GetExplosiveHeld(player) < 0) {
|
||||
if ((((player->heldActor != NULL) || (actor == player->talkActor)) &&
|
||||
((!IS_RANDO && ((getItemId > GI_NONE) && (getItemId < GI_MAX))) || (IS_RANDO && ((getItemId > RG_NONE) && (getItemId < RG_MAX))))) ||
|
||||
(!(player->stateFlags1 & (PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_IN_CUTSCENE)))) {
|
||||
if ((actor->xzDistToPlayer < xzRange) && (fabsf(actor->yDistToPlayer) < yRange)) {
|
||||
@@ -2153,7 +2154,7 @@ s32 Actor_IsMounted(PlayState* play, Actor* horse) {
|
||||
u32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (!(player->stateFlags1 &
|
||||
if (!(player->stateFlags1 &
|
||||
(PLAYER_STATE1_DEAD | PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_CHARGING_SPIN_ATTACK | PLAYER_STATE1_HANGING_OFF_LEDGE |
|
||||
PLAYER_STATE1_CLIMBING_LEDGE | PLAYER_STATE1_JUMPING | PLAYER_STATE1_FREEFALL | PLAYER_STATE1_FIRST_PERSON | PLAYER_STATE1_CLIMBING_LADDER))) {
|
||||
player->rideActor = horse;
|
||||
@@ -2203,7 +2204,7 @@ void Player_PlaySfx(Actor* actor, u16 sfxId) {
|
||||
Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale , &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
} else {
|
||||
freqMultiplier = CVarGetFloat(CVAR_AUDIO("LinkVoiceFreqMultiplier"), 1.0);
|
||||
if (freqMultiplier <= 0) {
|
||||
if (freqMultiplier <= 0) {
|
||||
freqMultiplier = 1;
|
||||
}
|
||||
// Authentic behavior uses D_801333E0 for both freqScale and a4
|
||||
@@ -2802,7 +2803,7 @@ void Actor_DrawLensOverlay(GraphicsContext* gfxCtx) {
|
||||
gSPWideTextureRectangle(POLY_XLU_DISP++, 0, 0, w, SCREEN_HEIGHT << 2, G_TX_RENDERTILE,
|
||||
LENS_MASK_OFFSET_S << 5, LENS_MASK_OFFSET_T << 5,
|
||||
(1 << 10) * (SCREEN_WIDTH - 2 * LENS_MASK_OFFSET_S) / SCREEN_WIDTH,
|
||||
(1 << 10) * (SCREEN_HEIGHT - 2 * LENS_MASK_OFFSET_T) / SCREEN_HEIGHT);
|
||||
(1 << 10) * (SCREEN_HEIGHT - 2 * LENS_MASK_OFFSET_T) / SCREEN_HEIGHT);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
@@ -3422,7 +3423,7 @@ void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) {
|
||||
Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, PlayState* play) {
|
||||
gMapLoading = 1;
|
||||
Actor* ret = Actor_Spawn(actorCtx, play, actorEntry->id, actorEntry->pos.x, actorEntry->pos.y, actorEntry->pos.z,
|
||||
actorEntry->rot.x, actorEntry->rot.y, actorEntry->rot.z, actorEntry->params, true);
|
||||
actorEntry->rot.x, actorEntry->rot.y, actorEntry->rot.z, actorEntry->params, true);
|
||||
gMapLoading = 0;
|
||||
|
||||
return ret;
|
||||
@@ -4803,7 +4804,7 @@ Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3,
|
||||
|
||||
spawnedEnPart =
|
||||
(EnPart*)Actor_SpawnAsChild(&play->actorCtx, actor, play, ACTOR_EN_PART, spawnPos->x, spawnPos->y,
|
||||
spawnPos->z, spawnRot->x, spawnRot->y, actor->objBankIndex, params);
|
||||
spawnPos->z, spawnRot->x, spawnRot->y, actor->objBankIndex, params);
|
||||
if (spawnedEnPart != NULL) {
|
||||
spawnedEnPart->actor.scale = actor->scale;
|
||||
spawnedEnPart->actor.speedXZ = arg3[0];
|
||||
|
||||
Reference in New Issue
Block a user