diff --git a/crates/kammy/src/editor/map.rs b/crates/kammy/src/editor/map.rs index 8b31010..29e35c8 100644 --- a/crates/kammy/src/editor/map.rs +++ b/crates/kammy/src/editor/map.rs @@ -15,7 +15,7 @@ use pm64::model::ModelNode; use super::{Editor, EditorContext, EditorId}; use crate::Project; -use crate::widget::rdp_viewport::RdpViewport; +use crate::widget::n64_viewport::N64Viewport; const FB_WIDTH: u32 = 320; const FB_HEIGHT: u32 = 240; @@ -25,7 +25,7 @@ const FB_ORIGIN: u32 = 0x0000_0100; /// Editor that renders PM64 map geometry via the N64 RSP + RDP pipeline. pub struct MapEditor { id: EditorId, - viewport: RdpViewport, + viewport: N64Viewport, camera: camera::OrbitCamera, } @@ -42,7 +42,7 @@ impl MapEditor { pub fn new(id: EditorId) -> Self { Self { id, - viewport: RdpViewport::new(4 * 1024 * 1024), + viewport: N64Viewport::new(4 * 1024 * 1024), camera: camera::OrbitCamera::default(), } } @@ -147,8 +147,8 @@ fn extract_vertex(v: &pm64::model::Vertex) -> VertexData { /// /// Matches the game's 320x240 16-bit non-interlaced mode with gamma off, /// dither filter on, divot on, and AA mode 1. -fn vi_config_ntsc(fb_origin: u32) -> crate::widget::rdp_viewport::ViConfig { - crate::widget::rdp_viewport::ViConfig { +fn vi_config_ntsc(fb_origin: u32) -> crate::widget::n64_viewport::ViConfig { + crate::widget::n64_viewport::ViConfig { // Base 0x0311E with gamma/gamma_dither cleared, dither_filter set control: 0x0001_3112, origin: fb_origin, diff --git a/crates/kammy/src/widget.rs b/crates/kammy/src/widget.rs index d5de886..1044700 100644 --- a/crates/kammy/src/widget.rs +++ b/crates/kammy/src/widget.rs @@ -4,4 +4,4 @@ //! Reusable egui widgets for kammy. -pub mod rdp_viewport; +pub mod n64_viewport; diff --git a/crates/kammy/src/widget/rdp_viewport.rs b/crates/kammy/src/widget/n64_viewport.rs similarity index 98% rename from crates/kammy/src/widget/rdp_viewport.rs rename to crates/kammy/src/widget/n64_viewport.rs index 05efe65..446197e 100644 --- a/crates/kammy/src/widget/rdp_viewport.rs +++ b/crates/kammy/src/widget/n64_viewport.rs @@ -45,7 +45,7 @@ pub struct ViConfig { /// /// The renderer is created lazily on the first [`ui`](Self::ui) call that /// receives a GPU context. -pub struct RdpViewport { +pub struct N64Viewport { renderer: Option, rdram_size: u32, /// Persistent RSP renderer — avoids 4 MB RDRAM allocation per frame. @@ -68,15 +68,15 @@ struct PendingScanout { height: u32, } -impl std::fmt::Debug for RdpViewport { +impl std::fmt::Debug for N64Viewport { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("RdpViewport") + f.debug_struct("N64Viewport") .field("texture_id", &self.texture_id) .finish_non_exhaustive() } } -impl Drop for RdpViewport { +impl Drop for N64Viewport { fn drop(&mut self) { // Wait for any in-flight GPU work before destroying the renderer. if let (Some(timeline), Some(renderer)) = @@ -90,7 +90,7 @@ impl Drop for RdpViewport { } } -impl RdpViewport { +impl N64Viewport { /// Creates a new viewport. /// /// `rdram_size` is the RDRAM capacity in bytes (typically 4 MiB). The