implements PLN-0103
This commit is contained in:
@@ -10,7 +10,10 @@ use crate::pad::Pad;
|
||||
use crate::touch::Touch;
|
||||
use prometeu_hal::cartridge::AssetsPayloadSource;
|
||||
use prometeu_hal::sprite::Sprite;
|
||||
use prometeu_hal::{AssetBridge, AudioBridge, GfxBridge, HardwareBridge, PadBridge, TouchBridge};
|
||||
use prometeu_hal::{
|
||||
AssetBridge, AudioBridge, GfxBridge, HardwareBridge, InputPlatform, NoopTelemetryPlatform,
|
||||
PadBridge, RenderBackend, RuntimePlatform, TelemetryPlatform, TouchBridge,
|
||||
};
|
||||
use prometeu_hal::{
|
||||
Game2DFrameComposer, Game2DFramePacket, RenderSubmission, RenderSubmissionPacket,
|
||||
};
|
||||
@@ -151,6 +154,12 @@ impl RenderSubmissionSink for Hardware {
|
||||
}
|
||||
}
|
||||
|
||||
impl RenderBackend for Hardware {
|
||||
fn render_frame(&mut self) {
|
||||
HardwareBridge::render_frame(self);
|
||||
}
|
||||
}
|
||||
|
||||
impl Game2DFrameComposer for Hardware {
|
||||
fn begin_frame(&mut self) {
|
||||
self.frame_composer.begin_frame();
|
||||
@@ -190,6 +199,68 @@ impl Game2DFrameComposer for Hardware {
|
||||
}
|
||||
}
|
||||
|
||||
impl InputPlatform for Hardware {
|
||||
fn pad(&self) -> &dyn PadBridge {
|
||||
&self.pad
|
||||
}
|
||||
|
||||
fn pad_mut(&mut self) -> &mut dyn PadBridge {
|
||||
&mut self.pad
|
||||
}
|
||||
|
||||
fn touch(&self) -> &dyn TouchBridge {
|
||||
&self.touch
|
||||
}
|
||||
|
||||
fn touch_mut(&mut self) -> &mut dyn TouchBridge {
|
||||
&mut self.touch
|
||||
}
|
||||
}
|
||||
|
||||
static NOOP_TELEMETRY: NoopTelemetryPlatform = NoopTelemetryPlatform;
|
||||
|
||||
impl RuntimePlatform for Hardware {
|
||||
fn render_submission_sink(&mut self) -> &mut dyn RenderSubmissionSink {
|
||||
self
|
||||
}
|
||||
|
||||
fn render_backend(&mut self) -> &mut dyn RenderBackend {
|
||||
self
|
||||
}
|
||||
|
||||
fn game2d_frame_composer(&mut self) -> &mut dyn Game2DFrameComposer {
|
||||
self
|
||||
}
|
||||
|
||||
fn audio(&self) -> &dyn prometeu_hal::AudioPlatform {
|
||||
&self.audio
|
||||
}
|
||||
|
||||
fn audio_mut(&mut self) -> &mut dyn prometeu_hal::AudioPlatform {
|
||||
&mut self.audio
|
||||
}
|
||||
|
||||
fn input(&self) -> &dyn InputPlatform {
|
||||
self
|
||||
}
|
||||
|
||||
fn input_mut(&mut self) -> &mut dyn InputPlatform {
|
||||
self
|
||||
}
|
||||
|
||||
fn assets(&self) -> &dyn prometeu_hal::AssetStoragePlatform {
|
||||
&self.assets
|
||||
}
|
||||
|
||||
fn assets_mut(&mut self) -> &mut dyn prometeu_hal::AssetStoragePlatform {
|
||||
&mut self.assets
|
||||
}
|
||||
|
||||
fn telemetry(&self) -> &dyn TelemetryPlatform {
|
||||
&NOOP_TELEMETRY
|
||||
}
|
||||
}
|
||||
|
||||
impl Hardware {
|
||||
/// Internal hardware width in pixels.
|
||||
pub const W: usize = 480;
|
||||
|
||||
Reference in New Issue
Block a user