Skip to content

Commit

Permalink
Merge pull request FunkinCrew#3 from someone2639/c_up_mode
Browse files Browse the repository at this point in the history
added C-up mode to parallel cam
  • Loading branch information
farisawan-2000 authored Jan 13, 2021
2 parents aa14e2a + 64d58dd commit 1cee813
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
3 changes: 3 additions & 0 deletions enhancements/puppycam.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ extern s16 newcam_yaw;
extern s16 newcam_tilt;
extern u16 newcam_distance_target;
extern s16 newcam_distance_values[3];
extern f32 newcam_lookat[3];
extern f32 newcam_pos[3];
extern f32 newcam_pos_target[3];

#ifndef TARGET_N64
extern s16 mousepos[2];
Expand Down
1 change: 1 addition & 0 deletions enhancements/puppycam_angles.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct newcam_hardpos newcam_fixedcam[] =
/*Cam X*/ 32767,/*Cam Y*/ 32767,/*Cam Z*/ 32767, //The position the camera gets placed for NC_MODE_FIXED and NC_MODE_FIXED_NOMOVE
/*Look X*/ 32767,/*Look Y*/ 32767,/*Look Z*/ 32767}, //The position the camera looks at for NC_MODE_FIXED_NOMOVE

// Parallel Cam with custom C-Up Mode Reimplementation
{/*Level ID*/ LEVEL_MAX,/*Area ID*/ 1,/*Permaswap*/ 0,
/*Mode*/NC_FLAG_COLLISION | NC_FLAG_ZOOM | NC_FLAG_FOCUSX | NC_FLAG_FOCUSZ | NC_FLAG_POSX | NC_FLAG_POSY | NC_FLAG_POSZ,
/*Script*/ &newcam_parallel_cam, //Standard params.
Expand Down
28 changes: 24 additions & 4 deletions enhancements/puppycam_scripts.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ static void newcam_angle_rotate(struct newcam_hardpos *params)
print_text_fmt_int(32,48,"%d",newcam_yaw);
}


static void newcam_parallel_cam(struct newcam_hardpos *params);

static void newcam_c_up_cam(struct newcam_hardpos *params) {
newcam_distance_target = 175;

newcam_yaw += (s32)gPlayer1Controller->stickX * 6;
newcam_tilt += (s32)gPlayer1Controller->stickY * 6;

if (gPlayer1Controller->buttonPressed & D_CBUTTONS) {
params->newcam_hard_script = newcam_parallel_cam;
newcam_tilt = 1500;
newcam_yaw = -gMarioState->faceAngle[1]-0x4000;
set_mario_action(gMarioState, ACT_IDLE, 0);
}
}

static void newcam_parallel_cam(struct newcam_hardpos *params) {
newcam_distance_target = 1000;

Expand All @@ -16,10 +33,13 @@ static void newcam_parallel_cam(struct newcam_hardpos *params) {
newcam_yaw -= 0x2000;
if (gPlayer1Controller->buttonPressed & L_CBUTTONS)
newcam_yaw += 0x2000;
if (gPlayer1Controller->buttonPressed & U_CBUTTONS)
newcam_tilt += 0x1000;
if (gPlayer1Controller->buttonPressed & D_CBUTTONS)
newcam_tilt -= 0x1000;
if (gPlayer1Controller->buttonPressed & U_CBUTTONS) {
if (gMarioState->action & ACT_FLAG_ALLOW_FIRST_PERSON) {
newcam_yaw = -gMarioState->faceAngle[1]-0x4000;
params->newcam_hard_script = newcam_c_up_cam;
set_mario_action(gMarioState, ACT_WAITING_FOR_DIALOG, 0);
}
}

if (gPlayer1Controller->buttonPressed & U_JPAD) {
newcam_yaw = -gMarioState->faceAngle[1]-0x4000;
Expand Down

0 comments on commit 1cee813

Please sign in to comment.