1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 22:44:30 +00:00

Merge branch 'master' into doc_pause_menu

This commit is contained in:
Dragorn421 2023-01-13 15:13:26 +01:00
commit 6be902cd24
No known key found for this signature in database
GPG key ID: 32B53D2D16FC4118
232 changed files with 2748 additions and 2576 deletions

View file

@ -7,6 +7,8 @@
.section .bss
# Note: This file is only included in the MATCHING build, the data is imported for non-matching
.balign 16
glabel sFaultInstance

View file

@ -7,10 +7,12 @@
.section .bss
# Note: This file is only included in the MATCHING build, the data is imported for non-matching
.balign 16
glabel sFaultDrawer
.space 0x3C
glabel D_8016B6C0
.space 0x20
glabel D_8016B6BC
.space 0x24

View file

@ -358,12 +358,12 @@ void Actor_Kill(Actor* actor);
void Actor_SetFocus(Actor* actor, f32 yOffset);
void Actor_SetScale(Actor* actor, f32 scale);
void Actor_SetObjectDependency(PlayState* play, Actor* actor);
void func_8002D7EC(Actor* actor);
void func_8002D868(Actor* actor);
void Actor_MoveForward(Actor* actor);
void func_8002D908(Actor* actor);
void func_8002D97C(Actor* actor);
void func_8002D9A4(Actor* actor, f32 arg1);
void Actor_UpdatePos(Actor* actor);
void Actor_UpdateVelocityXZGravity(Actor* actor);
void Actor_MoveXZGravity(Actor* actor);
void Actor_UpdateVelocityXYZ(Actor* actor);
void Actor_MoveXYZ(Actor* actor);
void Actor_SetProjectileSpeed(Actor* actor, f32 speedXYZ);
s16 Actor_WorldYawTowardActor(Actor* actorA, Actor* actorB);
s16 Actor_WorldYawTowardPoint(Actor* actor, Vec3f* refPoint);
f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB);
@ -761,8 +761,8 @@ u8 CollisionCheck_GetSwordDamage(s32 dmgFlags);
void SaveContext_Init(void);
s32 func_800635D0(s32);
void Regs_Init(void);
void DbCamera_ScreenText(u8 x, u8 y, const char* text);
void DbCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text);
void DebugCamera_ScreenText(u8 x, u8 y, const char* text);
void DebugCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text);
void Regs_UpdateEditor(Input* input);
void Debug_DrawText(GraphicsContext* gfxCtx);
void DebugDisplay_Init(void);
@ -1252,39 +1252,10 @@ u32 Letterbox_GetSize(void);
void Letterbox_Init(void);
void Letterbox_Destroy(void);
void Letterbox_Update(s32 updateRate);
// ? DbCamera_AddVecGeoToVec3f(?);
// ? DbCamera_CalcUpFromPitchYawRoll(?);
// ? DbCamera_SetTextValue(?);
// ? DbCamera_Vec3SToF(?);
// ? DbCamera_Vec3FToS(?);
// ? DbCamera_CopyVec3f(?);
// ? DbCamera_Vec3SToF2(?);
// ? func_800B3F94(?);
// ? func_800B3FF4(?);
// ? func_800B404C(?);
// ? func_800B4088(?);
// ? func_800B41DC(?);
// ? func_800B42C0(?);
// ? func_800B4370(?);
// ? func_800B44E0(?);
// ? DbCamera_PrintPoints(?);
// ? DbCamera_PrintF32Bytes(?);
// ? DbCamera_PrintU16Bytes(?);
// ? DbCamera_PrintS16Bytes(?);
// ? DbCamera_PrintCutBytes(?);
void DbCamera_Init(DbCamera* dbCamera, Camera* cameraPtr);
void DbgCamera_Enable(DbCamera* dbCamera, Camera* cam);
void DbCamera_Update(DbCamera* dbCamera, Camera* cam);
// ? DbCamera_GetFirstAvailableLetter(?);
// ? DbCamera_InitCut(?);
// ? DbCamera_ResetCut(?);
// ? DbCamera_CalcMempakAllocSize(?);
// ? DbCamera_GetMempakAllocSize(?);
// ? DbCamera_DrawSlotLetters(?);
// ? DbCamera_PrintAllCuts(?);
// ? func_800B91B0(?);
void DbCamera_Reset(Camera* cam, DbCamera* dbCam);
// ? DbCamera_UpdateDemoControl(?);
void DebugCamera_Init(DebugCam* debugCam, Camera* cameraPtr);
void DebugCamera_Enable(DebugCam* debugCam, Camera* cam);
void DebugCamera_Update(DebugCam* debugCam, Camera* cam);
void DebugCamera_Reset(Camera* cam, DebugCam* debugCam);
void func_800BB0A0(f32 u, Vec3f* pos, f32* roll, f32* viewAngle, f32* point0, f32* point1, f32* point2, f32* point3);
s32 func_800BB2B4(Vec3f* pos, f32* roll, f32* fov, CutsceneCameraPoint* point, s16* keyFrame, f32* curFrame);
void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl);

View file

@ -91,7 +91,7 @@
#define R_CAM_YOFFSET_NORM OREG(46)
#define R_CAM_DATA(type) PREG(0 + (type))
#define R_CAM_PARALLEL_LOCKON_CALC_SLOPE_Y_ADJ PREG(76)
#define R_DBG_CAM_UPDATE PREG(80)
#define R_DEBUG_CAM_UPDATE PREG(80)
#define R_DBG_REG_UPDATE PREG(82)
#define R_RELOAD_CAM_PARAMS QREG(0)
#define R_SCENE_CAM_TYPE YREG(15)

View file

@ -55,7 +55,7 @@ extern EffectSsOverlay gEffectSsOverlayTable[EFFECT_SS_TYPE_MAX];
extern Gfx D_80116280[];
extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX]; // original name: "actor_dlftbls" 801162A0
extern s32 gMaxActorId; // original name: "MaxProfile"
extern s32 gDbgCamEnabled;
extern s32 gDebugCamEnabled;
extern GameStateOverlay gGameStateOverlayTable[6];
extern u8 gWeatherMode;
extern u8 gLightConfigAfterUnderwater;

View file

@ -796,7 +796,7 @@ typedef enum {
/* 1 */ TRANS_TILE_SETUP, // Save the necessary buffers
/* 2 */ TRANS_TILE_PROCESS, // Initialize the transition
/* 3 */ TRANS_TILE_READY // The transition is ready, so will update and draw each frame
} TransitionTileStatus;
} TransitionTileState;
typedef struct PlayState {
/* 0x00000 */ GameState state;
@ -858,7 +858,7 @@ typedef struct PlayState {
/* 0x11E14 */ u8 skyboxId;
/* 0x11E15 */ s8 transitionTrigger; // "fade_direction"
/* 0x11E16 */ s16 unk_11E16;
/* 0x11E18 */ s16 unk_11E18;
/* 0x11E18 */ s16 bgCoverAlpha;
/* 0x11E1A */ s16 nextEntranceIndex;
/* 0x11E1C */ char unk_11E1C[0x40];
/* 0x11E5C */ s8 shootingGalleryStatus;

View file

@ -209,7 +209,7 @@ typedef struct Actor {
/* 0x05C */ Vec3f velocity; // Velocity of the actor in each axis
/* 0x068 */ f32 speed; // Context dependent speed value. Can be used for XZ or XYZ depending on which move function is used
/* 0x06C */ f32 gravity; // Acceleration due to gravity. Value is added to Y velocity every frame
/* 0x070 */ f32 minVelocityY; // Sets the lower bounds cap on velocity along the Y axis
/* 0x070 */ f32 minVelocityY; // Sets the lower bounds cap for velocity along the Y axis. Only relevant when moved with gravity.
/* 0x074 */ CollisionPoly* wallPoly; // Wall polygon the actor is touching
/* 0x078 */ CollisionPoly* floorPoly; // Floor polygon directly below the actor
/* 0x07C */ u8 wallBgId; // Bg ID of the wall polygon the actor is touching

View file

@ -50,26 +50,28 @@
#define CAM_HUD_VISIBILITY_MASK (0xF << CAM_HUD_VISIBILITY_SHIFT)
#define CAM_HUD_VISIBILITY(hudVisibility) (((hudVisibility) & 0xF) << CAM_HUD_VISIBILITY_SHIFT)
//! @note: since `interfaceField` can only have `0 - 0xF` values,
//! there is no cam value mapped to `HUD_VISIBILITY_NOTHING_INSTANT`.
//! @note: since 0 means `HUD_VISIBILITY_ALL`,
//! there is no cam value mapped to `HUD_VISIBILITY_NO_CHANGE`.
#define CAM_HUD_VISIBILITY_ALL CAM_HUD_VISIBILITY(0) // HUD_VISIBILITY_ALL
#define CAM_HUD_VISIBILITY_NOTHING CAM_HUD_VISIBILITY(HUD_VISIBILITY_NOTHING)
#define CAM_HUD_VISIBILITY_NOTHING_ALT CAM_HUD_VISIBILITY(HUD_VISIBILITY_NOTHING_ALT)
#define CAM_HUD_VISIBILITY_HEARTS_FORCE CAM_HUD_VISIBILITY(HUD_VISIBILITY_HEARTS_FORCE)
#define CAM_HUD_VISIBILITY_A CAM_HUD_VISIBILITY(HUD_VISIBILITY_A)
#define CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE CAM_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE)
#define CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_FORCE CAM_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_FORCE)
#define CAM_HUD_VISIBILITY_ALL_NO_MINIMAP_BY_BTN_STATUS CAM_HUD_VISIBILITY(HUD_VISIBILITY_ALL_NO_MINIMAP_BY_BTN_STATUS)
#define CAM_HUD_VISIBILITY_B CAM_HUD_VISIBILITY(HUD_VISIBILITY_B)
#define CAM_HUD_VISIBILITY_HEARTS_MAGIC CAM_HUD_VISIBILITY(HUD_VISIBILITY_HEARTS_MAGIC)
#define CAM_HUD_VISIBILITY_B_ALT CAM_HUD_VISIBILITY(HUD_VISIBILITY_B_ALT)
#define CAM_HUD_VISIBILITY_HEARTS CAM_HUD_VISIBILITY(HUD_VISIBILITY_HEARTS)
#define CAM_HUD_VISIBILITY_A_B_MINIMAP CAM_HUD_VISIBILITY(HUD_VISIBILITY_A_B_MINIMAP)
#define CAM_HUD_VISIBILITY_HEARTS_MAGIC_FORCE CAM_HUD_VISIBILITY(HUD_VISIBILITY_HEARTS_MAGIC_FORCE)
// These defines exist to clarify exactly which HUD visibility modes are supported by the camera system. While most of
// them map 1 to 1 with their HUD visibility counterparts, not all HUD visibility mode values will work as expected if
// used directly. Notably:
// - CAM_HUD_VISIBILITY_ALL (0) maps to HUD_VISIBILITY_ALL (50), not HUD_VISIBILITY_NO_CHANGE (0)
// - HUD_VISIBILITY_NOTHING_INSTANT (52) has no CAM_HUD_VISIBILITY_* mapping,
// because camera HUD visibility values are restricted to the 0-0xF range
#define CAM_HUD_VISIBILITY_ALL (0) // HUD_VISIBILITY_ALL
#define CAM_HUD_VISIBILITY_NOTHING (HUD_VISIBILITY_NOTHING)
#define CAM_HUD_VISIBILITY_NOTHING_ALT (HUD_VISIBILITY_NOTHING_ALT)
#define CAM_HUD_VISIBILITY_HEARTS_FORCE (HUD_VISIBILITY_HEARTS_FORCE)
#define CAM_HUD_VISIBILITY_A (HUD_VISIBILITY_A)
#define CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE (HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE)
#define CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_FORCE (HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_FORCE)
#define CAM_HUD_VISIBILITY_ALL_NO_MINIMAP_BY_BTN_STATUS (HUD_VISIBILITY_ALL_NO_MINIMAP_BY_BTN_STATUS)
#define CAM_HUD_VISIBILITY_B (HUD_VISIBILITY_B)
#define CAM_HUD_VISIBILITY_HEARTS_MAGIC (HUD_VISIBILITY_HEARTS_MAGIC)
#define CAM_HUD_VISIBILITY_B_ALT (HUD_VISIBILITY_B_ALT)
#define CAM_HUD_VISIBILITY_HEARTS (HUD_VISIBILITY_HEARTS)
#define CAM_HUD_VISIBILITY_A_B_MINIMAP (HUD_VISIBILITY_A_B_MINIMAP)
#define CAM_HUD_VISIBILITY_HEARTS_MAGIC_FORCE (HUD_VISIBILITY_HEARTS_MAGIC_FORCE)
// Unique to camera, does not change hud visibility mode (similar effect as HUD_VISIBILITY_NO_CHANGE)
#define CAM_HUD_VISIBILITY_IGNORE CAM_HUD_VISIBILITY(0xF)
#define CAM_HUD_VISIBILITY_IGNORE (0xF)
/**
* letterboxFlag: Determines the size of the letter-box window. See CAM_LETTERBOX_* defines.
@ -80,7 +82,7 @@
* funcFlags: Custom flags for functions
*/
#define CAM_INTERFACE_FIELD(letterboxFlag, hudVisibilityMode, funcFlags) \
(((letterboxFlag) & CAM_LETTERBOX_MASK) | (hudVisibilityMode) | ((funcFlags) & 0xFF))
(((letterboxFlag) & CAM_LETTERBOX_MASK) | CAM_HUD_VISIBILITY(hudVisibilityMode) | ((funcFlags) & 0xFF))
// Camera behaviorFlags. Flags specifically for settings, modes, and bgCam
// Used to store current state, only CAM_BEHAVIOR_SETTING_1 and CAM_BEHAVIOR_BG_2 are read from and used in logic
@ -1249,13 +1251,22 @@ typedef enum {
#define ONEPOINT_CS_GET_ACTION(onePointCsFull) ((onePointCsFull)->actionFlags & 0x1F)
/** initFlags
* & 0x00FF = atInitFlags
* & 0xFF00 = eyeInitFlags
#define ONEPOINT_CS_INIT_FIELD_NONE 0xFF
#define ONEPOINT_CS_INIT_FIELD_ACTORCAT(actorCat) (0x80 | ((actorCat) & 0x0F))
#define ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(camHudVisibility) (0xC0 | ((camHudVisibility) & 0x0F))
#define ONEPOINT_CS_INIT_FIELD_PLAYER_CS(csMode) ((csMode) & 0x7F)
#define ONEPOINT_CS_INIT_FIELD_IS_TYPE_ACTORCAT(field) ((field & 0xF0) == 0x80)
#define ONEPOINT_CS_INIT_FIELD_IS_TYPE_HUD_VISIBILITY(field) ((field & 0xF0) == 0xC0)
#define ONEPOINT_CS_INIT_FIELD_IS_TYPE_PLAYER_CS(field) !(field & 0x80)
/** viewFlags
* & 0x00FF = atFlags
* & 0xFF00 = eyeFlags
* 0x1: Direct Copy of atTargetInit
* if initFlags & 0x6060: use head for focus point
* if viewFlags & 0x6060: use head for focus point
* 0x2: Add atTargetInit to view's lookAt
* if initFlags & 0x6060: use world for focus point
* if viewFlags & 0x6060: use world for focus point
* 0x3: Add atTargetInit to camera's at
* 0x4: Don't update targets?
* 0x8: flag to use atTagetInit as f32 pitch, yaw, r
@ -1264,8 +1275,8 @@ typedef enum {
*/
typedef struct {
/* 0x00 */ u8 actionFlags;
/* 0x01 */ u8 unk_01;
/* 0x02 */ s16 initFlags;
/* 0x01 */ u8 initField;
/* 0x02 */ s16 viewFlags;
/* 0x04 */ s16 timerInit;
/* 0x06 */ s16 rollTargetInit;
/* 0x08 */ f32 fovTargetInit;
@ -1628,7 +1639,7 @@ typedef struct {
/* 0x1046 */ s16 demoCtrlActionIdx; // e (?), s (save), l (load), c (clear)
/* 0x1048 */ s16 demoCtrlToggleSwitch;
/* 0x104A */ Vec3s unk_104A;
} DbCameraSub; // size = 0x1050
} DebugCamSub; // size = 0x1050
typedef struct {
/* 0x00 */ s32 unk_00;
@ -1650,8 +1661,8 @@ typedef struct {
/* 0x6C */ Vec3f unk_6C;
/* 0x78 */ s16 unk_78;
/* 0x7A */ s16 unk_7A;
/* 0x7C */ DbCameraSub sub;
} DbCamera; // size = 0x10CC
/* 0x7C */ DebugCamSub sub;
} DebugCam; // size = 0x10CC
typedef struct {
/* 0x00 */ char letter;
@ -1661,7 +1672,7 @@ typedef struct {
/* 0x08 */ CutsceneCameraPoint* lookAt;
/* 0x0C */ s16 nFrames;
/* 0x0E */ s16 nPoints;
} DbCameraCut; // size = 0x10
} DebugCamCut; // size = 0x10
typedef struct {
/* 0x00 */ f32 curFrame;
@ -1673,17 +1684,17 @@ typedef struct {
/* 0x1C */ Vec3f lookAtPos;
/* 0x28 */ f32 roll;
/* 0x2C */ f32 fov;
} DbCameraAnim; // size = 0x30
} DebugCamAnim; // size = 0x30
typedef enum {
/* 0 */ DBCAMERA_TEXT_YELLOW,
/* 1 */ DBCAMERA_TEXT_PEACH,
/* 2 */ DBCAMERA_TEXT_BROWN,
/* 3 */ DBCAMERA_TEXT_ORANGE,
/* 4 */ DBCAMERA_TEXT_GOLD,
/* 5 */ DBCAMERA_TEXT_WHITE,
/* 6 */ DBCAMERA_TEXT_BLUE,
/* 7 */ DBCAMERA_TEXT_GREEN
} DbCameraTextColor;
/* 0 */ DEBUG_CAM_TEXT_YELLOW,
/* 1 */ DEBUG_CAM_TEXT_PEACH,
/* 2 */ DEBUG_CAM_TEXT_BROWN,
/* 3 */ DEBUG_CAM_TEXT_ORANGE,
/* 4 */ DEBUG_CAM_TEXT_GOLD,
/* 5 */ DEBUG_CAM_TEXT_WHITE,
/* 6 */ DEBUG_CAM_TEXT_BLUE,
/* 7 */ DEBUG_CAM_TEXT_GREEN
} DebugCamTextColor;
#endif

View file

@ -20,7 +20,7 @@ typedef enum {
typedef enum {
/* 0 */ EQUIP_INV_SWORD_KOKIRI,
/* 1 */ EQUIP_INV_SWORD_MASTER,
/* 2 */ EQUIP_INV_SWORD_BGS,
/* 2 */ EQUIP_INV_SWORD_BIGGORON,
/* 3 */ EQUIP_INV_SWORD_BROKENGIANTKNIFE
} EquipInvSword;
@ -48,7 +48,7 @@ typedef enum {
/* 0 */ EQUIP_VALUE_SWORD_NONE,
/* 1 */ EQUIP_VALUE_SWORD_KOKIRI,
/* 2 */ EQUIP_VALUE_SWORD_MASTER,
/* 3 */ EQUIP_VALUE_SWORD_BGS,
/* 3 */ EQUIP_VALUE_SWORD_BIGGORON,
/* 4 */ EQUIP_VALUE_SWORD_MAX
} EquipValueSword;

View file

@ -10,7 +10,7 @@ typedef enum {
/* 0 */ PLAYER_SWORD_NONE,
/* 1 */ PLAYER_SWORD_KOKIRI,
/* 2 */ PLAYER_SWORD_MASTER,
/* 3 */ PLAYER_SWORD_BGS,
/* 3 */ PLAYER_SWORD_BIGGORON,
/* 4 */ PLAYER_SWORD_MAX
} PlayerSword;
@ -75,7 +75,7 @@ typedef enum {
/* 0x02 */ PLAYER_IA_FISHING_POLE,
/* 0x03 */ PLAYER_IA_SWORD_MASTER,
/* 0x04 */ PLAYER_IA_SWORD_KOKIRI,
/* 0x05 */ PLAYER_IA_SWORD_BGS,
/* 0x05 */ PLAYER_IA_SWORD_BIGGORON,
/* 0x06 */ PLAYER_IA_DEKU_STICK,
/* 0x07 */ PLAYER_IA_HAMMER,
/* 0x08 */ PLAYER_IA_BOW,
@ -686,9 +686,9 @@ typedef struct Player {
/* 0x0834 */ s16 unk_834;
/* 0x0836 */ s8 unk_836;
/* 0x0837 */ u8 unk_837;
/* 0x0838 */ f32 linearVelocity;
/* 0x083C */ s16 currentYaw;
/* 0x083E */ s16 targetYaw;
/* 0x0838 */ f32 speedXZ; // Controls horizontal speed, used for `actor.speed`. Current or target value depending on context.
/* 0x083C */ s16 yaw; // General yaw value, used both for world and shape rotation. Current or target value depending on context.
/* 0x083E */ s16 zTargetYaw; // yaw relating to Z targeting/"parallel" mode
/* 0x0840 */ u16 underwaterTimer;
/* 0x0842 */ s8 meleeWeaponAnimation;
/* 0x0843 */ s8 meleeWeaponState;

4
spec
View file

@ -409,9 +409,11 @@ beginseg
include "build/src/code/irqmgr.o"
include "build/src/code/debug_malloc.o"
include "build/src/code/fault.o"
include "build/data/fault.bss.o"
include "build/src/code/fault_drawer.o"
#ifndef NON_MATCHING
include "build/data/fault.bss.o"
include "build/data/fault_drawer.bss.o"
#endif
include "build/src/code/kanread.o"
include "build/src/code/ucode_disas.o"
pad_text // audio library aligned to 32 bytes?

View file

@ -59,7 +59,7 @@ void DynaPolyActor_UpdateCarriedActorRotY(CollisionContext* colCtx, s32 bgId, Ac
s16 rotY = colCtx->dyna.bgActors[bgId].curTransform.rot.y - colCtx->dyna.bgActors[bgId].prevTransform.rot.y;
if (carriedActor->id == ACTOR_PLAYER) {
((Player*)carriedActor)->currentYaw += rotY;
((Player*)carriedActor)->yaw += rotY;
}
carriedActor->shape.rot.y += rotY;

View file

@ -61,7 +61,7 @@ s32 func_800BB2B4(Vec3f* pos, f32* roll, f32* fov, CutsceneCameraPoint* point, s
}
*curFrame += advance;
if (*curFrame >= 1) {
if (point[++*keyFrame + 3].continueFlag == -1) {
if (point[++*keyFrame + 3].continueFlag == CS_CMD_STOP) {
*keyFrame = 0;
ret = true;
}

File diff suppressed because it is too large Load diff

View file

@ -76,12 +76,21 @@ const char* sFpExceptionNames[] = {
"Unimplemented operation", "Invalid operation", "Division by zero", "Overflow", "Underflow", "Inexact operation",
};
// TODO: import .bss (has reordering issues)
#ifndef NON_MATCHING
// TODO: match .bss (has reordering issues)
extern FaultMgr* sFaultInstance;
extern u8 sFaultAwaitingInput;
extern STACK(sFaultStack, 0x600);
extern StackEntry sFaultThreadInfo;
extern FaultMgr gFaultMgr;
#else
// Non-matching version for struct shiftability
FaultMgr* sFaultInstance;
u8 sFaultAwaitingInput;
STACK(sFaultStack, 0x600);
StackEntry sFaultThreadInfo;
FaultMgr gFaultMgr;
#endif
typedef struct {
/* 0x00 */ s32 (*callback)(void*, void*);

View file

@ -99,7 +99,15 @@ FaultDrawer sFaultDrawerDefault = {
NULL,
};
#ifndef NON_MATCHING
// TODO: match .bss (has reordering issues)
extern FaultDrawer sFaultDrawer;
extern char D_8016B6BC[0x24];
#else
// Non-matching version for struct shiftability
FaultDrawer sFaultDrawer;
char D_8016B6BC[0x24];
#endif
void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) {
sFaultDrawer.osSyncPrintfEnabled = enabled;

View file

@ -841,7 +841,10 @@ void Actor_Destroy(Actor* actor, PlayState* play) {
}
}
void func_8002D7EC(Actor* actor) {
/**
* Update actor's position factoring in velocity and collider displacement
*/
void Actor_UpdatePos(Actor* actor) {
f32 speedRate = R_UPDATE_RATE * 0.5f;
actor->world.pos.x += (actor->velocity.x * speedRate) + actor->colChkInfo.displacement.x;
@ -849,22 +852,34 @@ void func_8002D7EC(Actor* actor) {
actor->world.pos.z += (actor->velocity.z * speedRate) + actor->colChkInfo.displacement.z;
}
void func_8002D868(Actor* actor) {
/**
* Update actor's velocity accounting for gravity (without dropping below minimum y velocity)
*/
void Actor_UpdateVelocityXZGravity(Actor* actor) {
actor->velocity.x = Math_SinS(actor->world.rot.y) * actor->speed;
actor->velocity.z = Math_CosS(actor->world.rot.y) * actor->speed;
actor->velocity.y += actor->gravity;
if (actor->velocity.y < actor->minVelocityY) {
actor->velocity.y = actor->minVelocityY;
}
}
void Actor_MoveForward(Actor* actor) {
func_8002D868(actor);
func_8002D7EC(actor);
/**
* Move actor while accounting for its current velocity and gravity.
* `actor.speed` is used as the XZ velocity.
* The actor will move in the direction of its world yaw.
*/
void Actor_MoveXZGravity(Actor* actor) {
Actor_UpdateVelocityXZGravity(actor);
Actor_UpdatePos(actor);
}
void func_8002D908(Actor* actor) {
/**
* Update actor's velocity without gravity.
*/
void Actor_UpdateVelocityXYZ(Actor* actor) {
f32 speedXZ = Math_CosS(actor->world.rot.x) * actor->speed;
actor->velocity.x = Math_SinS(actor->world.rot.y) * speedXZ;
@ -872,23 +887,33 @@ void func_8002D908(Actor* actor) {
actor->velocity.z = Math_CosS(actor->world.rot.y) * speedXZ;
}
void func_8002D97C(Actor* actor) {
func_8002D908(actor);
func_8002D7EC(actor);
/**
* Move actor while accounting for its current velocity.
* `actor.speed` is used as the XYZ velocity.
* The actor will move in the direction of its world yaw and pitch, with positive pitch moving upwards.
*/
void Actor_MoveXYZ(Actor* actor) {
Actor_UpdateVelocityXYZ(actor);
Actor_UpdatePos(actor);
}
void func_8002D9A4(Actor* actor, f32 arg1) {
actor->speed = Math_CosS(actor->world.rot.x) * arg1;
actor->velocity.y = -Math_SinS(actor->world.rot.x) * arg1;
/**
* From a given XYZ speed value, set the corresponding XZ speed as `actor.speed`, and Y speed as Y velocity.
* Only the actor's world pitch is factored in, with positive pitch moving downwards.
*/
void Actor_SetProjectileSpeed(Actor* actor, f32 speedXYZ) {
actor->speed = Math_CosS(actor->world.rot.x) * speedXYZ;
actor->velocity.y = -Math_SinS(actor->world.rot.x) * speedXYZ;
}
void func_8002D9F8(Actor* actor, SkelAnime* skelAnime) {
Vec3f sp1C;
void Actor_UpdatePosByAnimation(Actor* actor, SkelAnime* skelAnime) {
Vec3f posDiff;
SkelAnime_UpdateTranslation(skelAnime, &sp1C, actor->shape.rot.y);
actor->world.pos.x += sp1C.x * actor->scale.x;
actor->world.pos.y += sp1C.y * actor->scale.y;
actor->world.pos.z += sp1C.z * actor->scale.z;
SkelAnime_UpdateTranslation(skelAnime, &posDiff, actor->shape.rot.y);
actor->world.pos.x += posDiff.x * actor->scale.x;
actor->world.pos.y += posDiff.y * actor->scale.y;
actor->world.pos.z += posDiff.z * actor->scale.z;
}
s16 Actor_WorldYawTowardActor(Actor* actorA, Actor* actorB) {
@ -4037,7 +4062,7 @@ s16 func_80034DD4(Actor* actor, PlayState* play, s16 arg2, f32 arg3) {
Player* player = GET_PLAYER(play);
f32 var;
if ((play->csCtx.state != CS_STATE_IDLE) || gDbgCamEnabled) {
if ((play->csCtx.state != CS_STATE_IDLE) || gDebugCamEnabled) {
var = Math_Vec3f_DistXYZ(&actor->world.pos, &play->view.eye) * 0.25f;
} else {
var = Math_Vec3f_DistXYZ(&actor->world.pos, &player->actor.world.pos);
@ -4090,7 +4115,7 @@ s32 func_80035124(Actor* actor, PlayState* play) {
if (Actor_HasParent(actor, play)) {
actor->params = 1;
} else if (!(actor->bgCheckFlags & BGCHECKFLAG_GROUND)) {
Actor_MoveForward(actor);
Actor_MoveXZGravity(actor);
Math_SmoothStepToF(&actor->speed, 0.0f, 1.0f, 0.1f, 0.0f);
} else if ((actor->bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (actor->velocity.y < -4.0f)) {
ret = 1;
@ -5711,7 +5736,7 @@ s32 Actor_TrackPlayerSetFocusHeight(PlayState* play, Actor* actor, Vec3s* headRo
actor->focus.pos = actor->world.pos;
actor->focus.pos.y += focusHeight;
if (!(((play->csCtx.state != CS_STATE_IDLE) || gDbgCamEnabled) &&
if (!(((play->csCtx.state != CS_STATE_IDLE) || gDebugCamEnabled) &&
(gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_0))) {
yaw = ABS((s16)(actor->yawTowardsPlayer - actor->shape.rot.y));
if (yaw >= 0x4300) {
@ -5720,7 +5745,7 @@ s32 Actor_TrackPlayerSetFocusHeight(PlayState* play, Actor* actor, Vec3s* headRo
}
}
if (((play->csCtx.state != CS_STATE_IDLE) || gDbgCamEnabled) &&
if (((play->csCtx.state != CS_STATE_IDLE) || gDebugCamEnabled) &&
(gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_0)) {
target = play->view.eye;
} else {
@ -5755,7 +5780,7 @@ s32 Actor_TrackPlayer(PlayState* play, Actor* actor, Vec3s* headRot, Vec3s* tors
actor->focus.pos = focusPos;
if (!(((play->csCtx.state != CS_STATE_IDLE) || gDbgCamEnabled) &&
if (!(((play->csCtx.state != CS_STATE_IDLE) || gDebugCamEnabled) &&
(gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_0))) {
yaw = ABS((s16)(actor->yawTowardsPlayer - actor->shape.rot.y));
if (yaw >= 0x4300) {
@ -5764,7 +5789,7 @@ s32 Actor_TrackPlayer(PlayState* play, Actor* actor, Vec3s* headRot, Vec3s* tors
}
}
if (((play->csCtx.state != CS_STATE_IDLE) || gDbgCamEnabled) &&
if (((play->csCtx.state != CS_STATE_IDLE) || gDebugCamEnabled) &&
(gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_0)) {
target = play->view.eye;
} else {

View file

@ -487,12 +487,12 @@ Vec3s* Camera_GetBgCamFuncDataUnderPlayer(Camera* camera, u16* bgCamCount) {
CollisionPoly* floorPoly;
s32 pad;
s32 bgId;
PosRot playerPosShape;
PosRot playerPosRot;
Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor);
playerPosShape.pos.y += Player_GetHeight(camera->player);
Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor);
playerPosRot.pos.y += Player_GetHeight(camera->player);
if (BgCheck_EntityRaycastDown3(&camera->play->colCtx, &floorPoly, &bgId, &playerPosShape.pos) == BGCHECK_Y_MIN) {
if (BgCheck_EntityRaycastDown3(&camera->play->colCtx, &floorPoly, &bgId, &playerPosRot.pos) == BGCHECK_Y_MIN) {
// no floor
return NULL;
}
@ -508,14 +508,14 @@ Vec3s* Camera_GetBgCamFuncDataUnderPlayer(Camera* camera, u16* bgCamCount) {
* Returns the camera data index otherwise.
*/
s32 Camera_GetWaterBoxBgCamIndex(Camera* camera, f32* waterY) {
PosRot playerPosShape;
PosRot playerPosRot;
WaterBox* waterBox;
s32 bgCamIndex;
Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor);
*waterY = playerPosShape.pos.y;
Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor);
*waterY = playerPosRot.pos.y;
if (!WaterBox_GetSurface1(camera->play, &camera->play->colCtx, playerPosShape.pos.x, playerPosShape.pos.z, waterY,
if (!WaterBox_GetSurface1(camera->play, &camera->play->colCtx, playerPosRot.pos.x, playerPosRot.pos.z, waterY,
&waterBox)) {
// player's position is not in a water box.
*waterY = BGCHECK_Y_MIN;
@ -783,9 +783,9 @@ void Camera_UpdateInterface(s16 interfaceField) {
}
}
if ((interfaceField & CAM_HUD_VISIBILITY_MASK) != CAM_HUD_VISIBILITY_IGNORE) {
if ((interfaceField & CAM_HUD_VISIBILITY_MASK) != CAM_HUD_VISIBILITY(CAM_HUD_VISIBILITY_IGNORE)) {
hudVisibilityMode = (interfaceField & CAM_HUD_VISIBILITY_MASK) >> CAM_HUD_VISIBILITY_SHIFT;
if (hudVisibilityMode == (CAM_HUD_VISIBILITY_ALL >> CAM_HUD_VISIBILITY_SHIFT)) {
if (hudVisibilityMode == CAM_HUD_VISIBILITY_ALL) {
hudVisibilityMode = HUD_VISIBILITY_ALL;
}
if (sCameraHudVisibilityMode != hudVisibilityMode) {
@ -5204,8 +5204,8 @@ s32 Camera_Unique9(Camera* camera) {
VecGeo scratchGeo;
VecGeo playerTargetOffset;
s16 action;
s16 atInitFlags;
s16 eyeInitFlags;
s16 atFlags;
s16 eyeFlags;
s16 pad2;
PosRot targethead;
PosRot playerhead;
@ -5257,19 +5257,21 @@ s32 Camera_Unique9(Camera* camera) {
rwData->curKeyFrame = &ONEPOINT_CS_INFO(camera)->keyFrames[rwData->curKeyFrameIdx];
rwData->keyFrameTimer = rwData->curKeyFrame->timerInit;
if (rwData->curKeyFrame->unk_01 != 0xFF) {
if ((rwData->curKeyFrame->unk_01 & 0xF0) == 0x80) {
D_8011D3AC = rwData->curKeyFrame->unk_01 & 0xF;
} else if ((rwData->curKeyFrame->unk_01 & 0xF0) == 0xC0) {
if (rwData->curKeyFrame->initField != ONEPOINT_CS_INIT_FIELD_NONE) {
if (ONEPOINT_CS_INIT_FIELD_IS_TYPE_ACTORCAT(rwData->curKeyFrame->initField)) {
D_8011D3AC = rwData->curKeyFrame->initField & 0xF;
} else if (ONEPOINT_CS_INIT_FIELD_IS_TYPE_HUD_VISIBILITY(rwData->curKeyFrame->initField)) {
Camera_UpdateInterface(
CAM_INTERFACE_FIELD(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY(rwData->curKeyFrame->unk_01), 0));
} else if (camera->player->stateFlags1 & PLAYER_STATE1_27 &&
player->currentBoots != PLAYER_BOOTS_IRON) {
CAM_INTERFACE_FIELD(CAM_LETTERBOX_IGNORE, rwData->curKeyFrame->initField, 0));
} else { // initField is of type PlayerCsMode
if ((camera->player->stateFlags1 & PLAYER_STATE1_27) &&
(player->currentBoots != PLAYER_BOOTS_IRON)) {
func_8002DF38(camera->play, camera->target, PLAYER_CSMODE_8);
osSyncPrintf("camera: demo: player demo set WAIT\n");
} else {
osSyncPrintf("camera: demo: player demo set %d\n", rwData->curKeyFrame->unk_01);
func_8002DF38(camera->play, camera->target, rwData->curKeyFrame->unk_01);
osSyncPrintf("camera: demo: player demo set %d\n", rwData->curKeyFrame->initField);
func_8002DF38(camera->play, camera->target, rwData->curKeyFrame->initField);
}
}
}
} else {
@ -5283,29 +5285,29 @@ s32 Camera_Unique9(Camera* camera) {
rwData->isNewKeyFrame = false;
}
atInitFlags = rwData->curKeyFrame->initFlags & 0xFF;
if (atInitFlags == 1) {
atFlags = rwData->curKeyFrame->viewFlags & 0xFF;
if (atFlags == 1) {
rwData->atTarget = rwData->curKeyFrame->atTargetInit;
} else if (atInitFlags == 2) {
} else if (atFlags == 2) {
if (rwData->isNewKeyFrame) {
rwData->atTarget.x = camera->play->view.at.x + rwData->curKeyFrame->atTargetInit.x;
rwData->atTarget.y = camera->play->view.at.y + rwData->curKeyFrame->atTargetInit.y;
rwData->atTarget.z = camera->play->view.at.z + rwData->curKeyFrame->atTargetInit.z;
}
} else if (atInitFlags == 3) {
} else if (atFlags == 3) {
if (rwData->isNewKeyFrame) {
rwData->atTarget.x = camera->at.x + rwData->curKeyFrame->atTargetInit.x;
rwData->atTarget.y = camera->at.y + rwData->curKeyFrame->atTargetInit.y;
rwData->atTarget.z = camera->at.z + rwData->curKeyFrame->atTargetInit.z;
}
} else if (atInitFlags == 4 || atInitFlags == 0x84) {
} else if (atFlags == 4 || atFlags == 0x84) {
if (camera->target != NULL && camera->target->update != NULL) {
Actor_GetFocus(&targethead, camera->target);
Actor_GetFocus(&playerhead, &camera->player->actor);
playerhead.pos.x = playerPosRot.pos.x;
playerhead.pos.z = playerPosRot.pos.z;
OLib_Vec3fDiffToVecGeo(&playerTargetOffset, &targethead.pos, &playerhead.pos);
if (atInitFlags & (s16)0x8080) {
if (atFlags & (s16)0x8080) {
scratchGeo.pitch = CAM_DEG_TO_BINANG(rwData->curKeyFrame->atTargetInit.x);
scratchGeo.yaw = CAM_DEG_TO_BINANG(rwData->curKeyFrame->atTargetInit.y);
scratchGeo.r = rwData->curKeyFrame->atTargetInit.z;
@ -5323,9 +5325,9 @@ s32 Camera_Unique9(Camera* camera) {
camera->target = NULL;
rwData->atTarget = camera->at;
}
} else if (atInitFlags & 0x6060) {
if (!(atInitFlags & 4) || rwData->isNewKeyFrame) {
if (atInitFlags & 0x2020) {
} else if (atFlags & 0x6060) {
if (!(atFlags & 4) || rwData->isNewKeyFrame) {
if (atFlags & 0x2020) {
focusActor = &camera->player->actor;
} else if (camera->target != NULL && camera->target->update != NULL) {
focusActor = camera->target;
@ -5335,15 +5337,15 @@ s32 Camera_Unique9(Camera* camera) {
}
if (focusActor != NULL) {
if ((atInitFlags & 0xF) == 1) {
if ((atFlags & 0xF) == 1) {
Actor_GetFocus(&atFocusPosRot, focusActor);
} else if ((atInitFlags & 0xF) == 2) {
} else if ((atFlags & 0xF) == 2) {
Actor_GetWorld(&atFocusPosRot, focusActor);
} else {
Actor_GetWorldPosShapeRot(&atFocusPosRot, focusActor);
}
if (atInitFlags & (s16)0x8080) {
if (atFlags & (s16)0x8080) {
scratchGeo.pitch = CAM_DEG_TO_BINANG(rwData->curKeyFrame->atTargetInit.x);
scratchGeo.yaw = CAM_DEG_TO_BINANG(rwData->curKeyFrame->atTargetInit.y);
scratchGeo.r = rwData->curKeyFrame->atTargetInit.z;
@ -5365,36 +5367,35 @@ s32 Camera_Unique9(Camera* camera) {
rwData->atTarget = *at;
}
eyeInitFlags = rwData->curKeyFrame->initFlags & 0xFF00;
if (eyeInitFlags == 0x100) {
eyeFlags = rwData->curKeyFrame->viewFlags & 0xFF00;
if (eyeFlags == 0x100) {
rwData->eyeTarget = rwData->curKeyFrame->eyeTargetInit;
} else if (eyeInitFlags == 0x200) {
} else if (eyeFlags == 0x200) {
if (rwData->isNewKeyFrame) {
rwData->eyeTarget.x = camera->play->view.eye.x + rwData->curKeyFrame->eyeTargetInit.x;
rwData->eyeTarget.y = camera->play->view.eye.y + rwData->curKeyFrame->eyeTargetInit.y;
rwData->eyeTarget.z = camera->play->view.eye.z + rwData->curKeyFrame->eyeTargetInit.z;
}
} else if (eyeInitFlags == 0x300) {
} else if (eyeFlags == 0x300) {
if (rwData->isNewKeyFrame) {
rwData->eyeTarget.x = camera->eyeNext.x + rwData->curKeyFrame->eyeTargetInit.x;
rwData->eyeTarget.y = camera->eyeNext.y + rwData->curKeyFrame->eyeTargetInit.y;
rwData->eyeTarget.z = camera->eyeNext.z + rwData->curKeyFrame->eyeTargetInit.z;
}
} else if (eyeInitFlags == 0x400 || eyeInitFlags == (s16)0x8400 || eyeInitFlags == 0x500 ||
eyeInitFlags == (s16)0x8500) {
} else if (eyeFlags == 0x400 || eyeFlags == (s16)0x8400 || eyeFlags == 0x500 || eyeFlags == (s16)0x8500) {
if (camera->target != NULL && camera->target->update != NULL) {
Actor_GetFocus(&targethead, camera->target);
Actor_GetFocus(&playerhead, &camera->player->actor);
playerhead.pos.x = playerPosRot.pos.x;
playerhead.pos.z = playerPosRot.pos.z;
OLib_Vec3fDiffToVecGeo(&playerTargetOffset, &targethead.pos, &playerhead.pos);
if (eyeInitFlags == 0x400 || eyeInitFlags == (s16)0x8400) {
if (eyeFlags == 0x400 || eyeFlags == (s16)0x8400) {
eyeLookAtPos = targethead.pos;
} else {
eyeLookAtPos = rwData->atTarget;
}
if (eyeInitFlags & (s16)0x8080) {
if (eyeFlags & (s16)0x8080) {
scratchGeo.pitch = CAM_DEG_TO_BINANG(rwData->curKeyFrame->eyeTargetInit.x);
scratchGeo.yaw = CAM_DEG_TO_BINANG(rwData->curKeyFrame->eyeTargetInit.y);
scratchGeo.r = rwData->curKeyFrame->eyeTargetInit.z;
@ -5412,9 +5413,9 @@ s32 Camera_Unique9(Camera* camera) {
camera->target = NULL;
rwData->eyeTarget = *eyeNext;
}
} else if (eyeInitFlags & 0x6060) {
if (!(eyeInitFlags & 0x400) || rwData->isNewKeyFrame) {
if (eyeInitFlags & 0x2020) {
} else if (eyeFlags & 0x6060) {
if (!(eyeFlags & 0x400) || rwData->isNewKeyFrame) {
if (eyeFlags & 0x2020) {
focusActor = &camera->player->actor;
} else if (camera->target != NULL && camera->target->update != NULL) {
focusActor = camera->target;
@ -5424,10 +5425,10 @@ s32 Camera_Unique9(Camera* camera) {
}
if (focusActor != NULL) {
if ((eyeInitFlags & 0xF00) == 0x100) {
if ((eyeFlags & 0xF00) == 0x100) {
// head
Actor_GetFocus(&eyeFocusPosRot, focusActor);
} else if ((eyeInitFlags & 0xF00) == 0x200) {
} else if ((eyeFlags & 0xF00) == 0x200) {
// world
Actor_GetWorld(&eyeFocusPosRot, focusActor);
} else {
@ -5435,7 +5436,7 @@ s32 Camera_Unique9(Camera* camera) {
Actor_GetWorldPosShapeRot(&eyeFocusPosRot, focusActor);
}
if (eyeInitFlags & (s16)0x8080) {
if (eyeFlags & (s16)0x8080) {
scratchGeo.pitch = CAM_DEG_TO_BINANG(rwData->curKeyFrame->eyeTargetInit.x);
scratchGeo.yaw = CAM_DEG_TO_BINANG(rwData->curKeyFrame->eyeTargetInit.y);
scratchGeo.r = rwData->curKeyFrame->eyeTargetInit.z;
@ -5458,10 +5459,10 @@ s32 Camera_Unique9(Camera* camera) {
rwData->eyeTarget = *eyeNext;
}
if (rwData->curKeyFrame->initFlags == 2) {
if (rwData->curKeyFrame->viewFlags == 2) {
rwData->fovTarget = camera->play->view.fovy;
rwData->rollTarget = 0;
} else if (rwData->curKeyFrame->initFlags == 0) {
} else if (rwData->curKeyFrame->viewFlags == 0) {
rwData->fovTarget = camera->fov;
rwData->rollTarget = camera->roll;
} else {
@ -6805,8 +6806,8 @@ s32 Camera_Special6(Camera* camera) {
// Change "screens"
camera->player->actor.freezeTimer = 12;
// Overwrite hud visibility to CAM_HUD_VISIBILITY_HEARTS_FORCE
sCameraInterfaceField =
(sCameraInterfaceField & (u16)~CAM_HUD_VISIBILITY_MASK) | CAM_HUD_VISIBILITY_HEARTS_FORCE;
sCameraInterfaceField = (sCameraInterfaceField & (u16)~CAM_HUD_VISIBILITY_MASK) |
CAM_HUD_VISIBILITY(CAM_HUD_VISIBILITY_HEARTS_FORCE);
rwData->initalPlayerY = playerPosRot->pos.y;
rwData->animTimer = 12;
*eyeNext = bgCamPos;
@ -6842,7 +6843,8 @@ s32 Camera_Special6(Camera* camera) {
} else {
// Camera following player on the x axis.
// Overwrite hud visibility to CAM_HUD_VISIBILITY_ALL
sCameraInterfaceField = (sCameraInterfaceField & (u16)~CAM_HUD_VISIBILITY_MASK) | CAM_HUD_VISIBILITY_ALL;
sCameraInterfaceField =
(sCameraInterfaceField & (u16)~CAM_HUD_VISIBILITY_MASK) | CAM_HUD_VISIBILITY(CAM_HUD_VISIBILITY_ALL);
eyePosCalc = *eyeNext;
eyePosCalc.x += (playerPosRot->pos.x - eyePosCalc.x) * 0.5f;
eyePosCalc.y += (playerPosRot->pos.y - rwData->initalPlayerY) * 0.2f;
@ -7049,12 +7051,12 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState
R_CAM_DATA(i) = sCamDataRegsInit[i];
}
DbCamera_Reset(camera, &D_8015BD80);
DebugCamera_Reset(camera, &D_8015BD80);
sInitRegs = false;
PREG(88) = -1;
}
camera->play = D_8015BD7C = play;
DbCamera_Init(&D_8015BD80, camera);
DebugCamera_Init(&D_8015BD80, camera);
curUID = sNextUID;
sNextUID++;
while (curUID != 0) {
@ -7144,29 +7146,29 @@ void Camera_Stub80058140(Camera* camera) {
}
void Camera_InitDataUsingPlayer(Camera* camera, Player* player) {
PosRot playerPosShape;
PosRot playerPosRot;
VecGeo eyeNextAtOffset;
s32 bgId;
Vec3f floorPos;
Vec3f floorNorm;
s32 upXZ;
f32 playerToAtOffsetY;
Vec3f* eye = &camera->eye;
Vec3f* at = &camera->at;
Vec3f* eyeNext = &camera->eyeNext;
Actor_GetWorldPosShapeRot(&playerPosShape, &player->actor);
Actor_GetWorldPosShapeRot(&playerPosRot, &player->actor);
playerToAtOffsetY = Player_GetHeight(player);
camera->player = player;
camera->playerPosRot = playerPosShape;
camera->playerPosRot = playerPosRot;
camera->dist = eyeNextAtOffset.r = 180.0f;
camera->inputDir.y = playerPosShape.rot.y;
camera->inputDir.y = playerPosRot.rot.y;
eyeNextAtOffset.yaw = camera->inputDir.y - 0x7FFF;
camera->inputDir.x = eyeNextAtOffset.pitch = 0x71C;
camera->inputDir.z = 0;
camera->camDir = camera->inputDir;
camera->xzSpeed = 0.0f;
camera->playerPosDelta.y = 0.0f;
camera->at = playerPosShape.pos;
camera->at = playerPosRot.pos;
camera->at.y += playerToAtOffsetY;
camera->playerToAtOffset.x = 0;
@ -7182,7 +7184,7 @@ void Camera_InitDataUsingPlayer(Camera* camera, Player* player) {
camera->up.y = 1.0f;
camera->up.x = upXZ;
if (Camera_GetFloorYNorm(camera, &floorPos, at, &bgId) != BGCHECK_Y_MIN) {
if (Camera_GetFloorYNorm(camera, &floorNorm, at, &bgId) != BGCHECK_Y_MIN) {
camera->bgId = bgId;
}
@ -7245,7 +7247,7 @@ void Camera_PrintSettings(Camera* camera) {
char sp48[8];
s32 i;
if ((OREG(0) & 1) && (camera->play->activeCamId == camera->camId) && !gDbgCamEnabled) {
if ((OREG(0) & 1) && (camera->play->activeCamId == camera->camId) && !gDebugCamEnabled) {
for (i = 0; i < NUM_CAMS; i++) {
if (camera->play->cameraPtrs[i] == NULL) {
sp58[i] = '-';
@ -7278,15 +7280,15 @@ void Camera_PrintSettings(Camera* camera) {
sp48[i] = '\0';
sp48[camera->play->activeCamId] = 'a';
DbCamera_ScreenTextColored(3, 22, DBCAMERA_TEXT_WHITE, sp58);
DbCamera_ScreenTextColored(3, 22, DBCAMERA_TEXT_PEACH, sp48);
DbCamera_ScreenTextColored(3, 23, DBCAMERA_TEXT_WHITE, "S:");
DbCamera_ScreenTextColored(5, 23, DBCAMERA_TEXT_GOLD, sCameraSettingNames[camera->setting]);
DbCamera_ScreenTextColored(3, 24, DBCAMERA_TEXT_WHITE, "M:");
DbCamera_ScreenTextColored(5, 24, DBCAMERA_TEXT_GOLD, sCameraModeNames[camera->mode]);
DbCamera_ScreenTextColored(3, 25, DBCAMERA_TEXT_WHITE, "F:");
DbCamera_ScreenTextColored(
5, 25, DBCAMERA_TEXT_GOLD,
DebugCamera_ScreenTextColored(3, 22, DEBUG_CAM_TEXT_WHITE, sp58);
DebugCamera_ScreenTextColored(3, 22, DEBUG_CAM_TEXT_PEACH, sp48);
DebugCamera_ScreenTextColored(3, 23, DEBUG_CAM_TEXT_WHITE, "S:");
DebugCamera_ScreenTextColored(5, 23, DEBUG_CAM_TEXT_GOLD, sCameraSettingNames[camera->setting]);
DebugCamera_ScreenTextColored(3, 24, DEBUG_CAM_TEXT_WHITE, "M:");
DebugCamera_ScreenTextColored(5, 24, DEBUG_CAM_TEXT_GOLD, sCameraModeNames[camera->mode]);
DebugCamera_ScreenTextColored(3, 25, DEBUG_CAM_TEXT_WHITE, "F:");
DebugCamera_ScreenTextColored(
5, 25, DEBUG_CAM_TEXT_GOLD,
sCameraFunctionNames[sCameraSettings[camera->setting].cameraModes[camera->mode].funcIdx]);
i = 0;
@ -7311,8 +7313,8 @@ void Camera_PrintSettings(Camera* camera) {
sp50[i++] = ' ';
sp50[i++] = ' ';
sp50[i] = '\0';
DbCamera_ScreenTextColored(3, 26, DBCAMERA_TEXT_WHITE, "I:");
DbCamera_ScreenTextColored(5, 26, DBCAMERA_TEXT_GOLD, sp50);
DebugCamera_ScreenTextColored(3, 26, DEBUG_CAM_TEXT_WHITE, "I:");
DebugCamera_ScreenTextColored(5, 26, DEBUG_CAM_TEXT_GOLD, sp50);
}
}
@ -7451,7 +7453,7 @@ s32 Camera_UpdateHotRoom(Camera* camera) {
s32 Camera_DbgChangeMode(Camera* camera) {
s32 changeDir = 0;
if (!gDbgCamEnabled && camera->play->activeCamId == CAM_ID_MAIN) {
if (!gDebugCamEnabled && camera->play->activeCamId == CAM_ID_MAIN) {
if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CUP)) {
osSyncPrintf("attention sound URGENCY\n");
func_80078884(NA_SE_SY_ATTENTION_URGENCY);
@ -7581,12 +7583,12 @@ Vec3s Camera_Update(Camera* camera) {
player = camera->play->cameraPtrs[CAM_ID_MAIN]->player;
if (R_DBG_CAM_UPDATE) {
if (R_DEBUG_CAM_UPDATE) {
osSyncPrintf("camera: in %x\n", camera);
}
if (camera->status == CAM_STAT_CUT) {
if (R_DBG_CAM_UPDATE) {
if (R_DEBUG_CAM_UPDATE) {
osSyncPrintf("camera: cut out %x\n", camera);
}
return camera->inputDir;
@ -7661,7 +7663,7 @@ Vec3s Camera_Update(Camera* camera) {
Camera_DbgChangeMode(camera);
if (camera->status == CAM_STAT_WAIT) {
if (R_DBG_CAM_UPDATE) {
if (R_DEBUG_CAM_UPDATE) {
osSyncPrintf("camera: wait out %x\n", camera);
}
return camera->inputDir;
@ -7671,7 +7673,7 @@ Vec3s Camera_Update(Camera* camera) {
camera->stateFlags &= ~(CAM_STATE_10 | CAM_STATE_5);
camera->stateFlags |= CAM_STATE_4;
if (R_DBG_CAM_UPDATE) {
if (R_DEBUG_CAM_UPDATE) {
osSyncPrintf("camera: engine (%d %d %d) %04x \n", camera->setting, camera->mode,
sCameraSettings[camera->setting].cameraModes[camera->mode].funcIdx, camera->stateFlags);
}
@ -7702,11 +7704,11 @@ Vec3s Camera_Update(Camera* camera) {
}
}
if (R_DBG_CAM_UPDATE) {
if (R_DEBUG_CAM_UPDATE) {
osSyncPrintf("camera: shrink_and_bitem %x(%d)\n", sCameraInterfaceField, camera->play->transitionMode);
}
if (R_DBG_CAM_UPDATE) {
if (R_DEBUG_CAM_UPDATE) {
osSyncPrintf("camera: engine (%s(%d) %s(%d) %s(%d)) ok!\n", &sCameraSettingNames[camera->setting],
camera->setting, &sCameraModeNames[camera->mode], camera->mode,
&sCameraFunctionNames[sCameraSettings[camera->setting].cameraModes[camera->mode].funcIdx],
@ -7715,20 +7717,20 @@ Vec3s Camera_Update(Camera* camera) {
// enable/disable debug cam
if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_START)) {
gDbgCamEnabled ^= 1;
if (gDbgCamEnabled) {
DbgCamera_Enable(&D_8015BD80, camera);
gDebugCamEnabled ^= 1;
if (gDebugCamEnabled) {
DebugCamera_Enable(&D_8015BD80, camera);
} else if (camera->play->csCtx.state != CS_STATE_IDLE) {
Cutscene_StopManual(camera->play, &camera->play->csCtx);
}
}
// Debug cam update
if (gDbgCamEnabled) {
if (gDebugCamEnabled) {
camera->play->view.fovy = D_8015BD80.fov;
DbCamera_Update(&D_8015BD80, camera);
DebugCamera_Update(&D_8015BD80, camera);
View_LookAt(&camera->play->view, &D_8015BD80.eye, &D_8015BD80.at, &D_8015BD80.unk_1C);
if (R_DBG_CAM_UPDATE) {
if (R_DEBUG_CAM_UPDATE) {
osSyncPrintf("camera: debug out\n");
}
return D_8015BD80.sub.unk_104A;
@ -7804,7 +7806,7 @@ Vec3s Camera_Update(Camera* camera) {
camera->timer = 0;
}
if (R_DBG_CAM_UPDATE) {
if (R_DEBUG_CAM_UPDATE) {
osSyncPrintf("camera: out (%f %f %f) (%f %f %f)\n", camera->at.x, camera->at.y, camera->at.z, camera->eye.x,
camera->eye.y, camera->eye.z);
osSyncPrintf("camera: dir (%f %d(%f) %d(%f)) (%f)\n", eyeAtAngle.r, eyeAtAngle.pitch,
@ -8105,7 +8107,7 @@ s32 Camera_ChangeBgCamIndex(Camera* camera, s32 bgCamIndex) {
}
Vec3s* Camera_GetInputDir(Vec3s* dst, Camera* camera) {
if (gDbgCamEnabled) {
if (gDebugCamEnabled) {
*dst = D_8015BD80.sub.unk_104A;
return dst;
} else {
@ -8129,7 +8131,7 @@ s16 Camera_GetInputDirYaw(Camera* camera) {
}
Vec3s* Camera_GetCamDir(Vec3s* dst, Camera* camera) {
if (gDbgCamEnabled) {
if (gDebugCamEnabled) {
*dst = D_8015BD80.sub.unk_104A;
return dst;
} else {
@ -8331,8 +8333,8 @@ s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera) {
return true;
}
s32 Camera_GetDbgCamEnabled(void) {
return gDbgCamEnabled;
s32 Camera_IsDebugCamEnabled(void) {
return gDebugCamEnabled;
}
Vec3f* Camera_GetQuakeOffset(Vec3f* quakeOffset, Camera* camera) {

View file

@ -874,7 +874,7 @@ CameraModeValue sDataOnlyNullFlags[] = {
*=====================================================================
*/
CameraModeValue sSetPrerendFixedModeZTargetFriendlyData[] = {
CameraModeValue sSetPreRendFixedModeZTargetFriendlyData[] = {
CAM_FUNCDATA_INTERFACE_FIELD(CAM_INTERFACE_FIELD(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0)),
};
@ -884,15 +884,15 @@ CameraModeValue sSetPrerendFixedModeZTargetFriendlyData[] = {
*=====================================================================
*/
CameraModeValue sSetPrerendPivotModeNormalData[] = {
CameraModeValue sSetPreRendPivotModeNormalData[] = {
CAM_FUNCDATA_UNIQ7(60, CAM_INTERFACE_FIELD(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)),
};
CameraModeValue sSetPrerendPivotModeZTargetFriendlyData[] = {
CameraModeValue sSetPreRendPivotModeZTargetFriendlyData[] = {
CAM_FUNCDATA_UNIQ7(60, CAM_INTERFACE_FIELD(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0)),
};
CameraModeValue sSetPrerendPivotModeTalkData[] = {
CameraModeValue sSetPreRendPivotModeTalkData[] = {
CAM_FUNCDATA_KEEP0(30, 0, 4, CAM_INTERFACE_FIELD(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE, 0)),
};
@ -957,11 +957,11 @@ CameraModeValue sSetFree0ModeNormalData[] = {
/**
*=====================================================================
* Custom Data: FREE1 Setting
* Custom Data: FREE2 Setting
*=====================================================================
*/
CameraModeValue sSetFree1ModeNormalData[] = {
CameraModeValue sSetFree2ModeNormalData[] = {
CAM_FUNCDATA_INTERFACE_FIELD(CAM_INTERFACE_FIELD(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, UNIQUE6_FLAG_0)),
};
@ -1459,7 +1459,7 @@ CameraModeValue sSetDirectedYawModeTalkData[] = {
*=====================================================================
*/
CameraModeValue sNormal4ModeTalkData[] = {
CameraModeValue sSetNormal4ModeTalkData[] = {
CAM_FUNCDATA_KEEP3(-30, 70, 200, 40, 10, 0, 5, 70, 45, 50, 10,
CAM_INTERFACE_FIELD(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE,
KEEPON3_FLAG_7 | KEEPON3_FLAG_5)),
@ -1965,15 +1965,15 @@ CameraMode sCamSetPivotInFrontModes[] = {
CameraMode sCamSetPreRendFixedModes[] = {
CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXD3, sDataOnlyNullFlags), // CAM_MODE_NORMAL
{ CAM_FUNC_NONE, 0, NULL }, // CAM_MODE_Z_PARALLEL
CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXD3, sSetPrerendFixedModeZTargetFriendlyData), // CAM_MODE_Z_TARGET_FRIENDLY
CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXD3, sSetPrerendFixedModeZTargetFriendlyData), // CAM_MODE_TALK
CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXD3, sSetPreRendFixedModeZTargetFriendlyData), // CAM_MODE_Z_TARGET_FRIENDLY
CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXD3, sSetPreRendFixedModeZTargetFriendlyData), // CAM_MODE_TALK
};
CameraMode sCamSetPreRendPivotModes[] = {
CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ7, sSetPrerendPivotModeNormalData), // CAM_MODE_NORMAL
CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ7, sSetPreRendPivotModeNormalData), // CAM_MODE_NORMAL
{ CAM_FUNC_NONE, 0, NULL }, // CAM_MODE_Z_PARALLEL
CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ7, sSetPrerendPivotModeZTargetFriendlyData), // CAM_MODE_Z_TARGET_FRIENDLY
CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEP0, sSetPrerendPivotModeTalkData), // CAM_MODE_TALK
CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ7, sSetPreRendPivotModeZTargetFriendlyData), // CAM_MODE_Z_TARGET_FRIENDLY
CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEP0, sSetPreRendPivotModeTalkData), // CAM_MODE_TALK
};
CameraMode sCamSetPreRendSideScrollModes[] = {
@ -2005,15 +2005,15 @@ CameraMode sCamSetFree0Modes[] = {
CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ6, sSetFree0ModeNormalData), // CAM_MODE_NORMAL
};
CameraMode sCamSetFree1Modes[] = {
CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ6, sSetFree1ModeNormalData), // CAM_MODE_NORMAL
CameraMode sCamSetFree2Modes[] = {
CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ6, sSetFree2ModeNormalData), // CAM_MODE_NORMAL
};
CameraMode sCamSetPivotCornerModes[] = {
CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXD2, sSetPivotCornerModeNormalData), // CAM_MODE_NORMAL
};
CameraMode sCamSetPivotDivingModes[] = {
CameraMode sCamSetPivotWaterSurfaceModes[] = {
CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ2, sSetPivotWaterSurfaceModeNormalData), // CAM_MODE_NORMAL
CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ2, sSetPivotWaterSurfaceModeZParallelData), // CAM_MODE_Z_PARALLEL
};
@ -2319,7 +2319,7 @@ CameraMode sCamSetNormal4Modes[] = {
CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORM1, sSetNormal2and4ModeNormalData), // CAM_MODE_NORMAL
CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARA1, sSetNormal0ModeZParallelData), // CAM_MODE_Z_PARALLEL
CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEP1, sSetNormal0ModeZTargetFriendlyData), // CAM_MODE_Z_TARGET_FRIENDLY
CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEP3, sNormal4ModeTalkData), // CAM_MODE_TALK
CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEP3, sSetNormal4ModeTalkData), // CAM_MODE_TALK
CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATT1, sSetNormal1ModeZTargetUnfriendlyData), // CAM_MODE_Z_TARGET_UNFRIENDLY
CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeWallClimbData), // CAM_MODE_WALL_CLIMB
CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJ3, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRST_PERSON
@ -2374,9 +2374,9 @@ CameraSetting sCameraSettings[] = {
{ { 0xC5000001 }, sCamSetStart0Modes }, // CAM_SET_START0
{ { 0xC5000001 }, sCamSetStart1Modes }, // CAM_SET_START1
{ { 0x05000001 }, sCamSetFree0Modes }, // CAM_SET_FREE0
{ { 0x05000001 }, sCamSetFree1Modes }, // CAM_SET_FREE2
{ { 0x05000001 }, sCamSetFree2Modes }, // CAM_SET_FREE2
{ { 0x85000001 }, sCamSetPivotCornerModes }, // CAM_SET_PIVOT_CORNER
{ { 0x05000003 }, sCamSetPivotDivingModes }, // CAM_SET_PIVOT_WATER_SURFACE
{ { 0x05000003 }, sCamSetPivotWaterSurfaceModes }, // CAM_SET_PIVOT_WATER_SURFACE
{ { 0xCE000001 }, sCamSetCs0Modes }, // CAM_SET_CS_0
{ { 0x4E000001 }, sCamSetCsTwistedHallwayModes }, // CAM_SET_CS_TWISTED_HALLWAY
{ { 0x05000009 }, sCamSetForestBirdsEyeModes }, // CAM_SET_FOREST_BIRDS_EYE
@ -2555,7 +2555,7 @@ s32 (*sCameraFunctions[])(Camera*) = {
s32 sInitRegs = 1;
s32 gDbgCamEnabled = 0;
s32 gDebugCamEnabled = false;
s32 sDbgModeIdx = -1;
s16 sNextUID = 0;
@ -2676,12 +2676,12 @@ s32 sDemo5PrevSfxFrame = -200;
// target is player, far from eye
OnePointCsFull D_8011D6AC[] = {
{
// initflags & 0x00FF (at): 2, atTarget is view lookAt + atInit
// initFlags & 0xFF00 (eye): none
// viewFlags & 0x00FF (at): 2, atTarget is view lookAt + atInit
// viewFlags & 0xFF00 (eye): none
// action: 15, copy at, eye, roll, fov to camera
// result: eye remains in the same location, at is View's lookAt
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0002,
1,
0,
@ -2691,12 +2691,12 @@ OnePointCsFull D_8011D6AC[] = {
{ 0.0f, 0.0f, 0.0f },
},
{
// initFlags & 0x00FF (at): 3, atTarget is camera's current at + atInit
// initFlags & 0xFF00 (eye): 3, eyeTarget is the camera's current eye + eyeInit
// viewFlags & 0x00FF (at): 3, atTarget is camera's current at + atInit
// viewFlags & 0xFF00 (eye): 3, eyeTarget is the camera's current eye + eyeInit
// action: interpolate eye and at.
// result: eye and at's y interpolate to become +20 from their current location.
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0303,
19,
0,
@ -2706,11 +2706,11 @@ OnePointCsFull D_8011D6AC[] = {
{ 0.0f, 20.0f, 0.0f },
},
{
// initFlags & 0x00FF (at): 0 none
// initFlags & 0xFF00 (eye): 0 none
// viewFlags & 0x00FF (at): 0 none
// viewFlags & 0xFF00 (eye): 0 none
// action: 18, copy this camera to default camera.
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0000,
1,
0,
@ -2725,7 +2725,7 @@ OnePointCsFull D_8011D6AC[] = {
OnePointCsFull D_8011D724[] = {
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x2424,
1,
0,
@ -2736,7 +2736,7 @@ OnePointCsFull D_8011D724[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x2121,
19,
0,
@ -2747,7 +2747,7 @@ OnePointCsFull D_8011D724[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0000,
1,
0,
@ -2762,7 +2762,7 @@ OnePointCsFull D_8011D724[] = {
OnePointCsFull D_8011D79C[] = {
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0002,
1,
0,
@ -2773,7 +2773,7 @@ OnePointCsFull D_8011D79C[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, true, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0303,
19,
0,
@ -2784,7 +2784,7 @@ OnePointCsFull D_8011D79C[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, true, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0303,
9,
0,
@ -2795,7 +2795,7 @@ OnePointCsFull D_8011D79C[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0000,
1,
0,
@ -2810,7 +2810,7 @@ OnePointCsFull D_8011D79C[] = {
OnePointCsFull D_8011D83C[] = {
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x2141,
20,
0,
@ -2821,7 +2821,7 @@ OnePointCsFull D_8011D83C[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0000,
1,
0,
@ -2838,7 +2838,7 @@ OnePointCsFull D_8011D83C[] = {
OnePointCsFull D_8011D88C[] = {
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0303,
20,
0,
@ -2849,7 +2849,7 @@ OnePointCsFull D_8011D88C[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0000,
1,
0,
@ -2864,7 +2864,7 @@ OnePointCsFull D_8011D88C[] = {
OnePointCsFull D_8011D8DC[] = {
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0404,
20,
1,
@ -2875,7 +2875,7 @@ OnePointCsFull D_8011D8DC[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x2121,
5,
0,
@ -2886,7 +2886,7 @@ OnePointCsFull D_8011D8DC[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0000,
1,
0,
@ -2901,7 +2901,7 @@ OnePointCsFull D_8011D8DC[] = {
OnePointCsFull D_8011D954[] = {
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0xC1C1,
20,
0,
@ -2912,7 +2912,7 @@ OnePointCsFull D_8011D954[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x05B1,
5,
0,
@ -2923,7 +2923,7 @@ OnePointCsFull D_8011D954[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x2121,
5,
2,
@ -2934,7 +2934,7 @@ OnePointCsFull D_8011D954[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0000,
1,
0,
@ -2949,7 +2949,7 @@ OnePointCsFull D_8011D954[] = {
OnePointCsFull D_8011D9F4[] = {
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0504,
20,
2,
@ -2960,7 +2960,7 @@ OnePointCsFull D_8011D9F4[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, true),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x2121,
5,
2,
@ -2971,7 +2971,7 @@ OnePointCsFull D_8011D9F4[] = {
},
{
ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false),
0xFF,
ONEPOINT_CS_INIT_FIELD_NONE,
0x0000,
1,
0,
@ -3034,5 +3034,5 @@ s16 D_8011DAFC[] = {
};
PlayState* D_8015BD7C;
DbCamera D_8015BD80;
DebugCam D_8015BD80;
CollisionPoly* playerFloorPoly;

View file

@ -1,32 +1,32 @@
#include "global.h"
typedef struct {
u8 x;
u8 y;
u8 colorIndex;
char text[21];
} DbCameraTextBufferEntry; // size = 0x18
/* 0x0 */ u8 x;
/* 0x1 */ u8 y;
/* 0x2 */ u8 colorIndex;
/* 0x3 */ char text[21];
} DebugCamTextBufferEntry; // size = 0x18
typedef struct {
u16 hold;
u16 press;
/* 0x0 */ u16 hold;
/* 0x2 */ u16 press;
} InputCombo; // size = 0x4
RegEditor* gRegEditor;
DbCameraTextBufferEntry sDbCameraTextBuffer[22];
DebugCamTextBufferEntry sDebugCamTextBuffer[22];
s16 sDbCameraTextEntryCount = 0;
s16 sDebugCamTextEntryCount = 0;
Color_RGBA8 sDbCameraTextColors[] = {
{ 255, 255, 32, 192 }, // DBCAMERA_TEXT_YELLOW
{ 255, 150, 128, 192 }, // DBCAMERA_TEXT_PEACH
{ 128, 96, 0, 64 }, // DBCAMERA_TEXT_BROWN
{ 192, 128, 16, 128 }, // DBCAMERA_TEXT_ORANGE
{ 255, 192, 32, 128 }, // DBCAMERA_TEXT_GOLD
{ 230, 230, 220, 64 }, // DBCAMERA_TEXT_WHITE
{ 128, 150, 255, 128 }, // DBCAMERA_TEXT_BLUE
{ 128, 255, 32, 128 }, // DBCAMERA_TEXT_GREEN
Color_RGBA8 sDebugCamTextColors[] = {
{ 255, 255, 32, 192 }, // DEBUG_CAM_TEXT_YELLOW
{ 255, 150, 128, 192 }, // DEBUG_CAM_TEXT_PEACH
{ 128, 96, 0, 64 }, // DEBUG_CAM_TEXT_BROWN
{ 192, 128, 16, 128 }, // DEBUG_CAM_TEXT_ORANGE
{ 255, 192, 32, 128 }, // DEBUG_CAM_TEXT_GOLD
{ 230, 230, 220, 64 }, // DEBUG_CAM_TEXT_WHITE
{ 128, 150, 255, 128 }, // DEBUG_CAM_TEXT_BLUE
{ 128, 255, 32, 128 }, // DEBUG_CAM_TEXT_GREEN
};
InputCombo sRegGroupInputCombos[REG_GROUPS] = {
@ -108,16 +108,16 @@ void Regs_Init(void) {
}
}
// Function is stubbed. Name is assumed by similarities in signature to `DbCamera_ScreenTextColored` and usage.
void DbCamera_ScreenText(u8 x, u8 y, const char* text) {
// Function is stubbed. Name is assumed by similarities in signature to `DebugCamera_ScreenTextColored` and usage.
void DebugCamera_ScreenText(u8 x, u8 y, const char* text) {
}
void DbCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text) {
DbCameraTextBufferEntry* entry = &sDbCameraTextBuffer[sDbCameraTextEntryCount];
void DebugCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text) {
DebugCamTextBufferEntry* entry = &sDebugCamTextBuffer[sDebugCamTextEntryCount];
char* textDest;
s16 charCount;
if (sDbCameraTextEntryCount < ARRAY_COUNT(sDbCameraTextBuffer)) {
if (sDebugCamTextEntryCount < ARRAY_COUNT(sDebugCamTextBuffer)) {
entry->x = x;
entry->y = y;
entry->colorIndex = colorIndex;
@ -134,18 +134,18 @@ void DbCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text) {
*textDest = '\0';
sDbCameraTextEntryCount++;
sDebugCamTextEntryCount++;
}
}
void DbCamera_DrawScreenText(GfxPrint* printer) {
void DebugCamera_DrawScreenText(GfxPrint* printer) {
s32 i;
Color_RGBA8* color;
DbCameraTextBufferEntry* entry;
DebugCamTextBufferEntry* entry;
for (i = 0; i < sDbCameraTextEntryCount; i++) {
entry = &sDbCameraTextBuffer[i];
color = &sDbCameraTextColors[entry->colorIndex];
for (i = 0; i < sDebugCamTextEntryCount; i++) {
entry = &sDebugCamTextBuffer[i];
color = &sDebugCamTextColors[entry->colorIndex];
GfxPrint_SetColor(printer, color->r, color->g, color->b, color->a);
GfxPrint_SetPos(printer, entry->x, entry->y);
@ -288,14 +288,14 @@ void Debug_DrawText(GraphicsContext* gfxCtx) {
GfxPrint_Open(&printer, gfx);
if ((OREG(0) == 1) || (OREG(0) == 8)) {
DbCamera_DrawScreenText(&printer);
DebugCamera_DrawScreenText(&printer);
}
if (gRegEditor->regPage != 0) {
Regs_DrawEditor(&printer);
}
sDbCameraTextEntryCount = 0;
sDebugCamTextEntryCount = 0;
gfx = GfxPrint_Close(&printer);
gSPEndDisplayList(gfx++);

View file

@ -182,7 +182,7 @@ void Cutscene_UpdateScripted(PlayState* play, CutsceneContext* csCtx) {
}
if (CHECK_BTN_ALL(input->press.button, BTN_DUP) && (csCtx->state == CS_STATE_IDLE) && IS_CUTSCENE_LAYER &&
!gDbgCamEnabled) {
!gDebugCamEnabled) {
gUseCutsceneCam = true;
gSaveContext.cutsceneIndex = 0xFFFD;
gSaveContext.cutsceneTrigger = 1;

View file

@ -312,7 +312,7 @@ void EnAObj_Update(Actor* thisx, PlayState* play) {
EnAObj* this = (EnAObj*)thisx;
this->actionFunc(this, play);
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
if (this->dyna.actor.gravity != 0.0f) {
if (this->dyna.actor.params != A_OBJ_BOULDER_FRAGMENT) {

View file

@ -576,7 +576,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
} else {
sp3A = 1;
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
}
if (sp3A || D_80157D94[0]) {

View file

@ -1609,7 +1609,7 @@ void Message_OpenText(PlayState* play, u16 textId) {
// Increments text id based on piece of heart count, assumes the piece of heart text is all
// in order and that you don't have more than the intended amount of heart pieces.
textId += (gSaveContext.inventory.questItems & 0xF0000000 & 0xF0000000) >> QUEST_HEART_PIECE_COUNT;
} else if (msgCtx->textId == 0xC && CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BGS)) {
} else if (msgCtx->textId == 0xC && CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BIGGORON)) {
textId = 0xB; // Traded Giant's Knife for Biggoron Sword
} else if (msgCtx->textId == 0xB4 && GET_EVENTCHKINF(EVENTCHKINF_96)) {
textId = 0xB5; // Destroyed Gold Skulltula

View file

@ -664,7 +664,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0;
subCam->fov = 75.0f;
player->actor.shape.rot.y = player->actor.world.rot.y = player->currentYaw = spD0.yaw + 0x7FFF;
player->actor.shape.rot.y = player->actor.world.rot.y = player->yaw = spD0.yaw + 0x7FFF;
func_8002DF54(play, NULL, PLAYER_CSMODE_8);
break;
@ -708,7 +708,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break;
case 3390:
player->actor.shape.rot.y = player->actor.world.rot.y = player->currentYaw = -0x3FD9;
player->actor.shape.rot.y = player->actor.world.rot.y = player->yaw = -0x3FD9;
csInfo->keyFrames = D_80121DB4;
csInfo->keyFrameCount = ARRAY_COUNT(D_80121DB4);
@ -733,7 +733,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
D_80121F1C[0].eyeTargetInit = play->view.eye;
D_80121F1C[0].fovTargetInit = play->view.fovy;
Actor_GetFocus(&spA0, actor);
player->actor.shape.rot.y = player->actor.world.rot.y = player->currentYaw = spA0.rot.y;
player->actor.shape.rot.y = player->actor.world.rot.y = player->yaw = spA0.rot.y;
csInfo->keyFrames = D_80121F1C;
csInfo->keyFrameCount = ARRAY_COUNT(D_80121F1C);
@ -857,7 +857,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
csInfo->keyFrames = D_801225D4;
csInfo->keyFrameCount = ARRAY_COUNT(D_801225D4);
player->actor.shape.rot.y = player->actor.world.rot.y = player->currentYaw = 0x3FFC;
player->actor.shape.rot.y = player->actor.world.rot.y = player->yaw = 0x3FFC;
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
func_8002DF54(play, NULL, PLAYER_CSMODE_8);
break;

File diff suppressed because it is too large Load diff

View file

@ -1282,7 +1282,7 @@ void Interface_InitHorsebackArchery(PlayState* play) {
}
void func_800849EC(PlayState* play) {
gSaveContext.inventory.equipment |= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BGS);
gSaveContext.inventory.equipment |= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BIGGORON);
gSaveContext.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE);
if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) {
@ -1419,7 +1419,7 @@ u8 Item_Give(PlayState* play, u8 item) {
gSaveContext.swordHealth = 8;
if (ALL_EQUIP_VALUE(EQUIP_TYPE_SWORD) ==
((1 << EQUIP_INV_SWORD_KOKIRI) | (1 << EQUIP_INV_SWORD_MASTER) | (1 << EQUIP_INV_SWORD_BGS) |
((1 << EQUIP_INV_SWORD_KOKIRI) | (1 << EQUIP_INV_SWORD_MASTER) | (1 << EQUIP_INV_SWORD_BIGGORON) |
(1 << EQUIP_INV_SWORD_BROKENGIANTKNIFE))) {
gSaveContext.inventory.equipment ^=
OWNED_EQUIP_FLAG_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE);

View file

@ -370,7 +370,7 @@ void Play_Init(GameState* thisx) {
this->state.destroy = Play_Destroy;
this->transitionTrigger = TRANS_TRIGGER_END;
this->unk_11E16 = 0xFF;
this->unk_11E18 = 0;
this->bgCoverAlpha = 0;
this->haltAllActors = false;
if (gSaveContext.gameMode != GAMEMODE_TITLE_SCREEN) {
@ -988,7 +988,7 @@ void Play_Update(PlayState* this) {
skip:
PLAY_LOG(3801);
if (!isPaused || gDbgCamEnabled) {
if (!isPaused || gDebugCamEnabled) {
s32 pad3[5];
s32 i;
@ -1207,7 +1207,7 @@ void Play_Draw(PlayState* this) {
}
if ((R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ROOM_FLAGS != 0)) {
Environment_FillScreen(gfxCtx, 0, 0, 0, this->unk_11E18, FILL_SCREEN_OPA);
Environment_FillScreen(gfxCtx, 0, 0, 0, this->bgCoverAlpha, FILL_SCREEN_OPA);
}
if ((R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_ACTORS) {

View file

@ -26,7 +26,7 @@ u8 sActionModelGroups[PLAYER_IA_MAX] = {
PLAYER_MODELGROUP_10, // PLAYER_IA_FISHING_POLE
PLAYER_MODELGROUP_SWORD, // PLAYER_IA_SWORD_MASTER
PLAYER_MODELGROUP_SWORD, // PLAYER_IA_SWORD_KOKIRI
PLAYER_MODELGROUP_BGS, // PLAYER_IA_SWORD_BGS
PLAYER_MODELGROUP_BGS, // PLAYER_IA_SWORD_BIGGORON
PLAYER_MODELGROUP_10, // PLAYER_IA_DEKU_STICK
PLAYER_MODELGROUP_HAMMER, // PLAYER_IA_HAMMER
PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW
@ -723,7 +723,7 @@ s32 Player_GetMeleeWeaponHeld(Player* this) {
}
s32 Player_HoldsTwoHandedWeapon(Player* this) {
if ((this->heldItemAction >= PLAYER_IA_SWORD_BGS) && (this->heldItemAction <= PLAYER_IA_HAMMER)) {
if ((this->heldItemAction >= PLAYER_IA_SWORD_BIGGORON) && (this->heldItemAction <= PLAYER_IA_HAMMER)) {
return 1;
} else {
return 0;
@ -731,7 +731,7 @@ s32 Player_HoldsTwoHandedWeapon(Player* this) {
}
s32 Player_HoldsBrokenKnife(Player* this) {
return (this->heldItemAction == PLAYER_IA_SWORD_BGS) && (gSaveContext.swordHealth <= 0.0f);
return (this->heldItemAction == PLAYER_IA_SWORD_BIGGORON) && (gSaveContext.swordHealth <= 0.0f);
}
s32 Player_ActionToBottle(Player* this, s32 itemAction) {
@ -1666,7 +1666,7 @@ u32 Player_InitDrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime) {
u8 sPauseModelGroupBySword[] = {
PLAYER_MODELGROUP_SWORD, // PLAYER_SWORD_KOKIRI
PLAYER_MODELGROUP_SWORD, // PLAYER_SWORD_MASTER
PLAYER_MODELGROUP_BGS, // PLAYER_SWORD_BGS
PLAYER_MODELGROUP_BGS, // PLAYER_SWORD_BIGGORON
};
s32 Player_OverrideLimbDrawPause(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* arg) {
@ -1836,7 +1836,7 @@ void Player_DrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f*
srcTable = gLinkPauseChildJointTable;
}
} else {
if (sword == PLAYER_SWORD_BGS) {
if (sword == PLAYER_SWORD_BIGGORON) {
srcTable = gLinkPauseAdultBgsJointTable;
} else if (shield != PLAYER_SHIELD_NONE) {
srcTable = gLinkPauseAdultShieldJointTable;

View file

@ -607,10 +607,10 @@ s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) {
&roomCtx->loadQueue, NULL, "../z_room.c", 1036);
roomCtx->unk_30 ^= 1;
return 1;
return true;
}
return 0;
return false;
}
s32 func_800973FC(PlayState* play, RoomContext* roomCtx) {

View file

@ -315,7 +315,7 @@ static Inventory sDebugSaveInventory = {
// equipment
((((1 << EQUIP_INV_SWORD_KOKIRI) << (EQUIP_TYPE_SWORD * 4)) |
((1 << EQUIP_INV_SWORD_MASTER) << (EQUIP_TYPE_SWORD * 4)) |
((1 << EQUIP_INV_SWORD_BGS) << (EQUIP_TYPE_SWORD * 4))) |
((1 << EQUIP_INV_SWORD_BIGGORON) << (EQUIP_TYPE_SWORD * 4))) |
(((1 << EQUIP_INV_SHIELD_DEKU) << (EQUIP_TYPE_SHIELD * 4)) |
((1 << EQUIP_INV_SHIELD_HYLIAN) << (EQUIP_TYPE_SHIELD * 4)) |
((1 << EQUIP_INV_SHIELD_MIRROR) << (EQUIP_TYPE_SHIELD * 4))) |

View file

@ -41,7 +41,7 @@ void osSpTaskLoad(OSTask* intp) {
while (__osSpSetPc((void*)SP_IMEM_START) == -1) {
;
}
while (__osSpRawStartDma(OS_WRITE, (void*)(SP_IMEM_START - sizeof(*tp)), tp, sizeof(OSTask)) == -1) {
while (__osSpRawStartDma(OS_WRITE, (void*)(SP_DMEM_END + 1 - sizeof(OSTask)), tp, sizeof(OSTask)) == -1) {
;
}
while (__osSpDeviceBusy()) {

View file

@ -87,7 +87,7 @@ void ArmsHook_Wait(ArmsHook* this, PlayState* play) {
s32 length = (player->heldItemAction == PLAYER_IA_HOOKSHOT) ? 13 : 26;
ArmsHook_SetupAction(this, ArmsHook_Shoot);
func_8002D9A4(&this->actor, 20.0f);
Actor_SetProjectileSpeed(&this->actor, 20.0f);
this->actor.parent = &GET_PLAYER(play)->actor;
this->timer = length;
}
@ -250,7 +250,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
}
}
} else {
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &prevFrameDiff);
Math_Vec3f_Sum(&this->unk_1E8, &prevFrameDiff, &this->unk_1E8);
this->actor.shape.rot.x = Math_Atan2S(this->actor.speed, -this->actor.velocity.y);

View file

@ -855,7 +855,7 @@ void BgDyYoseizo_Update(Actor* thisx, PlayState* play2) {
}
}
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
this->heightOffset = this->scale * 7500.0f;
Actor_SetFocus(&this->actor, this->heightOffset);
this->actor.focus.pos.y = this->heightOffset;

View file

@ -190,7 +190,7 @@ void BgHakaShip_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
if (this->dyna.actor.params == 0) {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
}
}

View file

@ -395,7 +395,7 @@ void BgHakaZou_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
if (this->dyna.actor.params == 3) {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
}
}

View file

@ -172,7 +172,7 @@ void BgHeavyBlock_MovePiece(BgHeavyBlock* this, PlayState* play) {
thisx->velocity.x *= 0.98f;
thisx->velocity.z *= 0.98f;
func_8002D7EC(thisx);
Actor_UpdatePos(thisx);
thisx->shape.rot.x += thisx->world.rot.x;
thisx->shape.rot.y += thisx->world.rot.y;
thisx->shape.rot.z += thisx->world.rot.z;
@ -382,7 +382,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) {
Vec3f checkPos;
f32 yIntersect;
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
checkPos.x = this->dyna.actor.home.pos.x;
checkPos.y = this->dyna.actor.home.pos.y + 1000.0f;
checkPos.z = this->dyna.actor.home.pos.z;
@ -455,7 +455,7 @@ void BgHeavyBlock_Land(BgHeavyBlock* this, PlayState* play) {
Math_StepToF(&this->dyna.actor.velocity.y, 0.0f, 3.0f);
this->dyna.actor.gravity = 0.0f;
this->dyna.actor.world.pos = this->dyna.actor.home.pos;
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
this->dyna.actor.home.pos = this->dyna.actor.world.pos;
switch (this->dyna.actor.params & 0xFF) {
case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE:

View file

@ -181,7 +181,7 @@ void BgHidanDalm_Update(Actor* thisx, PlayState* play) {
BgHidanDalm* this = (BgHidanDalm*)thisx;
this->actionFunc(this, play);
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 10.0f, 15.0f, 32.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
}

View file

@ -294,7 +294,7 @@ void func_80888860(BgHidanHamstep* this, PlayState* play) {
s32 pad2;
s32 quakeIndex;
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) < (-20.0f - this->dyna.actor.minVelocityY)) &&
(this->dyna.actor.velocity.y <= 0.0f)) {
@ -344,7 +344,7 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) {
s32 pad2;
s32 quakeIndex;
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
func_80888694(this, (BgHidanHamstep*)this->dyna.actor.parent);
if (((this->dyna.actor.params & 0xFF) <= 0) || ((this->dyna.actor.params & 0xFF) >= 6)) {

View file

@ -124,12 +124,12 @@ void func_80889C18(BgHidanKousi* this, PlayState* play) {
this->dyna.actor.speed = 2.0f;
BgHidanKousi_SetupAction(this, func_80889C90);
}
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG);
}
void func_80889C90(BgHidanKousi* this, PlayState* play) {
func_8002D7EC(&this->dyna.actor);
Actor_UpdatePos(&this->dyna.actor);
if (D_80889E40[this->dyna.actor.params & 0xFF] <
Math_Vec3f_DistXYZ(&this->dyna.actor.home.pos, &this->dyna.actor.world.pos)) {
func_80889ACC(this);

View file

@ -332,7 +332,7 @@ void BgHidanRock_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
if (this->actionFunc == func_8088B79C) {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);
}

View file

@ -173,7 +173,7 @@ void BgIceTurara_Fall(BgIceTurara* this, PlayState* play) {
return;
}
} else {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
this->dyna.actor.world.pos.y += 40.0f;
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);
this->dyna.actor.world.pos.y -= 40.0f;

View file

@ -148,7 +148,7 @@ void BgJyaHaheniron_SetupChairCrumble(BgJyaHaheniron* this) {
void BgJyaHaheniron_ChairCrumble(BgJyaHaheniron* this, PlayState* play) {
Vec3f vec;
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 8.0f, 0.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_7);
if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) ||
@ -174,7 +174,7 @@ void BgJyaHaheniron_SetupPillarCrumble(BgJyaHaheniron* this) {
void BgJyaHaheniron_PillarCrumble(BgJyaHaheniron* this, PlayState* play) {
if (this->timer >= 8) {
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
} else if (this->timer >= 17) {
BgJyaHaheniron_SpawnFragments(play, &this->actor.world.pos, D_808987A0);
Actor_Kill(&this->actor);

View file

@ -329,7 +329,7 @@ void func_8089E650(BgMizuMovebg* this, PlayState* play) {
this->dyna.actor.speed = dist;
}
func_80035844(&this->dyna.actor.world.pos, &waypoint, &this->dyna.actor.world.rot, 1);
func_8002D97C(&this->dyna.actor);
Actor_MoveXYZ(&this->dyna.actor);
dx = waypoint.x - this->dyna.actor.world.pos.x;
dy = waypoint.y - this->dyna.actor.world.pos.y;
dz = waypoint.z - this->dyna.actor.world.pos.z;

View file

@ -158,7 +158,7 @@ void BgMoriBigst_SetupFall(BgMoriBigst* this, PlayState* play) {
}
void BgMoriBigst_Fall(BgMoriBigst* this, PlayState* play) {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) {
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
BgMoriBigst_SetupLanding(this, play);

View file

@ -243,7 +243,7 @@ void BgMoriHashigo_LadderFall(BgMoriHashigo* this, PlayState* play) {
static f32 bounceSpeed[3] = { 4.0f, 2.7f, 1.7f };
Actor* thisx = &this->dyna.actor;
Actor_MoveForward(thisx);
Actor_MoveXZGravity(thisx);
if ((thisx->bgCheckFlags & BGCHECKFLAG_GROUND) && (thisx->velocity.y < 0.0f)) {
if (this->bounceCounter >= ARRAY_COUNT(bounceSpeed)) {
BgMoriHashigo_SetupLadderRest(this);

View file

@ -149,7 +149,7 @@ void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, PlayState* play) {
Actor* thisx = &this->dyna.actor;
s32 quakeIndex;
Actor_MoveForward(thisx);
Actor_MoveXZGravity(thisx);
if ((thisx->velocity.y < 0.0f) && (thisx->world.pos.y <= 403.0f)) {
if (this->bounceCount >= ARRAY_COUNT(bounceVel)) {
BgMoriRakkatenjo_SetupRest(this);

View file

@ -62,7 +62,7 @@ void BgPushbox_UpdateImpl(BgPushbox* this, PlayState* play) {
this->dyna.actor.speed = CLAMP(this->dyna.actor.speed, -1.0f, 1.0f);
Math_StepToF(&this->dyna.actor.speed, 0.0f, 0.2f);
this->dyna.actor.world.rot.y = this->dyna.unk_158;
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 40.0f, 40.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
UPDBGCHECKINFO_FLAG_4);

View file

@ -319,7 +319,7 @@ void func_808B43D0(BgSpot15Rrbox* this, PlayState* play) {
player->stateFlags2 &= ~PLAYER_STATE2_4;
}
Actor_MoveForward(actor);
Actor_MoveXZGravity(actor);
if (actor->world.pos.y <= BGCHECK_Y_MIN + 10.0f) {
// "Lon Lon wooden crate fell too much"

View file

@ -500,7 +500,7 @@ void func_808B5B58(BgSpot16Bombstone* this) {
void func_808B5B6C(BgSpot16Bombstone* this, PlayState* play) {
Actor* actor = &this->actor;
Actor_MoveForward(actor);
Actor_MoveXZGravity(actor);
actor->shape.rot.x += this->unk_210;
actor->shape.rot.z += this->unk_212;

View file

@ -247,7 +247,7 @@ void func_808B8F08(BgSpot18Obj* this, PlayState* play) {
Player* player = GET_PLAYER(play);
Math_StepToF(&this->dyna.actor.speed, 1.2f, 0.1f);
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
func_808B8DDC(this, play);
if (Math3D_Dist2DSq(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z, this->dyna.actor.home.pos.x,

View file

@ -868,7 +868,7 @@ void BossDodongo_Update(Actor* thisx, PlayState* play2) {
thisx->shape.rot.y = thisx->world.rot.y;
Math_SmoothStepToF(&thisx->shape.yOffset, this->unk_228, 1.0f, 100.0f, 0.0f);
Actor_MoveForward(thisx);
Actor_MoveXZGravity(thisx);
BossDodongo_UpdateDamage(this, play);
Actor_UpdateBgCheckInfo(play, thisx, 10.0f, 10.0f, 20.0f, UPDBGCHECKINFO_FLAG_2);
Math_SmoothStepToF(&this->unk_208, 0, 1, 0.001f, 0.0);

View file

@ -939,9 +939,9 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
Math_ApproachF(&this->fwork[BFD_TURN_RATE], this->fwork[BFD_TURN_RATE_MAX], 1.0f, 20000.0f);
Math_ApproachF(&this->actor.speed, this->fwork[BFD_FLY_SPEED], 1.0f, 0.1f);
if (this->work[BFD_ACTION_STATE] < BOSSFD_SKULL_FALL) {
func_8002D908(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
}
func_8002D7EC(&this->actor);
Actor_UpdatePos(&this->actor);
this->work[BFD_LEAD_BODY_SEG]++;
if (this->work[BFD_LEAD_BODY_SEG] >= 100) {

View file

@ -3921,8 +3921,8 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) {
yDistFromLink = (player->actor.world.pos.y + 40.0f) - this->actor.world.pos.y;
zDistFromLink = player->actor.world.pos.z - this->actor.world.pos.z;
func_8002D908(&this->actor);
func_8002D7EC(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
Actor_UpdatePos(&this->actor);
switch (this->unk_1C2) {
case 0:
@ -4195,8 +4195,8 @@ void func_808E1EB4(Actor* thisx, PlayState* play2) {
}
}
func_8002D908(&this->actor);
func_8002D7EC(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
Actor_UpdatePos(&this->actor);
this->unk_1A6++;
@ -4322,8 +4322,8 @@ void func_808E2544(Actor* thisx, PlayState* play) {
}
}
func_8002D908(&this->actor);
func_8002D7EC(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
Actor_UpdatePos(&this->actor);
this->unk_1A6++;
@ -4412,8 +4412,8 @@ void func_808E2544(Actor* thisx, PlayState* play) {
(this->actor.xzDistToPlayer < 80.0f)) {
this->unk_1C2 = 0xC;
this->actor.speed = -30.0f;
func_8002D908(&this->actor);
func_8002D7EC(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
Actor_UpdatePos(&this->actor);
this->unk_1F0 = dorf->unk_1FC;
numEffects = 10;
break;
@ -4429,8 +4429,8 @@ void func_808E2544(Actor* thisx, PlayState* play) {
this->unk_1C2 = 0xC;
this->actor.speed = -30.0f;
func_8002D908(&this->actor);
func_8002D7EC(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
Actor_UpdatePos(&this->actor);
this->unk_1F0.x = Rand_CenteredFloat(700.0f) + dorf->unk_1FC.x;
this->unk_1F0.y = Rand_CenteredFloat(200.0f) + dorf->unk_1FC.y;

View file

@ -1997,7 +1997,7 @@ void BossGanon2_Update(Actor* thisx, PlayState* play) {
if (this->unk_392 != 0) {
this->unk_392--;
}
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
this->actor.shape.rot = this->actor.world.rot;
if (this->unk_335 != 0) {
Actor_UpdateBgCheckInfo(play, &this->actor, 60.0f, 60.0f, 100.0f,

View file

@ -761,7 +761,7 @@ void BossGanondrof_Stunned(BossGanondrof* this, PlayState* play) {
this->actor.gravity = 0.0f;
}
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
}
void BossGanondrof_SetupBlock(BossGanondrof* this, PlayState* play) {
@ -847,8 +847,8 @@ void BossGanondrof_Charge(BossGanondrof* this, PlayState* play) {
thisx->world.rot.x = RAD_TO_BINANG(Math_FAtan2F(vecToLink.y, sqrtf(SQ(vecToLink.x) + SQ(vecToLink.z))));
}
func_8002D908(thisx);
func_8002D7EC(thisx);
Actor_UpdateVelocityXYZ(thisx);
Actor_UpdatePos(thisx);
Math_ApproachF(&thisx->speed, 10.0f, 1.0f, 0.5f);
if ((sqrtf(SQ(dxCenter) + SQ(dzCenter)) > 280.0f) || (thisx->xyzDistToPlayerSq < SQ(100.0f))) {
this->work[GND_ACTION_STATE] = CHARGE_FINISH;
@ -857,7 +857,7 @@ void BossGanondrof_Charge(BossGanondrof* this, PlayState* play) {
break;
case CHARGE_FINISH:
thisx->gravity = 0.2f;
Actor_MoveForward(thisx);
Actor_MoveXZGravity(thisx);
osSyncPrintf("YP %f @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n", thisx->world.pos.y);
if (thisx->world.pos.y < 5.0f) {
thisx->world.pos.y = 5.0f;

View file

@ -1921,7 +1921,7 @@ void BossGoma_Update(Actor* thisx, PlayState* play) {
this->actor.shape.rot.y = this->actor.world.rot.y;
if (!this->doNotMoveThisFrame) {
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
} else {
this->doNotMoveThisFrame = false;
}

View file

@ -1473,7 +1473,7 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) {
this->subCamAtVel.z * this->subCamVelFactor);
Math_ApproachF(&this->subCamVelFactor, 1.0f, 1.0f, this->subCamAccel);
} else if (this->csState < MO_INTRO_REVEAL) {
func_8002D908(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
this->subCamEye.x += this->actor.velocity.x;
this->subCamEye.y += this->actor.velocity.y;
this->subCamEye.z += this->actor.velocity.z;
@ -2139,12 +2139,12 @@ void BossMo_Core(BossMo* this, PlayState* play) {
spD0 = RAD_TO_BINANG(Math_FAtan2F(spD8, sqrtf(SQ(spDC) + SQ(spD4))));
Math_ApproachS(&this->actor.world.rot.y, spCC, this->tentMaxAngle, this->tentSpeed);
Math_ApproachS(&this->actor.world.rot.x, spD0, this->tentMaxAngle, this->tentSpeed);
func_8002D908(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
} else {
this->actor.world.pos.y += this->actor.velocity.y;
this->actor.velocity.y -= 1.0f;
}
func_8002D7EC(&this->actor);
Actor_UpdatePos(&this->actor);
temp = (this->actor.world.pos.y < -200.0f) ? UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2
: UPDBGCHECKINFO_FLAG_0;
this->actor.world.pos.y -= 20.0f;
@ -2321,7 +2321,7 @@ void BossMo_UpdateTent(Actor* thisx, PlayState* play) {
}
}
Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xA, 0xC8);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Math_ApproachF(&this->actor.speed, 0.0, 1.0f, 0.02f);
if (BossMo_NearLand(&this->actor.world.pos, 40)) {

View file

@ -363,10 +363,10 @@ void BossSst_HeadSetupIntro(BossSst* this, PlayState* play) {
player->actor.world.pos.x = sRoomCenter.x;
player->actor.world.pos.y = ROOM_CENTER_Y + 1000.0f;
player->actor.world.pos.z = sRoomCenter.z;
player->linearVelocity = player->actor.velocity.y = 0.0f;
player->speedXZ = player->actor.velocity.y = 0.0f;
player->actor.shape.rot.y = -0x8000;
player->targetYaw = -0x8000;
player->currentYaw = -0x8000;
player->zTargetYaw = -0x8000;
player->yaw = -0x8000;
player->fallStartHeight = 0;
player->stateFlags1 |= PLAYER_STATE1_5;
@ -422,10 +422,10 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) {
if (player->actor.world.pos.y > 100.0f) {
player->actor.world.pos.x = sRoomCenter.x;
player->actor.world.pos.z = sRoomCenter.z;
player->linearVelocity = 0;
player->speedXZ = 0;
player->actor.shape.rot.y = -0x8000;
player->targetYaw = -0x8000;
player->currentYaw = -0x8000;
player->zTargetYaw = -0x8000;
player->yaw = -0x8000;
}
Math_Vec3f_Copy(&sSubCamAt, &player->actor.world.pos);

View file

@ -626,8 +626,8 @@ void BossTw_TurnToPlayer(BossTw* this, PlayState* play) {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, this->rotateSpeed);
Math_ApproachS(&this->actor.shape.rot.x, 0, 5, this->rotateSpeed);
Math_ApproachF(&this->rotateSpeed, 4096.0f, 1.0f, 200.0f);
func_8002D908(&this->actor);
func_8002D7EC(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
Actor_UpdatePos(&this->actor);
if (this->timers[0] == 0) {
if ((otherTw->actionFunc != BossTw_ShootBeam) && this->work[CAN_SHOOT]) {
this->work[CAN_SHOOT] = false;
@ -698,8 +698,8 @@ void BossTw_FlyTo(BossTw* this, PlayState* play) {
Math_ApproachS(&this->actor.shape.rot.x, pitchTarget, 0xA, this->rotateSpeed);
Math_ApproachF(&this->rotateSpeed, 4096.0f, 1.0f, 100.0f);
Math_ApproachF(&this->actor.speed, 10.0f, 1.0f, 1.0f);
func_8002D908(&this->actor);
func_8002D7EC(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
Actor_UpdatePos(&this->actor);
if ((this->timers[0] == 0) || (xzDist < 70.0f)) {
BossTw_SetupTurnToPlayer(this, play);
@ -2363,8 +2363,8 @@ void BossTw_DeathBall(BossTw* this, PlayState* play) {
Math_ApproachS(&this->actor.world.rot.x, RAD_TO_BINANG(Math_FAtan2F(yDiff, sqrtf(SQ(xDiff) + SQ(zDiff)))), 5,
this->rotateSpeed);
Math_ApproachS(&this->actor.world.rot.y, yaw, 5, this->rotateSpeed);
func_8002D908(&this->actor);
func_8002D7EC(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
Actor_UpdatePos(&this->actor);
}
void BossTw_TwinrovaSetupDeathCS(BossTw* this, PlayState* play) {
@ -3936,8 +3936,8 @@ void BossTw_BlastFire(BossTw* this, PlayState* play) {
case 10:
this->blastActive = true;
if (this->timers[0] == 0) {
func_8002D908(&this->actor);
func_8002D7EC(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
Actor_UpdatePos(&this->actor);
Actor_PlaySfx(&this->actor, NA_SE_EN_TWINROBA_SHOOT_FIRE & ~SFX_FLAG);
} else {
Vec3f velocity;
@ -4125,8 +4125,8 @@ void BossTw_BlastIce(BossTw* this, PlayState* play) {
this->blastActive = true;
if (this->timers[0] == 0) {
func_8002D908(&this->actor);
func_8002D7EC(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
Actor_UpdatePos(&this->actor);
Actor_PlaySfx(&this->actor, NA_SE_EN_TWINROBA_SHOOT_FREEZE - SFX_FLAG);
} else {
Vec3f velocity;
@ -5404,7 +5404,7 @@ void BossTw_TwinrovaFly(BossTw* this, PlayState* play) {
Math_ApproachS(&this->actor.shape.rot.y, yaw, 0xA, this->rotateSpeed);
Math_ApproachF(&this->rotateSpeed, 2000.0f, 1.0f, 100.0f);
Math_ApproachF(&this->actor.speed, 30.0f, 1.0f, 2.0f);
func_8002D908(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
Math_ApproachF(&this->actor.world.pos.x, this->targetPos.x, 0.1f, fabsf(this->actor.velocity.x) * 1.5f);
Math_ApproachF(&this->actor.world.pos.y, this->targetPos.y, 0.1f, fabsf(this->actor.velocity.y) * 1.5f);
Math_ApproachF(&this->targetPos.y, 380.0f, 1.0f, 2.0f);

View file

@ -1283,7 +1283,7 @@ void BossVa_BodyPhase3(BossVa* this, PlayState* play) {
this->actor.speed = 0.0f;
}
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
if (SkelAnime_Update(&this->skelAnime) && (sFightPhase >= PHASE_4)) {
BossVa_SetupBodyPhase4(this, play);
}
@ -1482,7 +1482,7 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) {
}
}
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 60.0f;
if (((play->gameplayFrames % 2) == 0) && (this->timer == 0)) {

View file

@ -918,7 +918,7 @@ void DemoEffect_UpdateLightRingTriforce(DemoEffect* this, PlayState* play) {
void DemoEffect_UpdateCreationFireball(DemoEffect* this, PlayState* play) {
DemoEffect* effect;
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
this->actor.speed += this->actor.gravity * 0.5f;
if (this->fireBall.timer != 0) {

View file

@ -568,7 +568,7 @@ void DemoGj_InitRubblePile1(DemoGj* this, PlayState* play) {
}
void func_8097A000(DemoGj* this, PlayState* play) {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
this->rotationVec.x += (s16)(kREG(18));
this->rotationVec.y += (s16)(kREG(19) + 1000);
@ -633,7 +633,7 @@ void DemoGj_InitRubblePile2(DemoGj* this, PlayState* play) {
}
void func_8097A238(DemoGj* this, PlayState* play) {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
this->rotationVec.x += (s16)(kREG(31));
this->rotationVec.y += (s16)(kREG(32) + 1000);
@ -698,7 +698,7 @@ void DemoGj_InitRubblePile3(DemoGj* this, PlayState* play) {
}
void func_8097A474(DemoGj* this, PlayState* play) {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
this->rotationVec.x += (s16)(kREG(44));
this->rotationVec.y += (s16)(kREG(45) + 1000);
@ -746,7 +746,7 @@ void DemoGj_InitRubblePile4(DemoGj* this, PlayState* play) {
}
void func_8097A644(DemoGj* this, PlayState* play) {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
this->rotationVec.x += (s16)(kREG(57));
this->rotationVec.y += (s16)(kREG(58) + 1000);
@ -794,7 +794,7 @@ void DemoGj_InitRubblePile5(DemoGj* this, PlayState* play) {
}
void func_8097A814(DemoGj* this, PlayState* play) {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
this->rotationVec.x += (s16)(kREG(70));
this->rotationVec.y += (s16)(kREG(71) + 1000);
@ -842,7 +842,7 @@ void DemoGj_InitRubblePile6(DemoGj* this, PlayState* play) {
}
void func_8097A9E4(DemoGj* this, PlayState* play) {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
this->rotationVec.x += (s16)(kREG(83));
this->rotationVec.y += (s16)(kREG(84) + 1000);
@ -890,7 +890,7 @@ void DemoGj_InitRubblePile7(DemoGj* this, PlayState* play) {
}
void func_8097ABB4(DemoGj* this, PlayState* play) {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
this->rotationVec.x += (s16)(kREG(15));
this->rotationVec.y += (s16)(kREG(14) + 1000);

View file

@ -166,11 +166,11 @@ void func_8097CC08(DemoGo* this) {
} else {
this->actor.speed = (kREG(15) * 0.01f) + 1.2f;
}
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
}
void func_8097CCC0(DemoGo* this) {
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
}
void func_8097CCE0(DemoGo* this, PlayState* play) {

View file

@ -222,7 +222,7 @@ void DoorKiller_FallAsRubble(DoorKiller* this, PlayState* play) {
} else {
Actor_Kill(&this->actor);
}
func_8002D7EC(&this->actor);
Actor_UpdatePos(&this->actor);
}
s32 DoorKiller_IsHit(Actor* thisx, PlayState* play) {

View file

@ -866,7 +866,7 @@ void DoorShutter_WaitPlayerSurprised(DoorShutter* this, PlayState* play) {
}
void DoorShutter_GohmaBlockFall(DoorShutter* this, PlayState* play) {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
DoorShutter_SetupAction(this, DoorShutter_GohmaBlockBounce);

View file

@ -186,7 +186,7 @@ void DoorWarp1_SetupWarp(DoorWarp1* this, PlayState* play) {
void DoorWarp1_SetupAdultDungeonWarp(DoorWarp1* this, PlayState* play) {
SkelAnime_Init(play, &this->skelAnime, &gWarpCrystalSkel, &gWarpCrystalAnim, NULL, NULL, 0);
Animation_ChangeImpl(&this->skelAnime, &gWarpCrystalAnim, 1.0f, 1.0f, 1.0f, ANIMMODE_ONCE, 40.0f, 1);
Animation_ChangeImpl(&this->skelAnime, &gWarpCrystalAnim, 1.0f, 1.0f, 1.0f, ANIMMODE_ONCE, 40.0f, ANIMTAPER_ACCEL);
this->scale = 0;
this->unk_1AE = -140;
@ -215,7 +215,7 @@ void DoorWarp1_SetupBlueCrystal(DoorWarp1* this, PlayState* play) {
SkelAnime_Init(play, &this->skelAnime, &gWarpCrystalSkel, &gWarpCrystalAnim, NULL, NULL, 0);
Animation_ChangeImpl(&this->skelAnime, &gWarpCrystalAnim, 0, Animation_GetLastFrame(&gWarpCrystalAnim),
Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 0.0f, 1);
Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 0.0f, ANIMTAPER_ACCEL);
this->skelAnime.curFrame = Animation_GetLastFrame(&gWarpCrystalAnim);
this->scale = 10;
@ -244,7 +244,7 @@ void DoorWarp1_SetupBlueCrystal(DoorWarp1* this, PlayState* play) {
void DoorWarp1_SetupPurpleCrystal(DoorWarp1* this, PlayState* play) {
SkelAnime_Init(play, &this->skelAnime, &gWarpCrystalSkel, &gWarpCrystalAnim, NULL, NULL, 0);
Animation_ChangeImpl(&this->skelAnime, &gWarpCrystalAnim, 0, Animation_GetLastFrame(&gWarpCrystalAnim),
Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 0.0f, 1);
Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 0.0f, ANIMTAPER_ACCEL);
this->skelAnime.curFrame = Animation_GetLastFrame(&gWarpCrystalAnim);
this->unk_1AE = 120;
@ -668,7 +668,7 @@ void func_8099A508(DoorWarp1* this, PlayState* play) {
Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Animation_ChangeImpl(&this->skelAnime, &gWarpCrystalAnim, 1.0f, Animation_GetLastFrame(&gWarpCrystalAnim),
Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 40.0f, 1);
Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 40.0f, ANIMTAPER_ACCEL);
this->unk_1B2 = 0x32;
DoorWarp1_SetupAction(this, DoorWarp1_AdultWarpOut);

View file

@ -112,9 +112,9 @@ static ColliderQuadInit sQuadInit = {
};
typedef enum {
/* 00 */ AM_DMGEFF_NONE, // used by anything that cant kill the armos
/* 01 */ AM_DMGEFF_NUT,
/* 06 */ AM_DMGEFF_STUN = 6, // doesn't include deku nuts
/* 0 */ AM_DMGEFF_NONE, // used by anything that cant kill the armos
/* 1 */ AM_DMGEFF_NUT,
/* 6 */ AM_DMGEFF_STUN = 6, // doesn't include deku nuts
/* 13 */ AM_DMGEFF_ICE = 13,
/* 14 */ AM_DMGEFF_MAGIC_FIRE_LIGHT,
/* 15 */ AM_DMGEFF_KILL // any damage source that can kill the armos (and isn't a special case)
@ -532,7 +532,7 @@ void EnAm_MoveToHome(EnAm* this, PlayState* play) {
// turn away from a wall if touching one
if ((this->dyna.actor.speed != 0.0f) && (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
this->dyna.actor.world.rot.y = this->dyna.actor.wallYaw;
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
}
SkelAnime_Update(&this->skelAnime);
@ -640,7 +640,7 @@ void EnAm_Lunge(EnAm* this, PlayState* play) {
if ((this->dyna.actor.speed != 0.0f) && (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
this->dyna.actor.world.rot.y =
(this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y) + this->dyna.actor.wallYaw;
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
this->dyna.actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
}
@ -885,7 +885,7 @@ void EnAm_Update(Actor* thisx, PlayState* play) {
}
}
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 28.0f, 80.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
UPDBGCHECKINFO_FLAG_4);

View file

@ -238,7 +238,7 @@ void EnAni_Update(Actor* thisx, PlayState* play) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);
if ((play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.actorCues[0] != NULL)) {
switch (this->unk_2AA) {

View file

@ -445,7 +445,7 @@ void EnAnubice_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
this->actor.velocity.y += this->actor.gravity;
func_8002D7EC(&this->actor);
Actor_UpdatePos(&this->actor);
if (!this->isPlayerOutOfRange) {
Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 5.0f, 10.0f,

View file

@ -176,7 +176,7 @@ void EnAnubiceFire_Update(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->actor, this->scale);
this->actionFunc(this, play);
func_8002D7EC(&this->actor);
Actor_UpdatePos(&this->actor);
this->unk_160[0] = this->actor.world.pos;
for (i = 4; i >= 0; i--) {

View file

@ -183,11 +183,11 @@ void EnArrow_Shoot(EnArrow* this, PlayState* play) {
Math_Vec3f_Copy(&this->unk_210, &this->actor.world.pos);
if (this->actor.params >= ARROW_SEED) {
func_8002D9A4(&this->actor, 80.0f);
Actor_SetProjectileSpeed(&this->actor, 80.0f);
this->timer = 15;
this->actor.shape.rot.x = this->actor.shape.rot.y = this->actor.shape.rot.z = 0;
} else {
func_8002D9A4(&this->actor, 150.0f);
Actor_SetProjectileSpeed(&this->actor, 150.0f);
this->timer = 12;
}
}
@ -325,7 +325,7 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) {
}
} else {
Math_Vec3f_Copy(&this->unk_210, &this->actor.world.pos);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
if ((this->touchedPoly =
BgCheck_ProjectileLineTest(&play->colCtx, &this->actor.prevPos, &this->actor.world.pos, &hitPoint,
@ -377,7 +377,7 @@ void func_809B45E0(EnArrow* this, PlayState* play) {
void func_809B4640(EnArrow* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
if (DECR(this->timer) == 0) {
Actor_Kill(&this->actor);

View file

@ -332,9 +332,9 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) {
UPDBGCHECKINFO_FLAG_4);
if (this->actionFunc == func_809B5670) {
func_8002D97C(&this->actor);
Actor_MoveXYZ(&this->actor);
} else {
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
}
if (this->actor.floorHeight <= BGCHECK_Y_MIN) {

View file

@ -212,7 +212,7 @@ void EnBa_FallAsBlob(EnBa* this, PlayState* play) {
Actor_Kill(&this->actor);
}
} else {
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 28.0f, 80.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
}
}

View file

@ -1237,7 +1237,7 @@ void EnBb_Update(Actor* thisx, PlayState* play2) {
this->actionFunc(this, play);
if ((this->actor.params <= ENBB_BLUE) && (this->actor.speed >= -6.0f) &&
((this->actor.flags & ACTOR_FLAG_15) == 0)) {
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
}
if (this->moveMode == BBMOVE_NORMAL) {
if ((this->actor.world.pos.y - 20.0f) <= this->actor.floorHeight) {

View file

@ -181,7 +181,7 @@ void EnBdfire_Update(Actor* thisx, PlayState* play) {
this->unk_156++;
this->actionFunc(this, play);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
}
void EnBdfire_DrawFire(EnBdfire* this, PlayState* play) {

View file

@ -619,9 +619,9 @@ void EnBili_Update(Actor* thisx, PlayState* play2) {
}
}
if (this->actionFunc == EnBili_Recoil) {
func_8002D97C(&this->actor);
Actor_MoveXYZ(&this->actor);
} else {
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
}
Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, this->collider.dim.radius, this->collider.dim.height,

View file

@ -136,7 +136,7 @@ void EnBom_Move(EnBom* this, PlayState* play) {
this->actor.world.rot.y = ((this->actor.wallYaw - this->actor.world.rot.y) + this->actor.wallYaw) - 0x8000;
}
Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_BOUND);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
this->actor.speed *= 0.7f;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
}
@ -154,7 +154,7 @@ void EnBom_Move(EnBom* this, PlayState* play) {
}
}
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
}
void EnBom_WaitForRelease(EnBom* this, PlayState* play) {

View file

@ -191,7 +191,7 @@ void EnBomChu_UpdateFloorPoly(EnBomChu* this, CollisionPoly* floorPoly, PlayStat
// A hack for preventing bombchus from sticking to ledges.
// The visual rotation reverts the sign inversion (shape.rot.x = -world.rot.x).
// The better fix would be making func_8002D908 compute XYZ velocity better,
// The better fix would be making Actor_UpdateVelocityXYZ compute XYZ velocity better,
// or not using it and make the bombchu compute its own velocity.
this->actor.world.rot.x = -this->actor.world.rot.x;
}
@ -422,7 +422,7 @@ void EnBomChu_Update(Actor* thisx, PlayState* play2) {
}
this->actionFunc(this, play);
func_8002D97C(&this->actor);
Actor_MoveXYZ(&this->actor);
this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x;
this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y;

View file

@ -332,7 +332,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
if (thisx->params == BOMBFLOWER_BODY) {
Actor_MoveForward(thisx);
Actor_MoveXZGravity(thisx);
}
if (thisx->gravity != 0.0f) {
@ -357,7 +357,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
thisx->world.rot.y = ((thisx->wallYaw - thisx->world.rot.y) + thisx->wallYaw) - 0x8000;
}
Actor_PlaySfx(thisx, NA_SE_EV_BOMB_BOUND);
Actor_MoveForward(thisx);
Actor_MoveXZGravity(thisx);
DREG(6) = 1;
Actor_UpdateBgCheckInfo(play, thisx, 5.0f, 10.0f, 0.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2 |

View file

@ -148,8 +148,8 @@ void EnBoom_Fly(EnBoom* this, PlayState* play) {
}
// Set xyz speed, move forward, and play the boomerang sound effect
func_8002D9A4(&this->actor, 12.0f);
Actor_MoveForward(&this->actor);
Actor_SetProjectileSpeed(&this->actor, 12.0f);
Actor_MoveXZGravity(&this->actor);
func_8002F974(&this->actor, NA_SE_IT_BOOMERANG_FLY - SFX_FLAG);
// If the boomerang collides with EnItem00 or a Skulltula token, set grabbed pointer to pick it up

View file

@ -8,7 +8,7 @@
/*
set on init unless treasure flag is set
if clear, chest moves (Actor_MoveForward) (falls, likely)
if clear, chest moves (Actor_MoveXZGravity) (falls, likely)
ends up cleared from SWITCH_FLAG_FALL types when switch flag is set
*/
#define ENBOX_MOVE_IMMOBILE (1 << 0)
@ -521,7 +521,7 @@ void EnBox_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
if (!(this->movementFlags & ENBOX_MOVE_IMMOBILE)) {
Actor_MoveForward(&this->dyna.actor);
Actor_MoveXZGravity(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f,
UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4);
}

View file

@ -398,7 +398,7 @@ void EnBubble_Regrow(EnBubble* this, PlayState* play) {
void EnBubble_Update(Actor* thisx, PlayState* play) {
EnBubble* this = (EnBubble*)thisx;
func_8002D7EC(&this->actor);
Actor_UpdatePos(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 16.0f, 16.0f, 0.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2);
this->actionFunc(this, play);

View file

@ -409,7 +409,7 @@ void EnButte_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
if (this->actor.update != NULL) {
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Math_StepToF(&this->actor.world.pos.y, this->posYTarget, 0.6f);
if (this->actor.xyzDistToPlayerSq < 5000.0f) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);

View file

@ -792,7 +792,7 @@ void EnBw_Update(Actor* thisx, PlayState* play2) {
this->unk_234 = Actor_TestFloorInDirection(thisx, play, 50.0f, thisx->world.rot.y);
if ((this->unk_220 == 4) || (this->unk_220 == 6) || (this->unk_220 == 5) || (this->unk_220 == 1) ||
(this->unk_234 != 0)) {
Actor_MoveForward(thisx);
Actor_MoveXZGravity(thisx);
}
Actor_UpdateBgCheckInfo(play, thisx, 20.0f, 30.0f, 21.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2 |

View file

@ -236,9 +236,9 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) {
this->state = CLEAR_TAG_STATE_LASER;
this->timers[CLEAR_TAG_TIMER_LASER_DEATH] = 70;
this->actor.speed = 35.0f;
func_8002D908(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
for (j = 0; j <= 0; j++) {
func_8002D7EC(&this->actor);
Actor_UpdatePos(&this->actor);
}
this->actor.scale.x = 0.4f;
this->actor.scale.y = 0.4f;
@ -246,7 +246,7 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) {
this->actor.speed = 70.0f;
this->actor.shape.rot.x = -this->actor.shape.rot.x;
func_8002D908(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
Collider_SetCylinder(play, &this->collider, &this->actor, &sLaserCylinderInit);
Actor_PlaySfx(&this->actor, NA_SE_IT_SWORD_REFLECT_MG);
} else { // Initialize the Arwing.
@ -473,7 +473,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) {
this->actor.shape.rot.x = -this->actor.shape.rot.x;
// Update the Arwing's velocity.
func_8002D908(&this->actor);
Actor_UpdateVelocityXYZ(&this->actor);
this->actor.velocity.x += this->acceleration.x;
this->actor.velocity.y += this->acceleration.y;
this->actor.velocity.z += this->acceleration.z;
@ -496,7 +496,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) {
this->crashingTimer--;
}
func_8002D7EC(&this->actor);
Actor_UpdatePos(&this->actor);
Actor_SetFocus(&this->actor, 0.0f);
@ -542,7 +542,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) {
break;
case CLEAR_TAG_STATE_LASER:
func_8002D7EC(&this->actor);
Actor_UpdatePos(&this->actor);
// Check if the laser has hit a target.
if (this->collider.base.atFlags & AT_HIT) {

View file

@ -301,7 +301,7 @@ void EnCow_Update(Actor* thisx, PlayState* play2) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliders[0].base);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliders[1].base);
Actor_MoveForward(thisx);
Actor_MoveXZGravity(thisx);
Actor_UpdateBgCheckInfo(play, thisx, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);
if (SkelAnime_Update(&this->skelAnime)) {
if (this->skelAnime.animation == &gCowBodyChewAnim) {

View file

@ -440,10 +440,10 @@ void EnCrow_Update(Actor* thisx, PlayState* play) {
if (this->actionFunc != EnCrow_Respawn) {
if (this->actor.colChkInfo.health != 0) {
height = 20.0f * scale;
func_8002D97C(&this->actor);
Actor_MoveXYZ(&this->actor);
} else {
height = 0.0f;
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
}
Actor_UpdateBgCheckInfo(play, &this->actor, 12.0f * scale, 25.0f * scale, 50.0f * scale,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2);

View file

@ -313,7 +313,7 @@ s32 EnCs_HandleWalking(EnCs* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->walkAngle, 1, 2500, 0);
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.speed = this->walkSpeed;
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);
return 0;

View file

@ -542,7 +542,7 @@ void EnDaiku_EscapeRun(EnDaiku* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, ry, 1, 0xFA0, 0);
this->actor.world.rot.y = this->actor.shape.rot.y;
Math_SmoothStepToF(&this->actor.speed, this->runSpeed, 0.6f, dxz, 0.0f);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);
if (this->subCamActive) {

View file

@ -428,7 +428,7 @@ void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.speed, this->runSpeed, 0.8f, runDist, 0.0f);
}
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
if (this->flags & 0x40) {
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);

View file

@ -1121,7 +1121,7 @@ void EnDekubaba_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
if (this->actionFunc == EnDekubaba_PrunedSomersault) {
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, this->size * 15.0f, 10.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
} else if (this->actionFunc != EnDekubaba_DeadStickDrop) {

View file

@ -475,7 +475,7 @@ void EnDekunuts_Update(Actor* thisx, PlayState* play) {
if (this->actor.params != DEKUNUTS_FLOWER) {
EnDekunuts_ColliderCheck(this, play);
this->actionFunc(this, play);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, this->collider.dim.radius, this->collider.dim.height,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
UPDBGCHECKINFO_FLAG_4);

View file

@ -508,7 +508,7 @@ void EnDh_Update(Actor* thisx, PlayState* play) {
EnDh_CollisionCheck(this, play);
this->actionFunc(this, play);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 45.0f, 45.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
UPDBGCHECKINFO_FLAG_4);

View file

@ -480,7 +480,7 @@ void EnDns_Update(Actor* thisx, PlayState* play) {
Actor_SetFocus(&this->actor, 60.0f);
Actor_SetScale(&this->actor, 0.01f);
SkelAnime_Update(&this->skelAnime);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
this->actionFunc(this, play);
if (this->standOnGround) {
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 20.0f, UPDBGCHECKINFO_FLAG_2);

View file

@ -417,7 +417,7 @@ void EnDntJiji_Update(Actor* thisx, PlayState* play) {
}
}
this->actionFunc(this, play);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
UPDBGCHECKINFO_FLAG_4);

View file

@ -804,7 +804,7 @@ void EnDntNomal_Update(Actor* thisx, PlayState* play) {
}
}
this->actionFunc(this, play);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
UPDBGCHECKINFO_FLAG_4);

View file

@ -429,7 +429,7 @@ void EnDodojr_EmergeFromGround(EnDodojr* this, PlayState* play) {
}
void EnDodojr_CrawlTowardsTarget(EnDodojr* this, PlayState* play) {
func_8002D868(&this->actor);
Actor_UpdateVelocityXZGravity(&this->actor);
EnDodojr_SpawnSmallDust(this, play, &this->actor.world.pos);
if (DECR(this->crawlSfxTimer) == 0) {
@ -487,7 +487,7 @@ void EnDodojr_SwallowedBombDeathBounce(EnDodojr* this, PlayState* play) {
// Scale up briefly to expand from the swallowed bomb exploding.
this->rootScale = 1.2f;
this->rootScale *= ((f32)this->actor.colorFilterTimer / 8);
func_8002D868(&this->actor);
Actor_UpdateVelocityXZGravity(&this->actor);
if (EnDodojr_UpdateBounces(this, play)) {
this->timer = 60;
@ -502,7 +502,7 @@ void EnDodojr_SwallowedBombDeathSequence(EnDodojr* this, PlayState* play) {
}
void EnDodojr_StunnedBounce(EnDodojr* this, PlayState* play) {
func_8002D868(&this->actor);
Actor_UpdateVelocityXZGravity(&this->actor);
if (EnDodojr_UpdateBounces(this, play)) {
EnDodojr_SetupSwallowedBombDeathSequence(this);
@ -536,7 +536,7 @@ void EnDodojr_Stunned(EnDodojr* this, PlayState* play) {
void EnDodojr_JumpAttackBounce(EnDodojr* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_24;
func_8002D868(&this->actor);
Actor_UpdateVelocityXZGravity(&this->actor);
if (EnDodojr_UpdateBounces(this, play)) {
EnDodojr_SetupCrawlTowardsTarget(this);
@ -560,7 +560,7 @@ void EnDodojr_Despawn(EnDodojr* this, PlayState* play) {
}
void EnDodojr_StandardDeathBounce(EnDodojr* this, PlayState* play) {
func_8002D868(&this->actor);
Actor_UpdateVelocityXZGravity(&this->actor);
Math_SmoothStepToS(&this->actor.shape.rot.y, 0, 4, 1000, 10);
this->actor.world.rot.x = this->actor.shape.rot.x;
@ -610,7 +610,7 @@ void EnDodojr_Update(Actor* thisx, PlayState* play) {
EnDodojr* this = (EnDodojr*)thisx;
SkelAnime_Update(&this->skelAnime);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
EnDodojr_CheckDamaged(this, play);
if (this->actionFunc != EnDodojr_WaitUnderground) {

View file

@ -769,7 +769,7 @@ void EnDodongo_Update(Actor* thisx, PlayState* play) {
EnDodongo_CollisionCheck(this, play);
if (this->actor.colChkInfo.damageEffect != 0xE) {
this->actionFunc(this, play);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 60.0f, 70.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
UPDBGCHECKINFO_FLAG_4);

View file

@ -455,7 +455,7 @@ void EnDog_Update(Actor* thisx, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
Actor_UpdateBgCheckInfo(play, &this->actor, this->collider.dim.radius, this->collider.dim.height * 0.5f, 0.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
Actor_MoveForward(&this->actor);
Actor_MoveXZGravity(&this->actor);
this->actionFunc(this, play);
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);

Some files were not shown because too many files have changed in this diff Show more