diff --git a/diff_settings.py b/diff_settings.py index e0da720b1f..05367ef05c 100644 --- a/diff_settings.py +++ b/diff_settings.py @@ -6,4 +6,4 @@ def apply(config, args): config['mapfile'] = 'build/n64-us/mm-n64-us.map' config['source_directories'] = ['./src','./include'] config['objdump_flags'] = ['-M','reg-names=32'] - config['makeflags'] = ['KEEP_MDEBUG=1'] + config['makeflags'] = ['KEEP_MDEBUG=1', 'WERROR=0', 'OBJDUMP_BUILD=0'] diff --git a/include/color.h b/include/color.h index 7c0cd7d9fd..f7e7a9dfa0 100644 --- a/include/color.h +++ b/include/color.h @@ -26,7 +26,7 @@ typedef struct { } Color_RGB16; // size = 0x6 // only use when necessary for alignment purposes -typedef union { +typedef union Color_RGBA8_u32 { struct { u8 r, g, b, a; }; diff --git a/include/functions.h b/include/functions.h index eb6aadf293..07b0e5b83d 100644 --- a/include/functions.h +++ b/include/functions.h @@ -264,57 +264,6 @@ void Inventory_IncrementSkullTokenCount(s16 sceneIndex); s16 Inventory_GetSkullTokenCount(s16 sceneIndex); void Inventory_SaveLotteryCodeGuess(PlayState* play); -void Play_SetMotionBlurAlpha(u32 alpha); -void Play_EnableMotionBlur(u32 alpha); -void Play_DisableMotionBlur(void); -void Play_SetMotionBlurPriorityAlpha(u32 alpha); -void Play_EnableMotionBlurPriority(u32 alpha); -void Play_DisableMotionBlurPriority(void); -void Play_TriggerPictoPhoto(void); -Gfx* Play_SetFog(PlayState* this, Gfx* gfx); -void Play_Destroy(GameState* thisx); -void Play_CompressI8ToI5(void* srcI8, void* destI5, size_t size); -void Play_DecompressI5ToI8(void* srcI5, void* destI8, size_t size); -void Play_Update(PlayState* this); -void Play_Draw(PlayState* this); -void Play_Main(GameState* thisx); -bool Play_InCsMode(PlayState* this); -f32 Play_GetFloorSurfaceImpl(PlayState* this, MtxF* mtx, CollisionPoly** poly, s32* bgId, Vec3f* pos); -void Play_GetFloorSurface(PlayState* this, MtxF* mtx, Vec3f* pos); -void* Play_LoadFile(PlayState* this, RomFile* entry); -void Play_InitEnvironment(PlayState* this, s16 skyboxId); -void Play_GetScreenPos(PlayState* this, Vec3f* worldPos, Vec3f* screenPos); -s16 Play_CreateSubCamera(PlayState* this); -s16 Play_GetActiveCamId(PlayState* this); -s32 Play_ChangeCameraStatus(PlayState* this, s16 camId, s16 status); -void Play_ClearCamera(PlayState* this, s16 camId); -Camera* Play_GetCamera(PlayState* this, s16 camId); -s32 Play_SetCameraAtEye(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye); -s32 Play_SetCameraAtEyeUp(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye, Vec3f* up); -s32 Play_SetCameraFov(PlayState* this, s16 camId, f32 fov); -s32 Play_SetCameraRoll(PlayState* this, s16 camId, s16 roll); -void Play_CopyCamera(PlayState* this, s16 destCamId, s16 srcCamId); -s32 func_80169A50(PlayState* this, s16 camId, Player* player, s16 setting); -s32 Play_ChangeCameraSetting(PlayState* this, s16 camId, s16 setting); -void func_80169AFC(PlayState* this, s16 camId, s16 timer); -u16 Play_GetActorCsCamSetting(PlayState* this, s32 csCamDataIndex); -Vec3s* Play_GetActorCsCamFuncData(PlayState* this, s32 csCamDataIndex); -s16 Play_GetOriginalSceneId(s16 sceneId); -void Play_SaveCycleSceneFlags(GameState* thisx); -void Play_SetRespawnData(GameState* thisx, s32 respawnMode, u16 entrance, s32 roomIndex, s32 playerParams, Vec3f* pos, s16 yaw); -void Play_SetupRespawnPoint(GameState* thisx, s32 respawnMode, s32 playerParams); -void func_80169EFC(GameState* thisx); -void func_80169F78(GameState* thisx); -void func_80169FDC(GameState* thisx); -s32 Play_CamIsNotFixed(GameState* thisx); -s32 FrameAdvance_IsEnabled(GameState* thisx); -s32 func_8016A02C(GameState* thisx, Actor* actor, s16* yaw); -s32 Play_IsUnderwater(PlayState* this, Vec3f* pos); -s32 Play_IsDebugCamEnabled(void); -void Play_AssignPlayerCsIdsFromScene(GameState* thisx, s32 spawnCsId); -void Play_FillScreen(GameState* thisx, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha); -void Play_Init(GameState* thisx); - void Graph_FaultClient(void); void Graph_InitTHGA(TwoHeadGfxArena* arena, Gfx* buffer, s32 size); void Graph_SetNextGfxPool(GraphicsContext* gfxCtx); diff --git a/include/ichain.h b/include/ichain.h index 1c7e8f26b1..43ee0ee4b6 100644 --- a/include/ichain.h +++ b/include/ichain.h @@ -55,4 +55,8 @@ typedef enum { #define ICHAIN_CONTINUE 1 #define ICHAIN_STOP 0 +struct Actor; + +void Actor_ProcessInitChain(struct Actor* actor, struct InitChainEntry* ichain); + #endif diff --git a/include/macros.h b/include/macros.h index fcede4ac2e..534b275c7d 100644 --- a/include/macros.h +++ b/include/macros.h @@ -2,7 +2,6 @@ #define MACROS_H #include "stdint.h" -#include "PR/os_convert.h" #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 @@ -20,12 +19,6 @@ #define ARRAY_COUNT_2D(arr) (ARRAY_COUNT(arr) * ARRAY_COUNT(arr[0])) -#define GET_ACTIVE_CAM(play) ((play)->cameraPtrs[(play)->activeCamId]) - -#define GET_PLAYER(play) ((Player*)(play)->actorCtx.actorLists[ACTORCAT_PLAYER].first) - -#define GET_FIRST_ENEMY(play) ((Actor*)(play)->actorCtx.actorLists[ACTORCAT_ENEMY].first) - #define CLOCK_TIME(hr, min) (s32)(((hr) * 60 + (min)) * 0x10000 / (24 * 60)) #define CLOCK_TIME_MINUTE (CLOCK_TIME(0, 1)) #define CLOCK_TIME_HOUR (CLOCK_TIME(1, 0)) diff --git a/include/variables.h b/include/variables.h index cb5741ff87..b257b01d51 100644 --- a/include/variables.h +++ b/include/variables.h @@ -23,8 +23,6 @@ extern s16 gItemPrices[]; extern u16 gSceneIdsPerRegion[11][27]; extern u8 gPlayerFormItemRestrictions[PLAYER_FORM_MAX][114]; -extern s32 gDbgCamEnabled; - extern s16 gLowPassFilterData[]; extern s16 gHighPassFilterData[]; extern s16 gBandStopFilterData[]; @@ -62,9 +60,6 @@ extern u8 gSampleBankTable[]; // bss -extern s32 gTransitionTileState; -extern Color_RGBA8_u32 gPlayVisMonoColor; - extern GfxMasterList* gGfxMasterDL; extern u64* gAudioSPDataPtr; diff --git a/include/z64.h b/include/z64.h index b0884e7948..3efb583387 100644 --- a/include/z64.h +++ b/include/z64.h @@ -59,6 +59,7 @@ #include "z64object.h" #include "z64ocarina.h" #include "z64pause_menu.h" +#include "z64play.h" #include "z64player.h" #include "z64prerender.h" #include "z64save.h" @@ -73,110 +74,4 @@ #include "z64transition.h" #include "z64view.h" - -typedef struct { - /* 0x0 */ u8 seqId; - /* 0x1 */ u8 ambienceId; -} SequenceContext; // size = 0x2 - -typedef struct PlayState { - /* 0x00000 */ GameState state; - /* 0x000A4 */ s16 sceneId; - /* 0x000A6 */ u8 sceneConfig; - /* 0x000A7 */ char unk_A7[0x9]; - /* 0x000B0 */ void* sceneSegment; - /* 0x000B4 */ char unk_B4[0x4]; - /* 0x000B8 */ View view; - /* 0x00220 */ Camera mainCamera; - /* 0x00398 */ Camera subCameras[NUM_CAMS - CAM_ID_SUB_FIRST]; - /* 0x00800 */ Camera* cameraPtrs[NUM_CAMS]; - /* 0x00810 */ s16 activeCamId; - /* 0x00812 */ s16 nextCamera; - /* 0x00814 */ SequenceContext sequenceCtx; - /* 0x00818 */ LightContext lightCtx; - /* 0x00828 */ FrameAdvanceContext frameAdvCtx; - /* 0x00830 */ CollisionContext colCtx; - /* 0x01CA0 */ ActorContext actorCtx; - /* 0x01F24 */ CutsceneContext csCtx; - /* 0x01F78 */ SoundSource soundSources[SOUND_SOURCE_COUNT]; - /* 0x02138 */ EffFootmark footprintInfo[100]; - /* 0x046B8 */ SramContext sramCtx; - /* 0x046E0 */ SkyboxContext skyboxCtx; - /* 0x04908 */ MessageContext msgCtx; - /* 0x169E8 */ InterfaceContext interfaceCtx; - /* 0x16D30 */ PauseContext pauseCtx; - /* 0x17000 */ GameOverContext gameOverCtx; - /* 0x17004 */ EnvironmentContext envCtx; - /* 0x17104 */ AnimationContext animationCtx; - /* 0x17D88 */ ObjectContext objectCtx; - /* 0x186E0 */ RoomContext roomCtx; - /* 0x18760 */ TransitionActorList transitionActors; - /* 0x18768 */ void (*playerInit)(Player* player, struct PlayState* play, FlexSkeletonHeader* skelHeader); - /* 0x1876C */ void (*playerUpdate)(Player* player, struct PlayState* play, Input* input); - /* 0x18770 */ void (*unk_18770)(struct PlayState* play, Player* player); - /* 0x18774 */ s32 (*startPlayerFishing)(struct PlayState* play); - /* 0x18778 */ s32 (*grabPlayer)(struct PlayState* play, Player* player); - /* 0x1877C */ s32 (*tryPlayerCsAction)(struct PlayState* play, Player* player, PlayerCsAction csAction); - /* 0x18780 */ void (*func_18780)(Player* player, struct PlayState* play); - /* 0x18784 */ s32 (*damagePlayer)(struct PlayState* play, s32 damage); - /* 0x18788 */ void (*talkWithPlayer)(struct PlayState* play, Actor* actor); - /* 0x1878C */ void (*unk_1878C)(struct PlayState* play); - /* 0x18790 */ void (*unk_18790)(struct PlayState* play, s16 arg1); - /* 0x18794 */ PlayerItemAction (*unk_18794)(struct PlayState* play, Player* player, ItemId itemId); - /* 0x18798 */ s32 (*setPlayerTalkAnim)(struct PlayState* play, PlayerAnimationHeader* talkAnim, AnimationMode animMode); - /* 0x1879C */ s16 playerCsIds[PLAYER_CS_ID_MAX]; - /* 0x187B0 */ MtxF viewProjectionMtxF; - /* 0x187F0 */ Vec3f projectionMtxFDiagonal; - /* 0x187FC */ MtxF billboardMtxF; - /* 0x1883C */ Mtx* billboardMtx; - /* 0x18840 */ u32 gameplayFrames; - /* 0x18844 */ u8 unk_18844; // bool - /* 0x18845 */ u8 haltAllActors; - /* 0x18846 */ s16 numSetupActors; - /* 0x18848 */ u8 numRooms; - /* 0x1884C */ RomFile* roomList; - /* 0x18850 */ ActorEntry* linkActorEntry; - /* 0x18854 */ ActorEntry* setupActorList; - /* 0x18858 */ ActorCsCamInfo* actorCsCamList; - /* 0x1885C */ EntranceEntry* setupEntranceList; - /* 0x18860 */ u16* setupExitList; - /* 0x18864 */ Path* setupPathList; - /* 0x18868 */ void* naviQuestHints; // leftover from OoT, system which processes this is removed - /* 0x1886C */ AnimatedMaterial* sceneMaterialAnims; - /* 0x18870 */ void* specialEffects; - /* 0x18874 */ u8 skyboxId; // @see SkyboxId enum - /* 0x18875 */ s8 transitionTrigger; // "fade_direction" - /* 0x18876 */ s16 worldCoverAlpha; - /* 0x18878 */ s16 bgCoverAlpha; - /* 0x1887A */ u16 nextEntrance; - /* 0x1887C */ s8 unk_1887C; // shootingGalleryStatus? - /* 0x1887D */ s8 unk_1887D; - /* 0x1887E */ s8 unk_1887E; - /* 0x1887F */ u8 transitionType; // fadeTransition - /* 0x18880 */ u8 unk_18880; - /* 0x18884 */ CollisionCheckContext colChkCtx; - /* 0x18B20 */ u16 cutsceneFlags[20]; - /* 0x18B48 */ u8 curSpawn; - /* 0x18B49 */ u8 unk_18B49; - /* 0x18B4A */ u8 transitionMode; - /* 0x18B4C */ PreRender pauseBgPreRender; - /* 0x18B9C */ char unk_18B9C[0x54]; - /* 0x18BF0 */ TransitionContext transitionCtx; - /* 0x18E48 */ TransitionFade unk_18E48; - /* 0x18E54 */ SceneTableEntry* loadedScene; - /* 0x18E58 */ void* unk_18E58; - /* 0x18E5C */ TexturePtr pictoPhotoI8; - /* 0x18E60 */ void* unk_18E60; - /* 0x18E64 */ void* unk_18E64; - /* 0x18E68 */ void* unk_18E68; // framebuffer related to Lens of Truth - /* 0x18E6C */ char unk_18E6C[0x3EC]; -} PlayState; // size = 0x19258 - -typedef enum { - /* 0 */ PICTO_PHOTO_STATE_OFF, - /* 1 */ PICTO_PHOTO_STATE_SETUP, - /* 2 */ PICTO_PHOTO_STATE_PROCESS, - /* 3 */ PICTO_PHOTO_STATE_READY -} PictoPhotoState; - #endif diff --git a/include/z64bombers_notebook.h b/include/z64bombers_notebook.h index 6b52121bb8..a67777d2e0 100644 --- a/include/z64bombers_notebook.h +++ b/include/z64bombers_notebook.h @@ -34,7 +34,7 @@ typedef enum BombersNotebookEvent { #undef DEFINE_PERSON #undef DEFINE_EVENT -typedef struct { +typedef struct BombersNotebook { /* 0x00 */ u8 loadState; /* 0x01 */ UNK_TYPE1 pad01[0x3F]; /* 0x40 */ void* scheduleDmaSegment; diff --git a/include/z64environment.h b/include/z64environment.h index 45f8463f05..74f89aadeb 100644 --- a/include/z64environment.h +++ b/include/z64environment.h @@ -272,7 +272,7 @@ typedef struct EnvironmentContext { /* 0xED */ u8 customSkyboxFilter; /* 0xEE */ u8 skyboxFilterColor[4]; /* 0xF2 */ u8 precipitation[PRECIP_MAX]; - /* 0xF7 */ UNK_TYPE1 unk_FA[9]; + /* 0xF7 */ UNK_TYPE1 unk_F7[9]; } EnvironmentContext; // size = 0x100 s32 Environment_ZBufValToFixedPoint(s32 zBufferVal); diff --git a/include/z64frameadvance.h b/include/z64frameadvance.h index a05ee8d581..13ce8389e1 100644 --- a/include/z64frameadvance.h +++ b/include/z64frameadvance.h @@ -4,6 +4,7 @@ #include "ultra64.h" struct Input; +struct PlayState; typedef struct FrameAdvanceContext { @@ -14,4 +15,6 @@ typedef struct FrameAdvanceContext { void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx); s32 FrameAdvance_Update(FrameAdvanceContext* frameAdvCtx, struct Input* input); +s32 FrameAdvance_IsEnabled(struct PlayState* this); + #endif diff --git a/include/z64lib.h b/include/z64lib.h index 5e38eab75f..f93ec5c471 100644 --- a/include/z64lib.h +++ b/include/z64lib.h @@ -8,14 +8,11 @@ #include "color.h" #include "z64math.h" -struct Actor; -struct InitChainEntry; struct Input; void* Lib_MemCpy(void* dest, void* src, size_t size); void* Lib_MemSet(void* buffer, s32 value, size_t size); void Lib_GetControlStickData(f32* outMagnitude, s16* outAngle, struct Input* input); -void Actor_ProcessInitChain(struct Actor* actor, struct InitChainEntry* ichain); void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src); void Lib_PlaySfx(u16 sfxId); void Lib_PlaySfx_2(u16 sfxId); diff --git a/include/z64play.h b/include/z64play.h new file mode 100644 index 0000000000..b5f78f702f --- /dev/null +++ b/include/z64play.h @@ -0,0 +1,196 @@ +#ifndef Z64PLAY_H +#define Z64PLAY_H + +#include "ultra64.h" + +#include "z64actor.h" +#include "z64animation.h" +#include "z64bgcheck.h" +#include "z64camera.h" +#include "z64collision_check.h" +#include "z64cutscene.h" +#include "z64eff_footmark.h" +#include "z64environment.h" +#include "z64frameadvance.h" +#include "z64game_over.h" +#include "z64game.h" +#include "z64interface.h" +#include "z64item.h" +#include "z64light.h" +#include "z64math.h" +#include "z64message.h" +#include "z64pause_menu.h" +#include "z64player.h" +#include "z64prerender.h" +#include "z64save.h" +#include "z64scene.h" +#include "z64skybox.h" +#include "z64sound_source.h" +#include "z64transition.h" +#include "z64view.h" + +typedef struct SceneSequences { + /* 0x0 */ u8 seqId; + /* 0x1 */ u8 ambienceId; +} SceneSequences; // size = 0x2 + +typedef struct PlayState { + /* 0x00000 */ GameState state; + /* 0x000A4 */ s16 sceneId; + /* 0x000A6 */ u8 sceneConfig; + /* 0x000A7 */ char unk_A7[0x9]; + /* 0x000B0 */ void* sceneSegment; + /* 0x000B8 */ View view; + /* 0x00220 */ Camera mainCamera; + /* 0x00398 */ Camera subCameras[NUM_CAMS - CAM_ID_SUB_FIRST]; + /* 0x00800 */ Camera* cameraPtrs[NUM_CAMS]; + /* 0x00810 */ s16 activeCamId; + /* 0x00812 */ s16 nextCamera; + /* 0x00814 */ SceneSequences sceneSequences; + /* 0x00818 */ LightContext lightCtx; + /* 0x00828 */ FrameAdvanceContext frameAdvCtx; + /* 0x00830 */ CollisionContext colCtx; + /* 0x01CA0 */ ActorContext actorCtx; + /* 0x01F24 */ CutsceneContext csCtx; + /* 0x01F78 */ SoundSource soundSources[SOUND_SOURCE_COUNT]; + /* 0x02138 */ EffFootmark footprintInfo[100]; + /* 0x046B8 */ SramContext sramCtx; + /* 0x046E0 */ SkyboxContext skyboxCtx; + /* 0x04908 */ MessageContext msgCtx; + /* 0x169E8 */ InterfaceContext interfaceCtx; + /* 0x16D30 */ PauseContext pauseCtx; + /* 0x17000 */ GameOverContext gameOverCtx; + /* 0x17004 */ EnvironmentContext envCtx; + /* 0x17104 */ AnimationContext animationCtx; + /* 0x17D88 */ ObjectContext objectCtx; + /* 0x186E0 */ RoomContext roomCtx; + /* 0x18760 */ TransitionActorList transitionActors; + /* 0x18768 */ void (*playerInit)(Player* player, struct PlayState* play, FlexSkeletonHeader* skelHeader); + /* 0x1876C */ void (*playerUpdate)(Player* player, struct PlayState* play, Input* input); + /* 0x18770 */ void (*unk_18770)(struct PlayState* play, Player* player); + /* 0x18774 */ s32 (*startPlayerFishing)(struct PlayState* play); + /* 0x18778 */ s32 (*grabPlayer)(struct PlayState* play, Player* player); + /* 0x1877C */ s32 (*tryPlayerCsAction)(struct PlayState* play, Player* player, PlayerCsAction csAction); + /* 0x18780 */ void (*func_18780)(Player* player, struct PlayState* play); + /* 0x18784 */ s32 (*damagePlayer)(struct PlayState* play, s32 damage); + /* 0x18788 */ void (*talkWithPlayer)(struct PlayState* play, Actor* actor); + /* 0x1878C */ void (*unk_1878C)(struct PlayState* play); + /* 0x18790 */ void (*unk_18790)(struct PlayState* play, s16 arg1); + /* 0x18794 */ PlayerItemAction (*unk_18794)(struct PlayState* play, Player* player, ItemId itemId); + /* 0x18798 */ s32 (*setPlayerTalkAnim)(struct PlayState* play, PlayerAnimationHeader* talkAnim, AnimationMode animMode); + /* 0x1879C */ s16 playerCsIds[PLAYER_CS_ID_MAX]; + /* 0x187B0 */ MtxF viewProjectionMtxF; + /* 0x187F0 */ Vec3f projectionMtxFDiagonal; + /* 0x187FC */ MtxF billboardMtxF; + /* 0x1883C */ Mtx* billboardMtx; + /* 0x18840 */ u32 gameplayFrames; + /* 0x18844 */ u8 unk_18844; // bool + /* 0x18845 */ u8 haltAllActors; + /* 0x18846 */ s16 numSetupActors; + /* 0x18848 */ u8 numRooms; + /* 0x1884C */ RomFile* roomList; + /* 0x18850 */ ActorEntry* linkActorEntry; + /* 0x18854 */ ActorEntry* setupActorList; + /* 0x18858 */ ActorCsCamInfo* actorCsCamList; + /* 0x1885C */ EntranceEntry* setupEntranceList; + /* 0x18860 */ u16* setupExitList; + /* 0x18864 */ Path* setupPathList; + /* 0x18868 */ void* naviQuestHints; // leftover from OoT, system which processes this is removed + /* 0x1886C */ AnimatedMaterial* sceneMaterialAnims; + /* 0x18870 */ void* specialEffects; + /* 0x18874 */ u8 skyboxId; // @see SkyboxId enum + /* 0x18875 */ s8 transitionTrigger; // "fade_direction" + /* 0x18876 */ s16 worldCoverAlpha; + /* 0x18878 */ s16 bgCoverAlpha; + /* 0x1887A */ u16 nextEntrance; + /* 0x1887C */ s8 unk_1887C; // shootingGalleryStatus? + /* 0x1887D */ s8 unk_1887D; + /* 0x1887E */ s8 unk_1887E; + /* 0x1887F */ u8 transitionType; // fadeTransition + /* 0x18880 */ u8 unk_18880; + /* 0x18884 */ CollisionCheckContext colChkCtx; + /* 0x18B20 */ u16 cutsceneFlags[20]; + /* 0x18B48 */ u8 curSpawn; + /* 0x18B49 */ u8 unk_18B49; + /* 0x18B4A */ u8 transitionMode; + /* 0x18B4C */ PreRender pauseBgPreRender; + /* 0x18B9C */ char unk_18B9C[0x54]; + /* 0x18BF0 */ TransitionContext transitionCtx; + /* 0x18E48 */ TransitionFade unk_18E48; + /* 0x18E54 */ SceneTableEntry* loadedScene; + /* 0x18E58 */ void* unk_18E58; + /* 0x18E5C */ TexturePtr pictoPhotoI8; + /* 0x18E60 */ void* unk_18E60; + /* 0x18E64 */ void* unk_18E64; + /* 0x18E68 */ void* unk_18E68; // framebuffer related to Lens of Truth + /* 0x18E6C */ char unk_18E6C[0x3EC]; +} PlayState; // size = 0x19258 + +typedef enum PictoPhotoState { + /* 0 */ PICTO_PHOTO_STATE_OFF, + /* 1 */ PICTO_PHOTO_STATE_SETUP, + /* 2 */ PICTO_PHOTO_STATE_PROCESS, + /* 3 */ PICTO_PHOTO_STATE_READY +} PictoPhotoState; + +#define GET_ACTIVE_CAM(play) ((play)->cameraPtrs[(play)->activeCamId]) +#define GET_PLAYER(play) ((Player*)(play)->actorCtx.actorLists[ACTORCAT_PLAYER].first) +#define GET_FIRST_ENEMY(play) ((Actor*)(play)->actorCtx.actorLists[ACTORCAT_ENEMY].first) + + +void Play_SetMotionBlurAlpha(u32 alpha); +void Play_EnableMotionBlur(u32 alpha); +void Play_DisableMotionBlur(void); +void Play_SetMotionBlurPriorityAlpha(u32 alpha); +void Play_EnableMotionBlurPriority(u32 alpha); +void Play_DisableMotionBlurPriority(void); +void Play_TriggerPictoPhoto(void); +Gfx* Play_SetFog(PlayState* this, Gfx* gfx); +void Play_Destroy(GameState* thisx); +void Play_CompressI8ToI5(void* srcI8, void* destI5, size_t size); +void Play_DecompressI5ToI8(void* srcI5, void* destI8, size_t size); +void Play_Update(PlayState* this); +void Play_Draw(PlayState* this); +void Play_Main(GameState* thisx); +bool Play_InCsMode(PlayState* this); +f32 Play_GetFloorSurfaceImpl(PlayState* this, MtxF* mtx, CollisionPoly** poly, s32* bgId, Vec3f* pos); +void Play_GetFloorSurface(PlayState* this, MtxF* mtx, Vec3f* pos); +void* Play_LoadFile(PlayState* this, RomFile* entry); +void Play_InitEnvironment(PlayState* this, s16 skyboxId); +void Play_GetScreenPos(PlayState* this, Vec3f* worldPos, Vec3f* screenPos); +s16 Play_CreateSubCamera(PlayState* this); +s16 Play_GetActiveCamId(PlayState* this); +s32 Play_ChangeCameraStatus(PlayState* this, s16 camId, s16 status); +void Play_ClearCamera(PlayState* this, s16 camId); +Camera* Play_GetCamera(PlayState* this, s16 camId); +s32 Play_SetCameraAtEye(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye); +s32 Play_SetCameraAtEyeUp(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye, Vec3f* up); +s32 Play_SetCameraFov(PlayState* this, s16 camId, f32 fov); +s32 Play_SetCameraRoll(PlayState* this, s16 camId, s16 roll); +void Play_CopyCamera(PlayState* this, s16 destCamId, s16 srcCamId); +s32 func_80169A50(PlayState* this, s16 camId, Player* player, s16 setting); +s32 Play_ChangeCameraSetting(PlayState* this, s16 camId, s16 setting); +void func_80169AFC(PlayState* this, s16 camId, s16 timer); +u16 Play_GetActorCsCamSetting(PlayState* this, s32 csCamDataIndex); +Vec3s* Play_GetActorCsCamFuncData(PlayState* this, s32 csCamDataIndex); +s16 Play_GetOriginalSceneId(s16 sceneId); +void Play_SaveCycleSceneFlags(PlayState* this); +void Play_SetRespawnData(PlayState* this, s32 respawnMode, u16 entrance, s32 roomIndex, s32 playerParams, Vec3f* pos, s16 yaw); +void Play_SetupRespawnPoint(PlayState* this, s32 respawnMode, s32 playerParams); +void func_80169EFC(PlayState* this); +void func_80169F78(PlayState* this); +void func_80169FDC(PlayState* this); +s32 Play_CamIsNotFixed(PlayState* this); +s32 func_8016A02C(PlayState* this, Actor* actor, s16* yaw); +s32 Play_IsUnderwater(PlayState* this, Vec3f* pos); +s32 Play_IsDebugCamEnabled(void); +void Play_AssignPlayerCsIdsFromScene(PlayState* this, s32 spawnCsId); +void Play_FillScreen(PlayState* this, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha); +void Play_Init(GameState* thisx); + +extern s32 gDbgCamEnabled; + +extern s32 gTransitionTileState; +extern Color_RGBA8_u32 gPlayVisMonoColor; + +#endif diff --git a/src/code/sys_math.c b/src/code/sys_math.c index 9649218b14..81d54d86aa 100644 --- a/src/code/sys_math.c +++ b/src/code/sys_math.c @@ -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[] = { diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c index b5048e5230..4e9bcdc05e 100644 --- a/src/code/sys_math3d.c +++ b/src/code/sys_math3d.c @@ -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); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index d4fe8a9da1..52684408e8 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -3184,7 +3184,7 @@ void Actor_CleanupContext(ActorContext* actorCtx, PlayState* play) { actorCtx->absoluteSpace = NULL; } - Play_SaveCycleSceneFlags(&play->state); + Play_SaveCycleSceneFlags(play); ActorOverlayTable_Cleanup(); } diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index aa36a4ac7d..79892053e5 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1,9 +1,14 @@ #include "z64collision_check.h" +#include "macros.h" +#include "sfx.h" +#include "sys_matrix.h" + #include "z64actor.h" #include "z64effect.h" +#include "z64frameadvance.h" #include "z64malloc.h" -#include "global.h" +#include "z64math.h" typedef s32 (*ColChkResetFunc)(struct PlayState*, Collider*); typedef void (*ColChkBloodFunc)(struct PlayState*, Collider*, Vec3f*); @@ -110,7 +115,7 @@ s32 CollisionCheck_GetToucherDamage(Collider* at, ColliderInfo* atInfo, Collider return atInfo->toucher.damage; } -s32 Collider_InitBase(PlayState* play, Collider* collider) { +s32 Collider_InitBase(struct PlayState* play, Collider* collider) { static Collider defaultCollider = { NULL, NULL, NULL, NULL, AT_NONE, AC_NONE, OC1_NONE, OC2_NONE, COLTYPE_HIT3, COLSHAPE_MAX, }; @@ -119,14 +124,14 @@ s32 Collider_InitBase(PlayState* play, Collider* collider) { return 1; } -s32 Collider_DestroyBase(PlayState* play, Collider* collider) { +s32 Collider_DestroyBase(struct PlayState* play, Collider* collider) { return 1; } /** * Uses default OC2_TYPE_1 and COLTYPE_HIT0 */ -s32 Collider_SetBaseToActor(PlayState* play, Collider* collider, ColliderInitToActor* src) { +s32 Collider_SetBaseToActor(struct PlayState* play, Collider* collider, ColliderInitToActor* src) { collider->actor = src->actor; collider->atFlags = src->atFlags; collider->acFlags = src->acFlags; @@ -139,7 +144,7 @@ s32 Collider_SetBaseToActor(PlayState* play, Collider* collider, ColliderInitToA /** * Uses default OC2_TYPE_1 */ -s32 Collider_SetBaseType1(PlayState* play, Collider* collider, Actor* actor, ColliderInitType1* src) { +s32 Collider_SetBaseType1(struct PlayState* play, Collider* collider, Actor* actor, ColliderInitType1* src) { collider->actor = actor; collider->colType = src->colType; collider->atFlags = src->atFlags; @@ -150,7 +155,7 @@ s32 Collider_SetBaseType1(PlayState* play, Collider* collider, Actor* actor, Col return 1; } -s32 Collider_SetBase(PlayState* play, Collider* collider, Actor* actor, ColliderInit* src) { +s32 Collider_SetBase(struct PlayState* play, Collider* collider, Actor* actor, ColliderInit* src) { collider->actor = actor; collider->colType = src->colType; collider->atFlags = src->atFlags; @@ -161,62 +166,62 @@ s32 Collider_SetBase(PlayState* play, Collider* collider, Actor* actor, Collider return 1; } -void Collider_ResetATBase(PlayState* play, Collider* collider) { +void Collider_ResetATBase(struct PlayState* play, Collider* collider) { collider->at = NULL; collider->atFlags &= ~(AT_HIT | AT_BOUNCED); } -void Collider_ResetACBase(PlayState* play, Collider* collider) { +void Collider_ResetACBase(struct PlayState* play, Collider* collider) { collider->ac = NULL; collider->acFlags &= ~(AC_HIT | AC_BOUNCED); } -void Collider_ResetOCBase(PlayState* play, Collider* collider) { +void Collider_ResetOCBase(struct PlayState* play, Collider* collider) { collider->oc = NULL; collider->ocFlags1 &= ~OC1_HIT; collider->ocFlags2 &= ~OC2_HIT_PLAYER; } -s32 Collider_InitTouch(PlayState* play, ColliderTouch* touch) { +s32 Collider_InitTouch(struct PlayState* play, ColliderTouch* touch) { static ColliderTouch defaultColliderTouch = { 0x00000000, 0, 0 }; *touch = defaultColliderTouch; return 1; } -s32 Collider_DestroyTouch(PlayState* play, ColliderTouch* touch) { +s32 Collider_DestroyTouch(struct PlayState* play, ColliderTouch* touch) { return 1; } -s32 Collider_SetTouch(PlayState* play, ColliderTouch* touch, ColliderTouchInit* src) { +s32 Collider_SetTouch(struct PlayState* play, ColliderTouch* touch, ColliderTouchInit* src) { touch->dmgFlags = src->dmgFlags; touch->effect = src->effect; touch->damage = src->damage; return 1; } -void Collider_ResetATInfoUnk(PlayState* play, ColliderInfo* info) { +void Collider_ResetATInfoUnk(struct PlayState* play, ColliderInfo* info) { } -s32 Collider_InitBump(PlayState* play, ColliderBump* bump) { +s32 Collider_InitBump(struct PlayState* play, ColliderBump* bump) { static ColliderBump defaultColliderBump = { 0xF7CFFFFF, 0, 0, { 0, 0, 0 } }; *bump = defaultColliderBump; return 1; } -s32 Collider_DestroyBump(PlayState* play, ColliderBump* bump) { +s32 Collider_DestroyBump(struct PlayState* play, ColliderBump* bump) { return 1; } -s32 Collider_SetBump(PlayState* play, ColliderBump* bump, ColliderBumpInit* src) { +s32 Collider_SetBump(struct PlayState* play, ColliderBump* bump, ColliderBumpInit* src) { bump->dmgFlags = src->dmgFlags; bump->effect = src->effect; bump->defense = src->defense; return 1; } -s32 Collider_InitInfo(PlayState* play, ColliderInfo* info) { +s32 Collider_InitInfo(struct PlayState* play, ColliderInfo* info) { static ColliderInfo defaultColliderInfo = { { 0, 0, 0 }, { 0xF7CFFFFF, 0, 0, { 0, 0, 0 } }, ELEMTYPE_UNK0, TOUCH_NONE, @@ -231,13 +236,13 @@ s32 Collider_InitInfo(PlayState* play, ColliderInfo* info) { return 1; } -s32 Collider_DestroyInfo(PlayState* play, ColliderInfo* info) { +s32 Collider_DestroyInfo(struct PlayState* play, ColliderInfo* info) { Collider_DestroyTouch(play, &info->toucher); Collider_DestroyBump(play, &info->bumper); return 1; } -s32 Collider_SetInfo(PlayState* play, ColliderInfo* info, ColliderInfoInit* src) { +s32 Collider_SetInfo(struct PlayState* play, ColliderInfo* info, ColliderInfoInit* src) { info->elemType = src->elemType; Collider_SetTouch(play, &info->toucher, &src->toucher); Collider_SetBump(play, &info->bumper, &src->bumper); @@ -247,7 +252,7 @@ s32 Collider_SetInfo(PlayState* play, ColliderInfo* info, ColliderInfoInit* src) return 1; } -void Collider_ResetATInfo(PlayState* play, ColliderInfo* info) { +void Collider_ResetATInfo(struct PlayState* play, ColliderInfo* info) { info->atHit = NULL; info->atHitInfo = NULL; info->toucherFlags &= ~TOUCH_HIT; @@ -255,7 +260,7 @@ void Collider_ResetATInfo(PlayState* play, ColliderInfo* info) { Collider_ResetATInfoUnk(play, info); } -void Collider_ResetACInfo(PlayState* play, ColliderInfo* info) { +void Collider_ResetACInfo(struct PlayState* play, ColliderInfo* info) { info->bumper.hitPos.x = info->bumper.hitPos.y = info->bumper.hitPos.z = 0; info->bumperFlags &= ~BUMP_HIT; info->bumperFlags &= ~BUMP_DRAW_HITMARK; @@ -263,11 +268,11 @@ void Collider_ResetACInfo(PlayState* play, ColliderInfo* info) { info->acHitInfo = NULL; } -void Collider_ResetOCInfo(PlayState* play, ColliderInfo* info) { +void Collider_ResetOCInfo(struct PlayState* play, ColliderInfo* info) { info->ocElemFlags &= ~OCELEM_HIT; } -s32 Collider_InitJntSphElementDim(PlayState* play, ColliderJntSphElementDim* dim) { +s32 Collider_InitJntSphElementDim(struct PlayState* play, ColliderJntSphElementDim* dim) { static ColliderJntSphElementDim defaultColliderJntSphElementDim = { { { 0, 0, 0 }, 0 }, { { 0, 0, 0 }, 0 }, @@ -279,46 +284,47 @@ s32 Collider_InitJntSphElementDim(PlayState* play, ColliderJntSphElementDim* dim return 1; } -s32 Collider_DestroyJntSphElementDim(PlayState* play, ColliderJntSphElementDim* dim) { +s32 Collider_DestroyJntSphElementDim(struct PlayState* play, ColliderJntSphElementDim* dim) { return 1; } -s32 Collider_SetJntSphElementDim(PlayState* play, ColliderJntSphElementDim* dest, ColliderJntSphElementDimInit* src) { +s32 Collider_SetJntSphElementDim(struct PlayState* play, ColliderJntSphElementDim* dest, + ColliderJntSphElementDimInit* src) { dest->limb = src->limb; dest->modelSphere = src->modelSphere; dest->scale = src->scale * 0.01f; return 1; } -s32 Collider_InitJntSphElement(PlayState* play, ColliderJntSphElement* element) { +s32 Collider_InitJntSphElement(struct PlayState* play, ColliderJntSphElement* element) { Collider_InitInfo(play, &element->info); Collider_InitJntSphElementDim(play, &element->dim); return 1; } -s32 Collider_DestroyJntSphElement(PlayState* play, ColliderJntSphElement* element) { +s32 Collider_DestroyJntSphElement(struct PlayState* play, ColliderJntSphElement* element) { Collider_DestroyInfo(play, &element->info); Collider_DestroyJntSphElementDim(play, &element->dim); return 1; } -s32 Collider_SetJntSphElement(PlayState* play, ColliderJntSphElement* dest, ColliderJntSphElementInit* src) { +s32 Collider_SetJntSphElement(struct PlayState* play, ColliderJntSphElement* dest, ColliderJntSphElementInit* src) { Collider_SetInfo(play, &dest->info, &src->info); Collider_SetJntSphElementDim(play, &dest->dim, &src->dim); return 1; } -s32 Collider_ResetJntSphElementAT(PlayState* play, ColliderJntSphElement* collider) { +s32 Collider_ResetJntSphElementAT(struct PlayState* play, ColliderJntSphElement* collider) { Collider_ResetATInfo(play, &collider->info); return 1; } -s32 Collider_ResetJntSphElementAC(PlayState* play, ColliderJntSphElement* collider) { +s32 Collider_ResetJntSphElementAC(struct PlayState* play, ColliderJntSphElement* collider) { Collider_ResetACInfo(play, &collider->info); return 1; } -s32 Collider_ResetJntSphElementOC(PlayState* play, ColliderJntSphElement* collider) { +s32 Collider_ResetJntSphElementOC(struct PlayState* play, ColliderJntSphElement* collider) { Collider_ResetOCInfo(play, &collider->info); return 1; } @@ -326,7 +332,7 @@ s32 Collider_ResetJntSphElementOC(PlayState* play, ColliderJntSphElement* collid /** * Initializes a ColliderJntSph to default values */ -s32 Collider_InitJntSph(PlayState* play, ColliderJntSph* collider) { +s32 Collider_InitJntSph(struct PlayState* play, ColliderJntSph* collider) { Collider_InitBase(play, &collider->base); collider->count = 0; collider->elements = NULL; @@ -336,7 +342,7 @@ s32 Collider_InitJntSph(PlayState* play, ColliderJntSph* collider) { /** * Destroys a dynamically allocated ColliderJntSph */ -s32 Collider_FreeJntSph(PlayState* play, ColliderJntSph* collider) { +s32 Collider_FreeJntSph(struct PlayState* play, ColliderJntSph* collider) { ColliderJntSphElement* element; Collider_DestroyBase(play, &collider->base); @@ -355,7 +361,7 @@ s32 Collider_FreeJntSph(PlayState* play, ColliderJntSph* collider) { /** * Destroys a preallocated ColliderJntSph */ -s32 Collider_DestroyJntSph(PlayState* play, ColliderJntSph* collider) { +s32 Collider_DestroyJntSph(struct PlayState* play, ColliderJntSph* collider) { ColliderJntSphElement* element; Collider_DestroyBase(play, &collider->base); @@ -372,7 +378,7 @@ s32 Collider_DestroyJntSph(PlayState* play, ColliderJntSph* collider) { * Sets up the ColliderJntSph using the values in src, sets it to the actor specified in src, and dynamically allocates * the element array. Uses default OC2_TYPE_1 and COLTYPE_HIT0. */ -s32 Collider_SetJntSphToActor(PlayState* play, ColliderJntSph* collider, ColliderJntSphInitToActor* src) { +s32 Collider_SetJntSphToActor(struct PlayState* play, ColliderJntSph* collider, ColliderJntSphInitToActor* src) { ColliderJntSphElement* destElem; ColliderJntSphElementInit* srcElem; @@ -397,7 +403,7 @@ s32 Collider_SetJntSphToActor(PlayState* play, ColliderJntSph* collider, Collide * Sets up the ColliderJntSph using the values in src and dynamically allocates the element array. Uses default * OC2_TYPE_1. */ -s32 Collider_SetJntSphAllocType1(PlayState* play, ColliderJntSph* sphereGroup, Actor* actor, +s32 Collider_SetJntSphAllocType1(struct PlayState* play, ColliderJntSph* sphereGroup, Actor* actor, ColliderJntSphInitType1* src) { ColliderJntSphElement* destElem; ColliderJntSphElementInit* srcElem; @@ -422,7 +428,7 @@ s32 Collider_SetJntSphAllocType1(PlayState* play, ColliderJntSph* sphereGroup, A /** * Sets up the ColliderJntSph using the values in src, placing the element array in elements. */ -s32 Collider_SetJntSph(PlayState* play, ColliderJntSph* sphereGroup, Actor* actor, ColliderJntSphInit* src, +s32 Collider_SetJntSph(struct PlayState* play, ColliderJntSph* sphereGroup, Actor* actor, ColliderJntSphInit* src, ColliderJntSphElement* elements) { ColliderJntSphElement* destElem; ColliderJntSphElementInit* srcElem; @@ -443,8 +449,8 @@ s32 Collider_SetJntSph(PlayState* play, ColliderJntSph* sphereGroup, Actor* acto /** * Fully initializes a ColliderJntSph using the values in `src`, placing the element array in elements. */ -s32 Collider_InitAndSetJntSph(PlayState* play, ColliderJntSph* sphereGroup, Actor* actor, ColliderJntSphInit* src, - ColliderJntSphElement* elements) { +s32 Collider_InitAndSetJntSph(struct PlayState* play, ColliderJntSph* sphereGroup, Actor* actor, + ColliderJntSphInit* src, ColliderJntSphElement* elements) { Collider_InitJntSph(play, sphereGroup); Collider_SetJntSph(play, sphereGroup, actor, src, elements); return 0; @@ -453,7 +459,7 @@ s32 Collider_InitAndSetJntSph(PlayState* play, ColliderJntSph* sphereGroup, Acto /** * Resets the collider's AT collision flags. */ -s32 Collider_ResetJntSphAT(PlayState* play, Collider* collider) { +s32 Collider_ResetJntSphAT(struct PlayState* play, Collider* collider) { ColliderJntSphElement* element; ColliderJntSph* jntSph = (ColliderJntSph*)collider; @@ -468,7 +474,7 @@ s32 Collider_ResetJntSphAT(PlayState* play, Collider* collider) { /** * Resets the collider's AC collision flags. */ -s32 Collider_ResetJntSphAC(PlayState* play, Collider* collider) { +s32 Collider_ResetJntSphAC(struct PlayState* play, Collider* collider) { ColliderJntSphElement* element; ColliderJntSph* jntSph = (ColliderJntSph*)collider; @@ -483,7 +489,7 @@ s32 Collider_ResetJntSphAC(PlayState* play, Collider* collider) { /** * Resets the collider's OC collision flags. */ -s32 Collider_ResetJntSphOC(PlayState* play, Collider* collider) { +s32 Collider_ResetJntSphOC(struct PlayState* play, Collider* collider) { ColliderJntSphElement* element; ColliderJntSph* jntSph = (ColliderJntSph*)collider; @@ -495,18 +501,18 @@ s32 Collider_ResetJntSphOC(PlayState* play, Collider* collider) { return 1; } -s32 Collider_InitCylinderDim(PlayState* play, Cylinder16* dim) { +s32 Collider_InitCylinderDim(struct PlayState* play, Cylinder16* dim) { static Cylinder16 defaultColliderCylinderDim = { 0, 0, 0, { 0, 0, 0 } }; *dim = defaultColliderCylinderDim; return 1; } -s32 Collider_DestroyCylinderDim(PlayState* play, Cylinder16* dim) { +s32 Collider_DestroyCylinderDim(struct PlayState* play, Cylinder16* dim) { return 1; } -s32 Collider_SetCylinderDim(PlayState* play, Cylinder16* dim, Cylinder16* src) { +s32 Collider_SetCylinderDim(struct PlayState* play, Cylinder16* dim, Cylinder16* src) { *dim = *src; return 1; } @@ -514,7 +520,7 @@ s32 Collider_SetCylinderDim(PlayState* play, Cylinder16* dim, Cylinder16* src) { /** * Initializes a ColliderCylinder to default values */ -s32 Collider_InitCylinder(PlayState* play, ColliderCylinder* collider) { +s32 Collider_InitCylinder(struct PlayState* play, ColliderCylinder* collider) { Collider_InitBase(play, &collider->base); Collider_InitInfo(play, &collider->info); Collider_InitCylinderDim(play, &collider->dim); @@ -524,7 +530,7 @@ s32 Collider_InitCylinder(PlayState* play, ColliderCylinder* collider) { /** * Destroys a ColliderCylinder */ -s32 Collider_DestroyCylinder(PlayState* play, ColliderCylinder* collider) { +s32 Collider_DestroyCylinder(struct PlayState* play, ColliderCylinder* collider) { Collider_DestroyBase(play, &collider->base); Collider_DestroyInfo(play, &collider->info); Collider_DestroyCylinderDim(play, &collider->dim); @@ -535,7 +541,7 @@ s32 Collider_DestroyCylinder(PlayState* play, ColliderCylinder* collider) { * Sets up the ColliderCylinder using the values in src and sets it to the actor specified in src. Uses default * OC2_TYPE_1 and COLTYPE_0. */ -s32 Collider_SetCylinderToActor(PlayState* play, ColliderCylinder* collider, ColliderCylinderInitToActor* src) { +s32 Collider_SetCylinderToActor(struct PlayState* play, ColliderCylinder* collider, ColliderCylinderInitToActor* src) { Collider_SetBaseToActor(play, &collider->base, &src->base); Collider_SetInfo(play, &collider->info, &src->info); Collider_SetCylinderDim(play, &collider->dim, &src->dim); @@ -545,7 +551,7 @@ s32 Collider_SetCylinderToActor(PlayState* play, ColliderCylinder* collider, Col /** * Sets up the ColliderCylinder using the values in src. Uses default OC2_TYPE_1 */ -s32 Collider_SetCylinderType1(PlayState* play, ColliderCylinder* collider, Actor* actor, +s32 Collider_SetCylinderType1(struct PlayState* play, ColliderCylinder* collider, Actor* actor, ColliderCylinderInitType1* src) { Collider_SetBaseType1(play, &collider->base, actor, &src->base); Collider_SetInfo(play, &collider->info, &src->info); @@ -556,7 +562,7 @@ s32 Collider_SetCylinderType1(PlayState* play, ColliderCylinder* collider, Actor /** * Sets up the ColliderCylinder using the values in src. */ -s32 Collider_SetCylinder(PlayState* play, ColliderCylinder* collider, Actor* actor, ColliderCylinderInit* src) { +s32 Collider_SetCylinder(struct PlayState* play, ColliderCylinder* collider, Actor* actor, ColliderCylinderInit* src) { Collider_SetBase(play, &collider->base, actor, &src->base); Collider_SetInfo(play, &collider->info, &src->info); Collider_SetCylinderDim(play, &collider->dim, &src->dim); @@ -566,7 +572,8 @@ s32 Collider_SetCylinder(PlayState* play, ColliderCylinder* collider, Actor* act /** * Fully initializes a ColliderCylinder using the values in src. */ -s32 Collider_InitAndSetCylinder(PlayState* play, ColliderCylinder* collider, Actor* actor, ColliderCylinderInit* src) { +s32 Collider_InitAndSetCylinder(struct PlayState* play, ColliderCylinder* collider, Actor* actor, + ColliderCylinderInit* src) { Collider_InitCylinder(play, collider); Collider_SetCylinder(play, collider, actor, src); return 1; @@ -575,7 +582,7 @@ s32 Collider_InitAndSetCylinder(PlayState* play, ColliderCylinder* collider, Act /** * Resets the collider's AT collision flags. */ -s32 Collider_ResetCylinderAT(PlayState* play, Collider* collider) { +s32 Collider_ResetCylinderAT(struct PlayState* play, Collider* collider) { ColliderCylinder* cylinder = (ColliderCylinder*)collider; Collider_ResetATBase(play, &cylinder->base); @@ -586,7 +593,7 @@ s32 Collider_ResetCylinderAT(PlayState* play, Collider* collider) { /** * Resets the collider's AC collision flags. */ -s32 Collider_ResetCylinderAC(PlayState* play, Collider* collider) { +s32 Collider_ResetCylinderAC(struct PlayState* play, Collider* collider) { ColliderCylinder* cylinder = (ColliderCylinder*)collider; Collider_ResetACBase(play, &cylinder->base); @@ -597,7 +604,7 @@ s32 Collider_ResetCylinderAC(PlayState* play, Collider* collider) { /** * Resets the collider's OC collision flags. */ -s32 Collider_ResetCylinderOC(PlayState* play, Collider* collider) { +s32 Collider_ResetCylinderOC(struct PlayState* play, Collider* collider) { ColliderCylinder* cylinder = (ColliderCylinder*)collider; Collider_ResetOCBase(play, &cylinder->base); @@ -605,7 +612,7 @@ s32 Collider_ResetCylinderOC(PlayState* play, Collider* collider) { return 1; } -s32 Collider_InitTrisElementDim(PlayState* play, TriNorm* dim) { +s32 Collider_InitTrisElementDim(struct PlayState* play, TriNorm* dim) { static TriNorm defaultColliderTrisElementDim = { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { { 0.0f, 0.0f, 0.0f }, 0.0f }, @@ -615,11 +622,11 @@ s32 Collider_InitTrisElementDim(PlayState* play, TriNorm* dim) { return 1; } -s32 Collider_DestroyTrisElementDim(PlayState* play, TriNorm* dim) { +s32 Collider_DestroyTrisElementDim(struct PlayState* play, TriNorm* dim) { return 1; } -s32 Collider_SetTrisElementDim(PlayState* play, TriNorm* dim, ColliderTrisElementDimInit* src) { +s32 Collider_SetTrisElementDim(struct PlayState* play, TriNorm* dim, ColliderTrisElementDimInit* src) { Vec3f* destVtx; Vec3f* srcVtx; f32 nx; @@ -640,35 +647,35 @@ s32 Collider_SetTrisElementDim(PlayState* play, TriNorm* dim, ColliderTrisElemen return 1; } -s32 Collider_InitTrisElement(PlayState* play, ColliderTrisElement* element) { +s32 Collider_InitTrisElement(struct PlayState* play, ColliderTrisElement* element) { Collider_InitInfo(play, &element->info); Collider_InitTrisElementDim(play, &element->dim); return 1; } -s32 Collider_DestroyTrisElement(PlayState* play, ColliderTrisElement* element) { +s32 Collider_DestroyTrisElement(struct PlayState* play, ColliderTrisElement* element) { Collider_DestroyInfo(play, &element->info); Collider_DestroyTrisElementDim(play, &element->dim); return 1; } -s32 Collider_SetTrisElement(PlayState* play, ColliderTrisElement* element, ColliderTrisElementInit* src) { +s32 Collider_SetTrisElement(struct PlayState* play, ColliderTrisElement* element, ColliderTrisElementInit* src) { Collider_SetInfo(play, &element->info, &src->info); Collider_SetTrisElementDim(play, &element->dim, &src->dim); return 1; } -s32 Collider_ResetTrisElementAT(PlayState* play, ColliderTrisElement* element) { +s32 Collider_ResetTrisElementAT(struct PlayState* play, ColliderTrisElement* element) { Collider_ResetATInfo(play, &element->info); return 1; } -s32 Collider_ResetTrisElementAC(PlayState* play, ColliderTrisElement* element) { +s32 Collider_ResetTrisElementAC(struct PlayState* play, ColliderTrisElement* element) { Collider_ResetACInfo(play, &element->info); return 1; } -s32 Collider_ResetTrisElementOC(PlayState* play, ColliderTrisElement* element) { +s32 Collider_ResetTrisElementOC(struct PlayState* play, ColliderTrisElement* element) { Collider_ResetOCInfo(play, &element->info); return 1; } @@ -676,7 +683,7 @@ s32 Collider_ResetTrisElementOC(PlayState* play, ColliderTrisElement* element) { /** * Initializes a ColliderTris to default values */ -s32 Collider_InitTris(PlayState* play, ColliderTris* tris) { +s32 Collider_InitTris(struct PlayState* play, ColliderTris* tris) { Collider_InitBase(play, &tris->base); tris->count = 0; tris->elements = NULL; @@ -686,7 +693,7 @@ s32 Collider_InitTris(PlayState* play, ColliderTris* tris) { /** * Destroys a dynamically allocated ColliderTris */ -s32 Collider_FreeTris(PlayState* play, ColliderTris* tris) { +s32 Collider_FreeTris(struct PlayState* play, ColliderTris* tris) { ColliderTrisElement* element; Collider_DestroyBase(play, &tris->base); @@ -707,7 +714,7 @@ s32 Collider_FreeTris(PlayState* play, ColliderTris* tris) { /** * Destroys a preallocated ColliderTris */ -s32 Collider_DestroyTris(PlayState* play, ColliderTris* tris) { +s32 Collider_DestroyTris(struct PlayState* play, ColliderTris* tris) { ColliderTrisElement* element; Collider_DestroyBase(play, &tris->base); @@ -724,7 +731,7 @@ s32 Collider_DestroyTris(PlayState* play, ColliderTris* tris) { * Sets up the ColliderTris using the values in src and dynamically allocates the element array. Uses default * OC2_TYPE_1. */ -s32 Collider_SetTrisAllocType1(PlayState* play, ColliderTris* tris, Actor* actor, ColliderTrisInitType1* src) { +s32 Collider_SetTrisAllocType1(struct PlayState* play, ColliderTris* tris, Actor* actor, ColliderTrisInitType1* src) { ColliderTrisElement* element; ColliderTrisElementInit* srcElem; @@ -749,7 +756,7 @@ s32 Collider_SetTrisAllocType1(PlayState* play, ColliderTris* tris, Actor* actor /** * Sets up the ColliderTris using the values in src, placing the element array in elements. */ -s32 Collider_SetTris(PlayState* play, ColliderTris* triGroup, Actor* actor, ColliderTrisInit* src, +s32 Collider_SetTris(struct PlayState* play, ColliderTris* triGroup, Actor* actor, ColliderTrisInit* src, ColliderTrisElement* tris) { ColliderTrisElement* element; ColliderTrisElementInit* srcElem; @@ -770,7 +777,7 @@ s32 Collider_SetTris(PlayState* play, ColliderTris* triGroup, Actor* actor, Coll /** * Fully initializes a ColliderTris using the values in src, placing the element array in elements. */ -s32 Collider_InitAndSetTris(PlayState* play, ColliderTris* tris, Actor* actor, ColliderTrisInit* src, +s32 Collider_InitAndSetTris(struct PlayState* play, ColliderTris* tris, Actor* actor, ColliderTrisInit* src, ColliderTrisElement* elements) { Collider_InitTris(play, tris); Collider_SetTris(play, tris, actor, src, elements); @@ -780,7 +787,7 @@ s32 Collider_InitAndSetTris(PlayState* play, ColliderTris* tris, Actor* actor, C /** * Resets the collider's AT collision flags. */ -s32 Collider_ResetTrisAT(PlayState* play, Collider* collider) { +s32 Collider_ResetTrisAT(struct PlayState* play, Collider* collider) { ColliderTrisElement* element; ColliderTris* tris = (ColliderTris*)collider; @@ -795,7 +802,7 @@ s32 Collider_ResetTrisAT(PlayState* play, Collider* collider) { /** * Resets the collider's AC collision flags. */ -s32 Collider_ResetTrisAC(PlayState* play, Collider* collider) { +s32 Collider_ResetTrisAC(struct PlayState* play, Collider* collider) { ColliderTrisElement* element; ColliderTris* tris = (ColliderTris*)collider; @@ -810,7 +817,7 @@ s32 Collider_ResetTrisAC(PlayState* play, Collider* collider) { /** * Resets the collider's OC collision flags. */ -s32 Collider_ResetTrisOC(PlayState* play, Collider* collider) { +s32 Collider_ResetTrisOC(struct PlayState* play, Collider* collider) { ColliderTrisElement* element; ColliderTris* tris = (ColliderTris*)collider; @@ -822,7 +829,7 @@ s32 Collider_ResetTrisOC(PlayState* play, Collider* collider) { return 1; } -s32 Collider_InitQuadDim(PlayState* play, ColliderQuadDim* dim) { +s32 Collider_InitQuadDim(struct PlayState* play, ColliderQuadDim* dim) { static ColliderQuadDim defaultColliderQuadDim = { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0, 0, 0 }, @@ -834,11 +841,11 @@ s32 Collider_InitQuadDim(PlayState* play, ColliderQuadDim* dim) { return 1; } -s32 Collider_DestroyQuadDim(PlayState* play, ColliderQuadDim* dim) { +s32 Collider_DestroyQuadDim(struct PlayState* play, ColliderQuadDim* dim) { return 1; } -s32 Collider_ResetQuadACDist(PlayState* play, ColliderQuadDim* dim) { +s32 Collider_ResetQuadACDist(struct PlayState* play, ColliderQuadDim* dim) { dim->acDist = 1.0E38f; return 1; } @@ -852,7 +859,7 @@ void Collider_SetQuadMidpoints(ColliderQuadDim* dim) { dim->baMid.z = (dim->quad[1].z + dim->quad[0].z) * 0.5f; } -s32 Collider_SetQuadDim(PlayState* play, ColliderQuadDim* dim, ColliderQuadDimInit* init) { +s32 Collider_SetQuadDim(struct PlayState* play, ColliderQuadDim* dim, ColliderQuadDimInit* init) { dim->quad[0] = init->quad[0]; dim->quad[1] = init->quad[1]; dim->quad[2] = init->quad[2]; @@ -865,7 +872,7 @@ s32 Collider_SetQuadDim(PlayState* play, ColliderQuadDim* dim, ColliderQuadDimIn /** * Initializes a ColliderQuad to default values. */ -s32 Collider_InitQuad(PlayState* play, ColliderQuad* collider) { +s32 Collider_InitQuad(struct PlayState* play, ColliderQuad* collider) { Collider_InitBase(play, &collider->base); Collider_InitInfo(play, &collider->info); Collider_InitQuadDim(play, &collider->dim); @@ -875,7 +882,7 @@ s32 Collider_InitQuad(PlayState* play, ColliderQuad* collider) { /** * Destroys a ColliderQuad. */ -s32 Collider_DestroyQuad(PlayState* play, ColliderQuad* collider) { +s32 Collider_DestroyQuad(struct PlayState* play, ColliderQuad* collider) { Collider_DestroyBase(play, &collider->base); Collider_DestroyInfo(play, &collider->info); Collider_DestroyQuadDim(play, &collider->dim); @@ -885,7 +892,7 @@ s32 Collider_DestroyQuad(PlayState* play, ColliderQuad* collider) { /** * Sets up the ColliderQuad using the values in src. Uses the default OC2_TYPE_1 */ -s32 Collider_SetQuadType1(PlayState* play, ColliderQuad* collider, Actor* actor, ColliderQuadInitType1* src) { +s32 Collider_SetQuadType1(struct PlayState* play, ColliderQuad* collider, Actor* actor, ColliderQuadInitType1* src) { Collider_SetBaseType1(play, &collider->base, actor, &src->base); Collider_SetInfo(play, &collider->info, &src->info); Collider_SetQuadDim(play, &collider->dim, &src->dim); @@ -895,7 +902,7 @@ s32 Collider_SetQuadType1(PlayState* play, ColliderQuad* collider, Actor* actor, /** * Sets up the ColliderQuad using the values in src. */ -s32 Collider_SetQuad(PlayState* play, ColliderQuad* collider, Actor* actor, ColliderQuadInit* src) { +s32 Collider_SetQuad(struct PlayState* play, ColliderQuad* collider, Actor* actor, ColliderQuadInit* src) { Collider_SetBase(play, &collider->base, actor, &src->base); Collider_SetInfo(play, &collider->info, &src->info); Collider_SetQuadDim(play, &collider->dim, &src->dim); @@ -905,7 +912,7 @@ s32 Collider_SetQuad(PlayState* play, ColliderQuad* collider, Actor* actor, Coll /** * Fully initializes a ColliderQuad using the values in src. */ -s32 Collider_InitAndSetQuad(PlayState* play, ColliderQuad* collider, Actor* actor, ColliderQuadInit* src) { +s32 Collider_InitAndSetQuad(struct PlayState* play, ColliderQuad* collider, Actor* actor, ColliderQuadInit* src) { Collider_InitQuad(play, collider); Collider_SetQuad(play, collider, actor, src); return 0; @@ -914,7 +921,7 @@ s32 Collider_InitAndSetQuad(PlayState* play, ColliderQuad* collider, Actor* acto /** * Resets the collider's AT collision flags. */ -s32 Collider_ResetQuadAT(PlayState* play, Collider* collider) { +s32 Collider_ResetQuadAT(struct PlayState* play, Collider* collider) { ColliderQuad* quad = (ColliderQuad*)collider; Collider_ResetATBase(play, &quad->base); @@ -926,7 +933,7 @@ s32 Collider_ResetQuadAT(PlayState* play, Collider* collider) { /** * Resets the collider's AC collision flags. */ -s32 Collider_ResetQuadAC(PlayState* play, Collider* collider) { +s32 Collider_ResetQuadAC(struct PlayState* play, Collider* collider) { ColliderQuad* quad = (ColliderQuad*)collider; Collider_ResetACBase(play, &quad->base); @@ -937,7 +944,7 @@ s32 Collider_ResetQuadAC(PlayState* play, Collider* collider) { /** * Resets the collider's OC collision flags. */ -s32 Collider_ResetQuadOC(PlayState* play, Collider* collider) { +s32 Collider_ResetQuadOC(struct PlayState* play, Collider* collider) { ColliderQuad* quad = (ColliderQuad*)collider; Collider_ResetOCBase(play, &quad->base); @@ -949,7 +956,7 @@ s32 Collider_ResetQuadOC(PlayState* play, Collider* collider) { * For quad colliders with TOUCH_NEAREST, resets the previous AC collider it hit if the current element is closer, * otherwise returns false. Used on player AT colliders to prevent multiple collisions from registering. */ -s32 Collider_QuadSetNearestAC(PlayState* play, ColliderQuad* quad, Vec3f* hitPos) { +s32 Collider_QuadSetNearestAC(struct PlayState* play, ColliderQuad* quad, Vec3f* hitPos) { f32 acDist; Vec3f dcMid; @@ -977,7 +984,7 @@ s32 Collider_QuadSetNearestAC(PlayState* play, ColliderQuad* quad, Vec3f* hitPos /** * Initializes a ColliderSphere to default values. */ -s32 Collider_InitSphere(PlayState* play, ColliderSphere* collider) { +s32 Collider_InitSphere(struct PlayState* play, ColliderSphere* collider) { Collider_InitBase(play, &collider->base); Collider_InitInfo(play, &collider->info); Collider_InitJntSphElementDim(play, &collider->dim); @@ -987,7 +994,7 @@ s32 Collider_InitSphere(PlayState* play, ColliderSphere* collider) { /** * Destroys a ColliderSphere. */ -s32 Collider_DestroySphere(PlayState* play, ColliderSphere* collider) { +s32 Collider_DestroySphere(struct PlayState* play, ColliderSphere* collider) { Collider_DestroyBase(play, &collider->base); Collider_DestroyInfo(play, &collider->info); Collider_DestroyJntSphElementDim(play, &collider->dim); @@ -997,7 +1004,7 @@ s32 Collider_DestroySphere(PlayState* play, ColliderSphere* collider) { /** * Sets up the ColliderSphere using the values in src. */ -s32 Collider_SetSphere(PlayState* play, ColliderSphere* collider, Actor* actor, ColliderSphereInit* src) { +s32 Collider_SetSphere(struct PlayState* play, ColliderSphere* collider, Actor* actor, ColliderSphereInit* src) { Collider_SetBase(play, &collider->base, actor, &src->base); Collider_SetInfo(play, &collider->info, &src->info); Collider_SetJntSphElementDim(play, &collider->dim, &src->dim); @@ -1007,7 +1014,7 @@ s32 Collider_SetSphere(PlayState* play, ColliderSphere* collider, Actor* actor, /** * Fully initializes a ColliderSphere using the values in src. */ -s32 Collider_InitAndSetSphere(PlayState* play, ColliderSphere* collider, Actor* actor, ColliderSphereInit* src) { +s32 Collider_InitAndSetSphere(struct PlayState* play, ColliderSphere* collider, Actor* actor, ColliderSphereInit* src) { Collider_InitSphere(play, collider); Collider_SetSphere(play, collider, actor, src); return 0; @@ -1016,7 +1023,7 @@ s32 Collider_InitAndSetSphere(PlayState* play, ColliderSphere* collider, Actor* /** * Resets the collider's AT collision flags. */ -s32 Collider_ResetSphereAT(PlayState* play, Collider* collider) { +s32 Collider_ResetSphereAT(struct PlayState* play, Collider* collider) { ColliderSphere* sphere = (ColliderSphere*)collider; Collider_ResetATBase(play, &sphere->base); @@ -1027,7 +1034,7 @@ s32 Collider_ResetSphereAT(PlayState* play, Collider* collider) { /** * Resets the collider's AC collision flags. */ -s32 Collider_ResetSphereAC(PlayState* play, Collider* collider) { +s32 Collider_ResetSphereAC(struct PlayState* play, Collider* collider) { ColliderSphere* sphere = (ColliderSphere*)collider; Collider_ResetACBase(play, &sphere->base); @@ -1038,7 +1045,7 @@ s32 Collider_ResetSphereAC(PlayState* play, Collider* collider) { /** * Resets the collider's OC collision flags. */ -s32 Collider_ResetSphereOC(PlayState* play, Collider* collider) { +s32 Collider_ResetSphereOC(struct PlayState* play, Collider* collider) { ColliderSphere* sphere = (ColliderSphere*)collider; Collider_ResetOCBase(play, &sphere->base); @@ -1049,7 +1056,7 @@ s32 Collider_ResetSphereOC(PlayState* play, Collider* collider) { /** * Initializes an OcLine to default values */ -s32 Collider_InitLine(PlayState* play, OcLine* line) { +s32 Collider_InitLine(struct PlayState* play, OcLine* line) { static Vec3f sDefaultLinePoint = { 0.0f, 0.0f, 0.0f }; Math_Vec3f_Copy(&line->line.a, &sDefaultLinePoint); @@ -1060,14 +1067,14 @@ s32 Collider_InitLine(PlayState* play, OcLine* line) { /** * Destroys an OcLine */ -s32 Collider_DestroyLine(PlayState* play, OcLine* line) { +s32 Collider_DestroyLine(struct PlayState* play, OcLine* line) { return 1; } /** * Sets up an OcLine with endpoints a and b. */ -s32 Collider_SetLinePoints(PlayState* play, OcLine* line, Vec3f* a, Vec3f* b) { +s32 Collider_SetLinePoints(struct PlayState* play, OcLine* line, Vec3f* a, Vec3f* b) { Math_Vec3f_Copy(&line->line.a, a); Math_Vec3f_Copy(&line->line.b, b); return 1; @@ -1076,7 +1083,7 @@ s32 Collider_SetLinePoints(PlayState* play, OcLine* line, Vec3f* a, Vec3f* b) { /** * Sets up an OcLine using the values in src. */ -s32 Collider_SetLine(PlayState* play, OcLine* line, OcLine* src) { +s32 Collider_SetLine(struct PlayState* play, OcLine* line, OcLine* src) { line->ocFlags = src->ocFlags; Collider_SetLinePoints(play, line, &src->line.a, &src->line.b); return 1; @@ -1085,7 +1092,7 @@ s32 Collider_SetLine(PlayState* play, OcLine* line, OcLine* src) { /** * Resets the OcLine's collision flags. */ -s32 Collider_ResetLineOC(PlayState* play, OcLine* line) { +s32 Collider_ResetLineOC(struct PlayState* play, OcLine* line) { line->ocFlags &= ~OCLINE_HIT; return 1; } @@ -1094,18 +1101,18 @@ s32 Collider_ResetLineOC(PlayState* play, OcLine* line) { * Initializes CollisionCheckContext. * Clears all collider arrays, disables SAC, and sets flags for drawing colliders. */ -void CollisionCheck_InitContext(PlayState* play, CollisionCheckContext* colCtxt) { +void CollisionCheck_InitContext(struct PlayState* play, CollisionCheckContext* colCtxt) { colCtxt->sacFlags = 0; CollisionCheck_ClearContext(play, colCtxt); } -void CollisionCheck_DestroyContext(PlayState* play, CollisionCheckContext* colCtxt) { +void CollisionCheck_DestroyContext(struct PlayState* play, CollisionCheckContext* colCtxt) { } /** * Clears all collider lists in CollisionCheckContext when not in SAC mode. */ -void CollisionCheck_ClearContext(PlayState* play, CollisionCheckContext* colCtxt) { +void CollisionCheck_ClearContext(struct PlayState* play, CollisionCheckContext* colCtxt) { Collider** col; OcLine** line; @@ -1138,14 +1145,14 @@ void CollisionCheck_ClearContext(PlayState* play, CollisionCheckContext* colCtxt /** * Enables SAC, an alternate collision check mode that allows direct management of collider lists. */ -void CollisionCheck_EnableSAC(PlayState* play, CollisionCheckContext* colCtxt) { +void CollisionCheck_EnableSAC(struct PlayState* play, CollisionCheckContext* colCtxt) { colCtxt->sacFlags |= SAC_ON; } /** * Disables SAC, an alternate collision check mode that allows direct management of collider lists. */ -void CollisionCheck_DisableSAC(PlayState* play, CollisionCheckContext* colCtxt) { +void CollisionCheck_DisableSAC(struct PlayState* play, CollisionCheckContext* colCtxt) { colCtxt->sacFlags &= ~SAC_ON; } @@ -1157,10 +1164,10 @@ ColChkResetFunc sATResetFuncs[] = { /** * Sets collider as an AT (attack) for the current frame, which will be checked against ACs (attack colliders) */ -s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { +s32 CollisionCheck_SetAT(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { s32 index; - if (FrameAdvance_IsEnabled(&play->state)) { + if (FrameAdvance_IsEnabled(play)) { return -1; } sATResetFuncs[collider->shape](play, collider); @@ -1185,8 +1192,8 @@ s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colCtxt, Collid * If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it * will be inserted into the next slot. */ -s32 CollisionCheck_SetAT_SAC(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider, s32 index) { - if (FrameAdvance_IsEnabled(&play->state)) { +s32 CollisionCheck_SetAT_SAC(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider, s32 index) { + if (FrameAdvance_IsEnabled(play)) { return -1; } sATResetFuncs[collider->shape](play, collider); @@ -1217,10 +1224,10 @@ ColChkResetFunc sACResetFuncs[] = { /** * Sets collider as an AC (attack collider) for the current frame, allowing it to detect ATs (attacks) */ -s32 CollisionCheck_SetAC(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { +s32 CollisionCheck_SetAC(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { s32 index; - if (FrameAdvance_IsEnabled(&play->state)) { + if (FrameAdvance_IsEnabled(play)) { return -1; } sACResetFuncs[collider->shape](play, collider); @@ -1245,8 +1252,8 @@ s32 CollisionCheck_SetAC(PlayState* play, CollisionCheckContext* colCtxt, Collid * If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it * will be inserted into the next slot */ -s32 CollisionCheck_SetAC_SAC(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider, s32 index) { - if (FrameAdvance_IsEnabled(&play->state)) { +s32 CollisionCheck_SetAC_SAC(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider, s32 index) { + if (FrameAdvance_IsEnabled(play)) { return -1; } sACResetFuncs[collider->shape](play, collider); @@ -1277,10 +1284,10 @@ ColChkResetFunc sOCResetFuncs[] = { /** * Sets collider as an OC (object collider) for the current frame, allowing it to detect other OCs. */ -s32 CollisionCheck_SetOC(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { +s32 CollisionCheck_SetOC(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { s32 index; - if (FrameAdvance_IsEnabled(&play->state)) { + if (FrameAdvance_IsEnabled(play)) { return -1; } sOCResetFuncs[collider->shape](play, collider); @@ -1305,8 +1312,8 @@ s32 CollisionCheck_SetOC(PlayState* play, CollisionCheckContext* colCtxt, Collid * If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it * will be inserted into the next slot. */ -s32 CollisionCheck_SetOC_SAC(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider, s32 index) { - if (FrameAdvance_IsEnabled(&play->state)) { +s32 CollisionCheck_SetOC_SAC(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider, s32 index) { + if (FrameAdvance_IsEnabled(play)) { return -1; } sOCResetFuncs[collider->shape](play, collider); @@ -1335,10 +1342,10 @@ s32 CollisionCheck_SetOC_SAC(PlayState* play, CollisionCheckContext* colCtxt, Co /** * Sets a line as an OC collider for this frame. */ -s32 CollisionCheck_SetOCLine(PlayState* play, CollisionCheckContext* colCtxt, OcLine* line) { +s32 CollisionCheck_SetOCLine(struct PlayState* play, CollisionCheckContext* colCtxt, OcLine* line) { s32 index; - if (FrameAdvance_IsEnabled(&play->state)) { + if (FrameAdvance_IsEnabled(play)) { return -1; } @@ -1387,7 +1394,7 @@ s32 CollisionCheck_NoSharedFlags(ColliderInfo* toucher, ColliderInfo* bumper) { * Spawns no blood drops. * Used by collider types HIT1, HIT3, HIT5, METAL, NONE, WOOD, HARD, and TREE */ -void CollisionCheck_NoBlood(PlayState* play, Collider* collider, Vec3f* v) { +void CollisionCheck_NoBlood(struct PlayState* play, Collider* collider, Vec3f* v) { } /** @@ -1396,13 +1403,13 @@ void CollisionCheck_NoBlood(PlayState* play, Collider* collider, Vec3f* v) { */ #ifdef NON_MATCHING // needs in-function static bss -void CollisionCheck_BlueBlood(PlayState* play, Collider* collider, Vec3f* v) { +void CollisionCheck_BlueBlood(struct PlayState* play, Collider* collider, Vec3f* v) { static EffectSparkInit D_801EEC00; s32 effectIndex; D_801EEC00.position.x = v->x; - D_801EEC00.position.x = v->y; - D_801EEC00.position.x = v->z; + D_801EEC00.position.y = v->y; + D_801EEC00.position.z = v->z; D_801EEC00.uDiv = 5; D_801EEC00.vDiv = 5; D_801EEC00.colorStart[0].r = 10; @@ -1454,13 +1461,13 @@ void CollisionCheck_BlueBlood(PlayState* play, Collider* collider, Vec3f* v) { */ #ifdef NON_MATCHING // needs in-function static bss -void CollisionCheck_GreenBlood(PlayState* play, Collider* collider, Vec3f* v) { +void CollisionCheck_GreenBlood(struct PlayState* play, Collider* collider, Vec3f* v) { static EffectSparkInit D_801EF0C8; s32 effectIndex; D_801EF0C8.position.x = v->x; - D_801EF0C8.position.x = v->y; - D_801EF0C8.position.x = v->z; + D_801EF0C8.position.y = v->y; + D_801EF0C8.position.z = v->z; D_801EF0C8.uDiv = 5; D_801EF0C8.vDiv = 5; D_801EF0C8.colorStart[0].r = 10; @@ -1509,7 +1516,7 @@ void CollisionCheck_GreenBlood(PlayState* play, Collider* collider, Vec3f* v) { * Spawns a burst of water. * Used by collider type HIT4. */ -void CollisionCheck_WaterBurst(PlayState* play, Collider* collider, Vec3f* v) { +void CollisionCheck_WaterBurst(struct PlayState* play, Collider* collider, Vec3f* v) { EffectSsSibuki_SpawnBurst(play, v); CollisionCheck_SpawnWaterDroplets(play, v); } @@ -1518,21 +1525,21 @@ void CollisionCheck_WaterBurst(PlayState* play, Collider* collider, Vec3f* v) { * Spawns red blood drops. * Used by collider type HIT7. */ -void CollisionCheck_RedBlood(PlayState* play, Collider* collider, Vec3f* v) { +void CollisionCheck_RedBlood(struct PlayState* play, Collider* collider, Vec3f* v) { CollisionCheck_SpawnRedBlood(play, v); } /** * Spawns red blood drops. */ -void CollisionCheck_RedBloodUnused(PlayState* play, Collider* collider, Vec3f* v) { +void CollisionCheck_RedBloodUnused(struct PlayState* play, Collider* collider, Vec3f* v) { CollisionCheck_SpawnRedBlood(play, v); } /** * Plays sound effects and displays hitmarks for solid-type AC colliders (METAL, WOOD, HARD, and TREE) */ -void CollisionCheck_HitSolid(PlayState* play, ColliderInfo* info, Collider* collider, Vec3f* hitPos) { +void CollisionCheck_HitSolid(struct PlayState* play, ColliderInfo* info, Collider* collider, Vec3f* hitPos) { s32 flags = info->toucherFlags & TOUCH_SFX_NONE; if ((flags == TOUCH_SFX_NORMAL) && (collider->colType != COLTYPE_METAL)) { @@ -1599,8 +1606,8 @@ HitInfo sHitInfo[] = { /** * Handles hitmarks, blood, and sound effects for each AC collision, determined by the AC collider's colType */ -void CollisionCheck_HitEffects(PlayState* play, Collider* at, ColliderInfo* atInfo, Collider* ac, ColliderInfo* acInfo, - Vec3f* hitPos) { +void CollisionCheck_HitEffects(struct PlayState* play, Collider* at, ColliderInfo* atInfo, Collider* ac, + ColliderInfo* acInfo, Vec3f* hitPos) { if (acInfo->bumperFlags & BUMP_NO_HITMARK) { return; } @@ -1649,7 +1656,7 @@ void CollisionCheck_SetBounce(Collider* at, Collider* ac) { /** * Performs the AC collision between the AT element and AC element that collided. */ -s32 CollisionCheck_SetATvsAC(PlayState* play, Collider* at, ColliderInfo* atInfo, Vec3f* atPos, Collider* ac, +s32 CollisionCheck_SetATvsAC(struct PlayState* play, Collider* at, ColliderInfo* atInfo, Vec3f* atPos, Collider* ac, ColliderInfo* acInfo, Vec3f* acPos, Vec3f* hitPos) { f32 damage; u32 effect; @@ -1722,7 +1729,7 @@ void CollisionCheck_QuadAvgPoint(ColliderQuad* quad, Vec3f* avg) { /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_JntSphVsJntSph(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, +void CollisionCheck_AC_JntSphVsJntSph(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { ColliderJntSph* at = (ColliderJntSph*)colAT; ColliderJntSphElement* atElem; @@ -1778,7 +1785,8 @@ void CollisionCheck_AC_JntSphVsJntSph(PlayState* play, CollisionCheckContext* co /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_JntSphVsCyl(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_JntSphVsCyl(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderJntSph* at = (ColliderJntSph*)colAT; ColliderJntSphElement* atElem; ColliderCylinder* ac = (ColliderCylinder*)colAC; @@ -1826,7 +1834,8 @@ void CollisionCheck_AC_JntSphVsCyl(PlayState* play, CollisionCheckContext* colCt /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_JntSphVsTris(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_JntSphVsTris(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderJntSph* at = (ColliderJntSph*)colAT; ColliderJntSphElement* atElem; ColliderTris* ac = (ColliderTris*)colAC; @@ -1863,7 +1872,8 @@ void CollisionCheck_AC_JntSphVsTris(PlayState* play, CollisionCheckContext* colC /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_JntSphVsQuad(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_JntSphVsQuad(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderJntSph* at = (ColliderJntSph*)colAT; ColliderQuad* ac = (ColliderQuad*)colAC; Vec3f hitPos; @@ -1901,7 +1911,7 @@ void CollisionCheck_AC_JntSphVsQuad(PlayState* play, CollisionCheckContext* colC /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_JntSphVsSphere(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, +void CollisionCheck_AC_JntSphVsSphere(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { ColliderJntSph* at = (ColliderJntSph*)colAT; ColliderSphere* ac = (ColliderSphere*)colAC; @@ -1947,7 +1957,8 @@ void CollisionCheck_AC_JntSphVsSphere(PlayState* play, CollisionCheckContext* co /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_CylVsJntSph(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_CylVsJntSph(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderCylinder* at = (ColliderCylinder*)colAT; ColliderJntSph* ac = (ColliderJntSph*)colAC; f32 overlapSize; @@ -1998,7 +2009,8 @@ void CollisionCheck_AC_CylVsJntSph(PlayState* play, CollisionCheckContext* colCt /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_CylVsCyl(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_CylVsCyl(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderCylinder* at = (ColliderCylinder*)colAT; ColliderCylinder* ac = (ColliderCylinder*)colAC; f32 overlapSize; @@ -2050,7 +2062,8 @@ void CollisionCheck_AC_CylVsCyl(PlayState* play, CollisionCheckContext* colCtxt, /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_CylVsTris(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_CylVsTris(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderCylinder* at = (ColliderCylinder*)colAT; ColliderTris* ac = (ColliderTris*)colAC; ColliderTrisElement* acElem; @@ -2085,7 +2098,8 @@ void CollisionCheck_AC_CylVsTris(PlayState* play, CollisionCheckContext* colCtxt /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_CylVsQuad(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_CylVsQuad(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderCylinder* at = (ColliderCylinder*)colAT; ColliderQuad* ac = (ColliderQuad*)colAC; @@ -2123,7 +2137,8 @@ void CollisionCheck_AC_CylVsQuad(PlayState* play, CollisionCheckContext* colCtxt /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_CylVsSphere(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_CylVsSphere(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderCylinder* at = (ColliderCylinder*)colAT; ColliderSphere* ac = (ColliderSphere*)colAC; f32 overlapSize; @@ -2169,7 +2184,8 @@ void CollisionCheck_AC_CylVsSphere(PlayState* play, CollisionCheckContext* colCt /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_TrisVsJntSph(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_TrisVsJntSph(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderTris* at = (ColliderTris*)colAT; ColliderJntSphElement* acElem; ColliderJntSph* ac = (ColliderJntSph*)colAC; @@ -2209,7 +2225,8 @@ void CollisionCheck_AC_TrisVsJntSph(PlayState* play, CollisionCheckContext* colC /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_TrisVsCyl(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_TrisVsCyl(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderTris* at = (ColliderTris*)colAT; ColliderCylinder* ac = (ColliderCylinder*)colAC; ColliderTrisElement* atElem; @@ -2242,7 +2259,8 @@ void CollisionCheck_AC_TrisVsCyl(PlayState* play, CollisionCheckContext* colCtxt /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_TrisVsTris(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_TrisVsTris(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderTris* at = (ColliderTris*)colAT; ColliderTrisElement* atElem; ColliderTris* ac = (ColliderTris*)colAC; @@ -2278,7 +2296,8 @@ void CollisionCheck_AC_TrisVsTris(PlayState* play, CollisionCheckContext* colCtx /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_TrisVsQuad(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_TrisVsQuad(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderTris* at = (ColliderTris*)colAT; ColliderQuad* ac = (ColliderQuad*)colAC; ColliderTrisElement* atElem; @@ -2316,7 +2335,8 @@ void CollisionCheck_AC_TrisVsQuad(PlayState* play, CollisionCheckContext* colCtx /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_TrisVsSphere(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_TrisVsSphere(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderTris* at = (ColliderTris*)colAT; ColliderTrisElement* atElem; ColliderSphere* ac = (ColliderSphere*)colAC; @@ -2348,7 +2368,8 @@ void CollisionCheck_AC_TrisVsSphere(PlayState* play, CollisionCheckContext* colC /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_QuadVsJntSph(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_QuadVsJntSph(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderJntSphElement* acElem; Vec3f hitPos; ColliderQuad* at = (ColliderQuad*)colAT; @@ -2391,7 +2412,8 @@ void CollisionCheck_AC_QuadVsJntSph(PlayState* play, CollisionCheckContext* colC /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_QuadVsCyl(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_QuadVsCyl(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderQuad* at = (ColliderQuad*)colAT; ColliderCylinder* ac = (ColliderCylinder*)colAC; @@ -2436,7 +2458,8 @@ void CollisionCheck_AC_QuadVsCyl(PlayState* play, CollisionCheckContext* colCtxt /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_QuadVsTris(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_QuadVsTris(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderQuad* at = (ColliderQuad*)colAT; ColliderTris* ac = (ColliderTris*)colAC; ColliderTrisElement* acElem; @@ -2477,7 +2500,8 @@ void CollisionCheck_AC_QuadVsTris(PlayState* play, CollisionCheckContext* colCtx /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_QuadVsQuad(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_QuadVsQuad(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderQuad* at = (ColliderQuad*)colAT; ColliderQuad* ac = (ColliderQuad*)colAC; s32 i; @@ -2517,7 +2541,8 @@ void CollisionCheck_AC_QuadVsQuad(PlayState* play, CollisionCheckContext* colCtx /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_QuadVsSphere(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_QuadVsSphere(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderQuad* at = (ColliderQuad*)colAT; Vec3f hitPos; ColliderSphere* ac = (ColliderSphere*)colAC; @@ -2548,7 +2573,7 @@ void CollisionCheck_AC_QuadVsSphere(PlayState* play, CollisionCheckContext* colC /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_SphereVsJntSph(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, +void CollisionCheck_AC_SphereVsJntSph(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { ColliderSphere* at = (ColliderSphere*)colAT; ColliderJntSph* ac = (ColliderJntSph*)colAC; @@ -2595,7 +2620,7 @@ void CollisionCheck_AC_SphereVsJntSph(PlayState* play, CollisionCheckContext* co /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_SphereVsCylinder(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, +void CollisionCheck_AC_SphereVsCylinder(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { ColliderCylinder* ac = (ColliderCylinder*)colAC; ColliderSphere* at = (ColliderSphere*)colAT; @@ -2642,7 +2667,8 @@ void CollisionCheck_AC_SphereVsCylinder(PlayState* play, CollisionCheckContext* /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_SphereVsTris(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_SphereVsTris(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderSphere* at = (ColliderSphere*)colAT; ColliderTris* ac = (ColliderTris*)colAC; ColliderTrisElement* acElem; @@ -2674,7 +2700,8 @@ void CollisionCheck_AC_SphereVsTris(PlayState* play, CollisionCheckContext* colC /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_SphereVsQuad(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { +void CollisionCheck_AC_SphereVsQuad(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, + Collider* colAC) { ColliderSphere* at = (ColliderSphere*)colAT; Vec3f hitPos; ColliderQuad* ac = (ColliderQuad*)colAC; @@ -2703,7 +2730,7 @@ void CollisionCheck_AC_SphereVsQuad(PlayState* play, CollisionCheckContext* colC /** * AC overlap check. Calculates the center of each collider element and the point of contact. */ -void CollisionCheck_AC_SphereVsSphere(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, +void CollisionCheck_AC_SphereVsSphere(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) { ColliderSphere* at = (ColliderSphere*)colAT; ColliderSphere* ac = (ColliderSphere*)colAC; @@ -2743,7 +2770,7 @@ void CollisionCheck_AC_SphereVsSphere(PlayState* play, CollisionCheckContext* co /** * Sets a ColliderJntSph's hit effects */ -void CollisionCheck_SetJntSphHitFX(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { +void CollisionCheck_SetJntSphHitFX(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { ColliderJntSph* jntSph = (ColliderJntSph*)collider; ColliderJntSphElement* element; @@ -2764,7 +2791,7 @@ void CollisionCheck_SetJntSphHitFX(PlayState* play, CollisionCheckContext* colCt /** * Sets a ColliderCylinder's hit effects */ -void CollisionCheck_SetCylHitFX(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { +void CollisionCheck_SetCylHitFX(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { ColliderCylinder* cylinder = (ColliderCylinder*)collider; if ((cylinder->info.bumperFlags & BUMP_DRAW_HITMARK) && (cylinder->info.acHitInfo != NULL) && @@ -2781,7 +2808,7 @@ void CollisionCheck_SetCylHitFX(PlayState* play, CollisionCheckContext* colCtxt, /** * Sets a ColliderTris's hit effects */ -void CollisionCheck_SetTrisHitFX(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { +void CollisionCheck_SetTrisHitFX(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { ColliderTris* tris = (ColliderTris*)collider; ColliderTrisElement* element; @@ -2802,7 +2829,7 @@ void CollisionCheck_SetTrisHitFX(PlayState* play, CollisionCheckContext* colCtxt /** * Sets a ColliderQuad's hit effects */ -void CollisionCheck_SetQuadHitFX(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { +void CollisionCheck_SetQuadHitFX(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { ColliderQuad* quad = (ColliderQuad*)collider; if ((quad->info.bumperFlags & BUMP_DRAW_HITMARK) && (quad->info.acHitInfo != NULL) && @@ -2818,7 +2845,7 @@ void CollisionCheck_SetQuadHitFX(PlayState* play, CollisionCheckContext* colCtxt /** * Sets a ColliderSphere's hit effects */ -void CollisionCheck_SetSphereHitFX(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { +void CollisionCheck_SetSphereHitFX(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { ColliderSphere* sphere = (ColliderSphere*)collider; if ((sphere->info.bumperFlags & BUMP_DRAW_HITMARK) && (sphere->info.acHitInfo != NULL) && @@ -2840,7 +2867,7 @@ ColChkApplyFunc sColChkApplyFuncs[] = { /** * Handles hit effects for each AC collider that had an AC collision. Spawns hitmarks and plays sound effects. */ -void CollisionCheck_SetHitEffects(PlayState* play, CollisionCheckContext* colCtxt) { +void CollisionCheck_SetHitEffects(struct PlayState* play, CollisionCheckContext* colCtxt) { Collider** col; for (col = &colCtxt->colAC[0]; col < &colCtxt->colAC[colCtxt->colACCount]; col++) { @@ -2871,7 +2898,7 @@ ColChkVsFunc sACVsFuncs[COLSHAPE_MAX][COLSHAPE_MAX] = { /** * Iterates through all AC colliders, performing AC collisions with the AT collider. */ -void CollisionCheck_AC(PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT) { +void CollisionCheck_AC(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* colAT) { Collider** col; for (col = &colCtxt->colAC[0]; col < &colCtxt->colAC[colCtxt->colACCount]; col++) { @@ -2897,7 +2924,7 @@ void CollisionCheck_AC(PlayState* play, CollisionCheckContext* colCtxt, Collider * successful collision. To collide, an AT collider must share a type (AC_TYPE_PLAYER, AC_TYPE_ENEMY, or AC_TYPE_OTHER) * with the AC collider and the toucher and bumper elements that overlapped must share a dmgFlag. */ -void CollisionCheck_AT(PlayState* play, CollisionCheckContext* colCtxt) { +void CollisionCheck_AT(struct PlayState* play, CollisionCheckContext* colCtxt) { Collider** col; if ((colCtxt->colATCount == 0) || (colCtxt->colACCount == 0)) { @@ -2936,8 +2963,8 @@ s32 CollisionCheck_GetMassType(u8 mass) { * Sets OC collision flags for OC collider overlaps. If both colliders are attached to actors and can push, * also performs an elastic collision where both colliders are moved apart in proportion to their masses. */ -void CollisionCheck_SetOCvsOC(PlayState* play, Collider* left, ColliderInfo* leftInfo, Vec3f* leftPos, Collider* right, - ColliderInfo* rightInfo, Vec3f* rightPos, f32 overlapSize) { +void CollisionCheck_SetOCvsOC(struct PlayState* play, Collider* left, ColliderInfo* leftInfo, Vec3f* leftPos, + Collider* right, ColliderInfo* rightInfo, Vec3f* rightPos, f32 overlapSize) { f32 pad; f32 leftDispRatio; f32 rightDispRatio; @@ -3035,7 +3062,8 @@ void CollisionCheck_SetOCvsOC(PlayState* play, Collider* left, ColliderInfo* lef /** * OC overlap check for two JntSphs */ -void CollisionCheck_OC_JntSphVsJntSph(PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { +void CollisionCheck_OC_JntSphVsJntSph(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* l, + Collider* r) { ColliderJntSph* left = (ColliderJntSph*)l; ColliderJntSph* right = (ColliderJntSph*)r; ColliderJntSphElement* leftElem; @@ -3071,7 +3099,7 @@ void CollisionCheck_OC_JntSphVsJntSph(PlayState* play, CollisionCheckContext* co /** * OC overlap check for a JntSph and Cylinder */ -void CollisionCheck_OC_JntSphVsCyl(PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { +void CollisionCheck_OC_JntSphVsCyl(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { ColliderJntSph* left = (ColliderJntSph*)l; ColliderCylinder* right = (ColliderCylinder*)r; ColliderJntSphElement* leftElem; @@ -3100,7 +3128,8 @@ void CollisionCheck_OC_JntSphVsCyl(PlayState* play, CollisionCheckContext* colCt /** * OC overlap check for a JntSph and Sphere */ -void CollisionCheck_OC_JntSphVsSphere(PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { +void CollisionCheck_OC_JntSphVsSphere(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* l, + Collider* r) { ColliderJntSph* left = (ColliderJntSph*)l; ColliderSphere* right = (ColliderSphere*)r; ColliderJntSphElement* leftElem; @@ -3129,14 +3158,14 @@ void CollisionCheck_OC_JntSphVsSphere(PlayState* play, CollisionCheckContext* co /** * OC overlap check for a Cylinder and JntSph */ -void CollisionCheck_OC_CylVsJntSph(PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { +void CollisionCheck_OC_CylVsJntSph(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { CollisionCheck_OC_JntSphVsCyl(play, colCtxt, r, l); } /** * OC overlap check for two Cylinders */ -void CollisionCheck_OC_CylVsCyl(PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { +void CollisionCheck_OC_CylVsCyl(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { ColliderCylinder* left = (ColliderCylinder*)l; ColliderCylinder* right = (ColliderCylinder*)r; f32 overlapSize; @@ -3158,7 +3187,7 @@ void CollisionCheck_OC_CylVsCyl(PlayState* play, CollisionCheckContext* colCtxt, /** * OC overlap check for a Cylinder and Sphere */ -void CollisionCheck_OC_CylVsSphere(PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { +void CollisionCheck_OC_CylVsSphere(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { ColliderCylinder* left = (ColliderCylinder*)l; ColliderSphere* right = (ColliderSphere*)r; f32 overlapSize; @@ -3180,21 +3209,23 @@ void CollisionCheck_OC_CylVsSphere(PlayState* play, CollisionCheckContext* colCt /** * OC overlap check for a Sphere and JntSph */ -void CollisionCheck_OC_SphereVsJntSph(PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { +void CollisionCheck_OC_SphereVsJntSph(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* l, + Collider* r) { CollisionCheck_OC_JntSphVsSphere(play, colCtxt, r, l); } /** * OC overlap check for a Sphere and Cylinder */ -void CollisionCheck_OC_SphereVsCyl(PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { +void CollisionCheck_OC_SphereVsCyl(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { CollisionCheck_OC_CylVsSphere(play, colCtxt, r, l); } /** * OC overlap check for two Spheres */ -void CollisionCheck_OC_SphereVsSphere(PlayState* play, CollisionCheckContext* colCtxt, Collider* l, Collider* r) { +void CollisionCheck_OC_SphereVsSphere(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* l, + Collider* r) { ColliderSphere* left = (ColliderSphere*)l; ColliderSphere* right = (ColliderSphere*)r; f32 overlapSize; @@ -3256,7 +3287,7 @@ ColChkVsFunc sOCVsFuncs[COLSHAPE_MAX][COLSHAPE_MAX] = { * colliders can collide, and each collider must have the OC flag corresponding to the other's OC type. Additionally, * OC2_UNK1 cannot collide with OC2_UNK2, nor can two colliders that share an actor. */ -void CollisionCheck_OC(PlayState* play, CollisionCheckContext* colCtxt) { +void CollisionCheck_OC(struct PlayState* play, CollisionCheckContext* colCtxt) { Collider** left; Collider** right; ColChkVsFunc vsFunc; @@ -3343,7 +3374,7 @@ void CollisionCheck_SetInfoGetDamageTable(CollisionCheckInfo* info, s32 index, C /** * Apply AC damage effect */ -void CollisionCheck_ApplyDamage(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider, +void CollisionCheck_ApplyDamage(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider, ColliderInfo* info) { f32 damage; f32 finalDamage = 0.0f; @@ -3394,7 +3425,7 @@ void CollisionCheck_ApplyDamage(PlayState* play, CollisionCheckContext* colCtxt, /** * Apply ColliderJntSph AC damage effect */ -void CollisionCheck_ApplyDamageJntSph(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { +void CollisionCheck_ApplyDamageJntSph(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { ColliderJntSph* jntSph = (ColliderJntSph*)collider; s32 i; @@ -3408,7 +3439,7 @@ void CollisionCheck_ApplyDamageJntSph(PlayState* play, CollisionCheckContext* co /** * Apply ColliderCylinder AC damage effect */ -void CollisionCheck_ApplyDamageCyl(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { +void CollisionCheck_ApplyDamageCyl(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { ColliderCylinder* cylinder = (ColliderCylinder*)collider; CollisionCheck_ApplyDamage(play, colCtxt, &cylinder->base, &cylinder->info); @@ -3417,7 +3448,7 @@ void CollisionCheck_ApplyDamageCyl(PlayState* play, CollisionCheckContext* colCt /** * Apply ColliderTris AC damage effect */ -void CollisionCheck_ApplyDamageTris(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { +void CollisionCheck_ApplyDamageTris(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { ColliderTris* tris = (ColliderTris*)collider; s32 i; @@ -3431,7 +3462,7 @@ void CollisionCheck_ApplyDamageTris(PlayState* play, CollisionCheckContext* colC /** * Apply ColliderQuad AC damage effect */ -void CollisionCheck_ApplyDamageQuad(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { +void CollisionCheck_ApplyDamageQuad(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { ColliderQuad* quad = (ColliderQuad*)collider; CollisionCheck_ApplyDamage(play, colCtxt, &quad->base, &quad->info); @@ -3440,7 +3471,7 @@ void CollisionCheck_ApplyDamageQuad(PlayState* play, CollisionCheckContext* colC /** * Apply ColliderSphere AC damage effect */ -void CollisionCheck_ApplyDamageSphere(PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { +void CollisionCheck_ApplyDamageSphere(struct PlayState* play, CollisionCheckContext* colCtxt, Collider* collider) { ColliderSphere* sphere = (ColliderSphere*)collider; CollisionCheck_ApplyDamage(play, colCtxt, &sphere->base, &sphere->info); @@ -3455,7 +3486,7 @@ ColChkApplyFunc sApplyDamageFuncs[] = { * For all AC colliders, sets any damage effects from collisions with AT colliders to their corresponding actor's * CollisionCheckInfo. */ -void CollisionCheck_Damage(PlayState* play, CollisionCheckContext* colCtxt) { +void CollisionCheck_Damage(struct PlayState* play, CollisionCheckContext* colCtxt) { s32 i; for (i = 0; i < colCtxt->colACCount; i++) { @@ -3474,7 +3505,7 @@ void CollisionCheck_Damage(PlayState* play, CollisionCheckContext* colCtxt) { /** * Checks if the line segment ab intersects any of the ColliderJntSph's elements */ -s32 CollisionCheck_LineOC_JntSph(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, Vec3f* a, +s32 CollisionCheck_LineOC_JntSph(struct PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, Vec3f* a, Vec3f* b) { ColliderJntSph* jntSph = (ColliderJntSph*)collider; s32 i; @@ -3498,7 +3529,7 @@ s32 CollisionCheck_LineOC_JntSph(PlayState* play, CollisionCheckContext* colChkC /** * Checks if the line segment ab intersects the ColliderCylinder */ -s32 CollisionCheck_LineOC_Cyl(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, Vec3f* a, +s32 CollisionCheck_LineOC_Cyl(struct PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, Vec3f* a, Vec3f* b) { ColliderCylinder* cylinder = (ColliderCylinder*)collider; @@ -3516,7 +3547,7 @@ s32 CollisionCheck_LineOC_Cyl(PlayState* play, CollisionCheckContext* colChkCtx, /** * Checks if the line segment ab intersects the ColliderSphere */ -s32 CollisionCheck_LineOC_Sphere(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, Vec3f* a, +s32 CollisionCheck_LineOC_Sphere(struct PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, Vec3f* a, Vec3f* b) { ColliderSphere* sphere = (ColliderSphere*)collider; @@ -3541,8 +3572,8 @@ ColChkLineFunc sOCLineCheckFuncs[] = { * Checks if the line segment ab intersects any OC colliders, excluding those attached to actors * on the exclusion list. Returns true if there are any intersections and false otherwise. */ -s32 CollisionCheck_LineOC(PlayState* play, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b, Actor** exclusions, - s32 numExclusions) { +s32 CollisionCheck_LineOC(struct PlayState* play, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b, + Actor** exclusions, s32 numExclusions) { ColChkLineFunc lineCheck; Collider** col; s32 i; @@ -3582,7 +3613,7 @@ s32 CollisionCheck_LineOC(PlayState* play, CollisionCheckContext* colChkCtx, Vec * Checks if the line segment ab intersects any OC colliders. Returns true if there are any intersections and false * otherwise. */ -s32 CollisionCheck_LineOCCheckAll(PlayState* play, CollisionCheckContext* colCtxt, Vec3f* a, Vec3f* b) { +s32 CollisionCheck_LineOCCheckAll(struct PlayState* play, CollisionCheckContext* colCtxt, Vec3f* a, Vec3f* b) { return CollisionCheck_LineOC(play, colCtxt, a, b, NULL, 0); } @@ -3590,8 +3621,8 @@ s32 CollisionCheck_LineOCCheckAll(PlayState* play, CollisionCheckContext* colCtx * Checks if the line segment ab intersects any OC colliders, excluding those attached to actors on the exclusion list. * Returns true if there are any intersections and false otherwise. */ -s32 CollisionCheck_LineOCCheck(PlayState* play, CollisionCheckContext* colCtxt, Vec3f* a, Vec3f* b, Actor** exclusions, - s32 numExclusions) { +s32 CollisionCheck_LineOCCheck(struct PlayState* play, CollisionCheckContext* colCtxt, Vec3f* a, Vec3f* b, + Actor** exclusions, s32 numExclusions) { return CollisionCheck_LineOC(play, colCtxt, a, b, exclusions, numExclusions); } @@ -3647,7 +3678,7 @@ void Collider_SetTrisVertices(ColliderTris* collider, s32 index, Vec3f* a, Vec3f /** * Sets the specified ColliderTrisElement's dim using the values in src */ -void Collider_SetTrisDim(PlayState* play, ColliderTris* collider, s32 index, ColliderTrisElementDimInit* init) { +void Collider_SetTrisDim(struct PlayState* play, ColliderTris* collider, s32 index, ColliderTrisElementDimInit* init) { ColliderTrisElement* element = &collider->elements[index]; Collider_SetTrisElementDim(play, &element->dim, init); @@ -3727,13 +3758,13 @@ void Collider_UpdateSphere(s32 limb, ColliderSphere* collider) { */ #ifdef NON_MATCHING // needs in-function static bss -void CollisionCheck_SpawnRedBlood(PlayState* play, Vec3f* v) { +void CollisionCheck_SpawnRedBlood(struct PlayState* play, Vec3f* v) { static EffectSparkInit D_801EE200; s32 effectIndex; D_801EE200.position.x = v->x; - D_801EE200.position.x = v->y; - D_801EE200.position.x = v->z; + D_801EE200.position.y = v->y; + D_801EE200.position.z = v->z; D_801EE200.uDiv = 5; D_801EE200.vDiv = 5; D_801EE200.colorStart[0].r = 128; @@ -3785,13 +3816,13 @@ void CollisionCheck_SpawnRedBlood(PlayState* play, Vec3f* v) { */ #ifdef NON_MATCHING // needs in-function static bss -void CollisionCheck_SpawnWaterDroplets(PlayState* play, Vec3f* v) { +void CollisionCheck_SpawnWaterDroplets(struct PlayState* play, Vec3f* v) { static EffectSparkInit D_801EE738; s32 effectIndex; D_801EE738.position.x = v->x; - D_801EE738.position.x = v->y; - D_801EE738.position.x = v->z; + D_801EE738.position.y = v->y; + D_801EE738.position.z = v->z; D_801EE738.uDiv = 5; D_801EE738.vDiv = 5; D_801EE738.colorStart[0].r = 255; @@ -3840,7 +3871,7 @@ void CollisionCheck_SpawnWaterDroplets(PlayState* play, Vec3f* v) { /** * Spawns streaks of light from hits against solid objects */ -void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v) { +void CollisionCheck_SpawnShieldParticles(struct PlayState* play, Vec3f* v) { static EffectShieldParticleInit shieldParticleInitMetal = { 16, { 0, 0, 0 }, @@ -3872,7 +3903,7 @@ void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v) { /** * Spawns streaks of light and makes a metallic sound */ -void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v) { +void CollisionCheck_SpawnShieldParticlesMetal(struct PlayState* play, Vec3f* v) { CollisionCheck_SpawnShieldParticles(play, v); Audio_PlaySfx(NA_SE_IT_SHIELD_REFLECT_SW); } @@ -3880,7 +3911,7 @@ void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v) { /** * Spawns streaks of light and makes a metallic sound at the specified position */ -void CollisionCheck_SpawnShieldParticlesMetalSound(PlayState* play, Vec3f* v, Vec3f* pos) { +void CollisionCheck_SpawnShieldParticlesMetalSound(struct PlayState* play, Vec3f* v, Vec3f* pos) { CollisionCheck_SpawnShieldParticles(play, v); Audio_PlaySfx_AtPos(pos, NA_SE_IT_SHIELD_REFLECT_SW); } @@ -3888,14 +3919,14 @@ void CollisionCheck_SpawnShieldParticlesMetalSound(PlayState* play, Vec3f* v, Ve /** * Spawns streaks of light and makes a metallic sound */ -void CollisionCheck_SpawnShieldParticlesMetal2(PlayState* play, Vec3f* v) { +void CollisionCheck_SpawnShieldParticlesMetal2(struct PlayState* play, Vec3f* v) { CollisionCheck_SpawnShieldParticlesMetal(play, v); } /** * Spawns streaks of light and makes a wooden sound */ -void CollisionCheck_SpawnShieldParticlesWood(PlayState* play, Vec3f* v, Vec3f* pos) { +void CollisionCheck_SpawnShieldParticlesWood(struct PlayState* play, Vec3f* v, Vec3f* pos) { static EffectShieldParticleInit shieldParticleInitWood = { 16, { 0, 0, 0 }, diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 7527cc3a10..d7a2239e8f 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -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); } } diff --git a/src/code/z_effect.c b/src/code/z_effect.c index 94600e9f93..8736ad355e 100644 --- a/src/code/z_effect.c +++ b/src/code/z_effect.c @@ -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: diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c index abe0f5d974..fda7dc1033 100644 --- a/src/code/z_effect_soft_sprite.c +++ b/src/code/z_effect_soft_sprite.c @@ -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; diff --git a/src/code/z_game_over.c b/src/code/z_game_over.c index 8340e8397d..d7ed33f9d0 100644 --- a/src/code/z_game_over.c +++ b/src/code/z_game_over.c @@ -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; } diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index 586ac8c760..b576056681 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -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); } diff --git a/src/code/z_lib.c b/src/code/z_lib.c index 648f56cff0..8a494cf76a 100644 --- a/src/code/z_lib.c +++ b/src/code/z_lib.c @@ -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); diff --git a/src/code/z_message.c b/src/code/z_message.c index b4bda662ac..175fd529c0 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -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) { diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index f9b6d9cfb8..f1928b8dfe 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -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 */ diff --git a/src/code/z_play.c b/src/code/z_play.c index 054bfe8e25..af7b40426c 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -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; diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index d4ab778998..fb77070b4d 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -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; } diff --git a/src/code/z_scene.c b/src/code/z_scene.c index cbcea15cbd..175a0abd45 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -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) { diff --git a/src/code/z_sram_NES.c b/src/code/z_sram_NES.c index e3fac08b51..c09db9c78b 100644 --- a/src/code/z_sram_NES.c +++ b/src/code/z_sram_NES.c @@ -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; diff --git a/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c b/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c index 45ff36a948..45cdef9e06 100644 --- a/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c +++ b/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c @@ -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); } diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c index e44c276faf..9fe77b05bb 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c @@ -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" diff --git a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c index 13710bbca3..3be27fd635 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c @@ -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); diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c index b98a783796..4de1ad0202 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -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; diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 7f8b641ba8..8326666905 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -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; diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 794648cde4..81bdd2d376 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c index 52e64f825c..031f3bbcb4 100644 --- a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c +++ b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 6f8865b7ef..4a35d757bc 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c index 27adcbaf53..d7d8dfecd3 100644 --- a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c +++ b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index ea668fded6..d9b8378336 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index e933029c3d..662e1bf425 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Test4/z_en_test4.c b/src/overlays/actors/ovl_En_Test4/z_en_test4.c index b6d175e836..f340629743 100644 --- a/src/overlays/actors/ovl_En_Test4/z_en_test4.c +++ b/src/overlays/actors/ovl_En_Test4/z_en_test4.c @@ -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)) { diff --git a/src/overlays/actors/ovl_En_Test6/z_en_test6.c b/src/overlays/actors/ovl_En_Test6/z_en_test6.c index 5c3b8ca903..69261490ed 100644 --- a/src/overlays/actors/ovl_En_Test6/z_en_test6.c +++ b/src/overlays/actors/ovl_En_Test6/z_en_test6.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Test7/z_en_test7.c b/src/overlays/actors/ovl_En_Test7/z_en_test7.c index 0853fe1177..da2aab1d5f 100644 --- a/src/overlays/actors/ovl_En_Test7/z_en_test7.c +++ b/src/overlays/actors/ovl_En_Test7/z_en_test7.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 7980c80940..0c7edc55cb 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Tru/z_en_tru.c b/src/overlays/actors/ovl_En_Tru/z_en_tru.c index ff8829bf23..243b0744a8 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -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++; diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 470182d9d3..4300fd1ab4 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c index 99917b5c15..188180499a 100644 --- a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c +++ b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c index 57153ea886..8896888e50 100644 --- a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c +++ b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c @@ -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(); } diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 2e537812ec..7c7a9ea138 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -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)) { diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 5393b0d7ad..1a44699215 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -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); } } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index c71e340203..e1c4aa12ec 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -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; diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c index 3d3a8c52fd..377db040e7 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c @@ -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;