This commit is contained in:
ineedhelpbad 2024-02-09 11:43:34 +00:00 committed by GitHub
commit ed238fc7db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 41 additions and 3 deletions

View File

@ -122,6 +122,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")

View File

@ -119,6 +119,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;
@ -127,9 +128,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;
@ -137,6 +135,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;
@ -194,6 +201,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

View File

@ -73,6 +73,7 @@ static const u8 optsCameraStr[][32] = {
{ TEXT_OPT_MOUSE },
{ TEXT_OPT_CAMD },
{ TEXT_OPT_CAMON },
{TEXT_OPT_BOWSERCAM},
};
static const u8 optsVideoStr[][32] = {
@ -232,6 +233,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

View File

@ -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

View File

@ -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;