mirror of
https://github.com/BanjoRecomp/BanjoRecomp
synced 2026-05-26 23:26:49 -04:00
Add and implement all remaining axis inversion settings (#41)
* Add and implement all remaining axis inversion settings * Improve third person inversion description, move enum * Fix X axis inversion with analog camera * formatting * Remove boot map patch + fix newlines * invert vanilla camera properly * Fix comment * add more comments * fix demos and add wrapper functions * rename analog camera mode to third person camera mode * Fix first person Y inversion for demos (oops) * Change phrasing * reorder options
This commit is contained in:
+45
-28
@@ -36,22 +36,6 @@ static void add_general_options(recomp::config::Config &config) {
|
||||
note_saving_mode_options,
|
||||
banjo::NoteSavingMode::On
|
||||
);
|
||||
|
||||
static EnumOptionVector camera_invert_mode_options = {
|
||||
{banjo::CameraInvertMode::InvertNone, "InvertNone", "None"},
|
||||
{banjo::CameraInvertMode::InvertX, "InvertX", "Invert X"},
|
||||
{banjo::CameraInvertMode::InvertY, "InvertY", "Invert Y"},
|
||||
{banjo::CameraInvertMode::InvertBoth, "InvertBoth", "Invert Both"}
|
||||
};
|
||||
config.add_enum_option(
|
||||
banjo::configkeys::general::camera_invert_mode,
|
||||
"Aiming Camera Inverting",
|
||||
// TODO: Update for banjo
|
||||
"Inverts the camera controls. <recomp-color primary>Invert Y</recomp-color> is the default and matches the original game.",
|
||||
camera_invert_mode_options,
|
||||
banjo::CameraInvertMode::InvertY
|
||||
);
|
||||
|
||||
static EnumOptionVector analog_cam_mode_options = {
|
||||
{banjo::AnalogCamMode::Off, "Off", "Off"},
|
||||
{banjo::AnalogCamMode::On, "On", "On"},
|
||||
@@ -59,23 +43,48 @@ static void add_general_options(recomp::config::Config &config) {
|
||||
config.add_enum_option(
|
||||
banjo::configkeys::general::analog_cam_mode,
|
||||
"Analog Camera",
|
||||
// TODO: Update for banjo
|
||||
"Enables the analog camera.",
|
||||
analog_cam_mode_options,
|
||||
banjo::AnalogCamMode::Off
|
||||
);
|
||||
static EnumOptionVector camera_invert_mode_options = {
|
||||
{banjo::CameraInvertMode::InvertNone, "InvertNone", "None"},
|
||||
{banjo::CameraInvertMode::InvertX, "InvertX", "Invert X"},
|
||||
{banjo::CameraInvertMode::InvertY, "InvertY", "Invert Y"},
|
||||
{banjo::CameraInvertMode::InvertBoth, "InvertBoth", "Invert Both"}
|
||||
};
|
||||
config.add_enum_option(
|
||||
banjo::configkeys::general::analog_camera_invert_mode,
|
||||
"Analog Camera Inverting",
|
||||
// TODO: Update for banjo
|
||||
"Inverts the camera controls for the analog camera if it's enabled. <recomp-color primary>None</recomp-color> is the default.",
|
||||
banjo::configkeys::general::third_person_camera_invert_mode,
|
||||
"Invert Camera",
|
||||
"Inverts the camera controls for the third person camera if it's enabled. <recomp-color primary>Invert X</recomp-color> is the default and matches the original game.<br /><br />If analog camera is off, only the <recomp-color primary>Invert X</recomp-color> setting will take effect.",
|
||||
camera_invert_mode_options,
|
||||
banjo::CameraInvertMode::InvertNone
|
||||
banjo::CameraInvertMode::InvertX
|
||||
);
|
||||
config.add_option_disable_dependency(
|
||||
banjo::configkeys::general::analog_camera_invert_mode,
|
||||
banjo::configkeys::general::analog_cam_mode,
|
||||
banjo::AnalogCamMode::Off
|
||||
static EnumOptionVector first_person_invert_mode_options = {
|
||||
{banjo::CameraInvertMode::InvertNone, "InvertNone", "None"},
|
||||
{banjo::CameraInvertMode::InvertX, "InvertX", "Invert X"},
|
||||
{banjo::CameraInvertMode::InvertY, "InvertY", "Invert Y"},
|
||||
{banjo::CameraInvertMode::InvertBoth, "InvertBoth", "Invert Both"}
|
||||
};
|
||||
config.add_enum_option(
|
||||
banjo::configkeys::general::first_person_invert_mode,
|
||||
"Invert First Person View",
|
||||
"Inverts the camera controls in first person view. <recomp-color primary>Invert Y</recomp-color> is the default and matches the original game.",
|
||||
first_person_invert_mode_options,
|
||||
banjo::CameraInvertMode::InvertY
|
||||
);
|
||||
static EnumOptionVector flying_and_swimming_invert_options = {
|
||||
{banjo::CameraInvertMode::InvertNone, "InvertNone", "None"},
|
||||
{banjo::CameraInvertMode::InvertX, "InvertX", "Invert X"},
|
||||
{banjo::CameraInvertMode::InvertY, "InvertY", "Invert Y"},
|
||||
{banjo::CameraInvertMode::InvertBoth, "InvertBoth", "Invert Both"}
|
||||
};
|
||||
config.add_enum_option(
|
||||
banjo::configkeys::general::flying_and_swimming_invert_mode,
|
||||
"Invert Flying & Swimming",
|
||||
"Inverts the controls for swimming and flying. <recomp-color primary>Invert Y</recomp-color> is the default and matches the original game.",
|
||||
flying_and_swimming_invert_options,
|
||||
banjo::CameraInvertMode::InvertY
|
||||
);
|
||||
}
|
||||
|
||||
@@ -92,8 +101,16 @@ banjo::CameraInvertMode banjo::get_camera_invert_mode() {
|
||||
return get_general_config_enum_value<banjo::CameraInvertMode>(banjo::configkeys::general::camera_invert_mode);
|
||||
}
|
||||
|
||||
banjo::CameraInvertMode banjo::get_analog_camera_invert_mode() {
|
||||
return get_general_config_enum_value<banjo::CameraInvertMode>(banjo::configkeys::general::analog_camera_invert_mode);
|
||||
banjo::CameraInvertMode banjo::get_third_person_camera_mode() {
|
||||
return get_general_config_enum_value<banjo::CameraInvertMode>(banjo::configkeys::general::third_person_camera_invert_mode);
|
||||
}
|
||||
|
||||
banjo::CameraInvertMode banjo::get_flying_and_swimming_invert_mode() {
|
||||
return get_general_config_enum_value<banjo::CameraInvertMode>(banjo::configkeys::general::flying_and_swimming_invert_mode);
|
||||
}
|
||||
|
||||
banjo::CameraInvertMode banjo::get_first_person_invert_mode() {
|
||||
return get_general_config_enum_value<banjo::CameraInvertMode>(banjo::configkeys::general::first_person_invert_mode);
|
||||
}
|
||||
|
||||
banjo::AnalogCamMode banjo::get_analog_cam_mode() {
|
||||
|
||||
+21
-1
@@ -146,7 +146,27 @@ extern "C" void recomp_get_analog_inverted_axes(uint8_t* rdram, recomp_context*
|
||||
s32* x_out = _arg<0, s32*>(rdram, ctx);
|
||||
s32* y_out = _arg<1, s32*>(rdram, ctx);
|
||||
|
||||
banjo::CameraInvertMode mode = banjo::get_analog_camera_invert_mode();
|
||||
banjo::CameraInvertMode mode = banjo::get_third_person_camera_mode();
|
||||
|
||||
*x_out = (mode == banjo::CameraInvertMode::InvertX || mode == banjo::CameraInvertMode::InvertBoth);
|
||||
*y_out = (mode == banjo::CameraInvertMode::InvertY || mode == banjo::CameraInvertMode::InvertBoth);
|
||||
}
|
||||
|
||||
extern "C" void recomp_get_flying_and_swimming_inverted_axes(uint8_t* rdram, recomp_context* ctx) {
|
||||
s32* x_out = _arg<0, s32*>(rdram, ctx);
|
||||
s32* y_out = _arg<1, s32*>(rdram, ctx);
|
||||
|
||||
banjo::CameraInvertMode mode = banjo::get_flying_and_swimming_invert_mode();
|
||||
|
||||
*x_out = (mode == banjo::CameraInvertMode::InvertX || mode == banjo::CameraInvertMode::InvertBoth);
|
||||
*y_out = (mode == banjo::CameraInvertMode::InvertY || mode == banjo::CameraInvertMode::InvertBoth);
|
||||
}
|
||||
|
||||
extern "C" void recomp_get_first_person_inverted_axes(uint8_t* rdram, recomp_context* ctx) {
|
||||
s32* x_out = _arg<0, s32*>(rdram, ctx);
|
||||
s32* y_out = _arg<1, s32*>(rdram, ctx);
|
||||
|
||||
banjo::CameraInvertMode mode = banjo::get_first_person_invert_mode();
|
||||
|
||||
*x_out = (mode == banjo::CameraInvertMode::InvertX || mode == banjo::CameraInvertMode::InvertBoth);
|
||||
*y_out = (mode == banjo::CameraInvertMode::InvertY || mode == banjo::CameraInvertMode::InvertBoth);
|
||||
|
||||
Reference in New Issue
Block a user