Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions include/text_options_strings.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
37 changes: 34 additions & 3 deletions src/game/bettercamera.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -123,16 +124,22 @@ 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;
case LEVEL_WDW: newcam_yaw = 0x2000; newcam_tilt = 3000; newcam_distance_target = newcam_distance_values[1]; break;
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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/game/options_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/pc/configfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/pc/configfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down