load_font now borrow rwops instead of consuming it

This commit is contained in:
Cobrand
2016-05-27 09:20:15 +02:00
parent 30c81b767e
commit 970ee3cd02
+2 -2
View File
@@ -42,7 +42,7 @@ impl Sdl2TtfContext {
/// Loads a font from the given SDL2 rwops object with the given size in
/// points.
pub fn load_font_from_rwops(&self, rwops: RWops, point_size: u16)
pub fn load_font_from_rwops(&self, rwops: &RWops, point_size: u16)
-> Result<Font, String> {
let raw = unsafe {
ffi::TTF_OpenFontRW(rwops.raw(), 0, point_size as c_int)
@@ -56,7 +56,7 @@ impl Sdl2TtfContext {
/// Loads the font at the given index of the SDL2 rwops object with
/// the given size in points.
pub fn load_font_at_index_from_rwops(&self, rwops: RWops, index: u32,
pub fn load_font_at_index_from_rwops(&self, rwops: &RWops, index: u32,
point_size: u16) -> Result<Font, String> {
let raw = unsafe {
ffi::TTF_OpenFontIndexRW(rwops.raw(), 0, point_size as c_int,