Various fixes

This commit is contained in:
Mors 2022-11-11 08:23:52 +03:00
parent 899af16c4c
commit 28b0792568
9 changed files with 56 additions and 55 deletions

View file

@ -281,37 +281,37 @@
"disabled_by": -1,
"name": "Remove Inconvenient Warps"
}, {
"internal_name": "improve_powerups",
"internal_name": "improved_powerups",
"description": "Makes it so that underwater shells last longer and Metal Mario sinks faster, and Metal Mario's interactions become more consistent.",
"os": OS_ANY,
"type": TYPE_BOOL,
"enabled_by": -1,
"disabled_by": -1,
"name": "Improve Powerups"
"name": "Improved Powerups"
}, {
"internal_name": "improve_enemies",
"internal_name": "improved_enemies",
"description": "Tweaks the behavior of some enemies, specifically Boos, Clams, and Tiny Goombas.",
"os": OS_ANY,
"type": TYPE_BOOL,
"enabled_by": -1,
"disabled_by": -1,
"name": "Improve Enemies"
"name": "Improved Enemies"
}, {
"internal_name": "improve_npcs",
"internal_name": "improved_npcs",
"description": "Makes talking with the NPCs easier and more consistent.",
"os": OS_ANY,
"type": TYPE_BOOL,
"enabled_by": -1,
"disabled_by": -1,
"name": "Improve NPCs"
"name": "Improved NPCs"
}, {
"internal_name": "improve_blast_away_the_wall",
"internal_name": "improved_blast_away_the_wall",
"description": "Prevents you from taking damage after hitting the breakable wall required for the \"Blast Away the Wall\" mission. Recommended when playing with the \"Permadeath Mode\" enabled.",
"os": OS_ANY,
"type": TYPE_BOOL,
"enabled_by": -1,
"disabled_by": -1,
"name": "Improve \"Blast Away the Wall\""
"name": "Improved \"Blast Away the Wall\""
}, {
"internal_name": "bring_mips_back",
"description": "Makes MIPS return to the castle after you collect 120 Power Stars.",

View file

@ -34,10 +34,10 @@ apply_bug_fixes = "2"
save_lives_to_save_file = "true"
make_items_respawn = "true"
remove_inconvenient_warps = "true"
improve_powerups = "true"
improve_enemies = "true"
improve_npcs = "true"
improve_blast_away_the_wall = "true"
improved_powerups = "true"
improved_enemies = "true"
improved_npcs = "true"
improved_blast_away_the_wall = "true"
bring_mips_back = "true"
disable_fall_damage = "true"
allow_leaving_the_course_at_any_time = "false"

View file

@ -34,10 +34,10 @@ apply_bug_fixes = "2"
save_lives_to_save_file = "true"
make_items_respawn = "true"
remove_inconvenient_warps = "true"
improve_powerups = "true"
improve_enemies = "true"
improve_npcs = "true"
improve_blast_away_the_wall = "true"
improved_powerups = "true"
improved_enemies = "true"
improved_npcs = "true"
improved_blast_away_the_wall = "true"
bring_mips_back = "true"
disable_fall_damage = "false"
allow_leaving_the_course_at_any_time = "false"

View file

@ -34,10 +34,10 @@ apply_bug_fixes = "0"
save_lives_to_save_file = "false"
make_items_respawn = "false"
remove_inconvenient_warps = "false"
improve_powerups = "false"
improve_enemies = "false"
improve_npcs = "false"
improve_blast_away_the_wall = "false"
improved_powerups = "false"
improved_enemies = "false"
improved_npcs = "false"
improved_blast_away_the_wall = "false"
bring_mips_back = "false"
disable_fall_damage = "false"
allow_leaving_the_course_at_any_time = "false"

View file

@ -193,7 +193,7 @@ static void boo_move_during_hit(s32 roll, f32 fVel) {
s32 oscillationVel = o->oTimer * 0x800 + 0x800;
o->oForwardVel = fVel;
o->oVelY = coss(oscillationVel) * (configBetterEnemies ? 0x200 : 1.0f);
o->oVelY = coss(oscillationVel) * (configBetterEnemies ? 8.0f : 1.0f);
o->oMoveAngleYaw = o->oBooMoveYawDuringHit;
if (roll != FALSE) {

View file

@ -1905,11 +1905,8 @@ void handle_cheats() {
}
}
if (gPlayer1Controller->buttonDown & L_TRIG && configDebugObjectSpawner) {
try_do_mario_debug_object_spawn();
}
}
if (gPlayer1Controller->buttonDown & L_TRIG && configDebugObjectSpawner)
try_do_mario_debug_object_spawn();
}
u32 mario_has_improved_metal_cap(struct MarioState *m) {

View file

@ -461,7 +461,7 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr
//! This check uses f32, but findFloor uses short (overflow jumps)
if (nextPos[1] <= floorHeight) {
if ((!configApplyBugFixes > 1) || (gMarioObject->platform == NULL | (m->vel[1]<=0))) {
if ((configApplyBugFixes <= 1) || (gMarioObject->platform == NULL | (m->vel[1]<=0))) {
if (ceilHeight - floorHeight > 160.0f) {
m->pos[0] = nextPos[0];
m->pos[2] = nextPos[2];

View file

@ -72,10 +72,10 @@ static const struct ConfigOption options[] = {
{ .name = "save_lives_to_save_file", .type = CONFIG_TYPE_BOOL, .boolValue = &configSaveLives },
{ .name = "make_items_respawn", .type = CONFIG_TYPE_BOOL, .boolValue = &configRespawnCertainItems },
{ .name = "remove_inconvenient_warps", .type = CONFIG_TYPE_BOOL, .boolValue = &configRemoveAnnoyingWarps },
{ .name = "improve_powerups", .type = CONFIG_TYPE_BOOL, .boolValue = &configBetterPowerups },
{ .name = "improve_enemies", .type = CONFIG_TYPE_BOOL, .boolValue = &configBetterEnemies },
{ .name = "improve_npcs", .type = CONFIG_TYPE_BOOL, .boolValue = &configTalkNPCs },
{ .name = "improve_blast_away_the_wall", .type = CONFIG_TYPE_BOOL, .boolValue = &configBetterBlastAwayTheWall },
{ .name = "improved_powerups", .type = CONFIG_TYPE_BOOL, .boolValue = &configBetterPowerups },
{ .name = "improved_enemies", .type = CONFIG_TYPE_BOOL, .boolValue = &configBetterEnemies },
{ .name = "improved_npcs", .type = CONFIG_TYPE_BOOL, .boolValue = &configTalkNPCs },
{ .name = "improved_blast_away_the_wall", .type = CONFIG_TYPE_BOOL, .boolValue = &configBetterBlastAwayTheWall },
{ .name = "bring_mips_back", .type = CONFIG_TYPE_BOOL, .boolValue = &configBringMipsBack },
{ .name = "disable_fall_damage", .type = CONFIG_TYPE_BOOL, .boolValue = &configDisableFallDamage },
{ .name = "allow_leaving_the_course_at_any_time", .type = CONFIG_TYPE_BOOL, .boolValue = &configLeaveAnyTime },

View file

@ -225,8 +225,11 @@ static void toggle_borderless_window_full_screen(bool enable, bool call_callback
SetWindowPos(dxgi.h_wnd, NULL, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_FRAMECHANGED);
ShowWindow(dxgi.h_wnd, SW_RESTORE);
}
ShowCursor(!mouse_capture || !gMouseCam);
mouse_visible = !mouse_capture || !gMouseCam;
if (!gMouseCam) {
ShowCursor(TRUE);
mouse_visible = true;
}
dxgi.is_full_screen = false;
} else {
@ -399,11 +402,6 @@ static void gfx_dxgi_init(const char *game_name, bool start_in_fullscreen) {
ATOM winclass = RegisterClassExW(&wcex);
if (gMouseCam) {
ShowCursor(FALSE);
mouse_visible = false;
}
run_as_dpi_aware([&] () {
// We need to be dpi aware when calculating the size
RECT wr = {0, 0, DESIRED_SCREEN_WIDTH, DESIRED_SCREEN_HEIGHT};
@ -421,6 +419,10 @@ static void gfx_dxgi_init(const char *game_name, bool start_in_fullscreen) {
if (start_in_fullscreen) {
toggle_borderless_window_full_screen(true, false);
}
if (start_in_fullscreen || gMouseCam) {
ShowCursor(FALSE);
mouse_visible = false;
}
}
static void gfx_dxgi_set_fullscreen_changed_callback(void (*on_fullscreen_changed)(bool is_now_fullscreen)) {
@ -469,24 +471,26 @@ static uint64_t qpc_to_us(uint64_t qpc) {
static bool gfx_dxgi_start_frame(void) {
// Before rendering, center the mouse cursor and set the mouse movement variables.
if (gMouseCam && mouse_capture) {
POINT cursorPoint;
GetCursorPos(&cursorPoint);
POINT screenPoint;
screenPoint.x = dxgi.current_width/2;
screenPoint.y = dxgi.current_height/2;
ClientToScreen(dxgi.h_wnd, &screenPoint);
dxgi.on_mouse_move(cursorPoint.x-screenPoint.x, cursorPoint.y-screenPoint.y);
SetCursorPos(screenPoint.x, screenPoint.y);
if (gMouseCam) {
if (mouse_capture) {
POINT cursorPoint;
GetCursorPos(&cursorPoint);
POINT screenPoint;
screenPoint.x = dxgi.current_width/2;
screenPoint.y = dxgi.current_height/2;
ClientToScreen(dxgi.h_wnd, &screenPoint);
dxgi.on_mouse_move(cursorPoint.x-screenPoint.x, cursorPoint.y-screenPoint.y);
SetCursorPos(screenPoint.x, screenPoint.y);
if (mouse_visible) {
ShowCursor(FALSE);
mouse_visible = false;
if (mouse_visible) {
ShowCursor(FALSE);
mouse_visible = false;
}
}
else if (!mouse_visible) {
ShowCursor(TRUE);
mouse_visible = true;
}
}
else if (!mouse_visible) {
ShowCursor(TRUE);
mouse_visible = true;
}
DXGI_FRAME_STATISTICS stats;