Port to fixed point math

This commit is contained in:
2026-08-24 21:54:23 +02:00
parent 91c5c4e05f
commit 73855ea354
27 changed files with 703 additions and 229 deletions
+5 -4
View File
@@ -6,6 +6,7 @@ use bevy::prelude::*;
use bevy_ggrs::{LocalInputs, LocalPlayers};
use crate::input::{BaseInputMap, FighterInputFrame, InputActionState, InputMapAction};
use crate::math::int::FGi32;
use crate::netcode::GGRSCfg;
pub fn preprocess_keyboard_input(
@@ -32,16 +33,16 @@ pub fn preprocess_keyboard_input(
};
let action_strength = match action_state {
InputActionState::JustPressed | InputActionState::Pressed => 1.0f32,
InputActionState::JustReleased | InputActionState::Released => 0.0f32,
InputActionState::JustPressed | InputActionState::Pressed => FGi32::ONE,
InputActionState::JustReleased | InputActionState::Released => FGi32::ZERO,
};
match keyboard_elment.action {
InputMapAction::MovementXDir(sign) => {
input_frame.movement.x += (sign as f32) * action_strength
input_frame.movement.x += (sign) * action_strength
}
InputMapAction::MovementYDir(sign) => {
input_frame.movement.y += (sign as f32) * action_strength
input_frame.movement.y += (sign) * action_strength
}
InputMapAction::Jump => todo!(),
}