mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2025-12-02 01:18:37 +00:00
Puu black fix and reword Vsync options
This commit is contained in:
parent
ca1d7a8642
commit
11f335acc4
|
|
@ -60,15 +60,15 @@
|
||||||
"vsync_mode": {
|
"vsync_mode": {
|
||||||
"entry": "V-Sync:",
|
"entry": "V-Sync:",
|
||||||
"uncapped": "Uncapped",
|
"uncapped": "Uncapped",
|
||||||
"uncapped_desc": "No V-Sync, game runs at uncapped frame rate.",
|
"uncapped_desc": "V-Sync Off.",
|
||||||
"vsync": "Enabled",
|
"vsync": "Enabled",
|
||||||
"vsync_desc": "Frame rate is synchronized to V-Sync interval.",
|
"vsync_desc": "V-Sync On.",
|
||||||
"vrr_1x": "Variable Refresh Rate - 1x game tick",
|
"vrr_1x": "Variable Refresh Rate (1x)",
|
||||||
"vrr_1x_desc": "Synced to 1*TPS, uses (G-/Free)Sync if available.",
|
"vrr_1x_desc": "Uses (G-/Free)Sync if available.",
|
||||||
"vrr_2x": "Variable Refresh Rate - 2x game tick",
|
"vrr_2x": "Variable Refresh Rate (2x)",
|
||||||
"vrr_2x_desc": "Synced to 2*TPS, uses (G-/Free)Sync if available.",
|
"vrr_2x_desc": "Uses (G-/Free)Sync if available.",
|
||||||
"vrr_3x": "Variable Refresh Rate - 3x game tick",
|
"vrr_3x": "Variable Refresh Rate (3x)",
|
||||||
"vrr_3x_desc": "Synced to 3*TPS, uses (G-/Free)Sync if available."
|
"vrr_3x_desc": "Uses (G-/Free)Sync if available."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,15 +54,15 @@
|
||||||
"vsync_mode": {
|
"vsync_mode": {
|
||||||
"entry": "V-Sync:",
|
"entry": "V-Sync:",
|
||||||
"uncapped": "Uncapped",
|
"uncapped": "Uncapped",
|
||||||
"uncapped_desc": "No V-Sync, game runs at uncapped frame rate.",
|
"uncapped_desc": "V-Sync Off.",
|
||||||
"vsync": "Enabled",
|
"vsync": "Enabled",
|
||||||
"vsync_desc": "Frame rate is synchronized to V-Sync interval.",
|
"vsync_desc": "V-Sync On.",
|
||||||
"vrr_1x": "Variable Refresh Rate - 1x game tick",
|
"vrr_1x": "Variable Refresh Rate (1x)",
|
||||||
"vrr_1x_desc": "Synced to 1*TPS, uses (G-/Free)Sync if available.",
|
"vrr_1x_desc": "Uses (G-/Free)Sync if available.",
|
||||||
"vrr_2x": "Variable Refresh Rate - 2x game tick",
|
"vrr_2x": "Variable Refresh Rate (2x)",
|
||||||
"vrr_2x_desc": "Synced to 2*TPS, uses (G-/Free)Sync if available.",
|
"vrr_2x_desc": "Uses (G-/Free)Sync if available.",
|
||||||
"vrr_3x": "Variable Refresh Rate - 3x game tick",
|
"vrr_3x": "Variable Refresh Rate (3x)",
|
||||||
"vrr_3x_desc": "Synced to 3*TPS, uses (G-/Free)Sync if available."
|
"vrr_3x_desc": "Uses (G-/Free)Sync if available."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sound": "サウンド",
|
"sound": "サウンド",
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@ impl SettingsMenu {
|
||||||
_ => (),
|
_ => (),
|
||||||
},
|
},
|
||||||
CurrentMenu::GraphicsMenu => match self.graphics.tick(controller, state) {
|
CurrentMenu::GraphicsMenu => match self.graphics.tick(controller, state) {
|
||||||
MenuSelectionResult::Selected(0, toggle) => {
|
MenuSelectionResult::Selected(0, toggle) | MenuSelectionResult::Right(0, toggle, _) => {
|
||||||
if let MenuEntry::DescriptiveOptions(_, value, _, _) = toggle {
|
if let MenuEntry::DescriptiveOptions(_, value, _, _) = toggle {
|
||||||
let (new_mode, new_value) = match *value {
|
let (new_mode, new_value) = match *value {
|
||||||
0 => (VSyncMode::VSync, 1),
|
0 => (VSyncMode::VSync, 1),
|
||||||
|
|
@ -295,7 +295,24 @@ impl SettingsMenu {
|
||||||
|
|
||||||
*value = new_value;
|
*value = new_value;
|
||||||
state.settings.vsync_mode = new_mode;
|
state.settings.vsync_mode = new_mode;
|
||||||
graphics::set_vsync_mode(ctx, new_mode);
|
graphics::set_vsync_mode(ctx, new_mode)?;
|
||||||
|
|
||||||
|
let _ = state.settings.save(ctx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MenuSelectionResult::Left(0, toggle, _) => {
|
||||||
|
if let MenuEntry::DescriptiveOptions(_, value, _, _) = toggle {
|
||||||
|
let (new_mode, new_value) = match *value {
|
||||||
|
0 => (VSyncMode::VRRTickSync3x, 4),
|
||||||
|
1 => (VSyncMode::Uncapped, 0),
|
||||||
|
2 => (VSyncMode::VSync, 1),
|
||||||
|
3 => (VSyncMode::VRRTickSync1x, 2),
|
||||||
|
_ => (VSyncMode::VRRTickSync2x, 3),
|
||||||
|
};
|
||||||
|
|
||||||
|
*value = new_value;
|
||||||
|
state.settings.vsync_mode = new_mode;
|
||||||
|
graphics::set_vsync_mode(ctx, new_mode)?;
|
||||||
|
|
||||||
let _ = state.settings.save(ctx);
|
let _ = state.settings.save(ctx);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -755,9 +755,7 @@ impl NPC {
|
||||||
} else {
|
} else {
|
||||||
self.anim_num = if self.direction != Direction::Left { 1 } else { 0 };
|
self.anim_num = if self.direction != Direction::Left { 1 } else { 0 };
|
||||||
|
|
||||||
self.anim_rect.top += self.action_counter3 / 8;
|
|
||||||
self.y = ((self.action_counter3 as i32 / 8) * 0x200) + self.target_y;
|
self.y = ((self.action_counter3 as i32 / 8) * 0x200) + self.target_y;
|
||||||
self.anim_rect.left -= if (self.action_counter3 & 0x02) != 0 { 1 } else { 0 };
|
|
||||||
}
|
}
|
||||||
if self.action_counter3 % 3 == 2 {
|
if self.action_counter3 % 3 == 2 {
|
||||||
let mut npc = NPC::create(161, &state.npc_table);
|
let mut npc = NPC::create(161, &state.npc_table);
|
||||||
|
|
@ -787,6 +785,11 @@ impl NPC {
|
||||||
|
|
||||||
self.anim_rect = state.constants.npc.n162_puu_black_dead[self.anim_num as usize];
|
self.anim_rect = state.constants.npc.n162_puu_black_dead[self.anim_num as usize];
|
||||||
|
|
||||||
|
if self.action_num == 2 && self.action_counter3 <= 240 {
|
||||||
|
self.anim_rect.top += self.action_counter3 / 8;
|
||||||
|
self.anim_rect.left -= if (self.action_counter3 & 0x02) != 0 { 1 } else { 0 };
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue