You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Puppycam free view mode
Intended mainly for use with developing, but not impossible to purpose for other means. Just set PUPPYCAM_BEHAVIOUR_FREE in intendedFlags to enable it, and remove it to disable it. Mario will be immobilised when in this mode. Puppyprint debug integration soonish
This commit is contained in:
@@ -616,6 +616,8 @@ void puppycam_input_zoom(void)
|
||||
|
||||
void puppycam_input_centre(void)
|
||||
{
|
||||
if (gPuppyCam.flags & PUPPYCAM_BEHAVIOUR_FREE)
|
||||
return;
|
||||
s32 inputDefault = L_TRIG;
|
||||
if (gPuppyCam.options.inputType == 2)
|
||||
inputDefault = R_TRIG;
|
||||
@@ -811,6 +813,9 @@ static void puppycam_input_hold(void)
|
||||
f32 ivY = ((gPuppyCam.options.invertY*2)-1)*(gPuppyCam.options.sensitivityY/100.f);
|
||||
s8 stickMag[2] = {100, 100};
|
||||
|
||||
if (gPuppyCam.intendedFlags & PUPPYCAM_BEHAVIOUR_FREE)
|
||||
gPuppyCam.flags = PUPPYCAM_BEHAVIOUR_FREE | PUPPYCAM_BEHAVIOUR_YAW_ROTATION | PUPPYCAM_BEHAVIOUR_PITCH_ROTATION;
|
||||
|
||||
//Analogue Camera stuff. If it fails to find an input, then it just sets stickmag to 100, which after calculations means the value goes unchanged.
|
||||
if (gPuppyCam.options.analogue && gPuppyCam.options.inputType != 2)
|
||||
{
|
||||
@@ -822,7 +827,7 @@ static void puppycam_input_hold(void)
|
||||
if (!(gPuppyCam.flags & PUPPYCAM_BEHAVIOUR_YAW_ROTATION))
|
||||
return;
|
||||
|
||||
if (!gPuppyCam.options.analogue)
|
||||
if (!gPuppyCam.options.analogue && !(gPuppyCam.flags & PUPPYCAM_BEHAVIOUR_FREE))
|
||||
{
|
||||
switch (gPuppyCam.options.inputType)
|
||||
{
|
||||
@@ -834,6 +839,9 @@ static void puppycam_input_hold(void)
|
||||
else
|
||||
{
|
||||
puppycam_input_hold_preset1(ivX);
|
||||
puppycam_input_pitch();
|
||||
puppycam_input_zoom();
|
||||
puppycam_input_centre();
|
||||
}
|
||||
|
||||
gPuppyCam.framesSinceC[0]++;
|
||||
@@ -885,9 +893,34 @@ static void puppycam_input_press(void)
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN,gGlobalSoundSource);
|
||||
}
|
||||
puppycam_input_pitch();
|
||||
puppycam_input_zoom();
|
||||
puppycam_input_centre();
|
||||
gPuppyCam.pitchTarget += ((4+gPuppyCam.moveFlagAdd)*gPuppyCam.pitchAcceleration*ivY)*(stickMag*0.01f);
|
||||
}
|
||||
|
||||
void puppycam_debug_view(void)
|
||||
{
|
||||
if (ABS(gPlayer1Controller->rawStickX) > DEADZONE)
|
||||
{
|
||||
gPuppyCam.pos[0] += (gPlayer1Controller->rawStickX/4) * -sins(gPuppyCam.yawTarget);
|
||||
gPuppyCam.pos[2] += (gPlayer1Controller->rawStickX/4) * coss(gPuppyCam.yawTarget);
|
||||
}
|
||||
if (ABS(gPlayer1Controller->rawStickY) > DEADZONE)
|
||||
{
|
||||
gPuppyCam.pos[0] += (gPlayer1Controller->rawStickY/4) * coss(gPuppyCam.yawTarget);
|
||||
gPuppyCam.pos[1] += (gPlayer1Controller->rawStickY/4) * sins(gPuppyCam.pitchTarget);
|
||||
gPuppyCam.pos[2] += (gPlayer1Controller->rawStickY/4) * sins(gPuppyCam.yawTarget);
|
||||
}
|
||||
if (gPlayer1Controller->buttonDown & Z_TRIG || gPlayer1Controller->buttonDown & L_TRIG)
|
||||
gPuppyCam.pos[1] -= 20;
|
||||
if (gPlayer1Controller->buttonDown & R_TRIG)
|
||||
gPuppyCam.pos[1] += 20;
|
||||
|
||||
gPuppyCam.focus[0] = gPuppyCam.pos[0] + (100 *coss(gPuppyCam.yawTarget));
|
||||
gPuppyCam.focus[1] = gPuppyCam.pos[1] + (100 *sins(gPuppyCam.pitchTarget));
|
||||
gPuppyCam.focus[2] = gPuppyCam.pos[2] + (100 *sins(gPuppyCam.yawTarget));
|
||||
}
|
||||
|
||||
static void puppycam_view_panning(void)
|
||||
{
|
||||
f32 panFloor, panMulti;
|
||||
@@ -1222,8 +1255,9 @@ static void puppycam_input_core(void)
|
||||
gPuppyCam.moveFlagAdd = 0;
|
||||
|
||||
//Decide which input for left and right C buttons to use based on behaviour type.
|
||||
if (gPuppyCam.flags & PUPPYCAM_BEHAVIOUR_INPUT_NORMAL)
|
||||
if (gPuppyCam.flags & PUPPYCAM_BEHAVIOUR_INPUT_NORMAL || gPuppyCam.flags & PUPPYCAM_BEHAVIOUR_FREE)
|
||||
puppycam_input_hold();
|
||||
else
|
||||
if (gPuppyCam.flags & PUPPYCAM_BEHAVIOUR_INPUT_8DIR || gPuppyCam.flags & PUPPYCAM_BEHAVIOUR_INPUT_4DIR)
|
||||
puppycam_input_press();
|
||||
}
|
||||
@@ -1235,6 +1269,13 @@ static void puppycam_projection(void)
|
||||
s16 pitchTotal;
|
||||
s32 panD = (gPuppyCam.flags & PUPPYCAM_BEHAVIOUR_PANSHIFT)/8192;
|
||||
|
||||
if (gPuppyCam.flags & PUPPYCAM_BEHAVIOUR_FREE)
|
||||
{
|
||||
puppycam_reset_values();
|
||||
puppycam_debug_view();
|
||||
return;
|
||||
}
|
||||
|
||||
//Extra behaviours that get tacked onto the projection. Will be completely ignored if there is no target object.
|
||||
puppycam_projection_behaviours();
|
||||
//These are what the base rotations aspire to be.
|
||||
|
||||
@@ -81,7 +81,7 @@ struct gPuppyStruct
|
||||
u8 opacity; //A value set by collision distance, to fade Mario out if you're too close.
|
||||
s8 stick2[2];//The value that's set and read for analogue stick.
|
||||
u8 stickN[2]; //This is set when the stick is neutral. It's to prevent rapidfire input.
|
||||
u8 enabled; //A boolean that decides whether to use vanilla camera or puppy camera.
|
||||
u8 enabled : 1; //A boolean that decides whether to use vanilla camera or puppy camera.
|
||||
s16 swimPitch; //Pitch adjustment that's applied when swimming. All pitch adjustment is clamped.
|
||||
s16 edgePitch; //Pitch adjustment that's applied when stood near an edge. All pitch adjustment is clamped.
|
||||
s16 moveZoom; //A small zoom value that's added on top of the regular zoom when moving. It's pretty subtle, but gives the feeling of a bit of speed.
|
||||
@@ -140,26 +140,27 @@ struct sPuppyVolume
|
||||
|
||||
enum gPuppyCamBeh
|
||||
{
|
||||
PUPPYCAM_BEHAVIOUR_X_MOVEMENT = 0x0001,
|
||||
PUPPYCAM_BEHAVIOUR_Y_MOVEMENT = 0x0002,
|
||||
PUPPYCAM_BEHAVIOUR_Z_MOVEMENT = 0x0004,
|
||||
PUPPYCAM_BEHAVIOUR_X_MOVEMENT = 0x0001,
|
||||
PUPPYCAM_BEHAVIOUR_Y_MOVEMENT = 0x0002,
|
||||
PUPPYCAM_BEHAVIOUR_Z_MOVEMENT = 0x0004,
|
||||
|
||||
PUPPYCAM_BEHAVIOUR_YAW_ROTATION = 0x0008,
|
||||
PUPPYCAM_BEHAVIOUR_PITCH_ROTATION = 0x0010,
|
||||
PUPPYCAM_BEHAVIOUR_ZOOM_CHANGE = 0x0020,
|
||||
PUPPYCAM_BEHAVIOUR_YAW_ROTATION = 0x0008,
|
||||
PUPPYCAM_BEHAVIOUR_PITCH_ROTATION = 0x0010,
|
||||
PUPPYCAM_BEHAVIOUR_ZOOM_CHANGE = 0x0020,
|
||||
|
||||
PUPPYCAM_BEHAVIOUR_INPUT_NORMAL = 0x0040,
|
||||
PUPPYCAM_BEHAVIOUR_INPUT_8DIR = 0x0080,
|
||||
PUPPYCAM_BEHAVIOUR_INPUT_4DIR = 0x0100,
|
||||
PUPPYCAM_BEHAVIOUR_INPUT_2D = 0x0200,
|
||||
PUPPYCAM_BEHAVIOUR_INPUT_NORMAL = 0x0040,
|
||||
PUPPYCAM_BEHAVIOUR_INPUT_8DIR = 0x0080,
|
||||
PUPPYCAM_BEHAVIOUR_INPUT_4DIR = 0x0100,
|
||||
PUPPYCAM_BEHAVIOUR_INPUT_2D = 0x0200,
|
||||
|
||||
PUPPYCAM_BEHAVIOUR_SLIDE_CORRECTION = 0x0400,
|
||||
PUPPYCAM_BEHAVIOUR_TURN_HELPER = 0x0800,
|
||||
PUPPYCAM_BEHAVIOUR_HEIGHT_HELPER = 0x1000,
|
||||
PUPPYCAM_BEHAVIOUR_PANSHIFT = 0x2000,
|
||||
PUPPYCAM_BEHAVIOUR_TURN_HELPER = 0x0800,
|
||||
PUPPYCAM_BEHAVIOUR_HEIGHT_HELPER = 0x1000,
|
||||
PUPPYCAM_BEHAVIOUR_PANSHIFT = 0x2000,
|
||||
|
||||
PUPPYCAM_BEHAVIOUR_COLLISION = 0x4000,
|
||||
PUPPYCAM_BEHAVIOUR_COLLISION = 0x4000,
|
||||
|
||||
PUPPYCAM_BEHAVIOUR_FREE = 0x8000,
|
||||
|
||||
PUPPYCAM_BEHAVIOUR_DEFAULT = PUPPYCAM_BEHAVIOUR_X_MOVEMENT | PUPPYCAM_BEHAVIOUR_Y_MOVEMENT | PUPPYCAM_BEHAVIOUR_Z_MOVEMENT |
|
||||
PUPPYCAM_BEHAVIOUR_YAW_ROTATION | PUPPYCAM_BEHAVIOUR_PITCH_ROTATION | PUPPYCAM_BEHAVIOUR_ZOOM_CHANGE |
|
||||
|
||||
Reference in New Issue
Block a user