diff --git a/ctru-rs/examples/gfx-3d-mode.rs b/ctru-rs/examples/gfx-3d-mode.rs index 4108694..596630e 100644 --- a/ctru-rs/examples/gfx-3d-mode.rs +++ b/ctru-rs/examples/gfx-3d-mode.rs @@ -1,5 +1,5 @@ use ctru::prelude::*; -use ctru::services::gfx::{Screen, Side, Swap, TopScreen3D}; +use ctru::services::gfx::{Flush, Screen, Side, Swap, TopScreen3D}; /// See `graphics-bitmap.rs` for details on how the image is generated. /// diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 6bbb02d..65c23c2 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -89,6 +89,9 @@ impl SwappableScreen for TopScreen {} impl SwappableScreen for BottomScreen {} impl Swap for S { + /// Swaps the video buffers. + /// + /// This should be used even if double buffering is disabled. fn swap_buffers(&mut self) { unsafe { ctru_sys::gfxScreenSwapBuffers(self.side().into(), false); @@ -97,6 +100,7 @@ impl Swap for S { } pub trait Flush: private::Sealed { + /// Flushes the video buffer for this screen. fn flush_buffer(&mut self); } diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 2db0d23..79a649b 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -13,10 +13,10 @@ bitflags::bitflags! { const B = ctru_sys::KEY_B; const SELECT = ctru_sys::KEY_SELECT; const START = ctru_sys::KEY_START; - const DRIGHT = ctru_sys::KEY_DRIGHT; - const DLEFT = ctru_sys::KEY_DLEFT; - const DUP = ctru_sys::KEY_DUP; - const DDOWN = ctru_sys::KEY_DDOWN; + const DPAD_RIGHT = ctru_sys::KEY_DRIGHT; + const DPAD_LEFT = ctru_sys::KEY_DLEFT; + const DPAD_UP = ctru_sys::KEY_DUP; + const DPAD_DOWN = ctru_sys::KEY_DDOWN; const R = ctru_sys::KEY_R; const L = ctru_sys::KEY_L; const X = ctru_sys::KEY_X; @@ -33,10 +33,10 @@ bitflags::bitflags! { const CPAD_UP = ctru_sys::KEY_CPAD_UP; const CPAD_DOWN = ctru_sys::KEY_CPAD_DOWN; // Convenience catch-all for the dpad and cpad - const UP = KeyPad::DUP.bits() | KeyPad::CPAD_UP.bits(); - const DOWN = KeyPad::DDOWN.bits() | KeyPad::CPAD_DOWN.bits(); - const LEFT = KeyPad::DLEFT.bits() | KeyPad::CPAD_LEFT.bits(); - const RIGHT = KeyPad::DRIGHT.bits() | KeyPad::CPAD_RIGHT.bits(); + const UP = KeyPad::DPAD_UP.bits() | KeyPad::CPAD_UP.bits(); + const DOWN = KeyPad::DPAD_DOWN.bits() | KeyPad::CPAD_DOWN.bits(); + const LEFT = KeyPad::DPAD_LEFT.bits() | KeyPad::CPAD_LEFT.bits(); + const RIGHT = KeyPad::DPAD_RIGHT.bits() | KeyPad::CPAD_RIGHT.bits(); } } diff --git a/ctru-rs/src/services/mod.rs b/ctru-rs/src/services/mod.rs index 6b9e115..1d31dea 100644 --- a/ctru-rs/src/services/mod.rs +++ b/ctru-rs/src/services/mod.rs @@ -34,6 +34,10 @@ cfg_if::cfg_if! { //! [package.metadata.cargo-3ds] //! romfs_dir = "romfs" //! ``` + + // If the feature is set, but no "romfs" directory was found: send an error during compilation. + #[cfg(feature = "romfs")] + compile_error!("romfs feature is enabled but no romfs found!"); } } }