Skip to content

Commit

Permalink
Merge pull request #4 from Amjad50/general_fix_code_improvement
Browse files Browse the repository at this point in the history
General fix code improvement
  • Loading branch information
Amjad50 authored Jul 7, 2024
2 parents 74a3ffc + 62fb61e commit 27ed7fc
Show file tree
Hide file tree
Showing 41 changed files with 4,080 additions and 4,099 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@

[workspace]
resolver = "2"
members = [
"nes_ui_sfml",
"nes_ui_gtk",
"nes_ui_tui",
"nes_ui_native_windows",
"plastic_core",
]
default-members = ["nes_ui_sfml"]

[profile.dev]
opt-level = 2

[profile.release]
opt-level = 3



2 changes: 1 addition & 1 deletion nes_ui_gtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "nes_ui_gtk"
version = "0.1.0"
authors = ["Amjad Alsharafi <[email protected]>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
4 changes: 2 additions & 2 deletions nes_ui_gtk/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,13 @@ impl UiProvider for GtkProvider {
let label =
format!("_{} {}", i + 1, if label { "saved" } else { "<empty>" });

if let Some(item) = save_state_menu_list.get_children().get(i as usize)
if let Some(item) = save_state_menu_list.get_children().get(i )
{
if let Some(item) = item.downcast_ref::<MenuItem>() {
item.set_label(&label);
}
}
if let Some(item) = load_state_menu_list.get_children().get(i as usize)
if let Some(item) = load_state_menu_list.get_children().get(i )
{
if let Some(item) = item.downcast_ref::<MenuItem>() {
item.set_label(&label);
Expand Down
2 changes: 1 addition & 1 deletion nes_ui_native_windows/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "nes_ui_native_windows"
version = "0.1.0"
authors = ["Amjad Alsharafi <[email protected]>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion nes_ui_sfml/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "nes_ui_sfml"
version = "0.1.0"
authors = ["Amjad Alsharafi <[email protected]>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion nes_ui_tui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "nes_ui_tui"
version = "0.1.0"
authors = ["Amjad Alsharafi <[email protected]>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
4 changes: 2 additions & 2 deletions nes_ui_tui/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl Shape for ImageView {

for x in 0..TV_WIDTH {
for y in 0..TV_HEIGHT {
let index = ((TV_HEIGHT - y - 1) * TV_WIDTH + x) as usize;
let index = (TV_HEIGHT - y - 1) * TV_WIDTH + x;
if let Some((x, y)) = painter.get_point(x as f64, y as f64) {
let pixel = data.get(index * 4..(index + 1) * 4).unwrap();
painter.paint(x, y, Color::Rgb(pixel[0], pixel[1], pixel[2]));
Expand Down Expand Up @@ -171,7 +171,7 @@ impl UiProvider for TuiProvider {
active_gamepad = None;
}
}
keyboard_events.set_stopped_state(active_gamepad != None);
keyboard_events.set_stopped_state(active_gamepad.is_some());

if let Some(gamepad) = active_gamepad.map(|id| gilrs.gamepad(id)) {
for (controller_button, nes_button) in &[
Expand Down
2 changes: 1 addition & 1 deletion plastic_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "plastic_core"
version = "0.1.0"
authors = ["Amjad Alsharafi <[email protected]>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
Loading

0 comments on commit 27ed7fc

Please sign in to comment.