Remove int_uint feature from gfx.

This commit is contained in:
Josh Matthews 2015-04-07 11:58:28 -04:00
parent a277036dd9
commit a68fa74f4b
13 changed files with 103 additions and 97 deletions

View file

@ -111,20 +111,20 @@ pub fn transform_text(text: &str,
}
}
pub fn float_to_fixed(before: int, f: f64) -> i32 {
((1i32 << before as uint) as f64 * f) as i32
pub fn float_to_fixed(before: usize, f: f64) -> i32 {
((1i32 << before) as f64 * f) as i32
}
pub fn fixed_to_float(before: int, f: i32) -> f64 {
f as f64 * 1.0f64 / ((1i32 << before as uint) as f64)
pub fn fixed_to_float(before: usize, f: i32) -> f64 {
f as f64 * 1.0f64 / ((1i32 << before) as f64)
}
pub fn fixed_to_rounded_int(before: int, f: i32) -> int {
let half = 1i32 << (before-1) as uint;
pub fn fixed_to_rounded_int(before: isize, f: i32) -> isize {
let half = 1i32 << (before-1) as usize;
if f > 0i32 {
((half + f) >> before as uint) as int
((half + f) >> before) as isize
} else {
-((half - f) >> before as uint) as int
-((half - f) >> before) as isize
}
}