Skip to content

Commit

Permalink
some rename in ceremony (#647)
Browse files Browse the repository at this point in the history
* rename ceremony

* apply some suggestion

* some rename

---------

Co-authored-by: MegaMech <[email protected]>
  • Loading branch information
coco875 and MegaMech authored Sep 15, 2024
1 parent e6bdbec commit b42cf5a
Show file tree
Hide file tree
Showing 12 changed files with 453 additions and 382 deletions.
3 changes: 0 additions & 3 deletions src/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ typedef struct {
/* 0xB4 */ f32 unk_B4;
} Camera; /* size = 0xB8 */

typedef BAD_RETURN(s32) (*CameraEvent)(Camera* c);
typedef CameraEvent CutsceneShot;

void camera_init(f32, f32, f32, s16, u32, s32);
void func_8001CA10(Camera*);
void func_8001CA24(Player*, f32);
Expand Down
4 changes: 2 additions & 2 deletions src/camera_junk.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

/* Function Prototypes */

void setup_camera_podium_ceremony(void);
void func_802816B8(void);
void update_camera_podium_ceremony(void);
void init_camera_podium_ceremony(void);

// guPerspective params

Expand Down
39 changes: 19 additions & 20 deletions src/code_80005FD0.c
Original file line number Diff line number Diff line change
Expand Up @@ -5426,26 +5426,25 @@ void func_80014D30(s32 cameraId, s32 pathIndex) {
(f32) temp_v0->posZ);
}

void func_80014DE4(s32 arg0) {
void func_80014DE4(s32 cameraIndex) {
s32 cameraId;

D_801646CC = 0;
D_80164678[arg0] = D_80164670[arg0];
D_80164678[cameraIndex] = D_80164670[cameraIndex];
if ((gModeSelection != 1) && ((gCourseIndexInCup == COURSE_ONE) || (gDemoMode == (u16) 1))) {
D_80164678[arg0] = 0;
} else if ((D_80164678[arg0] != 0) && (D_80164678[arg0] != (s16) 1) && (D_80164678[arg0] != 2) &&
(D_80164678[arg0] != 3)) {
D_80164678[arg0] = 0;
D_80164678[cameraIndex] = 0;
} else if ((D_80164678[cameraIndex] != 0) && (D_80164678[cameraIndex] != (s16) 1) && (D_80164678[cameraIndex] != 2) && (D_80164678[cameraIndex] != 3)) {
D_80164678[cameraIndex] = 0;
}
D_80164680[arg0] = -1;
D_80164680[cameraIndex] = -1;
D_80163238 = 0;
D_801646C0[arg0] = 0;
D_801646C0[cameraIndex] = 0;
D_801646C8 = 0;
D_801646D0[arg0].unk0 = 0;
D_801646D0[arg0].unk2 = 0;
D_801646D0[arg0].unk4 = 0;
D_801646D0[cameraIndex].unk0 = 0;
D_801646D0[cameraIndex].unk2 = 0;
D_801646D0[cameraIndex].unk4 = 0;
if ((gModeSelection == 1) && (D_8018EDFC == 0)) {
D_80164678[arg0] = 0;
D_80164678[cameraIndex] = 0;
}

for (cameraId = 0; cameraId < 4; cameraId++) {
Expand Down Expand Up @@ -5532,7 +5531,7 @@ f32 func_80014EE4(f32 arg0, s32 arg1) {
return arg0;
}

void func_800151A4(Camera* camera, s32 arg1) {
void calculate_camera_up_vector(Camera *camera, s32 cameraIndex) {
f32 xnorm;
f32 ynorm;
f32 znorm;
Expand All @@ -5543,7 +5542,7 @@ void func_800151A4(Camera* camera, s32 arg1) {
f32 sp28;
u16 thing;

thing = D_801646C0[arg1];
thing = D_801646C0[cameraIndex];
if (thing == 0) {
camera->up[0] = 0.0f;
camera->up[2] = 0.0f;
Expand Down Expand Up @@ -6665,10 +6664,10 @@ void func_80019890(s32 playerId, s32 cameraId) {
}
}

void func_80019B50(s32 arg0, u16 arg1) {
void func_80019B50(s32 cameraIndex, u16 arg1) {
u16 var_v0;

var_v0 = D_801646C0[arg0];
var_v0 = D_801646C0[cameraIndex];
if (var_v0 < arg1) {
if ((arg1 - var_v0) < 0x8000) {
var_v0 += 0x5A;
Expand All @@ -6692,10 +6691,10 @@ void func_80019B50(s32 arg0, u16 arg1) {
}
} else if ((var_v0 - arg1) >= 0x8000) {
var_v0 += 0x5A;
if (!arg0) {} // wtf?
if (!cameraIndex) {} // wtf?
}
}
D_801646C0[arg0] = (s16) var_v0;
D_801646C0[cameraIndex] = (s16) var_v0;
}

void func_80019C50(s32 arg0) {
Expand Down Expand Up @@ -6723,7 +6722,7 @@ void func_80019D2C(Camera* camera, Player* player, s32 arg2) {

playerId = camera->playerId;
if ((D_80163378 != 0) && (gCurrentCourseId == 8)) {
func_800151A4(camera, arg2);
calculate_camera_up_vector(camera, arg2);
nearestWaypoint = gNearestWaypointByPlayerId[playerId];
if (((nearestWaypoint >= 0x65) && (nearestWaypoint < 0xFA)) ||
((nearestWaypoint >= 0x1AF) && (nearestWaypoint < 0x226))) {
Expand Down Expand Up @@ -6959,7 +6958,7 @@ void func_8001A588(UNUSED u16* localD_80152300, Camera* camera, Player* player,
func_80019D2C(camera, player, cameraIndex);
} else {
D_801646C0[cameraIndex] = 0;
func_800151A4(camera, cameraIndex);
calculate_camera_up_vector(camera, cameraIndex);
}
switch ((u16) D_801646CC) {
case 1:
Expand Down
2 changes: 1 addition & 1 deletion src/code_80005FD0.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void func_80014D30(s32, s32);
void func_80014DE4(s32);
f32 func_80014EE4(f32, s32);

void func_800151A4(Camera*, s32);
void calculate_camera_up_vector(Camera*, s32);
void func_8001530C(void);
void func_80015314(s32, f32, s32);
void func_80015390(Camera*, Player*, s32);
Expand Down
4 changes: 2 additions & 2 deletions src/code_80091750.c
Original file line number Diff line number Diff line change
Expand Up @@ -11965,14 +11965,14 @@ void func_800AF270(struct_8018D9E0_entry* arg0) {
if (D_802874D8.unk1D >= 3) {
arg0->cursor = 4;
func_800CA0B8();
func_800C90F4(0U, (sp30 * 0x10) + 0x29008003);
func_800C90F4(0U, (sp30 * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x03));
func_800CA0A0();
} else {
arg0->cursor = 3;
func_8009A640(arg0->D_8018DEE0_index, 0, sp30,
segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[temp_v0]));
func_800CA0B8();
func_800C90F4(0U, (sp30 * 0x10) + 0x29008007);
func_800C90F4(0U, (sp30 * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80 ,0x07));
func_800CA0A0();
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/ending/camera_junk.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "ceremony_and_credits.h"
#include "main.h"

void setup_camera_podium_ceremony(void) {
Camera* camera;
void update_camera_podium_ceremony(void) {
Camera *camera;
f32 x_dist;
f32 y_dist;
f32 z_dist;
Expand All @@ -26,7 +26,7 @@ void setup_camera_podium_ceremony(void) {
}

// GP podium ceremony camera settings?
void func_802816B8(void) {
void init_camera_podium_ceremony(void) {
cameras[0].pos[0] = -3133.0f;
cameras[0].pos[1] = 19.0f;
cameras[0].pos[2] = -467.0f;
Expand Down
Loading

0 comments on commit b42cf5a

Please sign in to comment.