mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Camera Preparation (#644)
* Copy progress from z_camera * cleanup functions.h * Oops * Revert `SUB16` and `ADD16` back to original names * PR Suggestions * PR Suggestions * Fix merge with master
This commit is contained in:
+19
-20
@@ -1140,13 +1140,13 @@ s32 Camera_ChangeMode(Camera* camera, s16 mode);
|
||||
// void func_800DF86C(void);
|
||||
// void func_800DF8EC(void);
|
||||
s32 func_800DFAC8(Camera* camera, s16 param_2);
|
||||
u32 func_800DFB14(Camera* camera, u32 param_2);
|
||||
u32 Camera_ChangeDataIdx(Camera* camera, u32 camDataIdx);
|
||||
// void func_800DFC1C(void);
|
||||
// void func_800DFC40(void);
|
||||
s32 func_800DFC68(Camera* camera);
|
||||
s32 Camera_GetInputDirYaw(Camera* camera);
|
||||
// void func_800DFC90(void);
|
||||
s16 func_800DFCB4(Camera* camera);
|
||||
s16 func_800DFCDC(Camera* camera);
|
||||
s16 Camera_GetCamDirPitch(Camera* camera);
|
||||
s16 Camera_GetCamDirYaw(Camera* camera);
|
||||
void func_800DFD04(Camera* camera, s32 arg1, s32 arg2, s32 arg3);
|
||||
// void func_800DFD78(void);
|
||||
// UNK_TYPE4 func_800DFEF0(s32 param_1, u16 param_2);
|
||||
@@ -1162,9 +1162,9 @@ s32 func_800DFFAC(Camera* camera, Actor* doorActor, s16 bgCamDataId, f32 arg3, s
|
||||
// void func_800E01DC(s32 param_1, u32 param_2, UNK_TYPE4 param_3, UNK_TYPE4 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6);
|
||||
// UNK_TYPE4 func_800E0228(void);
|
||||
// void func_800E0238(void);
|
||||
void func_800E02AC(Camera* camera, Actor* actor);
|
||||
void func_800E0308(Camera* camera, Actor* actor);
|
||||
f32 func_800E031C(Camera* camera);
|
||||
void Camera_SetToTrackActor(Camera* camera, Actor* actor);
|
||||
void Camera_SetTargetActor(Camera* camera, Actor* actor);
|
||||
f32 Camera_GetWaterYPos(Camera* camera);
|
||||
void func_800E0348(Camera* camera);
|
||||
DamageTable* DamageTable_Get(s32 index);
|
||||
void DamageTable_Clear(DamageTable* damageTable);
|
||||
@@ -2838,22 +2838,21 @@ void func_8016927C(GlobalContext* globalCtx, s16 sParm2);
|
||||
// void func_801692C4(GlobalContext* globalCtx, UNK_TYPE1 uParm2);
|
||||
// void Play_SceneInit(GlobalContext* globalCtx, s32 sceneIndex, UNK_TYPE1 param_3);
|
||||
UNK_RET func_80169474(GlobalContext* globalCtx, Vec3f* v1, Vec3f* v2);
|
||||
s32 func_801694DC(GlobalContext* globalCtx);
|
||||
s32 Play_GetActiveCameraIndex(GlobalContext* globalCtx);
|
||||
void func_80169590(GlobalContext* globalCtx, s16 param_2, s16 param_3);
|
||||
void func_80169600(GlobalContext* globalCtx, s16 param_2);
|
||||
// void func_80169668(void);
|
||||
s32 Play_CreateSubCamera(GlobalContext* globalCtx);
|
||||
s32 Play_GetActiveCamId(GlobalContext* globalCtx);
|
||||
void Play_CameraChangeStatus(GlobalContext* globalCtx, s16 camId, s16 status);
|
||||
void Play_ClearCamera(GlobalContext* globalCtx, s16 camId);
|
||||
Camera* Play_GetCamera(GlobalContext* globalCtx, s16 index);
|
||||
s32 Play_CameraSetAtEye(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3f* eye);
|
||||
void func_8016981C(GlobalContext* globalCtx, s16 arg1, Vec3f* arg2, Vec3f* arg3, Vec3f* arg4);
|
||||
void func_80169940(GlobalContext* globalCtx, s16 camId, f32 arg2);
|
||||
// void func_80169988(void);
|
||||
void func_801699D4(GlobalContext* globalCtx, s16 arg1, s16 arg2);
|
||||
void Play_CameraSetAtEyeUp(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3f* eye, Vec3f* up);
|
||||
void Play_CameraSetFov(GlobalContext* globalCtx, s16 camId, f32 fov);
|
||||
void Play_CameraSetRoll(GlobalContext* globalCtx, s16 camId, s16 roll);
|
||||
void Play_CopyCamera(GlobalContext* globalCtx, s16 dstCamId, s16 srcCamId);
|
||||
// void func_80169A50(void);
|
||||
// void func_80169AC0(void);
|
||||
void Play_CameraChangeSetting(GlobalContext* globalCtx, s16 camId, s16 setting);
|
||||
void func_80169AFC(GlobalContext* globalCtx, s16 camId, s16 arg2);
|
||||
// void func_80169C64(void);
|
||||
// void func_80169C84(void);
|
||||
s16 Play_GetCsCamDataSetting(GlobalContext* globalCtx, s32 camId);
|
||||
Vec3s* Play_GetCsCamDataVec3s(GlobalContext* globalCtx, s32 camId);
|
||||
s16 convert_scene_number_among_shared_scenes(s16 arg0);
|
||||
void func_80169D40(GlobalContext* globalCtx);
|
||||
void func_80169DCC(GlobalContext* globalCtx, s32 arg1, u16 arg2, s32 arg3, s32 arg4, Vec3f* arg5, s16 arg6);
|
||||
@@ -3149,7 +3148,7 @@ s32 Math3D_TriChkPointParaZIntersect(Vec3f* a, Vec3f* b, Vec3f* c, f32 nx, f32 n
|
||||
s32 Math3D_TriChkLineSegParaZIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 x, f32 y, f32* zIntersect, f32 z0, f32 z1);
|
||||
// void func_8017D1AC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
|
||||
// void func_8017D220(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
// void func_8017D2FC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8);
|
||||
s32 Math3D_LineSegVsPlane(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* linePointA, Vec3f* linePointB, Vec3f* intersect, s32 fromFront);
|
||||
// void func_8017D404(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10, UNK_TYPE4 param_11);
|
||||
void Math3D_TriSetCoords(TriNorm* tri, Vec3f* pointA, Vec3f* pointB, Vec3f* pointC);
|
||||
u32 Math3D_IsPointInSphere(Sphere16* sphere, Vec3f* point);
|
||||
|
||||
+1
-2
@@ -21,8 +21,7 @@
|
||||
#define SEGMENTED_TO_VIRTUAL(addr) (void*)(PHYSICAL_TO_VIRTUAL(gSegments[SEGMENT_NUMBER(addr)]) + SEGMENT_OFFSET(addr))
|
||||
|
||||
#define GET_ACTIVE_CAM(globalCtx) ((globalCtx)->cameraPtrs[(globalCtx)->activeCamera])
|
||||
#define MAIN_CAM 0
|
||||
#define SUBCAM_FREE 0
|
||||
#define CAM_ID_MAIN 0
|
||||
|
||||
#define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \
|
||||
(curState)->nextGameStateInit = (GameStateFunc)newInit; \
|
||||
|
||||
+8
-8
@@ -67,7 +67,7 @@
|
||||
typedef struct {
|
||||
/* 0x0 */ s16 priority; // Lower means higher priority. -1 means it ignores priority
|
||||
/* 0x2 */ s16 length;
|
||||
/* 0x4 */ s16 unk4;
|
||||
/* 0x4 */ s16 csCamSceneDataId; // Index of CsCameraEntry to use. Negative indices use sGlobalCamDataSettings. Indices 0 and above use CsCameraEntry from scene
|
||||
/* 0x6 */ s16 unk6;
|
||||
/* 0x8 */ s16 additionalCutscene;
|
||||
/* 0xA */ u8 sound;
|
||||
@@ -119,8 +119,8 @@ typedef struct {
|
||||
/* 0x18 */ u16 unk_18;
|
||||
/* 0x1A */ u8 unk_1A;
|
||||
/* 0x1B */ u8 unk_1B;
|
||||
/* 0x1C */ CutsceneCameraPoint* cameraFocus;
|
||||
/* 0x20 */ CutsceneCameraPoint* cameraPosition;
|
||||
/* 0x1C */ CutsceneCameraPoint* atPoints;
|
||||
/* 0x20 */ CutsceneCameraPoint* eyePoints;
|
||||
/* 0x24 */ CsCmdActorAction* linkAction;
|
||||
/* 0x28 */ CsCmdActorAction* npcActions[10]; // "npcdemopnt"
|
||||
/* 0x50 */ CutsceneEntry* sceneCsList;
|
||||
@@ -718,8 +718,8 @@ typedef struct {
|
||||
/* 0x12 */ u8 unk_12;
|
||||
/* 0x13 */ u8 unk_13;
|
||||
/* 0x14 */ u8 unk_14;
|
||||
/* 0x15 */ u8 unk_15;
|
||||
/* 0x16 */ u8 unk_16;
|
||||
/* 0x15 */ u8 skyboxDisabled;
|
||||
/* 0x16 */ u8 sunMoonDisabled;
|
||||
/* 0x17 */ u8 unk_17;
|
||||
/* 0x18 */ u8 unk_18;
|
||||
/* 0x19 */ u8 unk_19;
|
||||
@@ -1071,7 +1071,7 @@ typedef struct Camera {
|
||||
/* 0x15E */ s16 animState;
|
||||
/* 0x160 */ s16 unk160;
|
||||
/* 0x162 */ s16 timer;
|
||||
/* 0x164 */ s16 thisIdx;
|
||||
/* 0x164 */ s16 camId;
|
||||
/* 0x166 */ s16 prevCamDataIdx;
|
||||
/* 0x168 */ s16 unk168;
|
||||
/* 0x16A */ s16 unk16A;
|
||||
@@ -1100,7 +1100,7 @@ typedef struct {
|
||||
/* 0x1A */ s16 speed;
|
||||
/* 0x1C */ s16 isShakePerpendicular;
|
||||
/* 0x1E */ s16 countdown;
|
||||
/* 0x20 */ s16 cameraPtrsIdx;
|
||||
/* 0x20 */ s16 camId;
|
||||
} QuakeRequest; // size = 0x24
|
||||
|
||||
typedef struct {
|
||||
@@ -1324,7 +1324,7 @@ struct GlobalContext {
|
||||
/* 0x1884C */ RomFile* roomList;
|
||||
/* 0x18850 */ ActorEntry* linkActorEntry;
|
||||
/* 0x18854 */ ActorEntry* setupActorList;
|
||||
/* 0x18858 */ void* unk_18858;
|
||||
/* 0x18858 */ CsCamData* csCamData;
|
||||
/* 0x1885C */ EntranceEntry* setupEntranceList;
|
||||
/* 0x18860 */ u16* setupExitList;
|
||||
/* 0x18864 */ Path* setupPathList;
|
||||
|
||||
@@ -89,10 +89,10 @@ typedef struct CollisionPoly {
|
||||
} CollisionPoly; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 cameraSType;
|
||||
/* 0x02 */ s16 unk_02;
|
||||
/* 0x04 */ Vec3s* camPosData;
|
||||
} CamData;
|
||||
/* 0x0 */ u16 setting;
|
||||
/* 0x2 */ s16 numData;
|
||||
/* 0x4 */ Vec3s* data;
|
||||
} CamData; // size = 0x8 (BgCamData)
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ Vec3s minPos;
|
||||
|
||||
+7
-5
@@ -290,7 +290,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
struct {
|
||||
s8 room; // Room to switch to
|
||||
s8 effects; // How the camera reacts during the transition
|
||||
s8 bgCamDataId; // How the camera reacts during the transition. -2 for spiral staircase. -1 for generic door. 0+ will index scene CamData
|
||||
} /* 0x00 */ sides[2]; // 0 = front, 1 = back
|
||||
/* 0x04 */ s16 id;
|
||||
/* 0x06 */ Vec3s pos;
|
||||
@@ -496,10 +496,12 @@ typedef struct {
|
||||
} MinimapChest; // size = 0xA
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 type;
|
||||
/* 0x00 */ s16 numPoints;
|
||||
/* 0x00 */ Vec3s* points;
|
||||
} CsCameraEntry;
|
||||
/* 0x0 */ s16 setting;
|
||||
/* 0x2 */ s16 numData;
|
||||
/* 0x4 */ Vec3s* data;
|
||||
} CsCamData; // size = 0x8
|
||||
|
||||
typedef CsCamData CsCameraEntry; // TODO: Remove once ZAPD updates its structs
|
||||
|
||||
typedef union {
|
||||
/* Command: N/A */ SCmdBase base;
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017D220.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017D2FC.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_LineSegVsPlane.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017D404.s")
|
||||
|
||||
|
||||
+3
-3
@@ -1279,7 +1279,7 @@ f32 Actor_HeightDiff(Actor* actor1, Actor* actor2) {
|
||||
* Sets the current and new inputs.
|
||||
*/
|
||||
void func_800B6F20(GlobalContext* globalCtx, Input* input, f32 magnitude, s16 baseYaw) {
|
||||
s16 relativeYaw = baseYaw - func_800DFC68(GET_ACTIVE_CAM(globalCtx));
|
||||
s16 relativeYaw = baseYaw - Camera_GetInputDirYaw(GET_ACTIVE_CAM(globalCtx));
|
||||
|
||||
input->cur.stick_x = -Math_SinS(relativeYaw) * magnitude;
|
||||
input->rel.stick_x = input->cur.stick_x;
|
||||
@@ -1341,7 +1341,7 @@ void Actor_SetCameraHorseSetting(GlobalContext* globalCtx, Player* player) {
|
||||
EnHorse* rideActor = (EnHorse*)player->rideActor;
|
||||
|
||||
if ((rideActor != NULL) && !(rideActor->unk_1EC & 0x10)) {
|
||||
func_800DFAC8(Play_GetCamera(globalCtx, MAIN_CAM), 4);
|
||||
func_800DFAC8(Play_GetCamera(globalCtx, CAM_ID_MAIN), 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3329,7 +3329,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC
|
||||
|
||||
if ((player != NULL) && (actor == player->unk_730)) {
|
||||
func_80123DA4(player);
|
||||
Camera_ChangeMode(Play_GetCamera(globalCtx, Play_GetActiveCameraIndex(globalCtx)), 0);
|
||||
Camera_ChangeMode(Play_GetCamera(globalCtx, Play_GetActiveCamId(globalCtx)), 0);
|
||||
}
|
||||
|
||||
if (actor == actorCtx->targetContext.arrowPointedActor) {
|
||||
|
||||
@@ -4047,7 +4047,7 @@ u16 func_800C9728(CollisionContext* colCtx, u32 camId, s32 bgId) {
|
||||
return 0;
|
||||
}
|
||||
camData = colHeader->cameraDataList;
|
||||
result = camData[camId].cameraSType;
|
||||
result = camData[camId].setting;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -4088,7 +4088,7 @@ u16 func_800C97F8(CollisionContext* colCtx, u32 camId, s32 bgId) {
|
||||
if (camData == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return camData[camId].unk_02;
|
||||
return camData[camId].numData;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4114,7 +4114,7 @@ u16 func_800C9844(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
|
||||
}
|
||||
|
||||
/**
|
||||
* CamData get camPosData
|
||||
* CamData get data
|
||||
*/
|
||||
Vec3s* func_800C98CC(CollisionContext* colCtx, s32 camId, s32 bgId) {
|
||||
CollisionHeader* colHeader = BgCheck_GetCollisionHeader(colCtx, bgId);
|
||||
@@ -4127,11 +4127,11 @@ Vec3s* func_800C98CC(CollisionContext* colCtx, s32 camId, s32 bgId) {
|
||||
if (cameraDataList == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return Lib_SegmentedToVirtual(cameraDataList[camId].camPosData);
|
||||
return Lib_SegmentedToVirtual(cameraDataList[camId].data);
|
||||
}
|
||||
|
||||
/**
|
||||
* SurfaceType Get camPosData
|
||||
* SurfaceType Get data
|
||||
*/
|
||||
Vec3s* SurfaceType_GetCamPosData(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
|
||||
CollisionHeader* colHeader = BgCheck_GetCollisionHeader(colCtx, bgId);
|
||||
@@ -4573,7 +4573,7 @@ u16 WaterBox_GetCameraSetting(CollisionContext* colCtx, WaterBox* waterBox, s32
|
||||
return result;
|
||||
}
|
||||
|
||||
result = camData[camId].cameraSType;
|
||||
result = camData[camId].setting;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -320,19 +320,19 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFAC8.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFB14.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ChangeDataIdx.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFC1C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFC40.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFC68.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_GetInputDirYaw.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFC90.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFCB4.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_GetCamDirPitch.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFCDC.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_GetCamDirYaw.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFD04.s")
|
||||
|
||||
@@ -364,10 +364,10 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E0238.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E02AC.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_SetToTrackActor.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E0308.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_SetTargetActor.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E031C.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_GetWaterYPos.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E0348.s")
|
||||
|
||||
@@ -255,9 +255,12 @@ void EffectSS_DrawAllParticles(GlobalContext* globalCtx) {
|
||||
|
||||
for (i = 0; i < sEffectSsInfo.size; i++) {
|
||||
if (sEffectSsInfo.data_table[i].life > -1) {
|
||||
if ((sEffectSsInfo.data_table[i].pos.x > 32000.0f) || (sEffectSsInfo.data_table[i].pos.x < -32000.0f) ||
|
||||
(sEffectSsInfo.data_table[i].pos.y > 32000.0f) || (sEffectSsInfo.data_table[i].pos.y < -32000.0f) ||
|
||||
(sEffectSsInfo.data_table[i].pos.z > 32000.0f) || (sEffectSsInfo.data_table[i].pos.z < -32000.0f)) {
|
||||
if ((sEffectSsInfo.data_table[i].pos.x > BGCHECK_Y_MAX) ||
|
||||
(sEffectSsInfo.data_table[i].pos.x < BGCHECK_Y_MIN) ||
|
||||
(sEffectSsInfo.data_table[i].pos.y > BGCHECK_Y_MAX) ||
|
||||
(sEffectSsInfo.data_table[i].pos.y < BGCHECK_Y_MIN) ||
|
||||
(sEffectSsInfo.data_table[i].pos.z > BGCHECK_Y_MAX) ||
|
||||
(sEffectSsInfo.data_table[i].pos.z < BGCHECK_Y_MIN)) {
|
||||
EffectSS_Delete(&sEffectSsInfo.data_table[i]);
|
||||
} else {
|
||||
EffectSS_DrawParticle(globalCtx, i);
|
||||
|
||||
@@ -157,7 +157,7 @@ void FireObj_Draw(GlobalContext* globalCtx, FireObj* fire) {
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, lightParams->envColor.r, lightParams->envColor.g, lightParams->envColor.b, 0);
|
||||
|
||||
vec.x = 0;
|
||||
vec.y = func_800DFCDC(GET_ACTIVE_CAM(globalCtx)) + 0x8000;
|
||||
vec.y = Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x8000;
|
||||
vec.z = 0;
|
||||
Matrix_SetStateRotationAndTranslation(fire->position.x, fire->position.y, fire->position.z, &vec);
|
||||
Matrix_Scale(fire->xScale, fire->yScale, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
|
||||
void (*sKaleidoScopeUpdateFunc)(GlobalContext* globalCtx);
|
||||
|
||||
+1
-1
@@ -371,7 +371,7 @@ void Math_Vec3f_DistXYZAndStoreNormDiff(Vec3f* a, Vec3f* b, f32 scale, Vec3f* de
|
||||
f32 Math_Vec3f_DistXYZ(Vec3f* a, Vec3f* b) {
|
||||
Vec3f diff;
|
||||
Math_Vec3f_Diff(b, a, &diff);
|
||||
return sqrtf(SQ(diff.x) + SQ(diff.y) + SQ(diff.z));
|
||||
return sqrtf(SQXYZ(diff));
|
||||
}
|
||||
|
||||
f32 Math_Vec3f_DistXYZAndStoreDiff(Vec3f* a, Vec3f* b, Vec3f* dest) {
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b) {
|
||||
v1.y = b->y - a->y;
|
||||
v1.z = b->z - a->z;
|
||||
|
||||
dist = OLib_ClampMinDist(sqrtf(SQ(v1.x) + SQ(v1.y) + SQ(v1.z)), 0.01f);
|
||||
dist = OLib_ClampMinDist(sqrtf(SQXYZ(v1)), 0.01f);
|
||||
|
||||
v2.x = v1.x / dist;
|
||||
v2.y = v1.y / dist;
|
||||
|
||||
+13
-13
@@ -74,41 +74,41 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169474.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_801694DC.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CreateSubCamera.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_GetActiveCameraIndex.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_GetActiveCamId.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169590.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraChangeStatus.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169600.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_ClearCamera.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169668.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_ClearAllSubCameras.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_GetCamera.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraSetAtEye.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_8016981C.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraSetAtEyeUp.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169940.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraSetFov.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169988.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraSetRoll.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_801699D4.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CopyCamera.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169A50.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169AC0.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraChangeSetting.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169AFC.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169BC4.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraGetUID.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169BF8.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169C64.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_GetCsCamDataSetting.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169C84.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_GetCsCamDataVec3s.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/convert_scene_number_among_shared_scenes.s")
|
||||
|
||||
|
||||
+3
-3
@@ -137,7 +137,7 @@ QuakeRequest* Quake_AddImpl(Camera* camera, u32 callbackIdx) {
|
||||
|
||||
__osMemset(req, 0, sizeof(QuakeRequest));
|
||||
req->camera = camera;
|
||||
req->cameraPtrsIdx = camera->thisIdx;
|
||||
req->camId = camera->camId;
|
||||
req->callbackIdx = callbackIdx;
|
||||
req->isShakePerpendicular = true;
|
||||
req->randIdx = ((s16)(Rand_ZeroOne() * (f32)0x10000) & ~3) + idx;
|
||||
@@ -326,10 +326,10 @@ s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData) {
|
||||
for (idx = 0; idx < ARRAY_COUNT(sQuakeRequest); idx++) {
|
||||
req = &sQuakeRequest[idx];
|
||||
if (req->callbackIdx != 0) {
|
||||
if (globalCtx->cameraPtrs[req->cameraPtrsIdx] == NULL) {
|
||||
if (globalCtx->cameraPtrs[req->camId] == NULL) {
|
||||
Quake_Remove(req);
|
||||
} else {
|
||||
eq = (camera->thisIdx != req->camera->thisIdx);
|
||||
eq = (camera->camId != req->camera->camId);
|
||||
absSpeedDiv = ABS(req->speed) / (f32)0x8000;
|
||||
if (sQuakeCallbacks[req->callbackIdx](req, &shake) == 0) {
|
||||
Quake_Remove(req);
|
||||
|
||||
+3
-3
@@ -179,7 +179,7 @@ void Scene_HeaderCmdActorList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
|
||||
// SceneTableEntry Header Command 0x02: List of cameras for actor cutscenes
|
||||
void Scene_HeaderCmdActorCutsceneCamList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->unk_18858 = (UNK_PTR)Lib_SegmentedToVirtual(cmd->csCameraList.segment);
|
||||
globalCtx->csCamData = Lib_SegmentedToVirtual(cmd->csCameraList.segment);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x03: Collision Header
|
||||
@@ -374,8 +374,8 @@ void Scene_HeaderCmdSkyboxSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
|
||||
// SceneTableEntry Header Command 0x12: Skybox Disables
|
||||
void Scene_HeaderCmdSkyboxDisables(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->envCtx.unk_15 = cmd->skyboxDisables.unk4;
|
||||
globalCtx->envCtx.unk_16 = cmd->skyboxDisables.unk5;
|
||||
globalCtx->envCtx.skyboxDisabled = cmd->skyboxDisables.unk4;
|
||||
globalCtx->envCtx.sunMoonDisabled = cmd->skyboxDisables.unk5;
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x10: Time Settings
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* File: z_shrink_window.c
|
||||
* Description: Draws black top/bottom/side borders on the viewing window (e.g. Z-targeting, talking to NPC)
|
||||
*/
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
|
||||
ShrinkWindowContext gShrinkWindowContext;
|
||||
|
||||
+3
-5
@@ -114,21 +114,19 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
|
||||
s16 y;
|
||||
f32 distance;
|
||||
CollisionPoly* poly;
|
||||
Camera* camera;
|
||||
Camera* camera = GET_ACTIVE_CAM(globalCtx);
|
||||
Actor* actors[2];
|
||||
s32 ret = 0;
|
||||
s32 bgId;
|
||||
|
||||
camera = GET_ACTIVE_CAM(globalCtx);
|
||||
|
||||
distance = OLib_Vec3fDist(pos, &camera->eye);
|
||||
if ((distance < distanceMin) || (distanceMax < distance)) {
|
||||
func_8013A41C(0x3F);
|
||||
ret = 0x3F;
|
||||
}
|
||||
|
||||
x = func_8013A504(func_800DFCB4(camera) + rot->x);
|
||||
y = func_8013A504(func_800DFCDC(camera) - (s16)(rot->y - 0x7FFF));
|
||||
x = func_8013A504(Camera_GetCamDirPitch(camera) + rot->x);
|
||||
y = func_8013A504(Camera_GetCamDirYaw(camera) - BINANG_SUB(rot->y, 0x7FFF));
|
||||
if ((0 < angleError) && ((angleError < x) || (angleError < y))) {
|
||||
func_8013A41C(0x3E);
|
||||
ret |= 0x3E;
|
||||
|
||||
@@ -170,7 +170,8 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
|
||||
} else {
|
||||
if (this->actor.child != NULL) {
|
||||
f32 sp94 = Actor_DistanceBetweenActors(&this->actor, grabbed);
|
||||
f32 sp90 = sqrtf(SQ(this->unk1FC.x) + SQ(this->unk1FC.y) + SQ(this->unk1FC.z));
|
||||
f32 sp90 = sqrtf(SQXYZ(this->unk1FC));
|
||||
|
||||
Math_Vec3f_Diff(&grabbed->world.pos, &this->unk1FC, &this->actor.world.pos);
|
||||
if (50.0f < (sp94 - sp90)) {
|
||||
ArmsHook_DetachHookFromActor(this);
|
||||
@@ -217,8 +218,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
} else {
|
||||
Math_Vec3f_Diff(&bodyDistDiffVec, &newPos, &player->actor.velocity);
|
||||
player->actor.world.rot.x =
|
||||
Math_FAtan2F(sqrtf(SQ(bodyDistDiffVec.x) + SQ(bodyDistDiffVec.z)), -bodyDistDiffVec.y);
|
||||
player->actor.world.rot.x = Math_FAtan2F(sqrtf(SQXZ(bodyDistDiffVec)), -bodyDistDiffVec.y);
|
||||
}
|
||||
if (phi_f16 < 50.0f) {
|
||||
ArmsHook_DetachHookFromActor(this);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user