fixed issues with Input API
This commit is contained in:
@@ -5,11 +5,7 @@ edition = "2024"
|
||||
license.workspace = true
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.228", features = ["derive"] }
|
||||
serde_json = "1.0.149"
|
||||
prometeu-vm = { path = "../prometeu-vm" }
|
||||
prometeu-kernel = { path = "../prometeu-kernel" }
|
||||
prometeu-bytecode = { path = "../prometeu-bytecode" }
|
||||
prometeu-abi = { path = "../prometeu-abi" }
|
||||
prometeu-hardware-contract = { path = "../prometeu-hardware-contract" }
|
||||
url = "2.5.8"
|
||||
@@ -10,5 +10,4 @@ pub use crate::asset::AssetManager;
|
||||
pub use crate::audio::{Audio, AudioCommand, Channel, MAX_CHANNELS, OUTPUT_SAMPLE_RATE};
|
||||
pub use crate::gfx::Gfx;
|
||||
pub use crate::memory_banks::MemoryBanks;
|
||||
pub use crate::pad::Pad;
|
||||
pub use crate::touch::Touch;
|
||||
pub use crate::pad::Pad;
|
||||
@@ -1,4 +1,4 @@
|
||||
use prometeu_abi::model::Button;
|
||||
use prometeu_abi::model::{Button};
|
||||
use prometeu_hardware_contract::{InputSignals, TouchBridge};
|
||||
|
||||
#[derive(Default, Clone, Copy, Debug)]
|
||||
@@ -8,13 +8,6 @@ pub struct Touch {
|
||||
pub y: i32,
|
||||
}
|
||||
|
||||
impl TouchBridge for Touch {
|
||||
fn begin_frame(&mut self, signals: &InputSignals) { self.begin_frame(signals) }
|
||||
fn f(&self) -> &Button { &self.f }
|
||||
fn x(&self) -> i32 { self.x }
|
||||
fn y(&self) -> i32 { self.y }
|
||||
}
|
||||
|
||||
impl Touch {
|
||||
/// Transient flags should last only 1 frame.
|
||||
pub fn begin_frame(&mut self, signals: &InputSignals) {
|
||||
@@ -23,3 +16,10 @@ impl Touch {
|
||||
self.y = signals.y_pos.clone();
|
||||
}
|
||||
}
|
||||
|
||||
impl TouchBridge for Touch {
|
||||
fn begin_frame(&mut self, signals: &InputSignals) { self.begin_frame(signals) }
|
||||
fn f(&self) -> &Button { &self.f }
|
||||
fn x(&self) -> i32 { self.x }
|
||||
fn y(&self) -> i32 { self.y }
|
||||
}
|
||||
Reference in New Issue
Block a user