From 5221be4c60e352f3faae22fddcb8b8018b2d30c0 Mon Sep 17 00:00:00 2001 From: John Collins Date: Sat, 22 Aug 2020 22:36:47 -0500 Subject: [PATCH 1/2] Mouse controls for cannons --- src/game/mario_actions_automatic.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index a74f4a186..83d56f35e 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -17,6 +17,11 @@ #include "level_table.h" #include "thread6.h" +#ifdef BETTERCAMERA + #include "pc\controller\controller_mouse.h" + extern u8 newcam_mouse; +#endif + #define POLE_NONE 0 #define POLE_TOUCHED_FLOOR 1 #define POLE_FELL_OFF 2 @@ -25,6 +30,8 @@ #define HANG_HIT_CEIL_OR_OOB 1 #define HANG_LEFT_CEIL 2 + + void add_tree_leaf_particles(struct MarioState *m) { f32 leafHeight; @@ -703,6 +710,12 @@ s32 act_in_cannon(struct MarioState *m) { case 2: m->faceAngle[0] -= (s16)(m->controller->stickY * 10.0f); marioObj->oMarioCannonInputYaw -= (s16)(m->controller->stickX * 10.0f); +#ifdef BETTERCAMERA + if (newcam_mouse) { + m->faceAngle[0] -= (s16)(mouse_y * 10.0f); + marioObj->oMarioCannonInputYaw -= (s16)(mouse_x * 10.0f); + } +#endif if (m->faceAngle[0] > 0x38E3) { m->faceAngle[0] = 0x38E3; From 66a51c4bde41bc79bc3d7fc1115067f07a454061 Mon Sep 17 00:00:00 2001 From: John Collins Date: Sun, 6 Sep 2020 14:56:30 -0500 Subject: [PATCH 2/2] Fix incorrect backslash --- src/game/mario_actions_automatic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index 83d56f35e..0e7489c9a 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -18,7 +18,7 @@ #include "thread6.h" #ifdef BETTERCAMERA - #include "pc\controller\controller_mouse.h" + #include "pc/controller/controller_mouse.h" extern u8 newcam_mouse; #endif