diff --git a/include/text_options_strings.h.in b/include/text_options_strings.h.in index a1ce481f2c..50a520a381 100644 --- a/include/text_options_strings.h.in +++ b/include/text_options_strings.h.in @@ -121,6 +121,8 @@ #define TEXT_OPT_THREEPT _("Three-point") #define TEXT_OPT_APPLY _("Apply") #define TEXT_OPT_RESETWND _("Reset Window") +#define TEXT_OPT_BOWSERCAM _("Bowser Level 8-way Camera") + #define TEXT_BIND_A _("A Button") #define TEXT_BIND_B _("B Button") diff --git a/src/game/bettercamera.inc.h b/src/game/bettercamera.inc.h index 6e224d80ca..4a6b0c52cd 100644 --- a/src/game/bettercamera.inc.h +++ b/src/game/bettercamera.inc.h @@ -115,6 +115,7 @@ u16 newcam_modeflags; s16 newcam_saved_mode = -1; s16 newcam_saved_defmode = -1; +u8 bowser_cam_changed; ///This is called at every level initialisation. void newcam_init(struct Camera *c, u8 dv) { newcam_tilt = 1500; @@ -123,9 +124,6 @@ void newcam_init(struct Camera *c, u8 dv) { newcam_mode = NC_MODE_NORMAL; ///This here will dictate what modes the camera will start in at the beginning of a level. Below are some examples. switch (gCurrLevelNum) { - case LEVEL_BITDW: newcam_yaw = 0x4000; newcam_mode = NC_MODE_8D; newcam_tilt = 4000; newcam_distance_target = newcam_distance_values[2]; break; - case LEVEL_BITFS: newcam_yaw = 0x4000; newcam_mode = NC_MODE_8D; newcam_tilt = 4000; newcam_distance_target = newcam_distance_values[2]; break; - case LEVEL_BITS: newcam_yaw = 0x4000; newcam_mode = NC_MODE_8D; newcam_tilt = 4000; newcam_distance_target = newcam_distance_values[2]; break; case LEVEL_WF: newcam_yaw = 0x4000; newcam_tilt = 2000; newcam_distance_target = newcam_distance_values[1]; break; case LEVEL_RR: newcam_yaw = 0x6000; newcam_tilt = 2000; newcam_distance_target = newcam_distance_values[2]; break; case LEVEL_CCM: if (gCurrAreaIndex == 1) {newcam_yaw = -0x4000; newcam_tilt = 2000; newcam_distance_target = newcam_distance_values[1];} else newcam_mode = NC_MODE_SLIDE; break; @@ -133,6 +131,15 @@ void newcam_init(struct Camera *c, u8 dv) { case 27: newcam_mode = NC_MODE_SLIDE; break; case LEVEL_TTM: if (gCurrAreaIndex == 2) newcam_mode = NC_MODE_SLIDE; break; } + if ((gCurrLevelNum == LEVEL_BITDW) ||(gCurrLevelNum == LEVEL_BITFS) ||(gCurrLevelNum == LEVEL_BITS) ) + { + newcam_yaw = 0x4000; + if (configBowserCam) { + newcam_mode = NC_MODE_8D; + } + newcam_tilt = 4000; + newcam_distance_target = newcam_distance_values[2]; + } // clear these out when entering a new level to prevent "camera mode buffering" newcam_saved_defmode = -1; @@ -190,6 +197,30 @@ void newcam_init_settings(void) { newcam_degrade = (f32)configCameraDegrade; newcam_toggle(configEnableCamera); + + if (bowser_cam_changed != configBowserCam) { + bowser_cam_changed = configBowserCam; + if ((gCurrLevelNum == LEVEL_BITDW) || (gCurrLevelNum == LEVEL_BITFS) + || (gCurrLevelNum == LEVEL_BITS)) { + if (configEnableCamera) { + newcam_saved_defmode = -1; + newcam_saved_mode = -1; + if (configBowserCam) { + newcam_yaw = 0x4000; + newcam_mode = NC_MODE_8D; + newcam_tilt = 4000; + newcam_distance_target = newcam_distance_values[2]; + newcam_tilt_acc = 0; + newcam_yaw_acc = 0; + } else { + newcam_mode = NC_MODE_NORMAL; + } + newcam_intendedmode = newcam_mode; + newcam_modeflags = newcam_mode; + } + } + } + } /** Mathematic calculations. This stuffs so basic even *I* understand it lol diff --git a/src/game/options_menu.c b/src/game/options_menu.c index 56dba619e3..b29bc1af78 100644 --- a/src/game/options_menu.c +++ b/src/game/options_menu.c @@ -70,6 +70,7 @@ static const u8 optsCameraStr[][32] = { { TEXT_OPT_MOUSE }, { TEXT_OPT_CAMD }, { TEXT_OPT_CAMON }, + {TEXT_OPT_BOWSERCAM}, }; static const u8 optsVideoStr[][32] = { @@ -229,6 +230,7 @@ static struct Option optsCamera[] = { DEF_OPT_SCROLL( optsCameraStr[4], &configCameraAggr, 0, 100, 1 ), DEF_OPT_SCROLL( optsCameraStr[5], &configCameraPan, 0, 100, 1 ), DEF_OPT_SCROLL( optsCameraStr[8], &configCameraDegrade, 0, 100, 1 ), + DEF_OPT_TOGGLE( optsCameraStr[10], &configBowserCam ), }; #endif diff --git a/src/pc/configfile.c b/src/pc/configfile.c index 7411d4f84b..7001ff2d9c 100644 --- a/src/pc/configfile.c +++ b/src/pc/configfile.c @@ -87,6 +87,7 @@ bool configCameraInvertY = false; bool configEnableCamera = false; bool configCameraAnalog = true; bool configCameraMouse = false; +bool configBowserCam = true; #endif bool configSkipIntro = 0; bool configHUD = true; @@ -136,6 +137,7 @@ static const struct ConfigOption options[] = { {.name = "bettercam_aggression", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraAggr}, {.name = "bettercam_pan_level", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraPan}, {.name = "bettercam_degrade", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraDegrade}, + {.name = "bettercam_bowser_cam", .type = CONFIG_TYPE_BOOL, .boolValue = &configBowserCam}, #endif {.name = "skip_intro", .type = CONFIG_TYPE_BOOL, .boolValue = &configSkipIntro}, #ifdef DISCORDRPC diff --git a/src/pc/configfile.h b/src/pc/configfile.h index b92ae7beae..8d7501cc62 100644 --- a/src/pc/configfile.h +++ b/src/pc/configfile.h @@ -53,6 +53,7 @@ extern bool configCameraInvertY; extern bool configEnableCamera; extern bool configCameraMouse; extern bool configCameraAnalog; +extern bool configBowserCam; #endif extern bool configHUD; extern bool configSkipIntro;