Browse Source

Translate impls to static inline

pull/137/head
Andrea Ciliberti 1 year ago
parent
commit
c3021fe39d
  1. 4
      ctru-rs/src/applets/mii_selector.rs
  2. 3
      ctru-rs/src/services/hid.rs

4
ctru-rs/src/applets/mii_selector.rs

@ -247,9 +247,7 @@ impl MiiSelector {
/// If there's no Mii at that index, the cursor will start at the Mii with the index 0. /// If there's no Mii at that index, the cursor will start at the Mii with the index 0.
#[doc(alias = "miiSelectorSetInitialIndex")] #[doc(alias = "miiSelectorSetInitialIndex")]
pub fn set_initial_index(&mut self, index: usize) { pub fn set_initial_index(&mut self, index: usize) {
// This function is static inline in libctru unsafe { ctru_sys::miiSelectorSetInitialIndex(self.config.as_mut(), index as u32) };
// https://github.com/devkitPro/libctru/blob/af5321c78ee5c72a55b526fd2ed0d95ca1c05af9/libctru/include/3ds/applets/miiselector.h#L155
self.config.initial_index = index as u32;
} }
/// Launch the Mii Selector. /// Launch the Mii Selector.

3
ctru-rs/src/services/hid.rs

@ -374,8 +374,7 @@ impl Hid {
/// ``` /// ```
#[doc(alias = "osGet3DSliderState")] #[doc(alias = "osGet3DSliderState")]
pub fn slider_3d(&self) -> f32 { pub fn slider_3d(&self) -> f32 {
// TODO: Replace with the static inline function `osGet3DSliderState`, which works the exact same way. unsafe { ctru_sys::osGet3DSliderState() }
unsafe { (*(ctru_sys::OS_SHAREDCFG_VADDR as *mut ctru_sys::osSharedConfig_s)).slider_3d }
} }
/// Activate/deactivate the console's acceleration sensor. /// Activate/deactivate the console's acceleration sensor.

Loading…
Cancel
Save