diff --git a/uw8-window/src/gpu/mod.rs b/uw8-window/src/gpu/mod.rs index 8d97a40..61d5b87 100644 --- a/uw8-window/src/gpu/mod.rs +++ b/uw8-window/src/gpu/mod.rs @@ -126,15 +126,17 @@ impl Window { WindowEvent::KeyboardInput { input, .. } => { fn gamepad_button(input: &winit::event::KeyboardInput) -> u32 { match input.scancode { - 103 => 1, - 108 => 2, - 105 => 4, - 106 => 8, 44 => 16, 45 => 32, 30 => 64, 31 => 128, - _ => 0, + _ => match input.virtual_keycode { + Some(VirtualKeyCode::Up) => 1, + Some(VirtualKeyCode::Down) => 2, + Some(VirtualKeyCode::Left) => 4, + Some(VirtualKeyCode::Right) => 8, + _ => 0, + }, } } if input.state == winit::event::ElementState::Pressed { diff --git a/uw8-window/src/gpu/square.wgsl b/uw8-window/src/gpu/square.wgsl index fcdfae8..ad41c0e 100644 --- a/uw8-window/src/gpu/square.wgsl +++ b/uw8-window/src/gpu/square.wgsl @@ -32,7 +32,7 @@ fn aa_tex_coord(c: f32) -> f32 { let center = base + 0.5; let next = base + 1.0; if high > next { - return center + (high - next) / (high - base); + return center + (high - next) / (high - low); } else { return center; }