1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 09:45:02 +00:00

Struct Returns (#1574)

* change args

* PR Review

* format
This commit is contained in:
engineer124 2023-11-20 03:17:31 +11:00 committed by GitHub
parent 3d1ee33d7b
commit aef0335681
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 425 additions and 481 deletions

View file

@ -391,9 +391,9 @@ Hilite* func_8002EABC(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContex
Hilite* func_8002EB44(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx);
void func_8002EBCC(Actor* actor, PlayState* play, s32 flag);
void func_8002ED80(Actor* actor, PlayState* play, s32 flag);
PosRot* Actor_GetFocus(PosRot* dest, Actor* actor);
PosRot* Actor_GetWorld(PosRot* dest, Actor* actor);
PosRot* Actor_GetWorldPosShapeRot(PosRot* arg0, Actor* actor);
PosRot Actor_GetFocus(Actor* actor);
PosRot Actor_GetWorld(Actor* actor);
PosRot Actor_GetWorldPosShapeRot(Actor* actor);
s32 func_8002F0C8(Actor* actor, Player* player, s32 flag);
s32 Actor_TalkOfferAccepted(Actor* actor, PlayState* play);
s32 Actor_OfferTalkExchange(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, u32 exchangeItemId);
@ -639,7 +639,7 @@ s32 Camera_CheckValidMode(Camera* camera, s16 mode);
s32 Camera_RequestSetting(Camera* camera, s16 setting);
s32 Camera_RequestBgCam(Camera* camera, s32 requestedBgCamIndex);
s16 Camera_GetInputDirYaw(Camera* camera);
Vec3s* Camera_GetCamDir(Vec3s* dst, Camera* camera);
Vec3s Camera_GetCamDir(Camera* camera);
s16 Camera_GetCamDirPitch(Camera* camera);
s16 Camera_GetCamDirYaw(Camera* camera);
s32 Camera_RequestQuake(Camera* camera, s32 unused, s16 y, s32 duration);
@ -653,7 +653,7 @@ s32 Camera_SetCSParams(Camera* camera, CutsceneCameraPoint* atPoints, CutsceneCa
s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2,
s16 timer3);
s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera);
Vec3f* Camera_GetQuakeOffset(Vec3f* quakeOffset, Camera* camera);
Vec3f Camera_GetQuakeOffset(Camera* camera);
void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* data1, s16 data2, s16 data3,
UNK_TYPE arg6);
s32 func_8005B198(void);
@ -923,12 +923,12 @@ f32 OLib_Vec3fDist(Vec3f* a, Vec3f* b);
f32 OLib_Vec3fDistXZ(Vec3f* a, Vec3f* b);
f32 OLib_ClampMinDist(f32 val, f32 min);
f32 OLib_ClampMaxDist(f32 val, f32 max);
Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b);
Vec3f* OLib_VecGeoToVec3f(Vec3f* dest, VecGeo* geo);
VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec);
VecGeo* OLib_Vec3fToVecGeo(VecGeo* dest, Vec3f* vec);
VecGeo* OLib_Vec3fDiffToVecGeo(VecGeo* dest, Vec3f* a, Vec3f* b);
Vec3f* OLib_Vec3fDiffRad(Vec3f* dest, Vec3f* a, Vec3f* b);
Vec3f OLib_Vec3fDistNormalize(Vec3f* a, Vec3f* b);
Vec3f OLib_VecGeoToVec3f(VecGeo* geo);
VecSph OLib_Vec3fToVecSph(Vec3f* vec);
VecGeo OLib_Vec3fToVecGeo(Vec3f* vec);
VecGeo OLib_Vec3fDiffToVecGeo(Vec3f* a, Vec3f* b);
Vec3f OLib_Vec3fDiffRad(Vec3f* a, Vec3f* b);
s16 OnePointCutscene_Init(PlayState* play, s16 csId, s16 timer, Actor* actor, s16 parentCamId);
s16 OnePointCutscene_EndCutscene(PlayState* play, s16 subCamId);
s32 OnePointCutscene_Attention(PlayState* play, Actor* actor);

View file

@ -95,25 +95,21 @@ static DebugCam* sDebugCamPtr;
static s16 D_8016110C;
static DebugCamAnim sDebugCamAnim;
Vec3f* DebugCamera_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo) {
Vec3f DebugCamera_AddVecGeoToVec3f(Vec3f* a, VecGeo* geo) {
Vec3f sum;
Vec3f b;
OLib_VecGeoToVec3f(&b, geo);
Vec3f b = OLib_VecGeoToVec3f(geo);
sum.x = a->x + b.x;
sum.y = a->y + b.y;
sum.z = a->z + b.z;
*dest = sum;
return dest;
return sum;
}
/**
* Calculates a new Up vector from the pitch, yaw, roll
*/
Vec3f* DebugCamera_CalcUpFromPitchYawRoll(Vec3f* viewUp, s16 pitch, s16 yaw, s16 roll) {
Vec3f DebugCamera_CalcUpFromPitchYawRoll(s16 pitch, s16 yaw, s16 roll) {
f32 sinP = Math_SinS(pitch);
f32 cosP = Math_CosS(pitch);
f32 sinY = Math_SinS(yaw);
@ -155,9 +151,7 @@ Vec3f* DebugCamera_CalcUpFromPitchYawRoll(Vec3f* viewUp, s16 pitch, s16 yaw, s16
up.y = DOTXYZ(baseUp, rollMtxRow2);
up.z = DOTXYZ(baseUp, rollMtxRow3);
*viewUp = up;
return viewUp;
return up;
}
char* DebugCamera_SetTextValue(s16 value, char* str, u8 endIdx) {
@ -221,9 +215,9 @@ void func_800B3F94(PosRot* posRot, Vec3f* vec, Vec3s* out) {
VecGeo geo;
Vec3f tempVec;
OLib_Vec3fDiffToVecGeo(&geo, &posRot->pos, vec);
geo = OLib_Vec3fDiffToVecGeo(&posRot->pos, vec);
geo.yaw -= posRot->rot.y;
OLib_VecGeoToVec3f(&tempVec, &geo);
tempVec = OLib_VecGeoToVec3f(&geo);
DebugCamera_Vec3FToS(&tempVec, out);
}
@ -232,9 +226,9 @@ void func_800B3FF4(PosRot* posRot, Vec3f* vec, Vec3f* out) {
Vec3f tempVec;
DebugCamera_CopyVec3f(vec, &tempVec);
OLib_Vec3fToVecGeo(&geo, &tempVec);
geo = OLib_Vec3fToVecGeo(&tempVec);
geo.yaw += posRot->rot.y;
DebugCamera_AddVecGeoToVec3f(out, &posRot->pos, &geo);
*out = DebugCamera_AddVecGeoToVec3f(&posRot->pos, &geo);
}
void func_800B404C(PosRot* posRot, Vec3s* vec, Vec3f* out) {
@ -335,7 +329,7 @@ s32 func_800B4370(DebugCam* debugCam, s16 idx, Camera* cam) {
geo.pitch = 0x2000;
geo.yaw -= 0x7FFF;
geo.r = 250.0f;
DebugCamera_AddVecGeoToVec3f(&debugCam->eye, &debugCam->at, &geo);
debugCam->eye = DebugCamera_AddVecGeoToVec3f(&debugCam->at, &geo);
debugCam->roll = lookAt->cameraRoll;
debugCam->rollDegrees = debugCam->roll * (360.0f / 256.0f);
debugCam->fov = lookAt->viewAngle;
@ -668,9 +662,9 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
phi_s0 = sp124;
if (!D_80161144) {
OLib_Vec3fDiffToVecGeo(&sp104, sp7C, sp80);
sp104 = OLib_Vec3fDiffToVecGeo(sp7C, sp80);
} else {
OLib_Vec3fDiffToVecGeo(&sp104, sp80, sp7C);
sp104 = OLib_Vec3fDiffToVecGeo(sp80, sp7C);
}
if (debugCam->unk_44 > 100) {
@ -706,11 +700,11 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.r = temp_f2;
if (!D_80161144) {
spFC.yaw = sp104.yaw;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
*sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else {
spFC.pitch = -spFC.pitch;
spFC.yaw = sp104.yaw - 0x7FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
*sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
}
if (debugCam->unk_40 == 0xB) {
debugCam->unk_44++;
@ -734,11 +728,11 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.r = -temp_f2;
if (!D_80161144) {
spFC.yaw = sp104.yaw;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
*sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else {
spFC.pitch = -spFC.pitch;
spFC.yaw = sp104.yaw - 0x7FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
*sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
}
if (debugCam->unk_40 == 0xC) {
debugCam->unk_44++;
@ -757,10 +751,10 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.pitch = 0;
if (!D_80161144) {
spFC.yaw = sp104.yaw;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
*sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else {
spFC.yaw = sp104.yaw - 0x7FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
*sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
}
if (debugCam->unk_40 == 1) {
@ -775,10 +769,10 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.pitch = 0;
if (!D_80161144) {
spFC.yaw = sp104.yaw;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
*sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else {
spFC.yaw = sp104.yaw - 0x7FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
*sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
}
if (debugCam->unk_40 == 2) {
debugCam->unk_44++;
@ -792,9 +786,9 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.pitch = 0x3FFF;
spFC.yaw = sp104.yaw;
if (!D_80161144) {
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
*sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else {
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
*sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
}
if (debugCam->unk_40 == 3) {
debugCam->unk_44++;
@ -808,9 +802,9 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.pitch = -0x3FFF;
spFC.yaw = sp104.yaw;
if (!D_80161144) {
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
*sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else {
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
*sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
}
if (debugCam->unk_40 == 4) {
debugCam->unk_44++;
@ -825,10 +819,10 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.pitch = 0;
if (!D_80161144) {
spFC.yaw = sp104.yaw + 0x3FFF;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
*sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else {
spFC.yaw = sp104.yaw - 0x3FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
*sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
}
if (debugCam->unk_40 == 5) {
debugCam->unk_44++;
@ -843,10 +837,10 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.pitch = 0;
if (!D_80161144) {
spFC.yaw = sp104.yaw - 0x3FFF;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
*sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else {
spFC.yaw = sp104.yaw + 0x3FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
*sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
}
if (debugCam->unk_40 == 6) {
debugCam->unk_44++;
@ -870,11 +864,11 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.r = temp_f2;
if (!D_80161144) {
spFC.yaw = sp104.yaw;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
*sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else {
spFC.pitch = -spFC.pitch;
spFC.yaw = sp104.yaw - 0x7FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
*sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
}
if (debugCam->unk_40 == 0xB) {
debugCam->unk_44++;
@ -899,11 +893,11 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.r = -temp_f2;
if (!D_80161144) {
spFC.yaw = sp104.yaw;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
*sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else {
spFC.pitch = -spFC.pitch;
spFC.yaw = sp104.yaw - 0x7FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
*sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
}
if (debugCam->unk_40 == 0xC) {
debugCam->unk_44++;
@ -961,20 +955,20 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
if (!D_80161144) {
sp104.pitch += (s16)((temp_f0_5 >= 0.0f) ? pitch : -pitch);
sp104.yaw += (s16)((temp_f2_2 >= 0.0f) ? yaw : -yaw);
DebugCamera_AddVecGeoToVec3f(sp80, sp7C, &sp104);
*sp80 = DebugCamera_AddVecGeoToVec3f(sp7C, &sp104);
debugCam->sub.unk_104A.x = -sp104.pitch;
debugCam->sub.unk_104A.y = sp104.yaw - 0x7FFF;
} else {
sp104.pitch += (s16)((temp_f0_5 >= 0.0f) ? -pitch : pitch);
sp104.yaw += (s16)((temp_f2_2 >= 0.0f) ? -yaw : yaw);
DebugCamera_AddVecGeoToVec3f(sp7C, sp80, &sp104);
*sp7C = DebugCamera_AddVecGeoToVec3f(sp80, &sp104);
debugCam->sub.unk_104A.x = sp104.pitch;
debugCam->sub.unk_104A.y = sp104.yaw;
}
OLib_Vec3fDiffToVecGeo(&spF4, sp80, sp7C);
DebugCamera_CalcUpFromPitchYawRoll(&debugCam->unk_1C, spF4.pitch, spF4.yaw,
CAM_DEG_TO_BINANG(debugCam->rollDegrees));
spF4 = OLib_Vec3fDiffToVecGeo(sp80, sp7C);
debugCam->unk_1C =
DebugCamera_CalcUpFromPitchYawRoll(spF4.pitch, spF4.yaw, CAM_DEG_TO_BINANG(debugCam->rollDegrees));
if (debugCam->unk_00 == 1) {
if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_CRIGHT)) {
cam->inputDir = debugCam->sub.unk_104A;
@ -982,7 +976,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
cam->at = *sp7C;
spFC = sp104;
spFC.r = new_var2;
DebugCamera_AddVecGeoToVec3f(&cam->eye, &cam->at, &spFC);
cam->eye = DebugCamera_AddVecGeoToVec3f(&cam->at, &spFC);
}
}
}
@ -1380,7 +1374,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
DebugCamera_ScreenTextColored(30, 25, DEBUG_CAM_TEXT_BROWN, &sp110);
} else {
if (D_8012CEE0[0]) {}
OLib_Vec3fDiffToVecGeo(&spFC, sp90, sp7C);
spFC = OLib_Vec3fDiffToVecGeo(sp90, sp7C);
spFC.yaw -= cam->playerPosRot.rot.y;
DebugCamera_ScreenTextColored(
3, 22,
@ -1394,7 +1388,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
DebugCamera_ScreenTextColored(3, 24, DEBUG_CAM_TEXT_ORANGE, D_8012D0F8);
DebugCamera_SetTextValue(spFC.r, &D_8012D0D4[7], 6);
DebugCamera_ScreenTextColored(3, 25, DEBUG_CAM_TEXT_ORANGE, D_8012D0D4);
OLib_Vec3fDiffToVecGeo(&spFC, sp90, sp80);
spFC = OLib_Vec3fDiffToVecGeo(sp90, sp80);
spFC.yaw -= cam->playerPosRot.rot.y;
DebugCamera_ScreenTextColored(30, 22,
((debugCam->sub.unk_08 == 1) && (debugCam->sub.unk_0A == 4) && D_80161144)
@ -1425,7 +1419,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
func_800B404C(temp_s6, &(debugCam->sub.lookAt + i)->pos, &spB8);
func_800B404C(temp_s6, &(debugCam->sub.position + i)->pos, &spAC);
}
OLib_Vec3fDiffToVecGeo(&spFC, &spAC, &spB8);
spFC = OLib_Vec3fDiffToVecGeo(&spAC, &spB8);
spAA = debugCam->sub.lookAt[i].cameraRoll * 0xB6;
if (i == debugCam->sub.unkIdx) {
DebugDisplay_AddObject(spAC.x, spAC.y, spAC.z, spFC.pitch * -1, spFC.yaw, spAA, .5f, .5f, .5f,
@ -1496,7 +1490,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
D_8012D110++;
D_8012D110 %= 50;
OLib_Vec3fDiffToVecGeo(&spA0, &cam->eye, &cam->at);
spA0 = OLib_Vec3fDiffToVecGeo(&cam->eye, &cam->at);
DebugDisplay_AddObject(debugCam->at.x, debugCam->at.y + 1.0f, debugCam->at.z, 0, 0, 0, 0.02f, 2.0f, 0.02f, 0xFF,
0xFF, 0x7F, 0x2D, 0, cam->play->view.gfxCtx);
DebugDisplay_AddObject(debugCam->at.x, debugCam->at.y + 1.0f, debugCam->at.z, 0, 0, 0, 2.0f, 0.02f, 0.02f, 0x7F,
@ -1507,7 +1501,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
0x7F, 0x7F, 0x80, 5, cam->play->view.gfxCtx);
DebugDisplay_AddObject(cam->at.x, cam->at.y, cam->at.z, spA0.pitch * -1, spA0.yaw, 0, 1.5f, 2.0f, 1.0f, 0xFF,
0x7F, 0x7F, 0x80, 4, cam->play->view.gfxCtx);
OLib_Vec3fDiffToVecGeo(&spA0, &cam->eyeNext, &cam->at);
spA0 = OLib_Vec3fDiffToVecGeo(&cam->eyeNext, &cam->at);
DebugDisplay_AddObject(cam->eyeNext.x, cam->eyeNext.y, cam->eyeNext.z, spA0.pitch * -1, spA0.yaw, 0, .5f, .5f,
.5f, 0xFF, 0xC0, 0x7F, 0x50, 5, cam->play->view.gfxCtx);
}
@ -2183,9 +2177,9 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) {
Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
OLib_Vec3fDiffToVecGeo(&sp5C, &debugCam->eye, &debugCam->at);
DebugCamera_CalcUpFromPitchYawRoll(&debugCam->unk_1C, sp5C.pitch, sp5C.yaw,
CAM_DEG_TO_BINANG(debugCam->rollDegrees));
sp5C = OLib_Vec3fDiffToVecGeo(&debugCam->eye, &debugCam->at);
debugCam->unk_1C =
DebugCamera_CalcUpFromPitchYawRoll(sp5C.pitch, sp5C.yaw, CAM_DEG_TO_BINANG(debugCam->rollDegrees));
return 2;
}

View file

@ -1465,26 +1465,21 @@ void func_8002ED80(Actor* actor, PlayState* play, s32 flag) {
}
}
PosRot* Actor_GetFocus(PosRot* dest, Actor* actor) {
*dest = actor->focus;
return dest;
PosRot Actor_GetFocus(Actor* actor) {
return actor->focus;
}
PosRot* Actor_GetWorld(PosRot* dest, Actor* actor) {
*dest = actor->world;
return dest;
PosRot Actor_GetWorld(Actor* actor) {
return actor->world;
}
PosRot* Actor_GetWorldPosShapeRot(PosRot* arg0, Actor* actor) {
PosRot sp1C;
PosRot Actor_GetWorldPosShapeRot(Actor* actor) {
PosRot worldPosRot;
Math_Vec3f_Copy(&sp1C.pos, &actor->world.pos);
sp1C.rot = actor->shape.rot;
*arg0 = sp1C;
Math_Vec3f_Copy(&worldPosRot.pos, &actor->world.pos);
worldPosRot.rot = actor->shape.rot;
return arg0;
return worldPosRot;
}
f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) {

File diff suppressed because it is too large Load diff

View file

@ -50,7 +50,7 @@ f32 OLib_ClampMaxDist(f32 val, f32 max) {
/**
* Takes the difference of points b and a, and creates a normal vector
*/
Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b) {
Vec3f OLib_Vec3fDistNormalize(Vec3f* a, Vec3f* b) {
Vec3f v1;
Vec3f v2;
f32 dist;
@ -65,15 +65,13 @@ Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b) {
v2.y = v1.y / dist;
v2.z = v1.z / dist;
*dest = v2;
return dest;
return v2;
}
/**
* Takes the spherical coordinate `sph`, and converts it into a x,y,z position
*/
Vec3f* OLib_VecSphToVec3f(Vec3f* dest, VecSph* sph) {
Vec3f OLib_VecSphToVec3f(VecSph* sph) {
Vec3f v;
f32 sinPitch;
f32 cosPitch = Math_CosS(sph->pitch);
@ -87,28 +85,26 @@ Vec3f* OLib_VecSphToVec3f(Vec3f* dest, VecSph* sph) {
v.y = sph->r * cosPitch;
v.z = sph->r * sinPitch * cosYaw;
*dest = v;
return dest;
return v;
}
/**
* Takes the geographic point `geo` and converts it into a x,y,z position
*/
Vec3f* OLib_VecGeoToVec3f(Vec3f* dest, VecGeo* geo) {
Vec3f OLib_VecGeoToVec3f(VecGeo* geo) {
VecSph sph;
sph.r = geo->r;
sph.pitch = 0x3FFF - geo->pitch;
sph.yaw = geo->yaw;
return OLib_VecSphToVec3f(dest, &sph);
return OLib_VecSphToVec3f(&sph);
}
/**
* Takes the point `vec`, and converts it into a spherical coordinate
*/
VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) {
VecSph OLib_Vec3fToVecSph(Vec3f* vec) {
VecSph sph;
f32 distXZSq = SQ(vec->x) + SQ(vec->z);
f32 distXZ = sqrtf(distXZSq);
@ -126,98 +122,88 @@ VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) {
sph.yaw = CAM_DEG_TO_BINANG(RAD_TO_DEG(Math_FAtan2F(vec->x, vec->z)));
}
*dest = sph;
return dest;
return sph;
}
/**
* Takes the point `vec`, and converts it to a geographic coordinate
*/
VecGeo* OLib_Vec3fToVecGeo(VecGeo* dest, Vec3f* vec) {
VecGeo OLib_Vec3fToVecGeo(Vec3f* vec) {
VecSph sph;
OLib_Vec3fToVecSph(&sph, vec);
sph = OLib_Vec3fToVecSph(vec);
sph.pitch = 0x3FFF - sph.pitch;
*dest = sph;
return dest;
return sph;
}
/**
* Takes the differences of positions `a` and `b`, and converts them to spherical coordinates
*/
VecSph* OLib_Vec3fDiffToVecSph(VecSph* dest, Vec3f* a, Vec3f* b) {
VecSph OLib_Vec3fDiffToVecSph(Vec3f* a, Vec3f* b) {
Vec3f diff;
diff.x = b->x - a->x;
diff.y = b->y - a->y;
diff.z = b->z - a->z;
return OLib_Vec3fToVecSph(dest, &diff);
return OLib_Vec3fToVecSph(&diff);
}
/**
* Takes the difference of positions `a` and `b`, and converts them to geographic coordinates
*/
VecGeo* OLib_Vec3fDiffToVecGeo(VecGeo* dest, Vec3f* a, Vec3f* b) {
VecGeo OLib_Vec3fDiffToVecGeo(Vec3f* a, Vec3f* b) {
Vec3f diff;
diff.x = b->x - a->x;
diff.y = b->y - a->y;
diff.z = b->z - a->z;
return OLib_Vec3fToVecGeo(dest, &diff);
return OLib_Vec3fToVecGeo(&diff);
}
/**
* Gets the pitch/yaw of the vector formed from `b`-`a`, result is in radians
*/
Vec3f* OLib_Vec3fDiffRad(Vec3f* dest, Vec3f* a, Vec3f* b) {
Vec3f OLib_Vec3fDiffRad(Vec3f* a, Vec3f* b) {
Vec3f anglesRad;
anglesRad.x = Math_FAtan2F(b->z - a->z, b->y - a->y);
anglesRad.y = Math_FAtan2F(b->x - a->x, b->z - a->z);
anglesRad.z = 0;
*dest = anglesRad;
return dest;
return anglesRad;
}
/**
* Gets the pitch/yaw of the vector formed from `b`-`a`, result is in degrees
*/
Vec3f* OLib_Vec3fDiffDegF(Vec3f* dest, Vec3f* a, Vec3f* b) {
Vec3f OLib_Vec3fDiffDegF(Vec3f* a, Vec3f* b) {
Vec3f anglesRad;
Vec3f anglesDegrees;
OLib_Vec3fDiffRad(&anglesRad, a, b);
anglesRad = OLib_Vec3fDiffRad(a, b);
anglesDegrees.x = RAD_TO_DEG(anglesRad.x);
anglesDegrees.y = RAD_TO_DEG(anglesRad.y);
anglesDegrees.z = 0.0f;
*dest = anglesDegrees;
return dest;
return anglesDegrees;
}
/**
* Gets the pitch/yaw of the vector formed from `b`-`a`, result is in binary degrees
*/
Vec3s* OLib_Vec3fDiffBinAng(Vec3s* dest, Vec3f* a, Vec3f* b) {
Vec3s OLib_Vec3fDiffBinAng(Vec3f* a, Vec3f* b) {
Vec3f anglesRad;
Vec3s anglesBinAng;
OLib_Vec3fDiffRad(&anglesRad, a, b);
anglesRad = OLib_Vec3fDiffRad(a, b);
anglesBinAng.x = CAM_DEG_TO_BINANG(RAD_TO_DEG(anglesRad.x));
anglesBinAng.y = CAM_DEG_TO_BINANG(RAD_TO_DEG(anglesRad.y));
anglesBinAng.z = 0.0f;
*dest = anglesBinAng;
return dest;
return anglesBinAng;
}

View file

@ -9,19 +9,15 @@ static s32 sPrevFrameCs1100 = -4096;
#include "z_onepointdemo_data.inc.c"
Vec3f* OnePointCutscene_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo) {
Vec3f OnePointCutscene_AddVecGeoToVec3f(Vec3f* a, VecGeo* geo) {
Vec3f sum;
Vec3f b;
OLib_VecGeoToVec3f(&b, geo);
Vec3f b = OLib_VecGeoToVec3f(geo);
sum.x = a->x + b.x;
sum.y = a->y + b.y;
sum.z = a->z + b.z;
*dest = sum;
return dest;
return sum;
}
s16 OnePointCutscene_Vec3fYaw(Vec3f* vec1, Vec3f* vec2) {
@ -98,7 +94,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
D_80120964[0].atTargetInit = play->view.at;
D_80120964[0].eyeTargetInit = play->view.eye;
D_80120964[0].fovTargetInit = play->view.fovy;
OLib_Vec3fDiffToVecGeo(&spD0, &mainCam->at, &mainCam->eye);
spD0 = OLib_Vec3fDiffToVecGeo(&mainCam->at, &mainCam->eye);
D_80120964[1].eyeTargetInit.y = CAM_BINANG_TO_DEG(spD0.yaw);
D_80120964[1].timerInit = timer - 1;
@ -112,9 +108,9 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
D_801209B4[0].atTargetInit = D_801209B4[1].atTargetInit = play->view.at;
D_801209B4[0].eyeTargetInit = play->view.eye;
D_801209B4[0].fovTargetInit = D_801209B4[2].fovTargetInit = play->view.fovy;
OLib_Vec3fDiffToVecGeo(&spD0, &actor->focus.pos, &mainCam->at);
spD0 = OLib_Vec3fDiffToVecGeo(&actor->focus.pos, &mainCam->at);
spD0.r = mainCam->dist;
OnePointCutscene_AddVecGeoToVec3f(&D_801209B4[1].eyeTargetInit, &D_801209B4[1].atTargetInit, &spD0);
D_801209B4[1].eyeTargetInit = OnePointCutscene_AddVecGeoToVec3f(&D_801209B4[1].atTargetInit, &spD0);
D_801209B4[1].atTargetInit.y += 20.0f;
csInfo->keyFrames = D_801209B4;
@ -310,14 +306,14 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break;
case 4500:
Actor_GetFocus(&spA0, actor);
spA0 = Actor_GetFocus(actor);
spC0 = spA0.pos;
spC0.y = OnePointCutscene_RaycastDown(&play->colCtx, &spC0) + 40.0f;
spD0.r = 150.0f;
spD0.yaw = spA0.rot.y;
spD0.pitch = 0x3E8;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
@ -329,7 +325,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break;
case 2210:
OLib_Vec3fDiffToVecGeo(&spD0, &player->actor.world.pos, &actor->world.pos);
spD0 = OLib_Vec3fDiffToVecGeo(&player->actor.world.pos, &actor->world.pos);
D_801213B4[0].eyeTargetInit.y = D_801213B4[1].eyeTargetInit.y = D_801213B4[2].eyeTargetInit.y =
D_801213B4[2].atTargetInit.y = CAM_BINANG_TO_DEG(spD0.yaw);
if (Rand_ZeroOne() < 0.0f) {
@ -454,7 +450,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
case 3100:
VEC_SET(spB4, 0.0f, -280.0f, -1400.0f);
Actor_GetFocus(&spA0, actor);
spA0 = Actor_GetFocus(actor);
spC0 = spA0.pos;
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_PIVOT_VERTICAL);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
@ -556,14 +552,14 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break;
case 3170:
Actor_GetWorld(&spA0, actor);
spA0 = Actor_GetWorld(actor);
spC0 = spA0.pos;
spD0.pitch = -0x5DC;
spC0.y += 50.0f;
spD0.r = 250.0f;
Actor_GetWorld(&spA0, &player->actor);
spA0 = Actor_GetWorld(&player->actor);
spD0.yaw = OnePointCutscene_Vec3fYaw(&spC0, &spA0.pos) - 0x7D0;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
Play_CopyCamera(play, CAM_ID_MAIN, subCamId);
@ -573,12 +569,12 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break;
case 3160:
Actor_GetWorld(&spA0, actor);
spA0 = Actor_GetWorld(actor);
spC0 = spA0.pos;
spD0.pitch = 0;
spD0.yaw = spA0.rot.y;
spD0.r = 150.0f;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0;
@ -587,13 +583,13 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break;
case 3180:
Actor_GetWorldPosShapeRot(&spA0, actor);
spA0 = Actor_GetWorldPosShapeRot(actor);
spC0 = spA0.pos;
spC0.y += 120.0f;
spD0.r = 300.0f;
spD0.yaw = spA0.rot.y;
spD0.pitch = -0xAF0;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0;
@ -619,15 +615,15 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
subCam->roll = 0x1E;
subCam->fov = 75.0f;
Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8);
Actor_GetWorldPosShapeRot(&spA0, actor);
Actor_GetFocus(&sp8C, &player->actor);
spA0 = Actor_GetWorldPosShapeRot(actor);
sp8C = Actor_GetFocus(&player->actor);
spC0.x = sp8C.pos.x;
spC0.y = sp8C.pos.y + 70.0f;
spC0.z = sp8C.pos.z;
OLib_Vec3fDiffToVecGeo(&spD0, &spA0.pos, &sp8C.pos);
spD0 = OLib_Vec3fDiffToVecGeo(&spA0.pos, &sp8C.pos);
spD0.pitch = 0x5DC;
spD0.r = 120.0f;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
Play_SetCameraAtEye(play, CAM_ID_MAIN, &spC0, &spB4);
i = Quake_Request(subCam, QUAKE_TYPE_3);
@ -637,13 +633,13 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break;
case 6010:
Actor_GetWorld(&spA0, actor);
spA0 = Actor_GetWorld(actor);
spC0 = spA0.pos;
spD0.pitch = 0;
spC0.y += 70.0f;
spD0.yaw = spA0.rot.y + 0x7FFF;
spD0.r = 300.0f;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0;
@ -652,14 +648,14 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break;
case 3220:
Actor_GetFocus(&spA0, actor);
spA0 = Actor_GetFocus(actor);
spC0 = spA0.pos;
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_PIVOT_VERTICAL);
Actor_GetWorld(&spA0, &player->actor);
OLib_Vec3fDiffToVecGeo(&spD0, &spC0, &spA0.pos);
spA0 = Actor_GetWorld(&player->actor);
spD0 = OLib_Vec3fDiffToVecGeo(&spC0, &spA0.pos);
spD0.yaw += 0x3E8;
spD0.r = 400.0f;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
spB4.y = spA0.pos.y + 60.0f;
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0;
@ -681,7 +677,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
case 6001:
Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
Actor_GetWorld(&spA0, actor);
spA0 = Actor_GetWorld(actor);
if (spA0.pos.z > -750.0f) {
OnePointCutscene_SetCsCamPoints(subCam, D_801208E8, D_801208E4, D_801206A0, D_80120820);
} else {
@ -732,7 +728,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
D_80121F1C[0].atTargetInit = play->view.at;
D_80121F1C[0].eyeTargetInit = play->view.eye;
D_80121F1C[0].fovTargetInit = play->view.fovy;
Actor_GetFocus(&spA0, actor);
spA0 = Actor_GetFocus(actor);
player->actor.shape.rot.y = player->actor.world.rot.y = player->yaw = spA0.rot.y;
csInfo->keyFrames = D_80121F1C;
@ -1002,8 +998,8 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break;
case 8700:
Actor_GetFocus(&spA0, actor);
Actor_GetFocus(&sp8C, &player->actor);
spA0 = Actor_GetFocus(actor);
sp8C = Actor_GetFocus(&player->actor);
D_80122E44[timer & 1][0].atTargetInit.y = ((spA0.pos.y - sp8C.pos.y) / 10.0f) + 90.0f;
D_80122E44[timer & 1][5].atTargetInit = mainCam->at;
@ -1052,13 +1048,13 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
if (player->stateFlags1 & PLAYER_STATE1_27) {
D_801231B4[2].atTargetInit.z = 0.0f;
}
Actor_GetWorldPosShapeRot(&spA0, &player->actor);
OLib_Vec3fDiffToVecGeo(&spD0, &spA0.pos, &mainCam->at);
spA0 = Actor_GetWorldPosShapeRot(&player->actor);
spD0 = OLib_Vec3fDiffToVecGeo(&spA0.pos, &mainCam->at);
spD0.yaw -= spA0.rot.y;
OLib_VecGeoToVec3f(&D_801231B4[3].atTargetInit, &spD0);
OLib_Vec3fDiffToVecGeo(&spD0, &spA0.pos, &mainCam->eye);
D_801231B4[3].atTargetInit = OLib_VecGeoToVec3f(&spD0);
spD0 = OLib_Vec3fDiffToVecGeo(&spA0.pos, &mainCam->eye);
spD0.yaw -= spA0.rot.y;
OLib_VecGeoToVec3f(&D_801231B4[3].eyeTargetInit, &spD0);
D_801231B4[3].eyeTargetInit = OLib_VecGeoToVec3f(&spD0);
D_801231B4[3].fovTargetInit = mainCam->fov;
D_801231B4[3].timerInit = timer - 50;

View file

@ -1200,7 +1200,7 @@ void Play_Draw(PlayState* this) {
(GET_ACTIVE_CAM(this)->setting != CAM_SET_PREREND_FIXED)) {
Vec3f quakeOffset;
Camera_GetQuakeOffset(&quakeOffset, GET_ACTIVE_CAM(this));
quakeOffset = Camera_GetQuakeOffset(GET_ACTIVE_CAM(this));
Skybox_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x + quakeOffset.x,
this->view.eye.y + quakeOffset.y, this->view.eye.z + quakeOffset.z);
}

View file

@ -22,18 +22,15 @@ QuakeRequest sQuakeRequests[4];
s16 sQuakeUnused = 1;
s16 sQuakeRequestCount = 0;
Vec3f* Quake_AddVecGeoToVec3f(Vec3f* dst, Vec3f* a, VecGeo* geo) {
Vec3f vec;
Vec3f b;
Vec3f Quake_AddVecGeoToVec3f(Vec3f* a, VecGeo* geo) {
Vec3f sum;
Vec3f b = OLib_VecGeoToVec3f(geo);
OLib_VecGeoToVec3f(&b, geo);
vec.x = a->x + b.x;
vec.y = a->y + b.y;
vec.z = a->z + b.z;
sum.x = a->x + b.x;
sum.y = a->y + b.y;
sum.z = a->z + b.z;
*dst = vec;
return dst;
return sum;
}
void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) {
@ -47,7 +44,7 @@ void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) {
offset.x = 0;
offset.y = 0;
offset.z = 0;
OLib_Vec3fDiffToVecGeo(&eyeToAtGeo, eye, at);
eyeToAtGeo = OLib_Vec3fDiffToVecGeo(eye, at);
// y shake
geo.r = req->y * y;
@ -55,7 +52,7 @@ void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) {
geo.pitch = eyeToAtGeo.pitch + req->orientation.x + 0x4000;
geo.yaw = eyeToAtGeo.yaw + req->orientation.y;
// apply y shake
Quake_AddVecGeoToVec3f(&offset, &offset, &geo);
offset = Quake_AddVecGeoToVec3f(&offset, &geo);
// x shake
geo.r = req->x * x;
@ -63,7 +60,7 @@ void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) {
geo.pitch = eyeToAtGeo.pitch + req->orientation.x;
geo.yaw = eyeToAtGeo.yaw + req->orientation.y + 0x4000;
// apply x shake
Quake_AddVecGeoToVec3f(&offset, &offset, &geo);
offset = Quake_AddVecGeoToVec3f(&offset, &geo);
} else {
offset.x = 0;
offset.y = req->y * y;
@ -71,7 +68,7 @@ void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) {
geo.r = req->x * x;
geo.pitch = req->orientation.x;
geo.yaw = req->orientation.y;
Quake_AddVecGeoToVec3f(&offset, &offset, &geo);
offset = Quake_AddVecGeoToVec3f(&offset, &geo);
}
shake->atOffset = shake->eyeOffset = offset;

View file

@ -389,7 +389,7 @@ void Room_DrawImageSingle(PlayState* play, Room* room, u32 flags) {
Vec3f quakeOffset;
gfx = POLY_OPA_DISP;
Camera_GetQuakeOffset(&quakeOffset, activeCam);
quakeOffset = Camera_GetQuakeOffset(activeCam);
Room_DrawBackground2D(&gfx, roomShape->source, roomShape->tlut, roomShape->width, roomShape->height,
roomShape->fmt, roomShape->siz, roomShape->tlutMode, roomShape->tlutCount,
(quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f,
@ -487,7 +487,7 @@ void Room_DrawImageMulti(PlayState* play, Room* room, u32 flags) {
Vec3f quakeOffset;
gfx = POLY_OPA_DISP;
Camera_GetQuakeOffset(&quakeOffset, activeCam);
quakeOffset = Camera_GetQuakeOffset(activeCam);
Room_DrawBackground2D(&gfx, bgEntry->source, bgEntry->tlut, bgEntry->width, bgEntry->height,
bgEntry->fmt, bgEntry->siz, bgEntry->tlutMode, bgEntry->tlutCount,
(quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f,

View file

@ -734,19 +734,15 @@ void DemoKankyo_Vec3fCopy(Vec3f* src, Vec3f* dst) {
dst->z = src->z;
}
Vec3f* DemoKankyo_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo) {
Vec3f DemoKankyo_AddVecGeoToVec3f(Vec3f* a, VecGeo* geo) {
Vec3f sum;
Vec3f b;
OLib_VecGeoToVec3f(&b, geo);
Vec3f b = OLib_VecGeoToVec3f(geo);
sum.x = a->x + b.x;
sum.y = a->y + b.y;
sum.z = a->z + b.z;
*dest = sum;
return dest;
return sum;
}
void DemoKankyo_Vec3fAddPosRot(PosRot* posRot, Vec3f* vec, Vec3f* dst) {
@ -754,9 +750,9 @@ void DemoKankyo_Vec3fAddPosRot(PosRot* posRot, Vec3f* vec, Vec3f* dst) {
Vec3f vecCopy;
DemoKankyo_Vec3fCopy(vec, &vecCopy);
OLib_Vec3fToVecGeo(&geo, &vecCopy);
geo = OLib_Vec3fToVecGeo(&vecCopy);
geo.yaw += posRot->rot.y;
DemoKankyo_AddVecGeoToVec3f(dst, &posRot->pos, &geo);
*dst = DemoKankyo_AddVecGeoToVec3f(&posRot->pos, &geo);
}
void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) {
@ -817,7 +813,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) {
this->unk_150[i].unk_22++;
}
}
Actor_GetWorld(&posRot, &player->actor);
posRot = Actor_GetWorld(&player->actor);
DemoKankyo_Vec3fAddPosRot(&posRot, &camPos, &D_8098CF98);
break;
case 2:
@ -941,7 +937,7 @@ void DemoKankyo_DrawSparkles(Actor* thisx, PlayState* play) {
&this->unk_150[i].unk_20, &this->unk_150[i].unk_1C) != 0) {
this->unk_150[i].unk_22++;
}
Actor_GetWorld(&posRot, &this->actor);
posRot = Actor_GetWorld(&this->actor);
DemoKankyo_Vec3fAddPosRot(&posRot, &camPos, &D_8098CFB8);
break;
case 2:

View file

@ -121,7 +121,7 @@ void EnButte_DrawTransformationEffect(EnButte* this, PlayState* play) {
alpha = Math_SinS(sTransformationEffectAlpha) * 250;
alpha = CLAMP(alpha, 0, 255);
Camera_GetCamDir(&camDir, GET_ACTIVE_CAM(play));
camDir = Camera_GetCamDir(GET_ACTIVE_CAM(play));
Matrix_RotateY(BINANG_TO_RAD(camDir.y), MTXMODE_NEW);
Matrix_RotateX(BINANG_TO_RAD(camDir.x), MTXMODE_APPLY);
Matrix_RotateZ(BINANG_TO_RAD(camDir.z), MTXMODE_APPLY);

View file

@ -75,7 +75,7 @@ void OceffWipe_Draw(Actor* thisx, PlayState* play) {
Vec3f quakeOffset;
eye = GET_ACTIVE_CAM(play)->eye;
Camera_GetQuakeOffset(&quakeOffset, GET_ACTIVE_CAM(play));
quakeOffset = Camera_GetQuakeOffset(GET_ACTIVE_CAM(play));
OPEN_DISPS(play->state.gfxCtx, "../z_oceff_wipe.c", 346);

View file

@ -69,7 +69,7 @@ void OceffWipe2_Draw(Actor* thisx, PlayState* play) {
Vec3f quakeOffset;
eye = GET_ACTIVE_CAM(play)->eye;
Camera_GetQuakeOffset(&quakeOffset, GET_ACTIVE_CAM(play));
quakeOffset = Camera_GetQuakeOffset(GET_ACTIVE_CAM(play));
if (this->timer < 32) {
z = Math_SinS(this->timer << 9) * 1330;
} else {

View file

@ -70,7 +70,7 @@ void OceffWipe3_Draw(Actor* thisx, PlayState* play) {
Vec3f quakeOffset;
eye = GET_ACTIVE_CAM(play)->eye;
Camera_GetQuakeOffset(&quakeOffset, GET_ACTIVE_CAM(play));
quakeOffset = Camera_GetQuakeOffset(GET_ACTIVE_CAM(play));
if (this->counter < 32) {
z = Math_SinS(this->counter << 9) * 1330;
} else {

View file

@ -68,7 +68,7 @@ void OceffWipe4_Draw(Actor* thisx, PlayState* play) {
Vec3f quakeOffset;
eye = GET_ACTIVE_CAM(play)->eye;
Camera_GetQuakeOffset(&quakeOffset, GET_ACTIVE_CAM(play));
quakeOffset = Camera_GetQuakeOffset(GET_ACTIVE_CAM(play));
if (this->timer < 16) {
z = Math_SinS(this->timer * 1024) * 1330.0f;
} else {