Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse controls for cannons #409

Open
wants to merge 2 commits into
base: nightly
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/game/mario_actions_automatic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

Expand Down Expand Up @@ -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;
Expand Down