mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2024-12-24 03:41:29 +11:00
Fixed overflow on windows
This commit is contained in:
parent
e89cb04189
commit
b46868121e
|
@ -284,13 +284,13 @@ impl Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_keys(&self) -> Vec<Key> {
|
pub fn get_keys(&self) -> Vec<Key> {
|
||||||
let mut index: u8 = 0;
|
let mut index: u16 = 0;
|
||||||
let mut keys: Vec<Key> = Vec::new();
|
let mut keys: Vec<Key> = Vec::new();
|
||||||
|
|
||||||
for i in self.keys.iter() {
|
for i in self.keys.iter() {
|
||||||
if *i {
|
if *i {
|
||||||
unsafe {
|
unsafe {
|
||||||
keys.push(mem::transmute(index));
|
keys.push(mem::transmute(index as u8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue