mirror of
https://github.com/zeldaret/mm.git
synced 2026-07-10 22:11:46 -04:00
Add a z64play.h header (#1646)
* z64play.h * Move macros, functions and variables to header * cleanup * Reduce needed headers on z_collision_check * Change play functions to take PlayState * Move `Actor_ProcessInitChain` to `ichain.h` * format * Update src/code/z_play.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Add macros.h to sys_math3d.c * Rename SequenceContext to SceneSequences --------- Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
* Maths library: two factorials, integer power, wrappers for libultra's sins and coss (the main ones used), and some
|
||||
* random functions moved from OoT's z_actor
|
||||
*/
|
||||
|
||||
#include "global.h"
|
||||
|
||||
static f32 sFactorialTbl[] = {
|
||||
|
||||
@@ -38,11 +38,11 @@ struct Dummy227 { int x; };
|
||||
#include "PR/gu.h"
|
||||
// The bss index at this point should be 184
|
||||
|
||||
#include "macros.h"
|
||||
|
||||
Vec3f gZeroVec3f = { 0.0f, 0.0f, 0.0f };
|
||||
Vec3s gZeroVec3s = { 0, 0, 0 };
|
||||
|
||||
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
f32 Math3D_Normalize(Vec3f* vec) {
|
||||
f32 magnitude = Math3D_Vec3fMagnitude(vec);
|
||||
|
||||
|
||||
+1
-1
@@ -3184,7 +3184,7 @@ void Actor_CleanupContext(ActorContext* actorCtx, PlayState* play) {
|
||||
actorCtx->absoluteSpace = NULL;
|
||||
}
|
||||
|
||||
Play_SaveCycleSceneFlags(&play->state);
|
||||
Play_SaveCycleSceneFlags(play);
|
||||
ActorOverlayTable_Cleanup();
|
||||
}
|
||||
|
||||
|
||||
+233
-202
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -440,7 +440,7 @@ void CutsceneCmd_FadeOutSequence(PlayState* play, CutsceneContext* csCtx, CsCmdF
|
||||
|
||||
void CutsceneCmd_StartAmbience(PlayState* play, CutsceneContext* csCtx, CsCmdStartAmbience* cmd) {
|
||||
if (csCtx->curFrame == cmd->startFrame) {
|
||||
Audio_PlayAmbience(play->sequenceCtx.ambienceId);
|
||||
Audio_PlayAmbience(play->sceneSequences.ambienceId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -166,7 +166,7 @@ void Effect_Add(PlayState* play, s32* pIndex, EffectType type, u8 arg3, u8 arg4,
|
||||
|
||||
*pIndex = TOTAL_EFFECT_COUNT;
|
||||
|
||||
if (FrameAdvance_IsEnabled(&play->state) != true) {
|
||||
if (FrameAdvance_IsEnabled(play) != true) {
|
||||
slotFound = false;
|
||||
switch (type) {
|
||||
case EFFECT_SPARK:
|
||||
|
||||
@@ -159,7 +159,7 @@ s32 EffectSS_FindFreeSpace(s32 priority, s32* tableEntry) {
|
||||
void EffectSS_Copy(PlayState* play, EffectSs* effectsSs) {
|
||||
s32 index;
|
||||
|
||||
if (FrameAdvance_IsEnabled(&play->state) != true) {
|
||||
if (FrameAdvance_IsEnabled(play) != true) {
|
||||
if (EffectSS_FindFreeSpace(effectsSs->priority, &index) == 0) {
|
||||
sEffectSsInfo.searchIndex = index + 1;
|
||||
sEffectSsInfo.dataTable[index] = *effectsSs;
|
||||
|
||||
@@ -75,7 +75,7 @@ void GameOver_Update(PlayState* play) {
|
||||
|
||||
case GAMEOVER_DEATH_FADE_OUT:
|
||||
if (AudioSeq_GetActiveSeqId(SEQ_PLAYER_FANFARE) != NA_BGM_GAME_OVER) {
|
||||
func_80169F78(&play->state);
|
||||
func_80169F78(play);
|
||||
if (gSaveContext.respawnFlag != -7) {
|
||||
gSaveContext.respawnFlag = -6;
|
||||
}
|
||||
|
||||
+22
-22
@@ -1204,7 +1204,7 @@ void Environment_UpdateTime(PlayState* play, EnvironmentContext* envCtx, PauseCo
|
||||
(msgCtx->currentTextId == 0x140C) ||
|
||||
((msgCtx->currentTextId >= 0x100) && (msgCtx->currentTextId <= 0x200)) ||
|
||||
(gSaveContext.gameMode == GAMEMODE_END_CREDITS)) {
|
||||
if (!FrameAdvance_IsEnabled(&play->state) &&
|
||||
if (!FrameAdvance_IsEnabled(play) &&
|
||||
((play->transitionMode == TRANS_MODE_OFF) || (gSaveContext.gameMode != GAMEMODE_NORMAL))) {
|
||||
if (play->transitionTrigger == TRANS_TRIGGER_OFF) {
|
||||
if ((CutsceneManager_GetCurrentCsId() == CS_ID_NONE) && !Play_InCsMode(play)) {
|
||||
@@ -2436,28 +2436,28 @@ void Environment_PlaySceneSequence(PlayState* play) {
|
||||
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
|
||||
} else if (!Environment_IsFinalHours(play) || func_800FE5D0(play) ||
|
||||
(AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_FINAL_HOURS)) {
|
||||
if (play->sequenceCtx.seqId == NA_BGM_NO_MUSIC) {
|
||||
if (play->sequenceCtx.ambienceId == AMBIENCE_ID_13) {
|
||||
if (play->sceneSequences.seqId == NA_BGM_NO_MUSIC) {
|
||||
if (play->sceneSequences.ambienceId == AMBIENCE_ID_13) {
|
||||
return;
|
||||
}
|
||||
if (play->sequenceCtx.ambienceId != ((void)0, gSaveContext.ambienceId)) {
|
||||
Audio_PlayAmbience(play->sequenceCtx.ambienceId);
|
||||
if (play->sceneSequences.ambienceId != ((void)0, gSaveContext.ambienceId)) {
|
||||
Audio_PlayAmbience(play->sceneSequences.ambienceId);
|
||||
}
|
||||
} else if (play->sequenceCtx.ambienceId == AMBIENCE_ID_13) {
|
||||
if (play->sequenceCtx.seqId != ((void)0, gSaveContext.seqId)) {
|
||||
Audio_PlaySceneSequence(play->sequenceCtx.seqId, dayMinusOne);
|
||||
} else if (play->sceneSequences.ambienceId == AMBIENCE_ID_13) {
|
||||
if (play->sceneSequences.seqId != ((void)0, gSaveContext.seqId)) {
|
||||
Audio_PlaySceneSequence(play->sceneSequences.seqId, dayMinusOne);
|
||||
}
|
||||
} else if ((CURRENT_TIME >= CLOCK_TIME(6, 0)) && (CURRENT_TIME <= CLOCK_TIME(17, 10))) {
|
||||
if (gSceneSeqState != SCENESEQ_DEFAULT) {
|
||||
Audio_PlayMorningSceneSequence(play->sequenceCtx.seqId, dayMinusOne);
|
||||
Audio_PlayMorningSceneSequence(play->sceneSequences.seqId, dayMinusOne);
|
||||
} else if ((CURRENT_TIME >= CLOCK_TIME(6, 1)) &&
|
||||
(play->sequenceCtx.seqId != ((void)0, gSaveContext.seqId))) {
|
||||
Audio_PlaySceneSequence(play->sequenceCtx.seqId, dayMinusOne);
|
||||
(play->sceneSequences.seqId != ((void)0, gSaveContext.seqId))) {
|
||||
Audio_PlaySceneSequence(play->sceneSequences.seqId, dayMinusOne);
|
||||
}
|
||||
play->envCtx.timeSeqState = TIMESEQ_FADE_DAY_BGM;
|
||||
} else {
|
||||
if (play->sequenceCtx.ambienceId != ((void)0, gSaveContext.ambienceId)) {
|
||||
Audio_PlayAmbience(play->sequenceCtx.ambienceId);
|
||||
if (play->sceneSequences.ambienceId != ((void)0, gSaveContext.ambienceId)) {
|
||||
Audio_PlayAmbience(play->sceneSequences.ambienceId);
|
||||
}
|
||||
if ((CURRENT_TIME > CLOCK_TIME(17, 10)) && (CURRENT_TIME < CLOCK_TIME(19, 0))) {
|
||||
play->envCtx.timeSeqState = TIMESEQ_EARLY_NIGHT_CRITTERS;
|
||||
@@ -2499,7 +2499,7 @@ void Environment_UpdateTimeBasedSequence(PlayState* play) {
|
||||
|
||||
case TIMESEQ_EARLY_NIGHT_CRITTERS:
|
||||
if (play->envCtx.precipitation[PRECIP_RAIN_CUR] < 9) {
|
||||
Audio_PlayAmbience(play->sequenceCtx.ambienceId);
|
||||
Audio_PlayAmbience(play->sceneSequences.ambienceId);
|
||||
Audio_SetAmbienceChannelIO(AMBIENCE_CHANNEL_CRITTER_0, 1, 1);
|
||||
}
|
||||
play->envCtx.timeSeqState++;
|
||||
@@ -2600,7 +2600,7 @@ void Environment_FadeInGameOverLights(PlayState* play) {
|
||||
sGameOverLightsIntensity += 2;
|
||||
}
|
||||
|
||||
if (Play_CamIsNotFixed(&play->state)) {
|
||||
if (Play_CamIsNotFixed(play)) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (play->envCtx.adjLightSettings.ambientColor[i] > -255) {
|
||||
play->envCtx.adjLightSettings.ambientColor[i] -= 12;
|
||||
@@ -2647,7 +2647,7 @@ void Environment_FadeOutGameOverLights(PlayState* play) {
|
||||
sGameOverLightsIntensity, sGameOverLightsIntensity, sGameOverLightsIntensity, 255);
|
||||
}
|
||||
|
||||
if (Play_CamIsNotFixed(&play->state)) {
|
||||
if (Play_CamIsNotFixed(play)) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
Math_SmoothStepToS(&play->envCtx.adjLightSettings.ambientColor[i], 0, 5, 12, 1);
|
||||
Math_SmoothStepToS(&play->envCtx.adjLightSettings.light1Color[i], 0, 5, 12, 1);
|
||||
@@ -2944,7 +2944,7 @@ s32 Environment_AdjustLights(PlayState* play, f32 arg1, f32 arg2, f32 arg3, f32
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!Play_CamIsNotFixed(&play->state)) {
|
||||
if (!Play_CamIsNotFixed(play)) {
|
||||
return 0;
|
||||
}
|
||||
if (play->unk_18880) {
|
||||
@@ -3050,12 +3050,12 @@ s32 Environment_IsForcedSequenceDisabled(void) {
|
||||
}
|
||||
|
||||
void Environment_PlayStormNatureAmbience(PlayState* play) {
|
||||
if (((play->sequenceCtx.seqId != NA_BGM_NO_MUSIC) && (play->sequenceCtx.ambienceId == AMBIENCE_ID_13)) ||
|
||||
if (((play->sceneSequences.seqId != NA_BGM_NO_MUSIC) && (play->sceneSequences.ambienceId == AMBIENCE_ID_13)) ||
|
||||
(AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) == NA_BGM_FINAL_HOURS)) {
|
||||
Audio_PlayAmbience(AMBIENCE_ID_07);
|
||||
} else if ((play->sequenceCtx.seqId != NA_BGM_NO_MUSIC) && (play->sequenceCtx.ambienceId != AMBIENCE_ID_13)) {
|
||||
} else if ((play->sceneSequences.seqId != NA_BGM_NO_MUSIC) && (play->sceneSequences.ambienceId != AMBIENCE_ID_13)) {
|
||||
if ((CURRENT_TIME >= CLOCK_TIME(6, 0)) && (CURRENT_TIME < CLOCK_TIME(18, 0))) {
|
||||
Audio_PlayAmbience(play->sequenceCtx.ambienceId);
|
||||
Audio_PlayAmbience(play->sceneSequences.ambienceId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3064,10 +3064,10 @@ void Environment_PlayStormNatureAmbience(PlayState* play) {
|
||||
}
|
||||
|
||||
void Environment_StopStormNatureAmbience(PlayState* play) {
|
||||
if (((play->sequenceCtx.seqId != NA_BGM_NO_MUSIC) && (play->sequenceCtx.ambienceId == AMBIENCE_ID_13)) ||
|
||||
if (((play->sceneSequences.seqId != NA_BGM_NO_MUSIC) && (play->sceneSequences.ambienceId == AMBIENCE_ID_13)) ||
|
||||
(AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) == NA_BGM_FINAL_HOURS)) {
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_AMBIENCE, 20);
|
||||
} else if ((play->sequenceCtx.seqId != NA_BGM_NO_MUSIC) && (play->sequenceCtx.ambienceId != AMBIENCE_ID_13)) {
|
||||
} else if ((play->sceneSequences.seqId != NA_BGM_NO_MUSIC) && (play->sceneSequences.ambienceId != AMBIENCE_ID_13)) {
|
||||
if ((CURRENT_TIME >= CLOCK_TIME(6, 0)) && (CURRENT_TIME < CLOCK_TIME(18, 0))) {
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_AMBIENCE, 20);
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,12 +1,11 @@
|
||||
#include "z64lib.h"
|
||||
#include "ichain.h"
|
||||
|
||||
#include "libc64/qrand.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "ichain.h"
|
||||
#include "sfx.h"
|
||||
#include "z64actor.h"
|
||||
#include "z64game.h"
|
||||
#include "functions.h"
|
||||
#include "macros.h"
|
||||
|
||||
void* Lib_MemCpy(void* dest, void* src, size_t size) {
|
||||
bcopy(src, dest, size);
|
||||
@@ -453,7 +452,7 @@ void (*sInitChainHandlers[])(u8* ptr, InitChainEntry* ichain) = {
|
||||
IChain_Apply_Vec3f, IChain_Apply_Vec3fdiv1000, IChain_Apply_Vec3s,
|
||||
};
|
||||
|
||||
void Actor_ProcessInitChain(Actor* actor, InitChainEntry* ichain) {
|
||||
void Actor_ProcessInitChain(struct Actor* actor, InitChainEntry* ichain) {
|
||||
do {
|
||||
sInitChainHandlers[ichain->type]((u8*)actor, ichain);
|
||||
} while ((ichain++)->cont);
|
||||
|
||||
@@ -5966,7 +5966,7 @@ void Message_Update(PlayState* play) {
|
||||
case MSGMODE_OWL_SAVE_0:
|
||||
play->state.unk_A3 = 1;
|
||||
gSaveContext.save.isOwlSave = true;
|
||||
Play_SaveCycleSceneFlags(&play->state);
|
||||
Play_SaveCycleSceneFlags(play);
|
||||
func_8014546C(&play->sramCtx);
|
||||
|
||||
if (gSaveContext.fileNum != 0xFF) {
|
||||
|
||||
@@ -4437,7 +4437,7 @@ void Interface_DrawClock(PlayState* play) {
|
||||
((play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON) && !Play_InCsMode(play)) ||
|
||||
(msgCtx->msgMode == MSGMODE_NONE) || ((msgCtx->currentTextId >= 0x100) && (msgCtx->currentTextId <= 0x200)) ||
|
||||
(gSaveContext.gameMode == GAMEMODE_END_CREDITS)) &&
|
||||
!FrameAdvance_IsEnabled(&play->state) && !Environment_IsTimeStopped() && (gSaveContext.save.day <= 3)) {
|
||||
!FrameAdvance_IsEnabled(play) && !Environment_IsTimeStopped() && (gSaveContext.save.day <= 3)) {
|
||||
/**
|
||||
* Section: Changes Clock's transparancy depending if Player is moving or not and possibly other things
|
||||
*/
|
||||
|
||||
+31
-42
@@ -1,32 +1,34 @@
|
||||
#include "z64.h"
|
||||
#include "regs.h"
|
||||
#include "z64malloc.h"
|
||||
#include "z64vis.h"
|
||||
#include "z64visfbuf.h"
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
// Variables are put before most headers as a hacky way to bypass bss reordering
|
||||
s16 sTransitionFillTimer;
|
||||
Input D_801F6C18;
|
||||
TransitionTile sTransitionTile;
|
||||
struct Input D_801F6C18;
|
||||
struct TransitionTile sTransitionTile;
|
||||
s32 gTransitionTileState;
|
||||
VisMono sPlayVisMono;
|
||||
Color_RGBA8_u32 gPlayVisMonoColor;
|
||||
VisFbuf sPlayVisFbuf;
|
||||
VisFbuf* sPlayVisFbufInstance;
|
||||
BombersNotebook sBombersNotebook;
|
||||
struct VisMono sPlayVisMono;
|
||||
union Color_RGBA8_u32 gPlayVisMonoColor;
|
||||
struct VisFbuf sPlayVisFbuf;
|
||||
struct VisFbuf* sPlayVisFbufInstance;
|
||||
struct BombersNotebook sBombersNotebook;
|
||||
u8 sBombersNotebookOpen;
|
||||
u8 sMotionBlurStatus;
|
||||
|
||||
#include "macros.h"
|
||||
#include "z64play.h"
|
||||
|
||||
#include "buffers.h"
|
||||
#include "idle.h"
|
||||
#include "regs.h"
|
||||
#include "sys_cfb.h"
|
||||
|
||||
#include "z64bombers_notebook.h"
|
||||
#include "z64debug_display.h"
|
||||
#include "z64malloc.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "z64view.h"
|
||||
#include "z64vis.h"
|
||||
#include "z64visfbuf.h"
|
||||
|
||||
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
|
||||
#include "overlays/gamestates/ovl_opening/z_opening.h"
|
||||
@@ -1863,8 +1865,7 @@ s16 Play_GetOriginalSceneId(s16 sceneId) {
|
||||
* Copies the flags set in ActorContext over to the current scene's CycleSceneFlags, usually using the original scene
|
||||
* number. Exception for Inverted Stone Tower Temple, which uses its own.
|
||||
*/
|
||||
void Play_SaveCycleSceneFlags(GameState* thisx) {
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
void Play_SaveCycleSceneFlags(PlayState* this) {
|
||||
CycleSceneFlags* cycleSceneFlags;
|
||||
|
||||
cycleSceneFlags = &gSaveContext.cycleSceneFlags[Play_GetOriginalSceneId(this->sceneId)];
|
||||
@@ -1880,9 +1881,8 @@ void Play_SaveCycleSceneFlags(GameState* thisx) {
|
||||
cycleSceneFlags->clearedRoom = this->actorCtx.sceneFlags.clearedRoom;
|
||||
}
|
||||
|
||||
void Play_SetRespawnData(GameState* thisx, s32 respawnMode, u16 entrance, s32 roomIndex, s32 playerParams, Vec3f* pos,
|
||||
void Play_SetRespawnData(PlayState* this, s32 respawnMode, u16 entrance, s32 roomIndex, s32 playerParams, Vec3f* pos,
|
||||
s16 yaw) {
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
|
||||
gSaveContext.respawn[respawnMode].entrance = Entrance_Create(entrance >> 9, 0, entrance & 0xF);
|
||||
gSaveContext.respawn[respawnMode].roomIndex = roomIndex;
|
||||
@@ -1894,12 +1894,11 @@ void Play_SetRespawnData(GameState* thisx, s32 respawnMode, u16 entrance, s32 ro
|
||||
gSaveContext.respawn[respawnMode].tempCollectFlags = this->actorCtx.sceneFlags.collectible[2];
|
||||
}
|
||||
|
||||
void Play_SetupRespawnPoint(GameState* thisx, s32 respawnMode, s32 playerParams) {
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
void Play_SetupRespawnPoint(PlayState* this, s32 respawnMode, s32 playerParams) {
|
||||
Player* player = GET_PLAYER(this);
|
||||
|
||||
if (this->sceneId != SCENE_KAKUSIANA) { // Grottos
|
||||
Play_SetRespawnData(&this->state, respawnMode, ((void)0, gSaveContext.save.entrance), this->roomCtx.curRoom.num,
|
||||
Play_SetRespawnData(this, respawnMode, ((void)0, gSaveContext.save.entrance), this->roomCtx.curRoom.num,
|
||||
playerParams, &player->actor.world.pos, player->actor.shape.rot.y);
|
||||
}
|
||||
}
|
||||
@@ -1914,9 +1913,7 @@ void func_80169ECC(PlayState* this) {
|
||||
|
||||
// Gameplay_TriggerVoidOut ?
|
||||
// Used by Player, Ikana_Rotaryroom, Bji01, Kakasi, LiftNuts, Test4, Warptag, WarpUzu, Roomtimer
|
||||
void func_80169EFC(GameState* thisx) {
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
|
||||
void func_80169EFC(PlayState* this) {
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwitchFlags = this->actorCtx.sceneFlags.switches[2];
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].unk_18 = this->actorCtx.sceneFlags.collectible[1];
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = this->actorCtx.sceneFlags.collectible[2];
|
||||
@@ -1929,9 +1926,7 @@ void func_80169EFC(GameState* thisx) {
|
||||
|
||||
// Gameplay_LoadToLastEntrance ?
|
||||
// Used by game_over and Test7
|
||||
void func_80169F78(GameState* thisx) {
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
|
||||
void func_80169F78(PlayState* this) {
|
||||
this->nextEntrance = gSaveContext.respawn[RESPAWN_MODE_TOP].entrance;
|
||||
gSaveContext.respawnFlag = -1;
|
||||
func_80169ECC(this);
|
||||
@@ -1941,20 +1936,16 @@ void func_80169F78(GameState* thisx) {
|
||||
|
||||
// Gameplay_TriggerRespawn ?
|
||||
// Used for void by Wallmaster, Deku Shrine doors. Also used by Player, Kaleido, DoorWarp1
|
||||
void func_80169FDC(GameState* thisx) {
|
||||
func_80169F78(thisx);
|
||||
void func_80169FDC(PlayState* this) {
|
||||
func_80169F78(this);
|
||||
}
|
||||
|
||||
s32 Play_CamIsNotFixed(GameState* thisx) {
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
|
||||
s32 Play_CamIsNotFixed(PlayState* this) {
|
||||
return this->roomCtx.curRoom.roomShape->base.type != ROOM_SHAPE_TYPE_IMAGE;
|
||||
}
|
||||
|
||||
s32 FrameAdvance_IsEnabled(GameState* thisx) {
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
|
||||
return this->frameAdvCtx.enabled != 0;
|
||||
s32 FrameAdvance_IsEnabled(PlayState* this) {
|
||||
return this->frameAdvCtx.enabled != false;
|
||||
}
|
||||
|
||||
// Unused, unchanged from OoT, which uses it only in one Camera function.
|
||||
@@ -1966,8 +1957,7 @@ s32 FrameAdvance_IsEnabled(GameState* thisx) {
|
||||
* @param[out] yaw Facing angle of the actor, or reverse if in the back room.
|
||||
* @return true if \p actor is a door and the sides are in different rooms, false otherwise
|
||||
*/
|
||||
s32 func_8016A02C(GameState* thisx, Actor* actor, s16* yaw) {
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
s32 func_8016A02C(PlayState* this, Actor* actor, s16* yaw) {
|
||||
TransitionActorEntry* transitionActor;
|
||||
s8 frontRoom;
|
||||
|
||||
@@ -2041,8 +2031,7 @@ s16 sPlayerCsIdToCsCamId[] = {
|
||||
* Otherwise, if there is an CutsceneEntry where csCamId matches the appropriate element of sPlayerCsIdToCsCamId,
|
||||
* set the corresponding playerActorCsId (and possibly change its priority for the zeroth one).
|
||||
*/
|
||||
void Play_AssignPlayerCsIdsFromScene(GameState* thisx, s32 spawnCsId) {
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
void Play_AssignPlayerCsIdsFromScene(PlayState* this, s32 spawnCsId) {
|
||||
s32 i;
|
||||
s16* curPlayerCsId = this->playerCsIds;
|
||||
s16* csCamId = sPlayerCsIdToCsCamId;
|
||||
@@ -2068,7 +2057,7 @@ void Play_AssignPlayerCsIdsFromScene(GameState* thisx, s32 spawnCsId) {
|
||||
}
|
||||
|
||||
// Set values to fill screen
|
||||
void Play_FillScreen(GameState* thisx, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha) {
|
||||
void Play_FillScreen(PlayState* this, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha) {
|
||||
R_PLAY_FILL_SCREEN_ON = fillScreenOn;
|
||||
R_PLAY_FILL_SCREEN_R = red;
|
||||
R_PLAY_FILL_SCREEN_G = green;
|
||||
@@ -2340,8 +2329,8 @@ void Play_Init(GameState* thisx) {
|
||||
CutsceneManager_StoreCamera(&this->mainCamera);
|
||||
Interface_SetSceneRestrictions(this);
|
||||
Environment_PlaySceneSequence(this);
|
||||
gSaveContext.seqId = this->sequenceCtx.seqId;
|
||||
gSaveContext.ambienceId = this->sequenceCtx.ambienceId;
|
||||
gSaveContext.seqId = this->sceneSequences.seqId;
|
||||
gSaveContext.ambienceId = this->sceneSequences.ambienceId;
|
||||
AnimationContext_Update(this, &this->animationCtx);
|
||||
Cutscene_HandleEntranceTriggers(this);
|
||||
gSaveContext.respawnFlag = 0;
|
||||
|
||||
@@ -81,7 +81,7 @@ void func_80127B64(struct_801F58B0 arg0[], s32 count, Vec3f* arg2);
|
||||
|
||||
s32 func_801226E0(PlayState* play, s32 arg1) {
|
||||
if (arg1 == 0) {
|
||||
Play_SetupRespawnPoint(&play->state, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
|
||||
Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
|
||||
if (play->sceneId == SCENE_KAKUSIANA) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
+2
-2
@@ -454,8 +454,8 @@ void Scene_Command09(PlayState* play, SceneCmd* cmd) {
|
||||
|
||||
// SceneTableEntry Header Command 0x15: Sound Settings
|
||||
void Scene_CommandSoundSettings(PlayState* play, SceneCmd* cmd) {
|
||||
play->sequenceCtx.seqId = cmd->soundSettings.seqId;
|
||||
play->sequenceCtx.ambienceId = cmd->soundSettings.ambienceId;
|
||||
play->sceneSequences.seqId = cmd->soundSettings.seqId;
|
||||
play->sceneSequences.ambienceId = cmd->soundSettings.ambienceId;
|
||||
|
||||
if (gSaveContext.seqId == (u8)NA_BGM_DISABLED ||
|
||||
AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) == NA_BGM_FINAL_HOURS) {
|
||||
|
||||
@@ -444,7 +444,7 @@ void Sram_SaveEndOfCycle(PlayState* play) {
|
||||
}
|
||||
|
||||
sceneId = Play_GetOriginalSceneId(play->sceneId);
|
||||
Play_SaveCycleSceneFlags(&play->state);
|
||||
Play_SaveCycleSceneFlags(play);
|
||||
|
||||
play->actorCtx.sceneFlags.chest &= sPersistentCycleSceneFlags[sceneId].chest;
|
||||
play->actorCtx.sceneFlags.switches[0] &= sPersistentCycleSceneFlags[sceneId].switch0;
|
||||
|
||||
@@ -329,7 +329,7 @@ void BgCraceMovebg_ClosingDoor_Close(BgCraceMovebg* this, PlayState* play) {
|
||||
if (!(this->stateFlags & BG_CRACE_MOVEBG_FLAG_PLAYER_IS_BEYOND_DOOR) &&
|
||||
!Flags_GetSwitch(play, BG_CRACE_MOVEBG_GET_SWITCH_FLAG(&this->dyna.actor) + 1)) {
|
||||
play->haltAllActors = true;
|
||||
func_80169FDC(&play->state);
|
||||
func_80169FDC(play);
|
||||
Audio_PlaySfx(NA_SE_OC_ABYSS);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
* Description: Snowhead Temple Central Pillar
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_bg_hakugin_post.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64rumble.h"
|
||||
|
||||
@@ -649,7 +649,7 @@ void func_80B814B8(BgIkanaRotaryroom* this, PlayState* play) {
|
||||
if (CutsceneManager_GetCurrentCsId() == this->dyna.actor.csId) {
|
||||
if (player->actor.bgCheckFlags & BGCHECKFLAG_CRUSHED) {
|
||||
Player_PlaySfx(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->voiceSfxIdOffset);
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
Player_PlaySfx(player, NA_SE_VO_LI_TAKEN_AWAY + player->ageProperties->voiceSfxIdOffset);
|
||||
play->haltAllActors = true;
|
||||
Audio_PlaySfx(NA_SE_OC_ABYSS);
|
||||
|
||||
@@ -1868,7 +1868,7 @@ void DmStk_Update(Actor* thisx, PlayState* play) {
|
||||
// This code is responsible for making in-game time pass while using the telescope in the Astral Observatory.
|
||||
// Skull Kid is always loaded in the scene, even if he isn't visible, hence why time always passes.
|
||||
if ((play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON) && (play->msgCtx.msgMode != MSGMODE_NONE) &&
|
||||
(play->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(&play->state) &&
|
||||
(play->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(play) &&
|
||||
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) &&
|
||||
(play->csCtx.state == CS_STATE_IDLE)) {
|
||||
gSaveContext.save.time = CURRENT_TIME + (u16)R_TIME_SPEED;
|
||||
|
||||
@@ -141,7 +141,7 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) {
|
||||
} else {
|
||||
s32 destinationIdx = DOORANA_GET_ENTRANCE(&this->actor);
|
||||
|
||||
Play_SetupRespawnPoint(&play->state, RESPAWN_MODE_UNK_3, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_4));
|
||||
Play_SetupRespawnPoint(play, RESPAWN_MODE_UNK_3, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_4));
|
||||
|
||||
gSaveContext.respawn[RESPAWN_MODE_UNK_3].pos.y = this->actor.world.pos.y;
|
||||
gSaveContext.respawn[RESPAWN_MODE_UNK_3].yaw = this->actor.home.rot.y;
|
||||
|
||||
@@ -489,7 +489,7 @@ void func_808B98A8(DoorWarp1* this, PlayState* play) {
|
||||
Scene_SetExitFade(play);
|
||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||
} else {
|
||||
func_80169FDC(&play->state);
|
||||
func_80169FDC(play);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -772,7 +772,7 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) {
|
||||
Scene_SetExitFade(play);
|
||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||
} else {
|
||||
func_80169FDC(&play->state);
|
||||
func_80169FDC(play);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@ void func_809CD634(EnBji01* this, PlayState* play) {
|
||||
SEQCMD_DISABLE_PLAY_SEQUENCES(true);
|
||||
play->nextEntrance = ENTRANCE(TERMINA_FIELD, 10); /* Telescope entrance */
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = play->nextEntrance;
|
||||
func_80169EFC(&play->state); /* Load new entrance? */
|
||||
func_80169EFC(play); /* Load new entrance? */
|
||||
gSaveContext.respawnFlag = -2;
|
||||
this->actionFunc = EnBji01_DoNothing;
|
||||
}
|
||||
|
||||
@@ -949,9 +949,9 @@ void EnKakasi_DancingNightAway(EnKakasi* this, PlayState* play) {
|
||||
if (this->unk204 == 0) {
|
||||
player = GET_PLAYER(play);
|
||||
|
||||
Play_SetRespawnData(&play->state, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE,
|
||||
Play_SetRespawnData(play, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE,
|
||||
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0, player->unk_3CC);
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
|
||||
if ((CURRENT_TIME > CLOCK_TIME(18, 0)) || (CURRENT_TIME < CLOCK_TIME(6, 0))) {
|
||||
gSaveContext.save.time = CLOCK_TIME(6, 0);
|
||||
|
||||
@@ -904,7 +904,7 @@ void EnLiftNuts_EndGame(EnLiftNuts* this, PlayState* play) {
|
||||
CLEAR_EVENTINF(EVENTINF_34);
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = ENTRANCE(DEKU_SCRUB_PLAYGROUND, 1);
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
gSaveContext.respawnFlag = -2;
|
||||
play->transitionType = TRANS_TYPE_64;
|
||||
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
|
||||
|
||||
@@ -428,7 +428,7 @@ s32 func_80BC01DC(Actor* thisx, PlayState* play) {
|
||||
|
||||
case ENNB_BEHAVIOUR_1:
|
||||
// Setup a black fill-screen, although initialize to 0 alpha
|
||||
Play_FillScreen(&play->state, true, 0, 0, 0, 0);
|
||||
Play_FillScreen(play, true, 0, 0, 0, 0);
|
||||
this->storyTimer = 40;
|
||||
this->behaviour = (u16)(this->behaviour + 1);
|
||||
break;
|
||||
|
||||
@@ -59,7 +59,7 @@ void func_8096B174(EnOkarinaEffect* this, PlayState* play) {
|
||||
DECR(this->timer);
|
||||
|
||||
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
|
||||
(play->msgCtx.msgLength == 0) && !FrameAdvance_IsEnabled(&play->state) && (this->timer == 0)) {
|
||||
(play->msgCtx.msgLength == 0) && !FrameAdvance_IsEnabled(play) && (this->timer == 0)) {
|
||||
EnOkarinaEffect_SetupAction(this, func_8096B1FC);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,9 +453,9 @@ void EnTest4_HandleEvents(EnTest4* this, PlayState* play) {
|
||||
} else {
|
||||
// Turn day with DayTelop cutscene
|
||||
gSaveContext.screenScale = 0.0f;
|
||||
Play_SetRespawnData(&play->state, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE,
|
||||
Play_SetRespawnData(play, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE,
|
||||
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0, player->unk_3CC);
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
if (player->stateFlags1 & PLAYER_STATE1_800000) {
|
||||
EnHorse* rideActor = (EnHorse*)player->rideActor;
|
||||
|
||||
@@ -512,7 +512,7 @@ void EnTest4_HandleEvents(EnTest4* this, PlayState* play) {
|
||||
playerParams = PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B);
|
||||
}
|
||||
|
||||
Play_SetRespawnData(&play->state, RESPAWN_MODE_RETURN, entrance, player->unk_3CE, playerParams,
|
||||
Play_SetRespawnData(play, RESPAWN_MODE_RETURN, entrance, player->unk_3CE, playerParams,
|
||||
&player->unk_3C0, player->unk_3CC);
|
||||
|
||||
if ((play->sceneId == SCENE_TENMON_DAI) || (play->sceneId == SCENE_00KEIKOKU)) {
|
||||
|
||||
@@ -1081,9 +1081,8 @@ void EnTest6_SharedSoTCutscene(EnTest6* this, PlayState* play) {
|
||||
return;
|
||||
|
||||
case SOTCS_CUEID_DOUBLE_END:
|
||||
Play_SetRespawnData(&play->state, RESPAWN_MODE_RETURN, ((void)0, gSaveContext.save.entrance),
|
||||
player->unk_3CE, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0,
|
||||
player->unk_3CC);
|
||||
Play_SetRespawnData(play, RESPAWN_MODE_RETURN, ((void)0, gSaveContext.save.entrance), player->unk_3CE,
|
||||
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0, player->unk_3CC);
|
||||
this->drawType = SOTCS_DRAW_TYPE_NONE;
|
||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||
play->nextEntrance = gSaveContext.respawn[RESPAWN_MODE_RETURN].entrance;
|
||||
@@ -1163,7 +1162,7 @@ void EnTest6_SharedSoTCutscene(EnTest6* this, PlayState* play) {
|
||||
|
||||
case SOTCS_CUEID_DOUBLE_END:
|
||||
if (CURRENT_TIME > CLOCK_TIME(12, 0)) {
|
||||
Play_SetRespawnData(&play->state, RESPAWN_MODE_RETURN, ((void)0, gSaveContext.save.entrance),
|
||||
Play_SetRespawnData(play, RESPAWN_MODE_RETURN, ((void)0, gSaveContext.save.entrance),
|
||||
player->unk_3CE, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0,
|
||||
player->unk_3CC);
|
||||
this->drawType = SOTCS_DRAW_TYPE_NONE;
|
||||
|
||||
@@ -660,7 +660,7 @@ void EnTest7_WarpCsWarp(EnTest7* this, PlayState* play) {
|
||||
if (play->sceneId == SCENE_SECOM) {
|
||||
play->nextEntrance = ENTRANCE(IKANA_CANYON, 6);
|
||||
} else if (OWL_WARP_CS_GET_OCARINA_MODE(&this->actor) == OCARINA_MODE_WARP_TO_ENTRANCE) {
|
||||
func_80169F78(&play->state);
|
||||
func_80169F78(play);
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams =
|
||||
PLAYER_PARAMS(gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams, PLAYER_INITMODE_6);
|
||||
gSaveContext.respawnFlag = -6;
|
||||
|
||||
@@ -80,7 +80,7 @@ void EnTorch2_Destroy(Actor* thisx, PlayState* play) {
|
||||
EnTorch2* this = THIS;
|
||||
|
||||
Collider_DestroyCylinder(play, &this->collider);
|
||||
Play_SetRespawnData(&play->state, this->actor.params + RESPAWN_MODE_GORON - 1, 0xFF, 0,
|
||||
Play_SetRespawnData(play, this->actor.params + RESPAWN_MODE_GORON - 1, 0xFF, 0,
|
||||
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &this->actor.world.pos, this->actor.shape.rot.y);
|
||||
play->actorCtx.elegyShells[this->actor.params] = NULL;
|
||||
}
|
||||
|
||||
@@ -1015,7 +1015,7 @@ s32 func_80A87B48(Actor* thisx, PlayState* play) {
|
||||
sp4C.z = 40.0f;
|
||||
Lib_Vec3f_TranslateAndRotateY(&this->actor.world.pos, sp3E, &sp4C, &sp40);
|
||||
func_80A85620(this->unk_394, &sp40, 2.0f, 0.08f, 60.0f);
|
||||
Play_FillScreen(&play->state, true, 160, 160, 160, 0);
|
||||
Play_FillScreen(play, true, 160, 160, 160, 0);
|
||||
this->unk_370 = 20;
|
||||
this->unk_372 = 10;
|
||||
this->unk_364++;
|
||||
|
||||
@@ -499,7 +499,7 @@ void EnWallmas_TakePlayer(EnWallmas* this, PlayState* play) {
|
||||
|
||||
if (this->timer == 30) {
|
||||
Audio_PlaySfx(NA_SE_OC_ABYSS);
|
||||
func_80169FDC(&play->state);
|
||||
func_80169FDC(play);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ void func_80A66278(EnWarpUzu* this, PlayState* play) {
|
||||
void func_80A66384(EnWarpUzu* this, PlayState* play) {
|
||||
play->nextEntrance = ENTRANCE(PIRATES_FORTRESS, 10);
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = play->nextEntrance;
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
gSaveContext.respawnFlag = -2;
|
||||
this->actionFunc = EnWarpUzu_DoNothing;
|
||||
}
|
||||
|
||||
@@ -211,11 +211,11 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) {
|
||||
|
||||
// why are we getting player home rotation from the room data? doesnt player have home.rot.y?
|
||||
// especially because we are converting from deg to binang, but isnt home.rot.y already in binang??
|
||||
Play_SetRespawnData(&play->state, RESPAWN_MODE_DOWN, entrance,
|
||||
play->setupEntranceList[playerSpawnIndex].room, playerParams, &newRespawnPos,
|
||||
Play_SetRespawnData(play, RESPAWN_MODE_DOWN, entrance, play->setupEntranceList[playerSpawnIndex].room,
|
||||
playerParams, &newRespawnPos,
|
||||
DEG_TO_BINANG_ALT((playerActorEntry->rot.y >> 7) & 0x1FF));
|
||||
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
gSaveContext.respawnFlag = -5;
|
||||
Play_DisableMotionBlur();
|
||||
}
|
||||
|
||||
@@ -489,7 +489,7 @@ void EnWeatherTag_Update(Actor* thisx, PlayState* play) {
|
||||
|
||||
this->actionFunc(this, play);
|
||||
if ((play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON) && (play->msgCtx.msgMode != MSGMODE_NONE) &&
|
||||
(play->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(&play->state) &&
|
||||
(play->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(play) &&
|
||||
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) &&
|
||||
(play->csCtx.state == CS_STATE_IDLE)) {
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ void func_80973D3C(ObjRoomtimer* this, PlayState* play) {
|
||||
this->actionFunc = func_80973DE0;
|
||||
} else if ((this->actor.params != 0x1FF) && (gSaveContext.timerStates[TIMER_ID_MINIGAME_2] == TIMER_STATE_OFF)) {
|
||||
Audio_PlaySfx(NA_SE_OC_ABYSS);
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5742,11 +5742,11 @@ s32 func_80834600(Player* this, PlayState* play) {
|
||||
Player_AnimSfx_PlayVoice(this, NA_SE_VO_LI_DAMAGE_S);
|
||||
|
||||
if (var_v0) {
|
||||
func_80169FDC(&play->state);
|
||||
func_80169FDC(play);
|
||||
func_808345C8();
|
||||
Scene_SetExitFade(play);
|
||||
} else {
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
func_808345C8();
|
||||
}
|
||||
|
||||
@@ -6074,7 +6074,7 @@ void func_808354A4(PlayState* play, s32 exitIndex, s32 arg2) {
|
||||
} else {
|
||||
if (arg2) {
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = play->nextEntrance;
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
gSaveContext.respawnFlag = -2;
|
||||
}
|
||||
|
||||
@@ -6125,7 +6125,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol
|
||||
}
|
||||
|
||||
if (exitIndexPlusOne == 0) {
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
Scene_SetExitFade(play);
|
||||
} else {
|
||||
func_808354A4(play, exitIndexPlusOne - 1,
|
||||
@@ -6173,7 +6173,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol
|
||||
BgCheck_EntityRaycastFloor7(&play->colCtx, &this->actor.floorPoly, &sp30, &this->actor,
|
||||
&this->actor.world.pos);
|
||||
if (this->actor.floorPoly == NULL) {
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
return false;
|
||||
}
|
||||
//! FAKE
|
||||
@@ -6187,10 +6187,10 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol
|
||||
((sPlayerYDistToFloor < 100.0f) || (this->fallDistance > 400))))) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
if (this->floorProperty == FLOOR_PROPERTY_5) {
|
||||
func_80169FDC(&play->state);
|
||||
func_80169FDC(play);
|
||||
func_808345C8();
|
||||
} else {
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
}
|
||||
if (!SurfaceType_IsWallDamage(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId)) {
|
||||
gSaveContext.respawnFlag = -5;
|
||||
@@ -8263,7 +8263,7 @@ void func_8083A98C(Actor* thisx, PlayState* play2) {
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = entrance;
|
||||
}
|
||||
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
gSaveContext.respawnFlag = -2;
|
||||
play->transitionType = TRANS_TYPE_CIRCLE;
|
||||
}
|
||||
@@ -8613,7 +8613,7 @@ void func_8083BB4C(PlayState* play, Player* this) {
|
||||
} else if ((this->unk_3CF == 0) &&
|
||||
((play->sceneId == SCENE_30GYOSON) || (play->sceneId == SCENE_31MISAKI) ||
|
||||
(play->sceneId == SCENE_TORIDE))) {
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
func_808345C8();
|
||||
} else {
|
||||
Player_SetAction(play, this, Player_Action_1, 0);
|
||||
@@ -10817,7 +10817,7 @@ void Player_Init(Actor* thisx, PlayState* play) {
|
||||
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, 255, 128, 0, -1);
|
||||
this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo);
|
||||
Play_AssignPlayerCsIdsFromScene(&play->state, this->actor.csId);
|
||||
Play_AssignPlayerCsIdsFromScene(play, this->actor.csId);
|
||||
|
||||
respawnFlag = gSaveContext.respawnFlag;
|
||||
if (respawnFlag != 0) {
|
||||
@@ -13281,7 +13281,7 @@ void func_80848640(PlayState* play, Player* this) {
|
||||
|
||||
if (torch2 != NULL) {
|
||||
play->actorCtx.elegyShells[this->transformation] = torch2;
|
||||
Play_SetupRespawnPoint(&play->state, this->transformation + 3, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
|
||||
Play_SetupRespawnPoint(play, this->transformation + 3, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
|
||||
}
|
||||
|
||||
effChange = Actor_Spawn(&play->actorCtx, play, ACTOR_EFF_CHANGE, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
@@ -15337,7 +15337,7 @@ void Player_Action_36(Player* this, PlayState* play) {
|
||||
}
|
||||
|
||||
func_800E0238(Play_GetCamera(play, CAM_ID_MAIN));
|
||||
Play_SetupRespawnPoint(&play->state, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
|
||||
Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
|
||||
}
|
||||
}
|
||||
} else if (!(this->stateFlags1 & PLAYER_STATE1_20000000) && PlayerAnimation_OnFrame(&this->skelAnime, 15.0f)) {
|
||||
@@ -17608,9 +17608,9 @@ void Player_Action_77(Player* this, PlayState* play) {
|
||||
if ((this->av2.actionVar2++ >= 9) && !func_8082DA90(play)) {
|
||||
if (this->av1.actionVar1 != 0) {
|
||||
if (this->av1.actionVar1 < 0) {
|
||||
func_80169FDC(&play->state);
|
||||
func_80169FDC(play);
|
||||
} else {
|
||||
func_80169EFC(&play->state);
|
||||
func_80169EFC(play);
|
||||
}
|
||||
if (!SurfaceType_IsWallDamage(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId)) {
|
||||
gSaveContext.respawnFlag = -5;
|
||||
|
||||
@@ -3065,7 +3065,7 @@ void KaleidoScope_Update(PlayState* play) {
|
||||
pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_RETURN_TO_MENU;
|
||||
} else {
|
||||
Audio_PlaySfx(NA_SE_SY_PIECE_OF_HEART);
|
||||
Play_SaveCycleSceneFlags(&play->state);
|
||||
Play_SaveCycleSceneFlags(play);
|
||||
gSaveContext.save.saveInfo.playerData.savedSceneId = play->sceneId;
|
||||
func_8014546C(sramCtx);
|
||||
if (!gSaveContext.flashSaveAvailable) {
|
||||
@@ -3331,7 +3331,7 @@ void KaleidoScope_Update(PlayState* play) {
|
||||
} else {
|
||||
Audio_PlaySfx(NA_SE_SY_PIECE_OF_HEART);
|
||||
pauseCtx->promptChoice = PAUSE_PROMPT_YES;
|
||||
Play_SaveCycleSceneFlags(&play->state);
|
||||
Play_SaveCycleSceneFlags(play);
|
||||
gSaveContext.save.saveInfo.playerData.savedSceneId = play->sceneId;
|
||||
gSaveContext.save.saveInfo.playerData.health = 0x30;
|
||||
func_8014546C(sramCtx);
|
||||
@@ -3381,7 +3381,7 @@ void KaleidoScope_Update(PlayState* play) {
|
||||
if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_START)) {
|
||||
if (pauseCtx->promptChoice == PAUSE_PROMPT_YES) {
|
||||
Audio_PlaySfx(NA_SE_SY_PIECE_OF_HEART);
|
||||
Play_SaveCycleSceneFlags(&play->state);
|
||||
Play_SaveCycleSceneFlags(play);
|
||||
if (gSaveContext.save.entrance == ENTRANCE(UNSET_0D, 0)) {}
|
||||
} else { // PAUSE_PROMPT_NO
|
||||
Audio_PlaySfx(NA_SE_SY_DECIDE);
|
||||
@@ -3403,7 +3403,7 @@ void KaleidoScope_Update(PlayState* play) {
|
||||
BgCheck_InitCollisionHeaders(&play->colCtx, play);
|
||||
|
||||
if (pauseCtx->promptChoice == PAUSE_PROMPT_YES) {
|
||||
func_80169FDC(&play->state);
|
||||
func_80169FDC(play);
|
||||
gSaveContext.respawnFlag = -2;
|
||||
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
|
||||
gSaveContext.save.saveInfo.playerData.health = 0x30;
|
||||
|
||||
Reference in New Issue
Block a user