mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-16 20:48:07 -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;
|
||||
|
||||
Reference in New Issue
Block a user