why not it work???

This commit is contained in:
Quaternions 2023-10-18 20:23:53 -07:00
parent 925dec1666
commit a3cd48b6db

View File

@ -122,7 +122,7 @@ fn write_input_instruction<W:std::io::Write>(state:&mut InputInstructionDeltaSta
|crate::physics::InputInstruction::Idle=>0u32,//TODO: don't write idle instructions |crate::physics::InputInstruction::Idle=>0u32,//TODO: don't write idle instructions
}; };
//instruction id packed with game control parity bit. This could be 1 byte but it ruins the alignment //instruction id packed with game control parity bit. This could be 1 byte but it ruins the alignment
w.write(&(ins.instruction as u32|parity).to_le_bytes());//4B w.write(&(unsafe{std::mem::transmute::<crate::physics::InputInstruction,u32>(ins.instruction)}|parity).to_le_bytes());//4B
match &ins.instruction{ match &ins.instruction{
&crate::physics::InputInstruction::MoveMouse(m)=>{//4B &crate::physics::InputInstruction::MoveMouse(m)=>{//4B
let dm=m-state.mouse_pos; let dm=m-state.mouse_pos;