forked from karx/catbox
Merge remote-tracking branch 'gallant/master'
This commit is contained in:
commit
26d6746065
10
src/lib.rs
10
src/lib.rs
|
@ -188,7 +188,7 @@ pub struct Sprite {
|
|||
pub rect: Rect,
|
||||
surf: Surface<'static>,
|
||||
angle: f64,
|
||||
is_platform: bool,
|
||||
|
||||
}
|
||||
|
||||
impl Sprite {
|
||||
|
@ -199,7 +199,7 @@ impl Sprite {
|
|||
/// # use cat_box::*;
|
||||
/// let s = Sprite::new("duck.png", 500, 400).unwrap();
|
||||
/// ```
|
||||
pub fn new<P: AsRef<Path>>(path: P, x: i32, y: i32, plat: bool) -> Result<Self> {
|
||||
pub fn new<P: AsRef<Path>>(path: P, x: i32, y: i32) -> Result<Self> {
|
||||
let ops = RWops::from_file(path, "r")?;
|
||||
let surf = ops.load()?;
|
||||
|
||||
|
@ -210,7 +210,7 @@ impl Sprite {
|
|||
rect: dest_rect,
|
||||
surf,
|
||||
angle: 0.0,
|
||||
is_platform: plat,
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ impl Sprite {
|
|||
/// let bytes = include_bytes!("../duck.png");
|
||||
/// let s = Sprite::from_bytes(bytes, 500, 400).unwrap();
|
||||
/// ```
|
||||
pub fn from_bytes<B: AsRef<[u8]>>(bytes: B, x: i32, y: i32, plat: bool) -> Result<Self> {
|
||||
pub fn from_bytes<B: AsRef<[u8]>>(bytes: B, x: i32, y: i32) -> Result<Self> {
|
||||
let ops = RWops::from_bytes(bytes.as_ref())?;
|
||||
let surf = ops.load()?;
|
||||
|
||||
|
@ -233,7 +233,7 @@ impl Sprite {
|
|||
rect: dest_rect,
|
||||
surf,
|
||||
angle: 0.0,
|
||||
is_platform: plat,
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue