mirror of
https://github.com/zeldaret/oot
synced 2026-05-28 00:16:06 -04:00
PlayState Rename (#1231)
* global context -> play * fix PlayState* PlayState
This commit is contained in:
@@ -76,7 +76,7 @@ s32 func_800435B4(DynaPolyActor* dynaActor) {
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_800435D8(GlobalContext* globalCtx, DynaPolyActor* dynaActor, s16 arg2, s16 arg3, s16 arg4) {
|
||||
s32 func_800435D8(PlayState* play, DynaPolyActor* dynaActor, s16 arg2, s16 arg3, s16 arg4) {
|
||||
Vec3f posA;
|
||||
Vec3f posB;
|
||||
Vec3f posResult;
|
||||
@@ -98,7 +98,7 @@ s32 func_800435D8(GlobalContext* globalCtx, DynaPolyActor* dynaActor, s16 arg2,
|
||||
posB.y = posA.y;
|
||||
posB.z = sign * a3 * cos + posA.z;
|
||||
|
||||
if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &posA, &posB, &posResult, &poly, true, false, false, true, &bgId,
|
||||
if (BgCheck_EntityLineTest3(&play->colCtx, &posA, &posB, &posResult, &poly, true, false, false, true, &bgId,
|
||||
&dynaActor->actor, 0.0f)) {
|
||||
return false;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ s32 func_800435D8(GlobalContext* globalCtx, DynaPolyActor* dynaActor, s16 arg2,
|
||||
posA.z = (dynaActor->actor.world.pos.z * 2) - posA.z;
|
||||
posB.x = sign * a3 * sin + posA.x;
|
||||
posB.z = sign * a3 * cos + posA.z;
|
||||
if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &posA, &posB, &posResult, &poly, true, false, false, true, &bgId,
|
||||
if (BgCheck_EntityLineTest3(&play->colCtx, &posA, &posB, &posResult, &poly, true, false, false, true, &bgId,
|
||||
&dynaActor->actor, 0.0f)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
#include "global.h"
|
||||
|
||||
void Flags_UnsetAllEnv(GlobalContext* globalCtx) {
|
||||
void Flags_UnsetAllEnv(PlayState* play) {
|
||||
u8 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(globalCtx->envFlags); i++) {
|
||||
globalCtx->envFlags[i] = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(play->envFlags); i++) {
|
||||
play->envFlags[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Flags_SetEnv(GlobalContext* globalCtx, s16 flag) {
|
||||
void Flags_SetEnv(PlayState* play, s16 flag) {
|
||||
s16 index = flag / 16;
|
||||
s16 bit = flag % 16;
|
||||
s16 mask = 1 << bit;
|
||||
|
||||
globalCtx->envFlags[index] |= mask;
|
||||
play->envFlags[index] |= mask;
|
||||
}
|
||||
|
||||
void Flags_UnsetEnv(GlobalContext* globalCtx, s16 flag) {
|
||||
void Flags_UnsetEnv(PlayState* play, s16 flag) {
|
||||
s16 index = flag / 16;
|
||||
s16 bit = flag % 16;
|
||||
s16 mask = (1 << bit) ^ 0xFFFF;
|
||||
|
||||
globalCtx->envFlags[index] &= mask;
|
||||
play->envFlags[index] &= mask;
|
||||
}
|
||||
|
||||
s32 Flags_GetEnv(GlobalContext* globalCtx, s16 flag) {
|
||||
s32 Flags_GetEnv(PlayState* play, s16 flag) {
|
||||
s16 index = flag / 16;
|
||||
s16 bit = flag % 16;
|
||||
s16 mask = 1 << bit;
|
||||
|
||||
return globalCtx->envFlags[index] & mask;
|
||||
return play->envFlags[index] & mask;
|
||||
}
|
||||
|
||||
@@ -229,8 +229,8 @@ void Inventory_ChangeEquipment(s16 equipment, u16 value) {
|
||||
gSaveContext.equips.equipment |= value << gEquipShifts[equipment];
|
||||
}
|
||||
|
||||
u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
s32 pad;
|
||||
u16 equipValue = gSaveContext.equips.equipment & gEquipMasks[equipment];
|
||||
|
||||
@@ -252,8 +252,8 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) {
|
||||
gSaveContext.infTable[INFTABLE_1DX_INDEX] = 1;
|
||||
}
|
||||
|
||||
Player_SetEquipmentData(globalCtx, player);
|
||||
globalCtx->pauseCtx.cursorSpecialPos = PAUSE_CURSOR_PAGE_LEFT;
|
||||
Player_SetEquipmentData(play, player);
|
||||
play->pauseCtx.cursorSpecialPos = PAUSE_CURSOR_PAGE_LEFT;
|
||||
}
|
||||
|
||||
return equipValue;
|
||||
|
||||
+101
-101
@@ -1,7 +1,7 @@
|
||||
#include "ultra64.h"
|
||||
#include "global.h"
|
||||
|
||||
static GlobalContext* sGlobalCtx;
|
||||
static PlayState* sPlay;
|
||||
|
||||
// TODO: cleanup these arrays and UB access
|
||||
char* D_8012CEE0[] = { GFXP_KATAKANA "キ-フレ-ム" GFXP_HIRAGANA "ガ" };
|
||||
@@ -346,7 +346,7 @@ s32 func_800B4370(DbCamera* dbCamera, s16 idx, Camera* cam) {
|
||||
void func_800B44E0(DbCamera* dbCamera, Camera* cam) {
|
||||
s32 i;
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CRIGHT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CRIGHT)) {
|
||||
sDbCamAnim.keyframe = 0;
|
||||
sDbCamAnim.unk_0A = 1;
|
||||
sDbCamAnim.curFrame = 0.0f;
|
||||
@@ -522,7 +522,7 @@ void DbCamera_Init(DbCamera* dbCamera, Camera* cameraPtr) {
|
||||
dbCamera->sub.unk_104A.x = dbCamera->sub.unk_104A.z;
|
||||
dbCamera->fov = 0.0f;
|
||||
dbCamera->rollDegrees = 0.0f;
|
||||
sGlobalCtx = cameraPtr->globalCtx;
|
||||
sPlay = cameraPtr->play;
|
||||
dbCamera->sub.mode = 0;
|
||||
dbCamera->sub.nFrames = -1;
|
||||
dbCamera->sub.nPoints = 1;
|
||||
@@ -597,7 +597,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
sp80 = &dbCamera->eye;
|
||||
sp7C = &dbCamera->at;
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_Z)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_Z)) {
|
||||
dbCamera->unk_00++;
|
||||
dbCamera->unk_00 %= 3;
|
||||
dbCamera->unk_38 = 1;
|
||||
@@ -688,7 +688,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
}
|
||||
|
||||
dbCamera->unk_3C = D_80161140;
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_B | BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_B | BTN_L)) {
|
||||
sp104.r += temp_f2;
|
||||
|
||||
if (sp104.r > 30000.0f) {
|
||||
@@ -702,7 +702,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
}
|
||||
|
||||
dbCamera->unk_40 = 7;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_B)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_B)) {
|
||||
spFC = sp104;
|
||||
spFC.r = temp_f2;
|
||||
if (!D_80161144) {
|
||||
@@ -719,7 +719,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->unk_44 = 0;
|
||||
}
|
||||
dbCamera->unk_40 = 0xB;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_A | BTN_L)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_A | BTN_L)) {
|
||||
sp104.r -= temp_f2;
|
||||
if (sp104.r < 10.0f) {
|
||||
sp104.r = 10.0f;
|
||||
@@ -730,7 +730,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->unk_44 = 0;
|
||||
}
|
||||
dbCamera->unk_40 = 8;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_A)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_A)) {
|
||||
spFC = sp104;
|
||||
spFC.r = -temp_f2;
|
||||
if (!D_80161144) {
|
||||
@@ -752,7 +752,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->unk_40 = -1;
|
||||
}
|
||||
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_DDOWN | BTN_L)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_DDOWN | BTN_L)) {
|
||||
spFC = sp104;
|
||||
spFC.r = temp_f2;
|
||||
spFC.pitch = 0;
|
||||
@@ -770,7 +770,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->unk_44 = 0;
|
||||
}
|
||||
dbCamera->unk_40 = 1;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_DUP | BTN_L)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_DUP | BTN_L)) {
|
||||
spFC = sp104;
|
||||
spFC.r = -temp_f2;
|
||||
spFC.pitch = 0;
|
||||
@@ -787,7 +787,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->unk_44 = 0;
|
||||
}
|
||||
dbCamera->unk_40 = 2;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_DUP)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_DUP)) {
|
||||
spFC = sp104;
|
||||
spFC.r = temp_f2;
|
||||
spFC.pitch = 0x3FFF;
|
||||
@@ -803,7 +803,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->unk_44 = 0;
|
||||
}
|
||||
dbCamera->unk_40 = 3;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_DDOWN)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_DDOWN)) {
|
||||
spFC = sp104;
|
||||
spFC.r = temp_f2;
|
||||
spFC.pitch = -0x3FFF;
|
||||
@@ -819,8 +819,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->unk_44 = 0;
|
||||
}
|
||||
dbCamera->unk_40 = 4;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, (BTN_DRIGHT | BTN_L)) ||
|
||||
CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_DRIGHT)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, (BTN_DRIGHT | BTN_L)) ||
|
||||
CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_DRIGHT)) {
|
||||
spFC = sp104;
|
||||
spFC.r = temp_f2;
|
||||
spFC.pitch = 0;
|
||||
@@ -837,8 +837,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->unk_44 = 0;
|
||||
}
|
||||
dbCamera->unk_40 = 5;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, (BTN_DLEFT | BTN_L)) ||
|
||||
CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_DLEFT)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, (BTN_DLEFT | BTN_L)) ||
|
||||
CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_DLEFT)) {
|
||||
spFC = sp104;
|
||||
spFC.r = temp_f2;
|
||||
spFC.pitch = 0;
|
||||
@@ -855,7 +855,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->unk_44 = 0;
|
||||
}
|
||||
dbCamera->unk_40 = 6;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_B | BTN_L)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_B | BTN_L)) {
|
||||
sp104.r = sp104.r + temp_f2;
|
||||
if (sp104.r > 30000.0f) {
|
||||
sp104.r = 30000.0f;
|
||||
@@ -866,7 +866,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->unk_44 = 0;
|
||||
}
|
||||
dbCamera->unk_40 = 7;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_B)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_B)) {
|
||||
spFC = sp104;
|
||||
spFC.r = temp_f2;
|
||||
if (!D_80161144) {
|
||||
@@ -883,7 +883,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->unk_44 = 0;
|
||||
}
|
||||
dbCamera->unk_40 = 0xB;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_A | BTN_L)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_A | BTN_L)) {
|
||||
|
||||
sp104.r -= temp_f2;
|
||||
if (sp104.r < 10.0f) {
|
||||
@@ -895,7 +895,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->unk_44 = 0;
|
||||
}
|
||||
dbCamera->unk_40 = 8;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_A)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_A)) {
|
||||
spFC = sp104;
|
||||
spFC.r = -temp_f2;
|
||||
if (!D_80161144) {
|
||||
@@ -917,7 +917,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->unk_40 = -1;
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_R)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_R)) {
|
||||
if (dbCamera->unk_00 == 0) {
|
||||
dbCamera->sub.unk_104A = cam->inputDir;
|
||||
*sp7C = cam->at;
|
||||
@@ -932,13 +932,13 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
func_800B41DC(dbCamera, dbCamera->sub.unkIdx, cam);
|
||||
} else {
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_R) &&
|
||||
CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_R) &&
|
||||
CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
dbCamera->sub.nPoints = dbCamera->sub.unkIdx + 1;
|
||||
func_800B4088(dbCamera, cam);
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_R)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_R)) {
|
||||
if (dbCamera->sub.unkIdx == 0x80) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
@@ -955,8 +955,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
temp_f0_5 = sGlobalCtx->state.input[2].rel.stick_y;
|
||||
temp_f2_2 = sGlobalCtx->state.input[2].rel.stick_x;
|
||||
temp_f0_5 = sPlay->state.input[2].rel.stick_y;
|
||||
temp_f2_2 = sPlay->state.input[2].rel.stick_x;
|
||||
pitch = CAM_DEG_TO_BINANG((SQ(temp_f0_5) / 600.0f) * 0.8f);
|
||||
yaw = CAM_DEG_TO_BINANG((SQ(temp_f2_2) / 600.0f) * 0.8f);
|
||||
if (!D_80161144) {
|
||||
@@ -977,7 +977,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
DbCamera_CalcUpFromPitchYawRoll(&dbCamera->unk_1C, spF4.pitch, spF4.yaw,
|
||||
CAM_DEG_TO_BINANG(dbCamera->rollDegrees));
|
||||
if (dbCamera->unk_00 == 1) {
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_CRIGHT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_CRIGHT)) {
|
||||
cam->inputDir = dbCamera->sub.unk_104A;
|
||||
new_var2 = OLib_Vec3fDist(&cam->at, &cam->eye);
|
||||
cam->at = *sp7C;
|
||||
@@ -991,12 +991,12 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
if (dbCamera->unk_00 == 1) {
|
||||
OREG(0) = 8;
|
||||
func_8006376C(0xC, 5, 0, D_8012CEF4);
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_CRIGHT) &&
|
||||
!CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_CRIGHT) &&
|
||||
!CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
|
||||
func_800B44E0(dbCamera, cam);
|
||||
} else {
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CRIGHT) &&
|
||||
CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CRIGHT) &&
|
||||
CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
osSyncPrintf("@@@\n@@@\n@@@/* *** spline point data ** start here *** */\n@@@\n");
|
||||
@@ -1006,14 +1006,14 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
osSyncPrintf("@@@static short nFrames = %d;\n@@@\n", dbCamera->sub.nFrames);
|
||||
osSyncPrintf("@@@static short Mode = %d;\n@@@\n", dbCamera->sub.mode);
|
||||
osSyncPrintf("@@@\n@@@\n@@@/* *** spline point data ** finish! *** */\n@@@\n");
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CLEFT)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CLEFT)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
dbCamera->sub.unk_08 = (dbCamera->sub.unk_08 + 1) % 3;
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CUP) &&
|
||||
CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CUP) &&
|
||||
CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
if (dbCamera->sub.unkIdx > 0) {
|
||||
@@ -1022,7 +1022,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->sub.unkIdx = dbCamera->sub.nPoints - 1;
|
||||
}
|
||||
} else {
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CUP)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CUP)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
if (dbCamera->sub.unkIdx > 0) {
|
||||
@@ -1043,8 +1043,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L) &&
|
||||
CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CDOWN)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L) &&
|
||||
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CDOWN)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
if (dbCamera->sub.unkIdx < (dbCamera->sub.nPoints - 1)) {
|
||||
@@ -1053,7 +1053,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->sub.unkIdx = 0;
|
||||
}
|
||||
} else {
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CDOWN)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CDOWN)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
if (dbCamera->sub.unkIdx < (dbCamera->sub.nPoints - 1)) {
|
||||
@@ -1123,7 +1123,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
break;
|
||||
case 1:
|
||||
dbCamera->unk_3C = true;
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DUP)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DUP)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
if (dbCamera->sub.unk_0A == 0) {
|
||||
@@ -1132,7 +1132,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->sub.unk_0A--;
|
||||
}
|
||||
}
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DDOWN)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DDOWN)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
if (dbCamera->sub.unk_0A == 5) {
|
||||
@@ -1141,12 +1141,12 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->sub.unk_0A++;
|
||||
}
|
||||
}
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DLEFT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DLEFT)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
switch (dbCamera->sub.unk_0A) {
|
||||
case 1:
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
|
||||
dbCamera->sub.lookAt[dbCamera->sub.unkIdx].nextPointFrame -= 5;
|
||||
} else {
|
||||
dbCamera->sub.lookAt[dbCamera->sub.unkIdx].nextPointFrame--;
|
||||
@@ -1178,7 +1178,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->sub.unk_0C = false;
|
||||
break;
|
||||
case 2:
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
|
||||
dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll -= 5;
|
||||
dbCamera->roll = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll;
|
||||
} else {
|
||||
@@ -1190,7 +1190,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
}
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_DLEFT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_DLEFT)) {
|
||||
if ((D_8012D10C++ % 5) == 0) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
@@ -1199,7 +1199,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
|
||||
switch (dbCamera->sub.unk_0A) {
|
||||
case 0:
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
|
||||
dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle -= 1.0f;
|
||||
dbCamera->fov = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle;
|
||||
} else {
|
||||
@@ -1208,7 +1208,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
|
||||
dbCamera->sub.nFrames -= 10;
|
||||
} else {
|
||||
dbCamera->sub.nFrames--;
|
||||
@@ -1230,13 +1230,13 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
}
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DRIGHT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DRIGHT)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
|
||||
switch (dbCamera->sub.unk_0A) {
|
||||
case 1:
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
|
||||
dbCamera->sub.lookAt[dbCamera->sub.unkIdx].nextPointFrame += 5;
|
||||
} else {
|
||||
dbCamera->sub.lookAt[dbCamera->sub.unkIdx].nextPointFrame++;
|
||||
@@ -1267,7 +1267,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->sub.unk_0C = true;
|
||||
break;
|
||||
case 2:
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
|
||||
dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll += 5;
|
||||
dbCamera->roll = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll;
|
||||
} else {
|
||||
@@ -1278,7 +1278,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_DRIGHT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_DRIGHT)) {
|
||||
if ((D_8012D10C++ % 5) == 0) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
@@ -1287,7 +1287,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
|
||||
switch (dbCamera->sub.unk_0A) {
|
||||
case 0:
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
|
||||
dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle += 1.0f;
|
||||
dbCamera->fov = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle;
|
||||
} else {
|
||||
@@ -1296,7 +1296,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
|
||||
dbCamera->sub.nFrames += 10;
|
||||
} else {
|
||||
dbCamera->sub.nFrames++;
|
||||
@@ -1398,11 +1398,11 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
}
|
||||
|
||||
DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 0.02f, 2.0f, 0.02f,
|
||||
0xFF, 0xFF, 0x7F, 0x40, 0, cam->globalCtx->view.gfxCtx);
|
||||
0xFF, 0xFF, 0x7F, 0x40, 0, cam->play->view.gfxCtx);
|
||||
DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 2.0f, 0.02f, 0.02f,
|
||||
0x7F, 0xFF, 0xFF, 0x40, 0, cam->globalCtx->view.gfxCtx);
|
||||
0x7F, 0xFF, 0xFF, 0x40, 0, cam->play->view.gfxCtx);
|
||||
DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 0.02f, 0.02f, 2.0f,
|
||||
0xFF, 0x7F, 0xFF, 0x40, 0, cam->globalCtx->view.gfxCtx);
|
||||
0xFF, 0x7F, 0xFF, 0x40, 0, cam->play->view.gfxCtx);
|
||||
if (dbCamera->sub.unk_08 == 2) {
|
||||
for (i = 0; i < (dbCamera->sub.nPoints - 1); i++) {
|
||||
if (dbCamera->sub.mode != 1) {
|
||||
@@ -1416,14 +1416,14 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
spAA = dbCamera->sub.lookAt[i].cameraRoll * 0xB6;
|
||||
if (i == dbCamera->sub.unkIdx) {
|
||||
DebugDisplay_AddObject(spAC.x, spAC.y, spAC.z, spFC.pitch * -1, spFC.yaw, spAA, .5f, .5f, .5f,
|
||||
0x7F, 0xFF, 0x7F, 0x80, 5, cam->globalCtx->view.gfxCtx);
|
||||
0x7F, 0xFF, 0x7F, 0x80, 5, cam->play->view.gfxCtx);
|
||||
DebugDisplay_AddObject(spB8.x, spB8.y, spB8.z, spFC.pitch * -1, spFC.yaw, spAA, 1.5f, 2.0f,
|
||||
1.0f, 0x7F, 0xFF, 0x7F, 0x80, 4, cam->globalCtx->view.gfxCtx);
|
||||
1.0f, 0x7F, 0xFF, 0x7F, 0x80, 4, cam->play->view.gfxCtx);
|
||||
} else {
|
||||
DebugDisplay_AddObject(spAC.x, spAC.y, spAC.z, spFC.pitch * -1, spFC.yaw, spAA, .5f, .5f, .5f,
|
||||
0xFF, 0x7F, 0x7F, 0x80, 5, cam->globalCtx->view.gfxCtx);
|
||||
0xFF, 0x7F, 0x7F, 0x80, 5, cam->play->view.gfxCtx);
|
||||
DebugDisplay_AddObject(spB8.x, spB8.y, spB8.z, spFC.pitch * -1, spFC.yaw, spAA, 1.5f, 2.0f,
|
||||
1.0f, 0xFF, 0x7F, 0x7F, 0x80, 4, cam->globalCtx->view.gfxCtx);
|
||||
1.0f, 0xFF, 0x7F, 0x7F, 0x80, 4, cam->play->view.gfxCtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1433,7 +1433,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->roll = 0;
|
||||
dbCamera->fov = 60.0f;
|
||||
dbCamera->rollDegrees = dbCamera->roll * 1.40625f;
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CLEFT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CLEFT)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
dbCamera->unk_78 = (dbCamera->unk_78 + 1) % 3;
|
||||
@@ -1482,18 +1482,18 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
||||
|
||||
OLib_Vec3fDiffToVecSphGeo(&spA0, &cam->eye, &cam->at);
|
||||
DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 0.02f, 2.0f, 0.02f, 0xFF,
|
||||
0xFF, 0x7F, 0x2D, 0, cam->globalCtx->view.gfxCtx);
|
||||
0xFF, 0x7F, 0x2D, 0, cam->play->view.gfxCtx);
|
||||
DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 2.0f, 0.02f, 0.02f, 0x7F,
|
||||
0xFF, 0xFF, 0x2D, 0, cam->globalCtx->view.gfxCtx);
|
||||
0xFF, 0xFF, 0x2D, 0, cam->play->view.gfxCtx);
|
||||
DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 0.02f, 0.02f, 2.0f, 0xFF,
|
||||
0x7F, 0xFF, 0x2D, 0, cam->globalCtx->view.gfxCtx);
|
||||
0x7F, 0xFF, 0x2D, 0, cam->play->view.gfxCtx);
|
||||
DebugDisplay_AddObject(cam->eye.x, cam->eye.y, cam->eye.z, spA0.pitch * -1, spA0.yaw, 0, .5f, .5f, .5f, 0xFF,
|
||||
0x7F, 0x7F, 0x80, 5, cam->globalCtx->view.gfxCtx);
|
||||
0x7F, 0x7F, 0x80, 5, cam->play->view.gfxCtx);
|
||||
DebugDisplay_AddObject(cam->at.x, cam->at.y, cam->at.z, spA0.pitch * -1, spA0.yaw, 0, 1.5f, 2.0f, 1.0f, 0xFF,
|
||||
0x7F, 0x7F, 0x80, 4, cam->globalCtx->view.gfxCtx);
|
||||
0x7F, 0x7F, 0x80, 4, cam->play->view.gfxCtx);
|
||||
OLib_Vec3fDiffToVecSphGeo(&spA0, &cam->eyeNext, &cam->at);
|
||||
DebugDisplay_AddObject(cam->eyeNext.x, cam->eyeNext.y, cam->eyeNext.z, spA0.pitch * -1, spA0.yaw, 0, .5f, .5f,
|
||||
.5f, 0xFF, 0xC0, 0x7F, 0x50, 5, cam->globalCtx->view.gfxCtx);
|
||||
.5f, 0xFF, 0xC0, 0x7F, 0x50, 5, cam->play->view.gfxCtx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1862,8 +1862,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
case DEMO_CTRL_MENU(ACTION_LOAD, MENU_INFO):
|
||||
case DEMO_CTRL_MENU(ACTION_CLEAR, MENU_INFO): {
|
||||
if ((1 << sCurFileIdx) & sMempakFiles) {
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DLEFT) ||
|
||||
CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DRIGHT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DLEFT) ||
|
||||
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DRIGHT)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
dbCamera->sub.demoCtrlToggleSwitch ^= 1;
|
||||
@@ -1876,7 +1876,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
func_8006376C(0x11, 8, dbCamera->sub.demoCtrlToggleSwitch ? 4 : 7, D_8012CF94);
|
||||
func_8006376C(0x15, 8, dbCamera->sub.demoCtrlToggleSwitch ? 7 : 4, D_8012CF98);
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_A)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A)) {
|
||||
if (dbCamera->sub.demoCtrlToggleSwitch == 0) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
@@ -1898,7 +1898,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
func_8006376C(0xD, 9, dbCamera->sub.demoCtrlToggleSwitch ? 1 : 6, "PRESS B BUTTON");
|
||||
}
|
||||
}
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_B)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
dbCamera->sub.demoCtrlMenu = 0;
|
||||
@@ -1934,8 +1934,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
func_8006376C(0x17, 7, 5, D_8012CFA4);
|
||||
func_8006376C(0xD, 9, (dbCamera->sub.demoCtrlToggleSwitch != 0) ? 1 : 6, "PRESS B BUTTON");
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_A) ||
|
||||
CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_B)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A) ||
|
||||
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
if (dbCamera->sub.demoCtrlMenu == DEMO_CTRL_MENU(ACTION_LOAD, MENU_SUCCESS)) {
|
||||
@@ -1957,8 +1957,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
func_8006376C(0x17, 7, 5, D_8012CFA4);
|
||||
func_8006376C(0xD, 9, (dbCamera->sub.demoCtrlToggleSwitch != 0) ? 1 : 6, "PRESS B BUTTON");
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_A) ||
|
||||
CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_B)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A) ||
|
||||
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
dbCamera->sub.demoCtrlMenu -= 9;
|
||||
@@ -1993,7 +1993,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
sp74[i * 2 + 0] = '-';
|
||||
sp74[i * 2 + 1] = '\0';
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DRIGHT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DRIGHT)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
if (sCurFileIdx >= 4) {
|
||||
@@ -2010,7 +2010,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
dbCamera->sub.demoCtrlActionIdx = ACTION_SAVE;
|
||||
}
|
||||
}
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DLEFT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DLEFT)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
if (sCurFileIdx <= 0) {
|
||||
@@ -2053,24 +2053,24 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
func_8006376C(0xD, 0x1A, 5, D_8012CF60[0]);
|
||||
func_8006376C(0x14, 0x1A, 5, D_8012CF70);
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DUP)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DUP)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx - 1) % 4u;
|
||||
}
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DDOWN)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DDOWN)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx + 1) % 4u;
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_A)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
dbCamera->sub.demoCtrlToggleSwitch = 0;
|
||||
dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(dbCamera->sub.demoCtrlActionIdx, MENU_INFO);
|
||||
}
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_B)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
dbCamera->sub.demoCtrlActionIdx = ACTION_E;
|
||||
@@ -2080,9 +2080,9 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
} else {
|
||||
func_8006376C(0xC, 0x1A, 4, D_8012CF60[0]);
|
||||
func_8006376C(0x13, 0x1A, 4, D_8012CF80);
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_B) ||
|
||||
CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DUP) ||
|
||||
CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DDOWN)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B) ||
|
||||
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DUP) ||
|
||||
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DDOWN)) {
|
||||
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
@@ -2096,14 +2096,14 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
break;
|
||||
|
||||
default: {
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DUP)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DUP)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO);
|
||||
dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx - 1) % 4u;
|
||||
sCurFileIdx = 0;
|
||||
}
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DDOWN)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DDOWN)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO);
|
||||
@@ -2117,7 +2117,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
func_8006376C(4, 7, 5, D_8012CF4C);
|
||||
func_8006376C(D_8016110C * 2 + 6, 7, 7, ">");
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CUP)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CUP)) {
|
||||
if (D_8016110C > 0) {
|
||||
D_8016110C--;
|
||||
}
|
||||
@@ -2125,7 +2125,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
sDbCamAnim.curFrame = 0.0f;
|
||||
sDbCamAnim.keyframe = 0;
|
||||
sDbCamAnim.unk_04 = 0;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CDOWN)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CDOWN)) {
|
||||
if (D_8016110C < 14) {
|
||||
D_8016110C++;
|
||||
}
|
||||
@@ -2133,7 +2133,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
sDbCamAnim.curFrame = 0.0f;
|
||||
sDbCamAnim.keyframe = 0;
|
||||
sDbCamAnim.unk_04 = 0;
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CLEFT)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CLEFT)) {
|
||||
sDbCamAnim.unk_0A = 0;
|
||||
Interface_ChangeAlpha(2);
|
||||
ShrinkWindow_SetVal(0);
|
||||
@@ -2153,7 +2153,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[1].press.button, BTN_CRIGHT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[1].press.button, BTN_CRIGHT)) {
|
||||
D_8015FCC8 = 0;
|
||||
gSaveContext.cutsceneIndex = 0xFFFD;
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
@@ -2167,7 +2167,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_L)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_L)) {
|
||||
if (sp74[sCurFileIdx] == '?') {
|
||||
sLastFileIdx = -1;
|
||||
D_801612EA = '*';
|
||||
@@ -2176,7 +2176,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
D_801612EA = sDbCameraCuts[idx1].letter;
|
||||
}
|
||||
if (1) {}
|
||||
} else if (!CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L)) {
|
||||
} else if (!CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
|
||||
if (sLastFileIdx != -1) {
|
||||
switch (sp74[sCurFileIdx]) {
|
||||
case '?':
|
||||
@@ -2218,7 +2218,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
sLastFileIdx = -1;
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_A)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A)) {
|
||||
if (sp74[sCurFileIdx] == '?') {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
@@ -2229,7 +2229,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
}
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_B)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) {
|
||||
if (sp74[sCurFileIdx] != '?' && sp74[sCurFileIdx] != '-') {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
@@ -2238,7 +2238,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
}
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_R)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_R)) {
|
||||
if (sp74[sCurFileIdx] != '?' && sp74[sCurFileIdx] != '-') {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
@@ -2262,7 +2262,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
}
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DRIGHT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DRIGHT)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
if (sCurFileIdx == 0x1E) {
|
||||
@@ -2271,22 +2271,22 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
sCurFileIdx++;
|
||||
}
|
||||
}
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_DLEFT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DLEFT)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
sCurFileIdx = (sCurFileIdx == 0) ? 0x1E : sCurFileIdx - 1;
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L) &&
|
||||
CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CRIGHT)) {
|
||||
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L) &&
|
||||
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CRIGHT)) {
|
||||
for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) {
|
||||
osSyncPrintf("###%2d:(%c) (%d %d) %d %d %d\n", i, sDbCameraCuts[i].letter,
|
||||
sDbCameraCuts[i].position, sDbCameraCuts[i].lookAt, sDbCameraCuts[i].nFrames,
|
||||
sDbCameraCuts[i].nPoints, sDbCameraCuts[i].mode);
|
||||
}
|
||||
DbCamera_PrintAllCuts(cam);
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_L) &&
|
||||
CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CLEFT)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L) &&
|
||||
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CLEFT)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) {
|
||||
@@ -2295,7 +2295,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
||||
DbCamera_PrintCutBytes(&sDbCameraCuts[i]);
|
||||
}
|
||||
}
|
||||
} else if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].press.button, BTN_CRIGHT)) {
|
||||
} else if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CRIGHT)) {
|
||||
sDbCamAnim.curFrame = 0.0f;
|
||||
sDbCamAnim.keyframe = 0;
|
||||
sDbCamAnim.unk_04 = 0.0f;
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
|
||||
void FlagSet_Update(GlobalContext* globalCtx) {
|
||||
void FlagSet_Update(PlayState* play) {
|
||||
static s32 entryIdx = 0;
|
||||
static u32 curBit = 0;
|
||||
static s32 timer = 0;
|
||||
@@ -35,8 +35,8 @@ void FlagSet_Update(GlobalContext* globalCtx) {
|
||||
{ &gSaveContext.eventInf[2], "event_inf[2]" }, { &gSaveContext.eventInf[3], "event_inf[3]" },
|
||||
};
|
||||
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Input* input = &globalCtx->state.input[0];
|
||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
Input* input = &play->state.input[0];
|
||||
Gfx* gfx;
|
||||
Gfx* polyOpa;
|
||||
|
||||
@@ -145,7 +145,7 @@ void FlagSet_Update(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(input->press.button, BTN_L)) {
|
||||
globalCtx->pauseCtx.debugState = 0;
|
||||
play->pauseCtx.debugState = 0;
|
||||
}
|
||||
|
||||
CLOSE_DISPS(gfxCtx, "../flg_set.c", 241);
|
||||
|
||||
@@ -2147,8 +2147,8 @@ s32 Math3D_YZInSphere(Sphere16* sphere, f32 y, f32 z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Math3D_DrawSphere(GlobalContext* globalCtx, Sphere16* sph) {
|
||||
void Math3D_DrawSphere(PlayState* play, Sphere16* sph) {
|
||||
}
|
||||
|
||||
void Math3D_DrawCylinder(GlobalContext* globalCtx, Cylinder16* cyl) {
|
||||
void Math3D_DrawCylinder(PlayState* play, Cylinder16* cyl) {
|
||||
}
|
||||
|
||||
+532
-541
File diff suppressed because it is too large
Load Diff
+91
-96
@@ -93,7 +93,7 @@ void DynaSSNodeList_SetSSListHead(DynaSSNodeList* nodeList, SSList* ssList, s16*
|
||||
/**
|
||||
* Initialize DynaSSNodeList
|
||||
*/
|
||||
void DynaSSNodeList_Initialize(GlobalContext* globalCtx, DynaSSNodeList* nodeList) {
|
||||
void DynaSSNodeList_Initialize(PlayState* play, DynaSSNodeList* nodeList) {
|
||||
nodeList->tbl = NULL;
|
||||
nodeList->count = 0;
|
||||
}
|
||||
@@ -101,8 +101,8 @@ void DynaSSNodeList_Initialize(GlobalContext* globalCtx, DynaSSNodeList* nodeLis
|
||||
/**
|
||||
* Initialize DynaSSNodeList tbl
|
||||
*/
|
||||
void DynaSSNodeList_Alloc(GlobalContext* globalCtx, DynaSSNodeList* nodeList, s32 max) {
|
||||
nodeList->tbl = THA_AllocEndAlign(&globalCtx->state.tha, max * sizeof(SSNode), -2);
|
||||
void DynaSSNodeList_Alloc(PlayState* play, DynaSSNodeList* nodeList, s32 max) {
|
||||
nodeList->tbl = THA_AllocEndAlign(&play->state.tha, max * sizeof(SSNode), -2);
|
||||
|
||||
ASSERT(nodeList->tbl != NULL, "psst->tbl != NULL", "../z_bgcheck.c", 1811);
|
||||
|
||||
@@ -1344,7 +1344,7 @@ s32 BgCheck_PolyIntersectsSubdivision(Vec3f* min, Vec3f* max, CollisionPoly* pol
|
||||
* Initialize StaticLookup Table
|
||||
* returns size of table, in bytes
|
||||
*/
|
||||
u32 BgCheck_InitializeStaticLookup(CollisionContext* colCtx, GlobalContext* globalCtx, StaticLookup* lookupTbl) {
|
||||
u32 BgCheck_InitializeStaticLookup(CollisionContext* colCtx, PlayState* play, StaticLookup* lookupTbl) {
|
||||
Vec3s* vtxList;
|
||||
CollisionPoly* polyList;
|
||||
s32 polyMax;
|
||||
@@ -1428,7 +1428,7 @@ u32 BgCheck_InitializeStaticLookup(CollisionContext* colCtx, GlobalContext* glob
|
||||
/**
|
||||
* Is current scene a SPOT scene
|
||||
*/
|
||||
s32 BgCheck_IsSpotScene(GlobalContext* globalCtx) {
|
||||
s32 BgCheck_IsSpotScene(PlayState* play) {
|
||||
static s16 spotScenes[] = {
|
||||
SCENE_SPOT00, SCENE_SPOT01, SCENE_SPOT02, SCENE_SPOT03, SCENE_SPOT04, SCENE_SPOT05, SCENE_SPOT06,
|
||||
SCENE_SPOT07, SCENE_SPOT08, SCENE_SPOT09, SCENE_SPOT10, SCENE_SPOT11, SCENE_SPOT12, SCENE_SPOT13,
|
||||
@@ -1437,7 +1437,7 @@ s32 BgCheck_IsSpotScene(GlobalContext* globalCtx) {
|
||||
s16* i;
|
||||
|
||||
for (i = spotScenes; i < spotScenes + ARRAY_COUNT(spotScenes); i++) {
|
||||
if (globalCtx->sceneNum == *i) {
|
||||
if (play->sceneNum == *i) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1491,7 +1491,7 @@ typedef struct {
|
||||
/**
|
||||
* Allocate CollisionContext
|
||||
*/
|
||||
void BgCheck_Allocate(CollisionContext* colCtx, GlobalContext* globalCtx, CollisionHeader* colHeader) {
|
||||
void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader* colHeader) {
|
||||
static BgCheckSceneSubdivisionEntry sceneSubdivisionList[] = {
|
||||
{ SCENE_HAKADAN, { 23, 7, 14 }, -1 },
|
||||
{ SCENE_BMORI1, { 38, 1, 38 }, -1 },
|
||||
@@ -1512,7 +1512,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, GlobalContext* globalCtx, Collis
|
||||
osSyncPrintf("/*---------------- BGCheck バッファーメモリサイズ -------------*/\n");
|
||||
|
||||
if (YREG(15) == 0x10 || YREG(15) == 0x20 || YREG(15) == 0x30 || YREG(15) == 0x40) {
|
||||
if (globalCtx->sceneNum == SCENE_MALON_STABLE) {
|
||||
if (play->sceneNum == SCENE_MALON_STABLE) {
|
||||
// "/* BGCheck LonLon Size %dbyte */\n"
|
||||
osSyncPrintf("/* BGCheck LonLonサイズ %dbyte */\n", 0x3520);
|
||||
colCtx->memSize = 0x3520;
|
||||
@@ -1527,7 +1527,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, GlobalContext* globalCtx, Collis
|
||||
colCtx->subdivAmount.x = 2;
|
||||
colCtx->subdivAmount.y = 2;
|
||||
colCtx->subdivAmount.z = 2;
|
||||
} else if (BgCheck_IsSpotScene(globalCtx) == true) {
|
||||
} else if (BgCheck_IsSpotScene(play) == true) {
|
||||
colCtx->memSize = 0xF000;
|
||||
// "/* BGCheck Spot Size %dbyte */\n"
|
||||
osSyncPrintf("/* BGCheck Spot用サイズ %dbyte */\n", 0xF000);
|
||||
@@ -1538,7 +1538,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, GlobalContext* globalCtx, Collis
|
||||
colCtx->subdivAmount.y = 4;
|
||||
colCtx->subdivAmount.z = 16;
|
||||
} else {
|
||||
if (BgCheck_TryGetCustomMemsize(globalCtx->sceneNum, &customMemSize)) {
|
||||
if (BgCheck_TryGetCustomMemsize(play->sceneNum, &customMemSize)) {
|
||||
colCtx->memSize = customMemSize;
|
||||
} else {
|
||||
colCtx->memSize = 0x1CC00;
|
||||
@@ -1551,7 +1551,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, GlobalContext* globalCtx, Collis
|
||||
useCustomSubdivisions = false;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sceneSubdivisionList); i++) {
|
||||
if (globalCtx->sceneNum == sceneSubdivisionList[i].sceneId) {
|
||||
if (play->sceneNum == sceneSubdivisionList[i].sceneId) {
|
||||
colCtx->subdivAmount.x = sceneSubdivisionList[i].subdivAmount.x;
|
||||
colCtx->subdivAmount.y = sceneSubdivisionList[i].subdivAmount.y;
|
||||
colCtx->subdivAmount.z = sceneSubdivisionList[i].subdivAmount.z;
|
||||
@@ -1566,7 +1566,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, GlobalContext* globalCtx, Collis
|
||||
}
|
||||
}
|
||||
colCtx->lookupTbl = THA_AllocEndAlign(
|
||||
&globalCtx->state.tha,
|
||||
&play->state.tha,
|
||||
colCtx->subdivAmount.x * sizeof(StaticLookup) * colCtx->subdivAmount.y * colCtx->subdivAmount.z, ~1);
|
||||
if (colCtx->lookupTbl == NULL) {
|
||||
LogUtils_HungupThread("../z_bgcheck.c", 4176);
|
||||
@@ -1599,15 +1599,15 @@ void BgCheck_Allocate(CollisionContext* colCtx, GlobalContext* globalCtx, Collis
|
||||
}
|
||||
|
||||
SSNodeList_Initialize(&colCtx->polyNodes);
|
||||
SSNodeList_Alloc(globalCtx, &colCtx->polyNodes, tblMax, colCtx->colHeader->numPolygons);
|
||||
SSNodeList_Alloc(play, &colCtx->polyNodes, tblMax, colCtx->colHeader->numPolygons);
|
||||
|
||||
lookupTblMemSize = BgCheck_InitializeStaticLookup(colCtx, globalCtx, colCtx->lookupTbl);
|
||||
lookupTblMemSize = BgCheck_InitializeStaticLookup(colCtx, play, colCtx->lookupTbl);
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("/*---結局 BG使用サイズ %dbyte---*/\n", memSize + lookupTblMemSize);
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
DynaPoly_Init(globalCtx, &colCtx->dyna);
|
||||
DynaPoly_Alloc(globalCtx, &colCtx->dyna);
|
||||
DynaPoly_Init(play, &colCtx->dyna);
|
||||
DynaPoly_Alloc(play, &colCtx->dyna);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1650,7 +1650,7 @@ s32 BgCheck_PosInStaticBoundingBox(CollisionContext* colCtx, Vec3f* pos) {
|
||||
* returns the yIntersect of the nearest poly found directly below `pos`, or BGCHECK_Y_MIN if no floor detected
|
||||
* returns the poly found in `outPoly`, and the bgId of the entity in `outBgId`
|
||||
*/
|
||||
f32 BgCheck_RaycastFloorImpl(GlobalContext* globalCtx, CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly,
|
||||
f32 BgCheck_RaycastFloorImpl(PlayState* play, CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly,
|
||||
s32* outBgId, Vec3f* pos, Actor* actor, u32 arg7, f32 chkDist) {
|
||||
|
||||
f32 yIntersectDyna;
|
||||
@@ -1695,7 +1695,7 @@ f32 BgCheck_RaycastFloorImpl(GlobalContext* globalCtx, CollisionContext* colCtx,
|
||||
dynaRaycast.actor = actor;
|
||||
dynaRaycast.unk_20 = arg7;
|
||||
dynaRaycast.chkDist = chkDist;
|
||||
dynaRaycast.globalCtx = globalCtx;
|
||||
dynaRaycast.play = play;
|
||||
dynaRaycast.resultPoly = outPoly;
|
||||
dynaRaycast.bgId = outBgId;
|
||||
|
||||
@@ -1735,11 +1735,10 @@ f32 BgCheck_EntityRaycastFloor1(CollisionContext* colCtx, CollisionPoly** outPol
|
||||
* Public raycast toward floor
|
||||
* returns yIntersect of the poly found, or BGCHECK_Y_MIN if no poly detected
|
||||
*/
|
||||
f32 BgCheck_EntityRaycastFloor2(GlobalContext* globalCtx, CollisionContext* colCtx, CollisionPoly** outPoly,
|
||||
Vec3f* pos) {
|
||||
f32 BgCheck_EntityRaycastFloor2(PlayState* play, CollisionContext* colCtx, CollisionPoly** outPoly, Vec3f* pos) {
|
||||
s32 bgId;
|
||||
|
||||
return BgCheck_RaycastFloorImpl(globalCtx, colCtx, COLPOLY_IGNORE_ENTITY, outPoly, &bgId, pos, NULL, 0x1C, 1.0f);
|
||||
return BgCheck_RaycastFloorImpl(play, colCtx, COLPOLY_IGNORE_ENTITY, outPoly, &bgId, pos, NULL, 0x1C, 1.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1763,9 +1762,9 @@ f32 BgCheck_EntityRaycastFloor4(CollisionContext* colCtx, CollisionPoly** outPol
|
||||
* Public raycast toward floor
|
||||
* returns yIntersect of the poly found, or BGCHECK_Y_MIN if no poly detected
|
||||
*/
|
||||
f32 BgCheck_EntityRaycastFloor5(GlobalContext* globalCtx, CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId,
|
||||
f32 BgCheck_EntityRaycastFloor5(PlayState* play, CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId,
|
||||
Actor* actor, Vec3f* pos) {
|
||||
return BgCheck_RaycastFloorImpl(globalCtx, colCtx, COLPOLY_IGNORE_ENTITY, outPoly, bgId, pos, actor, 0x1C, 1.0f);
|
||||
return BgCheck_RaycastFloorImpl(play, colCtx, COLPOLY_IGNORE_ENTITY, outPoly, bgId, pos, actor, 0x1C, 1.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2412,14 +2411,14 @@ void SSNodeList_Initialize(SSNodeList* this) {
|
||||
* tblMax is the number of SSNode records to allocate
|
||||
* numPolys is the number of polygons defined within the CollisionHeader
|
||||
*/
|
||||
void SSNodeList_Alloc(GlobalContext* globalCtx, SSNodeList* this, s32 tblMax, s32 numPolys) {
|
||||
void SSNodeList_Alloc(PlayState* play, SSNodeList* this, s32 tblMax, s32 numPolys) {
|
||||
this->max = tblMax;
|
||||
this->count = 0;
|
||||
this->tbl = THA_AllocEndAlign(&globalCtx->state.tha, tblMax * sizeof(SSNode), -2);
|
||||
this->tbl = THA_AllocEndAlign(&play->state.tha, tblMax * sizeof(SSNode), -2);
|
||||
|
||||
ASSERT(this->tbl != NULL, "this->short_slist_node_tbl != NULL", "../z_bgcheck.c", 5975);
|
||||
|
||||
this->polyCheckTbl = GameState_Alloc(&globalCtx->state, numPolys, "../z_bgcheck.c", 5979);
|
||||
this->polyCheckTbl = GameState_Alloc(&play->state, numPolys, "../z_bgcheck.c", 5979);
|
||||
|
||||
ASSERT(this->polyCheckTbl != NULL, "this->polygon_check != NULL", "../z_bgcheck.c", 5981);
|
||||
}
|
||||
@@ -2506,7 +2505,7 @@ void DynaLookup_ResetVtxStartIndex(u16* vtxStartIndex) {
|
||||
/**
|
||||
* Initialize BgActor
|
||||
*/
|
||||
void BgActor_Initialize(GlobalContext* globalCtx, BgActor* bgActor) {
|
||||
void BgActor_Initialize(PlayState* play, BgActor* bgActor) {
|
||||
bgActor->actor = NULL;
|
||||
bgActor->colHeader = NULL;
|
||||
ScaleRotPos_Initialize(&bgActor->prevTransform);
|
||||
@@ -2549,8 +2548,8 @@ void DynaPoly_NullPolyList(CollisionPoly** polyList) {
|
||||
/**
|
||||
* Allocate dyna.polyList
|
||||
*/
|
||||
void DynaPoly_AllocPolyList(GlobalContext* globalCtx, CollisionPoly** polyList, s32 numPolys) {
|
||||
*polyList = THA_AllocEndAlign(&globalCtx->state.tha, numPolys * sizeof(CollisionPoly), -2);
|
||||
void DynaPoly_AllocPolyList(PlayState* play, CollisionPoly** polyList, s32 numPolys) {
|
||||
*polyList = THA_AllocEndAlign(&play->state.tha, numPolys * sizeof(CollisionPoly), -2);
|
||||
ASSERT(*polyList != NULL, "ptbl->pbuf != NULL", "../z_bgcheck.c", 6247);
|
||||
}
|
||||
|
||||
@@ -2564,15 +2563,15 @@ void DynaPoly_NullVtxList(Vec3s** vtxList) {
|
||||
/**
|
||||
* Allocate dyna.vtxList
|
||||
*/
|
||||
void DynaPoly_AllocVtxList(GlobalContext* globalCtx, Vec3s** vtxList, s32 numVtx) {
|
||||
*vtxList = THA_AllocEndAlign(&globalCtx->state.tha, numVtx * sizeof(Vec3s), -2);
|
||||
void DynaPoly_AllocVtxList(PlayState* play, Vec3s** vtxList, s32 numVtx) {
|
||||
*vtxList = THA_AllocEndAlign(&play->state.tha, numVtx * sizeof(Vec3s), -2);
|
||||
ASSERT(*vtxList != NULL, "ptbl->pbuf != NULL", "../z_bgcheck.c", 6277);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update BgActor's prevTransform
|
||||
*/
|
||||
void DynaPoly_SetBgActorPrevTransform(GlobalContext* globalCtx, BgActor* bgActor) {
|
||||
void DynaPoly_SetBgActorPrevTransform(PlayState* play, BgActor* bgActor) {
|
||||
bgActor->prevTransform = bgActor->curTransform;
|
||||
}
|
||||
|
||||
@@ -2589,39 +2588,38 @@ s32 DynaPoly_IsBgIdBgActor(s32 bgId) {
|
||||
/**
|
||||
* Init DynaCollisionContext
|
||||
*/
|
||||
void DynaPoly_Init(GlobalContext* globalCtx, DynaCollisionContext* dyna) {
|
||||
void DynaPoly_Init(PlayState* play, DynaCollisionContext* dyna) {
|
||||
dyna->bitFlag = DYNAPOLY_INVALIDATE_LOOKUP;
|
||||
DynaPoly_NullPolyList(&dyna->polyList);
|
||||
DynaPoly_NullVtxList(&dyna->vtxList);
|
||||
DynaSSNodeList_Initialize(globalCtx, &dyna->polyNodes);
|
||||
DynaSSNodeList_Initialize(play, &dyna->polyNodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set DynaCollisionContext
|
||||
*/
|
||||
void DynaPoly_Alloc(GlobalContext* globalCtx, DynaCollisionContext* dyna) {
|
||||
void DynaPoly_Alloc(PlayState* play, DynaCollisionContext* dyna) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < BG_ACTOR_MAX; i++) {
|
||||
BgActor_Initialize(globalCtx, &dyna->bgActors[i]);
|
||||
BgActor_Initialize(play, &dyna->bgActors[i]);
|
||||
dyna->bgActorFlags[i] = 0;
|
||||
}
|
||||
DynaPoly_NullPolyList(&dyna->polyList);
|
||||
DynaPoly_AllocPolyList(globalCtx, &dyna->polyList, dyna->polyListMax);
|
||||
DynaPoly_AllocPolyList(play, &dyna->polyList, dyna->polyListMax);
|
||||
|
||||
DynaPoly_NullVtxList(&dyna->vtxList);
|
||||
DynaPoly_AllocVtxList(globalCtx, &dyna->vtxList, dyna->vtxListMax);
|
||||
DynaPoly_AllocVtxList(play, &dyna->vtxList, dyna->vtxListMax);
|
||||
|
||||
DynaSSNodeList_Initialize(globalCtx, &dyna->polyNodes);
|
||||
DynaSSNodeList_Alloc(globalCtx, &dyna->polyNodes, dyna->polyNodesMax);
|
||||
DynaSSNodeList_Initialize(play, &dyna->polyNodes);
|
||||
DynaSSNodeList_Alloc(play, &dyna->polyNodes, dyna->polyNodesMax);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set BgActor
|
||||
* original name: DynaPolyInfo_setActor
|
||||
*/
|
||||
s32 DynaPoly_SetBgActor(GlobalContext* globalCtx, DynaCollisionContext* dyna, Actor* actor,
|
||||
CollisionHeader* colHeader) {
|
||||
s32 DynaPoly_SetBgActor(PlayState* play, DynaCollisionContext* dyna, Actor* actor, CollisionHeader* colHeader) {
|
||||
s32 bgId;
|
||||
s32 foundSlot = false;
|
||||
|
||||
@@ -2662,28 +2660,28 @@ DynaPolyActor* DynaPoly_GetActor(CollisionContext* colCtx, s32 bgId) {
|
||||
return (DynaPolyActor*)colCtx->dyna.bgActors[bgId].actor;
|
||||
}
|
||||
|
||||
void func_8003EBF8(GlobalContext* globalCtx, DynaCollisionContext* dyna, s32 bgId) {
|
||||
void func_8003EBF8(PlayState* play, DynaCollisionContext* dyna, s32 bgId) {
|
||||
if (DynaPoly_IsBgIdBgActor(bgId)) {
|
||||
dyna->bgActorFlags[bgId] |= 4;
|
||||
dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP;
|
||||
}
|
||||
}
|
||||
|
||||
void func_8003EC50(GlobalContext* globalCtx, DynaCollisionContext* dyna, s32 bgId) {
|
||||
void func_8003EC50(PlayState* play, DynaCollisionContext* dyna, s32 bgId) {
|
||||
if (DynaPoly_IsBgIdBgActor(bgId)) {
|
||||
dyna->bgActorFlags[bgId] &= ~4;
|
||||
dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP;
|
||||
}
|
||||
}
|
||||
|
||||
void func_8003ECA8(GlobalContext* globalCtx, DynaCollisionContext* dyna, s32 bgId) {
|
||||
void func_8003ECA8(PlayState* play, DynaCollisionContext* dyna, s32 bgId) {
|
||||
if (DynaPoly_IsBgIdBgActor(bgId)) {
|
||||
dyna->bgActorFlags[bgId] |= 8;
|
||||
dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP;
|
||||
}
|
||||
}
|
||||
|
||||
void func_8003ED00(GlobalContext* globalCtx, DynaCollisionContext* dyna, s32 bgId) {
|
||||
void func_8003ED00(PlayState* play, DynaCollisionContext* dyna, s32 bgId) {
|
||||
if (DynaPoly_IsBgIdBgActor(bgId)) {
|
||||
dyna->bgActorFlags[bgId] &= ~8;
|
||||
dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP;
|
||||
@@ -2693,7 +2691,7 @@ void func_8003ED00(GlobalContext* globalCtx, DynaCollisionContext* dyna, s32 bgI
|
||||
/**
|
||||
* original name: DynaPolyInfo_delReserve
|
||||
*/
|
||||
void DynaPoly_DeleteBgActor(GlobalContext* globalCtx, DynaCollisionContext* dyna, s32 bgId) {
|
||||
void DynaPoly_DeleteBgActor(PlayState* play, DynaCollisionContext* dyna, s32 bgId) {
|
||||
DynaPolyActor* actor;
|
||||
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
@@ -2718,7 +2716,7 @@ void DynaPoly_DeleteBgActor(GlobalContext* globalCtx, DynaCollisionContext* dyna
|
||||
return;
|
||||
}
|
||||
}
|
||||
actor = DynaPoly_GetActor(&globalCtx->colCtx, bgId);
|
||||
actor = DynaPoly_GetActor(&play->colCtx, bgId);
|
||||
if (actor != NULL) {
|
||||
|
||||
actor->bgId = BGACTOR_NEG_ONE;
|
||||
@@ -2727,14 +2725,14 @@ void DynaPoly_DeleteBgActor(GlobalContext* globalCtx, DynaCollisionContext* dyna
|
||||
}
|
||||
}
|
||||
|
||||
void func_8003EE6C(GlobalContext* globalCtx, DynaCollisionContext* dyna) {
|
||||
void func_8003EE6C(PlayState* play, DynaCollisionContext* dyna) {
|
||||
dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: DynaPolyInfo_expandSRT
|
||||
*/
|
||||
void DynaPoly_ExpandSRT(GlobalContext* globalCtx, DynaCollisionContext* dyna, s32 bgId, s32* vtxStartIndex,
|
||||
void DynaPoly_ExpandSRT(PlayState* play, DynaCollisionContext* dyna, s32 bgId, s32* vtxStartIndex,
|
||||
s32* polyStartIndex) {
|
||||
MtxF mtx;
|
||||
Actor* actor;
|
||||
@@ -2915,13 +2913,13 @@ void DynaPoly_ExpandSRT(GlobalContext* globalCtx, DynaCollisionContext* dyna, s3
|
||||
}
|
||||
}
|
||||
|
||||
void func_8003F8EC(GlobalContext* globalCtx, DynaCollisionContext* dyna, Actor* actor) {
|
||||
void func_8003F8EC(PlayState* play, DynaCollisionContext* dyna, Actor* actor) {
|
||||
DynaPolyActor* dynaActor;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < BG_ACTOR_MAX; i++) {
|
||||
if (dyna->bgActorFlags[i] & 1) {
|
||||
dynaActor = DynaPoly_GetActor(&globalCtx->colCtx, i);
|
||||
dynaActor = DynaPoly_GetActor(&play->colCtx, i);
|
||||
if (dynaActor != NULL && &dynaActor->actor == actor) {
|
||||
func_800434A0((DynaPolyActor*)actor);
|
||||
return;
|
||||
@@ -2933,7 +2931,7 @@ void func_8003F8EC(GlobalContext* globalCtx, DynaCollisionContext* dyna, Actor*
|
||||
/**
|
||||
* DynaPolyInfo_setup
|
||||
*/
|
||||
void DynaPoly_Setup(GlobalContext* globalCtx, DynaCollisionContext* dyna) {
|
||||
void DynaPoly_Setup(PlayState* play, DynaCollisionContext* dyna) {
|
||||
DynaPolyActor* actor;
|
||||
s32 vtxStartIndex;
|
||||
s32 polyStartIndex;
|
||||
@@ -2953,7 +2951,7 @@ void DynaPoly_Setup(GlobalContext* globalCtx, DynaCollisionContext* dyna) {
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
dyna->bgActorFlags[i] = 0;
|
||||
BgActor_Initialize(globalCtx, &dyna->bgActors[i]);
|
||||
BgActor_Initialize(play, &dyna->bgActors[i]);
|
||||
dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP;
|
||||
}
|
||||
if (dyna->bgActors[i].actor != NULL && dyna->bgActors[i].actor->update == NULL) {
|
||||
@@ -2961,14 +2959,14 @@ void DynaPoly_Setup(GlobalContext* globalCtx, DynaCollisionContext* dyna) {
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("DynaPolyInfo_setup():削除 index=%d\n", i);
|
||||
osSyncPrintf(VT_RST);
|
||||
actor = DynaPoly_GetActor(&globalCtx->colCtx, i);
|
||||
actor = DynaPoly_GetActor(&play->colCtx, i);
|
||||
if (actor == NULL) {
|
||||
return;
|
||||
}
|
||||
actor->bgId = BGACTOR_NEG_ONE;
|
||||
dyna->bgActorFlags[i] = 0;
|
||||
|
||||
BgActor_Initialize(globalCtx, &dyna->bgActors[i]);
|
||||
BgActor_Initialize(play, &dyna->bgActors[i]);
|
||||
dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP;
|
||||
}
|
||||
}
|
||||
@@ -2976,7 +2974,7 @@ void DynaPoly_Setup(GlobalContext* globalCtx, DynaCollisionContext* dyna) {
|
||||
polyStartIndex = 0;
|
||||
for (i = 0; i < BG_ACTOR_MAX; i++) {
|
||||
if (dyna->bgActorFlags[i] & 1) {
|
||||
DynaPoly_ExpandSRT(globalCtx, dyna, i, &vtxStartIndex, &polyStartIndex);
|
||||
DynaPoly_ExpandSRT(play, dyna, i, &vtxStartIndex, &polyStartIndex);
|
||||
}
|
||||
}
|
||||
dyna->bitFlag &= ~DYNAPOLY_INVALIDATE_LOOKUP;
|
||||
@@ -2985,12 +2983,12 @@ void DynaPoly_Setup(GlobalContext* globalCtx, DynaCollisionContext* dyna) {
|
||||
/**
|
||||
* Update all BgActor's previous ScaleRotPos
|
||||
*/
|
||||
void DynaPoly_UpdateBgActorTransforms(GlobalContext* globalCtx, DynaCollisionContext* dyna) {
|
||||
void DynaPoly_UpdateBgActorTransforms(PlayState* play, DynaCollisionContext* dyna) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < BG_ACTOR_MAX; i++) {
|
||||
if (dyna->bgActorFlags[i] & 1) {
|
||||
DynaPoly_SetBgActorPrevTransform(globalCtx, &dyna->bgActors[i]);
|
||||
DynaPoly_SetBgActorPrevTransform(play, &dyna->bgActors[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3129,10 +3127,10 @@ f32 BgCheck_RaycastFloorDyna(DynaRaycast* dynaRaycast) {
|
||||
}
|
||||
|
||||
dynaActor = DynaPoly_GetActor(dynaRaycast->colCtx, *dynaRaycast->bgId);
|
||||
if ((result != BGCHECK_Y_MIN) && (dynaActor != NULL) && (dynaRaycast->globalCtx != NULL)) {
|
||||
pauseState = dynaRaycast->globalCtx->pauseCtx.state != 0;
|
||||
if ((result != BGCHECK_Y_MIN) && (dynaActor != NULL) && (dynaRaycast->play != NULL)) {
|
||||
pauseState = dynaRaycast->play->pauseCtx.state != 0;
|
||||
if (pauseState == 0) {
|
||||
pauseState = dynaRaycast->globalCtx->pauseCtx.debugState != 0;
|
||||
pauseState = dynaRaycast->play->pauseCtx.debugState != 0;
|
||||
}
|
||||
if (!pauseState && (dynaRaycast->colCtx->dyna.bgActorFlags[*dynaRaycast->bgId] & 2)) {
|
||||
curTransform = &dynaRaycast->dyna->bgActors[*dynaRaycast->bgId].curTransform;
|
||||
@@ -3787,7 +3785,7 @@ void CollisionHeader_GetVirtual(void* colHeader, CollisionHeader** dest) {
|
||||
/**
|
||||
* SEGMENT_TO_VIRTUAL all active BgActor CollisionHeaders
|
||||
*/
|
||||
void func_800418D0(CollisionContext* colCtx, GlobalContext* globalCtx) {
|
||||
void func_800418D0(CollisionContext* colCtx, PlayState* play) {
|
||||
DynaCollisionContext* dyna = &colCtx->dyna;
|
||||
s32 i;
|
||||
u16 flag;
|
||||
@@ -3795,7 +3793,7 @@ void func_800418D0(CollisionContext* colCtx, GlobalContext* globalCtx) {
|
||||
for (i = 0; i < BG_ACTOR_MAX; i++) {
|
||||
flag = dyna->bgActorFlags[i];
|
||||
if ((flag & 1) && !(flag & 2)) {
|
||||
Actor_SetObjectDependency(globalCtx, dyna->bgActors[i].actor);
|
||||
Actor_SetObjectDependency(play, dyna->bgActors[i].actor);
|
||||
CollisionHeader_SegmentedToVirtual(dyna->bgActors[i].colHeader);
|
||||
}
|
||||
}
|
||||
@@ -4173,9 +4171,9 @@ f32 zdWaterBoxMaxZ = -967.0f;
|
||||
* returns true if point is within the xz boundaries of an active water box, else false
|
||||
* `ySurface` returns the water box's surface, while `outWaterBox` returns a pointer to the WaterBox
|
||||
*/
|
||||
s32 WaterBox_GetSurface1(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface,
|
||||
s32 WaterBox_GetSurface1(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface,
|
||||
WaterBox** outWaterBox) {
|
||||
if (globalCtx->sceneNum == SCENE_SPOT07) {
|
||||
if (play->sceneNum == SCENE_SPOT07) {
|
||||
if (zdWaterBoxMinX < x && x < zdWaterBoxMaxX && zdWaterBoxMinY < *ySurface && *ySurface < zdWaterBoxMaxY &&
|
||||
zdWaterBoxMinZ < z && z < zdWaterBoxMaxZ) {
|
||||
*outWaterBox = &zdWaterBox;
|
||||
@@ -4183,7 +4181,7 @@ s32 WaterBox_GetSurface1(GlobalContext* globalCtx, CollisionContext* colCtx, f32
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return WaterBox_GetSurfaceImpl(globalCtx, colCtx, x, z, ySurface, outWaterBox);
|
||||
return WaterBox_GetSurfaceImpl(play, colCtx, x, z, ySurface, outWaterBox);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4191,7 +4189,7 @@ s32 WaterBox_GetSurface1(GlobalContext* globalCtx, CollisionContext* colCtx, f32
|
||||
* returns true if point is within the xz boundaries of an active water box, else false
|
||||
* `ySurface` returns the water box's surface, while `outWaterBox` returns a pointer to the WaterBox
|
||||
*/
|
||||
s32 WaterBox_GetSurfaceImpl(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface,
|
||||
s32 WaterBox_GetSurfaceImpl(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface,
|
||||
WaterBox** outWaterBox) {
|
||||
CollisionHeader* colHeader = colCtx->colHeader;
|
||||
u32 room;
|
||||
@@ -4204,7 +4202,7 @@ s32 WaterBox_GetSurfaceImpl(GlobalContext* globalCtx, CollisionContext* colCtx,
|
||||
for (curWaterBox = colHeader->waterBoxes; curWaterBox < colHeader->waterBoxes + colHeader->numWaterBoxes;
|
||||
curWaterBox++) {
|
||||
room = (curWaterBox->properties >> 13) & 0x3F;
|
||||
if (room == (u32)globalCtx->roomCtx.curRoom.num || room == 0x3F) {
|
||||
if (room == (u32)play->roomCtx.curRoom.num || room == 0x3F) {
|
||||
if ((curWaterBox->properties & 0x80000) == 0) {
|
||||
if (curWaterBox->xMin < x && x < curWaterBox->xMin + curWaterBox->xLength) {
|
||||
if (curWaterBox->zMin < z && z < curWaterBox->zMin + curWaterBox->zLength) {
|
||||
@@ -4225,7 +4223,7 @@ s32 WaterBox_GetSurfaceImpl(GlobalContext* globalCtx, CollisionContext* colCtx,
|
||||
* returns the index of the waterbox found, or -1 if no waterbox is found
|
||||
* `outWaterBox` returns the pointer to the waterbox found, or NULL if none is found
|
||||
*/
|
||||
s32 WaterBox_GetSurface2(GlobalContext* globalCtx, CollisionContext* colCtx, Vec3f* pos, f32 surfaceChkDist,
|
||||
s32 WaterBox_GetSurface2(PlayState* play, CollisionContext* colCtx, Vec3f* pos, f32 surfaceChkDist,
|
||||
WaterBox** outWaterBox) {
|
||||
CollisionHeader* colHeader = colCtx->colHeader;
|
||||
s32 room;
|
||||
@@ -4242,7 +4240,7 @@ s32 WaterBox_GetSurface2(GlobalContext* globalCtx, CollisionContext* colCtx, Vec
|
||||
waterBox = &colHeader->waterBoxes[i];
|
||||
|
||||
room = WATERBOX_ROOM(waterBox->properties);
|
||||
if (!(room == globalCtx->roomCtx.curRoom.num || room == 0x3F)) {
|
||||
if (!(room == play->roomCtx.curRoom.num || room == 0x3F)) {
|
||||
continue;
|
||||
}
|
||||
if (waterBox->properties & 0x80000) {
|
||||
@@ -4302,8 +4300,7 @@ u32 WaterBox_GetLightSettingIndex(CollisionContext* colCtx, WaterBox* waterBox)
|
||||
* returns true if point is within the xz boundaries of an active water box, else false
|
||||
* `ySurface` returns the water box's surface, while `outWaterBox` returns a pointer to the WaterBox
|
||||
*/
|
||||
s32 func_800425B0(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface,
|
||||
WaterBox** outWaterBox) {
|
||||
s32 func_800425B0(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox) {
|
||||
CollisionHeader* colHeader = colCtx->colHeader;
|
||||
u32 room;
|
||||
WaterBox* curWaterBox;
|
||||
@@ -4315,7 +4312,7 @@ s32 func_800425B0(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32
|
||||
for (curWaterBox = colHeader->waterBoxes; curWaterBox < colHeader->waterBoxes + colHeader->numWaterBoxes;
|
||||
curWaterBox++) {
|
||||
room = (curWaterBox->properties >> 0xD) & 0x3F;
|
||||
if ((room == (u32)globalCtx->roomCtx.curRoom.num) || (room == 0x3F)) {
|
||||
if ((room == (u32)play->roomCtx.curRoom.num) || (room == 0x3F)) {
|
||||
if ((curWaterBox->properties & 0x80000) != 0) {
|
||||
if (curWaterBox->xMin < x && x < (curWaterBox->xMin + curWaterBox->xLength)) {
|
||||
if (curWaterBox->zMin < z && z < (curWaterBox->zMin + curWaterBox->zLength)) {
|
||||
@@ -4371,8 +4368,8 @@ s32 func_800427B4(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* pointA, Vec
|
||||
/**
|
||||
* Draw a list of dyna polys, specified by `ssList`
|
||||
*/
|
||||
void BgCheck_DrawDynaPolyList(GlobalContext* globalCtx, CollisionContext* colCtx, DynaCollisionContext* dyna,
|
||||
SSList* ssList, u8 r, u8 g, u8 b) {
|
||||
void BgCheck_DrawDynaPolyList(PlayState* play, CollisionContext* colCtx, DynaCollisionContext* dyna, SSList* ssList,
|
||||
u8 r, u8 g, u8 b) {
|
||||
s16 curPolyId;
|
||||
CollisionPoly* poly;
|
||||
SSNode* curNode;
|
||||
@@ -4405,7 +4402,7 @@ void BgCheck_DrawDynaPolyList(GlobalContext* globalCtx, CollisionContext* colCtx
|
||||
vC.y += AREG(26) * ny;
|
||||
vC.z += AREG(26) * nz;
|
||||
}
|
||||
Collider_DrawPoly(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b);
|
||||
Collider_DrawPoly(play->state.gfxCtx, &vA, &vB, &vC, r, g, b);
|
||||
if (curNode->next == SS_NULL) {
|
||||
break;
|
||||
}
|
||||
@@ -4418,25 +4415,23 @@ void BgCheck_DrawDynaPolyList(GlobalContext* globalCtx, CollisionContext* colCtx
|
||||
* Draw a BgActor's dyna polys
|
||||
* `bgId` is the BgActor index that should be drawn
|
||||
*/
|
||||
void BgCheck_DrawBgActor(GlobalContext* globalCtx, CollisionContext* colCtx, s32 bgId) {
|
||||
void BgCheck_DrawBgActor(PlayState* play, CollisionContext* colCtx, s32 bgId) {
|
||||
if (AREG(21)) {
|
||||
BgCheck_DrawDynaPolyList(globalCtx, colCtx, &colCtx->dyna, &colCtx->dyna.bgActors[bgId].dynaLookup.ceiling, 255,
|
||||
0, 0);
|
||||
}
|
||||
if (AREG(22)) {
|
||||
BgCheck_DrawDynaPolyList(globalCtx, colCtx, &colCtx->dyna, &colCtx->dyna.bgActors[bgId].dynaLookup.wall, 0, 255,
|
||||
BgCheck_DrawDynaPolyList(play, colCtx, &colCtx->dyna, &colCtx->dyna.bgActors[bgId].dynaLookup.ceiling, 255, 0,
|
||||
0);
|
||||
}
|
||||
if (AREG(22)) {
|
||||
BgCheck_DrawDynaPolyList(play, colCtx, &colCtx->dyna, &colCtx->dyna.bgActors[bgId].dynaLookup.wall, 0, 255, 0);
|
||||
}
|
||||
if (AREG(23)) {
|
||||
BgCheck_DrawDynaPolyList(globalCtx, colCtx, &colCtx->dyna, &colCtx->dyna.bgActors[bgId].dynaLookup.floor, 0, 0,
|
||||
255);
|
||||
BgCheck_DrawDynaPolyList(play, colCtx, &colCtx->dyna, &colCtx->dyna.bgActors[bgId].dynaLookup.floor, 0, 0, 255);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw all dyna polys
|
||||
*/
|
||||
void BgCheck_DrawDynaCollision(GlobalContext* globalCtx, CollisionContext* colCtx) {
|
||||
void BgCheck_DrawDynaCollision(PlayState* play, CollisionContext* colCtx) {
|
||||
s32 bgId;
|
||||
|
||||
for (bgId = 0; bgId < BG_ACTOR_MAX; bgId++) {
|
||||
@@ -4444,14 +4439,14 @@ void BgCheck_DrawDynaCollision(GlobalContext* globalCtx, CollisionContext* colCt
|
||||
if (!(colCtx->dyna.bgActorFlags[bgId] & 1)) {
|
||||
continue;
|
||||
}
|
||||
BgCheck_DrawBgActor(globalCtx, colCtx, bgId);
|
||||
BgCheck_DrawBgActor(play, colCtx, bgId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a static poly
|
||||
*/
|
||||
void BgCheck_DrawStaticPoly(GlobalContext* globalCtx, CollisionContext* colCtx, CollisionPoly* poly, u8 r, u8 g, u8 b) {
|
||||
void BgCheck_DrawStaticPoly(PlayState* play, CollisionContext* colCtx, CollisionPoly* poly, u8 r, u8 g, u8 b) {
|
||||
Vec3f vA;
|
||||
Vec3f vB;
|
||||
Vec3f vC;
|
||||
@@ -4476,13 +4471,13 @@ void BgCheck_DrawStaticPoly(GlobalContext* globalCtx, CollisionContext* colCtx,
|
||||
vC.y += AREG(26) * ny;
|
||||
vC.z += AREG(26) * nz;
|
||||
}
|
||||
Collider_DrawPoly(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b);
|
||||
Collider_DrawPoly(play->state.gfxCtx, &vA, &vB, &vC, r, g, b);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a list of static polys, specified by `ssList`
|
||||
*/
|
||||
void BgCheck_DrawStaticPolyList(GlobalContext* globalCtx, CollisionContext* colCtx, SSList* ssList, u8 r, u8 g, u8 b) {
|
||||
void BgCheck_DrawStaticPolyList(PlayState* play, CollisionContext* colCtx, SSList* ssList, u8 r, u8 g, u8 b) {
|
||||
SSNode* curNode;
|
||||
CollisionPoly* polyList = colCtx->colHeader->polyList;
|
||||
s16 curPolyId;
|
||||
@@ -4491,7 +4486,7 @@ void BgCheck_DrawStaticPolyList(GlobalContext* globalCtx, CollisionContext* colC
|
||||
curNode = &colCtx->polyNodes.tbl[ssList->head];
|
||||
while (true) {
|
||||
curPolyId = curNode->polyId;
|
||||
BgCheck_DrawStaticPoly(globalCtx, colCtx, &polyList[curPolyId], r, g, b);
|
||||
BgCheck_DrawStaticPoly(play, colCtx, &polyList[curPolyId], r, g, b);
|
||||
if (curNode->next == SS_NULL) {
|
||||
break;
|
||||
}
|
||||
@@ -4503,17 +4498,17 @@ void BgCheck_DrawStaticPolyList(GlobalContext* globalCtx, CollisionContext* colC
|
||||
/**
|
||||
* Draw scene collision
|
||||
*/
|
||||
void BgCheck_DrawStaticCollision(GlobalContext* globalCtx, CollisionContext* colCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
void BgCheck_DrawStaticCollision(PlayState* play, CollisionContext* colCtx) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
StaticLookup* lookup = BgCheck_GetNearestStaticLookup(colCtx, colCtx->lookupTbl, &player->actor.world.pos);
|
||||
|
||||
if (AREG(23) != 0) {
|
||||
BgCheck_DrawStaticPolyList(globalCtx, colCtx, &lookup->floor, 0, 0, 255);
|
||||
BgCheck_DrawStaticPolyList(play, colCtx, &lookup->floor, 0, 0, 255);
|
||||
}
|
||||
if (AREG(22) != 0) {
|
||||
BgCheck_DrawStaticPolyList(globalCtx, colCtx, &lookup->wall, 0, 255, 0);
|
||||
BgCheck_DrawStaticPolyList(play, colCtx, &lookup->wall, 0, 255, 0);
|
||||
}
|
||||
if (AREG(21) != 0) {
|
||||
BgCheck_DrawStaticPolyList(globalCtx, colCtx, &lookup->ceiling, 255, 0, 0);
|
||||
BgCheck_DrawStaticPolyList(play, colCtx, &lookup->ceiling, 255, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
+122
-125
@@ -215,7 +215,7 @@ Vec3f* Camera_Vec3fTranslateByUnitVector(Vec3f* dest, Vec3f* src, Vec3f* unitVec
|
||||
* Detects the collision poly between `from` and `to`, places collision info in `to`
|
||||
*/
|
||||
s32 Camera_BGCheckInfo(Camera* camera, Vec3f* from, CamColChk* to) {
|
||||
CollisionContext* colCtx = &camera->globalCtx->colCtx;
|
||||
CollisionContext* colCtx = &camera->play->colCtx;
|
||||
Vec3f toNewPos;
|
||||
Vec3f toPoint;
|
||||
Vec3f fromToNorm;
|
||||
@@ -278,7 +278,7 @@ s32 Camera_BGCheck(Camera* camera, Vec3f* from, Vec3f* to) {
|
||||
}
|
||||
|
||||
s32 func_80043F94(Camera* camera, Vec3f* from, CamColChk* to) {
|
||||
CollisionContext* colCtx = &camera->globalCtx->colCtx;
|
||||
CollisionContext* colCtx = &camera->play->colCtx;
|
||||
Vec3f toNewPos;
|
||||
Vec3f toPos;
|
||||
Vec3f fromToNorm;
|
||||
@@ -363,7 +363,7 @@ s32 Camera_CheckOOB(Camera* camera, Vec3f* from, Vec3f* to) {
|
||||
s32 pad2;
|
||||
s32 bgId;
|
||||
CollisionPoly* poly;
|
||||
CollisionContext* colCtx = &camera->globalCtx->colCtx;
|
||||
CollisionContext* colCtx = &camera->play->colCtx;
|
||||
|
||||
poly = NULL;
|
||||
if (BgCheck_CameraLineTest1(colCtx, from, to, &intersect, &poly, 1, 1, 1, 0, &bgId) &&
|
||||
@@ -382,7 +382,7 @@ s32 Camera_CheckOOB(Camera* camera, Vec3f* from, Vec3f* to) {
|
||||
f32 Camera_GetFloorYNorm(Camera* camera, Vec3f* floorNorm, Vec3f* chkPos, s32* bgId) {
|
||||
s32 pad;
|
||||
CollisionPoly* floorPoly;
|
||||
f32 floorY = BgCheck_EntityRaycastFloor3(&camera->globalCtx->colCtx, &floorPoly, bgId, chkPos);
|
||||
f32 floorY = BgCheck_EntityRaycastFloor3(&camera->play->colCtx, &floorPoly, bgId, chkPos);
|
||||
|
||||
if (floorY == BGCHECK_Y_MIN) {
|
||||
// no floor
|
||||
@@ -418,7 +418,7 @@ f32 Camera_GetFloorY(Camera* camera, Vec3f* pos) {
|
||||
*/
|
||||
f32 Camera_GetFloorYLayer(Camera* camera, Vec3f* norm, Vec3f* pos, s32* bgId) {
|
||||
CollisionPoly* floorPoly;
|
||||
CollisionContext* colCtx = &camera->globalCtx->colCtx;
|
||||
CollisionContext* colCtx = &camera->play->colCtx;
|
||||
f32 floorY;
|
||||
s32 i;
|
||||
|
||||
@@ -453,14 +453,14 @@ f32 Camera_GetFloorYLayer(Camera* camera, Vec3f* norm, Vec3f* pos, s32* bgId) {
|
||||
* Returns the CameraSettingType of the camera at index `camDataIdx`
|
||||
*/
|
||||
s16 Camera_GetCamDataSetting(Camera* camera, s32 camDataIdx) {
|
||||
return func_80041A4C(&camera->globalCtx->colCtx, camDataIdx, BGCHECK_SCENE);
|
||||
return func_80041A4C(&camera->play->colCtx, camDataIdx, BGCHECK_SCENE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the scene camera info for the current camera data index
|
||||
*/
|
||||
Vec3s* Camera_GetCamBGData(Camera* camera) {
|
||||
return func_80041C10(&camera->globalCtx->colCtx, camera->camDataIdx, BGCHECK_SCENE);
|
||||
return func_80041C10(&camera->play->colCtx, camera->camDataIdx, BGCHECK_SCENE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -473,9 +473,9 @@ s32 Camera_GetDataIdxForPoly(Camera* camera, s32* bgId, CollisionPoly* poly) {
|
||||
s32 ret;
|
||||
|
||||
Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor); // unused.
|
||||
camDataIdx = SurfaceType_GetCamDataIndex(&camera->globalCtx->colCtx, poly, *bgId);
|
||||
camDataIdx = SurfaceType_GetCamDataIndex(&camera->play->colCtx, poly, *bgId);
|
||||
|
||||
if (func_80041A4C(&camera->globalCtx->colCtx, camDataIdx, *bgId) == CAM_SET_NONE) {
|
||||
if (func_80041A4C(&camera->play->colCtx, camDataIdx, *bgId) == CAM_SET_NONE) {
|
||||
ret = -1;
|
||||
} else {
|
||||
ret = camDataIdx;
|
||||
@@ -496,13 +496,12 @@ Vec3s* Camera_GetCamBgDataUnderPlayer(Camera* camera, u16* dataCnt) {
|
||||
|
||||
Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor);
|
||||
playerPosShape.pos.y += Player_GetHeight(camera->player);
|
||||
if (BgCheck_EntityRaycastFloor3(&camera->globalCtx->colCtx, &floorPoly, &bgId, &playerPosShape.pos) ==
|
||||
BGCHECK_Y_MIN) {
|
||||
if (BgCheck_EntityRaycastFloor3(&camera->play->colCtx, &floorPoly, &bgId, &playerPosShape.pos) == BGCHECK_Y_MIN) {
|
||||
// no floor
|
||||
return NULL;
|
||||
}
|
||||
*dataCnt = SurfaceType_GetNumCameras(&camera->globalCtx->colCtx, floorPoly, bgId);
|
||||
return SurfaceType_GetCamPosData(&camera->globalCtx->colCtx, floorPoly, bgId);
|
||||
*dataCnt = SurfaceType_GetNumCameras(&camera->play->colCtx, floorPoly, bgId);
|
||||
return SurfaceType_GetCamPosData(&camera->play->colCtx, floorPoly, bgId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -519,8 +518,8 @@ s32 Camera_GetWaterBoxDataIdx(Camera* camera, f32* waterY) {
|
||||
Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor);
|
||||
*waterY = playerPosShape.pos.y;
|
||||
|
||||
if (!WaterBox_GetSurface1(camera->globalCtx, &camera->globalCtx->colCtx, playerPosShape.pos.x, playerPosShape.pos.z,
|
||||
waterY, &waterBox)) {
|
||||
if (!WaterBox_GetSurface1(camera->play, &camera->play->colCtx, playerPosShape.pos.x, playerPosShape.pos.z, waterY,
|
||||
&waterBox)) {
|
||||
// player's position is not in a water box.
|
||||
*waterY = BGCHECK_Y_MIN;
|
||||
return -1;
|
||||
@@ -532,8 +531,8 @@ s32 Camera_GetWaterBoxDataIdx(Camera* camera, f32* waterY) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = WaterBox_GetCamDataIndex(&camera->globalCtx->colCtx, waterBox);
|
||||
if ((ret <= 0) || (WaterBox_GetCameraSType(&camera->globalCtx->colCtx, waterBox) <= 0)) {
|
||||
ret = WaterBox_GetCamDataIndex(&camera->play->colCtx, waterBox);
|
||||
if ((ret <= 0) || (WaterBox_GetCameraSType(&camera->play->colCtx, waterBox) <= 0)) {
|
||||
// no camera data index, or no CameraSettingType
|
||||
return -2;
|
||||
}
|
||||
@@ -554,8 +553,7 @@ f32 Camera_GetWaterSurface(Camera* camera, Vec3f* chkPos, s32* envProp) {
|
||||
Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor);
|
||||
waterY = playerPosRot.pos.y;
|
||||
|
||||
if (!WaterBox_GetSurface1(camera->globalCtx, &camera->globalCtx->colCtx, chkPos->x, chkPos->z, &waterY,
|
||||
&waterBox)) {
|
||||
if (!WaterBox_GetSurface1(camera->play, &camera->play->colCtx, chkPos->x, chkPos->z, &waterY, &waterBox)) {
|
||||
// chkPos is not within the x/z boundaries of a water box.
|
||||
return BGCHECK_Y_MIN;
|
||||
}
|
||||
@@ -566,7 +564,7 @@ f32 Camera_GetWaterSurface(Camera* camera, Vec3f* chkPos, s32* envProp) {
|
||||
return BGCHECK_Y_MIN;
|
||||
}
|
||||
|
||||
*envProp = WaterBox_GetLightSettingIndex(&camera->globalCtx->colCtx, waterBox);
|
||||
*envProp = WaterBox_GetLightSettingIndex(&camera->play->colCtx, waterBox);
|
||||
return waterY;
|
||||
}
|
||||
|
||||
@@ -608,7 +606,7 @@ s16 func_80044ADC(Camera* camera, s16 yaw, s16 arg2) {
|
||||
rotatedPos.x = playerPos.x + (sp30 * sinYaw);
|
||||
rotatedPos.y = playerPos.y;
|
||||
rotatedPos.z = playerPos.z + (sp30 * cosYaw);
|
||||
if (arg2 || (camera->globalCtx->state.frames % 2) == 0) {
|
||||
if (arg2 || (camera->play->state.frames % 2) == 0) {
|
||||
D_8015CE58.pos.x = playerPos.x + (sp2C * sinYaw);
|
||||
D_8015CE58.pos.y = playerPos.y;
|
||||
D_8015CE58.pos.z = playerPos.z + (sp2C * cosYaw);
|
||||
@@ -1638,7 +1636,7 @@ s32 Camera_Normal1(Camera* camera) {
|
||||
}
|
||||
|
||||
// crit wiggle
|
||||
if (gSaveContext.health <= 16 && ((camera->globalCtx->state.frames % 256) == 0)) {
|
||||
if (gSaveContext.health <= 16 && ((camera->play->state.frames % 256) == 0)) {
|
||||
wiggleAdj = Rand_ZeroOne() * 10000.0f;
|
||||
camera->inputDir.y = wiggleAdj + camera->inputDir.y;
|
||||
}
|
||||
@@ -1805,7 +1803,7 @@ s32 Camera_Normal2(Camera* camera) {
|
||||
|
||||
if (camera->status == CAM_STAT_ACTIVE) {
|
||||
bgChk.pos = *eyeNext;
|
||||
if (!camera->globalCtx->envCtx.skyboxDisabled || roData->interfaceFlags & 0x10) {
|
||||
if (!camera->play->envCtx.skyboxDisabled || roData->interfaceFlags & 0x10) {
|
||||
Camera_BGCheckInfo(camera, at, &bgChk);
|
||||
*eye = bgChk.pos;
|
||||
} else {
|
||||
@@ -2140,7 +2138,7 @@ s32 Camera_Parallel1(Camera* camera) {
|
||||
Camera_Vec3fVecSphGeoAdd(eyeNext, at, &spA8);
|
||||
if (camera->status == CAM_STAT_ACTIVE) {
|
||||
sp6C.pos = *eyeNext;
|
||||
if (!camera->globalCtx->envCtx.skyboxDisabled || roData->interfaceFlags & 0x10) {
|
||||
if (!camera->play->envCtx.skyboxDisabled || roData->interfaceFlags & 0x10) {
|
||||
Camera_BGCheckInfo(camera, at, &sp6C);
|
||||
*eye = sp6C.pos;
|
||||
} else {
|
||||
@@ -2950,7 +2948,7 @@ s32 Camera_Battle1(Camera* camera) {
|
||||
Camera_Vec3fVecSphGeoAdd(eyeNext, at, &spB4);
|
||||
spBC.pos = *eyeNext;
|
||||
if (camera->status == CAM_STAT_ACTIVE) {
|
||||
if (!camera->globalCtx->envCtx.skyboxDisabled || roData->flags & 1) {
|
||||
if (!camera->play->envCtx.skyboxDisabled || roData->flags & 1) {
|
||||
Camera_BGCheckInfo(camera, at, &spBC);
|
||||
} else if (roData->flags & 2) {
|
||||
func_80043F94(camera, at, &spBC);
|
||||
@@ -3277,7 +3275,7 @@ s32 Camera_KeepOn1(Camera* camera) {
|
||||
Camera_Vec3fVecSphGeoAdd(eyeNext, at, &spD8);
|
||||
sp8C.pos = *eyeNext;
|
||||
if (camera->status == CAM_STAT_ACTIVE) {
|
||||
if (!camera->globalCtx->envCtx.skyboxDisabled || roData->interfaceFlags & 1) {
|
||||
if (!camera->play->envCtx.skyboxDisabled || roData->interfaceFlags & 1) {
|
||||
Camera_BGCheckInfo(camera, at, &sp8C);
|
||||
} else if (roData->interfaceFlags & 2) {
|
||||
func_80043F94(camera, at, &sp8C);
|
||||
@@ -3343,9 +3341,9 @@ s32 Camera_KeepOn3(Camera* camera) {
|
||||
return 1;
|
||||
}
|
||||
if (RELOAD_PARAMS(camera)) {
|
||||
if (camera->globalCtx->view.unk_124 == 0) {
|
||||
if (camera->play->view.unk_124 == 0) {
|
||||
camera->unk_14C |= 0x20;
|
||||
camera->globalCtx->view.unk_124 = camera->camId | 0x50;
|
||||
camera->play->view.unk_124 = camera->camId | 0x50;
|
||||
return 1;
|
||||
}
|
||||
camera->unk_14C &= ~0x20;
|
||||
@@ -3433,7 +3431,7 @@ s32 Camera_KeepOn3(Camera* camera) {
|
||||
Camera_Vec3fVecSphGeoAdd(&lineChkPointB, &rwData->atTarget, &atToEyeAdj);
|
||||
if (!(roData->flags & 0x80)) {
|
||||
while (i < angleCnt) {
|
||||
if (!CollisionCheck_LineOCCheck(camera->globalCtx, &camera->globalCtx->colChkCtx, &rwData->atTarget,
|
||||
if (!CollisionCheck_LineOCCheck(camera->play, &camera->play->colChkCtx, &rwData->atTarget,
|
||||
&lineChkPointB, colChkActors, 2) &&
|
||||
!Camera_BGCheck(camera, &rwData->atTarget, &lineChkPointB)) {
|
||||
break;
|
||||
@@ -3517,15 +3515,15 @@ s32 Camera_KeepOn4(Camera* camera) {
|
||||
KeepOn4ReadWriteData* rwData = &camera->paramData.keep4.rwData;
|
||||
s32 pad;
|
||||
f32 playerHeight;
|
||||
Player* player = GET_PLAYER(camera->globalCtx);
|
||||
Player* player = GET_PLAYER(camera->play);
|
||||
s16 angleCnt;
|
||||
s32 i;
|
||||
|
||||
if (RELOAD_PARAMS(camera)) {
|
||||
if (camera->globalCtx->view.unk_124 == 0) {
|
||||
if (camera->play->view.unk_124 == 0) {
|
||||
camera->unk_14C |= 0x20;
|
||||
camera->unk_14C &= ~(0x4 | 0x2);
|
||||
camera->globalCtx->view.unk_124 = camera->camId | 0x50;
|
||||
camera->play->view.unk_124 = camera->camId | 0x50;
|
||||
return 1;
|
||||
}
|
||||
rwData->unk_14 = *temp_s0;
|
||||
@@ -3538,7 +3536,7 @@ s32 Camera_KeepOn4(Camera* camera) {
|
||||
camera->animState = 20;
|
||||
camera->unk_14C |= 0x20;
|
||||
camera->unk_14C &= ~(0x4 | 0x2);
|
||||
camera->globalCtx->view.unk_124 = camera->camId | 0x50;
|
||||
camera->play->view.unk_124 = camera->camId | 0x50;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3656,7 +3654,7 @@ s32 Camera_KeepOn4(Camera* camera) {
|
||||
OLib_Vec3fDiffToVecSphGeo(&spA8, at, eyeNext);
|
||||
D_8015BD50 = playerPosRot->pos;
|
||||
D_8015BD50.y += playerHeight;
|
||||
temp_f0_2 = BgCheck_CameraRaycastFloor2(&camera->globalCtx->colCtx, &spC0, &i, &D_8015BD50);
|
||||
temp_f0_2 = BgCheck_CameraRaycastFloor2(&camera->play->colCtx, &spC0, &i, &D_8015BD50);
|
||||
if (temp_f0_2 > (roData->unk_00 + D_8015BD50.y)) {
|
||||
D_8015BD50.y = temp_f0_2 + 10.0f;
|
||||
} else {
|
||||
@@ -3716,8 +3714,8 @@ s32 Camera_KeepOn4(Camera* camera) {
|
||||
if (!(roData->unk_1C & 1)) {
|
||||
angleCnt = ARRAY_COUNT(D_8011D3B0);
|
||||
for (i = 0; i < angleCnt; i++) {
|
||||
if (!CollisionCheck_LineOCCheck(camera->globalCtx, &camera->globalCtx->colChkCtx, &D_8015BD50,
|
||||
&D_8015BD70, spCC, sp9C) &&
|
||||
if (!CollisionCheck_LineOCCheck(camera->play, &camera->play->colChkCtx, &D_8015BD50, &D_8015BD70,
|
||||
spCC, sp9C) &&
|
||||
!Camera_BGCheck(camera, &D_8015BD50, &D_8015BD70)) {
|
||||
break;
|
||||
}
|
||||
@@ -4204,8 +4202,8 @@ s32 Camera_Subj3(Camera* camera) {
|
||||
Actor_GetFocus(&sp60, &camera->player->actor);
|
||||
playerHeight = Player_GetHeight(camera->player);
|
||||
|
||||
if (camera->globalCtx->view.unk_124 == 0) {
|
||||
camera->globalCtx->view.unk_124 = camera->camId | 0x50;
|
||||
if (camera->play->view.unk_124 == 0) {
|
||||
camera->play->view.unk_124 = camera->camId | 0x50;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4266,7 +4264,7 @@ s32 Camera_Subj3(Camera* camera) {
|
||||
*eye = *eyeNext;
|
||||
rwData->animTimer--;
|
||||
|
||||
if (!camera->globalCtx->envCtx.skyboxDisabled) {
|
||||
if (!camera->play->envCtx.skyboxDisabled) {
|
||||
Camera_BGCheck(camera, at, eye);
|
||||
} else {
|
||||
func_80044340(camera, at, eye);
|
||||
@@ -4333,8 +4331,8 @@ s32 Camera_Subj4(Camera* camera) {
|
||||
Camera_CopyPREGToModeValues(camera);
|
||||
}
|
||||
|
||||
if (camera->globalCtx->view.unk_124 == 0) {
|
||||
camera->globalCtx->view.unk_124 = (camera->camId | 0x50);
|
||||
if (camera->play->view.unk_124 == 0) {
|
||||
camera->play->view.unk_124 = (camera->camId | 0x50);
|
||||
rwData->unk_24 = camera->xzSpeed;
|
||||
return true;
|
||||
}
|
||||
@@ -5128,11 +5126,11 @@ s32 Camera_Unique9(Camera* camera) {
|
||||
Camera_UpdateInterface(0xF000 | ((rwData->curKeyFrame->unk_01 & 0xF) << 8));
|
||||
} else if (camera->player->stateFlags1 & PLAYER_STATE1_27 &&
|
||||
player->currentBoots != PLAYER_BOOTS_IRON) {
|
||||
func_8002DF38(camera->globalCtx, camera->target, 8);
|
||||
func_8002DF38(camera->play, camera->target, 8);
|
||||
osSyncPrintf("camera: demo: player demo set WAIT\n");
|
||||
} else {
|
||||
osSyncPrintf("camera: demo: player demo set %d\n", rwData->curKeyFrame->unk_01);
|
||||
func_8002DF38(camera->globalCtx, camera->target, rwData->curKeyFrame->unk_01);
|
||||
func_8002DF38(camera->play, camera->target, rwData->curKeyFrame->unk_01);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -5151,9 +5149,9 @@ s32 Camera_Unique9(Camera* camera) {
|
||||
rwData->atTarget = rwData->curKeyFrame->atTargetInit;
|
||||
} else if (atInitFlags == 2) {
|
||||
if (rwData->isNewKeyFrame) {
|
||||
rwData->atTarget.x = camera->globalCtx->view.at.x + rwData->curKeyFrame->atTargetInit.x;
|
||||
rwData->atTarget.y = camera->globalCtx->view.at.y + rwData->curKeyFrame->atTargetInit.y;
|
||||
rwData->atTarget.z = camera->globalCtx->view.at.z + rwData->curKeyFrame->atTargetInit.z;
|
||||
rwData->atTarget.x = camera->play->view.at.x + rwData->curKeyFrame->atTargetInit.x;
|
||||
rwData->atTarget.y = camera->play->view.at.y + rwData->curKeyFrame->atTargetInit.y;
|
||||
rwData->atTarget.z = camera->play->view.at.z + rwData->curKeyFrame->atTargetInit.z;
|
||||
}
|
||||
} else if (atInitFlags == 3) {
|
||||
if (rwData->isNewKeyFrame) {
|
||||
@@ -5233,9 +5231,9 @@ s32 Camera_Unique9(Camera* camera) {
|
||||
rwData->eyeTarget = rwData->curKeyFrame->eyeTargetInit;
|
||||
} else if (eyeInitFlags == 0x200) {
|
||||
if (rwData->isNewKeyFrame) {
|
||||
rwData->eyeTarget.x = camera->globalCtx->view.eye.x + rwData->curKeyFrame->eyeTargetInit.x;
|
||||
rwData->eyeTarget.y = camera->globalCtx->view.eye.y + rwData->curKeyFrame->eyeTargetInit.y;
|
||||
rwData->eyeTarget.z = camera->globalCtx->view.eye.z + rwData->curKeyFrame->eyeTargetInit.z;
|
||||
rwData->eyeTarget.x = camera->play->view.eye.x + rwData->curKeyFrame->eyeTargetInit.x;
|
||||
rwData->eyeTarget.y = camera->play->view.eye.y + rwData->curKeyFrame->eyeTargetInit.y;
|
||||
rwData->eyeTarget.z = camera->play->view.eye.z + rwData->curKeyFrame->eyeTargetInit.z;
|
||||
}
|
||||
} else if (eyeInitFlags == 0x300) {
|
||||
if (rwData->isNewKeyFrame) {
|
||||
@@ -5322,7 +5320,7 @@ s32 Camera_Unique9(Camera* camera) {
|
||||
}
|
||||
|
||||
if (rwData->curKeyFrame->initFlags == 2) {
|
||||
rwData->fovTarget = camera->globalCtx->view.fovy;
|
||||
rwData->fovTarget = camera->play->view.fovy;
|
||||
rwData->rollTarget = 0;
|
||||
} else if (rwData->curKeyFrame->initFlags == 0) {
|
||||
rwData->fovTarget = camera->fov;
|
||||
@@ -5477,12 +5475,12 @@ s32 Camera_Unique9(Camera* camera) {
|
||||
// Change the parent camera (or default)'s mode to normal
|
||||
s32 camIdx = camera->parentCamId <= CAM_ID_NONE ? CAM_ID_MAIN : camera->parentCamId;
|
||||
|
||||
Camera_ChangeModeFlags(camera->globalCtx->cameraPtrs[camIdx], CAM_MODE_NORMAL, 1);
|
||||
Camera_ChangeModeFlags(camera->play->cameraPtrs[camIdx], CAM_MODE_NORMAL, 1);
|
||||
}
|
||||
case 18: {
|
||||
// copy the current camera to the parent (or default)'s camera.
|
||||
s32 camIdx = camera->parentCamId <= CAM_ID_NONE ? CAM_ID_MAIN : camera->parentCamId;
|
||||
Camera* cam = camera->globalCtx->cameraPtrs[camIdx];
|
||||
Camera* cam = camera->play->cameraPtrs[camIdx];
|
||||
|
||||
*eye = *eyeNext;
|
||||
Camera_Copy(cam, camera);
|
||||
@@ -5603,8 +5601,8 @@ s32 Camera_Demo1(Camera* camera) {
|
||||
rwData->curFrame = 0.0f;
|
||||
camera->animState++;
|
||||
// "absolute" : "relative"
|
||||
osSyncPrintf(VT_SGR("1") "%06u:" VT_RST " camera: spline demo: start %s \n",
|
||||
camera->globalCtx->state.frames, *relativeToPlayer == 0 ? "絶対" : "相対");
|
||||
osSyncPrintf(VT_SGR("1") "%06u:" VT_RST " camera: spline demo: start %s \n", camera->play->state.frames,
|
||||
*relativeToPlayer == 0 ? "絶対" : "相対");
|
||||
|
||||
if (PREG(93)) {
|
||||
Camera_DebugPrintSplineArray("CENTER", 5, csAtPoints);
|
||||
@@ -5700,7 +5698,7 @@ s32 Camera_Demo3(Camera* camera) {
|
||||
sp68.x = rwData->initialAt.x + (Math_SinS(angle) * 40.0f);
|
||||
sp68.y = rwData->initialAt.y + 40.0f;
|
||||
sp68.z = rwData->initialAt.z + (Math_CosS(angle) * 40.0f);
|
||||
if (camera->globalCtx->state.frames & 1) {
|
||||
if (camera->play->state.frames & 1) {
|
||||
angle -= 0x3FFF;
|
||||
rwData->yawDir = 1;
|
||||
} else {
|
||||
@@ -5899,7 +5897,7 @@ s32 Camera_Demo5(Camera* camera) {
|
||||
Actor_GetFocus(&camera->targetPosRot, camera->target);
|
||||
OLib_Vec3fDiffToVecSphGeo(&playerTargetGeo, &camera->targetPosRot.pos, &camera->playerPosRot.pos);
|
||||
D_8011D3AC = camera->target->category;
|
||||
Actor_GetScreenPos(camera->globalCtx, camera->target, &targetScreenPosX, &targetScreenPosY);
|
||||
Actor_GetScreenPos(camera->play, camera->target, &targetScreenPosX, &targetScreenPosY);
|
||||
eyeTargetDist = OLib_Vec3fDist(&camera->targetPosRot.pos, &camera->eye);
|
||||
OLib_Vec3fDiffToVecSphGeo(&eyePlayerGeo, &playerhead.pos, &camera->eyeNext);
|
||||
sp4A = eyePlayerGeo.yaw - playerTargetGeo.yaw;
|
||||
@@ -5997,7 +5995,7 @@ s32 Camera_Demo5(Camera* camera) {
|
||||
// the target is a door.
|
||||
D_8011D954[0].timerInit = camera->timer - 5;
|
||||
sp4A = 0;
|
||||
if (!func_800C0D34(camera->globalCtx, camera->target, &sp4A)) {
|
||||
if (!func_800C0D34(camera->play, camera->target, &sp4A)) {
|
||||
osSyncPrintf(VT_COL(YELLOW, BLACK) "camera: attention demo: this door is dummy door!\n" VT_RST);
|
||||
if (ABS(playerTargetGeo.yaw - camera->target->shape.rot.y) >= 0x4000) {
|
||||
sp4A = camera->target->shape.rot.y;
|
||||
@@ -6050,7 +6048,7 @@ s32 Camera_Demo5(Camera* camera) {
|
||||
ONEPOINT_CS_INFO(camera)->keyFrames = D_8011D9F4;
|
||||
ONEPOINT_CS_INFO(camera)->keyFrameCnt = ARRAY_COUNT(D_8011D9F4);
|
||||
if (camera->parentCamId != CAM_ID_MAIN) {
|
||||
if (camera->globalCtx->state.frames & 1) {
|
||||
if (camera->play->state.frames & 1) {
|
||||
D_8011D9F4[0].rollTargetInit = -D_8011D9F4[0].rollTargetInit;
|
||||
D_8011D9F4[1].rollTargetInit = -D_8011D9F4[1].rollTargetInit;
|
||||
}
|
||||
@@ -6061,12 +6059,12 @@ s32 Camera_Demo5(Camera* camera) {
|
||||
}
|
||||
}
|
||||
|
||||
framesDiff = sDemo5PrevSfxFrame - camera->globalCtx->state.frames;
|
||||
framesDiff = sDemo5PrevSfxFrame - camera->play->state.frames;
|
||||
if ((framesDiff > 50) || (framesDiff < -50)) {
|
||||
func_80078884(camera->data1);
|
||||
}
|
||||
|
||||
sDemo5PrevSfxFrame = camera->globalCtx->state.frames;
|
||||
sDemo5PrevSfxFrame = camera->play->state.frames;
|
||||
|
||||
if (camera->player->stateFlags1 & PLAYER_STATE1_27 && (player->currentBoots != PLAYER_BOOTS_IRON)) {
|
||||
// swimming, and not iron boots
|
||||
@@ -6076,21 +6074,21 @@ s32 Camera_Demo5(Camera* camera) {
|
||||
} else {
|
||||
sp4A = playerhead.rot.y - playerTargetGeo.yaw;
|
||||
if (camera->target->category == ACTORCAT_PLAYER) {
|
||||
framesDiff = camera->globalCtx->state.frames - sDemo5PrevAction12Frame;
|
||||
framesDiff = camera->play->state.frames - sDemo5PrevAction12Frame;
|
||||
if (player->stateFlags1 & PLAYER_STATE1_11) {
|
||||
// holding object over head.
|
||||
func_8002DF54(camera->globalCtx, camera->target, 8);
|
||||
func_8002DF54(camera->play, camera->target, 8);
|
||||
} else if (ABS(framesDiff) > 3000) {
|
||||
func_8002DF54(camera->globalCtx, camera->target, 12);
|
||||
func_8002DF54(camera->play, camera->target, 12);
|
||||
} else {
|
||||
func_8002DF54(camera->globalCtx, camera->target, 69);
|
||||
func_8002DF54(camera->play, camera->target, 69);
|
||||
}
|
||||
} else {
|
||||
func_8002DF54(camera->globalCtx, camera->target, 1);
|
||||
func_8002DF54(camera->play, camera->target, 1);
|
||||
}
|
||||
}
|
||||
|
||||
sDemo5PrevAction12Frame = camera->globalCtx->state.frames;
|
||||
sDemo5PrevAction12Frame = camera->play->state.frames;
|
||||
Camera_ChangeSettingFlags(camera, CAM_SET_CS_C, (4 | 1));
|
||||
Camera_Unique9(camera);
|
||||
return true;
|
||||
@@ -6111,7 +6109,7 @@ s32 Camera_Demo6(Camera* camera) {
|
||||
s16 stateTimers[4];
|
||||
Demo6ReadWriteData* rwData = &camera->paramData.demo6.rwData;
|
||||
|
||||
mainCam = Play_GetCamera(camera->globalCtx, CAM_ID_MAIN);
|
||||
mainCam = Play_GetCamera(camera->play, CAM_ID_MAIN);
|
||||
camFocus = camera->target;
|
||||
stateTimers[1] = 0x37;
|
||||
stateTimers[2] = 0x46;
|
||||
@@ -6145,7 +6143,7 @@ s32 Camera_Demo6(Camera* camera) {
|
||||
camera->animState++;
|
||||
case 1:
|
||||
if (stateTimers[camera->animState] < rwData->animTimer) {
|
||||
func_8002DF54(camera->globalCtx, &camera->player->actor, 8);
|
||||
func_8002DF54(camera->play, &camera->player->actor, 8);
|
||||
Actor_GetWorld(&focusPosRot, camFocus);
|
||||
rwData->atTarget.x = focusPosRot.pos.x;
|
||||
rwData->atTarget.y = focusPosRot.pos.y - 20.0f;
|
||||
@@ -6216,7 +6214,7 @@ s32 Camera_Demo9(Camera* camera) {
|
||||
f32* camFOV = &camera->fov;
|
||||
Demo9ReadWriteData* rwData = &camera->paramData.demo9.rwData;
|
||||
|
||||
mainCam = Play_GetCamera(camera->globalCtx, CAM_ID_MAIN);
|
||||
mainCam = Play_GetCamera(camera->play, CAM_ID_MAIN);
|
||||
mainCamPlayerPosRot = &mainCam->playerPosRot;
|
||||
if (RELOAD_PARAMS(camera) || R_RELOAD_CAM_PARAMS) {
|
||||
values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
|
||||
@@ -6306,7 +6304,7 @@ s32 Camera_Demo9(Camera* camera) {
|
||||
if (rwData->finishAction == 0x2000) {
|
||||
// finish action = 0x2000, run OnePointCs 0x3FC (Dramatic Return to Link)
|
||||
onePointTimer = onePointCamData->initTimer < 50 ? 5 : onePointCamData->initTimer / 5;
|
||||
OnePointCutscene_Init(camera->globalCtx, 1020, onePointTimer, NULL, camera->parentCamId);
|
||||
OnePointCutscene_Init(camera->play, 1020, onePointTimer, NULL, camera->parentCamId);
|
||||
}
|
||||
} else {
|
||||
// finish action = 0x1000, copy the current camera's values to the
|
||||
@@ -6529,7 +6527,7 @@ s32 Camera_Special7(Camera* camera) {
|
||||
|
||||
yOffset = Player_GetHeight(camera->player);
|
||||
if (camera->animState == 0) {
|
||||
if (camera->globalCtx->sceneNum == SCENE_JYASINZOU) {
|
||||
if (camera->play->sceneNum == SCENE_JYASINZOU) {
|
||||
// Spirit Temple
|
||||
rwData->index = 3;
|
||||
} else if (playerPosRot->pos.x < 1500.0f) {
|
||||
@@ -6754,7 +6752,7 @@ s32 Camera_Special9(Camera* camera) {
|
||||
// 0xE38 ~ 20 degrees
|
||||
eyeAdjustment.pitch = 0xE38;
|
||||
// 0xAAA ~ 15 degrees.
|
||||
yaw = 0xAAA * ((camera->globalCtx->state.frames & 1) ? 1 : -1);
|
||||
yaw = 0xAAA * ((camera->play->state.frames & 1) ? 1 : -1);
|
||||
eyeAdjustment.yaw = rwData->targetYaw + yaw;
|
||||
eyeAdjustment.r = 200.0f * yNormal;
|
||||
Camera_Vec3fVecSphGeoAdd(eyeNext, at, &eyeAdjustment);
|
||||
@@ -6826,12 +6824,12 @@ s32 Camera_Special9(Camera* camera) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Camera* Camera_Create(View* view, CollisionContext* colCtx, GlobalContext* globalCtx) {
|
||||
Camera* Camera_Create(View* view, CollisionContext* colCtx, PlayState* play) {
|
||||
Camera* newCamera = ZeldaArena_MallocDebug(sizeof(*newCamera), "../z_camera.c", 9370);
|
||||
|
||||
if (newCamera != NULL) {
|
||||
osSyncPrintf(VT_FGCOL(BLUE) "camera: create --- allocate %d byte" VT_RST "\n", sizeof(*newCamera) * 4);
|
||||
Camera_Init(newCamera, view, colCtx, globalCtx);
|
||||
Camera_Init(newCamera, view, colCtx, play);
|
||||
} else {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "camera: create: not enough memory\n" VT_RST);
|
||||
}
|
||||
@@ -6847,7 +6845,7 @@ void Camera_Destroy(Camera* camera) {
|
||||
}
|
||||
}
|
||||
|
||||
void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, GlobalContext* globalCtx) {
|
||||
void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState* play) {
|
||||
Camera* camP;
|
||||
s32 i;
|
||||
s16 curUID;
|
||||
@@ -6867,7 +6865,7 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, GlobalCon
|
||||
sInitRegs = false;
|
||||
PREG(88) = -1;
|
||||
}
|
||||
camera->globalCtx = D_8015BD7C = globalCtx;
|
||||
camera->play = D_8015BD7C = play;
|
||||
DbCamera_Init(&D_8015BD80, camera);
|
||||
curUID = sNextUID;
|
||||
sNextUID++;
|
||||
@@ -6877,7 +6875,7 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, GlobalCon
|
||||
}
|
||||
|
||||
for (j = 0; j < NUM_CAMS; j++) {
|
||||
camP = camera->globalCtx->cameraPtrs[j];
|
||||
camP = camera->play->cameraPtrs[j];
|
||||
if (camP != NULL && curUID == camP->uid) {
|
||||
break;
|
||||
}
|
||||
@@ -6926,11 +6924,11 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, GlobalCon
|
||||
}
|
||||
|
||||
void func_80057FC4(Camera* camera) {
|
||||
if (camera != &camera->globalCtx->mainCamera) {
|
||||
if (camera != &camera->play->mainCamera) {
|
||||
camera->prevSetting = camera->setting = CAM_SET_FREE0;
|
||||
camera->unk_14C &= ~0x4;
|
||||
} else if (camera->globalCtx->roomCtx.curRoom.meshHeader->base.type != 1) {
|
||||
switch (camera->globalCtx->roomCtx.curRoom.behaviorType1) {
|
||||
} else if (camera->play->roomCtx.curRoom.meshHeader->base.type != 1) {
|
||||
switch (camera->play->roomCtx.curRoom.behaviorType1) {
|
||||
case ROOM_BEHAVIOR_TYPE1_1:
|
||||
Camera_ChangeDoorCam(camera, NULL, -99, 0, 0, 18, 10);
|
||||
camera->prevSetting = camera->setting = CAM_SET_DUNGEON0;
|
||||
@@ -6941,8 +6939,7 @@ void func_80057FC4(Camera* camera) {
|
||||
camera->prevSetting = camera->setting = CAM_SET_NORMAL0;
|
||||
break;
|
||||
default:
|
||||
osSyncPrintf("camera: room type: default set etc (%d)\n",
|
||||
camera->globalCtx->roomCtx.curRoom.behaviorType1);
|
||||
osSyncPrintf("camera: room type: default set etc (%d)\n", camera->play->roomCtx.curRoom.behaviorType1);
|
||||
Camera_ChangeDoorCam(camera, NULL, -99, 0, 0, 18, 10);
|
||||
camera->prevSetting = camera->setting = CAM_SET_NORMAL0;
|
||||
camera->unk_14C |= 4;
|
||||
@@ -7005,7 +7002,7 @@ void Camera_InitPlayerSettings(Camera* camera, Player* player) {
|
||||
camera->waterPrevCamSetting = -1;
|
||||
camera->unk_14C |= 4;
|
||||
|
||||
if (camera == &camera->globalCtx->mainCamera) {
|
||||
if (camera == &camera->play->mainCamera) {
|
||||
sCameraInterfaceFlags = 0xB200;
|
||||
} else {
|
||||
sCameraInterfaceFlags = 0;
|
||||
@@ -7059,13 +7056,13 @@ void Camera_PrintSettings(Camera* camera) {
|
||||
char sp48[8];
|
||||
s32 i;
|
||||
|
||||
if ((OREG(0) & 1) && (camera->globalCtx->activeCamId == camera->camId) && !gDbgCamEnabled) {
|
||||
if ((OREG(0) & 1) && (camera->play->activeCamId == camera->camId) && !gDbgCamEnabled) {
|
||||
for (i = 0; i < NUM_CAMS; i++) {
|
||||
if (camera->globalCtx->cameraPtrs[i] == NULL) {
|
||||
if (camera->play->cameraPtrs[i] == NULL) {
|
||||
sp58[i] = '-';
|
||||
sp48[i] = ' ';
|
||||
} else {
|
||||
switch (camera->globalCtx->cameraPtrs[i]->status) {
|
||||
switch (camera->play->cameraPtrs[i]->status) {
|
||||
case 0:
|
||||
sp58[i] = 'c';
|
||||
break;
|
||||
@@ -7091,7 +7088,7 @@ void Camera_PrintSettings(Camera* camera) {
|
||||
sp58[i] = '\0';
|
||||
sp48[i] = '\0';
|
||||
|
||||
sp48[camera->globalCtx->activeCamId] = 'a';
|
||||
sp48[camera->play->activeCamId] = 'a';
|
||||
func_8006376C(3, 0x16, 5, sp58);
|
||||
func_8006376C(3, 0x16, 1, sp48);
|
||||
func_8006376C(3, 0x17, 5, "S:");
|
||||
@@ -7205,7 +7202,7 @@ s32 Camera_UpdateWater(Camera* camera) {
|
||||
if (!(camera->unk_14C & 0x100)) {
|
||||
camera->unk_14C |= 0x100;
|
||||
osSyncPrintf("kankyo changed water, sound on\n");
|
||||
Environment_EnableUnderwaterLights(camera->globalCtx, waterLightsIndex);
|
||||
Environment_EnableUnderwaterLights(camera->play, waterLightsIndex);
|
||||
camera->waterDistortionTimer = 80;
|
||||
}
|
||||
|
||||
@@ -7228,7 +7225,7 @@ s32 Camera_UpdateWater(Camera* camera) {
|
||||
if (camera->waterDistortionTimer > 0) {
|
||||
camera->waterDistortionTimer--;
|
||||
camera->distortionFlags |= DISTORTION_UNDERWATER_STRONG;
|
||||
} else if (camera->globalCtx->sceneNum == SCENE_TURIBORI) {
|
||||
} else if (camera->play->sceneNum == SCENE_TURIBORI) {
|
||||
camera->distortionFlags |= DISTORTION_UNDERWATER_FISHING;
|
||||
} else {
|
||||
camera->distortionFlags |= DISTORTION_UNDERWATER_WEAK;
|
||||
@@ -7237,7 +7234,7 @@ s32 Camera_UpdateWater(Camera* camera) {
|
||||
if (camera->unk_14C & 0x100) {
|
||||
camera->unk_14C &= ~0x100;
|
||||
osSyncPrintf("kankyo changed water off, sound off\n");
|
||||
Environment_DisableUnderwaterLights(camera->globalCtx);
|
||||
Environment_DisableUnderwaterLights(camera->play);
|
||||
if (*quakeId != 0) {
|
||||
Quake_RemoveFromIdx(*quakeId);
|
||||
}
|
||||
@@ -7251,7 +7248,7 @@ s32 Camera_UpdateWater(Camera* camera) {
|
||||
|
||||
s32 Camera_UpdateHotRoom(Camera* camera) {
|
||||
camera->distortionFlags &= ~DISTORTION_HOT_ROOM;
|
||||
if (camera->globalCtx->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) {
|
||||
if (camera->play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) {
|
||||
camera->distortionFlags |= DISTORTION_HOT_ROOM;
|
||||
}
|
||||
|
||||
@@ -7261,7 +7258,7 @@ s32 Camera_UpdateHotRoom(Camera* camera) {
|
||||
s32 Camera_DbgChangeMode(Camera* camera) {
|
||||
s32 changeDir = 0;
|
||||
|
||||
if (!gDbgCamEnabled && camera->globalCtx->activeCamId == CAM_ID_MAIN) {
|
||||
if (!gDbgCamEnabled && camera->play->activeCamId == CAM_ID_MAIN) {
|
||||
if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CUP)) {
|
||||
osSyncPrintf("attention sound URGENCY\n");
|
||||
func_80078884(NA_SE_SY_ATTENTION_URGENCY);
|
||||
@@ -7357,17 +7354,17 @@ void Camera_UpdateDistortion(Camera* camera) {
|
||||
depthPhase += CAM_DEG_TO_BINANG(depthPhaseStep);
|
||||
screenPlanePhase += CAM_DEG_TO_BINANG(screenPlanePhaseStep);
|
||||
|
||||
View_SetDistortionOrientation(&camera->globalCtx->view, Math_CosS(depthPhase) * 0.0f,
|
||||
Math_SinS(depthPhase) * 0.0f, Math_SinS(screenPlanePhase) * 0.0f);
|
||||
View_SetDistortionScale(&camera->globalCtx->view, Math_SinS(screenPlanePhase) * (xScale * scaleFactor) + 1.0f,
|
||||
View_SetDistortionOrientation(&camera->play->view, Math_CosS(depthPhase) * 0.0f, Math_SinS(depthPhase) * 0.0f,
|
||||
Math_SinS(screenPlanePhase) * 0.0f);
|
||||
View_SetDistortionScale(&camera->play->view, Math_SinS(screenPlanePhase) * (xScale * scaleFactor) + 1.0f,
|
||||
Math_CosS(screenPlanePhase) * (yScale * scaleFactor) + 1.0f,
|
||||
Math_CosS(depthPhase) * (zScale * scaleFactor) + 1.0f);
|
||||
View_SetDistortionSpeed(&camera->globalCtx->view, speed * speedFactor);
|
||||
View_SetDistortionSpeed(&camera->play->view, speed * speedFactor);
|
||||
|
||||
camera->unk_14C |= 0x40;
|
||||
|
||||
} else if (camera->unk_14C & 0x40) {
|
||||
View_ClearDistortion(&camera->globalCtx->view);
|
||||
View_ClearDistortion(&camera->play->view);
|
||||
camera->unk_14C &= ~0x40;
|
||||
}
|
||||
}
|
||||
@@ -7388,7 +7385,7 @@ Vec3s Camera_Update(Camera* camera) {
|
||||
QuakeCamCalc quake;
|
||||
Player* player;
|
||||
|
||||
player = camera->globalCtx->cameraPtrs[CAM_ID_MAIN]->player;
|
||||
player = camera->play->cameraPtrs[CAM_ID_MAIN]->player;
|
||||
|
||||
if (R_DBG_CAM_UPDATE) {
|
||||
osSyncPrintf("camera: in %x\n", camera);
|
||||
@@ -7415,8 +7412,8 @@ Vec3s Camera_Update(Camera* camera) {
|
||||
spAC = curPlayerPosRot.pos;
|
||||
spAC.y += Player_GetHeight(camera->player);
|
||||
|
||||
playerGroundY = BgCheck_EntityRaycastFloor5(camera->globalCtx, &camera->globalCtx->colCtx, &playerFloorPoly,
|
||||
&bgId, &camera->player->actor, &spAC);
|
||||
playerGroundY = BgCheck_EntityRaycastFloor5(camera->play, &camera->play->colCtx, &playerFloorPoly, &bgId,
|
||||
&camera->player->actor, &spAC);
|
||||
if (playerGroundY != BGCHECK_Y_MIN) {
|
||||
// player is above ground.
|
||||
sOOBTimer = 0;
|
||||
@@ -7499,10 +7496,10 @@ Vec3s Camera_Update(Camera* camera) {
|
||||
D_8011D3F0--;
|
||||
sCameraInterfaceFlags = 0x3200;
|
||||
Camera_UpdateInterface(sCameraInterfaceFlags);
|
||||
} else if (camera->globalCtx->transitionMode != TRANS_MODE_OFF) {
|
||||
} else if (camera->play->transitionMode != TRANS_MODE_OFF) {
|
||||
sCameraInterfaceFlags = 0xF200;
|
||||
Camera_UpdateInterface(sCameraInterfaceFlags);
|
||||
} else if (camera->globalCtx->csCtx.state != CS_STATE_IDLE) {
|
||||
} else if (camera->play->csCtx.state != CS_STATE_IDLE) {
|
||||
sCameraInterfaceFlags = 0x3200;
|
||||
Camera_UpdateInterface(sCameraInterfaceFlags);
|
||||
} else {
|
||||
@@ -7511,7 +7508,7 @@ Vec3s Camera_Update(Camera* camera) {
|
||||
}
|
||||
|
||||
if (R_DBG_CAM_UPDATE) {
|
||||
osSyncPrintf("camera: shrink_and_bitem %x(%d)\n", sCameraInterfaceFlags, camera->globalCtx->transitionMode);
|
||||
osSyncPrintf("camera: shrink_and_bitem %x(%d)\n", sCameraInterfaceFlags, camera->play->transitionMode);
|
||||
}
|
||||
|
||||
if (R_DBG_CAM_UPDATE) {
|
||||
@@ -7526,16 +7523,16 @@ Vec3s Camera_Update(Camera* camera) {
|
||||
gDbgCamEnabled ^= 1;
|
||||
if (gDbgCamEnabled) {
|
||||
DbgCamera_Enable(&D_8015BD80, camera);
|
||||
} else if (camera->globalCtx->csCtx.state != CS_STATE_IDLE) {
|
||||
func_80064534(camera->globalCtx, &camera->globalCtx->csCtx);
|
||||
} else if (camera->play->csCtx.state != CS_STATE_IDLE) {
|
||||
func_80064534(camera->play, &camera->play->csCtx);
|
||||
}
|
||||
}
|
||||
|
||||
// Debug cam update
|
||||
if (gDbgCamEnabled) {
|
||||
camera->globalCtx->view.fovy = D_8015BD80.fov;
|
||||
camera->play->view.fovy = D_8015BD80.fov;
|
||||
DbCamera_Update(&D_8015BD80, camera);
|
||||
View_LookAt(&camera->globalCtx->view, &D_8015BD80.eye, &D_8015BD80.at, &D_8015BD80.unk_1C);
|
||||
View_LookAt(&camera->play->view, &D_8015BD80.eye, &D_8015BD80.at, &D_8015BD80.unk_1C);
|
||||
if (R_DBG_CAM_UPDATE) {
|
||||
osSyncPrintf("camera: debug out\n");
|
||||
}
|
||||
@@ -7580,13 +7577,13 @@ Vec3s Camera_Update(Camera* camera) {
|
||||
|
||||
Camera_UpdateDistortion(camera);
|
||||
|
||||
if ((camera->globalCtx->sceneNum == SCENE_SPOT00) && (camera->fov < 59.0f)) {
|
||||
View_SetScale(&camera->globalCtx->view, 0.79f);
|
||||
if ((camera->play->sceneNum == SCENE_SPOT00) && (camera->fov < 59.0f)) {
|
||||
View_SetScale(&camera->play->view, 0.79f);
|
||||
} else {
|
||||
View_SetScale(&camera->globalCtx->view, 1.0f);
|
||||
View_SetScale(&camera->play->view, 1.0f);
|
||||
}
|
||||
camera->globalCtx->view.fovy = viewFov;
|
||||
View_LookAt(&camera->globalCtx->view, &viewEye, &viewAt, &viewUp);
|
||||
camera->play->view.fovy = viewFov;
|
||||
View_LookAt(&camera->play->view, &viewEye, &viewAt, &viewUp);
|
||||
camera->camDir.x = eyeAtAngle.pitch;
|
||||
camera->camDir.y = eyeAtAngle.yaw;
|
||||
camera->camDir.z = 0;
|
||||
@@ -7627,18 +7624,18 @@ Vec3s Camera_Update(Camera* camera) {
|
||||
* When the camera's timer is 0, change the camera to its parent
|
||||
*/
|
||||
void Camera_Finish(Camera* camera) {
|
||||
Camera* mainCam = camera->globalCtx->cameraPtrs[CAM_ID_MAIN];
|
||||
Player* player = GET_PLAYER(camera->globalCtx);
|
||||
Camera* mainCam = camera->play->cameraPtrs[CAM_ID_MAIN];
|
||||
Player* player = GET_PLAYER(camera->play);
|
||||
|
||||
if (camera->timer == 0) {
|
||||
Play_ChangeCameraStatus(camera->globalCtx, camera->parentCamId, CAM_STAT_ACTIVE);
|
||||
Play_ChangeCameraStatus(camera->play, camera->parentCamId, CAM_STAT_ACTIVE);
|
||||
|
||||
if ((camera->parentCamId == CAM_ID_MAIN) && (camera->csId != 0)) {
|
||||
player->actor.freezeTimer = 0;
|
||||
player->stateFlags1 &= ~PLAYER_STATE1_29;
|
||||
|
||||
if (player->csMode != 0) {
|
||||
func_8002DF54(camera->globalCtx, &player->actor, 7);
|
||||
func_8002DF54(camera->play, &player->actor, 7);
|
||||
osSyncPrintf("camera: player demo end!!\n");
|
||||
}
|
||||
|
||||
@@ -7659,9 +7656,9 @@ void Camera_Finish(Camera* camera) {
|
||||
|
||||
camera->childCamId = camera->parentCamId = CAM_ID_MAIN;
|
||||
camera->timer = -1;
|
||||
camera->globalCtx->envCtx.fillScreen = false;
|
||||
camera->play->envCtx.fillScreen = false;
|
||||
|
||||
Play_ClearCamera(camera->globalCtx, camera->camId);
|
||||
Play_ClearCamera(camera->play, camera->camId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7675,7 +7672,7 @@ s32 Camera_ChangeModeFlags(Camera* camera, s16 mode, u8 flags) {
|
||||
static s32 modeChangeFlags = 0;
|
||||
|
||||
if (QREG(89)) {
|
||||
osSyncPrintf("+=+(%d)+=+ recive request -> %s\n", camera->globalCtx->state.frames, sCameraModeNames[mode]);
|
||||
osSyncPrintf("+=+(%d)+=+ recive request -> %s\n", camera->play->state.frames, sCameraModeNames[mode]);
|
||||
}
|
||||
|
||||
if (camera->unk_14C & 0x20 && flags == 0) {
|
||||
@@ -7777,7 +7774,7 @@ s32 Camera_ChangeModeFlags(Camera* camera, s16 mode, u8 flags) {
|
||||
func_80078884(0);
|
||||
break;
|
||||
case 2:
|
||||
if (camera->globalCtx->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_1) {
|
||||
if (camera->play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_1) {
|
||||
func_80078884(NA_SE_SY_ATTENTION_URGENCY);
|
||||
} else {
|
||||
func_80078884(NA_SE_SY_ATTENTION_ON);
|
||||
@@ -7824,7 +7821,7 @@ s16 Camera_ChangeSettingFlags(Camera* camera, s16 setting, s16 flags) {
|
||||
}
|
||||
}
|
||||
if (((setting == CAM_SET_MEADOW_BIRDS_EYE) || (setting == CAM_SET_MEADOW_UNUSED)) && LINK_IS_ADULT &&
|
||||
(camera->globalCtx->sceneNum == SCENE_SPOT05)) {
|
||||
(camera->play->sceneNum == SCENE_SPOT05)) {
|
||||
camera->unk_14A |= 0x10;
|
||||
return -5;
|
||||
}
|
||||
@@ -7871,7 +7868,7 @@ s16 Camera_ChangeSettingFlags(Camera* camera, s16 setting, s16 flags) {
|
||||
Camera_CopyDataToRegs(camera, camera->mode);
|
||||
}
|
||||
|
||||
osSyncPrintf(VT_SGR("1") "%06u:" VT_RST " camera: change camera[%d] set %s\n", camera->globalCtx->state.frames,
|
||||
osSyncPrintf(VT_SGR("1") "%06u:" VT_RST " camera: change camera[%d] set %s\n", camera->play->state.frames,
|
||||
camera->camId, sCameraSettingNames[camera->setting]);
|
||||
|
||||
return setting;
|
||||
@@ -8198,9 +8195,9 @@ s32 func_8005B198(void) {
|
||||
s16 func_8005B1A4(Camera* camera) {
|
||||
camera->unk_14C |= 0x8;
|
||||
|
||||
if ((camera->camId == CAM_ID_MAIN) && (camera->globalCtx->activeCamId != CAM_ID_MAIN)) {
|
||||
GET_ACTIVE_CAM(camera->globalCtx)->unk_14C |= 0x8;
|
||||
return camera->globalCtx->activeCamId;
|
||||
if ((camera->camId == CAM_ID_MAIN) && (camera->play->activeCamId != CAM_ID_MAIN)) {
|
||||
GET_ACTIVE_CAM(camera->play)->unk_14C |= 0x8;
|
||||
return camera->play->activeCamId;
|
||||
}
|
||||
|
||||
return camera->camId;
|
||||
|
||||
@@ -2398,6 +2398,6 @@ s16 D_8011DAFC[] = {
|
||||
CAM_SET_NORMAL0, CAM_SET_NORMAL1, CAM_SET_NORMAL2, CAM_SET_DUNGEON0, CAM_SET_DUNGEON1, CAM_SET_DUNGEON2,
|
||||
};
|
||||
|
||||
GlobalContext* D_8015BD7C;
|
||||
PlayState* D_8015BD7C;
|
||||
DbCamera D_8015BD80;
|
||||
CollisionPoly* playerFloorPoly;
|
||||
|
||||
+10
-10
@@ -1,23 +1,23 @@
|
||||
#include "global.h"
|
||||
|
||||
void Gfx_DrawDListOpa(GlobalContext* globalCtx, Gfx* dlist) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 214);
|
||||
void Gfx_DrawDListOpa(PlayState* play, Gfx* dlist) {
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 214);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 216),
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_cheap_proc.c", 216),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, dlist);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 219);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 219);
|
||||
}
|
||||
|
||||
void Gfx_DrawDListXlu(GlobalContext* globalCtx, Gfx* dlist) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 228);
|
||||
void Gfx_DrawDListXlu(PlayState* play, Gfx* dlist) {
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 228);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 230),
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_cheap_proc.c", 230),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, dlist);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 233);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 233);
|
||||
}
|
||||
|
||||
+375
-403
File diff suppressed because it is too large
Load Diff
+17
-17
@@ -1,11 +1,11 @@
|
||||
#include "global.h"
|
||||
|
||||
void func_80110990(GlobalContext* globalCtx) {
|
||||
Map_Destroy(globalCtx);
|
||||
void func_80110990(PlayState* play) {
|
||||
Map_Destroy(play);
|
||||
}
|
||||
|
||||
void func_801109B0(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
void func_801109B0(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
u32 parameterSize;
|
||||
u16 doActionOffset;
|
||||
u8 temp;
|
||||
@@ -13,7 +13,7 @@ void func_801109B0(GlobalContext* globalCtx) {
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
gSaveContext.unk_13E8 = gSaveContext.unk_13EA = 0;
|
||||
|
||||
View_Init(&interfaceCtx->view, globalCtx->state.gfxCtx);
|
||||
View_Init(&interfaceCtx->view, play->state.gfxCtx);
|
||||
|
||||
interfaceCtx->unk_1FA = interfaceCtx->unk_261 = interfaceCtx->unk_1FC = 0;
|
||||
interfaceCtx->unk_1EC = interfaceCtx->unk_1EE = interfaceCtx->unk_1F0 = 0;
|
||||
@@ -32,7 +32,7 @@ void func_801109B0(GlobalContext* globalCtx) {
|
||||
// "Permanent PARAMETER Segment = %x"
|
||||
osSyncPrintf("常駐PARAMETERセグメント=%x\n", parameterSize);
|
||||
|
||||
interfaceCtx->parameterSegment = GameState_Alloc(&globalCtx->state, parameterSize, "../z_construct.c", 159);
|
||||
interfaceCtx->parameterSegment = GameState_Alloc(&play->state, parameterSize, "../z_construct.c", 159);
|
||||
|
||||
osSyncPrintf("parameter->parameterSegment=%x\n", interfaceCtx->parameterSegment);
|
||||
|
||||
@@ -40,7 +40,7 @@ void func_801109B0(GlobalContext* globalCtx) {
|
||||
DmaMgr_SendRequest1(interfaceCtx->parameterSegment, (u32)_parameter_staticSegmentRomStart, parameterSize,
|
||||
"../z_construct.c", 162);
|
||||
|
||||
interfaceCtx->doActionSegment = GameState_Alloc(&globalCtx->state, 0x480, "../z_construct.c", 166);
|
||||
interfaceCtx->doActionSegment = GameState_Alloc(&play->state, 0x480, "../z_construct.c", 166);
|
||||
|
||||
osSyncPrintf("DOアクション テクスチャ初期=%x\n", 0x480); // "DO Action Texture Initialization"
|
||||
osSyncPrintf("parameter->do_actionSegment=%x\n", interfaceCtx->doActionSegment);
|
||||
@@ -69,7 +69,7 @@ void func_801109B0(GlobalContext* globalCtx) {
|
||||
DmaMgr_SendRequest1(interfaceCtx->doActionSegment + 0x300, (u32)_do_action_staticSegmentRomStart + doActionOffset,
|
||||
0x180, "../z_construct.c", 178);
|
||||
|
||||
interfaceCtx->iconItemSegment = GameState_Alloc(&globalCtx->state, 0x4000, "../z_construct.c", 190);
|
||||
interfaceCtx->iconItemSegment = GameState_Alloc(&play->state, 0x4000, "../z_construct.c", 190);
|
||||
|
||||
// "Icon Item Texture Initialization = %x"
|
||||
osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", 0x4000);
|
||||
@@ -146,8 +146,8 @@ void func_801109B0(GlobalContext* globalCtx) {
|
||||
|
||||
osSyncPrintf("PARAMETER領域=%x\n", parameterSize + 0x5300); // "Parameter Area = %x"
|
||||
|
||||
Health_InitMeter(globalCtx);
|
||||
Map_Init(globalCtx);
|
||||
Health_InitMeter(play);
|
||||
Map_Init(play);
|
||||
|
||||
interfaceCtx->unk_23C = interfaceCtx->unk_242 = 0;
|
||||
|
||||
@@ -164,29 +164,29 @@ void func_801109B0(GlobalContext* globalCtx) {
|
||||
R_A_BTN_COLOR(2) = 50;
|
||||
}
|
||||
|
||||
void Message_Init(GlobalContext* globalCtx) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
void Message_Init(PlayState* play) {
|
||||
MessageContext* msgCtx = &play->msgCtx;
|
||||
s32 pad;
|
||||
|
||||
Message_SetTables();
|
||||
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_00;
|
||||
play->msgCtx.ocarinaMode = OCARINA_MODE_00;
|
||||
|
||||
msgCtx->msgMode = MSGMODE_NONE;
|
||||
msgCtx->msgLength = 0;
|
||||
msgCtx->textId = msgCtx->textboxEndType = msgCtx->choiceIndex = msgCtx->ocarinaAction = msgCtx->textUnskippable = 0;
|
||||
msgCtx->textColorAlpha = 255;
|
||||
|
||||
View_Init(&msgCtx->view, globalCtx->state.gfxCtx);
|
||||
View_Init(&msgCtx->view, play->state.gfxCtx);
|
||||
|
||||
msgCtx->textboxSegment = GameState_Alloc(&globalCtx->state, 0x2200, "../z_construct.c", 349);
|
||||
msgCtx->textboxSegment = GameState_Alloc(&play->state, 0x2200, "../z_construct.c", 349);
|
||||
|
||||
osSyncPrintf("message->fukidashiSegment=%x\n", msgCtx->textboxSegment);
|
||||
|
||||
osSyncPrintf("吹き出しgame_alloc=%x\n", 0x2200); // "Textbox game_alloc=%x"
|
||||
ASSERT(msgCtx->textboxSegment != NULL, "message->fukidashiSegment != NULL", "../z_construct.c", 352);
|
||||
|
||||
Font_LoadOrderedFont(&globalCtx->msgCtx.font);
|
||||
Font_LoadOrderedFont(&play->msgCtx.font);
|
||||
|
||||
YREG(31) = 0;
|
||||
}
|
||||
@@ -600,6 +600,6 @@ void func_80111070(void) {
|
||||
VREG(92) = -63;
|
||||
}
|
||||
|
||||
void func_80112098(GlobalContext* globalCtx) {
|
||||
void func_80112098(PlayState* play) {
|
||||
func_80111070();
|
||||
}
|
||||
|
||||
+16
-16
@@ -6,10 +6,10 @@ typedef struct {
|
||||
/* 0x04 */ void* drawArg; // segment address (display list or texture) passed to the draw function when called
|
||||
} DebugDispObjectInfo; // size = 0x8
|
||||
|
||||
typedef void (*DebugDispObject_DrawFunc)(DebugDispObject*, void*, GlobalContext*);
|
||||
typedef void (*DebugDispObject_DrawFunc)(DebugDispObject*, void*, PlayState*);
|
||||
|
||||
void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, GlobalContext* globalCtx);
|
||||
void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dlist, GlobalContext* globalCtx);
|
||||
void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, PlayState* play);
|
||||
void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dlist, PlayState* play);
|
||||
|
||||
static DebugDispObject_DrawFunc sDebugObjectDrawFuncTable[] = {
|
||||
DebugDisplay_DrawSpriteI8,
|
||||
@@ -55,43 +55,43 @@ DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX,
|
||||
return sDebugObjectListHead;
|
||||
}
|
||||
|
||||
void DebugDisplay_DrawObjects(GlobalContext* globalCtx) {
|
||||
void DebugDisplay_DrawObjects(PlayState* play) {
|
||||
DebugDispObject* dispObj = sDebugObjectListHead;
|
||||
DebugDispObjectInfo* objInfo;
|
||||
|
||||
while (dispObj != NULL) {
|
||||
objInfo = &sDebugObjectInfoTable[dispObj->type];
|
||||
sDebugObjectDrawFuncTable[objInfo->drawType](dispObj, objInfo->drawArg, globalCtx);
|
||||
sDebugObjectDrawFuncTable[objInfo->drawType](dispObj, objInfo->drawArg, play);
|
||||
dispObj = dispObj->next;
|
||||
}
|
||||
}
|
||||
|
||||
void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_debug_display.c", 169);
|
||||
void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, PlayState* play) {
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_debug_display.c", 169);
|
||||
|
||||
func_80094678(globalCtx->state.gfxCtx);
|
||||
func_80094678(play->state.gfxCtx);
|
||||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, dispObj->color.r, dispObj->color.g, dispObj->color.b, dispObj->color.a);
|
||||
|
||||
Matrix_Translate(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_RotateZYX(dispObj->rot.x, dispObj->rot.y, dispObj->rot.z, MTXMODE_APPLY);
|
||||
|
||||
gDPLoadTextureBlock(POLY_XLU_DISP++, texture, G_IM_FMT_I, G_IM_SIZ_8b, 16, 16, 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);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 189),
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_debug_display.c", 189),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gDebugSpriteDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_debug_display.c", 192);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_debug_display.c", 192);
|
||||
}
|
||||
|
||||
void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dlist, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_debug_display.c", 211);
|
||||
void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dlist, PlayState* play) {
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_debug_display.c", 211);
|
||||
|
||||
func_8009435C(globalCtx->state.gfxCtx);
|
||||
func_8009435C(play->state.gfxCtx);
|
||||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, dispObj->color.r, dispObj->color.g, dispObj->color.b, dispObj->color.a);
|
||||
|
||||
@@ -100,9 +100,9 @@ void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dlist, GlobalConte
|
||||
Matrix_SetTranslateRotateYXZ(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, &dispObj->rot);
|
||||
Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 228),
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_debug_display.c", 228),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, dlist);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_debug_display.c", 231);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_debug_display.c", 231);
|
||||
}
|
||||
|
||||
+558
-559
File diff suppressed because it is too large
Load Diff
+213
-266
@@ -79,35 +79,35 @@
|
||||
#include "objects/object_st/object_st.h"
|
||||
|
||||
// "Get Item" Model Draw Functions
|
||||
void GetItem_DrawMaskOrBombchu(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawSoldOut(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawBlueFire(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawPoes(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawFairy(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawMirrorShield(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawSkullToken(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawEggOrMedallion(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawCompass(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawPotion(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawGoronSword(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawDekuNuts(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawRecoveryHeart(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawFish(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawOpa0(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawOpa0Xlu1(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawXlu01(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawOpa10Xlu2(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawMagicArrow(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawMagicSpell(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawOpa1023(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawOpa10Xlu32(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawSmallRupee(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawScale(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawBulletBag(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawWallet(GlobalContext* globalCtx, s16 drawId);
|
||||
void GetItem_DrawMaskOrBombchu(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawSoldOut(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawBlueFire(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawPoes(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawFairy(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawMirrorShield(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawSkullToken(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawEggOrMedallion(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawCompass(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawPotion(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawGoronSword(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawDekuNuts(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawRecoveryHeart(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawFish(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawOpa0(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawOpa0Xlu1(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawXlu01(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawOpa10Xlu2(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawMagicArrow(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawMagicSpell(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawOpa1023(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawOpa10Xlu32(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawSmallRupee(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawScale(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawBulletBag(PlayState* play, s16 drawId);
|
||||
void GetItem_DrawWallet(PlayState* play, s16 drawId);
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ void (*drawFunc)(GlobalContext*, s16);
|
||||
/* 0x00 */ void (*drawFunc)(PlayState*, s16);
|
||||
/* 0x04 */ Gfx* dlists[8];
|
||||
} DrawItemTableEntry; // size = 0x24
|
||||
|
||||
@@ -373,501 +373,448 @@ DrawItemTableEntry sDrawItemTable[] = {
|
||||
* Draw "Get Item" Model
|
||||
* Calls the corresponding draw function for the given draw ID
|
||||
*/
|
||||
void GetItem_Draw(GlobalContext* globalCtx, s16 drawId) {
|
||||
sDrawItemTable[drawId].drawFunc(globalCtx, drawId);
|
||||
void GetItem_Draw(PlayState* play, s16 drawId) {
|
||||
sDrawItemTable[drawId].drawFunc(play, drawId);
|
||||
}
|
||||
|
||||
// All remaining functions in this file are draw functions referenced in the table and called by the function above
|
||||
|
||||
void GetItem_DrawMaskOrBombchu(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawMaskOrBombchu(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 556);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 556);
|
||||
|
||||
func_80093BA8(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 560),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093BA8(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 560), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 565);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 565);
|
||||
}
|
||||
|
||||
void GetItem_DrawSoldOut(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawSoldOut(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 572);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 572);
|
||||
|
||||
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 5);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 576),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 576), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 581);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 581);
|
||||
}
|
||||
|
||||
void GetItem_DrawBlueFire(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawBlueFire(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 588);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 588);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 592),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 592), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
0 * (globalCtx->state.frames * 0), 16, 32, 1, 1 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 8), 16, 32));
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0 * (play->state.frames * 0), 0 * (play->state.frames * 0), 16,
|
||||
32, 1, 1 * (play->state.frames * 1), 1 * -(play->state.frames * 8), 16, 32));
|
||||
Matrix_Push();
|
||||
Matrix_Translate(-8.0f, -2.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 615),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 615), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 621);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 621);
|
||||
}
|
||||
|
||||
void GetItem_DrawPoes(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawPoes(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 628);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 628);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 632),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 632), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 641),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 641), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
0 * (globalCtx->state.frames * 0), 16, 32, 1, 1 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 6), 16, 32));
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0 * (play->state.frames * 0), 0 * (play->state.frames * 0), 16,
|
||||
32, 1, 1 * (play->state.frames * 1), 1 * -(play->state.frames * 6), 16, 32));
|
||||
Matrix_Push();
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 656),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 656), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 663);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 663);
|
||||
}
|
||||
|
||||
void GetItem_DrawFairy(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawFairy(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 670);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 670);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 674),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 674), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 683),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 683), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
0 * (globalCtx->state.frames * 0), 32, 32, 1, 1 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 6), 32, 32));
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0 * (play->state.frames * 0), 0 * (play->state.frames * 0), 32,
|
||||
32, 1, 1 * (play->state.frames * 1), 1 * -(play->state.frames * 6), 32, 32));
|
||||
Matrix_Push();
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 698),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 698), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 704);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 704);
|
||||
}
|
||||
|
||||
void GetItem_DrawMirrorShield(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawMirrorShield(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 712);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 712);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0) % 256,
|
||||
1 * (globalCtx->state.frames * 2) % 256, 64, 64, 1,
|
||||
0 * (globalCtx->state.frames * 0) % 128, 1 * (globalCtx->state.frames * 1) % 128, 32,
|
||||
32));
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 723),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0 * (play->state.frames * 0) % 256,
|
||||
1 * (play->state.frames * 2) % 256, 64, 64, 1, 0 * (play->state.frames * 0) % 128,
|
||||
1 * (play->state.frames * 1) % 128, 32, 32));
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 723), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 730),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 730), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 735);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 735);
|
||||
}
|
||||
|
||||
void GetItem_DrawSkullToken(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawSkullToken(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 742);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 742);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 746),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 746), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
1 * -(globalCtx->state.frames * 5), 32, 32, 1, 0 * (globalCtx->state.frames * 0),
|
||||
0 * (globalCtx->state.frames * 0), 32, 64));
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 760),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0 * (play->state.frames * 0), 1 * -(play->state.frames * 5), 32,
|
||||
32, 1, 0 * (play->state.frames * 0), 0 * (play->state.frames * 0), 32, 64));
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 760), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 765);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 765);
|
||||
}
|
||||
|
||||
void GetItem_DrawEggOrMedallion(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawEggOrMedallion(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 772);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 772);
|
||||
|
||||
func_80093BA8(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 776),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093BA8(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 776), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 783);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 783);
|
||||
}
|
||||
|
||||
void GetItem_DrawCompass(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawCompass(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 811);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 811);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 815),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 815), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 5);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 822),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 822), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 827);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 827);
|
||||
}
|
||||
|
||||
void GetItem_DrawPotion(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawPotion(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 834);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 834);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, -1 * (globalCtx->state.frames * 1),
|
||||
1 * (globalCtx->state.frames * 1), 32, 32, 1, -1 * (globalCtx->state.frames * 1),
|
||||
1 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 845),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, -1 * (play->state.frames * 1), 1 * (play->state.frames * 1), 32,
|
||||
32, 1, -1 * (play->state.frames * 1), 1 * (play->state.frames * 1), 32, 32));
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 845), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[3]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 855),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 855), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[4]);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[5]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 861);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 861);
|
||||
}
|
||||
|
||||
void GetItem_DrawGoronSword(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawGoronSword(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 868);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 868);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 1),
|
||||
0 * (globalCtx->state.frames * 1), 32, 32, 1, 0 * (globalCtx->state.frames * 1),
|
||||
0 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 878),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 1 * (play->state.frames * 1), 0 * (play->state.frames * 1), 32,
|
||||
32, 1, 0 * (play->state.frames * 1), 0 * (play->state.frames * 1), 32, 32));
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 878), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 883);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 883);
|
||||
}
|
||||
|
||||
void GetItem_DrawDekuNuts(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawDekuNuts(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 890);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 890);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 6),
|
||||
1 * (globalCtx->state.frames * 6), 32, 32, 1, 1 * (globalCtx->state.frames * 6),
|
||||
1 * (globalCtx->state.frames * 6), 32, 32));
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 901),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 1 * (play->state.frames * 6), 1 * (play->state.frames * 6), 32,
|
||||
32, 1, 1 * (play->state.frames * 6), 1 * (play->state.frames * 6), 32, 32));
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 901), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 906);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 906);
|
||||
}
|
||||
|
||||
void GetItem_DrawRecoveryHeart(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawRecoveryHeart(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 913);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 913);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 3), 32, 32, 1, 0 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 2), 32, 32));
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 924),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0 * (play->state.frames * 1), 1 * -(play->state.frames * 3), 32,
|
||||
32, 1, 0 * (play->state.frames * 1), 1 * -(play->state.frames * 2), 32, 32));
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 924), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 929);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 929);
|
||||
}
|
||||
|
||||
void GetItem_DrawFish(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawFish(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 936);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 936);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
1 * (globalCtx->state.frames * 1), 32, 32, 1, 0 * (globalCtx->state.frames * 0),
|
||||
1 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 947),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0 * (play->state.frames * 0), 1 * (play->state.frames * 1), 32,
|
||||
32, 1, 0 * (play->state.frames * 0), 1 * (play->state.frames * 1), 32, 32));
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 947), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 952);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 952);
|
||||
}
|
||||
|
||||
void GetItem_DrawOpa0(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawOpa0(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 959);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 959);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 963),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 963), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 968);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 968);
|
||||
}
|
||||
|
||||
void GetItem_DrawOpa0Xlu1(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawOpa0Xlu1(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 975);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 975);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 979),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 979), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 986),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 986), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 991);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 991);
|
||||
}
|
||||
|
||||
void GetItem_DrawXlu01(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawXlu01(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 998);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 998);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1002),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1002), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1008);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1008);
|
||||
}
|
||||
|
||||
void GetItem_DrawOpa10Xlu2(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawOpa10Xlu2(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1015);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1015);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1019),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1019), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1027),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1027), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1032);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1032);
|
||||
}
|
||||
|
||||
void GetItem_DrawMagicArrow(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawMagicArrow(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1039);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1039);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1043),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1043), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1050),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1050), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1056);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1056);
|
||||
}
|
||||
|
||||
void GetItem_DrawMagicSpell(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawMagicSpell(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1063);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1063);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 2),
|
||||
1 * -(globalCtx->state.frames * 6), 32, 32, 1, 1 * (globalCtx->state.frames * 1),
|
||||
-1 * (globalCtx->state.frames * 2), 32, 32));
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1074),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 1 * (play->state.frames * 2), 1 * -(play->state.frames * 6), 32,
|
||||
32, 1, 1 * (play->state.frames * 1), -1 * (play->state.frames * 2), 32, 32));
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1074), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1081);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1081);
|
||||
}
|
||||
|
||||
void GetItem_DrawOpa1023(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawOpa1023(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1088);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1088);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1092),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1092), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[3]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1100);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1100);
|
||||
}
|
||||
|
||||
void GetItem_DrawOpa10Xlu32(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawOpa10Xlu32(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1108);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1108);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1112),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1112), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1120),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1120), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1126);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1126);
|
||||
}
|
||||
|
||||
void GetItem_DrawSmallRupee(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawSmallRupee(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1133);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1133);
|
||||
|
||||
Matrix_Scale(0.7f, 0.7f, 0.7f, MTXMODE_APPLY);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1140),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1140), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1148),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1148), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1154);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1154);
|
||||
}
|
||||
|
||||
void GetItem_DrawScale(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawScale(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1162);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1162);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 2),
|
||||
-1 * (globalCtx->state.frames * 2), 64, 64, 1, 1 * (globalCtx->state.frames * 4),
|
||||
1 * -(globalCtx->state.frames * 4), 32, 32));
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1173),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 1 * (play->state.frames * 2), -1 * (play->state.frames * 2), 64,
|
||||
64, 1, 1 * (play->state.frames * 4), 1 * -(play->state.frames * 4), 32, 32));
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1173), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1181);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1181);
|
||||
}
|
||||
|
||||
void GetItem_DrawBulletBag(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawBulletBag(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1188);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1188);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1192),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1192), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1200),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1200), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[4]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1207);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1207);
|
||||
}
|
||||
|
||||
void GetItem_DrawWallet(GlobalContext* globalCtx, s16 drawId) {
|
||||
void GetItem_DrawWallet(PlayState* play, s16 drawId) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1214);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1214);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1218),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1218), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]);
|
||||
@@ -877,5 +824,5 @@ void GetItem_DrawWallet(GlobalContext* globalCtx, s16 drawId) {
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[6]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[7]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_draw.c", 1230);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1230);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ void EffectShieldParticle_Init(void* thisx, void* initParamsx) {
|
||||
this->lightInfo.type = LIGHT_POINT_NOGLOW;
|
||||
this->lightInfo.params.point = initParams->lightPoint;
|
||||
this->lightNode =
|
||||
LightContext_InsertLight(Effect_GetGlobalCtx(), &Effect_GetGlobalCtx()->lightCtx, &this->lightInfo);
|
||||
LightContext_InsertLight(Effect_GetPlayState(), &Effect_GetPlayState()->lightCtx, &this->lightInfo);
|
||||
} else {
|
||||
this->lightNode = NULL;
|
||||
}
|
||||
@@ -63,10 +63,10 @@ void EffectShieldParticle_Destroy(void* thisx) {
|
||||
EffectShieldParticle* this = (EffectShieldParticle*)thisx;
|
||||
|
||||
if ((this != NULL) && (this->lightDecay == true)) {
|
||||
if (this->lightNode == Effect_GetGlobalCtx()->lightCtx.listHead) {
|
||||
Effect_GetGlobalCtx()->lightCtx.listHead = this->lightNode->next;
|
||||
if (this->lightNode == Effect_GetPlayState()->lightCtx.listHead) {
|
||||
Effect_GetPlayState()->lightCtx.listHead = this->lightNode->next;
|
||||
}
|
||||
LightContext_RemoveLight(Effect_GetGlobalCtx(), &Effect_GetGlobalCtx()->lightCtx, this->lightNode);
|
||||
LightContext_RemoveLight(Effect_GetPlayState(), &Effect_GetPlayState()->lightCtx, this->lightNode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ s32 EffectSpark_Update(void* thisx) {
|
||||
void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) {
|
||||
Vtx* vertices;
|
||||
EffectSpark* this = (EffectSpark*)thisx;
|
||||
GlobalContext* globalCtx = Effect_GetGlobalCtx();
|
||||
PlayState* play = Effect_GetPlayState();
|
||||
s32 i;
|
||||
s32 j;
|
||||
u8 sp1D3;
|
||||
@@ -210,7 +210,7 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) {
|
||||
SkinMatrix_SetTranslate(&spEC, elem->position.x, elem->position.y, elem->position.z);
|
||||
temp = ((Rand_ZeroOne() * 2.5f) + 1.5f) / 64.0f;
|
||||
SkinMatrix_SetScale(&spAC, temp, temp, 1.0f);
|
||||
SkinMatrix_MtxFMtxFMult(&spEC, &globalCtx->billboardMtxF, &sp6C);
|
||||
SkinMatrix_MtxFMtxFMult(&spEC, &play->billboardMtxF, &sp6C);
|
||||
SkinMatrix_MtxFMtxFMult(&sp6C, &spAC, &sp12C);
|
||||
|
||||
vertices[j].v.ob[0] = -32;
|
||||
|
||||
+20
-20
@@ -1,11 +1,11 @@
|
||||
#include "global.h"
|
||||
|
||||
void func_80026230(GlobalContext* globalCtx, Color_RGBA8* color, s16 arg2, s16 arg3) {
|
||||
void func_80026230(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3) {
|
||||
f32 cos;
|
||||
Gfx* displayListHead;
|
||||
f32 absCos;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 113);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 113);
|
||||
|
||||
displayListHead = POLY_OPA_DISP;
|
||||
cos = Math_CosS((0x8000 / arg3) * arg2);
|
||||
@@ -25,15 +25,15 @@ void func_80026230(GlobalContext* globalCtx, Color_RGBA8* color, s16 arg2, s16 a
|
||||
|
||||
if (1) {} // Necessary to match
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 129);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 129);
|
||||
}
|
||||
|
||||
void func_80026400(GlobalContext* globalCtx, Color_RGBA8* color, s16 arg2, s16 arg3) {
|
||||
void func_80026400(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3) {
|
||||
Gfx* displayListHead;
|
||||
f32 cos;
|
||||
|
||||
if (arg3 != 0) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 141);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 141);
|
||||
|
||||
cos = Math_CosS((0x4000 / arg3) * arg2);
|
||||
displayListHead = POLY_OPA_DISP;
|
||||
@@ -46,27 +46,27 @@ void func_80026400(GlobalContext* globalCtx, Color_RGBA8* color, s16 arg2, s16 a
|
||||
|
||||
if (1) {} // Necessary to match
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 153);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 153);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80026608(GlobalContext* globalCtx) {
|
||||
void func_80026608(PlayState* play) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 159);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 159);
|
||||
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 164);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 164);
|
||||
}
|
||||
|
||||
void func_80026690(GlobalContext* globalCtx, Color_RGBA8* color, s16 arg2, s16 arg3) {
|
||||
void func_80026690(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3) {
|
||||
f32 cos;
|
||||
Gfx* displayListHead;
|
||||
f32 absCos;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 178);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 178);
|
||||
|
||||
displayListHead = POLY_XLU_DISP;
|
||||
cos = Math_CosS((0x8000 / arg3) * arg2);
|
||||
@@ -86,14 +86,14 @@ void func_80026690(GlobalContext* globalCtx, Color_RGBA8* color, s16 arg2, s16 a
|
||||
|
||||
if (1) {} // Necessary to match
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 194);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 194);
|
||||
}
|
||||
|
||||
void func_80026860(GlobalContext* globalCtx, Color_RGBA8* color, s16 arg2, s16 arg3) {
|
||||
void func_80026860(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3) {
|
||||
f32 cos;
|
||||
Gfx* displayListHead;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 201);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 201);
|
||||
|
||||
displayListHead = POLY_XLU_DISP;
|
||||
cos = Math_CosS((0x4000 / arg3) * arg2);
|
||||
@@ -106,16 +106,16 @@ void func_80026860(GlobalContext* globalCtx, Color_RGBA8* color, s16 arg2, s16 a
|
||||
|
||||
if (1) {} // Necessary to match
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 212);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 212);
|
||||
}
|
||||
|
||||
void func_80026A6C(GlobalContext* globalCtx) {
|
||||
void func_80026A6C(PlayState* play) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 217);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 217);
|
||||
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
POLY_XLU_DISP = Play_SetFog(globalCtx, POLY_XLU_DISP);
|
||||
POLY_XLU_DISP = Play_SetFog(play, POLY_XLU_DISP);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 222);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 222);
|
||||
}
|
||||
|
||||
+12
-12
@@ -33,8 +33,8 @@ EffectInfo sEffectInfoTable[] = {
|
||||
},
|
||||
};
|
||||
|
||||
GlobalContext* Effect_GetGlobalCtx(void) {
|
||||
return sEffectContext.globalCtx;
|
||||
PlayState* Effect_GetPlayState(void) {
|
||||
return sEffectContext.play;
|
||||
}
|
||||
|
||||
void* Effect_GetByIndex(s32 index) {
|
||||
@@ -77,7 +77,7 @@ void Effect_InitStatus(EffectStatus* status) {
|
||||
status->unk_02 = 0;
|
||||
}
|
||||
|
||||
void Effect_InitContext(GlobalContext* globalCtx) {
|
||||
void Effect_InitContext(PlayState* play) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < SPARK_COUNT; i++) {
|
||||
@@ -93,10 +93,10 @@ void Effect_InitContext(GlobalContext* globalCtx) {
|
||||
Effect_InitStatus(&sEffectContext.blures[i].status);
|
||||
}
|
||||
|
||||
sEffectContext.globalCtx = globalCtx;
|
||||
sEffectContext.play = play;
|
||||
}
|
||||
|
||||
void Effect_Add(GlobalContext* globalCtx, s32* pIndex, s32 type, u8 arg3, u8 arg4, void* initParams) {
|
||||
void Effect_Add(PlayState* play, s32* pIndex, s32 type, u8 arg3, u8 arg4, void* initParams) {
|
||||
s32 i;
|
||||
u32 slotFound;
|
||||
void* effect = NULL;
|
||||
@@ -104,7 +104,7 @@ void Effect_Add(GlobalContext* globalCtx, s32* pIndex, s32 type, u8 arg3, u8 arg
|
||||
|
||||
*pIndex = TOTAL_EFFECT_COUNT;
|
||||
|
||||
if (FrameAdvance_IsEnabled(globalCtx) != true) {
|
||||
if (FrameAdvance_IsEnabled(play) != true) {
|
||||
slotFound = false;
|
||||
switch (type) {
|
||||
case EFFECT_SPARK:
|
||||
@@ -181,13 +181,13 @@ void Effect_DrawAll(GraphicsContext* gfxCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
void Effect_UpdateAll(GlobalContext* globalCtx) {
|
||||
void Effect_UpdateAll(PlayState* play) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < SPARK_COUNT; i++) {
|
||||
if (sEffectContext.sparks[i].status.active) {
|
||||
if (sEffectInfoTable[EFFECT_SPARK].update(&sEffectContext.sparks[i].effect) == 1) {
|
||||
Effect_Delete(globalCtx, i);
|
||||
Effect_Delete(play, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -195,7 +195,7 @@ void Effect_UpdateAll(GlobalContext* globalCtx) {
|
||||
for (i = 0; i < BLURE_COUNT; i++) {
|
||||
if (sEffectContext.blures[i].status.active) {
|
||||
if (sEffectInfoTable[EFFECT_BLURE1].update(&sEffectContext.blures[i].effect) == 1) {
|
||||
Effect_Delete(globalCtx, i + SPARK_COUNT);
|
||||
Effect_Delete(play, i + SPARK_COUNT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -203,13 +203,13 @@ void Effect_UpdateAll(GlobalContext* globalCtx) {
|
||||
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
|
||||
if (sEffectContext.shieldParticles[i].status.active) {
|
||||
if (sEffectInfoTable[EFFECT_SHIELD_PARTICLE].update(&sEffectContext.shieldParticles[i].effect) == 1) {
|
||||
Effect_Delete(globalCtx, i + SPARK_COUNT + BLURE_COUNT);
|
||||
Effect_Delete(play, i + SPARK_COUNT + BLURE_COUNT);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Effect_Delete(GlobalContext* globalCtx, s32 index) {
|
||||
void Effect_Delete(PlayState* play, s32 index) {
|
||||
if (index == TOTAL_EFFECT_COUNT) {
|
||||
return;
|
||||
}
|
||||
@@ -235,7 +235,7 @@ void Effect_Delete(GlobalContext* globalCtx, s32 index) {
|
||||
}
|
||||
}
|
||||
|
||||
void Effect_DeleteAll(GlobalContext* globalCtx) {
|
||||
void Effect_DeleteAll(PlayState* play) {
|
||||
s32 i;
|
||||
|
||||
osSyncPrintf("エフェクト総て解放\n"); // "All effect release"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
EffectSsInfo sEffectSsInfo = { 0 }; // "EffectSS2Info"
|
||||
|
||||
void EffectSs_InitInfo(GlobalContext* globalCtx, s32 tableSize) {
|
||||
void EffectSs_InitInfo(PlayState* play, s32 tableSize) {
|
||||
u32 i;
|
||||
EffectSs* effectSs;
|
||||
EffectSsOverlay* overlay;
|
||||
@@ -14,8 +14,7 @@ void EffectSs_InitInfo(GlobalContext* globalCtx, s32 tableSize) {
|
||||
(u32)overlay->vramEnd - (u32)overlay->vramStart, overlay->vromEnd - overlay->vromStart);
|
||||
}
|
||||
|
||||
sEffectSsInfo.table =
|
||||
GameState_Alloc(&globalCtx->state, tableSize * sizeof(EffectSs), "../z_effect_soft_sprite.c", 289);
|
||||
sEffectSsInfo.table = GameState_Alloc(&play->state, tableSize * sizeof(EffectSs), "../z_effect_soft_sprite.c", 289);
|
||||
ASSERT(sEffectSsInfo.table != NULL, "EffectSS2Info.data_table != NULL", "../z_effect_soft_sprite.c", 290);
|
||||
|
||||
sEffectSsInfo.searchStartIndex = 0;
|
||||
@@ -32,7 +31,7 @@ void EffectSs_InitInfo(GlobalContext* globalCtx, s32 tableSize) {
|
||||
}
|
||||
}
|
||||
|
||||
void EffectSs_ClearAll(GlobalContext* globalCtx) {
|
||||
void EffectSs_ClearAll(PlayState* play) {
|
||||
u32 i;
|
||||
EffectSs* effectSs;
|
||||
EffectSsOverlay* overlay;
|
||||
@@ -153,10 +152,10 @@ s32 EffectSs_FindSlot(s32 priority, s32* pIndex) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EffectSs_Insert(GlobalContext* globalCtx, EffectSs* effectSs) {
|
||||
void EffectSs_Insert(PlayState* play, EffectSs* effectSs) {
|
||||
s32 index;
|
||||
|
||||
if (FrameAdvance_IsEnabled(globalCtx) != true) {
|
||||
if (FrameAdvance_IsEnabled(play) != true) {
|
||||
if (EffectSs_FindSlot(effectSs->priority, &index) == 0) {
|
||||
sEffectSsInfo.searchStartIndex = index + 1;
|
||||
sEffectSsInfo.table[index] = *effectSs;
|
||||
@@ -165,7 +164,7 @@ void EffectSs_Insert(GlobalContext* globalCtx, EffectSs* effectSs) {
|
||||
}
|
||||
|
||||
// original name: "EffectSoftSprite2_makeEffect"
|
||||
void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* initParams) {
|
||||
void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initParams) {
|
||||
s32 index;
|
||||
u32 overlaySize;
|
||||
EffectSsOverlay* overlayEntry;
|
||||
@@ -234,7 +233,7 @@ void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* init
|
||||
sEffectSsInfo.table[index].type = type;
|
||||
sEffectSsInfo.table[index].priority = priority;
|
||||
|
||||
if (initInfo->init(globalCtx, index, &sEffectSsInfo.table[index], initParams) == 0) {
|
||||
if (initInfo->init(play, index, &sEffectSsInfo.table[index], initParams) == 0) {
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
// "Construction failed for some reason. The constructor returned an error.
|
||||
// Ceasing effect addition."
|
||||
@@ -246,7 +245,7 @@ void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* init
|
||||
}
|
||||
}
|
||||
|
||||
void EffectSs_Update(GlobalContext* globalCtx, s32 index) {
|
||||
void EffectSs_Update(PlayState* play, s32 index) {
|
||||
EffectSs* effectSs = &sEffectSsInfo.table[index];
|
||||
|
||||
if (effectSs->update != NULL) {
|
||||
@@ -258,11 +257,11 @@ void EffectSs_Update(GlobalContext* globalCtx, s32 index) {
|
||||
effectSs->pos.y += effectSs->velocity.y;
|
||||
effectSs->pos.z += effectSs->velocity.z;
|
||||
|
||||
effectSs->update(globalCtx, index, effectSs);
|
||||
effectSs->update(play, index, effectSs);
|
||||
}
|
||||
}
|
||||
|
||||
void EffectSs_UpdateAll(GlobalContext* globalCtx) {
|
||||
void EffectSs_UpdateAll(PlayState* play) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < sEffectSsInfo.tableSize; i++) {
|
||||
@@ -275,26 +274,26 @@ void EffectSs_UpdateAll(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if (sEffectSsInfo.table[i].life > -1) {
|
||||
EffectSs_Update(globalCtx, i);
|
||||
EffectSs_Update(play, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EffectSs_Draw(GlobalContext* globalCtx, s32 index) {
|
||||
void EffectSs_Draw(PlayState* play, s32 index) {
|
||||
EffectSs* effectSs = &sEffectSsInfo.table[index];
|
||||
|
||||
if (effectSs->draw != NULL) {
|
||||
effectSs->draw(globalCtx, index, effectSs);
|
||||
effectSs->draw(play, index, effectSs);
|
||||
}
|
||||
}
|
||||
|
||||
// original name: "EffectSoftSprite2_disp"
|
||||
void EffectSs_DrawAll(GlobalContext* globalCtx) {
|
||||
Lights* lights = LightContext_NewLights(&globalCtx->lightCtx, globalCtx->state.gfxCtx);
|
||||
void EffectSs_DrawAll(PlayState* play) {
|
||||
Lights* lights = LightContext_NewLights(&play->lightCtx, play->state.gfxCtx);
|
||||
s32 i;
|
||||
|
||||
Lights_BindAll(lights, globalCtx->lightCtx.listHead, NULL);
|
||||
Lights_Draw(lights, globalCtx->state.gfxCtx);
|
||||
Lights_BindAll(lights, play->lightCtx.listHead, NULL);
|
||||
Lights_Draw(lights, play->state.gfxCtx);
|
||||
|
||||
for (i = 0; i < sEffectSsInfo.tableSize; i++) {
|
||||
if (sEffectSsInfo.table[i].life > -1) {
|
||||
@@ -317,7 +316,7 @@ void EffectSs_DrawAll(GlobalContext* globalCtx) {
|
||||
|
||||
EffectSs_Delete(&sEffectSsInfo.table[i]);
|
||||
} else {
|
||||
EffectSs_Draw(globalCtx, i);
|
||||
EffectSs_Draw(play, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -148,12 +148,12 @@ u16 ElfMessage_GetTextFromMsgs(ElfMessage* msg) {
|
||||
}
|
||||
}
|
||||
|
||||
u16 ElfMessage_GetSariaText(GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
u16 ElfMessage_GetSariaText(PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
ElfMessage* msgs;
|
||||
|
||||
if (!LINK_IS_ADULT) {
|
||||
if (Actor_FindNearby(globalCtx, &player->actor, ACTOR_EN_SA, 4, 800.0f) == NULL) {
|
||||
if (Actor_FindNearby(play, &player->actor, ACTOR_EN_SA, 4, 800.0f) == NULL) {
|
||||
msgs = sChildSariaMsgs;
|
||||
} else {
|
||||
return 0x0160; // Special text about Saria preferring to talk to you face-to-face
|
||||
@@ -165,10 +165,10 @@ u16 ElfMessage_GetSariaText(GlobalContext* globalCtx) {
|
||||
return ElfMessage_GetTextFromMsgs(msgs);
|
||||
}
|
||||
|
||||
u16 ElfMessage_GetCUpText(GlobalContext* globalCtx) {
|
||||
if (globalCtx->cUpElfMsgs == NULL) {
|
||||
u16 ElfMessage_GetCUpText(PlayState* play) {
|
||||
if (play->cUpElfMsgs == NULL) {
|
||||
return 0;
|
||||
} else {
|
||||
return ElfMessage_GetTextFromMsgs(globalCtx->cUpElfMsgs);
|
||||
return ElfMessage_GetTextFromMsgs(play->cUpElfMsgs);
|
||||
}
|
||||
}
|
||||
|
||||
+36
-36
@@ -4,16 +4,16 @@
|
||||
|
||||
#define FLAGS ACTOR_FLAG_4
|
||||
|
||||
void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnAObj_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnAObj_Init(Actor* thisx, PlayState* play);
|
||||
void EnAObj_Destroy(Actor* thisx, PlayState* play);
|
||||
void EnAObj_Update(Actor* thisx, PlayState* play);
|
||||
void EnAObj_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void EnAObj_WaitFinishedTalking(EnAObj* this, GlobalContext* globalCtx);
|
||||
void EnAObj_WaitTalk(EnAObj* this, GlobalContext* globalCtx);
|
||||
void EnAObj_BlockRot(EnAObj* this, GlobalContext* globalCtx);
|
||||
void EnAObj_BoulderFragment(EnAObj* this, GlobalContext* globalCtx);
|
||||
void EnAObj_Block(EnAObj* this, GlobalContext* globalCtx);
|
||||
void EnAObj_WaitFinishedTalking(EnAObj* this, PlayState* play);
|
||||
void EnAObj_WaitTalk(EnAObj* this, PlayState* play);
|
||||
void EnAObj_BlockRot(EnAObj* this, PlayState* play);
|
||||
void EnAObj_BoulderFragment(EnAObj* this, PlayState* play);
|
||||
void EnAObj_Block(EnAObj* this, PlayState* play);
|
||||
|
||||
void EnAObj_SetupWaitTalk(EnAObj* this, s16 type);
|
||||
void EnAObj_SetupBlockRot(EnAObj* this, s16 type);
|
||||
@@ -82,7 +82,7 @@ void EnAObj_SetupAction(EnAObj* this, EnAObjActionFunc actionFunc) {
|
||||
this->actionFunc = actionFunc;
|
||||
}
|
||||
|
||||
void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnAObj_Init(Actor* thisx, PlayState* play) {
|
||||
CollisionHeader* colHeader = NULL;
|
||||
s32 pad;
|
||||
EnAObj* this = (EnAObj*)thisx;
|
||||
@@ -129,13 +129,13 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
case A_OBJ_BLOCK_LARGE:
|
||||
case A_OBJ_BLOCK_HUGE:
|
||||
this->dyna.bgId = 1;
|
||||
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG);
|
||||
Actor_ChangeCategory(play, &play->actorCtx, thisx, ACTORCAT_BG);
|
||||
EnAObj_SetupBlock(this, thisx->params);
|
||||
break;
|
||||
case A_OBJ_BLOCK_SMALL_ROT:
|
||||
case A_OBJ_BLOCK_LARGE_ROT:
|
||||
this->dyna.bgId = 3;
|
||||
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG);
|
||||
Actor_ChangeCategory(play, &play->actorCtx, thisx, ACTORCAT_BG);
|
||||
EnAObj_SetupBlockRot(this, thisx->params);
|
||||
break;
|
||||
case A_OBJ_UNKNOWN_6:
|
||||
@@ -157,8 +157,8 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
thisx->flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3;
|
||||
this->focusYoffset = 45.0f;
|
||||
EnAObj_SetupWaitTalk(this, thisx->params);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
|
||||
Collider_InitCylinder(play, &this->collider);
|
||||
Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit);
|
||||
thisx->colChkInfo.mass = MASS_IMMOVABLE;
|
||||
thisx->targetMode = 0;
|
||||
break;
|
||||
@@ -178,25 +178,25 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
if (this->dyna.bgId != BGACTOR_NEG_ONE) {
|
||||
CollisionHeader_GetVirtual(sColHeaders[this->dyna.bgId], &colHeader);
|
||||
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader);
|
||||
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader);
|
||||
}
|
||||
}
|
||||
|
||||
void EnAObj_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnAObj_Destroy(Actor* thisx, PlayState* play) {
|
||||
EnAObj* this = (EnAObj*)thisx;
|
||||
|
||||
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
|
||||
|
||||
switch (this->dyna.actor.params) {
|
||||
case A_OBJ_SIGNPOST_OBLONG:
|
||||
case A_OBJ_SIGNPOST_ARROW:
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
Collider_DestroyCylinder(play, &this->collider);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void EnAObj_WaitFinishedTalking(EnAObj* this, GlobalContext* globalCtx) {
|
||||
if (Actor_TextboxIsClosing(&this->dyna.actor, globalCtx)) {
|
||||
void EnAObj_WaitFinishedTalking(EnAObj* this, PlayState* play) {
|
||||
if (Actor_TextboxIsClosing(&this->dyna.actor, play)) {
|
||||
EnAObj_SetupWaitTalk(this, this->dyna.actor.params);
|
||||
}
|
||||
}
|
||||
@@ -205,17 +205,17 @@ void EnAObj_SetupWaitTalk(EnAObj* this, s16 type) {
|
||||
EnAObj_SetupAction(this, EnAObj_WaitTalk);
|
||||
}
|
||||
|
||||
void EnAObj_WaitTalk(EnAObj* this, GlobalContext* globalCtx) {
|
||||
void EnAObj_WaitTalk(EnAObj* this, PlayState* play) {
|
||||
s16 relYawTowardsPlayer;
|
||||
|
||||
if (this->dyna.actor.textId != 0) {
|
||||
relYawTowardsPlayer = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y;
|
||||
if (ABS(relYawTowardsPlayer) < 0x2800 ||
|
||||
(this->dyna.actor.params == A_OBJ_SIGNPOST_ARROW && ABS(relYawTowardsPlayer) > 0x5800)) {
|
||||
if (Actor_ProcessTalkRequest(&this->dyna.actor, globalCtx)) {
|
||||
if (Actor_ProcessTalkRequest(&this->dyna.actor, play)) {
|
||||
EnAObj_SetupAction(this, EnAObj_WaitFinishedTalking);
|
||||
} else {
|
||||
func_8002F2F4(&this->dyna.actor, globalCtx);
|
||||
func_8002F2F4(&this->dyna.actor, play);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -229,7 +229,7 @@ void EnAObj_SetupBlockRot(EnAObj* this, s16 type) {
|
||||
EnAObj_SetupAction(this, EnAObj_BlockRot);
|
||||
}
|
||||
|
||||
void EnAObj_BlockRot(EnAObj* this, GlobalContext* globalCtx) {
|
||||
void EnAObj_BlockRot(EnAObj* this, PlayState* play) {
|
||||
if (this->rotateState == 0) {
|
||||
if (this->dyna.unk_160 != 0) {
|
||||
this->rotateState++;
|
||||
@@ -272,7 +272,7 @@ void EnAObj_SetupBoulderFragment(EnAObj* this, s16 type) {
|
||||
EnAObj_SetupAction(this, EnAObj_BoulderFragment);
|
||||
}
|
||||
|
||||
void EnAObj_BoulderFragment(EnAObj* this, GlobalContext* globalCtx) {
|
||||
void EnAObj_BoulderFragment(EnAObj* this, PlayState* play) {
|
||||
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f);
|
||||
this->dyna.actor.shape.rot.x += this->dyna.actor.world.rot.x >> 1;
|
||||
this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z >> 1;
|
||||
@@ -301,7 +301,7 @@ void EnAObj_SetupBlock(EnAObj* this, s16 type) {
|
||||
EnAObj_SetupAction(this, EnAObj_Block);
|
||||
}
|
||||
|
||||
void EnAObj_Block(EnAObj* this, GlobalContext* globalCtx) {
|
||||
void EnAObj_Block(EnAObj* this, PlayState* play) {
|
||||
this->dyna.actor.speedXZ += this->dyna.unk_150;
|
||||
this->dyna.actor.world.rot.y = this->dyna.unk_158;
|
||||
this->dyna.actor.speedXZ = CLAMP(this->dyna.actor.speedXZ, -2.5f, 2.5f);
|
||||
@@ -316,19 +316,19 @@ void EnAObj_Block(EnAObj* this, GlobalContext* globalCtx) {
|
||||
this->dyna.unk_150 = 0.0f;
|
||||
}
|
||||
|
||||
void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnAObj_Update(Actor* thisx, PlayState* play) {
|
||||
EnAObj* this = (EnAObj*)thisx;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
this->actionFunc(this, play);
|
||||
Actor_MoveForward(&this->dyna.actor);
|
||||
|
||||
if (this->dyna.actor.gravity != 0.0f) {
|
||||
if (this->dyna.actor.params != A_OBJ_BOULDER_FRAGMENT) {
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 40.0f, 0.0f,
|
||||
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 5.0f, 40.0f, 0.0f,
|
||||
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
|
||||
UPDBGCHECKINFO_FLAG_4);
|
||||
} else {
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 20.0f, 0.0f,
|
||||
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 5.0f, 20.0f, 0.0f,
|
||||
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
|
||||
UPDBGCHECKINFO_FLAG_4);
|
||||
}
|
||||
@@ -341,17 +341,17 @@ void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
case A_OBJ_SIGNPOST_OBLONG:
|
||||
case A_OBJ_SIGNPOST_ARROW:
|
||||
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnAObj_Draw(Actor* thisx, PlayState* play) {
|
||||
s32 type = thisx->params;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 701);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_a_keep.c", 701);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
|
||||
if (type >= A_OBJ_MAX) {
|
||||
type = A_OBJ_BOULDER_FRAGMENT;
|
||||
@@ -361,9 +361,9 @@ void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 1, 60, 60, 60, 50);
|
||||
}
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 712),
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_a_keep.c", 712),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDLists[type]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 715);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_a_keep.c", 715);
|
||||
}
|
||||
|
||||
+139
-140
@@ -5,20 +5,20 @@
|
||||
|
||||
#define FLAGS 0
|
||||
|
||||
void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnItem00_Init(Actor* thisx, PlayState* play);
|
||||
void EnItem00_Destroy(Actor* thisx, PlayState* play);
|
||||
void EnItem00_Update(Actor* thisx, PlayState* play);
|
||||
void EnItem00_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx);
|
||||
void func_8001E1C8(EnItem00* this, GlobalContext* globalCtx);
|
||||
void func_8001E304(EnItem00* this, GlobalContext* globalCtx);
|
||||
void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx);
|
||||
void func_8001DFC8(EnItem00* this, PlayState* play);
|
||||
void func_8001E1C8(EnItem00* this, PlayState* play);
|
||||
void func_8001E304(EnItem00* this, PlayState* play);
|
||||
void func_8001E5C8(EnItem00* this, PlayState* play);
|
||||
|
||||
void EnItem00_DrawRupee(EnItem00* this, GlobalContext* globalCtx);
|
||||
void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx);
|
||||
void EnItem00_DrawHeartContainer(EnItem00* this, GlobalContext* globalCtx);
|
||||
void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx);
|
||||
void EnItem00_DrawRupee(EnItem00* this, PlayState* play);
|
||||
void EnItem00_DrawCollectible(EnItem00* this, PlayState* play);
|
||||
void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play);
|
||||
void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play);
|
||||
|
||||
const ActorInit En_Item00_InitVars = {
|
||||
ACTOR_EN_ITEM00,
|
||||
@@ -136,7 +136,7 @@ void EnItem00_SetupAction(EnItem00* this, EnItem00ActionFunc actionFunc) {
|
||||
this->actionFunc = actionFunc;
|
||||
}
|
||||
|
||||
void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnItem00_Init(Actor* thisx, PlayState* play) {
|
||||
EnItem00* this = (EnItem00*)thisx;
|
||||
s32 pad;
|
||||
f32 yOffset = 980.0f;
|
||||
@@ -149,14 +149,14 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
this->actor.params &= 0xFF;
|
||||
|
||||
if (Flags_GetCollectible(globalCtx, this->collectibleFlag)) {
|
||||
if (Flags_GetCollectible(play, this->collectibleFlag)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
Collider_InitCylinder(play, &this->collider);
|
||||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
|
||||
this->unk_158 = 1;
|
||||
|
||||
@@ -236,8 +236,8 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->scale = 0.01f;
|
||||
break;
|
||||
case ITEM00_SHIELD_DEKU:
|
||||
this->actor.objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_SHIELD_1);
|
||||
Actor_SetObjectDependency(globalCtx, &this->actor);
|
||||
this->actor.objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_SHIELD_1);
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
Actor_SetScale(&this->actor, 0.5f);
|
||||
this->scale = 0.5f;
|
||||
yOffset = 0.0f;
|
||||
@@ -245,8 +245,8 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actor.world.rot.x = 0x4000;
|
||||
break;
|
||||
case ITEM00_SHIELD_HYLIAN:
|
||||
this->actor.objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_SHIELD_2);
|
||||
Actor_SetObjectDependency(globalCtx, &this->actor);
|
||||
this->actor.objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_SHIELD_2);
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
Actor_SetScale(&this->actor, 0.5f);
|
||||
this->scale = 0.5f;
|
||||
yOffset = 0.0f;
|
||||
@@ -255,8 +255,8 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
break;
|
||||
case ITEM00_TUNIC_ZORA:
|
||||
case ITEM00_TUNIC_GORON:
|
||||
this->actor.objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_CLOTHES);
|
||||
Actor_SetObjectDependency(globalCtx, &this->actor);
|
||||
this->actor.objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_CLOTHES);
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
Actor_SetScale(&this->actor, 0.5f);
|
||||
this->scale = 0.5f;
|
||||
yOffset = 0.0f;
|
||||
@@ -286,41 +286,41 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
switch (this->actor.params) {
|
||||
case ITEM00_RUPEE_GREEN:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_GREEN);
|
||||
Item_Give(play, ITEM_RUPEE_GREEN);
|
||||
break;
|
||||
case ITEM00_RUPEE_BLUE:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_BLUE);
|
||||
Item_Give(play, ITEM_RUPEE_BLUE);
|
||||
break;
|
||||
case ITEM00_RUPEE_RED:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_RED);
|
||||
Item_Give(play, ITEM_RUPEE_RED);
|
||||
break;
|
||||
case ITEM00_RUPEE_PURPLE:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_PURPLE);
|
||||
Item_Give(play, ITEM_RUPEE_PURPLE);
|
||||
break;
|
||||
case ITEM00_RUPEE_ORANGE:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_GOLD);
|
||||
Item_Give(play, ITEM_RUPEE_GOLD);
|
||||
break;
|
||||
case ITEM00_HEART:
|
||||
Item_Give(globalCtx, ITEM_HEART);
|
||||
Item_Give(play, ITEM_HEART);
|
||||
break;
|
||||
case ITEM00_FLEXIBLE:
|
||||
Health_ChangeBy(globalCtx, 0x70);
|
||||
Health_ChangeBy(play, 0x70);
|
||||
break;
|
||||
case ITEM00_BOMBS_A:
|
||||
case ITEM00_BOMBS_B:
|
||||
Item_Give(globalCtx, ITEM_BOMBS_5);
|
||||
Item_Give(play, ITEM_BOMBS_5);
|
||||
break;
|
||||
case ITEM00_ARROWS_SINGLE:
|
||||
Item_Give(globalCtx, ITEM_BOW);
|
||||
Item_Give(play, ITEM_BOW);
|
||||
break;
|
||||
case ITEM00_ARROWS_SMALL:
|
||||
Item_Give(globalCtx, ITEM_ARROWS_SMALL);
|
||||
Item_Give(play, ITEM_ARROWS_SMALL);
|
||||
break;
|
||||
case ITEM00_ARROWS_MEDIUM:
|
||||
Item_Give(globalCtx, ITEM_ARROWS_MEDIUM);
|
||||
Item_Give(play, ITEM_ARROWS_MEDIUM);
|
||||
break;
|
||||
case ITEM00_ARROWS_LARGE:
|
||||
Item_Give(globalCtx, ITEM_ARROWS_LARGE);
|
||||
Item_Give(play, ITEM_ARROWS_LARGE);
|
||||
break;
|
||||
case ITEM00_MAGIC_LARGE:
|
||||
getItemId = GI_MAGIC_SMALL;
|
||||
@@ -329,7 +329,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
getItemId = GI_MAGIC_LARGE;
|
||||
break;
|
||||
case ITEM00_SMALL_KEY:
|
||||
Item_Give(globalCtx, ITEM_KEY_SMALL);
|
||||
Item_Give(play, ITEM_KEY_SMALL);
|
||||
break;
|
||||
case ITEM00_SEEDS:
|
||||
getItemId = GI_SEEDS_5;
|
||||
@@ -350,21 +350,21 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
|
||||
func_8002F554(&this->actor, globalCtx, getItemId);
|
||||
if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, play)) {
|
||||
func_8002F554(&this->actor, play, getItemId);
|
||||
}
|
||||
|
||||
EnItem00_SetupAction(this, func_8001E5C8);
|
||||
this->actionFunc(this, globalCtx);
|
||||
this->actionFunc(this, play);
|
||||
}
|
||||
|
||||
void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnItem00_Destroy(Actor* thisx, PlayState* play) {
|
||||
EnItem00* this = (EnItem00*)thisx;
|
||||
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
Collider_DestroyCylinder(play, &this->collider);
|
||||
}
|
||||
|
||||
void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) {
|
||||
void func_8001DFC8(EnItem00* this, PlayState* play) {
|
||||
if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->unk_15A < 0)) ||
|
||||
(this->actor.params == ITEM00_HEART_PIECE)) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
@@ -410,7 +410,7 @@ void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001E1C8(EnItem00* this, GlobalContext* globalCtx) {
|
||||
void func_8001E1C8(EnItem00* this, PlayState* play) {
|
||||
f32 originalVelocity;
|
||||
Vec3f effectPos;
|
||||
|
||||
@@ -418,11 +418,11 @@ void func_8001E1C8(EnItem00* this, GlobalContext* globalCtx) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
}
|
||||
|
||||
if (globalCtx->gameplayFrames & 1) {
|
||||
if (play->gameplayFrames & 1) {
|
||||
effectPos.x = this->actor.world.pos.x + Rand_CenteredFloat(10.0f);
|
||||
effectPos.y = this->actor.world.pos.y + Rand_CenteredFloat(10.0f);
|
||||
effectPos.z = this->actor.world.pos.z + Rand_CenteredFloat(10.0f);
|
||||
EffectSsKiraKira_SpawnSmall(globalCtx, &effectPos, &sEffectVelocity, &sEffectAccel, &sEffectPrimColor,
|
||||
EffectSsKiraKira_SpawnSmall(play, &effectPos, &sEffectVelocity, &sEffectAccel, &sEffectPrimColor,
|
||||
&sEffectEnvColor);
|
||||
}
|
||||
|
||||
@@ -438,7 +438,7 @@ void func_8001E1C8(EnItem00* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001E304(EnItem00* this, GlobalContext* globalCtx) {
|
||||
void func_8001E304(EnItem00* this, PlayState* play) {
|
||||
s32 pad;
|
||||
Vec3f pos;
|
||||
s32 rotOffset;
|
||||
@@ -477,12 +477,11 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!(globalCtx->gameplayFrames & 1)) {
|
||||
if (!(play->gameplayFrames & 1)) {
|
||||
pos.x = this->actor.world.pos.x + (Rand_ZeroOne() - 0.5f) * 10.0f;
|
||||
pos.y = this->actor.world.pos.y + (Rand_ZeroOne() - 0.5f) * 10.0f;
|
||||
pos.z = this->actor.world.pos.z + (Rand_ZeroOne() - 0.5f) * 10.0f;
|
||||
EffectSsKiraKira_SpawnSmall(globalCtx, &pos, &sEffectVelocity, &sEffectAccel, &sEffectPrimColor,
|
||||
&sEffectEnvColor);
|
||||
EffectSsKiraKira_SpawnSmall(play, &pos, &sEffectVelocity, &sEffectAccel, &sEffectPrimColor, &sEffectEnvColor);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) {
|
||||
@@ -493,12 +492,12 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
void func_8001E5C8(EnItem00* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (this->getItemId != GI_NONE) {
|
||||
if (!Actor_HasParent(&this->actor, globalCtx)) {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 50.0f, 80.0f);
|
||||
if (!Actor_HasParent(&this->actor, play)) {
|
||||
func_8002F434(&this->actor, play, this->getItemId, 50.0f, 80.0f);
|
||||
this->unk_15A++;
|
||||
} else {
|
||||
this->getItemId = GI_NONE;
|
||||
@@ -526,7 +525,7 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
// The BSS in the function acted weird in the past. It is matching now but might cause issues in the future
|
||||
void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnItem00_Update(Actor* thisx, PlayState* play) {
|
||||
static u32 D_80157D90;
|
||||
static s16 D_80157D94[1];
|
||||
s16* params;
|
||||
@@ -546,7 +545,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->unk_156 = this->unk_15A;
|
||||
}
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
this->actionFunc(this, play);
|
||||
Math_SmoothStepToF(&this->actor.scale.x, this->scale, 0.1f, this->scale * 0.1f, 0.0f);
|
||||
temp = &D_80157D90;
|
||||
|
||||
@@ -555,12 +554,12 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
if (this->actor.gravity) {
|
||||
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) {
|
||||
if (*temp != globalCtx->gameplayFrames) {
|
||||
D_80157D90 = globalCtx->gameplayFrames;
|
||||
if (*temp != play->gameplayFrames) {
|
||||
D_80157D90 = play->gameplayFrames;
|
||||
D_80157D94[0] = 0;
|
||||
for (i = 0; i < 50; i++) {
|
||||
if (globalCtx->colCtx.dyna.bgActorFlags[i] & 1) {
|
||||
dynaActor = globalCtx->colCtx.dyna.bgActors[i].actor;
|
||||
if (play->colCtx.dyna.bgActorFlags[i] & 1) {
|
||||
dynaActor = play->colCtx.dyna.bgActors[i].actor;
|
||||
if ((dynaActor != NULL) && (dynaActor->update != NULL)) {
|
||||
if ((dynaActor->world.pos.x != dynaActor->prevPos.x) ||
|
||||
(dynaActor->world.pos.y != dynaActor->prevPos.y) ||
|
||||
@@ -579,7 +578,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if (sp3A || D_80157D94[0]) {
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 15.0f, 15.0f,
|
||||
Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 15.0f, 15.0f,
|
||||
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
|
||||
UPDBGCHECKINFO_FLAG_4);
|
||||
|
||||
@@ -591,7 +590,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
|
||||
|
||||
if ((this->actor.params == ITEM00_SHIELD_DEKU) || (this->actor.params == ITEM00_SHIELD_HYLIAN) ||
|
||||
(this->actor.params == ITEM00_TUNIC_ZORA) || (this->actor.params == ITEM00_TUNIC_GORON)) {
|
||||
@@ -605,30 +604,30 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
if (!((this->actor.xzDistToPlayer <= 30.0f) && (this->actor.yDistToPlayer >= -50.0f) &&
|
||||
(this->actor.yDistToPlayer <= 50.0f))) {
|
||||
if (!Actor_HasParent(&this->actor, globalCtx)) {
|
||||
if (!Actor_HasParent(&this->actor, play)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (globalCtx->gameOverCtx.state != GAMEOVER_INACTIVE) {
|
||||
if (play->gameOverCtx.state != GAMEOVER_INACTIVE) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (this->actor.params) {
|
||||
case ITEM00_RUPEE_GREEN:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_GREEN);
|
||||
Item_Give(play, ITEM_RUPEE_GREEN);
|
||||
break;
|
||||
case ITEM00_RUPEE_BLUE:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_BLUE);
|
||||
Item_Give(play, ITEM_RUPEE_BLUE);
|
||||
break;
|
||||
case ITEM00_RUPEE_RED:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_RED);
|
||||
Item_Give(play, ITEM_RUPEE_RED);
|
||||
break;
|
||||
case ITEM00_RUPEE_PURPLE:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_PURPLE);
|
||||
Item_Give(play, ITEM_RUPEE_PURPLE);
|
||||
break;
|
||||
case ITEM00_RUPEE_ORANGE:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_GOLD);
|
||||
Item_Give(play, ITEM_RUPEE_GOLD);
|
||||
break;
|
||||
case ITEM00_STICK:
|
||||
getItemId = GI_STICKS_1;
|
||||
@@ -637,26 +636,26 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
getItemId = GI_NUTS_5;
|
||||
break;
|
||||
case ITEM00_HEART:
|
||||
Item_Give(globalCtx, ITEM_HEART);
|
||||
Item_Give(play, ITEM_HEART);
|
||||
break;
|
||||
case ITEM00_FLEXIBLE:
|
||||
Health_ChangeBy(globalCtx, 0x70);
|
||||
Health_ChangeBy(play, 0x70);
|
||||
break;
|
||||
case ITEM00_BOMBS_A:
|
||||
case ITEM00_BOMBS_B:
|
||||
Item_Give(globalCtx, ITEM_BOMBS_5);
|
||||
Item_Give(play, ITEM_BOMBS_5);
|
||||
break;
|
||||
case ITEM00_ARROWS_SINGLE:
|
||||
Item_Give(globalCtx, ITEM_BOW);
|
||||
Item_Give(play, ITEM_BOW);
|
||||
break;
|
||||
case ITEM00_ARROWS_SMALL:
|
||||
Item_Give(globalCtx, ITEM_ARROWS_SMALL);
|
||||
Item_Give(play, ITEM_ARROWS_SMALL);
|
||||
break;
|
||||
case ITEM00_ARROWS_MEDIUM:
|
||||
Item_Give(globalCtx, ITEM_ARROWS_MEDIUM);
|
||||
Item_Give(play, ITEM_ARROWS_MEDIUM);
|
||||
break;
|
||||
case ITEM00_ARROWS_LARGE:
|
||||
Item_Give(globalCtx, ITEM_ARROWS_LARGE);
|
||||
Item_Give(play, ITEM_ARROWS_LARGE);
|
||||
break;
|
||||
case ITEM00_SEEDS:
|
||||
getItemId = GI_SEEDS_5;
|
||||
@@ -694,8 +693,8 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
params = &this->actor.params;
|
||||
|
||||
if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
|
||||
func_8002F554(&this->actor, globalCtx, getItemId);
|
||||
if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, play)) {
|
||||
func_8002F554(&this->actor, play, getItemId);
|
||||
}
|
||||
|
||||
switch (*params) {
|
||||
@@ -706,8 +705,8 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
case ITEM00_SHIELD_HYLIAN:
|
||||
case ITEM00_TUNIC_ZORA:
|
||||
case ITEM00_TUNIC_GORON:
|
||||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
Flags_SetCollectible(globalCtx, this->collectibleFlag);
|
||||
if (Actor_HasParent(&this->actor, play)) {
|
||||
Flags_SetCollectible(play, this->collectibleFlag);
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
return;
|
||||
@@ -717,8 +716,8 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
} else if (getItemId != GI_NONE) {
|
||||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
Flags_SetCollectible(globalCtx, this->collectibleFlag);
|
||||
if (Actor_HasParent(&this->actor, play)) {
|
||||
Flags_SetCollectible(play, this->collectibleFlag);
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
return;
|
||||
@@ -727,7 +726,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
|
||||
Flags_SetCollectible(globalCtx, this->collectibleFlag);
|
||||
Flags_SetCollectible(play, this->collectibleFlag);
|
||||
|
||||
this->unk_15A = 15;
|
||||
this->unk_154 = 35;
|
||||
@@ -742,7 +741,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnItem00_SetupAction(this, func_8001E5C8);
|
||||
}
|
||||
|
||||
void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnItem00_Draw(Actor* thisx, PlayState* play) {
|
||||
EnItem00* this = (EnItem00*)thisx;
|
||||
f32 mtxScale;
|
||||
|
||||
@@ -753,28 +752,28 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
case ITEM00_RUPEE_RED:
|
||||
case ITEM00_RUPEE_ORANGE:
|
||||
case ITEM00_RUPEE_PURPLE:
|
||||
EnItem00_DrawRupee(this, globalCtx);
|
||||
EnItem00_DrawRupee(this, play);
|
||||
break;
|
||||
case ITEM00_HEART_PIECE:
|
||||
EnItem00_DrawHeartPiece(this, globalCtx);
|
||||
EnItem00_DrawHeartPiece(this, play);
|
||||
break;
|
||||
case ITEM00_HEART_CONTAINER:
|
||||
EnItem00_DrawHeartContainer(this, globalCtx);
|
||||
EnItem00_DrawHeartContainer(this, play);
|
||||
break;
|
||||
case ITEM00_HEART:
|
||||
if (this->unk_15A < 0) {
|
||||
if (this->unk_15A == -1) {
|
||||
s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART);
|
||||
s8 bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_HEART);
|
||||
|
||||
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, bankIndex)) {
|
||||
this->actor.objBankIndex = bankIndex;
|
||||
Actor_SetObjectDependency(globalCtx, &this->actor);
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
this->unk_15A = -2;
|
||||
}
|
||||
} else {
|
||||
mtxScale = 16.0f;
|
||||
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||
GetItem_Draw(globalCtx, GID_HEART);
|
||||
GetItem_Draw(play, GID_HEART);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -791,19 +790,19 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
case ITEM00_MAGIC_SMALL:
|
||||
case ITEM00_SEEDS:
|
||||
case ITEM00_SMALL_KEY:
|
||||
EnItem00_DrawCollectible(this, globalCtx);
|
||||
EnItem00_DrawCollectible(this, play);
|
||||
break;
|
||||
case ITEM00_SHIELD_DEKU:
|
||||
GetItem_Draw(globalCtx, GID_SHIELD_DEKU);
|
||||
GetItem_Draw(play, GID_SHIELD_DEKU);
|
||||
break;
|
||||
case ITEM00_SHIELD_HYLIAN:
|
||||
GetItem_Draw(globalCtx, GID_SHIELD_HYLIAN);
|
||||
GetItem_Draw(play, GID_SHIELD_HYLIAN);
|
||||
break;
|
||||
case ITEM00_TUNIC_ZORA:
|
||||
GetItem_Draw(globalCtx, GID_TUNIC_ZORA);
|
||||
GetItem_Draw(play, GID_TUNIC_ZORA);
|
||||
break;
|
||||
case ITEM00_TUNIC_GORON:
|
||||
GetItem_Draw(globalCtx, GID_TUNIC_GORON);
|
||||
GetItem_Draw(play, GID_TUNIC_GORON);
|
||||
break;
|
||||
case ITEM00_FLEXIBLE:
|
||||
break;
|
||||
@@ -814,14 +813,14 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
/**
|
||||
* Draw Function used for Rupee types of En_Item00.
|
||||
*/
|
||||
void EnItem00_DrawRupee(EnItem00* this, GlobalContext* globalCtx) {
|
||||
void EnItem00_DrawRupee(EnItem00* this, PlayState* play) {
|
||||
s32 pad;
|
||||
s32 texIndex;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1546);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1546);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_8002EBCC(&this->actor, globalCtx, 0);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
func_8002EBCC(&this->actor, play, 0);
|
||||
|
||||
if (this->actor.params <= ITEM00_RUPEE_RED) {
|
||||
texIndex = this->actor.params;
|
||||
@@ -829,25 +828,25 @@ void EnItem00_DrawRupee(EnItem00* this, GlobalContext* globalCtx) {
|
||||
texIndex = this->actor.params - 0x10;
|
||||
}
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1562),
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1562),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sRupeeTex[texIndex]));
|
||||
|
||||
gSPDisplayList(POLY_OPA_DISP++, gRupeeDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1568);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1568);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...).
|
||||
*/
|
||||
void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
|
||||
void EnItem00_DrawCollectible(EnItem00* this, PlayState* play) {
|
||||
s32 texIndex = this->actor.params - 3;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1594);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1594);
|
||||
|
||||
POLY_OPA_DISP = Play_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
|
||||
if (this->actor.params == ITEM00_BOMBS_SPECIAL) {
|
||||
texIndex = 1;
|
||||
@@ -859,51 +858,51 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sItemDropTex[texIndex]));
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1607),
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1607),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gItemDropDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1611);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1611);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw Function used for the Heart Container type of En_Item00.
|
||||
*/
|
||||
void EnItem00_DrawHeartContainer(EnItem00* this, GlobalContext* globalCtx) {
|
||||
void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1623);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1623);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_8002EBCC(&this->actor, globalCtx, 0);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1634),
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
func_8002EBCC(&this->actor, play, 0);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1634),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gHeartPieceExteriorDL);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_8002ED80(&this->actor, globalCtx, 0);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1644),
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
func_8002ED80(&this->actor, play, 0);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1644),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gHeartContainerInteriorDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1647);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1647);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw Function used for the Piece of Heart type of En_Item00.
|
||||
*/
|
||||
void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
|
||||
void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1658);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1658);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_8002ED80(&this->actor, globalCtx, 0);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1670),
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
func_8002ED80(&this->actor, play, 0);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1670),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gHeartPieceInteriorDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1673);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1673);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -942,7 +941,7 @@ s16 func_8001F404(s16 dropId) {
|
||||
|
||||
// External functions used by other actors to drop collectibles, which usually results in spawning an En_Item00 actor.
|
||||
|
||||
EnItem00* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) {
|
||||
EnItem00* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, s16 params) {
|
||||
s32 pad[2];
|
||||
EnItem00* spawnedActor = NULL;
|
||||
s16 param4000 = params & 0x4000;
|
||||
@@ -953,18 +952,18 @@ EnItem00* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 pa
|
||||
|
||||
if (((params & 0x00FF) == ITEM00_FLEXIBLE) && !param4000) {
|
||||
// TODO: Prevent the cast to EnItem00 here since this is a different actor (En_Elf)
|
||||
spawnedActor = (EnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x,
|
||||
spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0, FAIRY_HEAL_TIMED);
|
||||
EffectSsDeadSound_SpawnStationary(globalCtx, spawnPos, NA_SE_EV_BUTTERFRY_TO_FAIRY, true,
|
||||
DEADSOUND_REPEAT_MODE_OFF, 40);
|
||||
spawnedActor = (EnItem00*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f,
|
||||
spawnPos->z, 0, 0, 0, FAIRY_HEAL_TIMED);
|
||||
EffectSsDeadSound_SpawnStationary(play, spawnPos, NA_SE_EV_BUTTERFRY_TO_FAIRY, true, DEADSOUND_REPEAT_MODE_OFF,
|
||||
40);
|
||||
} else {
|
||||
if (!param8000) {
|
||||
params = func_8001F404(params & 0x00FF);
|
||||
}
|
||||
|
||||
if (params != -1) {
|
||||
spawnedActor = (EnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x,
|
||||
spawnPos->y, spawnPos->z, 0, 0, 0, params | param8000 | param3F00);
|
||||
spawnedActor = (EnItem00*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, spawnPos->x, spawnPos->y,
|
||||
spawnPos->z, 0, 0, 0, params | param8000 | param3F00);
|
||||
if ((spawnedActor != NULL) && !param8000) {
|
||||
spawnedActor->actor.velocity.y = !param4000 ? 8.0f : -2.0f;
|
||||
spawnedActor->actor.speedXZ = 2.0f;
|
||||
@@ -985,7 +984,7 @@ EnItem00* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 pa
|
||||
return spawnedActor;
|
||||
}
|
||||
|
||||
EnItem00* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) {
|
||||
EnItem00* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s16 params) {
|
||||
EnItem00* spawnedActor = NULL;
|
||||
s32 pad;
|
||||
s16 param4000 = params & 0x4000;
|
||||
@@ -996,15 +995,15 @@ EnItem00* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 p
|
||||
|
||||
if (((params & 0x00FF) == ITEM00_FLEXIBLE) && !param4000) {
|
||||
// TODO: Prevent the cast to EnItem00 here since this is a different actor (En_Elf)
|
||||
spawnedActor = (EnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x,
|
||||
spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0, FAIRY_HEAL_TIMED);
|
||||
EffectSsDeadSound_SpawnStationary(globalCtx, spawnPos, NA_SE_EV_BUTTERFRY_TO_FAIRY, true,
|
||||
DEADSOUND_REPEAT_MODE_OFF, 40);
|
||||
spawnedActor = (EnItem00*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f,
|
||||
spawnPos->z, 0, 0, 0, FAIRY_HEAL_TIMED);
|
||||
EffectSsDeadSound_SpawnStationary(play, spawnPos, NA_SE_EV_BUTTERFRY_TO_FAIRY, true, DEADSOUND_REPEAT_MODE_OFF,
|
||||
40);
|
||||
} else {
|
||||
params = func_8001F404(params & 0x00FF);
|
||||
if (params != -1) {
|
||||
spawnedActor = (EnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x,
|
||||
spawnPos->y, spawnPos->z, 0, 0, 0, params | param8000 | param3F00);
|
||||
spawnedActor = (EnItem00*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, spawnPos->x, spawnPos->y,
|
||||
spawnPos->z, 0, 0, 0, params | param8000 | param3F00);
|
||||
if ((spawnedActor != NULL) && !param8000) {
|
||||
spawnedActor->actor.velocity.y = 0.0f;
|
||||
spawnedActor->actor.speedXZ = 0.0f;
|
||||
@@ -1018,7 +1017,7 @@ EnItem00* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 p
|
||||
return spawnedActor;
|
||||
}
|
||||
|
||||
void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3f* spawnPos, s16 params) {
|
||||
void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnPos, s16 params) {
|
||||
s32 pad;
|
||||
EnItem00* spawnedActor;
|
||||
s16 dropQuantity;
|
||||
@@ -1065,9 +1064,9 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
|
||||
|
||||
if (dropId == ITEM00_FLEXIBLE) {
|
||||
if (gSaveContext.health <= 0x10) { // 1 heart or less
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, 0,
|
||||
0, 0, FAIRY_HEAL_TIMED);
|
||||
EffectSsDeadSound_SpawnStationary(globalCtx, spawnPos, NA_SE_EV_BUTTERFRY_TO_FAIRY, true,
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0,
|
||||
FAIRY_HEAL_TIMED);
|
||||
EffectSsDeadSound_SpawnStationary(play, spawnPos, NA_SE_EV_BUTTERFRY_TO_FAIRY, true,
|
||||
DEADSOUND_REPEAT_MODE_OFF, 40);
|
||||
return;
|
||||
} else if (gSaveContext.health <= 0x30) { // 3 hearts or less
|
||||
@@ -1113,7 +1112,7 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
|
||||
if (!param8000) {
|
||||
dropId = func_8001F404(dropId);
|
||||
if (dropId != ITEM00_NONE) {
|
||||
spawnedActor = (EnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x,
|
||||
spawnedActor = (EnItem00*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, spawnPos->x,
|
||||
spawnPos->y, spawnPos->z, 0, 0, 0, dropId);
|
||||
if ((spawnedActor != NULL) && (dropId != ITEM00_NONE)) {
|
||||
spawnedActor->actor.velocity.y = 8.0f;
|
||||
@@ -1132,7 +1131,7 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Item_DropCollectible(globalCtx, spawnPos, params | 0x8000);
|
||||
Item_DropCollectible(play, spawnPos, params | 0x8000);
|
||||
}
|
||||
dropQuantity--;
|
||||
}
|
||||
|
||||
@@ -63,8 +63,8 @@ u16 sReactionTextIds[][PLAYER_MASK_MAX] = {
|
||||
{ 0x0000, 0x7104, 0x7105, 0x7107, 0x7105, 0x710C, 0x7105, 0x7107, 0x7107 },
|
||||
};
|
||||
|
||||
u16 Text_GetFaceReaction(GlobalContext* globalCtx, u32 reactionSet) {
|
||||
u8 currentMask = Player_GetMask(globalCtx);
|
||||
u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet) {
|
||||
u8 currentMask = Player_GetMask(play);
|
||||
|
||||
return sReactionTextIds[reactionSet][currentMask];
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ void SkelCurve_Clear(SkelCurve* skelCurve) {
|
||||
*
|
||||
* @return bool always true
|
||||
*/
|
||||
s32 SkelCurve_Init(GlobalContext* globalCtx, SkelCurve* skelCurve, CurveSkeletonHeader* skeletonHeaderSeg,
|
||||
s32 SkelCurve_Init(PlayState* play, SkelCurve* skelCurve, CurveSkeletonHeader* skeletonHeaderSeg,
|
||||
CurveAnimationHeader* animation) {
|
||||
SkelCurveLimb** limbs;
|
||||
CurveSkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg);
|
||||
@@ -62,7 +62,7 @@ s32 SkelCurve_Init(GlobalContext* globalCtx, SkelCurve* skelCurve, CurveSkeleton
|
||||
/**
|
||||
* Frees the joint table.
|
||||
*/
|
||||
void SkelCurve_Destroy(GlobalContext* globalCtx, SkelCurve* skelCurve) {
|
||||
void SkelCurve_Destroy(PlayState* play, SkelCurve* skelCurve) {
|
||||
if (skelCurve->jointTable != NULL) {
|
||||
ZeldaArena_FreeDebug(skelCurve->jointTable, "../z_fcurve_data_skelanime.c", 146);
|
||||
}
|
||||
@@ -92,7 +92,7 @@ typedef enum {
|
||||
*
|
||||
* @return bool true when the animation has finished.
|
||||
*/
|
||||
s32 SkelCurve_Update(GlobalContext* globalCtx, SkelCurve* skelCurve) {
|
||||
s32 SkelCurve_Update(PlayState* play, SkelCurve* skelCurve) {
|
||||
s16* jointData;
|
||||
u8* knotCounts;
|
||||
CurveAnimationHeader* animation;
|
||||
@@ -156,16 +156,16 @@ s32 SkelCurve_Update(GlobalContext* globalCtx, SkelCurve* skelCurve) {
|
||||
/**
|
||||
* Recursively draws limbs with appropriate properties.
|
||||
*/
|
||||
void SkelCurve_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, SkelCurve* skelCurve,
|
||||
OverrideCurveLimbDraw overrideLimbDraw, PostCurveLimbDraw postLimbDraw, s32 lod, void* data) {
|
||||
void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelCurve* skelCurve, OverrideCurveLimbDraw overrideLimbDraw,
|
||||
PostCurveLimbDraw postLimbDraw, s32 lod, void* data) {
|
||||
SkelCurveLimb* limb = SEGMENTED_TO_VIRTUAL(skelCurve->skeleton[limbIndex]);
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_fcurve_data_skelanime.c", 279);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 279);
|
||||
|
||||
Matrix_Push();
|
||||
|
||||
if ((overrideLimbDraw == NULL) ||
|
||||
((overrideLimbDraw != NULL) && overrideLimbDraw(globalCtx, skelCurve, limbIndex, data))) {
|
||||
((overrideLimbDraw != NULL) && overrideLimbDraw(play, skelCurve, limbIndex, data))) {
|
||||
Vec3f scale;
|
||||
Vec3s rot;
|
||||
Vec3f pos;
|
||||
@@ -192,7 +192,7 @@ void SkelCurve_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, SkelCurve* skel
|
||||
|
||||
dList = limb->dList[0];
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_fcurve_data_skelanime.c", 321),
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 321),
|
||||
G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, dList);
|
||||
}
|
||||
@@ -201,13 +201,13 @@ void SkelCurve_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, SkelCurve* skel
|
||||
|
||||
dList = limb->dList[0];
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_fcurve_data_skelanime.c", 332),
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 332),
|
||||
G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, dList);
|
||||
}
|
||||
dList = limb->dList[1];
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_fcurve_data_skelanime.c", 338),
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 338),
|
||||
G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, dList);
|
||||
}
|
||||
@@ -218,25 +218,25 @@ void SkelCurve_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, SkelCurve* skel
|
||||
}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, skelCurve, limbIndex, data);
|
||||
postLimbDraw(play, skelCurve, limbIndex, data);
|
||||
}
|
||||
|
||||
if (limb->child != LIMB_DONE) {
|
||||
SkelCurve_DrawLimb(globalCtx, limb->child, skelCurve, overrideLimbDraw, postLimbDraw, lod, data);
|
||||
SkelCurve_DrawLimb(play, limb->child, skelCurve, overrideLimbDraw, postLimbDraw, lod, data);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
SkelCurve_DrawLimb(globalCtx, limb->sibling, skelCurve, overrideLimbDraw, postLimbDraw, lod, data);
|
||||
SkelCurve_DrawLimb(play, limb->sibling, skelCurve, overrideLimbDraw, postLimbDraw, lod, data);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_fcurve_data_skelanime.c", 371);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 371);
|
||||
}
|
||||
|
||||
void SkelCurve_Draw(Actor* actor, GlobalContext* globalCtx, SkelCurve* skelCurve,
|
||||
OverrideCurveLimbDraw overrideLimbDraw, PostCurveLimbDraw postLimbDraw, s32 lod, void* data) {
|
||||
void SkelCurve_Draw(Actor* actor, PlayState* play, SkelCurve* skelCurve, OverrideCurveLimbDraw overrideLimbDraw,
|
||||
PostCurveLimbDraw postLimbDraw, s32 lod, void* data) {
|
||||
if (skelCurve->jointTable != NULL) {
|
||||
SkelCurve_DrawLimb(globalCtx, 0, skelCurve, overrideLimbDraw, postLimbDraw, lod, data);
|
||||
SkelCurve_DrawLimb(play, 0, skelCurve, overrideLimbDraw, postLimbDraw, lod, data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ GameStateOverlay gGameStateOverlayTable[] = {
|
||||
GAMESTATE_OVERLAY_INTERNAL(TitleSetup_Init, TitleSetup_Destroy, sizeof(GameState)),
|
||||
GAMESTATE_OVERLAY(select, Select_Init, Select_Destroy, sizeof(SelectContext)),
|
||||
GAMESTATE_OVERLAY(title, Title_Init, Title_Destroy, sizeof(TitleContext)),
|
||||
GAMESTATE_OVERLAY_INTERNAL(Play_Init, Play_Destroy, sizeof(GlobalContext)),
|
||||
GAMESTATE_OVERLAY_INTERNAL(Play_Init, Play_Destroy, sizeof(PlayState)),
|
||||
GAMESTATE_OVERLAY(opening, Opening_Init, Opening_Destroy, sizeof(OpeningContext)),
|
||||
GAMESTATE_OVERLAY(file_choose, FileChoose_Init, FileChoose_Destroy, sizeof(FileChooseContext)),
|
||||
};
|
||||
|
||||
+13
-13
@@ -1,23 +1,23 @@
|
||||
#include "global.h"
|
||||
|
||||
void GameOver_Init(GlobalContext* globalCtx) {
|
||||
globalCtx->gameOverCtx.state = GAMEOVER_INACTIVE;
|
||||
void GameOver_Init(PlayState* play) {
|
||||
play->gameOverCtx.state = GAMEOVER_INACTIVE;
|
||||
}
|
||||
|
||||
void GameOver_FadeInLights(GlobalContext* globalCtx) {
|
||||
GameOverContext* gameOverCtx = &globalCtx->gameOverCtx;
|
||||
void GameOver_FadeInLights(PlayState* play) {
|
||||
GameOverContext* gameOverCtx = &play->gameOverCtx;
|
||||
|
||||
if ((gameOverCtx->state >= GAMEOVER_DEATH_WAIT_GROUND && gameOverCtx->state < GAMEOVER_REVIVE_START) ||
|
||||
(gameOverCtx->state >= GAMEOVER_REVIVE_RUMBLE && gameOverCtx->state < GAMEOVER_REVIVE_FADE_OUT)) {
|
||||
Environment_FadeInGameOverLights(globalCtx);
|
||||
Environment_FadeInGameOverLights(play);
|
||||
}
|
||||
}
|
||||
|
||||
// This variable cannot be moved into this file as all of z_message_PAL rodata is in the way
|
||||
extern s16 gGameOverTimer;
|
||||
|
||||
void GameOver_Update(GlobalContext* globalCtx) {
|
||||
GameOverContext* gameOverCtx = &globalCtx->gameOverCtx;
|
||||
void GameOver_Update(PlayState* play) {
|
||||
GameOverContext* gameOverCtx = &play->gameOverCtx;
|
||||
s16 i;
|
||||
s16 j;
|
||||
s32 v90;
|
||||
@@ -26,7 +26,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
|
||||
|
||||
switch (gameOverCtx->state) {
|
||||
case GAMEOVER_DEATH_START:
|
||||
Message_CloseTextbox(globalCtx);
|
||||
Message_CloseTextbox(play);
|
||||
|
||||
gSaveContext.timer1State = 0;
|
||||
gSaveContext.timer2State = 0;
|
||||
@@ -41,7 +41,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
|
||||
for (j = 1; j < ARRAY_COUNT(gSaveContext.equips.buttonItems); j++) {
|
||||
if (gSaveContext.equips.buttonItems[j] == gSpoilingItems[i]) {
|
||||
gSaveContext.equips.buttonItems[j] = gSpoilingItemReverts[i];
|
||||
Interface_LoadItemIcon1(globalCtx, j);
|
||||
Interface_LoadItemIcon1(play, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
|
||||
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
|
||||
gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = 0;
|
||||
|
||||
Environment_InitGameOverLights(globalCtx);
|
||||
Environment_InitGameOverLights(play);
|
||||
gGameOverTimer = 20;
|
||||
if (1) {}
|
||||
v90 = VREG(90);
|
||||
@@ -92,7 +92,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
|
||||
gGameOverTimer--;
|
||||
|
||||
if (gGameOverTimer == 0) {
|
||||
globalCtx->pauseCtx.state = 8;
|
||||
play->pauseCtx.state = 8;
|
||||
gameOverCtx->state++;
|
||||
func_800AA15C();
|
||||
}
|
||||
@@ -101,7 +101,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
|
||||
case GAMEOVER_REVIVE_START:
|
||||
gameOverCtx->state++;
|
||||
gGameOverTimer = 0;
|
||||
Environment_InitGameOverLights(globalCtx);
|
||||
Environment_InitGameOverLights(play);
|
||||
ShrinkWindow_SetVal(0x20);
|
||||
return;
|
||||
|
||||
@@ -137,7 +137,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
|
||||
break;
|
||||
|
||||
case GAMEOVER_REVIVE_FADE_OUT:
|
||||
Environment_FadeOutGameOverLights(globalCtx);
|
||||
Environment_FadeOutGameOverLights(play);
|
||||
gGameOverTimer--;
|
||||
|
||||
if (gGameOverTimer == 0) {
|
||||
|
||||
+57
-60
@@ -15,7 +15,7 @@ s32 func_8006CFC0(s32 scene) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void func_8006D074(GlobalContext* globalCtx) {
|
||||
void func_8006D074(PlayState* play) {
|
||||
gSaveContext.horseData.scene = SCENE_SPOT00;
|
||||
gSaveContext.horseData.pos.x = -1840;
|
||||
gSaveContext.horseData.pos.y = 72;
|
||||
@@ -23,7 +23,7 @@ void func_8006D074(GlobalContext* globalCtx) {
|
||||
gSaveContext.horseData.angle = -27353;
|
||||
}
|
||||
|
||||
void func_8006D0AC(GlobalContext* globalCtx) {
|
||||
void func_8006D0AC(PlayState* play) {
|
||||
if (gSaveContext.horseData.scene == SCENE_SPOT06) {
|
||||
gSaveContext.horseData.scene = SCENE_SPOT06;
|
||||
gSaveContext.horseData.pos.x = -2065;
|
||||
@@ -40,7 +40,7 @@ typedef struct {
|
||||
/* 0x0A */ s16 type;
|
||||
} HorseSpawn;
|
||||
|
||||
void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
|
||||
void func_8006D0EC(PlayState* play, Player* player) {
|
||||
s32 i;
|
||||
HorseSpawn horseSpawns[] = {
|
||||
{ SCENE_SPOT00, -460, 100, 6640, 0, 2 }, { SCENE_SPOT06, -1929, -1025, 768, 0, 2 },
|
||||
@@ -49,41 +49,40 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
|
||||
};
|
||||
|
||||
if ((AREG(6) != 0) && (Flags_GetEventChkInf(EVENTCHKINF_18) || (DREG(1) != 0))) {
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.world.pos.x,
|
||||
player->rideActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, player->actor.world.pos.x,
|
||||
player->actor.world.pos.y, player->actor.world.pos.z, player->actor.shape.rot.x,
|
||||
player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
|
||||
|
||||
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", "../z_horse.c", 343);
|
||||
|
||||
Actor_MountHorse(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
gSaveContext.horseData.scene = globalCtx->sceneNum;
|
||||
Actor_MountHorse(play, player, player->rideActor);
|
||||
func_8002DE74(play, player);
|
||||
gSaveContext.horseData.scene = play->sceneNum;
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
if (play->sceneNum == SCENE_SPOT12) {
|
||||
player->rideActor->room = -1;
|
||||
}
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigameState == 3)) {
|
||||
} else if ((play->sceneNum == SCENE_SPOT12) && (gSaveContext.minigameState == 3)) {
|
||||
Actor* horseActor;
|
||||
gSaveContext.minigameState = 0;
|
||||
horseActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1);
|
||||
horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1);
|
||||
horseActor->room = -1;
|
||||
} else if ((gSaveContext.entranceIndex == ENTR_SPOT20_7) && GET_EVENTCHKINF(EVENTCHKINF_18)) {
|
||||
Actor* horseActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1);
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1);
|
||||
ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 389);
|
||||
} else if ((globalCtx->sceneNum == gSaveContext.horseData.scene) &&
|
||||
} else if ((play->sceneNum == gSaveContext.horseData.scene) &&
|
||||
(Flags_GetEventChkInf(EVENTCHKINF_18) || DREG(1) != 0)) {
|
||||
// "Set by existence of horse %d %d %d"
|
||||
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene,
|
||||
Flags_GetEventChkInf(EVENTCHKINF_18), DREG(1));
|
||||
|
||||
if (func_8006CFC0(gSaveContext.horseData.scene)) {
|
||||
Actor* horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
gSaveContext.horseData.pos.x, gSaveContext.horseData.pos.y,
|
||||
gSaveContext.horseData.pos.z, 0, gSaveContext.horseData.angle, 0, 1);
|
||||
Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, gSaveContext.horseData.pos.x,
|
||||
gSaveContext.horseData.pos.y, gSaveContext.horseData.pos.z, 0,
|
||||
gSaveContext.horseData.angle, 0, 1);
|
||||
ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 414);
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
if (play->sceneNum == SCENE_SPOT12) {
|
||||
horseActor->room = -1;
|
||||
}
|
||||
} else {
|
||||
@@ -91,21 +90,20 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
|
||||
// "Horse_SetNormal():%d set spot is no good."
|
||||
osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horseData.scene);
|
||||
osSyncPrintf(VT_RST);
|
||||
func_8006D074(globalCtx);
|
||||
func_8006D074(play);
|
||||
}
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(EVENTCHKINF_18) && (DREG(1) == 0)) {
|
||||
Actor* horseActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1);
|
||||
} else if ((play->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(EVENTCHKINF_18) && (DREG(1) == 0)) {
|
||||
Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1);
|
||||
ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 443);
|
||||
} else if (Flags_GetEventChkInf(EVENTCHKINF_18) || (DREG(1) != 0)) {
|
||||
for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) {
|
||||
HorseSpawn* horseSpawn = &horseSpawns[i];
|
||||
if (horseSpawn->scene == globalCtx->sceneNum) {
|
||||
if (horseSpawn->scene == play->sceneNum) {
|
||||
Actor* horseActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, horseSpawn->pos.x, horseSpawn->pos.y,
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, horseSpawn->pos.x, horseSpawn->pos.y,
|
||||
horseSpawn->pos.z, 0, horseSpawn->angle, 0, horseSpawn->type);
|
||||
ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 466);
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
if (play->sceneNum == SCENE_SPOT12) {
|
||||
horseActor->room = -1;
|
||||
}
|
||||
|
||||
@@ -113,8 +111,8 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
|
||||
}
|
||||
}
|
||||
} else if (!Flags_GetEventChkInf(EVENTCHKINF_18)) {
|
||||
if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && !IS_DAY) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1);
|
||||
if ((DREG(1) == 0) && (play->sceneNum == SCENE_SOUKO) && !IS_DAY) {
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,7 +125,7 @@ typedef struct {
|
||||
/* 0x10 */ s16 type;
|
||||
} struct_8011F9B8;
|
||||
|
||||
void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
void func_8006D684(PlayState* play, Player* player) {
|
||||
s32 pad;
|
||||
s32 i;
|
||||
Vec3s spawnPos;
|
||||
@@ -152,24 +150,24 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
spawnPos = spawnPositions[3];
|
||||
}
|
||||
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y,
|
||||
spawnPos.z, 0, player->actor.world.rot.y, 0, 7);
|
||||
player->rideActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y, spawnPos.z, 0,
|
||||
player->actor.world.rot.y, 0, 7);
|
||||
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", "../z_horse.c", 561);
|
||||
|
||||
Actor_MountHorse(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
gSaveContext.horseData.scene = globalCtx->sceneNum;
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT20) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) &&
|
||||
Actor_MountHorse(play, player, player->rideActor);
|
||||
func_8002DE74(play, player);
|
||||
gSaveContext.horseData.scene = play->sceneNum;
|
||||
} else if ((play->sceneNum == SCENE_SPOT20) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) &&
|
||||
!Flags_GetEventChkInf(EVENTCHKINF_18) && (DREG(1) == 0)) {
|
||||
player->rideActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5);
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5);
|
||||
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", "../z_horse.c", 582);
|
||||
|
||||
Actor_MountHorse(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
gSaveContext.horseData.scene = globalCtx->sceneNum;
|
||||
Actor_MountHorse(play, player, player->rideActor);
|
||||
func_8002DE74(play, player);
|
||||
gSaveContext.horseData.scene = play->sceneNum;
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
if (play->sceneNum == SCENE_SPOT12) {
|
||||
player->rideActor->room = -1;
|
||||
}
|
||||
} else {
|
||||
@@ -181,22 +179,22 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
};
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++) {
|
||||
if ((globalCtx->sceneNum == D_8011F9B8[i].scene) &&
|
||||
if ((play->sceneNum == D_8011F9B8[i].scene) &&
|
||||
(((void)0, gSaveContext.cutsceneIndex) == D_8011F9B8[i].cutsceneIndex)) {
|
||||
if (D_8011F9B8[i].type == 7) {
|
||||
if ((globalCtx->sceneNum == 99) && (((void)0, gSaveContext.cutsceneIndex) == 0xFFF1)) {
|
||||
if ((play->sceneNum == 99) && (((void)0, gSaveContext.cutsceneIndex) == 0xFFF1)) {
|
||||
D_8011F9B8[i].pos.x = player->actor.world.pos.x;
|
||||
D_8011F9B8[i].pos.y = player->actor.world.pos.y;
|
||||
D_8011F9B8[i].pos.z = player->actor.world.pos.z;
|
||||
}
|
||||
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
|
||||
player->actor.world.rot.y, 0, D_8011F9B8[i].type);
|
||||
player->rideActor =
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y,
|
||||
D_8011F9B8[i].pos.z, 0, player->actor.world.rot.y, 0, D_8011F9B8[i].type);
|
||||
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", "../z_horse.c", 628);
|
||||
|
||||
Actor_MountHorse(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
Actor_MountHorse(play, player, player->rideActor);
|
||||
func_8002DE74(play, player);
|
||||
} else if ((D_8011F9B8[i].type == 5) || (D_8011F9B8[i].type == 6) || (D_8011F9B8[i].type == 8)) {
|
||||
Vec3f sp54;
|
||||
s32 temp = 0;
|
||||
@@ -205,9 +203,9 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
temp = 0x8000;
|
||||
}
|
||||
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
|
||||
D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp);
|
||||
player->rideActor =
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y,
|
||||
D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp);
|
||||
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", "../z_horse.c", 667);
|
||||
|
||||
player->actor.world.pos.x = D_8011F9B8[i].pos.x;
|
||||
@@ -216,18 +214,17 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
player->actor.shape.rot.x = player->actor.shape.rot.z = 0;
|
||||
player->actor.shape.rot.y = D_8011F9B8[i].angle;
|
||||
|
||||
Actor_MountHorse(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
Actor_MountHorse(play, player, player->rideActor);
|
||||
func_8002DE74(play, player);
|
||||
|
||||
sp54.x = player->actor.world.pos.x - 200.0f;
|
||||
sp54.y = player->actor.world.pos.y + 100.0f;
|
||||
sp54.z = player->actor.world.pos.z;
|
||||
|
||||
Play_CameraSetAtEye(globalCtx, globalCtx->activeCamId, &player->actor.world.pos, &sp54);
|
||||
Play_CameraSetAtEye(play, play->activeCamId, &player->actor.world.pos, &sp54);
|
||||
} else {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x,
|
||||
D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0,
|
||||
D_8011F9B8[i].type);
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y,
|
||||
D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0, D_8011F9B8[i].type);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -235,26 +232,26 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_8006DC68(GlobalContext* globalCtx, Player* player) {
|
||||
void func_8006DC68(PlayState* play, Player* player) {
|
||||
if (LINK_IS_ADULT) {
|
||||
if (!func_8006CFC0(gSaveContext.horseData.scene)) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE));
|
||||
// "Horse_Set_Check():%d set spot is no good."
|
||||
osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horseData.scene);
|
||||
osSyncPrintf(VT_RST);
|
||||
func_8006D074(globalCtx);
|
||||
func_8006D074(play);
|
||||
}
|
||||
|
||||
if (func_8006CFC0(globalCtx->sceneNum)) {
|
||||
if (func_8006CFC0(play->sceneNum)) {
|
||||
if ((gSaveContext.sceneSetupIndex > 3) ||
|
||||
((gSaveContext.entranceIndex == ENTR_SPOT00_11 || gSaveContext.entranceIndex == ENTR_SPOT00_12 ||
|
||||
gSaveContext.entranceIndex == ENTR_SPOT00_13 || gSaveContext.entranceIndex == ENTR_SPOT00_15) &&
|
||||
(gSaveContext.respawnFlag == 0)) ||
|
||||
((globalCtx->sceneNum == SCENE_SPOT20) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) &&
|
||||
((play->sceneNum == SCENE_SPOT20) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) &&
|
||||
!Flags_GetEventChkInf(EVENTCHKINF_18) && (DREG(1) == 0))) {
|
||||
func_8006D684(globalCtx, player);
|
||||
func_8006D684(play, player);
|
||||
} else {
|
||||
func_8006D0EC(globalCtx, player);
|
||||
func_8006D0EC(play, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl) {
|
||||
}
|
||||
}
|
||||
|
||||
void KaleidoManager_Init(GlobalContext* globalCtx) {
|
||||
void KaleidoManager_Init(PlayState* play) {
|
||||
s32 largestSize = 0;
|
||||
s32 size;
|
||||
u32 i;
|
||||
@@ -57,7 +57,7 @@ void KaleidoManager_Init(GlobalContext* globalCtx) {
|
||||
osSyncPrintf("KaleidoArea の最大サイズは %d バイトを確保します\n", largestSize);
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
sKaleidoAreaPtr = GameState_Alloc(&globalCtx->state, largestSize, "../z_kaleido_manager.c", 150);
|
||||
sKaleidoAreaPtr = GameState_Alloc(&play->state, largestSize, "../z_kaleido_manager.c", 150);
|
||||
LogUtils_CheckNullPointer("KaleidoArea_allocp", sKaleidoAreaPtr, "../z_kaleido_manager.c", 151);
|
||||
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#include "global.h"
|
||||
#include "vt.h"
|
||||
|
||||
void (*sKaleidoScopeUpdateFunc)(GlobalContext* globalCtx);
|
||||
void (*sKaleidoScopeDrawFunc)(GlobalContext* globalCtx);
|
||||
void (*sKaleidoScopeUpdateFunc)(PlayState* play);
|
||||
void (*sKaleidoScopeDrawFunc)(PlayState* play);
|
||||
f32 gBossMarkScale;
|
||||
u32 D_8016139C;
|
||||
PauseMapMarksData* gLoadedPauseMarkDataTable;
|
||||
|
||||
extern void KaleidoScope_Update(GlobalContext* globalCtx);
|
||||
extern void KaleidoScope_Draw(GlobalContext* globalCtx);
|
||||
extern void KaleidoScope_Update(PlayState* play);
|
||||
extern void KaleidoScope_Draw(PlayState* play);
|
||||
|
||||
void KaleidoScopeCall_LoadPlayer(void) {
|
||||
KaleidoMgrOverlay* playerActorOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR];
|
||||
@@ -30,7 +30,7 @@ void KaleidoScopeCall_LoadPlayer(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void KaleidoScopeCall_Init(GlobalContext* globalCtx) {
|
||||
void KaleidoScopeCall_Init(PlayState* play) {
|
||||
// "Kaleidoscope replacement construction"
|
||||
osSyncPrintf("カレイド・スコープ入れ替え コンストラクト \n");
|
||||
|
||||
@@ -42,19 +42,19 @@ void KaleidoScopeCall_Init(GlobalContext* globalCtx) {
|
||||
LOG_ADDRESS("kaleido_scope_draw", KaleidoScope_Draw, "../z_kaleido_scope_call.c", 100);
|
||||
LOG_ADDRESS("kaleido_scope_draw_func", sKaleidoScopeDrawFunc, "../z_kaleido_scope_call.c", 101);
|
||||
|
||||
KaleidoSetup_Init(globalCtx);
|
||||
KaleidoSetup_Init(play);
|
||||
}
|
||||
|
||||
void KaleidoScopeCall_Destroy(GlobalContext* globalCtx) {
|
||||
void KaleidoScopeCall_Destroy(PlayState* play) {
|
||||
// "Kaleidoscope replacement destruction"
|
||||
osSyncPrintf("カレイド・スコープ入れ替え デストラクト \n");
|
||||
|
||||
KaleidoSetup_Destroy(globalCtx);
|
||||
KaleidoSetup_Destroy(play);
|
||||
}
|
||||
|
||||
void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
|
||||
void KaleidoScopeCall_Update(PlayState* play) {
|
||||
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
|
||||
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
||||
PauseContext* pauseCtx = &play->pauseCtx;
|
||||
|
||||
if ((pauseCtx->state != 0) || (pauseCtx->debugState != 0)) {
|
||||
if (pauseCtx->state == 1) {
|
||||
@@ -99,9 +99,9 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if (gKaleidoMgrCurOvl == kaleidoScopeOvl) {
|
||||
sKaleidoScopeUpdateFunc(globalCtx);
|
||||
sKaleidoScopeUpdateFunc(play);
|
||||
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0)) {
|
||||
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0)) {
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
// "Kaleido area Kaleidoscope Emission"
|
||||
osSyncPrintf("カレイド領域 カレイドスコープ排出\n");
|
||||
@@ -115,14 +115,14 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
void KaleidoScopeCall_Draw(GlobalContext* globalCtx) {
|
||||
void KaleidoScopeCall_Draw(PlayState* play) {
|
||||
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
|
||||
|
||||
if (R_PAUSE_MENU_MODE >= 3) {
|
||||
if (((globalCtx->pauseCtx.state >= 4) && (globalCtx->pauseCtx.state <= 7)) ||
|
||||
((globalCtx->pauseCtx.state >= 11) && (globalCtx->pauseCtx.state <= 18))) {
|
||||
if (((play->pauseCtx.state >= 4) && (play->pauseCtx.state <= 7)) ||
|
||||
((play->pauseCtx.state >= 11) && (play->pauseCtx.state <= 18))) {
|
||||
if (gKaleidoMgrCurOvl == kaleidoScopeOvl) {
|
||||
sKaleidoScopeDrawFunc(globalCtx);
|
||||
sKaleidoScopeDrawFunc(play);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+12
-12
@@ -8,15 +8,15 @@ s16 sKaleidoSetupKscpPos1[] = { PAUSE_MAP, PAUSE_QUEST, PAUSE_EQUIP, PAUSE_ITEM
|
||||
f32 sKaleidoSetupEyeX1[] = { -64.0f, 0.0f, 64.0f, 0.0f };
|
||||
f32 sKaleidoSetupEyeZ1[] = { 0.0f, -64.0f, 0.0f, 64.0f };
|
||||
|
||||
void KaleidoSetup_Update(GlobalContext* globalCtx) {
|
||||
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
||||
Input* input = &globalCtx->state.input[0];
|
||||
void KaleidoSetup_Update(PlayState* play) {
|
||||
PauseContext* pauseCtx = &play->pauseCtx;
|
||||
Input* input = &play->state.input[0];
|
||||
|
||||
if (pauseCtx->state == 0 && pauseCtx->debugState == 0 && globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE &&
|
||||
globalCtx->transitionTrigger == TRANS_TRIGGER_OFF && globalCtx->transitionMode == TRANS_MODE_OFF &&
|
||||
gSaveContext.cutsceneIndex < 0xFFF0 && gSaveContext.nextCutsceneIndex < 0xFFF0 && !Play_InCsMode(globalCtx) &&
|
||||
globalCtx->shootingGalleryStatus <= 1 && gSaveContext.unk_13F0 != 8 && gSaveContext.unk_13F0 != 9 &&
|
||||
(globalCtx->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(globalCtx, 0x38))) {
|
||||
if (pauseCtx->state == 0 && pauseCtx->debugState == 0 && play->gameOverCtx.state == GAMEOVER_INACTIVE &&
|
||||
play->transitionTrigger == TRANS_TRIGGER_OFF && play->transitionMode == TRANS_MODE_OFF &&
|
||||
gSaveContext.cutsceneIndex < 0xFFF0 && gSaveContext.nextCutsceneIndex < 0xFFF0 && !Play_InCsMode(play) &&
|
||||
play->shootingGalleryStatus <= 1 && gSaveContext.unk_13F0 != 8 && gSaveContext.unk_13F0 != 9 &&
|
||||
(play->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(play, 0x38))) {
|
||||
|
||||
if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
|
||||
if (BREG(0)) {
|
||||
@@ -61,8 +61,8 @@ void KaleidoSetup_Update(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
void KaleidoSetup_Init(GlobalContext* globalCtx) {
|
||||
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
||||
void KaleidoSetup_Init(PlayState* play) {
|
||||
PauseContext* pauseCtx = &play->pauseCtx;
|
||||
u64 temp = 0; // Necessary to match
|
||||
|
||||
pauseCtx->state = 0;
|
||||
@@ -114,8 +114,8 @@ void KaleidoSetup_Init(GlobalContext* globalCtx) {
|
||||
pauseCtx->ocarinaSongIdx = -1;
|
||||
pauseCtx->cursorSpecialPos = 0;
|
||||
|
||||
View_Init(&pauseCtx->view, globalCtx->state.gfxCtx);
|
||||
View_Init(&pauseCtx->view, play->state.gfxCtx);
|
||||
}
|
||||
|
||||
void KaleidoSetup_Destroy(GlobalContext* globalCtx) {
|
||||
void KaleidoSetup_Destroy(PlayState* play) {
|
||||
}
|
||||
|
||||
+283
-296
File diff suppressed because it is too large
Load Diff
+18
-18
@@ -111,8 +111,8 @@ s16 sBeatingHeartsDDEnv[3];
|
||||
s16 sHeartsDDPrim[2][3];
|
||||
s16 sHeartsDDEnv[2][3];
|
||||
|
||||
void Health_InitMeter(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
void Health_InitMeter(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
interfaceCtx->unk_228 = 0x140;
|
||||
interfaceCtx->unk_226 = gSaveContext.health;
|
||||
@@ -144,8 +144,8 @@ void Health_InitMeter(GlobalContext* globalCtx) {
|
||||
sHeartsDDEnv[0][2] = sHeartsDDEnv[1][2] = HEARTS_DD_ENV_B;
|
||||
}
|
||||
|
||||
void Health_UpdateMeter(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
void Health_UpdateMeter(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
f32 factor = interfaceCtx->heartColorOscillator * 0.1f;
|
||||
f32 ddFactor;
|
||||
s32 type = 0;
|
||||
@@ -241,14 +241,14 @@ void Health_UpdateMeter(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
// Unused
|
||||
s32 func_80078E18(GlobalContext* globalCtx) {
|
||||
gSaveContext.health = globalCtx->interfaceCtx.unk_226;
|
||||
s32 func_80078E18(PlayState* play) {
|
||||
gSaveContext.health = play->interfaceCtx.unk_226;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Unused
|
||||
s32 func_80078E34(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
s32 func_80078E34(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
interfaceCtx->unk_228 = 0x140;
|
||||
interfaceCtx->unk_226 += 0x10;
|
||||
@@ -262,8 +262,8 @@ s32 func_80078E34(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
// Unused
|
||||
s32 func_80078E84(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
s32 func_80078E84(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
if (interfaceCtx->unk_228 != 0) {
|
||||
interfaceCtx->unk_228--;
|
||||
@@ -272,7 +272,7 @@ s32 func_80078E84(GlobalContext* globalCtx) {
|
||||
interfaceCtx->unk_226 -= 0x10;
|
||||
if (interfaceCtx->unk_226 <= 0) {
|
||||
interfaceCtx->unk_226 = 0;
|
||||
globalCtx->damagePlayer(globalCtx, -(gSaveContext.health + 1));
|
||||
play->damagePlayer(play, -(gSaveContext.health + 1));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -295,7 +295,7 @@ static void* sHeartDDTextures[] = {
|
||||
gDefenseHeartThreeQuarterTex,
|
||||
};
|
||||
|
||||
void Health_DrawMeter(GlobalContext* globalCtx) {
|
||||
void Health_DrawMeter(PlayState* play) {
|
||||
s32 pad[5];
|
||||
void* heartBgImg;
|
||||
u32 curColorSet;
|
||||
@@ -306,8 +306,8 @@ void Health_DrawMeter(GlobalContext* globalCtx) {
|
||||
f32 heartCenterX;
|
||||
f32 heartCenterY;
|
||||
f32 heartTexCoordPerPixel;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
Vtx* beatingHeartVtx = interfaceCtx->beatingHeartVtx;
|
||||
s32 curHeartFraction = gSaveContext.health % 0x10;
|
||||
s16 totalHeartCount = gSaveContext.healthCapacity / 0x10;
|
||||
@@ -498,16 +498,16 @@ void Health_DrawMeter(GlobalContext* globalCtx) {
|
||||
CLOSE_DISPS(gfxCtx, "../z_lifemeter.c", 606);
|
||||
}
|
||||
|
||||
void Health_UpdateBeatingHeart(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
void Health_UpdateBeatingHeart(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
if (interfaceCtx->beatingHeartOscillatorDirection != 0) {
|
||||
interfaceCtx->beatingHeartOscillator--;
|
||||
if (interfaceCtx->beatingHeartOscillator <= 0) {
|
||||
interfaceCtx->beatingHeartOscillator = 0;
|
||||
interfaceCtx->beatingHeartOscillatorDirection = 0;
|
||||
if (!Player_InCsMode(globalCtx) && (globalCtx->pauseCtx.state == 0) &&
|
||||
(globalCtx->pauseCtx.debugState == 0) && Health_IsCritical() && !Play_InCsMode(globalCtx)) {
|
||||
if (!Player_InCsMode(play) && (play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) &&
|
||||
Health_IsCritical() && !Play_InCsMode(play)) {
|
||||
func_80078884(NA_SE_SY_HITPOINT_ALARM);
|
||||
}
|
||||
}
|
||||
|
||||
+15
-15
@@ -195,8 +195,8 @@ s32 Lights_FreeNode(LightNode* light) {
|
||||
}
|
||||
}
|
||||
|
||||
void LightContext_Init(GlobalContext* globalCtx, LightContext* lightCtx) {
|
||||
LightContext_InitList(globalCtx, lightCtx);
|
||||
void LightContext_Init(PlayState* play, LightContext* lightCtx) {
|
||||
LightContext_InitList(play, lightCtx);
|
||||
LightContext_SetAmbientColor(lightCtx, 80, 80, 80);
|
||||
LightContext_SetFog(lightCtx, 0, 0, 0, 996, 12800);
|
||||
bzero(&sLightsBuffer, sizeof(sLightsBuffer));
|
||||
@@ -223,13 +223,13 @@ Lights* LightContext_NewLights(LightContext* lightCtx, GraphicsContext* gfxCtx)
|
||||
return Lights_New(gfxCtx, lightCtx->ambientColor[0], lightCtx->ambientColor[1], lightCtx->ambientColor[2]);
|
||||
}
|
||||
|
||||
void LightContext_InitList(GlobalContext* globalCtx, LightContext* lightCtx) {
|
||||
void LightContext_InitList(PlayState* play, LightContext* lightCtx) {
|
||||
lightCtx->listHead = NULL;
|
||||
}
|
||||
|
||||
void LightContext_DestroyList(GlobalContext* globalCtx, LightContext* lightCtx) {
|
||||
void LightContext_DestroyList(PlayState* play, LightContext* lightCtx) {
|
||||
while (lightCtx->listHead != NULL) {
|
||||
LightContext_RemoveLight(globalCtx, lightCtx, lightCtx->listHead);
|
||||
LightContext_RemoveLight(play, lightCtx, lightCtx->listHead);
|
||||
lightCtx->listHead = lightCtx->listHead->next;
|
||||
}
|
||||
}
|
||||
@@ -240,7 +240,7 @@ void LightContext_DestroyList(GlobalContext* globalCtx, LightContext* lightCtx)
|
||||
* Note: Due to the limited number of slots in a Lights group, inserting too many lights in the
|
||||
* list may result in older entries not being bound to a Light when calling Lights_BindAll
|
||||
*/
|
||||
LightNode* LightContext_InsertLight(GlobalContext* globalCtx, LightContext* lightCtx, LightInfo* info) {
|
||||
LightNode* LightContext_InsertLight(PlayState* play, LightContext* lightCtx, LightInfo* info) {
|
||||
LightNode* node;
|
||||
|
||||
node = Lights_FindBufSlot();
|
||||
@@ -260,7 +260,7 @@ LightNode* LightContext_InsertLight(GlobalContext* globalCtx, LightContext* ligh
|
||||
return node;
|
||||
}
|
||||
|
||||
void LightContext_RemoveLight(GlobalContext* globalCtx, LightContext* lightCtx, LightNode* node) {
|
||||
void LightContext_RemoveLight(PlayState* play, LightContext* lightCtx, LightNode* node) {
|
||||
if (node != NULL) {
|
||||
if (node->prev != NULL) {
|
||||
node->prev->next = node->next;
|
||||
@@ -316,7 +316,7 @@ Lights* Lights_New(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambient
|
||||
return lights;
|
||||
}
|
||||
|
||||
void Lights_GlowCheck(GlobalContext* globalCtx) {
|
||||
void Lights_GlowCheck(PlayState* play) {
|
||||
LightNode* node;
|
||||
LightPoint* params;
|
||||
Vec3f pos;
|
||||
@@ -327,7 +327,7 @@ void Lights_GlowCheck(GlobalContext* globalCtx) {
|
||||
s32 wZ;
|
||||
s32 zBuf;
|
||||
|
||||
node = globalCtx->lightCtx.listHead;
|
||||
node = play->lightCtx.listHead;
|
||||
|
||||
while (node != NULL) {
|
||||
params = &node->info->params.point;
|
||||
@@ -336,7 +336,7 @@ void Lights_GlowCheck(GlobalContext* globalCtx) {
|
||||
pos.x = params->x;
|
||||
pos.y = params->y;
|
||||
pos.z = params->z;
|
||||
Actor_ProjectPos(globalCtx, &pos, &multDest, &cappedInvWDest);
|
||||
Actor_ProjectPos(play, &pos, &multDest, &cappedInvWDest);
|
||||
params->drawGlow = false;
|
||||
wX = multDest.x * cappedInvWDest;
|
||||
wY = multDest.y * cappedInvWDest;
|
||||
@@ -356,13 +356,13 @@ void Lights_GlowCheck(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
void Lights_DrawGlow(GlobalContext* globalCtx) {
|
||||
void Lights_DrawGlow(PlayState* play) {
|
||||
s32 pad;
|
||||
LightNode* node;
|
||||
|
||||
node = globalCtx->lightCtx.listHead;
|
||||
node = play->lightCtx.listHead;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_lights.c", 887);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_lights.c", 887);
|
||||
|
||||
POLY_XLU_DISP = func_800947AC(POLY_XLU_DISP++);
|
||||
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_NOISE);
|
||||
@@ -384,7 +384,7 @@ void Lights_DrawGlow(GlobalContext* globalCtx) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, params->color[0], params->color[1], params->color[2], 50);
|
||||
Matrix_Translate(params->x, params->y, params->z, MTXMODE_NEW);
|
||||
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_lights.c", 918),
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_lights.c", 918),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGlowCircleDL);
|
||||
}
|
||||
@@ -392,5 +392,5 @@ void Lights_DrawGlow(GlobalContext* globalCtx) {
|
||||
node = node->next;
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_lights.c", 927);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_lights.c", 927);
|
||||
}
|
||||
|
||||
+73
-74
@@ -10,17 +10,17 @@ s16 sPlayerInitialPosZ = 0;
|
||||
s16 sPlayerInitialDirection = 0;
|
||||
s16 sEntranceIconMapIndex = 0;
|
||||
|
||||
void Map_SavePlayerInitialInfo(GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
void Map_SavePlayerInitialInfo(PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
sPlayerInitialPosX = player->actor.world.pos.x;
|
||||
sPlayerInitialPosZ = player->actor.world.pos.z;
|
||||
sPlayerInitialDirection = (s16)((0x7FFF - player->actor.shape.rot.y) / 0x400);
|
||||
}
|
||||
|
||||
void Map_SetPaletteData(GlobalContext* globalCtx, s16 room) {
|
||||
void Map_SetPaletteData(PlayState* play, s16 room) {
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s16 paletteIndex = gMapData->roomPalette[mapIndex][room];
|
||||
|
||||
if (interfaceCtx->mapRoomNum == room) {
|
||||
@@ -37,9 +37,9 @@ void Map_SetPaletteData(GlobalContext* globalCtx, s16 room) {
|
||||
interfaceCtx->mapPalette[paletteIndex * 2 + 1] = 0xBF;
|
||||
}
|
||||
|
||||
void Map_SetFloorPalettesData(GlobalContext* globalCtx, s16 floor) {
|
||||
void Map_SetFloorPalettesData(PlayState* play, s16 floor) {
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s16 room;
|
||||
s16 i;
|
||||
|
||||
@@ -53,7 +53,7 @@ void Map_SetFloorPalettesData(GlobalContext* globalCtx, s16 floor) {
|
||||
interfaceCtx->mapPalette[31] = 1;
|
||||
}
|
||||
|
||||
switch (globalCtx->sceneNum) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_YDAN:
|
||||
case SCENE_DDAN:
|
||||
case SCENE_BDAN:
|
||||
@@ -75,19 +75,19 @@ void Map_SetFloorPalettesData(GlobalContext* globalCtx, s16 floor) {
|
||||
for (i = 0; i < gMapData->maxPaletteCount[mapIndex]; i++) {
|
||||
room = gMapData->paletteRoom[mapIndex][floor][i];
|
||||
if ((room != 0xFF) && (gSaveContext.sceneFlags[mapIndex].rooms & gBitFlags[room])) {
|
||||
Map_SetPaletteData(globalCtx, room);
|
||||
Map_SetPaletteData(play, room);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Map_InitData(GlobalContext* globalCtx, s16 room) {
|
||||
void Map_InitData(PlayState* play, s16 room) {
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s16 extendedMapIndex;
|
||||
|
||||
switch (globalCtx->sceneNum) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_SPOT00:
|
||||
case SCENE_SPOT01:
|
||||
case SCENE_SPOT02:
|
||||
@@ -109,19 +109,19 @@ void Map_InitData(GlobalContext* globalCtx, s16 room) {
|
||||
case SCENE_SPOT20:
|
||||
case SCENE_GANON_TOU:
|
||||
extendedMapIndex = mapIndex;
|
||||
if (globalCtx->sceneNum == SCENE_SPOT02) {
|
||||
if (play->sceneNum == SCENE_SPOT02) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_SONG_NOCTURNE)) {
|
||||
extendedMapIndex = 0x14;
|
||||
}
|
||||
} else if (globalCtx->sceneNum == SCENE_SPOT06) {
|
||||
} else if (play->sceneNum == SCENE_SPOT06) {
|
||||
if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER)) {
|
||||
extendedMapIndex = 0x15;
|
||||
}
|
||||
} else if (globalCtx->sceneNum == SCENE_SPOT09) {
|
||||
} else if (play->sceneNum == SCENE_SPOT09) {
|
||||
if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
|
||||
extendedMapIndex = 0x16;
|
||||
}
|
||||
} else if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
} else if (play->sceneNum == SCENE_SPOT12) {
|
||||
if (GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
|
||||
extendedMapIndex = 0x17;
|
||||
}
|
||||
@@ -158,27 +158,27 @@ void Map_InitData(GlobalContext* globalCtx, s16 room) {
|
||||
osSyncPrintf("デクの樹ダンジョンMAP テクスチャDMA(%x) scene_id_offset=%d VREG(30)=%d\n", room,
|
||||
mapIndex, VREG(30));
|
||||
osSyncPrintf(VT_RST);
|
||||
DmaMgr_SendRequest1(globalCtx->interfaceCtx.mapSegment,
|
||||
DmaMgr_SendRequest1(play->interfaceCtx.mapSegment,
|
||||
(u32)_map_i_staticSegmentRomStart +
|
||||
((gMapData->dgnMinimapTexIndexOffset[mapIndex] + room) * 0xFF0),
|
||||
0xFF0, "../z_map_exp.c", 346);
|
||||
R_COMPASS_OFFSET_X = gMapData->roomCompassOffsetX[mapIndex][room];
|
||||
R_COMPASS_OFFSET_Y = gMapData->roomCompassOffsetY[mapIndex][room];
|
||||
Map_SetFloorPalettesData(globalCtx, VREG(30));
|
||||
Map_SetFloorPalettesData(play, VREG(30));
|
||||
osSyncPrintf("MAP 各階ONチェック\n"); // "MAP Individual Floor ON Check"
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Map_InitRoomData(GlobalContext* globalCtx, s16 room) {
|
||||
void Map_InitRoomData(PlayState* play, s16 room) {
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
osSyncPrintf("*******\n*******\nroom_no=%d (%d)(%d)\n*******\n*******\n", room,
|
||||
mapIndex, globalCtx->sceneNum);
|
||||
mapIndex, play->sceneNum);
|
||||
|
||||
if (room >= 0) {
|
||||
switch (globalCtx->sceneNum) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_YDAN:
|
||||
case SCENE_DDAN:
|
||||
case SCENE_BDAN:
|
||||
@@ -201,11 +201,11 @@ void Map_InitRoomData(GlobalContext* globalCtx, s16 room) {
|
||||
osSyncPrintf("ROOM_INF=%d\n", gSaveContext.sceneFlags[mapIndex].rooms);
|
||||
interfaceCtx->mapRoomNum = room;
|
||||
interfaceCtx->unk_25A = mapIndex;
|
||||
Map_SetPaletteData(globalCtx, room);
|
||||
Map_SetPaletteData(play, room);
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("部屋部屋=%d\n", room); // "Room Room = %d"
|
||||
osSyncPrintf(VT_RST);
|
||||
Map_InitData(globalCtx, room);
|
||||
Map_InitData(play, room);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@@ -217,27 +217,27 @@ void Map_InitRoomData(GlobalContext* globalCtx, s16 room) {
|
||||
}
|
||||
}
|
||||
|
||||
void Map_Destroy(GlobalContext* globalCtx) {
|
||||
MapMark_ClearPointers(globalCtx);
|
||||
void Map_Destroy(PlayState* play) {
|
||||
MapMark_ClearPointers(play);
|
||||
gMapData = NULL;
|
||||
}
|
||||
|
||||
void Map_Init(GlobalContext* globalCtx) {
|
||||
void Map_Init(PlayState* play) {
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
gMapData = &gMapDataTable;
|
||||
|
||||
interfaceCtx->unk_258 = -1;
|
||||
interfaceCtx->unk_25A = -1;
|
||||
|
||||
interfaceCtx->mapSegment = GameState_Alloc(&globalCtx->state, 0x1000, "../z_map_exp.c", 457);
|
||||
interfaceCtx->mapSegment = GameState_Alloc(&play->state, 0x1000, "../z_map_exp.c", 457);
|
||||
// "MAP texture initialization scene_data_ID=%d mapSegment=%x"
|
||||
osSyncPrintf("\n\n\nMAP テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", globalCtx->sceneNum,
|
||||
interfaceCtx->mapSegment, globalCtx);
|
||||
osSyncPrintf("\n\n\nMAP テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", play->sceneNum,
|
||||
interfaceCtx->mapSegment, play);
|
||||
ASSERT(interfaceCtx->mapSegment != NULL, "parameter->mapSegment != NULL", "../z_map_exp.c", 459);
|
||||
|
||||
switch (globalCtx->sceneNum) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_SPOT00:
|
||||
case SCENE_SPOT01:
|
||||
case SCENE_SPOT02:
|
||||
@@ -258,13 +258,13 @@ void Map_Init(GlobalContext* globalCtx) {
|
||||
case SCENE_SPOT18:
|
||||
case SCENE_SPOT20:
|
||||
case SCENE_GANON_TOU:
|
||||
mapIndex = globalCtx->sceneNum - SCENE_SPOT00;
|
||||
mapIndex = play->sceneNum - SCENE_SPOT00;
|
||||
R_MAP_INDEX = gSaveContext.mapIndex = mapIndex;
|
||||
R_COMPASS_SCALE_X = gMapData->owCompassInfo[mapIndex][0];
|
||||
R_COMPASS_SCALE_Y = gMapData->owCompassInfo[mapIndex][1];
|
||||
R_COMPASS_OFFSET_X = gMapData->owCompassInfo[mapIndex][2];
|
||||
R_COMPASS_OFFSET_Y = gMapData->owCompassInfo[mapIndex][3];
|
||||
Map_InitData(globalCtx, mapIndex);
|
||||
Map_InitData(play, mapIndex);
|
||||
R_OW_MINIMAP_X = gMapData->owMinimapPosX[mapIndex];
|
||||
R_OW_MINIMAP_Y = gMapData->owMinimapPosY[mapIndex];
|
||||
break;
|
||||
@@ -293,31 +293,30 @@ void Map_Init(GlobalContext* globalCtx) {
|
||||
case SCENE_MIZUSIN_BS:
|
||||
case SCENE_JYASINBOSS:
|
||||
case SCENE_HAKADAN_BS:
|
||||
mapIndex =
|
||||
(globalCtx->sceneNum >= SCENE_YDAN_BOSS) ? globalCtx->sceneNum - SCENE_YDAN_BOSS : globalCtx->sceneNum;
|
||||
mapIndex = (play->sceneNum >= SCENE_YDAN_BOSS) ? play->sceneNum - SCENE_YDAN_BOSS : play->sceneNum;
|
||||
R_MAP_INDEX = gSaveContext.mapIndex = mapIndex;
|
||||
if ((globalCtx->sceneNum <= SCENE_ICE_DOUKUTO) || (globalCtx->sceneNum >= SCENE_YDAN_BOSS)) {
|
||||
if ((play->sceneNum <= SCENE_ICE_DOUKUTO) || (play->sceneNum >= SCENE_YDAN_BOSS)) {
|
||||
R_COMPASS_SCALE_X = gMapData->dgnCompassInfo[mapIndex][0];
|
||||
R_COMPASS_SCALE_Y = gMapData->dgnCompassInfo[mapIndex][1];
|
||||
R_COMPASS_OFFSET_X = gMapData->dgnCompassInfo[mapIndex][2];
|
||||
R_COMPASS_OFFSET_Y = gMapData->dgnCompassInfo[mapIndex][3];
|
||||
R_MAP_TEX_INDEX = R_MAP_TEX_INDEX_BASE = gMapData->dgnTexIndexBase[mapIndex];
|
||||
Map_InitRoomData(globalCtx, globalCtx->roomCtx.curRoom.num);
|
||||
MapMark_Init(globalCtx);
|
||||
Map_InitRoomData(play, play->roomCtx.curRoom.num);
|
||||
MapMark_Init(play);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
|
||||
void Minimap_DrawCompassIcons(PlayState* play) {
|
||||
s32 pad;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Player* player = GET_PLAYER(play);
|
||||
s16 tempX, tempZ;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_map_exp.c", 565);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_map_exp.c", 565);
|
||||
|
||||
if (globalCtx->interfaceCtx.minimapAlpha >= 0xAA) {
|
||||
func_80094A14(globalCtx->state.gfxCtx);
|
||||
if (play->interfaceCtx.minimapAlpha >= 0xAA) {
|
||||
func_80094A14(play->state.gfxCtx);
|
||||
|
||||
gSPMatrix(OVERLAY_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||
@@ -334,7 +333,7 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
|
||||
Matrix_RotateX(-1.6f, MTXMODE_APPLY);
|
||||
tempX = (0x7FFF - player->actor.shape.rot.y) / 0x400;
|
||||
Matrix_RotateY(tempX / 10.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_map_exp.c", 585),
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_map_exp.c", 585),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 255, 0, 255);
|
||||
@@ -348,25 +347,25 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
|
||||
Matrix_Scale(VREG(9) / 100.0f, VREG(9) / 100.0f, VREG(9) / 100.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateX(VREG(52) / 10.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateY(sPlayerInitialDirection / 10.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_map_exp.c", 603),
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_map_exp.c", 603),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, 200, 0, 0, 255);
|
||||
gSPDisplayList(OVERLAY_DISP++, gCompassArrowDL);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_map_exp.c", 607);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_map_exp.c", 607);
|
||||
}
|
||||
|
||||
void Minimap_Draw(GlobalContext* globalCtx) {
|
||||
void Minimap_Draw(PlayState* play) {
|
||||
s32 pad[2];
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_map_exp.c", 626);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_map_exp.c", 626);
|
||||
|
||||
if (globalCtx->pauseCtx.state < 4) {
|
||||
switch (globalCtx->sceneNum) {
|
||||
if (play->pauseCtx.state < 4) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_YDAN:
|
||||
case SCENE_DDAN:
|
||||
case SCENE_BDAN:
|
||||
@@ -378,7 +377,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
||||
case SCENE_HAKADANCH:
|
||||
case SCENE_ICE_DOUKUTO:
|
||||
if (!R_MINIMAP_DISABLED) {
|
||||
func_80094520(globalCtx->state.gfxCtx);
|
||||
func_80094520(play->state.gfxCtx);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0,
|
||||
TEXEL0, 0, PRIMITIVE, 0);
|
||||
|
||||
@@ -395,14 +394,14 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if (CHECK_DUNGEON_ITEM(DUNGEON_COMPASS, mapIndex)) {
|
||||
Minimap_DrawCompassIcons(globalCtx); // Draw icons for the player spawn and current position
|
||||
func_80094520(globalCtx->state.gfxCtx);
|
||||
MapMark_Draw(globalCtx);
|
||||
Minimap_DrawCompassIcons(play); // Draw icons for the player spawn and current position
|
||||
func_80094520(play->state.gfxCtx);
|
||||
MapMark_Draw(play);
|
||||
}
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Play_InCsMode(globalCtx)) {
|
||||
osSyncPrintf("Game_play_demo_mode_check=%d\n", Play_InCsMode(globalCtx));
|
||||
if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play)) {
|
||||
osSyncPrintf("Game_play_demo_mode_check=%d\n", Play_InCsMode(play));
|
||||
// clang-format off
|
||||
if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
@@ -438,7 +437,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
||||
case SCENE_SPOT20:
|
||||
case SCENE_GANON_TOU:
|
||||
if (!R_MINIMAP_DISABLED) {
|
||||
func_80094520(globalCtx->state.gfxCtx);
|
||||
func_80094520(play->state.gfxCtx);
|
||||
|
||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_MINIMAP_COLOR(0), R_MINIMAP_COLOR(1), R_MINIMAP_COLOR(2),
|
||||
@@ -454,8 +453,8 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
||||
(R_OW_MINIMAP_Y + gMapData->owMinimapHeight[mapIndex]) << 2, G_TX_RENDERTILE, 0,
|
||||
0, 1 << 10, 1 << 10);
|
||||
|
||||
if (((globalCtx->sceneNum != SCENE_SPOT01) && (globalCtx->sceneNum != SCENE_SPOT04) &&
|
||||
(globalCtx->sceneNum != SCENE_SPOT08)) ||
|
||||
if (((play->sceneNum != SCENE_SPOT01) && (play->sceneNum != SCENE_SPOT04) &&
|
||||
(play->sceneNum != SCENE_SPOT08)) ||
|
||||
(LINK_AGE_IN_YEARS != YEARS_ADULT)) {
|
||||
if ((gMapData->owEntranceFlag[sEntranceIconMapIndex] == 0xFFFF) ||
|
||||
((gMapData->owEntranceFlag[sEntranceIconMapIndex] != 0xFFFF) &&
|
||||
@@ -475,7 +474,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((globalCtx->sceneNum == SCENE_SPOT08) &&
|
||||
if ((play->sceneNum == SCENE_SPOT08) &&
|
||||
(gSaveContext.infTable[INFTABLE_1AX_INDEX] & gBitFlags[INFTABLE_1A9_SHIFT])) {
|
||||
gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8,
|
||||
8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
@@ -485,10 +484,10 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
||||
0, 1 << 10, 1 << 10);
|
||||
}
|
||||
|
||||
Minimap_DrawCompassIcons(globalCtx); // Draw icons for the player spawn and current position
|
||||
Minimap_DrawCompassIcons(play); // Draw icons for the player spawn and current position
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Play_InCsMode(globalCtx)) {
|
||||
if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play)) {
|
||||
// clang-format off
|
||||
if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
@@ -506,23 +505,23 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_map_exp.c", 782);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_map_exp.c", 782);
|
||||
}
|
||||
|
||||
s16 Map_GetFloorTextIndexOffset(s32 mapIndex, s32 floor) {
|
||||
return gMapData->floorTexIndexOffset[mapIndex][floor];
|
||||
}
|
||||
|
||||
void Map_Update(GlobalContext* globalCtx) {
|
||||
void Map_Update(PlayState* play) {
|
||||
static s16 sLastRoomNum = 99;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Player* player = GET_PLAYER(play);
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s16 floor;
|
||||
s16 i;
|
||||
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0)) {
|
||||
switch (globalCtx->sceneNum) {
|
||||
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0)) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_YDAN:
|
||||
case SCENE_DDAN:
|
||||
case SCENE_BDAN:
|
||||
@@ -568,9 +567,9 @@ void Map_Update(GlobalContext* globalCtx) {
|
||||
// "Layer switching = %x"
|
||||
osSyncPrintf("階層切替=%x\n", interfaceCtx->mapRoomNum);
|
||||
osSyncPrintf(VT_RST);
|
||||
Map_InitData(globalCtx, interfaceCtx->mapRoomNum);
|
||||
Map_InitData(play, interfaceCtx->mapRoomNum);
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
Map_SavePlayerInitialInfo(globalCtx);
|
||||
Map_SavePlayerInitialInfo(play);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,9 +583,9 @@ void Map_Update(GlobalContext* globalCtx) {
|
||||
case SCENE_MIZUSIN_BS:
|
||||
case SCENE_JYASINBOSS:
|
||||
case SCENE_HAKADAN_BS:
|
||||
VREG(30) = gMapData->bossFloor[globalCtx->sceneNum - SCENE_YDAN_BOSS];
|
||||
R_MAP_TEX_INDEX = R_MAP_TEX_INDEX_BASE +
|
||||
gMapData->floorTexIndexOffset[globalCtx->sceneNum - SCENE_YDAN_BOSS][VREG(30)];
|
||||
VREG(30) = gMapData->bossFloor[play->sceneNum - SCENE_YDAN_BOSS];
|
||||
R_MAP_TEX_INDEX =
|
||||
R_MAP_TEX_INDEX_BASE + gMapData->floorTexIndexOffset[play->sceneNum - SCENE_YDAN_BOSS][VREG(30)];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+13
-13
@@ -53,11 +53,11 @@ static MapMarkDataOverlay sMapMarkDataOvl = {
|
||||
|
||||
static MapMarkData** sLoadedMarkDataTable;
|
||||
|
||||
void MapMark_Init(GlobalContext* globalCtx) {
|
||||
void MapMark_Init(PlayState* play) {
|
||||
MapMarkDataOverlay* overlay = &sMapMarkDataOvl;
|
||||
u32 overlaySize = (u32)overlay->vramEnd - (u32)overlay->vramStart;
|
||||
|
||||
overlay->loadedRamAddr = GameState_Alloc(&globalCtx->state, overlaySize, "../z_map_mark.c", 235);
|
||||
overlay->loadedRamAddr = GameState_Alloc(&play->state, overlaySize, "../z_map_mark.c", 235);
|
||||
LogUtils_CheckNullPointer("dlftbl->allocp", overlay->loadedRamAddr, "../z_map_mark.c", 236);
|
||||
|
||||
Overlay_Load(overlay->vromStart, overlay->vromEnd, overlay->vramStart, overlay->vramEnd, overlay->loadedRamAddr);
|
||||
@@ -69,12 +69,12 @@ void MapMark_Init(GlobalContext* globalCtx) {
|
||||
: NULL);
|
||||
}
|
||||
|
||||
void MapMark_ClearPointers(GlobalContext* globalCtx) {
|
||||
void MapMark_ClearPointers(PlayState* play) {
|
||||
sMapMarkDataOvl.loadedRamAddr = NULL;
|
||||
sLoadedMarkDataTable = NULL;
|
||||
}
|
||||
|
||||
void MapMark_DrawForDungeon(GlobalContext* globalCtx) {
|
||||
void MapMark_DrawForDungeon(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx;
|
||||
MapMarkIconData* mapMarkIconData;
|
||||
MapMarkPoint* markPoint;
|
||||
@@ -84,18 +84,18 @@ void MapMark_DrawForDungeon(GlobalContext* globalCtx) {
|
||||
s32 rectLeft;
|
||||
s32 rectTop;
|
||||
|
||||
interfaceCtx = &globalCtx->interfaceCtx;
|
||||
interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
if ((gMapData != NULL) && (globalCtx->interfaceCtx.mapRoomNum >= gMapData->dgnMinimapCount[dungeon])) {
|
||||
if ((gMapData != NULL) && (play->interfaceCtx.mapRoomNum >= gMapData->dgnMinimapCount[dungeon])) {
|
||||
// "Room number exceeded, yikes %d/%d MapMarkDraw processing interrupted"
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n",
|
||||
VT_RST, globalCtx->interfaceCtx.mapRoomNum, gMapData->dgnMinimapCount[dungeon]);
|
||||
VT_RST, play->interfaceCtx.mapRoomNum, gMapData->dgnMinimapCount[dungeon]);
|
||||
return;
|
||||
}
|
||||
|
||||
mapMarkIconData = &sLoadedMarkDataTable[dungeon][interfaceCtx->mapRoomNum][0];
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_map_mark.c", 303);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_map_mark.c", 303);
|
||||
|
||||
while (true) {
|
||||
if (mapMarkIconData->markType == MAP_MARK_NONE) {
|
||||
@@ -109,7 +109,7 @@ void MapMark_DrawForDungeon(GlobalContext* globalCtx) {
|
||||
|
||||
markPoint = &mapMarkIconData->points[0];
|
||||
for (i = 0; i < mapMarkIconData->count; i++) {
|
||||
if ((mapMarkIconData->markType != MAP_MARK_CHEST) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag)) {
|
||||
if ((mapMarkIconData->markType != MAP_MARK_CHEST) || !Flags_GetTreasure(play, markPoint->chestFlag)) {
|
||||
markInfo = &sMapMarkInfoTable[mapMarkIconData->markType];
|
||||
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
@@ -128,11 +128,11 @@ void MapMark_DrawForDungeon(GlobalContext* globalCtx) {
|
||||
mapMarkIconData++;
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_map_mark.c", 339);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_map_mark.c", 339);
|
||||
}
|
||||
|
||||
void MapMark_Draw(GlobalContext* globalCtx) {
|
||||
switch (globalCtx->sceneNum) {
|
||||
void MapMark_Draw(PlayState* play) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_YDAN:
|
||||
case SCENE_DDAN:
|
||||
case SCENE_BDAN:
|
||||
@@ -148,7 +148,7 @@ void MapMark_Draw(GlobalContext* globalCtx) {
|
||||
case SCENE_BDAN_BOSS:
|
||||
case SCENE_MORIBOSSROOM:
|
||||
case SCENE_FIRE_BS:
|
||||
MapMark_DrawForDungeon(globalCtx);
|
||||
MapMark_DrawForDungeon(play);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+214
-217
File diff suppressed because it is too large
Load Diff
+270
-270
File diff suppressed because it is too large
Load Diff
+237
-240
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -1,10 +1,10 @@
|
||||
#include "global.h"
|
||||
|
||||
Path* Path_GetByIndex(GlobalContext* globalCtx, s16 index, s16 max) {
|
||||
Path* Path_GetByIndex(PlayState* play, s16 index, s16 max) {
|
||||
Path* path;
|
||||
|
||||
if (index != max) {
|
||||
path = &globalCtx->setupPathList[index];
|
||||
path = &play->setupPathList[index];
|
||||
} else {
|
||||
path = NULL;
|
||||
}
|
||||
|
||||
+51
-51
@@ -13,13 +13,13 @@ FaultClient D_801614B8;
|
||||
s16 sTransitionFillTimer;
|
||||
u64 D_801614D0[0xA00];
|
||||
|
||||
void Play_SpawnScene(GlobalContext* this, s32 sceneNum, s32 spawn);
|
||||
void Play_SpawnScene(PlayState* this, s32 sceneNum, s32 spawn);
|
||||
|
||||
void func_800BC450(GlobalContext* this) {
|
||||
void func_800BC450(PlayState* this) {
|
||||
Camera_ChangeDataIdx(GET_ACTIVE_CAM(this), this->unk_1242B - 1);
|
||||
}
|
||||
|
||||
void func_800BC490(GlobalContext* this, s16 point) {
|
||||
void func_800BC490(PlayState* this, s16 point) {
|
||||
ASSERT(point == 1 || point == 2, "point == 1 || point == 2", "../z_play.c", 2160);
|
||||
|
||||
this->unk_1242B = point;
|
||||
@@ -32,12 +32,12 @@ void func_800BC490(GlobalContext* this, s16 point) {
|
||||
func_800BC450(this);
|
||||
}
|
||||
|
||||
s32 func_800BC56C(GlobalContext* this, s16 arg1) {
|
||||
s32 func_800BC56C(PlayState* this, s16 arg1) {
|
||||
return (arg1 == this->unk_1242B);
|
||||
}
|
||||
|
||||
// original name: "Game_play_shop_pr_vr_switch_set"
|
||||
void func_800BC590(GlobalContext* this) {
|
||||
void func_800BC590(PlayState* this) {
|
||||
osSyncPrintf("Game_play_shop_pr_vr_switch_set()\n");
|
||||
|
||||
if (YREG(15) == 0x10) {
|
||||
@@ -45,7 +45,7 @@ void func_800BC590(GlobalContext* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void Play_SetupTransition(GlobalContext* this, s32 transitionType) {
|
||||
void Play_SetupTransition(PlayState* this, s32 transitionType) {
|
||||
TransitionContext* transitionCtx = &this->transitionCtx;
|
||||
|
||||
bzero(transitionCtx, sizeof(TransitionContext));
|
||||
@@ -143,17 +143,17 @@ void Play_SetupTransition(GlobalContext* this, s32 transitionType) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_800BC88C(GlobalContext* this) {
|
||||
void func_800BC88C(PlayState* this) {
|
||||
this->transitionCtx.transitionType = -1;
|
||||
}
|
||||
|
||||
Gfx* Play_SetFog(GlobalContext* this, Gfx* gfx) {
|
||||
Gfx* Play_SetFog(PlayState* this, Gfx* gfx) {
|
||||
return Gfx_SetFog2(gfx, this->lightCtx.fogColor[0], this->lightCtx.fogColor[1], this->lightCtx.fogColor[2], 0,
|
||||
this->lightCtx.fogNear, 1000);
|
||||
}
|
||||
|
||||
void Play_Destroy(GameState* thisx) {
|
||||
GlobalContext* this = (GlobalContext*)thisx;
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
Player* player = GET_PLAYER(this);
|
||||
|
||||
this->state.gfxCtx->callback = NULL;
|
||||
@@ -195,7 +195,7 @@ void Play_Destroy(GameState* thisx) {
|
||||
}
|
||||
|
||||
void Play_Init(GameState* thisx) {
|
||||
GlobalContext* this = (GlobalContext*)thisx;
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
GraphicsContext* gfxCtx = this->state.gfxCtx;
|
||||
u32 zAlloc;
|
||||
u32 zAllocAligned;
|
||||
@@ -418,7 +418,7 @@ void Play_Init(GameState* thisx) {
|
||||
}
|
||||
}
|
||||
|
||||
void Play_Update(GlobalContext* this) {
|
||||
void Play_Update(PlayState* this) {
|
||||
s32 pad1;
|
||||
s32 sp80;
|
||||
Input* input;
|
||||
@@ -603,7 +603,7 @@ void Play_Update(GlobalContext* this) {
|
||||
this->state.running = false;
|
||||
|
||||
if (gSaveContext.gameMode != 2) {
|
||||
SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext);
|
||||
SET_NEXT_GAMESTATE(&this->state, Play_Init, PlayState);
|
||||
gSaveContext.entranceIndex = this->nextEntranceIndex;
|
||||
|
||||
if (gSaveContext.minigameState == 1) {
|
||||
@@ -654,7 +654,7 @@ void Play_Update(GlobalContext* this) {
|
||||
|
||||
if (sTransitionFillTimer >= 20) {
|
||||
this->state.running = false;
|
||||
SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext);
|
||||
SET_NEXT_GAMESTATE(&this->state, Play_Init, PlayState);
|
||||
gSaveContext.entranceIndex = this->nextEntranceIndex;
|
||||
this->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
this->transitionMode = TRANS_MODE_OFF;
|
||||
@@ -696,7 +696,7 @@ void Play_Update(GlobalContext* this) {
|
||||
case TRANS_MODE_INSTANT:
|
||||
if (this->transitionTrigger != TRANS_TRIGGER_END) {
|
||||
this->state.running = false;
|
||||
SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext);
|
||||
SET_NEXT_GAMESTATE(&this->state, Play_Init, PlayState);
|
||||
gSaveContext.entranceIndex = this->nextEntranceIndex;
|
||||
this->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
this->transitionMode = TRANS_MODE_OFF;
|
||||
@@ -742,7 +742,7 @@ void Play_Update(GlobalContext* this) {
|
||||
} else {
|
||||
if (this->envCtx.sandstormEnvA == 255) {
|
||||
this->state.running = false;
|
||||
SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext);
|
||||
SET_NEXT_GAMESTATE(&this->state, Play_Init, PlayState);
|
||||
gSaveContext.entranceIndex = this->nextEntranceIndex;
|
||||
this->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
this->transitionMode = TRANS_MODE_OFF;
|
||||
@@ -1073,7 +1073,7 @@ skip:
|
||||
this->state.gfxCtx);
|
||||
}
|
||||
|
||||
void Play_DrawOverlayElements(GlobalContext* this) {
|
||||
void Play_DrawOverlayElements(PlayState* this) {
|
||||
if ((this->pauseCtx.state != 0) || (this->pauseCtx.debugState != 0)) {
|
||||
KaleidoScopeCall_Draw(this);
|
||||
}
|
||||
@@ -1089,7 +1089,7 @@ void Play_DrawOverlayElements(GlobalContext* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void Play_Draw(GlobalContext* this) {
|
||||
void Play_Draw(PlayState* this) {
|
||||
GraphicsContext* gfxCtx = this->state.gfxCtx;
|
||||
Lights* sp228;
|
||||
Vec3f sp21C;
|
||||
@@ -1346,7 +1346,7 @@ void Play_Draw(GlobalContext* this) {
|
||||
}
|
||||
|
||||
void Play_Main(GameState* thisx) {
|
||||
GlobalContext* this = (GlobalContext*)thisx;
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
|
||||
D_8012D1F8 = &this->state.input[0];
|
||||
|
||||
@@ -1389,11 +1389,11 @@ void Play_Main(GameState* thisx) {
|
||||
}
|
||||
|
||||
// original name: "Game_play_demo_mode_check"
|
||||
s32 Play_InCsMode(GlobalContext* this) {
|
||||
s32 Play_InCsMode(PlayState* this) {
|
||||
return (this->csCtx.state != CS_STATE_IDLE) || Player_InCsMode(this);
|
||||
}
|
||||
|
||||
f32 func_800BFCB8(GlobalContext* this, MtxF* mf, Vec3f* vec) {
|
||||
f32 func_800BFCB8(PlayState* this, MtxF* mf, Vec3f* vec) {
|
||||
CollisionPoly poly;
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
@@ -1459,7 +1459,7 @@ f32 func_800BFCB8(GlobalContext* this, MtxF* mf, Vec3f* vec) {
|
||||
return floorY;
|
||||
}
|
||||
|
||||
void* Play_LoadFile(GlobalContext* this, RomFile* file) {
|
||||
void* Play_LoadFile(PlayState* this, RomFile* file) {
|
||||
u32 size;
|
||||
void* allocp;
|
||||
|
||||
@@ -1470,12 +1470,12 @@ void* Play_LoadFile(GlobalContext* this, RomFile* file) {
|
||||
return allocp;
|
||||
}
|
||||
|
||||
void Play_InitEnvironment(GlobalContext* this, s16 skyboxId) {
|
||||
void Play_InitEnvironment(PlayState* this, s16 skyboxId) {
|
||||
Skybox_Init(&this->state, &this->skyboxCtx, skyboxId);
|
||||
Environment_Init(this, &this->envCtx, 0);
|
||||
}
|
||||
|
||||
void Play_InitScene(GlobalContext* this, s32 spawn) {
|
||||
void Play_InitScene(PlayState* this, s32 spawn) {
|
||||
this->curSpawn = spawn;
|
||||
this->linkActorEntry = NULL;
|
||||
this->unk_11DFC = NULL;
|
||||
@@ -1494,7 +1494,7 @@ void Play_InitScene(GlobalContext* this, s32 spawn) {
|
||||
Play_InitEnvironment(this, this->skyboxId);
|
||||
}
|
||||
|
||||
void Play_SpawnScene(GlobalContext* this, s32 sceneNum, s32 spawn) {
|
||||
void Play_SpawnScene(PlayState* this, s32 sceneNum, s32 spawn) {
|
||||
SceneTableEntry* scene = &gSceneTable[sceneNum];
|
||||
|
||||
scene->unk_13 = 0;
|
||||
@@ -1515,7 +1515,7 @@ void Play_SpawnScene(GlobalContext* this, s32 sceneNum, s32 spawn) {
|
||||
osSyncPrintf("ROOM SIZE=%fK\n", func_80096FE8(this, &this->roomCtx) / 1024.0f);
|
||||
}
|
||||
|
||||
void Play_GetScreenPos(GlobalContext* this, Vec3f* src, Vec3f* dest) {
|
||||
void Play_GetScreenPos(PlayState* this, Vec3f* src, Vec3f* dest) {
|
||||
f32 w;
|
||||
|
||||
Matrix_Mult(&this->viewProjectionMtxF, MTXMODE_NEW);
|
||||
@@ -1528,7 +1528,7 @@ void Play_GetScreenPos(GlobalContext* this, Vec3f* src, Vec3f* dest) {
|
||||
dest->y = (SCREEN_HEIGHT / 2) - ((dest->y / w) * (SCREEN_HEIGHT / 2));
|
||||
}
|
||||
|
||||
s16 Play_CreateSubCamera(GlobalContext* this) {
|
||||
s16 Play_CreateSubCamera(PlayState* this) {
|
||||
s16 i;
|
||||
|
||||
for (i = CAM_ID_SUB_FIRST; i < NUM_CAMS; i++) {
|
||||
@@ -1553,11 +1553,11 @@ s16 Play_CreateSubCamera(GlobalContext* this) {
|
||||
return i;
|
||||
}
|
||||
|
||||
s16 Play_GetActiveCamId(GlobalContext* this) {
|
||||
s16 Play_GetActiveCamId(PlayState* this) {
|
||||
return this->activeCamId;
|
||||
}
|
||||
|
||||
s16 Play_ChangeCameraStatus(GlobalContext* this, s16 camId, s16 status) {
|
||||
s16 Play_ChangeCameraStatus(PlayState* this, s16 camId, s16 status) {
|
||||
s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId;
|
||||
|
||||
if (status == CAM_STAT_ACTIVE) {
|
||||
@@ -1567,7 +1567,7 @@ s16 Play_ChangeCameraStatus(GlobalContext* this, s16 camId, s16 status) {
|
||||
return Camera_ChangeStatus(this->cameraPtrs[camIdx], status);
|
||||
}
|
||||
|
||||
void Play_ClearCamera(GlobalContext* this, s16 camId) {
|
||||
void Play_ClearCamera(PlayState* this, s16 camId) {
|
||||
s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId;
|
||||
|
||||
if (camIdx == CAM_ID_MAIN) {
|
||||
@@ -1585,7 +1585,7 @@ void Play_ClearCamera(GlobalContext* this, s16 camId) {
|
||||
}
|
||||
}
|
||||
|
||||
void Play_ClearAllSubCameras(GlobalContext* this) {
|
||||
void Play_ClearAllSubCameras(PlayState* this) {
|
||||
s16 subCamId;
|
||||
|
||||
for (subCamId = CAM_ID_SUB_FIRST; subCamId < NUM_CAMS; subCamId++) {
|
||||
@@ -1597,13 +1597,13 @@ void Play_ClearAllSubCameras(GlobalContext* this) {
|
||||
this->activeCamId = CAM_ID_MAIN;
|
||||
}
|
||||
|
||||
Camera* Play_GetCamera(GlobalContext* this, s16 camId) {
|
||||
Camera* Play_GetCamera(PlayState* this, s16 camId) {
|
||||
s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId;
|
||||
|
||||
return this->cameraPtrs[camIdx];
|
||||
}
|
||||
|
||||
s32 Play_CameraSetAtEye(GlobalContext* this, s16 camId, Vec3f* at, Vec3f* eye) {
|
||||
s32 Play_CameraSetAtEye(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye) {
|
||||
s32 ret = 0;
|
||||
s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId;
|
||||
Camera* camera = this->cameraPtrs[camIdx];
|
||||
@@ -1629,7 +1629,7 @@ s32 Play_CameraSetAtEye(GlobalContext* this, s16 camId, Vec3f* at, Vec3f* eye) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
s32 Play_CameraSetAtEyeUp(GlobalContext* this, s16 camId, Vec3f* at, Vec3f* eye, Vec3f* up) {
|
||||
s32 Play_CameraSetAtEyeUp(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye, Vec3f* up) {
|
||||
s32 ret = 0;
|
||||
s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId;
|
||||
Camera* camera = this->cameraPtrs[camIdx];
|
||||
@@ -1657,14 +1657,14 @@ s32 Play_CameraSetAtEyeUp(GlobalContext* this, s16 camId, Vec3f* at, Vec3f* eye,
|
||||
return ret;
|
||||
}
|
||||
|
||||
s32 Play_CameraSetFov(GlobalContext* this, s16 camId, f32 fov) {
|
||||
s32 Play_CameraSetFov(PlayState* this, s16 camId, f32 fov) {
|
||||
s32 ret = Camera_SetParam(this->cameraPtrs[camId], 0x20, &fov) & 1;
|
||||
|
||||
if (1) {}
|
||||
return ret;
|
||||
}
|
||||
|
||||
s32 Play_SetCameraRoll(GlobalContext* this, s16 camId, s16 roll) {
|
||||
s32 Play_SetCameraRoll(PlayState* this, s16 camId, s16 roll) {
|
||||
s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId;
|
||||
Camera* camera = this->cameraPtrs[camIdx];
|
||||
|
||||
@@ -1673,14 +1673,14 @@ s32 Play_SetCameraRoll(GlobalContext* this, s16 camId, s16 roll) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void Play_CopyCamera(GlobalContext* this, s16 destCamId, s16 srcCamId) {
|
||||
void Play_CopyCamera(PlayState* this, s16 destCamId, s16 srcCamId) {
|
||||
s16 srcCamId2 = (srcCamId == CAM_ID_NONE) ? this->activeCamId : srcCamId;
|
||||
s16 destCamId1 = (destCamId == CAM_ID_NONE) ? this->activeCamId : destCamId;
|
||||
|
||||
Camera_Copy(this->cameraPtrs[destCamId1], this->cameraPtrs[srcCamId2]);
|
||||
}
|
||||
|
||||
s32 func_800C0808(GlobalContext* this, s16 camId, Player* player, s16 setting) {
|
||||
s32 func_800C0808(PlayState* this, s16 camId, Player* player, s16 setting) {
|
||||
Camera* camera;
|
||||
s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId;
|
||||
|
||||
@@ -1689,11 +1689,11 @@ s32 func_800C0808(GlobalContext* this, s16 camId, Player* player, s16 setting) {
|
||||
return Camera_ChangeSetting(camera, setting);
|
||||
}
|
||||
|
||||
s32 Play_CameraChangeSetting(GlobalContext* this, s16 camId, s16 setting) {
|
||||
s32 Play_CameraChangeSetting(PlayState* this, s16 camId, s16 setting) {
|
||||
return Camera_ChangeSetting(Play_GetCamera(this, camId), setting);
|
||||
}
|
||||
|
||||
void func_800C08AC(GlobalContext* this, s16 camId, s16 arg2) {
|
||||
void func_800C08AC(PlayState* this, s16 camId, s16 arg2) {
|
||||
s16 camIdx = (camId == CAM_ID_NONE) ? this->activeCamId : camId;
|
||||
s16 i;
|
||||
|
||||
@@ -1716,7 +1716,7 @@ void func_800C08AC(GlobalContext* this, s16 camId, s16 arg2) {
|
||||
}
|
||||
}
|
||||
|
||||
s16 Play_CameraGetUID(GlobalContext* this, s16 camId) {
|
||||
s16 Play_CameraGetUID(PlayState* this, s16 camId) {
|
||||
Camera* camera = this->cameraPtrs[camId];
|
||||
|
||||
if (camera != NULL) {
|
||||
@@ -1726,7 +1726,7 @@ s16 Play_CameraGetUID(GlobalContext* this, s16 camId) {
|
||||
}
|
||||
}
|
||||
|
||||
s16 func_800C09D8(GlobalContext* this, s16 camId, s16 arg2) {
|
||||
s16 func_800C09D8(PlayState* this, s16 camId, s16 arg2) {
|
||||
Camera* camera = this->cameraPtrs[camId];
|
||||
|
||||
if (camera != NULL) {
|
||||
@@ -1740,7 +1740,7 @@ s16 func_800C09D8(GlobalContext* this, s16 camId, s16 arg2) {
|
||||
}
|
||||
}
|
||||
|
||||
void Play_SaveSceneFlags(GlobalContext* this) {
|
||||
void Play_SaveSceneFlags(PlayState* this) {
|
||||
SavedSceneFlags* savedSceneFlags = &gSaveContext.sceneFlags[this->sceneNum];
|
||||
|
||||
savedSceneFlags->chest = this->actorCtx.flags.chest;
|
||||
@@ -1749,7 +1749,7 @@ void Play_SaveSceneFlags(GlobalContext* this) {
|
||||
savedSceneFlags->collect = this->actorCtx.flags.collect;
|
||||
}
|
||||
|
||||
void Play_SetRespawnData(GlobalContext* this, s32 respawnMode, s16 entranceIndex, s32 roomIndex, s32 playerParams,
|
||||
void Play_SetRespawnData(PlayState* this, s32 respawnMode, s16 entranceIndex, s32 roomIndex, s32 playerParams,
|
||||
Vec3f* pos, s16 yaw) {
|
||||
RespawnData* respawnData = &gSaveContext.respawn[respawnMode];
|
||||
|
||||
@@ -1762,7 +1762,7 @@ void Play_SetRespawnData(GlobalContext* this, s32 respawnMode, s16 entranceIndex
|
||||
respawnData->tempCollectFlags = this->actorCtx.flags.tempCollect;
|
||||
}
|
||||
|
||||
void Play_SetupRespawnPoint(GlobalContext* this, s32 respawnMode, s32 playerParams) {
|
||||
void Play_SetupRespawnPoint(PlayState* this, s32 respawnMode, s32 playerParams) {
|
||||
Player* player = GET_PLAYER(this);
|
||||
s32 entranceIndex;
|
||||
s8 roomIndex;
|
||||
@@ -1775,7 +1775,7 @@ void Play_SetupRespawnPoint(GlobalContext* this, s32 respawnMode, s32 playerPara
|
||||
}
|
||||
}
|
||||
|
||||
void Play_TriggerVoidOut(GlobalContext* this) {
|
||||
void Play_TriggerVoidOut(PlayState* this) {
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags = this->actorCtx.flags.tempSwch;
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = this->actorCtx.flags.tempCollect;
|
||||
gSaveContext.respawnFlag = 1;
|
||||
@@ -1784,7 +1784,7 @@ void Play_TriggerVoidOut(GlobalContext* this) {
|
||||
this->transitionType = TRANS_TYPE_FADE_BLACK;
|
||||
}
|
||||
|
||||
void Play_LoadToLastEntrance(GlobalContext* this) {
|
||||
void Play_LoadToLastEntrance(PlayState* this) {
|
||||
gSaveContext.respawnFlag = -1;
|
||||
this->transitionTrigger = TRANS_TRIGGER_START;
|
||||
|
||||
@@ -1802,21 +1802,21 @@ void Play_LoadToLastEntrance(GlobalContext* this) {
|
||||
this->transitionType = TRANS_TYPE_FADE_BLACK;
|
||||
}
|
||||
|
||||
void Play_TriggerRespawn(GlobalContext* this) {
|
||||
void Play_TriggerRespawn(PlayState* this) {
|
||||
Play_SetupRespawnPoint(this, RESPAWN_MODE_DOWN, 0xDFF);
|
||||
Play_LoadToLastEntrance(this);
|
||||
}
|
||||
|
||||
s32 func_800C0CB8(GlobalContext* this) {
|
||||
s32 func_800C0CB8(PlayState* this) {
|
||||
return (this->roomCtx.curRoom.meshHeader->base.type != 1) && (YREG(15) != 0x20) && (YREG(15) != 0x30) &&
|
||||
(YREG(15) != 0x40) && (this->sceneNum != SCENE_HAIRAL_NIWA);
|
||||
}
|
||||
|
||||
s32 FrameAdvance_IsEnabled(GlobalContext* this) {
|
||||
s32 FrameAdvance_IsEnabled(PlayState* this) {
|
||||
return !!this->frameAdvCtx.enabled;
|
||||
}
|
||||
|
||||
s32 func_800C0D34(GlobalContext* this, Actor* actor, s16* yaw) {
|
||||
s32 func_800C0D34(PlayState* this, Actor* actor, s16* yaw) {
|
||||
TransitionActorEntry* transitionActor;
|
||||
s32 frontRoom;
|
||||
|
||||
@@ -1840,7 +1840,7 @@ s32 func_800C0D34(GlobalContext* this, Actor* actor, s16* yaw) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_800C0DB4(GlobalContext* this, Vec3f* pos) {
|
||||
s32 func_800C0DB4(PlayState* this, Vec3f* pos) {
|
||||
WaterBox* waterBox;
|
||||
CollisionPoly* poly;
|
||||
Vec3f waterSurfacePos;
|
||||
|
||||
+20
-20
@@ -2,20 +2,20 @@
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25 | ACTOR_FLAG_26)
|
||||
|
||||
void (*sPlayerCallInitFunc)(Actor* thisx, GlobalContext* globalCtx);
|
||||
void (*sPlayerCallDestroyFunc)(Actor* thisx, GlobalContext* globalCtx);
|
||||
void (*sPlayerCallUpdateFunc)(Actor* thisx, GlobalContext* globalCtx);
|
||||
void (*sPlayerCallDrawFunc)(Actor* thisx, GlobalContext* globalCtx);
|
||||
void (*sPlayerCallInitFunc)(Actor* thisx, PlayState* play);
|
||||
void (*sPlayerCallDestroyFunc)(Actor* thisx, PlayState* play);
|
||||
void (*sPlayerCallUpdateFunc)(Actor* thisx, PlayState* play);
|
||||
void (*sPlayerCallDrawFunc)(Actor* thisx, PlayState* play);
|
||||
|
||||
void PlayerCall_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void PlayerCall_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void PlayerCall_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void PlayerCall_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void PlayerCall_Init(Actor* thisx, PlayState* play);
|
||||
void PlayerCall_Destroy(Actor* thisx, PlayState* play);
|
||||
void PlayerCall_Update(Actor* thisx, PlayState* play);
|
||||
void PlayerCall_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void Player_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void Player_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void Player_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void Player_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void Player_Init(Actor* thisx, PlayState* play);
|
||||
void Player_Destroy(Actor* thisx, PlayState* play);
|
||||
void Player_Update(Actor* thisx, PlayState* play);
|
||||
void Player_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
const ActorInit Player_InitVars = {
|
||||
ACTOR_PLAYER,
|
||||
@@ -36,23 +36,23 @@ void PlayerCall_InitFuncPtrs(void) {
|
||||
sPlayerCallDrawFunc = KaleidoManager_GetRamAddr(Player_Draw);
|
||||
}
|
||||
|
||||
void PlayerCall_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void PlayerCall_Init(Actor* thisx, PlayState* play) {
|
||||
KaleidoScopeCall_LoadPlayer();
|
||||
PlayerCall_InitFuncPtrs();
|
||||
sPlayerCallInitFunc(thisx, globalCtx);
|
||||
sPlayerCallInitFunc(thisx, play);
|
||||
}
|
||||
|
||||
void PlayerCall_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void PlayerCall_Destroy(Actor* thisx, PlayState* play) {
|
||||
KaleidoScopeCall_LoadPlayer();
|
||||
sPlayerCallDestroyFunc(thisx, globalCtx);
|
||||
sPlayerCallDestroyFunc(thisx, play);
|
||||
}
|
||||
|
||||
void PlayerCall_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void PlayerCall_Update(Actor* thisx, PlayState* play) {
|
||||
KaleidoScopeCall_LoadPlayer();
|
||||
sPlayerCallUpdateFunc(thisx, globalCtx);
|
||||
sPlayerCallUpdateFunc(thisx, play);
|
||||
}
|
||||
|
||||
void PlayerCall_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void PlayerCall_Draw(Actor* thisx, PlayState* play) {
|
||||
KaleidoScopeCall_LoadPlayer();
|
||||
sPlayerCallDrawFunc(thisx, globalCtx);
|
||||
sPlayerCallDrawFunc(thisx, play);
|
||||
}
|
||||
|
||||
+115
-119
@@ -435,7 +435,7 @@ Vec3f sGetItemRefPos;
|
||||
s32 sLeftHandType;
|
||||
s32 sRightHandType;
|
||||
|
||||
void Player_SetBootData(GlobalContext* globalCtx, Player* this) {
|
||||
void Player_SetBootData(PlayState* play, Player* this) {
|
||||
s32 currentBoots;
|
||||
s16* bootRegs;
|
||||
|
||||
@@ -474,22 +474,22 @@ void Player_SetBootData(GlobalContext* globalCtx, Player* this) {
|
||||
IREG(69) = bootRegs[15];
|
||||
MREG(95) = bootRegs[16];
|
||||
|
||||
if (globalCtx->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_2) {
|
||||
if (play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_2) {
|
||||
REG(45) = 500;
|
||||
}
|
||||
}
|
||||
|
||||
s32 Player_InBlockingCsMode(GlobalContext* globalCtx, Player* this) {
|
||||
s32 Player_InBlockingCsMode(PlayState* play, Player* this) {
|
||||
return (this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_29)) || (this->csMode != 0) ||
|
||||
(globalCtx->transitionTrigger == TRANS_TRIGGER_START) || (this->stateFlags1 & PLAYER_STATE1_0) ||
|
||||
(play->transitionTrigger == TRANS_TRIGGER_START) || (this->stateFlags1 & PLAYER_STATE1_0) ||
|
||||
(this->stateFlags3 & PLAYER_STATE3_7) ||
|
||||
((gSaveContext.unk_13F0 != 0) && (Player_ActionToMagicSpell(this, this->itemActionParam) >= 0));
|
||||
}
|
||||
|
||||
s32 Player_InCsMode(GlobalContext* globalCtx) {
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
s32 Player_InCsMode(PlayState* play) {
|
||||
Player* this = GET_PLAYER(play);
|
||||
|
||||
return Player_InBlockingCsMode(globalCtx, this) || (this->unk_6AD == 4);
|
||||
return Player_InBlockingCsMode(play, this) || (this->unk_6AD == 4);
|
||||
}
|
||||
|
||||
s32 func_8008E9C4(Player* this) {
|
||||
@@ -568,19 +568,19 @@ void func_8008EC70(Player* this) {
|
||||
this->unk_6AD = 0;
|
||||
}
|
||||
|
||||
void Player_SetEquipmentData(GlobalContext* globalCtx, Player* this) {
|
||||
void Player_SetEquipmentData(PlayState* play, Player* this) {
|
||||
if (this->csMode != 0x56) {
|
||||
this->currentShield = SHIELD_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_SHIELD));
|
||||
this->currentTunic = TUNIC_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_TUNIC));
|
||||
this->currentBoots = BOOTS_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_BOOTS));
|
||||
this->currentSwordItemId = B_BTN_ITEM;
|
||||
Player_SetModelGroup(this, Player_ActionToModelGroup(this, this->heldItemActionParam));
|
||||
Player_SetBootData(globalCtx, this);
|
||||
Player_SetBootData(play, this);
|
||||
}
|
||||
}
|
||||
|
||||
void Player_UpdateBottleHeld(GlobalContext* globalCtx, Player* this, s32 item, s32 actionParam) {
|
||||
Inventory_UpdateBottleItem(globalCtx, item, this->heldItemButton);
|
||||
void Player_UpdateBottleHeld(PlayState* play, Player* this, s32 item, s32 actionParam) {
|
||||
Inventory_UpdateBottleItem(play, item, this->heldItemButton);
|
||||
|
||||
if (item != ITEM_BOTTLE) {
|
||||
this->heldItemId = item;
|
||||
@@ -609,30 +609,30 @@ void func_8008EE08(Player* this) {
|
||||
func_8008EDF0(this);
|
||||
}
|
||||
|
||||
void func_8008EEAC(GlobalContext* globalCtx, Actor* actor) {
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
void func_8008EEAC(PlayState* play, Actor* actor) {
|
||||
Player* this = GET_PLAYER(play);
|
||||
|
||||
func_8008EE08(this);
|
||||
this->unk_664 = actor;
|
||||
this->unk_684 = actor;
|
||||
this->stateFlags1 |= PLAYER_STATE1_16;
|
||||
Camera_SetParam(Play_GetCamera(globalCtx, CAM_ID_MAIN), 8, actor);
|
||||
Camera_ChangeMode(Play_GetCamera(globalCtx, CAM_ID_MAIN), CAM_MODE_FOLLOWTARGET);
|
||||
Camera_SetParam(Play_GetCamera(play, CAM_ID_MAIN), 8, actor);
|
||||
Camera_ChangeMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_FOLLOWTARGET);
|
||||
}
|
||||
|
||||
s32 func_8008EF30(GlobalContext* globalCtx) {
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
s32 func_8008EF30(PlayState* play) {
|
||||
Player* this = GET_PLAYER(play);
|
||||
|
||||
return (this->stateFlags1 & PLAYER_STATE1_23);
|
||||
}
|
||||
|
||||
s32 func_8008EF44(GlobalContext* globalCtx, s32 ammo) {
|
||||
globalCtx->shootingGalleryStatus = ammo + 1;
|
||||
s32 func_8008EF44(PlayState* play, s32 ammo) {
|
||||
play->shootingGalleryStatus = ammo + 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 Player_IsBurningStickInRange(GlobalContext* globalCtx, Vec3f* pos, f32 xzRange, f32 yRange) {
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
s32 Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 yRange) {
|
||||
Player* this = GET_PLAYER(play);
|
||||
Vec3f diff;
|
||||
s32 pad;
|
||||
|
||||
@@ -656,28 +656,28 @@ s32 Player_GetStrength(void) {
|
||||
}
|
||||
}
|
||||
|
||||
u8 Player_GetMask(GlobalContext* globalCtx) {
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
u8 Player_GetMask(PlayState* play) {
|
||||
Player* this = GET_PLAYER(play);
|
||||
|
||||
return this->currentMask;
|
||||
}
|
||||
|
||||
Player* Player_UnsetMask(GlobalContext* globalCtx) {
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
Player* Player_UnsetMask(PlayState* play) {
|
||||
Player* this = GET_PLAYER(play);
|
||||
|
||||
this->currentMask = PLAYER_MASK_NONE;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
s32 Player_HasMirrorShieldEquipped(GlobalContext* globalCtx) {
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
s32 Player_HasMirrorShieldEquipped(PlayState* play) {
|
||||
Player* this = GET_PLAYER(play);
|
||||
|
||||
return (this->currentShield == PLAYER_SHIELD_MIRROR);
|
||||
}
|
||||
|
||||
s32 Player_HasMirrorShieldSetToDraw(GlobalContext* globalCtx) {
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
s32 Player_HasMirrorShieldSetToDraw(PlayState* play) {
|
||||
Player* this = GET_PLAYER(play);
|
||||
|
||||
return (this->rightHandType == PLAYER_MODELTYPE_RH_SHIELD) && (this->currentShield == PLAYER_SHIELD_MIRROR);
|
||||
}
|
||||
@@ -770,12 +770,12 @@ return_neg:
|
||||
return -1;
|
||||
}
|
||||
|
||||
s32 func_8008F2F8(GlobalContext* globalCtx) {
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
s32 func_8008F2F8(PlayState* play) {
|
||||
Player* this = GET_PLAYER(play);
|
||||
TextTriggerEntry* triggerEntry;
|
||||
s32 var;
|
||||
|
||||
if (globalCtx->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) { // Room is hot
|
||||
if (play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) { // Room is hot
|
||||
var = 0;
|
||||
} else if ((this->unk_840 > 80) &&
|
||||
((this->currentBoots == PLAYER_BOOTS_IRON) || (this->unk_840 >= 300))) { // Deep underwater
|
||||
@@ -787,7 +787,7 @@ s32 func_8008F2F8(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
// Trigger general textboxes under certain conditions, like "It's so hot in here!"
|
||||
if (!Player_InCsMode(globalCtx)) {
|
||||
if (!Player_InCsMode(play)) {
|
||||
triggerEntry = &sTextTriggers[var];
|
||||
|
||||
if (0) {}
|
||||
@@ -796,7 +796,7 @@ s32 func_8008F2F8(GlobalContext* globalCtx) {
|
||||
(((var == 0) && (this->currentTunic != PLAYER_TUNIC_GORON)) ||
|
||||
(((var == 1) || (var == 3)) && (this->currentBoots == PLAYER_BOOTS_IRON) &&
|
||||
(this->currentTunic != PLAYER_TUNIC_ZORA)))) {
|
||||
Message_StartTextbox(globalCtx, triggerEntry->textId, NULL);
|
||||
Message_StartTextbox(play, triggerEntry->textId, NULL);
|
||||
gSaveContext.textTriggerFlags |= triggerEntry->flag;
|
||||
}
|
||||
}
|
||||
@@ -858,14 +858,13 @@ Gfx* sBootDListGroups[][2] = {
|
||||
{ gLinkAdultLeftHoverBootDL, gLinkAdultRightHoverBootDL }, // PLAYER_BOOTS_HOVER
|
||||
};
|
||||
|
||||
void Player_DrawImpl(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, s32 tunic,
|
||||
s32 boots, s32 face, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
|
||||
void* data) {
|
||||
void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, s32 tunic, s32 boots,
|
||||
s32 face, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* data) {
|
||||
Color_RGB8* color;
|
||||
s32 eyeIndex = (jointTable[22].x & 0xF) - 1;
|
||||
s32 mouthIndex = (jointTable[22].x >> 4) - 1;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 1721);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 1721);
|
||||
|
||||
if (eyeIndex < 0) {
|
||||
eyeIndex = sEyeMouthIndices[face][0];
|
||||
@@ -892,7 +891,7 @@ void Player_DrawImpl(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTabl
|
||||
|
||||
sDListsLodOffset = lod * 2;
|
||||
|
||||
SkelAnime_DrawFlexLod(globalCtx, skeleton, jointTable, dListCount, overrideLimbDraw, postLimbDraw, data, lod);
|
||||
SkelAnime_DrawFlexLod(play, skeleton, jointTable, dListCount, overrideLimbDraw, postLimbDraw, data, lod);
|
||||
|
||||
if ((overrideLimbDraw != Player_OverrideLimbDrawGameplayFirstPerson) &&
|
||||
(overrideLimbDraw != Player_OverrideLimbDrawGameplay_80090440) && (gSaveContext.gameMode != 3)) {
|
||||
@@ -928,7 +927,7 @@ void Player_DrawImpl(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTabl
|
||||
}
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 1803);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_player_lib.c", 1803);
|
||||
}
|
||||
|
||||
Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f };
|
||||
@@ -945,8 +944,8 @@ f32 D_80126068[] = { 5.0f, 3.0f };
|
||||
|
||||
Vec3f D_80126070 = { 0.0f, -300.0f, 0.0f };
|
||||
|
||||
void func_8008F87C(GlobalContext* globalCtx, Player* this, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot,
|
||||
s32 thighLimbIndex, s32 shinLimbIndex, s32 footLimbIndex) {
|
||||
void func_8008F87C(PlayState* play, Player* this, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot, s32 thighLimbIndex,
|
||||
s32 shinLimbIndex, s32 footLimbIndex) {
|
||||
Vec3f spA4;
|
||||
Vec3f sp98;
|
||||
Vec3f footprintPos;
|
||||
@@ -988,7 +987,7 @@ void func_8008F87C(GlobalContext* globalCtx, Player* this, SkelAnime* skelAnime,
|
||||
|
||||
footprintPos.y += 15.0f;
|
||||
|
||||
sp80 = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &sp88, &sp84, &this->actor, &footprintPos) + sp74;
|
||||
sp80 = BgCheck_EntityRaycastFloor4(&play->colCtx, &sp88, &sp84, &this->actor, &footprintPos) + sp74;
|
||||
|
||||
if (sp98.y < sp80) {
|
||||
sp70 = sp98.x - spA4.x;
|
||||
@@ -1028,17 +1027,17 @@ void func_8008F87C(GlobalContext* globalCtx, Player* this, SkelAnime* skelAnime,
|
||||
skelAnime->jointTable[shinLimbIndex].z = skelAnime->jointTable[shinLimbIndex].z + temp1;
|
||||
skelAnime->jointTable[footLimbIndex].z = skelAnime->jointTable[footLimbIndex].z + temp2 - temp1;
|
||||
|
||||
temp3 = func_80041D4C(&globalCtx->colCtx, sp88, sp84);
|
||||
temp3 = func_80041D4C(&play->colCtx, sp88, sp84);
|
||||
|
||||
if ((temp3 >= 2) && (temp3 < 4) && !SurfaceType_IsWallDamage(&globalCtx->colCtx, sp88, sp84)) {
|
||||
if ((temp3 >= 2) && (temp3 < 4) && !SurfaceType_IsWallDamage(&play->colCtx, sp88, sp84)) {
|
||||
footprintPos.y = sp80;
|
||||
EffectSsGFire_Spawn(globalCtx, &footprintPos);
|
||||
EffectSsGFire_Spawn(play, &footprintPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 Player_OverrideLimbDrawGameplayCommon(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
void* thisx) {
|
||||
Player* this = (Player*)thisx;
|
||||
|
||||
@@ -1097,10 +1096,10 @@ s32 Player_OverrideLimbDrawGameplayCommon(GlobalContext* globalCtx, s32 limbInde
|
||||
Matrix_RotateZ(BINANG_TO_RAD(this->unk_6C0), MTXMODE_APPLY);
|
||||
}
|
||||
} else if (limbIndex == PLAYER_LIMB_L_THIGH) {
|
||||
func_8008F87C(globalCtx, this, &this->skelAnime, pos, rot, PLAYER_LIMB_L_THIGH, PLAYER_LIMB_L_SHIN,
|
||||
func_8008F87C(play, this, &this->skelAnime, pos, rot, PLAYER_LIMB_L_THIGH, PLAYER_LIMB_L_SHIN,
|
||||
PLAYER_LIMB_L_FOOT);
|
||||
} else if (limbIndex == PLAYER_LIMB_R_THIGH) {
|
||||
func_8008F87C(globalCtx, this, &this->skelAnime, pos, rot, PLAYER_LIMB_R_THIGH, PLAYER_LIMB_R_SHIN,
|
||||
func_8008F87C(play, this, &this->skelAnime, pos, rot, PLAYER_LIMB_R_THIGH, PLAYER_LIMB_R_SHIN,
|
||||
PLAYER_LIMB_R_FOOT);
|
||||
return false;
|
||||
} else {
|
||||
@@ -1111,11 +1110,11 @@ s32 Player_OverrideLimbDrawGameplayCommon(GlobalContext* globalCtx, s32 limbInde
|
||||
return false;
|
||||
}
|
||||
|
||||
s32 Player_OverrideLimbDrawGameplayDefault(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
void* thisx) {
|
||||
Player* this = (Player*)thisx;
|
||||
|
||||
if (!Player_OverrideLimbDrawGameplayCommon(globalCtx, limbIndex, dList, pos, rot, thisx)) {
|
||||
if (!Player_OverrideLimbDrawGameplayCommon(play, limbIndex, dList, pos, rot, thisx)) {
|
||||
if (limbIndex == PLAYER_LIMB_L_HAND) {
|
||||
Gfx** dLists = this->leftHandDLists;
|
||||
|
||||
@@ -1168,11 +1167,11 @@ s32 Player_OverrideLimbDrawGameplayDefault(GlobalContext* globalCtx, s32 limbInd
|
||||
return false;
|
||||
}
|
||||
|
||||
s32 Player_OverrideLimbDrawGameplayFirstPerson(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos,
|
||||
Vec3s* rot, void* thisx) {
|
||||
s32 Player_OverrideLimbDrawGameplayFirstPerson(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
void* thisx) {
|
||||
Player* this = (Player*)thisx;
|
||||
|
||||
if (!Player_OverrideLimbDrawGameplayCommon(globalCtx, limbIndex, dList, pos, rot, thisx)) {
|
||||
if (!Player_OverrideLimbDrawGameplayCommon(play, limbIndex, dList, pos, rot, thisx)) {
|
||||
if (this->unk_6AD != 2) {
|
||||
*dList = NULL;
|
||||
} else if (limbIndex == PLAYER_LIMB_L_FOREARM) {
|
||||
@@ -1194,20 +1193,19 @@ s32 Player_OverrideLimbDrawGameplayFirstPerson(GlobalContext* globalCtx, s32 lim
|
||||
return false;
|
||||
}
|
||||
|
||||
s32 Player_OverrideLimbDrawGameplay_80090440(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos,
|
||||
Vec3s* rot, void* thisx) {
|
||||
if (!Player_OverrideLimbDrawGameplayCommon(globalCtx, limbIndex, dList, pos, rot, thisx)) {
|
||||
s32 Player_OverrideLimbDrawGameplay_80090440(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
void* thisx) {
|
||||
if (!Player_OverrideLimbDrawGameplayCommon(play, limbIndex, dList, pos, rot, thisx)) {
|
||||
*dList = NULL;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
u8 func_80090480(GlobalContext* globalCtx, ColliderQuad* collider, WeaponInfo* weaponInfo, Vec3f* newTip,
|
||||
Vec3f* newBase) {
|
||||
u8 func_80090480(PlayState* play, ColliderQuad* collider, WeaponInfo* weaponInfo, Vec3f* newTip, Vec3f* newBase) {
|
||||
if (weaponInfo->active == 0) {
|
||||
if (collider != NULL) {
|
||||
Collider_ResetQuadAT(globalCtx, &collider->base);
|
||||
Collider_ResetQuadAT(play, &collider->base);
|
||||
}
|
||||
Math_Vec3f_Copy(&weaponInfo->tip, newTip);
|
||||
Math_Vec3f_Copy(&weaponInfo->base, newBase);
|
||||
@@ -1217,13 +1215,13 @@ u8 func_80090480(GlobalContext* globalCtx, ColliderQuad* collider, WeaponInfo* w
|
||||
(weaponInfo->tip.z == newTip->z) && (weaponInfo->base.x == newBase->x) &&
|
||||
(weaponInfo->base.y == newBase->y) && (weaponInfo->base.z == newBase->z)) {
|
||||
if (collider != NULL) {
|
||||
Collider_ResetQuadAT(globalCtx, &collider->base);
|
||||
Collider_ResetQuadAT(play, &collider->base);
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
if (collider != NULL) {
|
||||
Collider_SetQuadVertices(collider, newBase, newTip, &weaponInfo->base, &weaponInfo->tip);
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &collider->base);
|
||||
CollisionCheck_SetAT(play, &play->colChkCtx, &collider->base);
|
||||
}
|
||||
Math_Vec3f_Copy(&weaponInfo->base, newBase);
|
||||
Math_Vec3f_Copy(&weaponInfo->tip, newTip);
|
||||
@@ -1232,7 +1230,7 @@ u8 func_80090480(GlobalContext* globalCtx, ColliderQuad* collider, WeaponInfo* w
|
||||
}
|
||||
}
|
||||
|
||||
void func_80090604(GlobalContext* globalCtx, Player* this, ColliderQuad* collider, Vec3f* quadSrc) {
|
||||
void func_80090604(PlayState* play, Player* this, ColliderQuad* collider, Vec3f* quadSrc) {
|
||||
static u8 shieldColTypes[PLAYER_SHIELD_MAX] = {
|
||||
COLTYPE_METAL,
|
||||
COLTYPE_WOOD,
|
||||
@@ -1251,8 +1249,8 @@ void func_80090604(GlobalContext* globalCtx, Player* this, ColliderQuad* collide
|
||||
Matrix_MultVec3f(&quadSrc[3], &quadDest[3]);
|
||||
Collider_SetQuadVertices(collider, &quadDest[0], &quadDest[1], &quadDest[2], &quadDest[3]);
|
||||
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &collider->base);
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &collider->base);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &collider->base);
|
||||
CollisionCheck_SetAT(play, &play->colChkCtx, &collider->base);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1266,14 +1264,14 @@ Vec3f D_801260A4[3] = {
|
||||
{ 0.0f, -400.0f, 1000.0f },
|
||||
};
|
||||
|
||||
void func_800906D4(GlobalContext* globalCtx, Player* this, Vec3f* newTipPos) {
|
||||
void func_800906D4(PlayState* play, Player* this, Vec3f* newTipPos) {
|
||||
Vec3f newBasePos[3];
|
||||
|
||||
Matrix_MultVec3f(&D_801260A4[0], &newBasePos[0]);
|
||||
Matrix_MultVec3f(&D_801260A4[1], &newBasePos[1]);
|
||||
Matrix_MultVec3f(&D_801260A4[2], &newBasePos[2]);
|
||||
|
||||
if (func_80090480(globalCtx, NULL, &this->meleeWeaponInfo[0], &newTipPos[0], &newBasePos[0]) &&
|
||||
if (func_80090480(play, NULL, &this->meleeWeaponInfo[0], &newTipPos[0], &newBasePos[0]) &&
|
||||
!(this->stateFlags1 & PLAYER_STATE1_22)) {
|
||||
EffectBlure_AddVertex(Effect_GetByIndex(this->meleeWeaponEffectIndex), &this->meleeWeaponInfo[0].tip,
|
||||
&this->meleeWeaponInfo[0].base);
|
||||
@@ -1281,15 +1279,15 @@ void func_800906D4(GlobalContext* globalCtx, Player* this, Vec3f* newTipPos) {
|
||||
|
||||
if ((this->meleeWeaponState > 0) &&
|
||||
((this->meleeWeaponAnimation < PLAYER_MWA_SPIN_ATTACK_1H) || (this->stateFlags2 & PLAYER_STATE2_17))) {
|
||||
func_80090480(globalCtx, &this->meleeWeaponQuads[0], &this->meleeWeaponInfo[1], &newTipPos[1], &newBasePos[1]);
|
||||
func_80090480(globalCtx, &this->meleeWeaponQuads[1], &this->meleeWeaponInfo[2], &newTipPos[2], &newBasePos[2]);
|
||||
func_80090480(play, &this->meleeWeaponQuads[0], &this->meleeWeaponInfo[1], &newTipPos[1], &newBasePos[1]);
|
||||
func_80090480(play, &this->meleeWeaponQuads[1], &this->meleeWeaponInfo[2], &newTipPos[2], &newBasePos[2]);
|
||||
}
|
||||
}
|
||||
|
||||
void Player_DrawGetItemImpl(GlobalContext* globalCtx, Player* this, Vec3f* refPos, s32 drawIdPlusOne) {
|
||||
void Player_DrawGetItemImpl(PlayState* play, Player* this, Vec3f* refPos, s32 drawIdPlusOne) {
|
||||
f32 height = (this->exchangeItemId != EXCH_ITEM_NONE) ? 6.0f : 14.0f;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2401);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2401);
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(this->giObjectSegment);
|
||||
|
||||
@@ -1298,18 +1296,18 @@ void Player_DrawGetItemImpl(GlobalContext* globalCtx, Player* this, Vec3f* refPo
|
||||
|
||||
Matrix_Translate(refPos->x + (3.3f * Math_SinS(this->actor.shape.rot.y)), refPos->y + height,
|
||||
refPos->z + ((3.3f + (IREG(90) / 10.0f)) * Math_CosS(this->actor.shape.rot.y)), MTXMODE_NEW);
|
||||
Matrix_RotateZYX(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_RotateZYX(0, play->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
|
||||
GetItem_Draw(globalCtx, drawIdPlusOne - 1);
|
||||
GetItem_Draw(play, drawIdPlusOne - 1);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2421);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2421);
|
||||
}
|
||||
|
||||
void Player_DrawGetItem(GlobalContext* globalCtx, Player* this) {
|
||||
void Player_DrawGetItem(PlayState* play, Player* this) {
|
||||
if (!this->giObjectLoading || osRecvMesg(&this->giObjectLoadQueue, NULL, OS_MESG_NOBLOCK) == 0) {
|
||||
this->giObjectLoading = false;
|
||||
Player_DrawGetItemImpl(globalCtx, this, &sGetItemRefPos, ABS(this->unk_862));
|
||||
Player_DrawGetItemImpl(play, this, &sGetItemRefPos, ABS(this->unk_862));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1329,7 +1327,7 @@ void func_80090A28(Player* this, Vec3f* vecs) {
|
||||
Matrix_MultVec3f(&D_80126098, &vecs[2]);
|
||||
}
|
||||
|
||||
void Player_DrawHookshotReticle(GlobalContext* globalCtx, Player* this, f32 arg2) {
|
||||
void Player_DrawHookshotReticle(PlayState* play, Player* this, f32 arg2) {
|
||||
static Vec3f D_801260C8 = { -500.0f, -100.0f, 0.0f };
|
||||
CollisionPoly* sp9C;
|
||||
s32 bgId;
|
||||
@@ -1347,24 +1345,24 @@ void Player_DrawHookshotReticle(GlobalContext* globalCtx, Player* this, f32 arg2
|
||||
|
||||
if (1) {}
|
||||
|
||||
if (BgCheck_AnyLineTest3(&globalCtx->colCtx, &sp8C, &sp80, &sp74, &sp9C, 1, 1, 1, 1, &bgId)) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2572);
|
||||
if (BgCheck_AnyLineTest3(&play->colCtx, &sp8C, &sp80, &sp74, &sp9C, 1, 1, 1, 1, &bgId)) {
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2572);
|
||||
|
||||
OVERLAY_DISP = Gfx_CallSetupDL(OVERLAY_DISP, 0x07);
|
||||
|
||||
SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, &sp74, &sp68, &sp64);
|
||||
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &sp74, &sp68, &sp64);
|
||||
|
||||
sp60 = (sp64 < 200.0f) ? 0.08f : (sp64 / 200.0f) * 0.08f;
|
||||
|
||||
Matrix_Translate(sp74.x, sp74.y, sp74.z, MTXMODE_NEW);
|
||||
Matrix_Scale(sp60, sp60, sp60, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_player_lib.c", 2587),
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_player_lib.c", 2587),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(OVERLAY_DISP++, 0x06, globalCtx->objectCtx.status[this->actor.objBankIndex].segment);
|
||||
gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.status[this->actor.objBankIndex].segment);
|
||||
gSPDisplayList(OVERLAY_DISP++, gLinkAdultHookshotReticleDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2592);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2592);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1414,7 +1412,7 @@ Vec3f D_801261E0[] = {
|
||||
{ 200.0f, 200.0f, 0.0f },
|
||||
};
|
||||
|
||||
void Player_PostLimbDrawGameplay(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
|
||||
void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
|
||||
Player* this = (Player*)thisx;
|
||||
|
||||
if (*dList != NULL) {
|
||||
@@ -1430,13 +1428,13 @@ void Player_PostLimbDrawGameplay(GlobalContext* globalCtx, s32 limbIndex, Gfx**
|
||||
if (this->itemActionParam == PLAYER_AP_STICK) {
|
||||
Vec3f sp124[3];
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2633);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2633);
|
||||
|
||||
if (this->actor.scale.y >= 0.0f) {
|
||||
D_80126080.x = this->unk_85C * 5000.0f;
|
||||
func_80090A28(this, sp124);
|
||||
if (this->meleeWeaponState != 0) {
|
||||
func_800906D4(globalCtx, this, sp124);
|
||||
func_800906D4(play, this, sp124);
|
||||
} else {
|
||||
Math_Vec3f_Copy(&this->meleeWeaponInfo[0].tip, &sp124[0]);
|
||||
}
|
||||
@@ -1446,11 +1444,11 @@ void Player_PostLimbDrawGameplay(GlobalContext* globalCtx, s32 limbIndex, Gfx**
|
||||
Matrix_RotateZYX(-0x8000, 0, 0x4000, MTXMODE_APPLY);
|
||||
Matrix_Scale(1.0f, this->unk_85C, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_player_lib.c", 2653),
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_player_lib.c", 2653),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gLinkChildLinkDekuStickDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2656);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2656);
|
||||
} else if ((this->actor.scale.y >= 0.0f) && (this->meleeWeaponState != 0)) {
|
||||
Vec3f spE4[3];
|
||||
|
||||
@@ -1461,18 +1459,18 @@ void Player_PostLimbDrawGameplay(GlobalContext* globalCtx, s32 limbIndex, Gfx**
|
||||
}
|
||||
|
||||
func_80090A28(this, spE4);
|
||||
func_800906D4(globalCtx, this, spE4);
|
||||
func_800906D4(play, this, spE4);
|
||||
} else if ((*dList != NULL) && (this->leftHandType == PLAYER_MODELTYPE_LH_BOTTLE)) {
|
||||
Color_RGB8* bottleColor = &sBottleColors[Player_ActionToBottle(this, this->itemActionParam)];
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2710);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2710);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_player_lib.c", 2712),
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_player_lib.c", 2712),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, bottleColor->r, bottleColor->g, bottleColor->b, 0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sBottleDLists[((void)0, gSaveContext.linkAge)]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2717);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2717);
|
||||
}
|
||||
|
||||
if (this->actor.scale.y >= 0.0f) {
|
||||
@@ -1509,7 +1507,7 @@ void Player_PostLimbDrawGameplay(GlobalContext* globalCtx, s32 limbIndex, Gfx**
|
||||
(this->rightHandType == PLAYER_MODELTYPE_12)) {
|
||||
BowStringData* stringData = &sBowStringData[gSaveContext.linkAge];
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2783);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2783);
|
||||
|
||||
Matrix_Push();
|
||||
Matrix_Translate(stringData->pos.x, stringData->pos.y, stringData->pos.z, MTXMODE_APPLY);
|
||||
@@ -1540,16 +1538,16 @@ void Player_PostLimbDrawGameplay(GlobalContext* globalCtx, s32 limbIndex, Gfx**
|
||||
Matrix_RotateZ(this->unk_858 * -0.2f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_player_lib.c", 2804),
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_player_lib.c", 2804),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, stringData->dList);
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2809);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2809);
|
||||
} else if ((this->actor.scale.y >= 0.0f) && (this->rightHandType == PLAYER_MODELTYPE_RH_SHIELD)) {
|
||||
Matrix_Get(&this->shieldMf);
|
||||
func_80090604(globalCtx, this, &this->shieldQuad, D_80126154);
|
||||
func_80090604(play, this, &this->shieldQuad, D_80126154);
|
||||
}
|
||||
|
||||
if (this->actor.scale.y >= 0.0f) {
|
||||
@@ -1570,7 +1568,7 @@ void Player_PostLimbDrawGameplay(GlobalContext* globalCtx, s32 limbIndex, Gfx**
|
||||
if (func_8002DD78(this) != 0) {
|
||||
Matrix_Translate(500.0f, 300.0f, 0.0f, MTXMODE_APPLY);
|
||||
Player_DrawHookshotReticle(
|
||||
globalCtx, this, (this->heldItemActionParam == PLAYER_AP_HOOKSHOT) ? 38600.0f : 77600.0f);
|
||||
play, this, (this->heldItemActionParam == PLAYER_AP_HOOKSHOT) ? 38600.0f : 77600.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1595,7 +1593,7 @@ void Player_PostLimbDrawGameplay(GlobalContext* globalCtx, s32 limbIndex, Gfx**
|
||||
if ((this->rightHandType != PLAYER_MODELTYPE_RH_SHIELD) &&
|
||||
(this->rightHandType != PLAYER_MODELTYPE_RH_FF)) {
|
||||
if (Player_IsChildWithHylianShield(this)) {
|
||||
func_80090604(globalCtx, this, &this->shieldQuad, D_8012619C);
|
||||
func_80090604(play, this, &this->shieldQuad, D_8012619C);
|
||||
}
|
||||
|
||||
Matrix_TranslateRotateZYX(&D_801261CC, &D_801261D8);
|
||||
@@ -1611,7 +1609,7 @@ void Player_PostLimbDrawGameplay(GlobalContext* globalCtx, s32 limbIndex, Gfx**
|
||||
}
|
||||
}
|
||||
|
||||
u32 func_80091738(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime) {
|
||||
u32 func_80091738(PlayState* play, u8* segment, SkelAnime* skelAnime) {
|
||||
s16 linkObjectId = gLinkObjectIds[(void)0, gSaveContext.linkAge];
|
||||
u32 size;
|
||||
void* ptr;
|
||||
@@ -1630,8 +1628,8 @@ u32 func_80091738(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime) {
|
||||
gSegments[6] =
|
||||
VIRTUAL_TO_PHYSICAL(segment + PAUSE_EQUIP_BUFFER_SIZE + PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE);
|
||||
|
||||
SkelAnime_InitLink(globalCtx, skelAnime, gPlayerSkelHeaders[(void)0, gSaveContext.linkAge], &gPlayerAnim_003238, 9,
|
||||
ptr, ptr, PLAYER_LIMB_MAX);
|
||||
SkelAnime_InitLink(play, skelAnime, gPlayerSkelHeaders[(void)0, gSaveContext.linkAge], &gPlayerAnim_003238, 9, ptr,
|
||||
ptr, PLAYER_LIMB_MAX);
|
||||
|
||||
return size + PAUSE_EQUIP_BUFFER_SIZE + PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE +
|
||||
sizeof(Vec3s[PLAYER_LIMB_BUF_COUNT]);
|
||||
@@ -1643,8 +1641,7 @@ u8 D_801261F8[] = {
|
||||
PLAYER_MODELGROUP_BGS, // PLAYER_SWORD_BGS
|
||||
};
|
||||
|
||||
s32 Player_OverrideLimbDrawPause(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
void* arg) {
|
||||
s32 Player_OverrideLimbDrawPause(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* arg) {
|
||||
u8* playerSwordAndShield = arg;
|
||||
//! @bug `playerSwordAndShield[0]` can be 0 (`PLAYER_SWORD_NONE`), which indexes `D_801261F8[-1]`. The result
|
||||
//! happens to be 0 (`PLAYER_MODELGROUP_0`) in vanilla, but weird values are likely to cause a crash
|
||||
@@ -1687,9 +1684,9 @@ s32 Player_OverrideLimbDrawPause(GlobalContext* globalCtx, s32 limbIndex, Gfx**
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Player_DrawPauseImpl(GlobalContext* globalCtx, void* gameplayKeep, void* linkObject, SkelAnime* skelAnime,
|
||||
Vec3f* pos, Vec3s* rot, f32 scale, s32 sword, s32 tunic, s32 shield, s32 boots, s32 width,
|
||||
s32 height, Vec3f* eye, Vec3f* at, f32 fovy, void* colorFrameBuffer, void* depthFrameBuffer) {
|
||||
void Player_DrawPauseImpl(PlayState* play, void* gameplayKeep, void* linkObject, SkelAnime* skelAnime, Vec3f* pos,
|
||||
Vec3s* rot, f32 scale, s32 sword, s32 tunic, s32 shield, s32 boots, s32 width, s32 height,
|
||||
Vec3f* eye, Vec3f* at, f32 fovy, void* colorFrameBuffer, void* depthFrameBuffer) {
|
||||
// Note: the viewport x and y values are overwritten below, before usage
|
||||
static Vp viewport = { (PAUSE_EQUIP_PLAYER_WIDTH / 2) << 2, (PAUSE_EQUIP_PLAYER_HEIGHT / 2) << 2, G_MAXZ / 2, 0,
|
||||
(PAUSE_EQUIP_PLAYER_WIDTH / 2) << 2, (PAUSE_EQUIP_PLAYER_HEIGHT / 2) << 2, G_MAXZ / 2, 0 };
|
||||
@@ -1699,10 +1696,10 @@ void Player_DrawPauseImpl(GlobalContext* globalCtx, void* gameplayKeep, void* li
|
||||
Gfx* opaRef;
|
||||
Gfx* xluRef;
|
||||
u16 perspNorm;
|
||||
Mtx* perspMtx = Graph_Alloc(globalCtx->state.gfxCtx, sizeof(Mtx));
|
||||
Mtx* lookAtMtx = Graph_Alloc(globalCtx->state.gfxCtx, sizeof(Mtx));
|
||||
Mtx* perspMtx = Graph_Alloc(play->state.gfxCtx, sizeof(Mtx));
|
||||
Mtx* lookAtMtx = Graph_Alloc(play->state.gfxCtx, sizeof(Mtx));
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 3129);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 3129);
|
||||
|
||||
{ s32 pad[2]; }
|
||||
|
||||
@@ -1772,15 +1769,15 @@ void Player_DrawPauseImpl(GlobalContext* globalCtx, void* gameplayKeep, void* li
|
||||
|
||||
gSPSetLights1(POLY_OPA_DISP++, lights1);
|
||||
|
||||
func_80093C80(globalCtx);
|
||||
func_80093C80(play);
|
||||
|
||||
POLY_OPA_DISP = Gfx_SetFog2(POLY_OPA_DISP++, 0, 0, 0, 0, 997, 1000);
|
||||
|
||||
func_8002EABC(pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx);
|
||||
func_8002EABC(pos, &play->view.eye, &lightDir, play->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0C, gCullBackDList);
|
||||
|
||||
Player_DrawImpl(globalCtx, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, 0, tunic, boots, 0,
|
||||
Player_DrawImpl(play, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, 0, tunic, boots, 0,
|
||||
Player_OverrideLimbDrawPause, NULL, &playerSwordAndShield);
|
||||
|
||||
gSPEndDisplayList(POLY_OPA_DISP++);
|
||||
@@ -1789,11 +1786,11 @@ void Player_DrawPauseImpl(GlobalContext* globalCtx, void* gameplayKeep, void* li
|
||||
gSPBranchList(opaRef, POLY_OPA_DISP);
|
||||
gSPBranchList(xluRef, POLY_XLU_DISP);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 3288);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_player_lib.c", 3288);
|
||||
}
|
||||
|
||||
void Player_DrawPause(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot, f32 scale,
|
||||
s32 sword, s32 tunic, s32 shield, s32 boots) {
|
||||
void Player_DrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot, f32 scale, s32 sword,
|
||||
s32 tunic, s32 shield, s32 boots) {
|
||||
static Vec3f eye = { 0.0f, 0.0f, -400.0f };
|
||||
static Vec3f at = { 0.0f, 0.0f, 0.0f };
|
||||
Vec3s* destTable;
|
||||
@@ -1826,10 +1823,9 @@ void Player_DrawPause(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnim
|
||||
*destTable++ = *srcTable++;
|
||||
}
|
||||
|
||||
Player_DrawPauseImpl(globalCtx, segment + PAUSE_EQUIP_BUFFER_SIZE,
|
||||
Player_DrawPauseImpl(play, segment + PAUSE_EQUIP_BUFFER_SIZE,
|
||||
segment + PAUSE_EQUIP_BUFFER_SIZE + PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE, skelAnime,
|
||||
pos, rot, scale, sword, tunic, shield, boots, PAUSE_EQUIP_PLAYER_WIDTH,
|
||||
PAUSE_EQUIP_PLAYER_HEIGHT, &eye, &at, 60.0f, globalCtx->state.gfxCtx->curFrameBuffer,
|
||||
globalCtx->state.gfxCtx->curFrameBuffer +
|
||||
(PAUSE_EQUIP_PLAYER_WIDTH * PAUSE_EQUIP_PLAYER_HEIGHT));
|
||||
PAUSE_EQUIP_PLAYER_HEIGHT, &eye, &at, 60.0f, play->state.gfxCtx->curFrameBuffer,
|
||||
play->state.gfxCtx->curFrameBuffer + (PAUSE_EQUIP_PLAYER_WIDTH * PAUSE_EQUIP_PLAYER_HEIGHT));
|
||||
}
|
||||
|
||||
+3
-3
@@ -317,9 +317,9 @@ s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData) {
|
||||
s32 ret;
|
||||
u32 eq;
|
||||
Vec3f vec;
|
||||
GlobalContext* globalCtx;
|
||||
PlayState* play;
|
||||
|
||||
globalCtx = camera->globalCtx;
|
||||
play = camera->play;
|
||||
vec.x = 0.0f;
|
||||
vec.y = 0.0f;
|
||||
vec.z = 0.0f;
|
||||
@@ -342,7 +342,7 @@ s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData) {
|
||||
for (idx = 0; idx < ARRAY_COUNT(sQuakeRequest); idx++) {
|
||||
req = &sQuakeRequest[idx];
|
||||
if (req->callbackIdx != 0) {
|
||||
if (globalCtx->cameraPtrs[req->camPtrIdx] == NULL) {
|
||||
if (play->cameraPtrs[req->camPtrIdx] == NULL) {
|
||||
osSyncPrintf(VT_COL(YELLOW, BLACK) "quake: stopped! 'coz camera [%d] killed!!\n" VT_RST,
|
||||
req->camPtrIdx);
|
||||
Quake_Remove(req);
|
||||
|
||||
+3
-3
@@ -1007,12 +1007,12 @@ void func_80093C14(GraphicsContext* gfxCtx) {
|
||||
CLOSE_DISPS(gfxCtx, "../z_rcp.c", 1443);
|
||||
}
|
||||
|
||||
void func_80093C80(GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
void func_80093C80(PlayState* play) {
|
||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
|
||||
func_80093D18(gfxCtx);
|
||||
|
||||
if (globalCtx->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_3) {
|
||||
if (play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_3) {
|
||||
OPEN_DISPS(gfxCtx, "../z_rcp.c", 1460);
|
||||
|
||||
gDPSetColorDither(POLY_OPA_DISP++, G_CD_DISABLE);
|
||||
|
||||
+70
-70
@@ -1,9 +1,9 @@
|
||||
#include "global.h"
|
||||
#include "vt.h"
|
||||
|
||||
void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags);
|
||||
void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags);
|
||||
void func_80096F6C(GlobalContext* globalCtx, Room* room, u32 flags);
|
||||
void func_80095AB4(PlayState* play, Room* room, u32 flags);
|
||||
void func_80095D04(PlayState* play, Room* room, u32 flags);
|
||||
void func_80096F6C(PlayState* play, Room* room, u32 flags);
|
||||
|
||||
Vec3f D_801270A0 = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
@@ -22,34 +22,34 @@ Gfx D_801270B0[] = {
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
void (*sRoomDrawHandlers[])(GlobalContext* globalCtx, Room* room, u32 flags) = {
|
||||
void (*sRoomDrawHandlers[])(PlayState* play, Room* room, u32 flags) = {
|
||||
func_80095AB4,
|
||||
func_80096F6C,
|
||||
func_80095D04,
|
||||
};
|
||||
|
||||
void func_80095AA0(GlobalContext* globalCtx, Room* room, Input* arg2, UNK_TYPE arg3) {
|
||||
void func_80095AA0(PlayState* play, Room* room, Input* arg2, UNK_TYPE arg3) {
|
||||
}
|
||||
|
||||
// Room Draw Polygon Type 0
|
||||
void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
void func_80095AB4(PlayState* play, Room* room, u32 flags) {
|
||||
s32 i;
|
||||
PolygonType0* polygon0;
|
||||
PolygonDlist* polygonDlist;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 193);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_room.c", 193);
|
||||
|
||||
if (flags & 1) {
|
||||
func_800342EC(&D_801270A0, globalCtx);
|
||||
func_800342EC(&D_801270A0, play);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x03, room->segment);
|
||||
func_80093C80(globalCtx);
|
||||
func_80093C80(play);
|
||||
gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
}
|
||||
|
||||
if (flags & 2) {
|
||||
func_8003435C(&D_801270A0, globalCtx);
|
||||
func_8003435C(&D_801270A0, play);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x03, room->segment);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
polygonDlist++;
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 239);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_room.c", 239);
|
||||
}
|
||||
|
||||
#define SHAPE_SORT_MAX 64
|
||||
@@ -80,7 +80,7 @@ typedef struct struct_80095D04 {
|
||||
} struct_80095D04; // size = 0x10
|
||||
|
||||
// Room Draw Polygon Type 2
|
||||
void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
void func_80095D04(PlayState* play, Room* room, u32 flags) {
|
||||
PolygonType2* polygon2;
|
||||
PolygonDlist2* polygonDlist;
|
||||
struct_80095D04 spB8[SHAPE_SORT_MAX];
|
||||
@@ -99,18 +99,18 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
PolygonDlist2* polygonDlistIter;
|
||||
f32 temp_f2;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 287);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_room.c", 287);
|
||||
if (flags & 1) {
|
||||
func_800342EC(&D_801270A0, globalCtx);
|
||||
func_800342EC(&D_801270A0, play);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x03, room->segment);
|
||||
func_80093C80(globalCtx);
|
||||
func_80093C80(play);
|
||||
gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
}
|
||||
if (1) {}
|
||||
if (flags & 2) {
|
||||
func_8003435C(&D_801270A0, globalCtx);
|
||||
func_8003435C(&D_801270A0, play);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x03, room->segment);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
}
|
||||
|
||||
@@ -125,10 +125,10 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
pos.x = polygonDlist->pos.x;
|
||||
pos.y = polygonDlist->pos.y;
|
||||
pos.z = polygonDlist->pos.z;
|
||||
SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, &pos, &projectedPos, &projectedW);
|
||||
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &pos, &projectedPos, &projectedW);
|
||||
if (-(f32)polygonDlist->unk_06 < projectedPos.z) {
|
||||
temp_f2 = projectedPos.z - polygonDlist->unk_06;
|
||||
if (temp_f2 < globalCtx->lightCtx.fogFar) {
|
||||
if (temp_f2 < play->lightCtx.fogFar) {
|
||||
spA4->unk_00 = polygonDlist;
|
||||
spA4->unk_04 = temp_f2;
|
||||
iter = spB4;
|
||||
@@ -212,7 +212,7 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
|
||||
iREG(88) = i - 1;
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 430);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_room.c", 430);
|
||||
}
|
||||
|
||||
#define JPEG_MARKER 0xFFD8FFE0
|
||||
@@ -306,7 +306,7 @@ void func_8009638C(Gfx** displayList, void* source, void* tlut, u16 width, u16 h
|
||||
}
|
||||
|
||||
// Room Draw Polygon Type 1 - Single Format
|
||||
void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
void func_80096680(PlayState* play, Room* room, u32 flags) {
|
||||
Camera* activeCam;
|
||||
Gfx* spA8;
|
||||
PolygonType1* polygon1;
|
||||
@@ -316,9 +316,9 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
u32 drawOpa;
|
||||
u32 drawXlu;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 628);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_room.c", 628);
|
||||
|
||||
activeCam = GET_ACTIVE_CAM(globalCtx);
|
||||
activeCam = GET_ACTIVE_CAM(play);
|
||||
isFixedCamera = (activeCam->setting == CAM_SET_PREREND_FIXED);
|
||||
polygon1 = &room->meshHeader->polygon1;
|
||||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
|
||||
@@ -330,7 +330,7 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x03, room->segment);
|
||||
|
||||
if (drawOpa) {
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, polygonDlist->opa);
|
||||
}
|
||||
@@ -355,16 +355,16 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
|
||||
if (drawXlu) {
|
||||
gSPSegment(POLY_XLU_DISP++, 0x03, room->segment);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, polygonDlist->xlu);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 691);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_room.c", 691);
|
||||
}
|
||||
|
||||
BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) {
|
||||
Camera* activeCam = GET_ACTIVE_CAM(globalCtx);
|
||||
BgImage* func_80096A74(PolygonType1* polygon1, PlayState* play) {
|
||||
Camera* activeCam = GET_ACTIVE_CAM(play);
|
||||
s32 camDataIdx;
|
||||
s16 camDataIdx2;
|
||||
Player* player;
|
||||
@@ -373,12 +373,12 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) {
|
||||
|
||||
camDataIdx = activeCam->camDataIdx;
|
||||
// jfifid
|
||||
camDataIdx2 = func_80041C10(&globalCtx->colCtx, camDataIdx, BGCHECK_SCENE)[2].y;
|
||||
camDataIdx2 = func_80041C10(&play->colCtx, camDataIdx, BGCHECK_SCENE)[2].y;
|
||||
if (camDataIdx2 >= 0) {
|
||||
camDataIdx = camDataIdx2;
|
||||
}
|
||||
|
||||
player = GET_PLAYER(globalCtx);
|
||||
player = GET_PLAYER(play);
|
||||
player->actor.params = (player->actor.params & 0xFF00) | camDataIdx;
|
||||
|
||||
bgImage = SEGMENTED_TO_VIRTUAL(polygon1->multi.list);
|
||||
@@ -397,7 +397,7 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
// Room Draw Polygon Type 1 - Multi Format
|
||||
void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
void func_80096B6C(PlayState* play, Room* room, u32 flags) {
|
||||
Camera* activeCam;
|
||||
Gfx* gfx;
|
||||
PolygonType1* polygon1;
|
||||
@@ -408,13 +408,13 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
u32 drawOpa;
|
||||
u32 drawXlu;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 752);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_room.c", 752);
|
||||
|
||||
activeCam = GET_ACTIVE_CAM(globalCtx);
|
||||
activeCam = GET_ACTIVE_CAM(play);
|
||||
isFixedCamera = (activeCam->setting == CAM_SET_PREREND_FIXED);
|
||||
polygon1 = &room->meshHeader->polygon1;
|
||||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
|
||||
bgImage = func_80096A74(polygon1, globalCtx);
|
||||
bgImage = func_80096A74(polygon1, play);
|
||||
drawBg = (flags & 1) && isFixedCamera && bgImage->source && !(SREG(25) & 1);
|
||||
drawOpa = (flags & 1) && (polygonDlist->opa != NULL) && !(SREG(25) & 2);
|
||||
drawXlu = (flags & 2) && (polygonDlist->xlu != NULL) && !(SREG(25) & 4);
|
||||
@@ -423,7 +423,7 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x03, room->segment);
|
||||
|
||||
if (drawOpa) {
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, polygonDlist->opa);
|
||||
}
|
||||
@@ -449,35 +449,35 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
|
||||
if (drawXlu) {
|
||||
gSPSegment(POLY_XLU_DISP++, 0x03, room->segment);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_XLU_DISP++, polygonDlist->xlu);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 819);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_room.c", 819);
|
||||
}
|
||||
|
||||
// Room Draw Polygon Type 1
|
||||
void func_80096F6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
void func_80096F6C(PlayState* play, Room* room, u32 flags) {
|
||||
PolygonType1* polygon1 = &room->meshHeader->polygon1;
|
||||
|
||||
if (polygon1->format == 1) {
|
||||
func_80096680(globalCtx, room, flags);
|
||||
func_80096680(play, room, flags);
|
||||
} else if (polygon1->format == 2) {
|
||||
func_80096B6C(globalCtx, room, flags);
|
||||
func_80096B6C(play, room, flags);
|
||||
} else {
|
||||
LogUtils_HungupThread("../z_room.c", 841);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80096FD4(GlobalContext* globalCtx, Room* room) {
|
||||
void func_80096FD4(PlayState* play, Room* room) {
|
||||
room->num = -1;
|
||||
room->segment = NULL;
|
||||
}
|
||||
|
||||
u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) {
|
||||
u32 maxRoomSize = 0;
|
||||
RomFile* roomList = globalCtx->roomList;
|
||||
RomFile* roomList = play->roomList;
|
||||
u32 roomSize;
|
||||
s32 i;
|
||||
s32 j;
|
||||
@@ -487,7 +487,7 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
u32 backRoomSize;
|
||||
u32 cumulRoomSize;
|
||||
|
||||
for (i = 0; i < globalCtx->numRooms; i++) {
|
||||
for (i = 0; i < play->numRooms; i++) {
|
||||
roomSize = roomList[i].vromEnd - roomList[i].vromStart;
|
||||
osSyncPrintf("ROOM%d size=%d\n", i, roomSize);
|
||||
if (maxRoomSize < roomSize) {
|
||||
@@ -495,13 +495,13 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
if (globalCtx->transiActorCtx.numActors != 0) {
|
||||
RomFile* roomList = globalCtx->roomList;
|
||||
TransitionActorEntry* transitionActor = &globalCtx->transiActorCtx.list[0];
|
||||
if (play->transiActorCtx.numActors != 0) {
|
||||
RomFile* roomList = play->roomList;
|
||||
TransitionActorEntry* transitionActor = &play->transiActorCtx.list[0];
|
||||
|
||||
LOG_NUM("game_play->room_rom_address.num", globalCtx->numRooms, "../z_room.c", 912);
|
||||
LOG_NUM("game_play->room_rom_address.num", play->numRooms, "../z_room.c", 912);
|
||||
|
||||
for (j = 0; j < globalCtx->transiActorCtx.numActors; j++) {
|
||||
for (j = 0; j < play->transiActorCtx.numActors; j++) {
|
||||
frontRoom = transitionActor->sides[0].room;
|
||||
backRoom = transitionActor->sides[1].room;
|
||||
frontRoomSize = (frontRoom < 0) ? 0 : roomList[frontRoom].vromEnd - roomList[frontRoom].vromStart;
|
||||
@@ -520,7 +520,7 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
// "Room buffer size=%08x(%5.1fK)"
|
||||
osSyncPrintf("部屋バッファサイズ=%08x(%5.1fK)\n", maxRoomSize, maxRoomSize / 1024.0f);
|
||||
roomCtx->bufPtrs[0] = GameState_Alloc(&globalCtx->state, maxRoomSize, "../z_room.c", 946);
|
||||
roomCtx->bufPtrs[0] = GameState_Alloc(&play->state, maxRoomSize, "../z_room.c", 946);
|
||||
// "Room buffer initial pointer=%08x"
|
||||
osSyncPrintf("部屋バッファ開始ポインタ=%08x\n", roomCtx->bufPtrs[0]);
|
||||
roomCtx->bufPtrs[1] = (void*)((s32)roomCtx->bufPtrs[0] + maxRoomSize);
|
||||
@@ -531,13 +531,13 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
roomCtx->status = 0;
|
||||
|
||||
frontRoom = gSaveContext.respawnFlag > 0 ? ((void)0, gSaveContext.respawn[gSaveContext.respawnFlag - 1].roomIndex)
|
||||
: globalCtx->setupEntranceList[globalCtx->curSpawn].room;
|
||||
func_8009728C(globalCtx, roomCtx, frontRoom);
|
||||
: play->setupEntranceList[play->curSpawn].room;
|
||||
func_8009728C(play, roomCtx, frontRoom);
|
||||
|
||||
return maxRoomSize;
|
||||
}
|
||||
|
||||
s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum) {
|
||||
s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) {
|
||||
u32 size;
|
||||
|
||||
if (roomCtx->status == 0) {
|
||||
@@ -546,13 +546,13 @@ s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum) {
|
||||
roomCtx->curRoom.segment = NULL;
|
||||
roomCtx->status = 1;
|
||||
|
||||
ASSERT(roomNum < globalCtx->numRooms, "read_room_ID < game_play->room_rom_address.num", "../z_room.c", 1009);
|
||||
ASSERT(roomNum < play->numRooms, "read_room_ID < game_play->room_rom_address.num", "../z_room.c", 1009);
|
||||
|
||||
size = globalCtx->roomList[roomNum].vromEnd - globalCtx->roomList[roomNum].vromStart;
|
||||
size = play->roomList[roomNum].vromEnd - play->roomList[roomNum].vromStart;
|
||||
roomCtx->unk_34 = (void*)ALIGN16((u32)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7));
|
||||
|
||||
osCreateMesgQueue(&roomCtx->loadQueue, &roomCtx->loadMsg, 1);
|
||||
DmaMgr_SendRequest2(&roomCtx->dmaRequest, roomCtx->unk_34, globalCtx->roomList[roomNum].vromStart, size, 0,
|
||||
DmaMgr_SendRequest2(&roomCtx->dmaRequest, roomCtx->unk_34, play->roomList[roomNum].vromStart, size, 0,
|
||||
&roomCtx->loadQueue, NULL, "../z_room.c", 1036);
|
||||
roomCtx->unk_30 ^= 1;
|
||||
|
||||
@@ -562,16 +562,16 @@ s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
s32 func_800973FC(PlayState* play, RoomContext* roomCtx) {
|
||||
if (roomCtx->status == 1) {
|
||||
if (osRecvMesg(&roomCtx->loadQueue, NULL, OS_MESG_NOBLOCK) == 0) {
|
||||
roomCtx->status = 0;
|
||||
roomCtx->curRoom.segment = roomCtx->unk_34;
|
||||
gSegments[3] = VIRTUAL_TO_PHYSICAL(roomCtx->unk_34);
|
||||
|
||||
Scene_ExecuteCommands(globalCtx, roomCtx->curRoom.segment);
|
||||
Player_SetBootData(globalCtx, GET_PLAYER(globalCtx));
|
||||
Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx);
|
||||
Scene_ExecuteCommands(play, roomCtx->curRoom.segment);
|
||||
Player_SetBootData(play, GET_PLAYER(play));
|
||||
Actor_SpawnTransitionActors(play, &play->actorCtx);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -582,23 +582,23 @@ s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
void Room_Draw(PlayState* play, Room* room, u32 flags) {
|
||||
if (room->segment != NULL) {
|
||||
gSegments[3] = VIRTUAL_TO_PHYSICAL(room->segment);
|
||||
ASSERT(room->meshHeader->base.type < ARRAY_COUNTU(sRoomDrawHandlers),
|
||||
"this->ground_shape->polygon.type < number(Room_Draw_Proc)", "../z_room.c", 1125);
|
||||
sRoomDrawHandlers[room->meshHeader->base.type](globalCtx, room, flags);
|
||||
sRoomDrawHandlers[room->meshHeader->base.type](play, room, flags);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80097534(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
void func_80097534(PlayState* play, RoomContext* roomCtx) {
|
||||
roomCtx->prevRoom.num = -1;
|
||||
roomCtx->prevRoom.segment = NULL;
|
||||
func_80031B14(globalCtx, &globalCtx->actorCtx);
|
||||
Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx);
|
||||
Map_InitRoomData(globalCtx, roomCtx->curRoom.num);
|
||||
if (!((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_SPOT20))) {
|
||||
Map_SavePlayerInitialInfo(globalCtx);
|
||||
func_80031B14(play, &play->actorCtx);
|
||||
Actor_SpawnTransitionActors(play, &play->actorCtx);
|
||||
Map_InitRoomData(play, roomCtx->curRoom.num);
|
||||
if (!((play->sceneNum >= SCENE_SPOT00) && (play->sceneNum <= SCENE_SPOT20))) {
|
||||
Map_SavePlayerInitialInfo(play);
|
||||
}
|
||||
Audio_SetEnvReverb(globalCtx->roomCtx.curRoom.echo);
|
||||
Audio_SetEnvReverb(play->roomCtx.curRoom.echo);
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
void Sample_HandleStateChange(SampleContext* this) {
|
||||
if (CHECK_BTN_ALL(this->state.input[0].press.button, BTN_START)) {
|
||||
SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext);
|
||||
SET_NEXT_GAMESTATE(&this->state, Play_Init, PlayState);
|
||||
this->state.running = false;
|
||||
}
|
||||
}
|
||||
|
||||
+99
-98
@@ -33,24 +33,24 @@ s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId) {
|
||||
return objectCtx->num - 1;
|
||||
}
|
||||
|
||||
void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx) {
|
||||
GlobalContext* globalCtx2 = globalCtx; // Needs to be a new variable to match (possibly a sub struct?)
|
||||
void Object_InitBank(PlayState* play, ObjectContext* objectCtx) {
|
||||
PlayState* play2 = play; // Needs to be a new variable to match (possibly a sub struct?)
|
||||
u32 spaceSize;
|
||||
s32 i;
|
||||
|
||||
if (globalCtx2->sceneNum == SCENE_SPOT00) {
|
||||
if (play2->sceneNum == SCENE_SPOT00) {
|
||||
spaceSize = 1024000;
|
||||
} else if (globalCtx2->sceneNum == SCENE_GANON_DEMO) {
|
||||
} else if (play2->sceneNum == SCENE_GANON_DEMO) {
|
||||
if (gSaveContext.sceneSetupIndex != 4) {
|
||||
spaceSize = 1177600;
|
||||
} else {
|
||||
spaceSize = 1024000;
|
||||
}
|
||||
} else if (globalCtx2->sceneNum == SCENE_JYASINBOSS) {
|
||||
} else if (play2->sceneNum == SCENE_JYASINBOSS) {
|
||||
spaceSize = 1075200;
|
||||
} else if (globalCtx2->sceneNum == SCENE_KENJYANOMA) {
|
||||
} else if (play2->sceneNum == SCENE_KENJYANOMA) {
|
||||
spaceSize = 1075200;
|
||||
} else if (globalCtx2->sceneNum == SCENE_GANON_BOSS) {
|
||||
} else if (play2->sceneNum == SCENE_GANON_BOSS) {
|
||||
spaceSize = 1075200;
|
||||
} else {
|
||||
spaceSize = 1024000;
|
||||
@@ -69,7 +69,7 @@ void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx) {
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
objectCtx->spaceStart = objectCtx->status[0].segment =
|
||||
GameState_Alloc(&globalCtx->state, spaceSize, "../z_scene.c", 219);
|
||||
GameState_Alloc(&play->state, spaceSize, "../z_scene.c", 219);
|
||||
objectCtx->spaceEnd = (void*)((s32)objectCtx->spaceStart + spaceSize);
|
||||
|
||||
objectCtx->mainKeepIndex = Object_Spawn(objectCtx, OBJECT_GAMEPLAY_KEEP);
|
||||
@@ -158,7 +158,7 @@ void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId) {
|
||||
return nextPtr;
|
||||
}
|
||||
|
||||
s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd) {
|
||||
s32 Scene_ExecuteCommands(PlayState* play, SceneCmd* sceneCmd) {
|
||||
u32 cmdCode;
|
||||
|
||||
while (true) {
|
||||
@@ -171,7 +171,7 @@ s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd) {
|
||||
}
|
||||
|
||||
if (cmdCode < ARRAY_COUNT(gSceneCmdHandlers)) {
|
||||
gSceneCmdHandlers[cmdCode](globalCtx, sceneCmd);
|
||||
gSceneCmdHandlers[cmdCode](play, sceneCmd);
|
||||
} else {
|
||||
osSyncPrintf(VT_FGCOL(RED));
|
||||
osSyncPrintf("code の値が異常です\n"); // "code variable is abnormal"
|
||||
@@ -182,29 +182,29 @@ s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Scene_CommandSpawnList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
ActorEntry* linkEntry = globalCtx->linkActorEntry = (ActorEntry*)SEGMENTED_TO_VIRTUAL(cmd->spawnList.segment) +
|
||||
globalCtx->setupEntranceList[globalCtx->curSpawn].spawn;
|
||||
void Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) {
|
||||
ActorEntry* linkEntry = play->linkActorEntry =
|
||||
(ActorEntry*)SEGMENTED_TO_VIRTUAL(cmd->spawnList.segment) + play->setupEntranceList[play->curSpawn].spawn;
|
||||
s16 linkObjectId;
|
||||
|
||||
globalCtx->linkAgeOnLoad = ((void)0, gSaveContext.linkAge);
|
||||
play->linkAgeOnLoad = ((void)0, gSaveContext.linkAge);
|
||||
|
||||
linkObjectId = gLinkObjectIds[((void)0, gSaveContext.linkAge)];
|
||||
|
||||
gActorOverlayTable[linkEntry->id].initInfo->objectId = linkObjectId;
|
||||
Object_Spawn(&globalCtx->objectCtx, linkObjectId);
|
||||
Object_Spawn(&play->objectCtx, linkObjectId);
|
||||
}
|
||||
|
||||
void Scene_CommandActorList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->numSetupActors = cmd->actorList.num;
|
||||
globalCtx->setupActorList = SEGMENTED_TO_VIRTUAL(cmd->actorList.segment);
|
||||
void Scene_CommandActorList(PlayState* play, SceneCmd* cmd) {
|
||||
play->numSetupActors = cmd->actorList.num;
|
||||
play->setupActorList = SEGMENTED_TO_VIRTUAL(cmd->actorList.segment);
|
||||
}
|
||||
|
||||
void Scene_CommandUnused2(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->unk_11DFC = SEGMENTED_TO_VIRTUAL(cmd->unused02.segment);
|
||||
void Scene_CommandUnused2(PlayState* play, SceneCmd* cmd) {
|
||||
play->unk_11DFC = SEGMENTED_TO_VIRTUAL(cmd->unused02.segment);
|
||||
}
|
||||
|
||||
void Scene_CommandCollisionHeader(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
void Scene_CommandCollisionHeader(PlayState* play, SceneCmd* cmd) {
|
||||
CollisionHeader* colHeader = SEGMENTED_TO_VIRTUAL(cmd->colHeader.segment);
|
||||
|
||||
colHeader->vtxList = SEGMENTED_TO_VIRTUAL(colHeader->vtxList);
|
||||
@@ -213,41 +213,41 @@ void Scene_CommandCollisionHeader(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
colHeader->cameraDataList = SEGMENTED_TO_VIRTUAL(colHeader->cameraDataList);
|
||||
colHeader->waterBoxes = SEGMENTED_TO_VIRTUAL(colHeader->waterBoxes);
|
||||
|
||||
BgCheck_Allocate(&globalCtx->colCtx, globalCtx, colHeader);
|
||||
BgCheck_Allocate(&play->colCtx, play, colHeader);
|
||||
}
|
||||
|
||||
void Scene_CommandRoomList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->numRooms = cmd->roomList.num;
|
||||
globalCtx->roomList = SEGMENTED_TO_VIRTUAL(cmd->roomList.segment);
|
||||
void Scene_CommandRoomList(PlayState* play, SceneCmd* cmd) {
|
||||
play->numRooms = cmd->roomList.num;
|
||||
play->roomList = SEGMENTED_TO_VIRTUAL(cmd->roomList.segment);
|
||||
}
|
||||
|
||||
void Scene_CommandEntranceList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->setupEntranceList = SEGMENTED_TO_VIRTUAL(cmd->entranceList.segment);
|
||||
void Scene_CommandEntranceList(PlayState* play, SceneCmd* cmd) {
|
||||
play->setupEntranceList = SEGMENTED_TO_VIRTUAL(cmd->entranceList.segment);
|
||||
}
|
||||
|
||||
void Scene_CommandSpecialFiles(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
void Scene_CommandSpecialFiles(PlayState* play, SceneCmd* cmd) {
|
||||
if (cmd->specialFiles.keepObjectId != OBJECT_INVALID) {
|
||||
globalCtx->objectCtx.subKeepIndex = Object_Spawn(&globalCtx->objectCtx, cmd->specialFiles.keepObjectId);
|
||||
gSegments[5] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment);
|
||||
play->objectCtx.subKeepIndex = Object_Spawn(&play->objectCtx, cmd->specialFiles.keepObjectId);
|
||||
gSegments[5] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[play->objectCtx.subKeepIndex].segment);
|
||||
}
|
||||
|
||||
if (cmd->specialFiles.cUpElfMsgNum != 0) {
|
||||
globalCtx->cUpElfMsgs = Play_LoadFile(globalCtx, &sNaviMsgFiles[cmd->specialFiles.cUpElfMsgNum - 1]);
|
||||
play->cUpElfMsgs = Play_LoadFile(play, &sNaviMsgFiles[cmd->specialFiles.cUpElfMsgNum - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
void Scene_CommandRoomBehavior(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->roomCtx.curRoom.behaviorType1 = cmd->roomBehavior.gpFlag1;
|
||||
globalCtx->roomCtx.curRoom.behaviorType2 = cmd->roomBehavior.gpFlag2 & 0xFF;
|
||||
globalCtx->roomCtx.curRoom.lensMode = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
|
||||
globalCtx->msgCtx.disableWarpSongs = (cmd->roomBehavior.gpFlag2 >> 0xA) & 1;
|
||||
void Scene_CommandRoomBehavior(PlayState* play, SceneCmd* cmd) {
|
||||
play->roomCtx.curRoom.behaviorType1 = cmd->roomBehavior.gpFlag1;
|
||||
play->roomCtx.curRoom.behaviorType2 = cmd->roomBehavior.gpFlag2 & 0xFF;
|
||||
play->roomCtx.curRoom.lensMode = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
|
||||
play->msgCtx.disableWarpSongs = (cmd->roomBehavior.gpFlag2 >> 0xA) & 1;
|
||||
}
|
||||
|
||||
void Scene_CommandMeshHeader(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->roomCtx.curRoom.meshHeader = SEGMENTED_TO_VIRTUAL(cmd->mesh.segment);
|
||||
void Scene_CommandMeshHeader(PlayState* play, SceneCmd* cmd) {
|
||||
play->roomCtx.curRoom.meshHeader = SEGMENTED_TO_VIRTUAL(cmd->mesh.segment);
|
||||
}
|
||||
|
||||
void Scene_CommandObjectList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
void Scene_CommandObjectList(PlayState* play, SceneCmd* cmd) {
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 k;
|
||||
@@ -258,19 +258,19 @@ void Scene_CommandObjectList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
void* nextPtr;
|
||||
|
||||
k = 0;
|
||||
i = globalCtx->objectCtx.unk_09;
|
||||
firstStatus = &globalCtx->objectCtx.status[0];
|
||||
status = &globalCtx->objectCtx.status[i];
|
||||
i = play->objectCtx.unk_09;
|
||||
firstStatus = &play->objectCtx.status[0];
|
||||
status = &play->objectCtx.status[i];
|
||||
|
||||
while (i < globalCtx->objectCtx.num) {
|
||||
while (i < play->objectCtx.num) {
|
||||
if (status->id != *objectEntry) {
|
||||
status2 = &globalCtx->objectCtx.status[i];
|
||||
for (j = i; j < globalCtx->objectCtx.num; j++) {
|
||||
status2 = &play->objectCtx.status[i];
|
||||
for (j = i; j < play->objectCtx.num; j++) {
|
||||
status2->id = OBJECT_INVALID;
|
||||
status2++;
|
||||
}
|
||||
globalCtx->objectCtx.num = i;
|
||||
func_80031A28(globalCtx, &globalCtx->actorCtx);
|
||||
play->objectCtx.num = i;
|
||||
func_80031A28(play, &play->actorCtx);
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -285,7 +285,7 @@ void Scene_CommandObjectList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
"../z_scene.c", 705);
|
||||
|
||||
while (k < cmd->objectList.num) {
|
||||
nextPtr = func_800982FC(&globalCtx->objectCtx, i, *objectEntry);
|
||||
nextPtr = func_800982FC(&play->objectCtx, i, *objectEntry);
|
||||
if (i < OBJECT_EXCHANGE_BANK_MAX - 1) {
|
||||
firstStatus[i + 1].segment = nextPtr;
|
||||
}
|
||||
@@ -294,71 +294,72 @@ void Scene_CommandObjectList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
objectEntry++;
|
||||
}
|
||||
|
||||
globalCtx->objectCtx.num = i;
|
||||
play->objectCtx.num = i;
|
||||
}
|
||||
|
||||
void Scene_CommandLightList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
void Scene_CommandLightList(PlayState* play, SceneCmd* cmd) {
|
||||
s32 i;
|
||||
LightInfo* lightInfo = SEGMENTED_TO_VIRTUAL(cmd->lightList.segment);
|
||||
|
||||
for (i = 0; i < cmd->lightList.num; i++) {
|
||||
LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, lightInfo);
|
||||
LightContext_InsertLight(play, &play->lightCtx, lightInfo);
|
||||
lightInfo++;
|
||||
}
|
||||
}
|
||||
|
||||
void Scene_CommandPathList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->setupPathList = SEGMENTED_TO_VIRTUAL(cmd->pathList.segment);
|
||||
void Scene_CommandPathList(PlayState* play, SceneCmd* cmd) {
|
||||
play->setupPathList = SEGMENTED_TO_VIRTUAL(cmd->pathList.segment);
|
||||
}
|
||||
|
||||
void Scene_CommandTransitionActorList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->transiActorCtx.numActors = cmd->transiActorList.num;
|
||||
globalCtx->transiActorCtx.list = SEGMENTED_TO_VIRTUAL(cmd->transiActorList.segment);
|
||||
void Scene_CommandTransitionActorList(PlayState* play, SceneCmd* cmd) {
|
||||
play->transiActorCtx.numActors = cmd->transiActorList.num;
|
||||
play->transiActorCtx.list = SEGMENTED_TO_VIRTUAL(cmd->transiActorList.segment);
|
||||
}
|
||||
|
||||
void TransitionActor_InitContext(GameState* state, TransitionActorContext* transiActorCtx) {
|
||||
transiActorCtx->numActors = 0;
|
||||
}
|
||||
|
||||
void Scene_CommandLightSettingsList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->envCtx.numLightSettings = cmd->lightSettingList.num;
|
||||
globalCtx->envCtx.lightSettingsList = SEGMENTED_TO_VIRTUAL(cmd->lightSettingList.segment);
|
||||
void Scene_CommandLightSettingsList(PlayState* play, SceneCmd* cmd) {
|
||||
play->envCtx.numLightSettings = cmd->lightSettingList.num;
|
||||
play->envCtx.lightSettingsList = SEGMENTED_TO_VIRTUAL(cmd->lightSettingList.segment);
|
||||
}
|
||||
|
||||
void Scene_CommandSkyboxSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->skyboxId = cmd->skyboxSettings.skyboxId;
|
||||
globalCtx->envCtx.skyboxConfig = globalCtx->envCtx.changeSkyboxNextConfig = cmd->skyboxSettings.unk_05;
|
||||
globalCtx->envCtx.lightMode = cmd->skyboxSettings.unk_06;
|
||||
void Scene_CommandSkyboxSettings(PlayState* play, SceneCmd* cmd) {
|
||||
play->skyboxId = cmd->skyboxSettings.skyboxId;
|
||||
play->envCtx.skyboxConfig = play->envCtx.changeSkyboxNextConfig = cmd->skyboxSettings.unk_05;
|
||||
play->envCtx.lightMode = cmd->skyboxSettings.unk_06;
|
||||
}
|
||||
|
||||
void Scene_CommandSkyboxDisables(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->envCtx.skyboxDisabled = cmd->skyboxDisables.unk_04;
|
||||
globalCtx->envCtx.sunMoonDisabled = cmd->skyboxDisables.unk_05;
|
||||
void Scene_CommandSkyboxDisables(PlayState* play, SceneCmd* cmd) {
|
||||
play->envCtx.skyboxDisabled = cmd->skyboxDisables.unk_04;
|
||||
play->envCtx.sunMoonDisabled = cmd->skyboxDisables.unk_05;
|
||||
}
|
||||
|
||||
void Scene_CommandTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
void Scene_CommandTimeSettings(PlayState* play, SceneCmd* cmd) {
|
||||
if ((cmd->timeSettings.hour != 0xFF) && (cmd->timeSettings.min != 0xFF)) {
|
||||
gSaveContext.skyboxTime = gSaveContext.dayTime =
|
||||
((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / ((f32)(24 * 60) / 0x10000);
|
||||
}
|
||||
|
||||
if (cmd->timeSettings.unk_06 != 0xFF) {
|
||||
globalCtx->envCtx.sceneTimeSpeed = cmd->timeSettings.unk_06;
|
||||
play->envCtx.sceneTimeSpeed = cmd->timeSettings.unk_06;
|
||||
} else {
|
||||
globalCtx->envCtx.sceneTimeSpeed = 0;
|
||||
play->envCtx.sceneTimeSpeed = 0;
|
||||
}
|
||||
|
||||
if (gSaveContext.sunsSongState == SUNSSONG_INACTIVE) {
|
||||
gTimeSpeed = globalCtx->envCtx.sceneTimeSpeed;
|
||||
gTimeSpeed = play->envCtx.sceneTimeSpeed;
|
||||
}
|
||||
|
||||
globalCtx->envCtx.sunPos.x = -(Math_SinS(((void)0, gSaveContext.dayTime) - CLOCK_TIME(12, 0)) * 120.0f) * 25.0f;
|
||||
globalCtx->envCtx.sunPos.y = (Math_CosS(((void)0, gSaveContext.dayTime) - CLOCK_TIME(12, 0)) * 120.0f) * 25.0f;
|
||||
globalCtx->envCtx.sunPos.z = (Math_CosS(((void)0, gSaveContext.dayTime) - CLOCK_TIME(12, 0)) * 20.0f) * 25.0f;
|
||||
play->envCtx.sunPos.x = -(Math_SinS(((void)0, gSaveContext.dayTime) - CLOCK_TIME(12, 0)) * 120.0f) * 25.0f;
|
||||
play->envCtx.sunPos.y = (Math_CosS(((void)0, gSaveContext.dayTime) - CLOCK_TIME(12, 0)) * 120.0f) * 25.0f;
|
||||
play->envCtx.sunPos.z = (Math_CosS(((void)0, gSaveContext.dayTime) - CLOCK_TIME(12, 0)) * 20.0f) * 25.0f;
|
||||
|
||||
if (((globalCtx->envCtx.sceneTimeSpeed == 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) ||
|
||||
if (((play->envCtx.sceneTimeSpeed == 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) ||
|
||||
(gSaveContext.entranceIndex == ENTR_SPOT06_8)) {
|
||||
gSaveContext.skyboxTime = ((void)0, gSaveContext.dayTime);
|
||||
|
||||
if ((gSaveContext.skyboxTime > CLOCK_TIME(4, 0)) && (gSaveContext.skyboxTime < CLOCK_TIME(6, 30))) {
|
||||
gSaveContext.skyboxTime = CLOCK_TIME(5, 0) + 1;
|
||||
} else if ((gSaveContext.skyboxTime >= CLOCK_TIME(6, 30)) && (gSaveContext.skyboxTime <= CLOCK_TIME(8, 0))) {
|
||||
@@ -372,39 +373,39 @@ void Scene_CommandTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
}
|
||||
}
|
||||
|
||||
void Scene_CommandWindSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
void Scene_CommandWindSettings(PlayState* play, SceneCmd* cmd) {
|
||||
s8 x = cmd->windSettings.x;
|
||||
s8 y = cmd->windSettings.y;
|
||||
s8 z = cmd->windSettings.z;
|
||||
|
||||
globalCtx->envCtx.windDirection.x = x;
|
||||
globalCtx->envCtx.windDirection.y = y;
|
||||
globalCtx->envCtx.windDirection.z = z;
|
||||
play->envCtx.windDirection.x = x;
|
||||
play->envCtx.windDirection.y = y;
|
||||
play->envCtx.windDirection.z = z;
|
||||
|
||||
globalCtx->envCtx.windSpeed = cmd->windSettings.unk_07;
|
||||
play->envCtx.windSpeed = cmd->windSettings.unk_07;
|
||||
}
|
||||
|
||||
void Scene_CommandExitList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->setupExitList = SEGMENTED_TO_VIRTUAL(cmd->exitList.segment);
|
||||
void Scene_CommandExitList(PlayState* play, SceneCmd* cmd) {
|
||||
play->setupExitList = SEGMENTED_TO_VIRTUAL(cmd->exitList.segment);
|
||||
}
|
||||
|
||||
void Scene_CommandUndefined9(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
void Scene_CommandUndefined9(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
void Scene_CommandSoundSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->sequenceCtx.seqId = cmd->soundSettings.seqId;
|
||||
globalCtx->sequenceCtx.natureAmbienceId = cmd->soundSettings.natureAmbienceId;
|
||||
void Scene_CommandSoundSettings(PlayState* play, SceneCmd* cmd) {
|
||||
play->sequenceCtx.seqId = cmd->soundSettings.seqId;
|
||||
play->sequenceCtx.natureAmbienceId = cmd->soundSettings.natureAmbienceId;
|
||||
|
||||
if (gSaveContext.seqId == (u8)NA_BGM_DISABLED) {
|
||||
Audio_QueueSeqCmd(cmd->soundSettings.specId | 0xF0000000);
|
||||
}
|
||||
}
|
||||
|
||||
void Scene_CommandEchoSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->roomCtx.curRoom.echo = cmd->echoSettings.echo;
|
||||
void Scene_CommandEchoSettings(PlayState* play, SceneCmd* cmd) {
|
||||
play->roomCtx.curRoom.echo = cmd->echoSettings.echo;
|
||||
}
|
||||
|
||||
void Scene_CommandAlternateHeaderList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
void Scene_CommandAlternateHeaderList(PlayState* play, SceneCmd* cmd) {
|
||||
s32 pad;
|
||||
SceneCmd* altHeader;
|
||||
|
||||
@@ -418,7 +419,7 @@ void Scene_CommandAlternateHeaderList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
if (1) {}
|
||||
|
||||
if (altHeader != NULL) {
|
||||
Scene_ExecuteCommands(globalCtx, SEGMENTED_TO_VIRTUAL(altHeader));
|
||||
Scene_ExecuteCommands(play, SEGMENTED_TO_VIRTUAL(altHeader));
|
||||
(cmd + 1)->base.code = SCENE_CMD_ID_END;
|
||||
} else {
|
||||
// "Coughh! There is no specified dataaaaa!"
|
||||
@@ -432,7 +433,7 @@ void Scene_CommandAlternateHeaderList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
osSyncPrintf("\nそこで、大人の昼データを使用するでええっす!!");
|
||||
|
||||
if (altHeader != NULL) {
|
||||
Scene_ExecuteCommands(globalCtx, SEGMENTED_TO_VIRTUAL(altHeader));
|
||||
Scene_ExecuteCommands(play, SEGMENTED_TO_VIRTUAL(altHeader));
|
||||
(cmd + 1)->base.code = SCENE_CMD_ID_END;
|
||||
}
|
||||
}
|
||||
@@ -440,24 +441,24 @@ void Scene_CommandAlternateHeaderList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
}
|
||||
}
|
||||
|
||||
void Scene_CommandCutsceneData(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
osSyncPrintf("\ngame_play->demo_play.data=[%x]", globalCtx->csCtx.segment);
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(cmd->cutsceneData.segment);
|
||||
void Scene_CommandCutsceneData(PlayState* play, SceneCmd* cmd) {
|
||||
osSyncPrintf("\ngame_play->demo_play.data=[%x]", play->csCtx.segment);
|
||||
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(cmd->cutsceneData.segment);
|
||||
}
|
||||
|
||||
// Camera & World Map Area
|
||||
void Scene_CommandMiscSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
void Scene_CommandMiscSettings(PlayState* play, SceneCmd* cmd) {
|
||||
YREG(15) = cmd->miscSettings.cameraMovement;
|
||||
gSaveContext.worldMapArea = cmd->miscSettings.area;
|
||||
|
||||
if ((globalCtx->sceneNum == SCENE_SHOP1) || (globalCtx->sceneNum == SCENE_SYATEKIJYOU)) {
|
||||
if ((play->sceneNum == SCENE_SHOP1) || (play->sceneNum == SCENE_SYATEKIJYOU)) {
|
||||
if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
|
||||
gSaveContext.worldMapArea = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_GANON_TOU)) ||
|
||||
((globalCtx->sceneNum >= SCENE_ENTRA) && (globalCtx->sceneNum <= SCENE_SHRINE_R))) {
|
||||
if (((play->sceneNum >= SCENE_SPOT00) && (play->sceneNum <= SCENE_GANON_TOU)) ||
|
||||
((play->sceneNum >= SCENE_ENTRA) && (play->sceneNum <= SCENE_SHRINE_R))) {
|
||||
if (gSaveContext.cutsceneIndex < 0xFFF0) {
|
||||
gSaveContext.worldMapAreaData |= gBitFlags[gSaveContext.worldMapArea];
|
||||
osSyncPrintf("000 area_arrival=%x (%d)\n", gSaveContext.worldMapAreaData,
|
||||
@@ -466,7 +467,7 @@ void Scene_CommandMiscSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
}
|
||||
}
|
||||
|
||||
void (*gSceneCmdHandlers[SCENE_CMD_ID_MAX])(GlobalContext*, SceneCmd*) = {
|
||||
void (*gSceneCmdHandlers[SCENE_CMD_ID_MAX])(PlayState*, SceneCmd*) = {
|
||||
Scene_CommandSpawnList, // SCENE_CMD_ID_SPAWN_LIST
|
||||
Scene_CommandActorList, // SCENE_CMD_ID_ACTOR_LIST
|
||||
Scene_CommandUnused2, // SCENE_CMD_ID_UNUSED_2
|
||||
|
||||
+441
-453
File diff suppressed because it is too large
Load Diff
+164
-173
@@ -3,8 +3,8 @@
|
||||
|
||||
#define ANIM_INTERP 1
|
||||
|
||||
s32 LinkAnimation_Loop(GlobalContext* globalCtx, SkelAnime* skelAnime);
|
||||
s32 LinkAnimation_Once(GlobalContext* globalCtx, SkelAnime* skelAnime);
|
||||
s32 LinkAnimation_Loop(PlayState* play, SkelAnime* skelAnime);
|
||||
s32 LinkAnimation_Once(PlayState* play, SkelAnime* skelAnime);
|
||||
s32 SkelAnime_LoopFull(SkelAnime* skelAnime);
|
||||
s32 SkelAnime_Once(SkelAnime* skelAnime);
|
||||
s32 SkelAnime_LoopPartial(SkelAnime* skelAnime);
|
||||
@@ -18,14 +18,14 @@ static u32 sAnimQueueFlags;
|
||||
* Draw a limb of type `LodLimb`
|
||||
* Near or far display list is specified via `lod`
|
||||
*/
|
||||
void SkelAnime_DrawLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||
void SkelAnime_DrawLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg, s32 lod) {
|
||||
LodLimb* limb;
|
||||
Gfx* dList;
|
||||
Vec3f pos;
|
||||
Vec3s rot;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 773);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_skelanime.c", 773);
|
||||
|
||||
Matrix_Push();
|
||||
limb = (LodLimb*)SEGMENTED_TO_VIRTUAL(skeleton[limbIndex]);
|
||||
@@ -38,10 +38,10 @@ void SkelAnime_DrawLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
|
||||
dList = limb->dLists[lod];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &dList, &pos, &rot, arg)) {
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_skelanime.c", 805), G_MTX_LOAD);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 805), G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, dList);
|
||||
}
|
||||
}
|
||||
@@ -49,28 +49,28 @@ void SkelAnime_DrawLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
if (1) {}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, limbIndex, &dList, &rot, arg);
|
||||
postLimbDraw(play, limbIndex, &dList, &rot, arg);
|
||||
}
|
||||
|
||||
if (limb->child != LIMB_DONE) {
|
||||
SkelAnime_DrawLimbLod(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg, lod);
|
||||
SkelAnime_DrawLimbLod(play, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg, lod);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
SkelAnime_DrawLimbLod(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg, lod);
|
||||
SkelAnime_DrawLimbLod(play, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg, lod);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 821);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_skelanime.c", 821);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw all limbs of type `LodLimb` in a given skeleton
|
||||
* Near or far display list is specified via `lod`
|
||||
*/
|
||||
void SkelAnime_DrawLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
|
||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg, s32 lod) {
|
||||
void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw,
|
||||
PostLimbDrawOpa postLimbDraw, void* arg, s32 lod) {
|
||||
LodLimb* rootLimb;
|
||||
s32 pad;
|
||||
Gfx* dList;
|
||||
@@ -84,7 +84,7 @@ void SkelAnime_DrawLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTa
|
||||
return;
|
||||
}
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 849);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_skelanime.c", 849);
|
||||
|
||||
Matrix_Push();
|
||||
|
||||
@@ -96,32 +96,31 @@ void SkelAnime_DrawLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTa
|
||||
rot = jointTable[1];
|
||||
dList = rootLimb->dLists[lod];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, 1, &dList, &pos, &rot, arg)) {
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_skelanime.c", 881), G_MTX_LOAD);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 881), G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, dList);
|
||||
}
|
||||
}
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, 1, &dList, &rot, arg);
|
||||
postLimbDraw(play, 1, &dList, &rot, arg);
|
||||
}
|
||||
|
||||
if (rootLimb->child != LIMB_DONE) {
|
||||
SkelAnime_DrawLimbLod(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
lod);
|
||||
SkelAnime_DrawLimbLod(play, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg, lod);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 894);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_skelanime.c", 894);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a limb of type `LodLimb` contained within a flexible skeleton
|
||||
* Near or far display list is specified via `lod`
|
||||
*/
|
||||
void SkelAnime_DrawFlexLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||
void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg, s32 lod,
|
||||
Mtx** mtx) {
|
||||
LodLimb* limb;
|
||||
@@ -143,15 +142,15 @@ void SkelAnime_DrawFlexLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** s
|
||||
|
||||
newDList = limbDList = limb->dLists[lod];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &newDList, &pos, &rot, arg)) {
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
Matrix_ToMtx(*mtx, "../z_skelanime.c", 945);
|
||||
{
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 946);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_skelanime.c", 946);
|
||||
gSPMatrix(POLY_OPA_DISP++, *mtx, G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, newDList);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 949);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_skelanime.c", 949);
|
||||
}
|
||||
(*mtx)++;
|
||||
} else if (limbDList != NULL) {
|
||||
@@ -160,18 +159,18 @@ void SkelAnime_DrawFlexLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** s
|
||||
}
|
||||
}
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, limbIndex, &limbDList, &rot, arg);
|
||||
postLimbDraw(play, limbIndex, &limbDList, &rot, arg);
|
||||
}
|
||||
if (limb->child != LIMB_DONE) {
|
||||
SkelAnime_DrawFlexLimbLod(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
lod, mtx);
|
||||
SkelAnime_DrawFlexLimbLod(play, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg, lod,
|
||||
mtx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
SkelAnime_DrawFlexLimbLod(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
lod, mtx);
|
||||
SkelAnime_DrawFlexLimbLod(play, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg, lod,
|
||||
mtx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +179,7 @@ void SkelAnime_DrawFlexLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** s
|
||||
* Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
|
||||
* An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
|
||||
*/
|
||||
void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
||||
void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg, s32 lod) {
|
||||
LodLimb* rootLimb;
|
||||
s32 pad;
|
||||
@@ -188,7 +187,7 @@ void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
Gfx* limbDList;
|
||||
Vec3f pos;
|
||||
Vec3s rot;
|
||||
Mtx* mtx = Graph_Alloc(globalCtx->state.gfxCtx, dListCount * sizeof(Mtx));
|
||||
Mtx* mtx = Graph_Alloc(play->state.gfxCtx, dListCount * sizeof(Mtx));
|
||||
|
||||
if (skeleton == NULL) {
|
||||
osSyncPrintf(VT_FGCOL(RED));
|
||||
@@ -197,7 +196,7 @@ void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
return;
|
||||
}
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 1000);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_skelanime.c", 1000);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0xD, mtx);
|
||||
Matrix_Push();
|
||||
@@ -211,7 +210,7 @@ void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
|
||||
newDList = limbDList = rootLimb->dLists[lod];
|
||||
|
||||
if ((overrideLimbDraw == 0) || !overrideLimbDraw(globalCtx, 1, &newDList, &pos, &rot, arg)) {
|
||||
if ((overrideLimbDraw == 0) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
Matrix_ToMtx(mtx, "../z_skelanime.c", 1033);
|
||||
@@ -225,29 +224,29 @@ void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, 1, &limbDList, &rot, arg);
|
||||
postLimbDraw(play, 1, &limbDList, &rot, arg);
|
||||
}
|
||||
if (rootLimb->child != LIMB_DONE) {
|
||||
SkelAnime_DrawFlexLimbLod(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
lod, &mtx);
|
||||
SkelAnime_DrawFlexLimbLod(play, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg, lod,
|
||||
&mtx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 1053);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_skelanime.c", 1053);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a limb of type `StandardLimb` to the polyOpa buffer
|
||||
*/
|
||||
void SkelAnime_DrawLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||
void SkelAnime_DrawLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg) {
|
||||
StandardLimb* limb;
|
||||
Gfx* dList;
|
||||
Vec3f pos;
|
||||
Vec3s rot;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 1076);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_skelanime.c", 1076);
|
||||
Matrix_Push();
|
||||
|
||||
limb = (StandardLimb*)SEGMENTED_TO_VIRTUAL(skeleton[limbIndex]);
|
||||
@@ -258,10 +257,10 @@ void SkelAnime_DrawLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
pos.z = limb->jointPos.z;
|
||||
dList = limb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &dList, &pos, &rot, arg)) {
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_skelanime.c", 1103), G_MTX_LOAD);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 1103), G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, dList);
|
||||
}
|
||||
}
|
||||
@@ -269,26 +268,26 @@ void SkelAnime_DrawLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
if (1) {}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, limbIndex, &dList, &rot, arg);
|
||||
postLimbDraw(play, limbIndex, &dList, &rot, arg);
|
||||
}
|
||||
|
||||
if (limb->child != LIMB_DONE) {
|
||||
SkelAnime_DrawLimbOpa(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg);
|
||||
SkelAnime_DrawLimbOpa(play, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
SkelAnime_DrawLimbOpa(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg);
|
||||
SkelAnime_DrawLimbOpa(play, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg);
|
||||
}
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 1121);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_skelanime.c", 1121);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw all limbs of type `StandardLimb` in a given skeleton to the polyOpa buffer
|
||||
*/
|
||||
void SkelAnime_DrawOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
|
||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg) {
|
||||
void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw,
|
||||
PostLimbDrawOpa postLimbDraw, void* arg) {
|
||||
StandardLimb* rootLimb;
|
||||
s32 pad;
|
||||
Gfx* dList;
|
||||
@@ -302,7 +301,7 @@ void SkelAnime_DrawOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTa
|
||||
return;
|
||||
}
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 1148);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_skelanime.c", 1148);
|
||||
|
||||
Matrix_Push();
|
||||
rootLimb = (StandardLimb*)SEGMENTED_TO_VIRTUAL(skeleton[0]);
|
||||
@@ -314,31 +313,31 @@ void SkelAnime_DrawOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTa
|
||||
rot = jointTable[1];
|
||||
dList = rootLimb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, 1, &dList, &pos, &rot, arg)) {
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_skelanime.c", 1176), G_MTX_LOAD);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 1176), G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, dList);
|
||||
}
|
||||
}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, 1, &dList, &rot, arg);
|
||||
postLimbDraw(play, 1, &dList, &rot, arg);
|
||||
}
|
||||
|
||||
if (rootLimb->child != LIMB_DONE) {
|
||||
SkelAnime_DrawLimbOpa(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg);
|
||||
SkelAnime_DrawLimbOpa(play, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 1190);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_skelanime.c", 1190);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a limb of type `StandardLimb` contained within a flexible skeleton to the polyOpa buffer
|
||||
*/
|
||||
void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||
void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg,
|
||||
Mtx** limbMatrices) {
|
||||
StandardLimb* limb;
|
||||
@@ -347,7 +346,7 @@ void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** s
|
||||
Vec3f pos;
|
||||
Vec3s rot;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 1214);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_skelanime.c", 1214);
|
||||
|
||||
Matrix_Push();
|
||||
|
||||
@@ -361,7 +360,7 @@ void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** s
|
||||
|
||||
newDList = limbDList = limb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &newDList, &pos, &rot, arg)) {
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
Matrix_ToMtx(*limbMatrices, "../z_skelanime.c", 1242);
|
||||
@@ -375,21 +374,21 @@ void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** s
|
||||
}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, limbIndex, &limbDList, &rot, arg);
|
||||
postLimbDraw(play, limbIndex, &limbDList, &rot, arg);
|
||||
}
|
||||
|
||||
if (limb->child != LIMB_DONE) {
|
||||
SkelAnime_DrawFlexLimbOpa(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
SkelAnime_DrawFlexLimbOpa(play, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
limbMatrices);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
SkelAnime_DrawFlexLimbOpa(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
SkelAnime_DrawFlexLimbOpa(play, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
limbMatrices);
|
||||
}
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 1265);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_skelanime.c", 1265);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -397,7 +396,7 @@ void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** s
|
||||
* Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
|
||||
* An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
|
||||
*/
|
||||
void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
||||
void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg) {
|
||||
StandardLimb* rootLimb;
|
||||
s32 pad;
|
||||
@@ -405,7 +404,7 @@ void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
Gfx* limbDList;
|
||||
Vec3f pos;
|
||||
Vec3s rot;
|
||||
Mtx* mtx = Graph_Alloc(globalCtx->state.gfxCtx, dListCount * sizeof(Mtx));
|
||||
Mtx* mtx = Graph_Alloc(play->state.gfxCtx, dListCount * sizeof(Mtx));
|
||||
|
||||
if (skeleton == NULL) {
|
||||
osSyncPrintf(VT_FGCOL(RED));
|
||||
@@ -414,7 +413,7 @@ void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
return;
|
||||
}
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 1294);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_skelanime.c", 1294);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0xD, mtx);
|
||||
|
||||
@@ -430,7 +429,7 @@ void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
|
||||
newDList = limbDList = rootLimb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, 1, &newDList, &pos, &rot, arg)) {
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
Matrix_ToMtx(mtx, "../z_skelanime.c", 1327);
|
||||
@@ -444,16 +443,16 @@ void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, 1, &limbDList, &rot, arg);
|
||||
postLimbDraw(play, 1, &limbDList, &rot, arg);
|
||||
}
|
||||
|
||||
if (rootLimb->child != LIMB_DONE) {
|
||||
SkelAnime_DrawFlexLimbOpa(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
SkelAnime_DrawFlexLimbOpa(play, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
&mtx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_skelanime.c", 1347);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_skelanime.c", 1347);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -502,7 +501,7 @@ s16 Animation_GetLastFrame(void* animation) {
|
||||
/**
|
||||
* Draw a limb of type `StandardLimb` to the specified display buffer
|
||||
*/
|
||||
Gfx* SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||
Gfx* SkelAnime_DrawLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, void* arg, Gfx* gfx) {
|
||||
StandardLimb* limb;
|
||||
Gfx* dList;
|
||||
@@ -522,28 +521,26 @@ Gfx* SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton
|
||||
|
||||
dList = limb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &dList, &pos, &rot, arg, &gfx)) {
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg, &gfx)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(gfx++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_skelanime.c", 1489), G_MTX_LOAD);
|
||||
gSPMatrix(gfx++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 1489), G_MTX_LOAD);
|
||||
gSPDisplayList(gfx++, dList);
|
||||
}
|
||||
}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, limbIndex, &dList, &rot, arg, &gfx);
|
||||
postLimbDraw(play, limbIndex, &dList, &rot, arg, &gfx);
|
||||
}
|
||||
|
||||
if (limb->child != LIMB_DONE) {
|
||||
gfx =
|
||||
SkelAnime_DrawLimb(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg, gfx);
|
||||
gfx = SkelAnime_DrawLimb(play, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg, gfx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
gfx = SkelAnime_DrawLimb(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
gfx);
|
||||
gfx = SkelAnime_DrawLimb(play, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg, gfx);
|
||||
}
|
||||
|
||||
return gfx;
|
||||
@@ -552,7 +549,7 @@ Gfx* SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton
|
||||
/**
|
||||
* Draw all limbs of type `StandardLimb` in a given skeleton to the specified display buffer
|
||||
*/
|
||||
Gfx* SkelAnime_Draw(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw,
|
||||
Gfx* SkelAnime_Draw(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw,
|
||||
PostLimbDraw postLimbDraw, void* arg, Gfx* gfx) {
|
||||
StandardLimb* rootLimb;
|
||||
s32 pad;
|
||||
@@ -580,21 +577,20 @@ Gfx* SkelAnime_Draw(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable
|
||||
|
||||
dList = rootLimb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, 1, &dList, &pos, &rot, arg, &gfx)) {
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg, &gfx)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(gfx++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_skelanime.c", 1558), G_MTX_LOAD);
|
||||
gSPMatrix(gfx++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 1558), G_MTX_LOAD);
|
||||
gSPDisplayList(gfx++, dList);
|
||||
}
|
||||
}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, 1, &dList, &rot, arg, &gfx);
|
||||
postLimbDraw(play, 1, &dList, &rot, arg, &gfx);
|
||||
}
|
||||
|
||||
if (rootLimb->child != LIMB_DONE) {
|
||||
gfx = SkelAnime_DrawLimb(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
gfx);
|
||||
gfx = SkelAnime_DrawLimb(play, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg, gfx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
@@ -605,7 +601,7 @@ Gfx* SkelAnime_Draw(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable
|
||||
/**
|
||||
* Draw a limb of type `StandardLimb` contained within a flexible skeleton to the specified display buffer
|
||||
*/
|
||||
Gfx* SkelAnime_DrawFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||
Gfx* SkelAnime_DrawFlexLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, void* arg, Mtx** mtx,
|
||||
Gfx* gfx) {
|
||||
StandardLimb* limb;
|
||||
@@ -625,7 +621,7 @@ Gfx* SkelAnime_DrawFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skel
|
||||
pos.z = limb->jointPos.z;
|
||||
|
||||
newDList = limbDList = limb->dList;
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &newDList, &pos, &rot, arg, &gfx)) {
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg, &gfx)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
Matrix_ToMtx(*mtx, "../z_skelanime.c", 1623);
|
||||
@@ -638,18 +634,18 @@ Gfx* SkelAnime_DrawFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skel
|
||||
}
|
||||
}
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, limbIndex, &limbDList, &rot, arg, &gfx);
|
||||
postLimbDraw(play, limbIndex, &limbDList, &rot, arg, &gfx);
|
||||
}
|
||||
if (limb->child != LIMB_DONE) {
|
||||
gfx = SkelAnime_DrawFlexLimb(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
mtx, gfx);
|
||||
gfx = SkelAnime_DrawFlexLimb(play, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg, mtx,
|
||||
gfx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
gfx = SkelAnime_DrawFlexLimb(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
|
||||
arg, mtx, gfx);
|
||||
gfx = SkelAnime_DrawFlexLimb(play, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
mtx, gfx);
|
||||
}
|
||||
|
||||
return gfx;
|
||||
@@ -660,7 +656,7 @@ Gfx* SkelAnime_DrawFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skel
|
||||
* Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
|
||||
* An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
|
||||
*/
|
||||
Gfx* SkelAnime_DrawFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
||||
Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
||||
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, void* arg, Gfx* gfx) {
|
||||
StandardLimb* rootLimb;
|
||||
s32 pad;
|
||||
@@ -668,7 +664,7 @@ Gfx* SkelAnime_DrawFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointT
|
||||
Gfx* limbDList;
|
||||
Vec3f pos;
|
||||
Vec3s rot;
|
||||
Mtx* mtx = Graph_Alloc(globalCtx->state.gfxCtx, dListCount * sizeof(*mtx));
|
||||
Mtx* mtx = Graph_Alloc(play->state.gfxCtx, dListCount * sizeof(*mtx));
|
||||
|
||||
if (skeleton == NULL) {
|
||||
osSyncPrintf(VT_FGCOL(RED));
|
||||
@@ -690,7 +686,7 @@ Gfx* SkelAnime_DrawFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointT
|
||||
|
||||
newDList = limbDList = rootLimb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, 1, &newDList, &pos, &rot, arg, &gfx)) {
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg, &gfx)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
Matrix_ToMtx(mtx, "../z_skelanime.c", 1710);
|
||||
@@ -703,11 +699,11 @@ Gfx* SkelAnime_DrawFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointT
|
||||
}
|
||||
}
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, 1, &limbDList, &rot, arg, &gfx);
|
||||
postLimbDraw(play, 1, &limbDList, &rot, arg, &gfx);
|
||||
}
|
||||
if (rootLimb->child != LIMB_DONE) {
|
||||
gfx = SkelAnime_DrawFlexLimb(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
|
||||
arg, &mtx, gfx);
|
||||
gfx = SkelAnime_DrawFlexLimb(play, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, arg,
|
||||
&mtx, gfx);
|
||||
}
|
||||
|
||||
Matrix_Pop();
|
||||
@@ -810,14 +806,14 @@ void AnimationContext_Reset(AnimationContext* animationCtx) {
|
||||
/**
|
||||
* Shifts the queue flag to the next queue
|
||||
*/
|
||||
void AnimationContext_SetNextQueue(GlobalContext* globalCtx) {
|
||||
void AnimationContext_SetNextQueue(PlayState* play) {
|
||||
sAnimQueueFlags <<= 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables the current animation queue. Only load and move actor requests will be processed for that queue.
|
||||
*/
|
||||
void AnimationContext_DisableQueue(GlobalContext* globalCtx) {
|
||||
void AnimationContext_DisableQueue(PlayState* play) {
|
||||
sDisableAnimQueueFlags |= sAnimQueueFlags;
|
||||
}
|
||||
|
||||
@@ -838,9 +834,9 @@ AnimationEntry* AnimationContext_AddEntry(AnimationContext* animationCtx, Animat
|
||||
/**
|
||||
* Requests loading frame data from the Link animation into frameTable
|
||||
*/
|
||||
void AnimationContext_SetLoadFrame(GlobalContext* globalCtx, LinkAnimationHeader* animation, s32 frame, s32 limbCount,
|
||||
void AnimationContext_SetLoadFrame(PlayState* play, LinkAnimationHeader* animation, s32 frame, s32 limbCount,
|
||||
Vec3s* frameTable) {
|
||||
AnimationEntry* entry = AnimationContext_AddEntry(&globalCtx->animationCtx, ANIMENTRY_LOADFRAME);
|
||||
AnimationEntry* entry = AnimationContext_AddEntry(&play->animationCtx, ANIMENTRY_LOADFRAME);
|
||||
|
||||
if (entry != NULL) {
|
||||
LinkAnimationHeader* linkAnimHeader = SEGMENTED_TO_VIRTUAL(animation);
|
||||
@@ -857,8 +853,8 @@ void AnimationContext_SetLoadFrame(GlobalContext* globalCtx, LinkAnimationHeader
|
||||
/**
|
||||
* Requests copying all vectors from src frame table into dst frame table
|
||||
*/
|
||||
void AnimationContext_SetCopyAll(GlobalContext* globalCtx, s32 vecCount, Vec3s* dst, Vec3s* src) {
|
||||
AnimationEntry* entry = AnimationContext_AddEntry(&globalCtx->animationCtx, ANIMENTRY_COPYALL);
|
||||
void AnimationContext_SetCopyAll(PlayState* play, s32 vecCount, Vec3s* dst, Vec3s* src) {
|
||||
AnimationEntry* entry = AnimationContext_AddEntry(&play->animationCtx, ANIMENTRY_COPYALL);
|
||||
|
||||
if (entry != NULL) {
|
||||
entry->data.copy.queueFlag = sAnimQueueFlags;
|
||||
@@ -871,8 +867,8 @@ void AnimationContext_SetCopyAll(GlobalContext* globalCtx, s32 vecCount, Vec3s*
|
||||
/**
|
||||
* Requests interpolating between base and mod frame tables with the given weight, placing the result in base
|
||||
*/
|
||||
void AnimationContext_SetInterp(GlobalContext* globalCtx, s32 vecCount, Vec3s* base, Vec3s* mod, f32 weight) {
|
||||
AnimationEntry* entry = AnimationContext_AddEntry(&globalCtx->animationCtx, ANIMENTRY_INTERP);
|
||||
void AnimationContext_SetInterp(PlayState* play, s32 vecCount, Vec3s* base, Vec3s* mod, f32 weight) {
|
||||
AnimationEntry* entry = AnimationContext_AddEntry(&play->animationCtx, ANIMENTRY_INTERP);
|
||||
|
||||
if (entry != NULL) {
|
||||
entry->data.interp.queueFlag = sAnimQueueFlags;
|
||||
@@ -886,8 +882,8 @@ void AnimationContext_SetInterp(GlobalContext* globalCtx, s32 vecCount, Vec3s* b
|
||||
/**
|
||||
* Requests copying vectors from src frame table to dst frame table whose copy flag is true
|
||||
*/
|
||||
void AnimationContext_SetCopyTrue(GlobalContext* globalCtx, s32 vecCount, Vec3s* dst, Vec3s* src, u8* copyFlag) {
|
||||
AnimationEntry* entry = AnimationContext_AddEntry(&globalCtx->animationCtx, ANIMENTRY_COPYTRUE);
|
||||
void AnimationContext_SetCopyTrue(PlayState* play, s32 vecCount, Vec3s* dst, Vec3s* src, u8* copyFlag) {
|
||||
AnimationEntry* entry = AnimationContext_AddEntry(&play->animationCtx, ANIMENTRY_COPYTRUE);
|
||||
|
||||
if (entry != NULL) {
|
||||
entry->data.copy1.queueFlag = sAnimQueueFlags;
|
||||
@@ -901,8 +897,8 @@ void AnimationContext_SetCopyTrue(GlobalContext* globalCtx, s32 vecCount, Vec3s*
|
||||
/**
|
||||
* Requests copying vectors from src frame table to dst frame table whose copy flag is false
|
||||
*/
|
||||
void AnimationContext_SetCopyFalse(GlobalContext* globalCtx, s32 vecCount, Vec3s* dst, Vec3s* src, u8* copyFlag) {
|
||||
AnimationEntry* entry = AnimationContext_AddEntry(&globalCtx->animationCtx, ANIMENTRY_COPYFALSE);
|
||||
void AnimationContext_SetCopyFalse(PlayState* play, s32 vecCount, Vec3s* dst, Vec3s* src, u8* copyFlag) {
|
||||
AnimationEntry* entry = AnimationContext_AddEntry(&play->animationCtx, ANIMENTRY_COPYFALSE);
|
||||
|
||||
if (entry != NULL) {
|
||||
entry->data.copy0.queueFlag = sAnimQueueFlags;
|
||||
@@ -916,8 +912,8 @@ void AnimationContext_SetCopyFalse(GlobalContext* globalCtx, s32 vecCount, Vec3s
|
||||
/**
|
||||
* Requests moving an actor according to the translation of its root limb
|
||||
*/
|
||||
void AnimationContext_SetMoveActor(GlobalContext* globalCtx, Actor* actor, SkelAnime* skelAnime, f32 arg3) {
|
||||
AnimationEntry* entry = AnimationContext_AddEntry(&globalCtx->animationCtx, ANIMENTRY_MOVEACTOR);
|
||||
void AnimationContext_SetMoveActor(PlayState* play, Actor* actor, SkelAnime* skelAnime, f32 arg3) {
|
||||
AnimationEntry* entry = AnimationContext_AddEntry(&play->animationCtx, ANIMENTRY_MOVEACTOR);
|
||||
|
||||
if (entry != NULL) {
|
||||
entry->data.move.actor = actor;
|
||||
@@ -929,7 +925,7 @@ void AnimationContext_SetMoveActor(GlobalContext* globalCtx, Actor* actor, SkelA
|
||||
/**
|
||||
* Receives the request for Link's animation frame data
|
||||
*/
|
||||
void AnimationContext_LoadFrame(GlobalContext* globalCtx, AnimationEntryData* data) {
|
||||
void AnimationContext_LoadFrame(PlayState* play, AnimationEntryData* data) {
|
||||
AnimEntryLoadFrame* entry = &data->load;
|
||||
|
||||
osRecvMesg(&entry->msgQueue, NULL, OS_MESG_BLOCK);
|
||||
@@ -938,7 +934,7 @@ void AnimationContext_LoadFrame(GlobalContext* globalCtx, AnimationEntryData* da
|
||||
/**
|
||||
* If the entry's queue is enabled, copies all vectors from src frame table to dst frame table
|
||||
*/
|
||||
void AnimationContext_CopyAll(GlobalContext* globalCtx, AnimationEntryData* data) {
|
||||
void AnimationContext_CopyAll(PlayState* play, AnimationEntryData* data) {
|
||||
AnimEntryCopyAll* entry = &data->copy;
|
||||
|
||||
if (!(entry->queueFlag & sDisableAnimQueueFlags)) {
|
||||
@@ -955,7 +951,7 @@ void AnimationContext_CopyAll(GlobalContext* globalCtx, AnimationEntryData* data
|
||||
/**
|
||||
* If the entry's queue is enabled, interpolates between the base and mod frame tables, placing the result in base
|
||||
*/
|
||||
void AnimationContext_Interp(GlobalContext* globalCtx, AnimationEntryData* data) {
|
||||
void AnimationContext_Interp(PlayState* play, AnimationEntryData* data) {
|
||||
AnimEntryInterp* entry = &data->interp;
|
||||
|
||||
if (!(entry->queueFlag & sDisableAnimQueueFlags)) {
|
||||
@@ -966,7 +962,7 @@ void AnimationContext_Interp(GlobalContext* globalCtx, AnimationEntryData* data)
|
||||
/**
|
||||
* If the entry's queue is enabled, copies all vectors from src frame table to dst frame table whose copy flag is true
|
||||
*/
|
||||
void AnimationContext_CopyTrue(GlobalContext* globalCtx, AnimationEntryData* data) {
|
||||
void AnimationContext_CopyTrue(PlayState* play, AnimationEntryData* data) {
|
||||
AnimEntryCopyTrue* entry = &data->copy1;
|
||||
|
||||
if (!(entry->queueFlag & sDisableAnimQueueFlags)) {
|
||||
@@ -986,7 +982,7 @@ void AnimationContext_CopyTrue(GlobalContext* globalCtx, AnimationEntryData* dat
|
||||
/**
|
||||
* If the entry's queue is enabled, copies all vectors from src frame table to dst frame table whose copy flag is false
|
||||
*/
|
||||
void AnimationContext_CopyFalse(GlobalContext* globalCtx, AnimationEntryData* data) {
|
||||
void AnimationContext_CopyFalse(PlayState* play, AnimationEntryData* data) {
|
||||
AnimEntryCopyFalse* entry = &data->copy0;
|
||||
|
||||
if (!(entry->queueFlag & sDisableAnimQueueFlags)) {
|
||||
@@ -1006,7 +1002,7 @@ void AnimationContext_CopyFalse(GlobalContext* globalCtx, AnimationEntryData* da
|
||||
/**
|
||||
* Moves an actor according to the translation of its root limb
|
||||
*/
|
||||
void AnimationContext_MoveActor(GlobalContext* globalCtx, AnimationEntryData* data) {
|
||||
void AnimationContext_MoveActor(PlayState* play, AnimationEntryData* data) {
|
||||
AnimEntryMoveActor* entry = &data->move;
|
||||
Actor* actor = entry->actor;
|
||||
Vec3f diff;
|
||||
@@ -1020,7 +1016,7 @@ void AnimationContext_MoveActor(GlobalContext* globalCtx, AnimationEntryData* da
|
||||
/**
|
||||
* Performs all requests in the animation queue, then resets the queue flags.
|
||||
*/
|
||||
void AnimationContext_Update(GlobalContext* globalCtx, AnimationContext* animationCtx) {
|
||||
void AnimationContext_Update(PlayState* play, AnimationContext* animationCtx) {
|
||||
static AnimationEntryCallback animFuncs[] = {
|
||||
AnimationContext_LoadFrame, AnimationContext_CopyAll, AnimationContext_Interp,
|
||||
AnimationContext_CopyTrue, AnimationContext_CopyFalse, AnimationContext_MoveActor,
|
||||
@@ -1028,7 +1024,7 @@ void AnimationContext_Update(GlobalContext* globalCtx, AnimationContext* animati
|
||||
AnimationEntry* entry;
|
||||
|
||||
for (entry = animationCtx->entries; animationCtx->animationCount != 0; entry++, animationCtx->animationCount--) {
|
||||
animFuncs[entry->type](globalCtx, &entry->data);
|
||||
animFuncs[entry->type](play, &entry->data);
|
||||
}
|
||||
|
||||
sAnimQueueFlags = 1;
|
||||
@@ -1039,7 +1035,7 @@ void AnimationContext_Update(GlobalContext* globalCtx, AnimationContext* animati
|
||||
* Initializes a skeleton to be used with Link animations to a looping animation, dynamically allocating the frame
|
||||
* tables if not given.
|
||||
*/
|
||||
void SkelAnime_InitLink(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg,
|
||||
void SkelAnime_InitLink(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg,
|
||||
LinkAnimationHeader* animation, s32 flags, Vec3s* jointTable, Vec3s* morphTable,
|
||||
s32 limbBufCount) {
|
||||
FlexSkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg);
|
||||
@@ -1084,7 +1080,7 @@ void SkelAnime_InitLink(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkel
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
|
||||
LinkAnimation_Change(globalCtx, skelAnime, animation, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f);
|
||||
LinkAnimation_Change(play, skelAnime, animation, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1103,15 +1099,15 @@ void LinkAnimation_SetUpdateFunction(SkelAnime* skelAnime) {
|
||||
* Advances the current Link animation and updates all frame tables. If the animation plays once, returns true when it
|
||||
* finishes.
|
||||
*/
|
||||
s32 LinkAnimation_Update(GlobalContext* globalCtx, SkelAnime* skelAnime) {
|
||||
return skelAnime->update(globalCtx, skelAnime);
|
||||
s32 LinkAnimation_Update(PlayState* play, SkelAnime* skelAnime) {
|
||||
return skelAnime->update(play, skelAnime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests an interpolation between the pose in jointTable to the one in morphTable, advancing the morph but not the
|
||||
* animation frame
|
||||
*/
|
||||
s32 LinkAnimation_Morph(GlobalContext* globalCtx, SkelAnime* skelAnime) {
|
||||
s32 LinkAnimation_Morph(PlayState* play, SkelAnime* skelAnime) {
|
||||
f32 prevMorphWeight = skelAnime->morphWeight;
|
||||
f32 updateRate = R_UPDATE_RATE * 0.5f;
|
||||
|
||||
@@ -1121,7 +1117,7 @@ s32 LinkAnimation_Morph(GlobalContext* globalCtx, SkelAnime* skelAnime) {
|
||||
LinkAnimation_SetUpdateFunction(skelAnime);
|
||||
}
|
||||
|
||||
AnimationContext_SetInterp(globalCtx, skelAnime->limbCount, skelAnime->jointTable, skelAnime->morphTable,
|
||||
AnimationContext_SetInterp(play, skelAnime->limbCount, skelAnime->jointTable, skelAnime->morphTable,
|
||||
1.0f - (skelAnime->morphWeight / prevMorphWeight));
|
||||
return 0;
|
||||
}
|
||||
@@ -1130,8 +1126,8 @@ s32 LinkAnimation_Morph(GlobalContext* globalCtx, SkelAnime* skelAnime) {
|
||||
* Requests a load of the next frame of a Link animation, advances the morph, and requests an interpolation between
|
||||
* jointTable and morphTable
|
||||
*/
|
||||
void LinkAnimation_AnimateFrame(GlobalContext* globalCtx, SkelAnime* skelAnime) {
|
||||
AnimationContext_SetLoadFrame(globalCtx, skelAnime->animation, skelAnime->curFrame, skelAnime->limbCount,
|
||||
void LinkAnimation_AnimateFrame(PlayState* play, SkelAnime* skelAnime) {
|
||||
AnimationContext_SetLoadFrame(play, skelAnime->animation, skelAnime->curFrame, skelAnime->limbCount,
|
||||
skelAnime->jointTable);
|
||||
if (skelAnime->morphWeight != 0) {
|
||||
f32 updateRate = R_UPDATE_RATE * 0.5f;
|
||||
@@ -1140,7 +1136,7 @@ void LinkAnimation_AnimateFrame(GlobalContext* globalCtx, SkelAnime* skelAnime)
|
||||
if (skelAnime->morphWeight <= 0.0f) {
|
||||
skelAnime->morphWeight = 0.0f;
|
||||
} else {
|
||||
AnimationContext_SetInterp(globalCtx, skelAnime->limbCount, skelAnime->jointTable, skelAnime->morphTable,
|
||||
AnimationContext_SetInterp(play, skelAnime->limbCount, skelAnime->jointTable, skelAnime->morphTable,
|
||||
skelAnime->morphWeight);
|
||||
}
|
||||
}
|
||||
@@ -1149,7 +1145,7 @@ void LinkAnimation_AnimateFrame(GlobalContext* globalCtx, SkelAnime* skelAnime)
|
||||
/**
|
||||
* Advances a Link animation that loops over its full length
|
||||
*/
|
||||
s32 LinkAnimation_Loop(GlobalContext* globalCtx, SkelAnime* skelAnime) {
|
||||
s32 LinkAnimation_Loop(PlayState* play, SkelAnime* skelAnime) {
|
||||
f32 updateRate = R_UPDATE_RATE * 0.5f;
|
||||
|
||||
skelAnime->curFrame += skelAnime->playSpeed * updateRate;
|
||||
@@ -1158,18 +1154,18 @@ s32 LinkAnimation_Loop(GlobalContext* globalCtx, SkelAnime* skelAnime) {
|
||||
} else if (skelAnime->animLength <= skelAnime->curFrame) {
|
||||
skelAnime->curFrame -= skelAnime->animLength;
|
||||
}
|
||||
LinkAnimation_AnimateFrame(globalCtx, skelAnime);
|
||||
LinkAnimation_AnimateFrame(play, skelAnime);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Advances a Link animation that stops at endFrame and returns true when it is reached.
|
||||
*/
|
||||
s32 LinkAnimation_Once(GlobalContext* globalCtx, SkelAnime* skelAnime) {
|
||||
s32 LinkAnimation_Once(PlayState* play, SkelAnime* skelAnime) {
|
||||
f32 updateRate = R_UPDATE_RATE * 0.5f;
|
||||
|
||||
if (skelAnime->curFrame == skelAnime->endFrame) {
|
||||
LinkAnimation_AnimateFrame(globalCtx, skelAnime);
|
||||
LinkAnimation_AnimateFrame(play, skelAnime);
|
||||
return 1;
|
||||
}
|
||||
skelAnime->curFrame += skelAnime->playSpeed * updateRate;
|
||||
@@ -1180,14 +1176,14 @@ s32 LinkAnimation_Once(GlobalContext* globalCtx, SkelAnime* skelAnime) {
|
||||
} else if (skelAnime->animLength <= skelAnime->curFrame) {
|
||||
skelAnime->curFrame -= skelAnime->animLength;
|
||||
}
|
||||
LinkAnimation_AnimateFrame(globalCtx, skelAnime);
|
||||
LinkAnimation_AnimateFrame(play, skelAnime);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a new morph and resets the morph weight for the current animation.
|
||||
*/
|
||||
void Animation_SetMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, f32 morphFrames) {
|
||||
void Animation_SetMorph(PlayState* play, SkelAnime* skelAnime, f32 morphFrames) {
|
||||
skelAnime->morphWeight = 1.0f;
|
||||
skelAnime->morphRate = 1.0f / morphFrames;
|
||||
}
|
||||
@@ -1198,7 +1194,7 @@ void Animation_SetMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, f32 morp
|
||||
* animation, then start the new animation. Negative morph frames start the new animation immediately, modified by the
|
||||
* pose immediately before the animation change.
|
||||
*/
|
||||
void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 playSpeed,
|
||||
void LinkAnimation_Change(PlayState* play, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 playSpeed,
|
||||
f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames) {
|
||||
skelAnime->mode = mode;
|
||||
if ((morphFrames != 0.0f) && ((animation != skelAnime->animation) || (startFrame != skelAnime->curFrame))) {
|
||||
@@ -1208,15 +1204,14 @@ void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAn
|
||||
morphFrames = -morphFrames;
|
||||
} else {
|
||||
skelAnime->update = LinkAnimation_Morph;
|
||||
AnimationContext_SetLoadFrame(globalCtx, animation, (s32)startFrame, skelAnime->limbCount,
|
||||
AnimationContext_SetLoadFrame(play, animation, (s32)startFrame, skelAnime->limbCount,
|
||||
skelAnime->morphTable);
|
||||
}
|
||||
skelAnime->morphWeight = 1.0f;
|
||||
skelAnime->morphRate = 1.0f / morphFrames;
|
||||
} else {
|
||||
LinkAnimation_SetUpdateFunction(skelAnime);
|
||||
AnimationContext_SetLoadFrame(globalCtx, animation, (s32)startFrame, skelAnime->limbCount,
|
||||
skelAnime->jointTable);
|
||||
AnimationContext_SetLoadFrame(play, animation, (s32)startFrame, skelAnime->limbCount, skelAnime->jointTable);
|
||||
skelAnime->morphWeight = 0.0f;
|
||||
}
|
||||
|
||||
@@ -1232,105 +1227,101 @@ void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAn
|
||||
/**
|
||||
* Immediately changes to a Link animation that plays once at the default speed.
|
||||
*/
|
||||
void LinkAnimation_PlayOnce(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation) {
|
||||
LinkAnimation_Change(globalCtx, skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_ONCE,
|
||||
void LinkAnimation_PlayOnce(PlayState* play, SkelAnime* skelAnime, LinkAnimationHeader* animation) {
|
||||
LinkAnimation_Change(play, skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_ONCE,
|
||||
0.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Immediately changes to a Link animation that plays once at the specified speed.
|
||||
*/
|
||||
void LinkAnimation_PlayOnceSetSpeed(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation,
|
||||
void LinkAnimation_PlayOnceSetSpeed(PlayState* play, SkelAnime* skelAnime, LinkAnimationHeader* animation,
|
||||
f32 playSpeed) {
|
||||
LinkAnimation_Change(globalCtx, skelAnime, animation, playSpeed, 0.0f, Animation_GetLastFrame(animation),
|
||||
ANIMMODE_ONCE, 0.0f);
|
||||
LinkAnimation_Change(play, skelAnime, animation, playSpeed, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_ONCE,
|
||||
0.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Immediately changes to a Link animation that loops at the default speed.
|
||||
*/
|
||||
void LinkAnimation_PlayLoop(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation) {
|
||||
LinkAnimation_Change(globalCtx, skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_LOOP,
|
||||
void LinkAnimation_PlayLoop(PlayState* play, SkelAnime* skelAnime, LinkAnimationHeader* animation) {
|
||||
LinkAnimation_Change(play, skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_LOOP,
|
||||
0.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Immediately changes to a Link animation that loops at the specified speed.
|
||||
*/
|
||||
void LinkAnimation_PlayLoopSetSpeed(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation,
|
||||
void LinkAnimation_PlayLoopSetSpeed(PlayState* play, SkelAnime* skelAnime, LinkAnimationHeader* animation,
|
||||
f32 playSpeed) {
|
||||
LinkAnimation_Change(globalCtx, skelAnime, animation, playSpeed, 0.0f, Animation_GetLastFrame(animation),
|
||||
ANIMMODE_LOOP, 0.0f);
|
||||
LinkAnimation_Change(play, skelAnime, animation, playSpeed, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_LOOP,
|
||||
0.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests copying jointTable to morphTable
|
||||
*/
|
||||
void LinkAnimation_CopyJointToMorph(GlobalContext* globalCtx, SkelAnime* skelAnime) {
|
||||
AnimationContext_SetCopyAll(globalCtx, skelAnime->limbCount, skelAnime->morphTable, skelAnime->jointTable);
|
||||
void LinkAnimation_CopyJointToMorph(PlayState* play, SkelAnime* skelAnime) {
|
||||
AnimationContext_SetCopyAll(play, skelAnime->limbCount, skelAnime->morphTable, skelAnime->jointTable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests copying morphTable to jointTable
|
||||
* unused
|
||||
*/
|
||||
void LinkAnimation_CopyMorphToJoint(GlobalContext* globalCtx, SkelAnime* skelAnime) {
|
||||
AnimationContext_SetCopyAll(globalCtx, skelAnime->limbCount, skelAnime->jointTable, skelAnime->morphTable);
|
||||
void LinkAnimation_CopyMorphToJoint(PlayState* play, SkelAnime* skelAnime) {
|
||||
AnimationContext_SetCopyAll(play, skelAnime->limbCount, skelAnime->jointTable, skelAnime->morphTable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests loading frame data from the Link animation into morphTable
|
||||
*/
|
||||
void LinkAnimation_LoadToMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation,
|
||||
f32 frame) {
|
||||
AnimationContext_SetLoadFrame(globalCtx, animation, (s32)frame, skelAnime->limbCount, skelAnime->morphTable);
|
||||
void LinkAnimation_LoadToMorph(PlayState* play, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 frame) {
|
||||
AnimationContext_SetLoadFrame(play, animation, (s32)frame, skelAnime->limbCount, skelAnime->morphTable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests loading frame data from the Link animation into jointTable
|
||||
*/
|
||||
void LinkAnimation_LoadToJoint(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation,
|
||||
f32 frame) {
|
||||
AnimationContext_SetLoadFrame(globalCtx, animation, (s32)frame, skelAnime->limbCount, skelAnime->jointTable);
|
||||
void LinkAnimation_LoadToJoint(PlayState* play, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 frame) {
|
||||
AnimationContext_SetLoadFrame(play, animation, (s32)frame, skelAnime->limbCount, skelAnime->jointTable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests interpolating between jointTable and morphTable, placing the result in jointTable
|
||||
*/
|
||||
void LinkAnimation_InterpJointMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, f32 weight) {
|
||||
AnimationContext_SetInterp(globalCtx, skelAnime->limbCount, skelAnime->jointTable, skelAnime->morphTable, weight);
|
||||
void LinkAnimation_InterpJointMorph(PlayState* play, SkelAnime* skelAnime, f32 weight) {
|
||||
AnimationContext_SetInterp(play, skelAnime->limbCount, skelAnime->jointTable, skelAnime->morphTable, weight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests loading frame data from the Link animations and blending them, placing the result in jointTable
|
||||
*/
|
||||
void LinkAnimation_BlendToJoint(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation1,
|
||||
f32 frame1, LinkAnimationHeader* animation2, f32 frame2, f32 blendWeight,
|
||||
Vec3s* blendTable) {
|
||||
void LinkAnimation_BlendToJoint(PlayState* play, SkelAnime* skelAnime, LinkAnimationHeader* animation1, f32 frame1,
|
||||
LinkAnimationHeader* animation2, f32 frame2, f32 blendWeight, Vec3s* blendTable) {
|
||||
Vec3s* alignedBlendTable;
|
||||
|
||||
AnimationContext_SetLoadFrame(globalCtx, animation1, (s32)frame1, skelAnime->limbCount, skelAnime->jointTable);
|
||||
AnimationContext_SetLoadFrame(play, animation1, (s32)frame1, skelAnime->limbCount, skelAnime->jointTable);
|
||||
|
||||
alignedBlendTable = (Vec3s*)ALIGN16((u32)blendTable);
|
||||
|
||||
AnimationContext_SetLoadFrame(globalCtx, animation2, (s32)frame2, skelAnime->limbCount, alignedBlendTable);
|
||||
AnimationContext_SetInterp(globalCtx, skelAnime->limbCount, skelAnime->jointTable, alignedBlendTable, blendWeight);
|
||||
AnimationContext_SetLoadFrame(play, animation2, (s32)frame2, skelAnime->limbCount, alignedBlendTable);
|
||||
AnimationContext_SetInterp(play, skelAnime->limbCount, skelAnime->jointTable, alignedBlendTable, blendWeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests loading frame data from the Link animations and blending them, placing the result in morphTable
|
||||
*/
|
||||
void LinkAnimation_BlendToMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation1,
|
||||
f32 frame1, LinkAnimationHeader* animation2, f32 frame2, f32 blendWeight,
|
||||
Vec3s* blendTable) {
|
||||
void LinkAnimation_BlendToMorph(PlayState* play, SkelAnime* skelAnime, LinkAnimationHeader* animation1, f32 frame1,
|
||||
LinkAnimationHeader* animation2, f32 frame2, f32 blendWeight, Vec3s* blendTable) {
|
||||
Vec3s* alignedBlendTable;
|
||||
|
||||
AnimationContext_SetLoadFrame(globalCtx, animation1, (s32)frame1, skelAnime->limbCount, skelAnime->morphTable);
|
||||
AnimationContext_SetLoadFrame(play, animation1, (s32)frame1, skelAnime->limbCount, skelAnime->morphTable);
|
||||
|
||||
alignedBlendTable = (Vec3s*)ALIGN16((u32)blendTable);
|
||||
|
||||
AnimationContext_SetLoadFrame(globalCtx, animation2, (s32)frame2, skelAnime->limbCount, alignedBlendTable);
|
||||
AnimationContext_SetInterp(globalCtx, skelAnime->limbCount, skelAnime->morphTable, alignedBlendTable, blendWeight);
|
||||
AnimationContext_SetLoadFrame(play, animation2, (s32)frame2, skelAnime->limbCount, alignedBlendTable);
|
||||
AnimationContext_SetInterp(play, skelAnime->limbCount, skelAnime->morphTable, alignedBlendTable, blendWeight);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1380,8 +1371,8 @@ s32 LinkAnimation_OnFrame(SkelAnime* skelAnime, f32 frame) {
|
||||
/**
|
||||
* Initializes a normal skeleton to a looping animation, dynamically allocating the frame tables if not provided.
|
||||
*/
|
||||
s32 SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg,
|
||||
AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) {
|
||||
s32 SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animation,
|
||||
Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) {
|
||||
SkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg);
|
||||
|
||||
skelAnime->limbCount = skeletonHeader->limbCount + 1;
|
||||
@@ -1410,7 +1401,7 @@ s32 SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeade
|
||||
/**
|
||||
* Initializes a flex skeleton to a looping animation, dynamically allocating the frame tables if not given.
|
||||
*/
|
||||
s32 SkelAnime_InitFlex(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg,
|
||||
s32 SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg,
|
||||
AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) {
|
||||
FlexSkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg);
|
||||
|
||||
@@ -1444,7 +1435,7 @@ s32 SkelAnime_InitFlex(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkele
|
||||
/**
|
||||
* Initializes a skeleton with SkinLimbs to a looping animation, dynamically allocating the frame tables.
|
||||
*/
|
||||
s32 SkelAnime_InitSkin(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg,
|
||||
s32 SkelAnime_InitSkin(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg,
|
||||
AnimationHeader* animation) {
|
||||
SkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg);
|
||||
|
||||
@@ -1839,7 +1830,7 @@ s32 Animation_OnFrame(SkelAnime* skelAnime, f32 frame) {
|
||||
/**
|
||||
* Frees the frame tables for a skelAnime with dynamically allocated tables.
|
||||
*/
|
||||
void SkelAnime_Free(SkelAnime* skelAnime, GlobalContext* globalCtx) {
|
||||
void SkelAnime_Free(SkelAnime* skelAnime, PlayState* play) {
|
||||
if (skelAnime->jointTable != NULL) {
|
||||
ZeldaArena_FreeDebug(skelAnime->jointTable, "../z_skelanime.c", 3729);
|
||||
} else {
|
||||
|
||||
+12
-12
@@ -185,12 +185,12 @@ void Skin_DrawLimb(GraphicsContext* gfxCtx, Skin* skin, s32 limbIndex, Gfx* dlis
|
||||
CLOSE_DISPS(gfxCtx, "../z_skin.c", 433);
|
||||
}
|
||||
|
||||
void Skin_DrawImpl(Actor* actor, GlobalContext* globalCtx, Skin* skin, SkinPostDraw postDraw,
|
||||
void Skin_DrawImpl(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw,
|
||||
SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation, s32 arg6, s32 drawFlags) {
|
||||
s32 i;
|
||||
s32 segmentType;
|
||||
SkinLimb** skeleton;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(gfxCtx, "../z_skin.c", 471);
|
||||
@@ -218,7 +218,7 @@ void Skin_DrawImpl(Actor* actor, GlobalContext* globalCtx, Skin* skin, SkinPostD
|
||||
s32 shouldDraw = true;
|
||||
|
||||
if (overrideLimbDraw != NULL) {
|
||||
shouldDraw = overrideLimbDraw(actor, globalCtx, i, skin);
|
||||
shouldDraw = overrideLimbDraw(actor, play, i, skin);
|
||||
}
|
||||
|
||||
segmentType = ((SkinLimb*)SEGMENTED_TO_VIRTUAL(skeleton[i]))->segmentType;
|
||||
@@ -231,7 +231,7 @@ void Skin_DrawImpl(Actor* actor, GlobalContext* globalCtx, Skin* skin, SkinPostD
|
||||
}
|
||||
|
||||
if (postDraw != NULL) {
|
||||
postDraw(actor, globalCtx, skin);
|
||||
postDraw(actor, play, skin);
|
||||
}
|
||||
|
||||
close_disps:
|
||||
@@ -239,26 +239,26 @@ close_disps:
|
||||
}
|
||||
|
||||
// allows specifying PostLimbDraw and setTranslation
|
||||
void func_800A6330(Actor* actor, GlobalContext* globalCtx, Skin* skin, SkinPostDraw postDraw, s32 setTranslation) {
|
||||
Skin_DrawImpl(actor, globalCtx, skin, postDraw, NULL, setTranslation, false, 0);
|
||||
void func_800A6330(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw, s32 setTranslation) {
|
||||
Skin_DrawImpl(actor, play, skin, postDraw, NULL, setTranslation, false, 0);
|
||||
}
|
||||
|
||||
// allows specifying OverrideLimbDraw, PostLimbDraw and setTranslation
|
||||
void func_800A6360(Actor* actor, GlobalContext* globalCtx, Skin* skin, SkinPostDraw postDraw,
|
||||
void func_800A6360(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw,
|
||||
SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation) {
|
||||
Skin_DrawImpl(actor, globalCtx, skin, postDraw, overrideLimbDraw, setTranslation, false, 0);
|
||||
Skin_DrawImpl(actor, play, skin, postDraw, overrideLimbDraw, setTranslation, false, 0);
|
||||
}
|
||||
|
||||
// allows specifying OverrideLimbDraw, PostLimbDraw, setTranslation, and arg6
|
||||
void func_800A6394(Actor* actor, GlobalContext* globalCtx, Skin* skin, SkinPostDraw postDraw,
|
||||
void func_800A6394(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw,
|
||||
SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation, s32 arg6) {
|
||||
Skin_DrawImpl(actor, globalCtx, skin, postDraw, overrideLimbDraw, setTranslation, arg6, 0);
|
||||
Skin_DrawImpl(actor, play, skin, postDraw, overrideLimbDraw, setTranslation, arg6, 0);
|
||||
}
|
||||
|
||||
// allows specifying all variables
|
||||
void func_800A63CC(Actor* actor, GlobalContext* globalCtx, Skin* skin, SkinPostDraw postDraw,
|
||||
void func_800A63CC(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw,
|
||||
SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation, s32 arg6, s32 drawFlags) {
|
||||
Skin_DrawImpl(actor, globalCtx, skin, postDraw, overrideLimbDraw, setTranslation, arg6, drawFlags);
|
||||
Skin_DrawImpl(actor, play, skin, postDraw, overrideLimbDraw, setTranslation, arg6, drawFlags);
|
||||
}
|
||||
|
||||
void Skin_GetLimbPos(Skin* skin, s32 limbIndex, Vec3f* offset, Vec3f* dst) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/**
|
||||
* Initialises the Vtx buffers used for limb at index `limbIndex`
|
||||
*/
|
||||
void Skin_InitAnimatedLimb(GlobalContext* globalCtx, Skin* skin, s32 limbIndex) {
|
||||
void Skin_InitAnimatedLimb(PlayState* play, Skin* skin, s32 limbIndex) {
|
||||
s32 i;
|
||||
SkinLimb** skeleton = SEGMENTED_TO_VIRTUAL(skin->skeletonHeader->segment);
|
||||
SkinAnimatedLimbData* animatedLimbData =
|
||||
@@ -36,7 +36,7 @@ void Skin_InitAnimatedLimb(GlobalContext* globalCtx, Skin* skin, s32 limbIndex)
|
||||
* Initializes a skin skeleton to looping animation, dynamically allocating the frame tables,
|
||||
* and dynamically allocating and initializing the Vtx and SkinLimbVtx buffers for its animated limbs
|
||||
*/
|
||||
void Skin_Init(GlobalContext* globalCtx, Skin* skin, SkeletonHeader* skeletonHeader, AnimationHeader* animationHeader) {
|
||||
void Skin_Init(PlayState* play, Skin* skin, SkeletonHeader* skeletonHeader, AnimationHeader* animationHeader) {
|
||||
s32 limbCount;
|
||||
s32 i;
|
||||
SkinLimb** skeleton;
|
||||
@@ -74,17 +74,17 @@ void Skin_Init(GlobalContext* globalCtx, Skin* skin, SkeletonHeader* skeletonHea
|
||||
ZeldaArena_MallocDebug(animatedLimbData->totalVtxCount * sizeof(Vtx), "../z_skin_awb.c", 240);
|
||||
ASSERT(vtxEntry->buf[1] != NULL, "psavb->buf[1] != NULL", "../z_skin_awb.c", 242);
|
||||
|
||||
Skin_InitAnimatedLimb(globalCtx, skin, i);
|
||||
Skin_InitAnimatedLimb(play, skin, i);
|
||||
}
|
||||
}
|
||||
|
||||
SkelAnime_InitSkin(globalCtx, &skin->skelAnime, skeletonHeader, animationHeader);
|
||||
SkelAnime_InitSkin(play, &skin->skelAnime, skeletonHeader, animationHeader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Frees the dynamically allocated Vtx and SkinLimbVtx buffers and tables
|
||||
*/
|
||||
void Skin_Free(GlobalContext* globalCtx, Skin* skin) {
|
||||
void Skin_Free(PlayState* play, Skin* skin) {
|
||||
if (skin->vtxTable != NULL) {
|
||||
s32 i;
|
||||
|
||||
@@ -103,7 +103,7 @@ void Skin_Free(GlobalContext* globalCtx, Skin* skin) {
|
||||
ZeldaArena_FreeDebug(skin->vtxTable, "../z_skin_awb.c", 286);
|
||||
}
|
||||
|
||||
SkelAnime_Free(&skin->skelAnime, globalCtx);
|
||||
SkelAnime_Free(&skin->skelAnime, play);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
-12
@@ -1,24 +1,24 @@
|
||||
#include "global.h"
|
||||
|
||||
void SoundSource_InitAll(GlobalContext* globalCtx) {
|
||||
SoundSource* sources = &globalCtx->soundSources[0];
|
||||
void SoundSource_InitAll(PlayState* play) {
|
||||
SoundSource* sources = &play->soundSources[0];
|
||||
s32 i;
|
||||
|
||||
// clang-format off
|
||||
for (i = 0; i < ARRAY_COUNT(globalCtx->soundSources); i++) { sources[i].countdown = 0; }
|
||||
for (i = 0; i < ARRAY_COUNT(play->soundSources); i++) { sources[i].countdown = 0; }
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
void SoundSource_UpdateAll(GlobalContext* globalCtx) {
|
||||
SoundSource* source = &globalCtx->soundSources[0];
|
||||
void SoundSource_UpdateAll(PlayState* play) {
|
||||
SoundSource* source = &play->soundSources[0];
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(globalCtx->soundSources); i++) {
|
||||
for (i = 0; i < ARRAY_COUNT(play->soundSources); i++) {
|
||||
if (source->countdown != 0) {
|
||||
if (DECR(source->countdown) == 0) {
|
||||
Audio_StopSfxByPos(&source->projectedPos);
|
||||
} else {
|
||||
SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->viewProjectionMtxF, &source->worldPos, &source->projectedPos);
|
||||
SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &source->worldPos, &source->projectedPos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,15 +26,15 @@ void SoundSource_UpdateAll(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
void SoundSource_PlaySfxAtFixedWorldPos(GlobalContext* globalCtx, Vec3f* worldPos, s32 duration, u16 sfxId) {
|
||||
void SoundSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, s32 duration, u16 sfxId) {
|
||||
s32 countdown;
|
||||
SoundSource* source;
|
||||
s32 smallestCountdown = 0xFFFF;
|
||||
SoundSource* backupSource;
|
||||
s32 i;
|
||||
|
||||
source = &globalCtx->soundSources[0];
|
||||
for (i = 0; i < ARRAY_COUNT(globalCtx->soundSources); i++) {
|
||||
source = &play->soundSources[0];
|
||||
for (i = 0; i < ARRAY_COUNT(play->soundSources); i++) {
|
||||
if (source->countdown == 0) {
|
||||
break;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ void SoundSource_PlaySfxAtFixedWorldPos(GlobalContext* globalCtx, Vec3f* worldPo
|
||||
}
|
||||
|
||||
// If no sound source is available, replace the sound source with the smallest remaining countdown
|
||||
if (i >= ARRAY_COUNT(globalCtx->soundSources)) {
|
||||
if (i >= ARRAY_COUNT(play->soundSources)) {
|
||||
source = backupSource;
|
||||
Audio_StopSfxByPos(&source->projectedPos);
|
||||
}
|
||||
@@ -57,7 +57,7 @@ void SoundSource_PlaySfxAtFixedWorldPos(GlobalContext* globalCtx, Vec3f* worldPo
|
||||
source->worldPos = *worldPos;
|
||||
source->countdown = duration;
|
||||
|
||||
SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->viewProjectionMtxF, &source->worldPos, &source->projectedPos);
|
||||
SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &source->worldPos, &source->projectedPos);
|
||||
Audio_PlaySoundGeneral(sfxId, &source->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
}
|
||||
|
||||
+1
-1
@@ -899,5 +899,5 @@ void Sram_Alloc(GameState* gameState, SramContext* sramCtx) {
|
||||
ASSERT(sramCtx->readBuff != NULL, "sram->read_buff != NULL", "../z_sram.c", 1295);
|
||||
}
|
||||
|
||||
void Sram_Init(GlobalContext* globalCtx, SramContext* sramCtx) {
|
||||
void Sram_Init(PlayState* play, SramContext* sramCtx) {
|
||||
}
|
||||
|
||||
+61
-63
@@ -370,7 +370,7 @@ void func_800AF178(SkyboxContext* skyboxCtx, s32 arg1) {
|
||||
}
|
||||
}
|
||||
|
||||
void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
||||
void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
||||
u32 size;
|
||||
s16 i;
|
||||
u8 skybox1Index;
|
||||
@@ -390,25 +390,23 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
if (gSaveContext.skyboxTime >= gTimeBasedSkyboxConfigs[skyboxConfig][i].startTime &&
|
||||
(gSaveContext.skyboxTime < gTimeBasedSkyboxConfigs[skyboxConfig][i].endTime ||
|
||||
gTimeBasedSkyboxConfigs[skyboxConfig][i].endTime == 0xFFFF)) {
|
||||
globalCtx->envCtx.skybox1Index = skybox1Index =
|
||||
gTimeBasedSkyboxConfigs[skyboxConfig][i].skybox1Index;
|
||||
globalCtx->envCtx.skybox2Index = skybox2Index =
|
||||
gTimeBasedSkyboxConfigs[skyboxConfig][i].skybox2Index;
|
||||
play->envCtx.skybox1Index = skybox1Index = gTimeBasedSkyboxConfigs[skyboxConfig][i].skybox1Index;
|
||||
play->envCtx.skybox2Index = skybox2Index = gTimeBasedSkyboxConfigs[skyboxConfig][i].skybox2Index;
|
||||
if (gTimeBasedSkyboxConfigs[skyboxConfig][i].changeSkybox) {
|
||||
globalCtx->envCtx.skyboxBlend =
|
||||
play->envCtx.skyboxBlend =
|
||||
Environment_LerpWeight(gTimeBasedSkyboxConfigs[skyboxConfig][i].endTime,
|
||||
gTimeBasedSkyboxConfigs[skyboxConfig][i].startTime,
|
||||
((void)0, gSaveContext.skyboxTime)) *
|
||||
255.0f;
|
||||
} else {
|
||||
globalCtx->envCtx.skyboxBlend = 0;
|
||||
play->envCtx.skyboxBlend = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
size = gNormalSkyFiles[skybox1Index].file.vromEnd - gNormalSkyFiles[skybox1Index].file.vromStart;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1054);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1054);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1055);
|
||||
|
||||
@@ -416,7 +414,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
"../z_vr_box.c", 1058);
|
||||
|
||||
size = gNormalSkyFiles[skybox2Index].file.vromEnd - gNormalSkyFiles[skybox2Index].file.vromStart;
|
||||
skyboxCtx->staticSegments[1] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1060);
|
||||
skyboxCtx->staticSegments[1] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1060);
|
||||
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
|
||||
1061);
|
||||
|
||||
@@ -426,7 +424,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
if ((skybox1Index & 1) ^ ((skybox1Index & 4) >> 2)) {
|
||||
size = gNormalSkyFiles[skybox1Index].palette.vromEnd - gNormalSkyFiles[skybox1Index].palette.vromStart;
|
||||
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size * 2, "../z_vr_box.c", 1072);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1072);
|
||||
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1073);
|
||||
|
||||
@@ -437,7 +435,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
} else {
|
||||
size = gNormalSkyFiles[skybox1Index].palette.vromEnd - gNormalSkyFiles[skybox1Index].palette.vromStart;
|
||||
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size * 2, "../z_vr_box.c", 1085);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1085);
|
||||
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1086);
|
||||
|
||||
@@ -453,7 +451,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_SP1a_staticSegmentRomStart;
|
||||
size = _vr_SP1a_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1127);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1127);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1128);
|
||||
|
||||
@@ -461,7 +459,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_SP1a_pal_staticSegmentRomStart;
|
||||
size = _vr_SP1a_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1132);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1132);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1133);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1134);
|
||||
@@ -470,13 +468,13 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
case SKYBOX_OVERCAST_SUNSET:
|
||||
start = _vr_cloud2_staticSegmentRomStart;
|
||||
size = _vr_cloud2_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1155);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1155);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1156);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1159);
|
||||
|
||||
skyboxCtx->staticSegments[1] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1162);
|
||||
skyboxCtx->staticSegments[1] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1162);
|
||||
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
|
||||
1163);
|
||||
|
||||
@@ -484,7 +482,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_cloud2_pal_staticSegmentRomStart;
|
||||
size = _vr_cloud2_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size * 2, "../z_vr_box.c", 1170);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1170);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1171);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1173);
|
||||
@@ -495,7 +493,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_RUVR_staticSegmentRomStart;
|
||||
size = _vr_RUVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1182);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1182);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1183);
|
||||
|
||||
@@ -505,7 +503,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
size = _vr_RUVR_pal_staticSegmentRomEnd - start;
|
||||
osSyncPrintf("SIZE = %d\n", size);
|
||||
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1188);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1188);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1189);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1190);
|
||||
@@ -513,7 +511,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
case SKYBOX_CUTSCENE_MAP:
|
||||
start = _vr_holy0_staticSegmentRomStart;
|
||||
size = _vr_holy0_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1196);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1196);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1197);
|
||||
|
||||
@@ -521,7 +519,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_holy1_staticSegmentRomStart;
|
||||
size = _vr_holy1_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[1] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1203);
|
||||
skyboxCtx->staticSegments[1] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1203);
|
||||
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
|
||||
1204);
|
||||
|
||||
@@ -529,7 +527,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_holy0_pal_staticSegmentRomStart;
|
||||
size = _vr_holy0_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size * 2, "../z_vr_box.c", 1211);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1211);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1212);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1214);
|
||||
@@ -541,7 +539,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_LHVR_staticSegmentRomStart;
|
||||
size = _vr_LHVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1226);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1226);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1227);
|
||||
|
||||
@@ -549,7 +547,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_LHVR_pal_staticSegmentRomStart;
|
||||
size = _vr_LHVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1231);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1231);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1232);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1233);
|
||||
@@ -559,7 +557,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_MDVR_staticSegmentRomStart;
|
||||
size = _vr_MDVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1257);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1257);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1258);
|
||||
|
||||
@@ -567,7 +565,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_MDVR_pal_staticSegmentRomStart;
|
||||
size = _vr_MDVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1262);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1262);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1263);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1264);
|
||||
@@ -577,7 +575,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_MNVR_staticSegmentRomStart;
|
||||
size = _vr_MNVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1271);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1271);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1272);
|
||||
|
||||
@@ -587,7 +585,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
size = _vr_MNVR_pal_staticSegmentRomEnd - start;
|
||||
osSyncPrintf("SIZE = %d\n", size);
|
||||
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1277);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1277);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1278);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1279);
|
||||
@@ -597,7 +595,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_FCVR_staticSegmentRomStart;
|
||||
size = _vr_FCVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1286);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1286);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1287);
|
||||
|
||||
@@ -605,7 +603,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_FCVR_pal_staticSegmentRomStart;
|
||||
size = _vr_FCVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1291);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1291);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1292);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1293);
|
||||
@@ -616,7 +614,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_KHVR_staticSegmentRomStart;
|
||||
size = _vr_KHVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1301);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1301);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1302);
|
||||
|
||||
@@ -624,7 +622,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_KHVR_pal_staticSegmentRomStart;
|
||||
size = _vr_KHVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1306);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1306);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1307);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1308);
|
||||
@@ -634,7 +632,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_K3VR_staticSegmentRomStart;
|
||||
size = _vr_K3VR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1331);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1331);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1332);
|
||||
|
||||
@@ -642,7 +640,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_K3VR_pal_staticSegmentRomStart;
|
||||
size = _vr_K3VR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1336);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1336);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1337);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1338);
|
||||
@@ -652,7 +650,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_MLVR_staticSegmentRomStart;
|
||||
size = _vr_MLVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1345);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1345);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1346);
|
||||
|
||||
@@ -660,7 +658,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_MLVR_pal_staticSegmentRomStart;
|
||||
size = _vr_MLVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1350);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1350);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1351);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1352);
|
||||
@@ -670,7 +668,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_KKRVR_staticSegmentRomStart;
|
||||
size = _vr_KKRVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1359);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1359);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1360);
|
||||
|
||||
@@ -678,7 +676,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_KKRVR_pal_staticSegmentRomStart;
|
||||
size = _vr_KKRVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1364);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1364);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1365);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1366);
|
||||
@@ -688,7 +686,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_KSVR_staticSegmentRomStart;
|
||||
size = _vr_KSVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1373);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1373);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1374);
|
||||
|
||||
@@ -696,7 +694,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_KSVR_pal_staticSegmentRomStart;
|
||||
size = _vr_KSVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1378);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1378);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1379);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1380);
|
||||
@@ -707,7 +705,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_GLVR_staticSegmentRomStart;
|
||||
size = _vr_GLVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1405);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1405);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1406);
|
||||
|
||||
@@ -715,7 +713,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_GLVR_pal_staticSegmentRomStart;
|
||||
size = _vr_GLVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1410);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1410);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1411);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1412);
|
||||
@@ -726,7 +724,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_ZRVR_staticSegmentRomStart;
|
||||
size = _vr_ZRVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1420);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1420);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1421);
|
||||
|
||||
@@ -734,7 +732,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_ZRVR_pal_staticSegmentRomStart;
|
||||
size = _vr_ZRVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1425);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1425);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1426);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1427);
|
||||
@@ -745,7 +743,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_DGVR_staticSegmentRomStart;
|
||||
size = _vr_DGVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1451);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1451);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1452);
|
||||
|
||||
@@ -753,7 +751,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_DGVR_pal_staticSegmentRomStart;
|
||||
size = _vr_DGVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1456);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1456);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1457);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1458);
|
||||
@@ -764,7 +762,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_ALVR_staticSegmentRomStart;
|
||||
size = _vr_ALVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1466);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1466);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1467);
|
||||
|
||||
@@ -772,7 +770,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_ALVR_pal_staticSegmentRomStart;
|
||||
size = _vr_ALVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1471);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1471);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1472);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1473);
|
||||
@@ -783,7 +781,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_NSVR_staticSegmentRomStart;
|
||||
size = _vr_NSVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1481);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1481);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1482);
|
||||
|
||||
@@ -791,7 +789,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_NSVR_pal_staticSegmentRomStart;
|
||||
size = _vr_NSVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1486);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1486);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1487);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1488);
|
||||
@@ -802,7 +800,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_IPVR_staticSegmentRomStart;
|
||||
size = _vr_IPVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1512);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1512);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1513);
|
||||
|
||||
@@ -810,7 +808,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_IPVR_pal_staticSegmentRomStart;
|
||||
size = _vr_IPVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1517);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1517);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1518);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1519);
|
||||
@@ -820,7 +818,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_LBVR_staticSegmentRomStart;
|
||||
size = _vr_LBVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1526);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1526);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1527);
|
||||
|
||||
@@ -828,7 +826,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_LBVR_pal_staticSegmentRomStart;
|
||||
size = _vr_LBVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1531);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1531);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1532);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1533);
|
||||
@@ -838,7 +836,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_TTVR_staticSegmentRomStart;
|
||||
size = _vr_TTVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1540);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1540);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1541);
|
||||
|
||||
@@ -846,7 +844,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_TTVR_pal_staticSegmentRomStart;
|
||||
size = _vr_TTVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1545);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1545);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1546);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1547);
|
||||
@@ -856,7 +854,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_K4VR_staticSegmentRomStart;
|
||||
size = _vr_K4VR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1560);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1560);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1561);
|
||||
|
||||
@@ -864,7 +862,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_K4VR_pal_staticSegmentRomStart;
|
||||
size = _vr_K4VR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1565);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1565);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1566);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1567);
|
||||
@@ -874,7 +872,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_K5VR_staticSegmentRomStart;
|
||||
size = _vr_K5VR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1574);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1574);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1575);
|
||||
|
||||
@@ -882,7 +880,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_K5VR_pal_staticSegmentRomStart;
|
||||
size = _vr_K5VR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1579);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1579);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1580);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1581);
|
||||
@@ -892,7 +890,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_KR3VR_staticSegmentRomStart;
|
||||
size = _vr_KR3VR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1588);
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1588);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1589);
|
||||
|
||||
@@ -900,7 +898,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
|
||||
start = _vr_KR3VR_pal_staticSegmentRomStart;
|
||||
size = _vr_KR3VR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1593);
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1593);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1594);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1595);
|
||||
@@ -911,12 +909,12 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
}
|
||||
|
||||
void Skybox_Init(GameState* state, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
||||
GlobalContext* globalCtx = (GlobalContext*)state;
|
||||
PlayState* play = (PlayState*)state;
|
||||
|
||||
skyboxCtx->unk_140 = 0;
|
||||
skyboxCtx->rot.x = skyboxCtx->rot.y = skyboxCtx->rot.z = 0.0f;
|
||||
|
||||
Skybox_Setup(globalCtx, skyboxCtx, skyboxId);
|
||||
Skybox_Setup(play, skyboxCtx, skyboxId);
|
||||
osSyncPrintf("\n\n\n********************\n\n\n"
|
||||
"TYPE=%d"
|
||||
"\n\n\n********************\n\n\n",
|
||||
|
||||
Reference in New Issue
Block a user