fixed issues with Input API

This commit is contained in:
2026-03-24 13:40:30 +00:00
parent 0a087d51fb
commit 2592b1a1d1
17 changed files with 457 additions and 90 deletions
-4
View File
@@ -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"
+1 -2
View File
@@ -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;
+8 -8
View File
@@ -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 }
}