mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
fix some typos
This commit is contained in:
+2
-2
@@ -106,7 +106,7 @@ impl AudioSubsystem {
|
||||
pub fn num_audio_playback_devices(&self) -> Option<u32> {
|
||||
let result = unsafe { sys::SDL_GetNumAudioDevices(0) };
|
||||
if result < 0 {
|
||||
// SDL cannot retreive a list of audio devices. This is not necessarily an error (see the SDL2 docs).
|
||||
// SDL cannot retrieve a list of audio devices. This is not necessarily an error (see the SDL2 docs).
|
||||
None
|
||||
} else {
|
||||
Some(result as u32)
|
||||
@@ -330,7 +330,7 @@ where Self::Channel: AudioFormatNum + 'static
|
||||
fn callback(&mut self, &mut [Self::Channel]);
|
||||
}
|
||||
|
||||
/// A phantom type for retreiving the `SDL_AudioFormat` of a given generic type.
|
||||
/// A phantom type for retrieving the `SDL_AudioFormat` of a given generic type.
|
||||
/// All format types are returned as native-endian.
|
||||
pub trait AudioFormatNum {
|
||||
fn audio_format() -> AudioFormat;
|
||||
|
||||
@@ -45,7 +45,7 @@ impl error::Error for AddMappingError {
|
||||
}
|
||||
|
||||
impl GameControllerSubsystem {
|
||||
/// Retreive the total number of attached joysticks *and* controllers identified by SDL.
|
||||
/// Retrieve the total number of attached joysticks *and* controllers identified by SDL.
|
||||
pub fn num_joysticks(&self) -> Result<u32, String> {
|
||||
let result = unsafe { sys::SDL_NumJoysticks() };
|
||||
|
||||
@@ -67,7 +67,7 @@ impl GameControllerSubsystem {
|
||||
|
||||
/// Attempt to open the controller ad index `joystick_index` and return it.
|
||||
/// Controller IDs are the same as joystick IDs and the maximum number can
|
||||
/// be retreived using the `SDL_NumJoysticks` function.
|
||||
/// be retrieved using the `SDL_NumJoysticks` function.
|
||||
pub fn open(&self, joystick_index: u32) -> Result<GameController, IntegerOrSdlError> {
|
||||
use common::IntegerOrSdlError::*;
|
||||
let joystick_index = try!(validate_int(joystick_index, "joystick_index"));
|
||||
|
||||
+1
-1
@@ -1160,7 +1160,7 @@ impl Event {
|
||||
timestamp: timestamp,
|
||||
which: which,
|
||||
// This conversion turns an i32 into a u8; signed-to-unsigned conversions
|
||||
// are a bit of a code smellx, but that appears to be how SDL defines it.
|
||||
// are a bit of a code smell, but that appears to be how SDL defines it.
|
||||
button: buttonval as u8,
|
||||
state: sys::SDL_PRESSED as u8,
|
||||
padding1: 0,
|
||||
|
||||
@@ -40,7 +40,7 @@ mod ll {
|
||||
pub trait RotozoomSurface {
|
||||
/// Rotates and zooms a surface and optional anti-aliasing.
|
||||
fn rotozoom(&self, angle: f64, zoom: f64, smooth: bool) -> Result<Surface, String>;
|
||||
/// Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing.
|
||||
/// Rotates and zooms a surface with different horizontal and vertical scaling factors and optional anti-aliasing.
|
||||
fn rotozoom_xy(&self, angle: f64, zoomx: f64, zoomy: f64, smooth: bool) -> Result<Surface, String>;
|
||||
/// Zoom a surface by independent horizontal and vertical factors with optional smoothing.
|
||||
fn zoom(&self, zoomx: f64, zoomy: f64, smooth: bool) -> Result<Surface, String>;
|
||||
|
||||
@@ -172,7 +172,7 @@ impl<T> LoadTexture for TextureCreator<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Context manager for `sdl2_image` to manage quiting. Can't do much with it but
|
||||
/// Context manager for `sdl2_image` to manage quitting. Can't do much with it but
|
||||
/// keep it alive while you are using it.
|
||||
pub struct Sdl2ImageContext;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ use libc::c_char;
|
||||
use common::{validate_int, IntegerOrSdlError};
|
||||
|
||||
impl JoystickSubsystem {
|
||||
/// Retreive the total number of attached joysticks *and* controllers identified by SDL.
|
||||
/// Retrieve the total number of attached joysticks *and* controllers identified by SDL.
|
||||
pub fn num_joysticks(&self) -> Result<u32, String> {
|
||||
let result = unsafe { sys::SDL_NumJoysticks() };
|
||||
|
||||
@@ -125,7 +125,7 @@ impl Joystick {
|
||||
}
|
||||
}
|
||||
|
||||
/// Retreive the joystick's GUID
|
||||
/// Retrieve the joystick's GUID
|
||||
pub fn guid(&self) -> Guid {
|
||||
let raw = unsafe { sys::SDL_JoystickGetGUID(self.raw) };
|
||||
|
||||
@@ -139,7 +139,7 @@ impl Joystick {
|
||||
}
|
||||
}
|
||||
|
||||
/// Retreive the number of axes for this joystick
|
||||
/// Retrieve the number of axes for this joystick
|
||||
pub fn num_axes(&self) -> u32 {
|
||||
let result = unsafe { sys::SDL_JoystickNumAxes(self.raw) };
|
||||
|
||||
@@ -178,7 +178,7 @@ impl Joystick {
|
||||
}
|
||||
}
|
||||
|
||||
/// Retreive the number of buttons for this joystick
|
||||
/// Retrieve the number of buttons for this joystick
|
||||
pub fn num_buttons(&self) -> u32 {
|
||||
let result = unsafe { sys::SDL_JoystickNumButtons(self.raw) };
|
||||
|
||||
@@ -219,7 +219,7 @@ impl Joystick {
|
||||
}
|
||||
}
|
||||
|
||||
/// Retreive the number of balls for this joystick
|
||||
/// Retrieve the number of balls for this joystick
|
||||
pub fn num_balls(&self) -> u32 {
|
||||
let result = unsafe { sys::SDL_JoystickNumBalls(self.raw) };
|
||||
|
||||
@@ -248,7 +248,7 @@ impl Joystick {
|
||||
}
|
||||
}
|
||||
|
||||
/// Retreive the number of balls for this joystick
|
||||
/// Retrieve the number of balls for this joystick
|
||||
pub fn num_hats(&self) -> u32 {
|
||||
let result = unsafe { sys::SDL_JoystickNumHats(self.raw) };
|
||||
|
||||
@@ -346,7 +346,7 @@ impl Guid {
|
||||
}
|
||||
|
||||
// The buffer should always be NUL terminated (the
|
||||
// documentation doesn't explicitely say it but I checked the
|
||||
// documentation doesn't explicitly say it but I checked the
|
||||
// code)
|
||||
if c_str.is_null() {
|
||||
String::new()
|
||||
|
||||
@@ -964,7 +964,7 @@ impl<'a> Music<'a> {
|
||||
pub fn unhook_finished() {
|
||||
unsafe {
|
||||
ffi::Mix_HookMusicFinished(None);
|
||||
// unset from c, then rust, to avoid race condiction
|
||||
// unset from c, then rust, to avoid race condition
|
||||
MUSIC_FINISHED_HOOK = None;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ impl<'a> DerefMut for WindowSurfaceRef<'a> {
|
||||
impl<'a> WindowSurfaceRef<'a> {
|
||||
/// Updates the change made to the inner Surface to the Window it was created from.
|
||||
///
|
||||
/// This would effectively be the theorical equivalent of `present` from a Canvas.
|
||||
/// This would effectively be the theoretical equivalent of `present` from a Canvas.
|
||||
pub fn update_window(&self) -> Result<(), String> {
|
||||
unsafe {
|
||||
if sys::SDL_UpdateWindowSurface(self.1.context.raw) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user