mirror of
https://github.com/touchHLE/rust-sdl2.git
synced 2026-01-31 01:25:23 +01:00
Remove dependency on the rand crate
This commit is contained in:
@@ -18,7 +18,6 @@ path = "src/sdl2/lib.rs"
|
||||
[dependencies]
|
||||
bitflags = "^1"
|
||||
libc = "^0.2"
|
||||
rand = "^0.6"
|
||||
lazy_static = "^1"
|
||||
|
||||
[dependencies.num]
|
||||
@@ -33,6 +32,9 @@ version = "^0.32"
|
||||
version = ">= 1.0, <= 1.3"
|
||||
optional = true
|
||||
|
||||
[dev-dependencies]
|
||||
rand = "^0.7"
|
||||
|
||||
[features]
|
||||
|
||||
unsafe_textures = []
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
extern crate rand;
|
||||
use self::rand::Rng;
|
||||
use self::rand::distributions::{Distribution, Standard};
|
||||
|
||||
use num::FromPrimitive;
|
||||
use std::mem::transmute;
|
||||
use std::convert::TryFrom;
|
||||
@@ -171,16 +167,6 @@ impl From<(u8, u8, u8, u8)> for Color {
|
||||
}
|
||||
}
|
||||
|
||||
impl Distribution<Color> for Standard {
|
||||
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Color {
|
||||
if rng.gen() {
|
||||
Color::RGBA(rng.gen(), rng.gen(), rng.gen(), rng.gen())
|
||||
} else {
|
||||
Color::RGB(rng.gen(), rng.gen(), rng.gen())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct PixelMasks {
|
||||
/// Bits per pixel; usually 15, 16, or 32
|
||||
pub bpp: u8,
|
||||
|
||||
Reference in New Issue
Block a user