mirror of
https://github.com/zeldaret/oot.git
synced 2024-12-27 15:16:13 +00:00
named members of TitleCardContext (#749)
* named members of TitleCardContext * changed screenX/Y to just x/y * added clarifying comments and renamed timer -> duration because i think its better * changed names to delayTimer and durationTimer * made texture a void* Co-authored-by: gamestabled <chandler2016@yahoo.com>
This commit is contained in:
parent
1398898b70
commit
03b81c71c2
6 changed files with 54 additions and 54 deletions
|
@ -372,10 +372,10 @@ void Flags_SetTempClear(GlobalContext* globalCtx, s32 flag);
|
|||
void Flags_UnsetTempClear(GlobalContext* globalCtx, s32 flag);
|
||||
s32 Flags_GetCollectible(GlobalContext* globalCtx, s32 flag);
|
||||
void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag);
|
||||
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 arg3, s16 arg4,
|
||||
u8 arg5, u8 arg6);
|
||||
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 arg3, s32 arg4,
|
||||
s32 arg5, s32 arg6, s32 arg7);
|
||||
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 x,
|
||||
s16 y, u8 width, u8 height);
|
||||
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 x,
|
||||
s32 y, s32 width, s32 height, s32 delay);
|
||||
s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx);
|
||||
void Actor_Kill(Actor* actor);
|
||||
void Actor_SetFocus(Actor* actor, f32 offset);
|
||||
|
@ -526,7 +526,7 @@ void func_80035650(Actor* actor, ColliderInfo* colBody, s32 freezeFlag);
|
|||
void func_8003573C(Actor* actor, ColliderJntSph* colBody, s32 freezeFlag);
|
||||
void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3);
|
||||
Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* unused,
|
||||
GlobalContext* globalCtx, s16 params, s32 arg8);
|
||||
GlobalContext* globalCtx, s16 params, s32 arg8);
|
||||
void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2);
|
||||
s32 Flags_GetEventChkInf(s32 flag);
|
||||
void Flags_SetEventChkInf(s32 flag);
|
||||
|
|
|
@ -222,15 +222,15 @@ typedef struct {
|
|||
} TargetContext; // size = 0x98
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* texture;
|
||||
/* 0x04 */ s16 unk_4;
|
||||
/* 0x06 */ s16 unk_6;
|
||||
/* 0x08 */ u8 unk_8;
|
||||
/* 0x09 */ u8 unk_9;
|
||||
/* 0x0A */ u8 delayA;
|
||||
/* 0x0B */ u8 delayB;
|
||||
/* 0x0C */ s16 unk_C;
|
||||
/* 0x0E */ s16 unk_E;
|
||||
/* 0x00 */ void* texture;
|
||||
/* 0x04 */ s16 x;
|
||||
/* 0x06 */ s16 y;
|
||||
/* 0x08 */ u8 width;
|
||||
/* 0x09 */ u8 height;
|
||||
/* 0x0A */ u8 durationTimer; // how long the title card appears for before fading
|
||||
/* 0x0B */ u8 delayTimer; // how long the title card waits to appear
|
||||
/* 0x0C */ s16 alpha;
|
||||
/* 0x0E */ s16 intensity;
|
||||
} TitleCardContext; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -664,22 +664,22 @@ void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag) {
|
|||
}
|
||||
|
||||
void func_8002CDE4(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
|
||||
titleCtx->delayA = titleCtx->delayB = titleCtx->unk_E = titleCtx->unk_C = 0;
|
||||
titleCtx->durationTimer = titleCtx->delayTimer = titleCtx->intensity = titleCtx->alpha = 0;
|
||||
}
|
||||
|
||||
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 arg3, s16 arg4,
|
||||
u8 arg5, u8 arg6) {
|
||||
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 x,
|
||||
s16 y, u8 width, u8 height) {
|
||||
titleCtx->texture = texture;
|
||||
titleCtx->unk_4 = arg3;
|
||||
titleCtx->unk_6 = arg4;
|
||||
titleCtx->unk_8 = arg5;
|
||||
titleCtx->unk_9 = arg6;
|
||||
titleCtx->delayA = 80;
|
||||
titleCtx->delayB = 0;
|
||||
titleCtx->x = x;
|
||||
titleCtx->y = y;
|
||||
titleCtx->width = width;
|
||||
titleCtx->height = height;
|
||||
titleCtx->durationTimer = 80;
|
||||
titleCtx->delayTimer = 0;
|
||||
}
|
||||
|
||||
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 arg3, s32 arg4,
|
||||
s32 arg5, s32 arg6, s32 arg7) {
|
||||
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 x,
|
||||
s32 y, s32 width, s32 height, s32 delay) {
|
||||
Scene* loadedScene = globalCtx->loadedScene;
|
||||
u32 size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart;
|
||||
|
||||
|
@ -688,22 +688,22 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt
|
|||
}
|
||||
|
||||
titleCtx->texture = texture;
|
||||
titleCtx->unk_4 = arg3;
|
||||
titleCtx->unk_6 = arg4;
|
||||
titleCtx->unk_8 = arg5;
|
||||
titleCtx->unk_9 = arg6;
|
||||
titleCtx->delayA = 80;
|
||||
titleCtx->delayB = arg7;
|
||||
titleCtx->x = x;
|
||||
titleCtx->y = y;
|
||||
titleCtx->width = width;
|
||||
titleCtx->height = height;
|
||||
titleCtx->durationTimer = 80;
|
||||
titleCtx->delayTimer = delay;
|
||||
}
|
||||
|
||||
void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
|
||||
if (DECR(titleCtx->delayB) == 0) {
|
||||
if (DECR(titleCtx->delayA) == 0) {
|
||||
Math_StepToS(&titleCtx->unk_C, 0, 30);
|
||||
Math_StepToS(&titleCtx->unk_E, 0, 70);
|
||||
if (DECR(titleCtx->delayTimer) == 0) {
|
||||
if (DECR(titleCtx->durationTimer) == 0) {
|
||||
Math_StepToS(&titleCtx->alpha, 0, 30);
|
||||
Math_StepToS(&titleCtx->intensity, 0, 70);
|
||||
} else {
|
||||
Math_StepToS(&titleCtx->unk_C, 255, 10);
|
||||
Math_StepToS(&titleCtx->unk_E, 255, 20);
|
||||
Math_StepToS(&titleCtx->alpha, 255, 10);
|
||||
Math_StepToS(&titleCtx->intensity, 255, 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -718,11 +718,11 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
|
|||
s32 spB4;
|
||||
s32 spB0;
|
||||
|
||||
if (titleCtx->unk_C != 0) {
|
||||
spCC = titleCtx->unk_8;
|
||||
spC8 = titleCtx->unk_9;
|
||||
spC0 = (titleCtx->unk_4 * 4) - (spCC * 2);
|
||||
spB8 = (titleCtx->unk_6 * 4) - (spC8 * 2);
|
||||
if (titleCtx->alpha != 0) {
|
||||
spCC = titleCtx->width;
|
||||
spC8 = titleCtx->height;
|
||||
spC0 = (titleCtx->x * 4) - (spCC * 2);
|
||||
spB8 = (titleCtx->y * 4) - (spC8 * 2);
|
||||
sp38 = spCC * 2;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 2824);
|
||||
|
@ -735,8 +735,8 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
|
|||
|
||||
OVERLAY_DISP = func_80093808(OVERLAY_DISP);
|
||||
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, (u8)titleCtx->unk_E, (u8)titleCtx->unk_E, (u8)titleCtx->unk_E,
|
||||
(u8)titleCtx->unk_C);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity,
|
||||
(u8)titleCtx->alpha);
|
||||
|
||||
gDPLoadTextureBlock(OVERLAY_DISP++, (s32)titleCtx->texture + spB0, G_IM_FMT_IA, G_IM_SIZ_8b, spCC, spC8, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
|
||||
|
@ -745,7 +745,7 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
|
|||
gSPTextureRectangle(OVERLAY_DISP++, spC0, spB8, ((sp38 * 2) + spC0) - 4, spB8 + (spC8 * 4) - 1, G_TX_RENDERTILE,
|
||||
0, 0, 1024, 1024);
|
||||
|
||||
spC8 = titleCtx->unk_9 - spC8;
|
||||
spC8 = titleCtx->height - spC8;
|
||||
|
||||
if (spC8 > 0) {
|
||||
gDPLoadTextureBlock(OVERLAY_DISP++, (s32)titleCtx->texture + spB0 + 0x1000, G_IM_FMT_IA, G_IM_SIZ_8b, spCC,
|
||||
|
@ -761,9 +761,9 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
|
|||
}
|
||||
|
||||
s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
|
||||
if ((globalCtx->actorCtx.titleCtx.delayB != 0) || (globalCtx->actorCtx.titleCtx.unk_C != 0)) {
|
||||
titleCtx->delayA = 0;
|
||||
titleCtx->delayB = 0;
|
||||
if ((globalCtx->actorCtx.titleCtx.delayTimer != 0) || (globalCtx->actorCtx.titleCtx.alpha != 0)) {
|
||||
titleCtx->durationTimer = 0;
|
||||
titleCtx->delayTimer = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -259,8 +259,8 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
|||
break;
|
||||
case 15:
|
||||
if (sp3F != 0) {
|
||||
TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, player->giObjectSegment, 0xA0, 0x78,
|
||||
0x90, 0x18, 0x14);
|
||||
TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, player->giObjectSegment, 160, 120,
|
||||
144, 24, 20);
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
|
|
|
@ -336,7 +336,7 @@ void EnfHG_Intro(EnfHG* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachF(&this->cameraSpeedMod, 1.0f, 1.0f, 0.05f);
|
||||
if (this->timers[0] == 75) {
|
||||
TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx,
|
||||
SEGMENTED_TO_VIRTUAL(&gPhantomGanonTitleCardTex), 0xA0, 0xB4, 0x80, 0x28);
|
||||
SEGMENTED_TO_VIRTUAL(&gPhantomGanonTitleCardTex), 160, 180, 128, 40);
|
||||
}
|
||||
if (this->timers[0] == 0) {
|
||||
this->cutsceneState = INTRO_RETREAT;
|
||||
|
|
|
@ -4674,7 +4674,7 @@ s32 func_8083B040(Player* this, GlobalContext* globalCtx) {
|
|||
(((this->itemActionParam == PLAYER_AP_BOTTLE_POE) && (this->exchangeItemId == EXCH_ITEM_POE)) ||
|
||||
(this->exchangeItemId == EXCH_ITEM_BLUE_FIRE))))))) {
|
||||
|
||||
if ((globalCtx->actorCtx.titleCtx.delayB == 0) && (globalCtx->actorCtx.titleCtx.unk_C == 0)) {
|
||||
if ((globalCtx->actorCtx.titleCtx.delayTimer == 0) && (globalCtx->actorCtx.titleCtx.alpha == 0)) {
|
||||
func_80835DE4(globalCtx, this, func_8084F104, 0);
|
||||
|
||||
if (sp2C >= 0) {
|
||||
|
@ -9052,8 +9052,8 @@ void Player_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
0x4000) &&
|
||||
((globalCtx->sceneNum != SCENE_DDAN) || (gSaveContext.eventChkInf[11] & 1)) &&
|
||||
((globalCtx->sceneNum != SCENE_NIGHT_SHOP) || (gSaveContext.eventChkInf[2] & 0x20))) {
|
||||
TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, this->giObjectSegment, 0xA0, 0x78,
|
||||
0x90, 0x18, 0x14);
|
||||
TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, this->giObjectSegment, 160, 120,
|
||||
144, 24, 20);
|
||||
}
|
||||
}
|
||||
gSaveContext.showTitleCard = true;
|
||||
|
|
Loading…
Reference in a new issue