mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-11 03:21:32 +11:00
Ran rustfmt
This commit is contained in:
parent
0c1fd92275
commit
546cc762d8
|
@ -4,9 +4,9 @@ const WIDTH: usize = 1280;
|
||||||
const HEIGHT: usize = 720;
|
const HEIGHT: usize = 720;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut noise;
|
let mut noise;
|
||||||
let mut carry;
|
let mut carry;
|
||||||
let mut seed = 0xbeefu32;
|
let mut seed = 0xbeefu32;
|
||||||
|
|
||||||
let mut buffer: [u32; WIDTH * HEIGHT] = [0; WIDTH * HEIGHT];
|
let mut buffer: [u32; WIDTH * HEIGHT] = [0; WIDTH * HEIGHT];
|
||||||
|
|
||||||
|
@ -15,17 +15,17 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
while minifb::update(&buffer) {
|
while minifb::update(&buffer) {
|
||||||
for i in buffer.iter_mut() {
|
for i in buffer.iter_mut() {
|
||||||
noise = seed;
|
noise = seed;
|
||||||
noise >>= 3;
|
noise >>= 3;
|
||||||
noise ^= seed;
|
noise ^= seed;
|
||||||
carry = noise & 1;
|
carry = noise & 1;
|
||||||
noise >>= 1;
|
noise >>= 1;
|
||||||
seed >>= 1;
|
seed >>= 1;
|
||||||
seed |= carry << 30;
|
seed |= carry << 30;
|
||||||
noise &= 0xFF;
|
noise &= 0xFF;
|
||||||
*i = (noise << 16) | (noise << 8) | noise;
|
*i = (noise << 16) | (noise << 8) | noise;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
minifb::close();
|
minifb::close();
|
||||||
|
|
Loading…
Reference in a new issue