pub fn scale_coordinates(
x: f32,
y: f32,
play_res_x: f32,
play_res_y: f32,
screen_width: f32,
screen_height: f32,
) -> (f32, f32) {
let scale_x = screen_width / play_res_x;
let scale_y = screen_height / play_res_y;
(x * scale_x, y * scale_y)
}
pub fn convert_ssa_alignment(ssa_align: u8) -> u8 {
let h_align = ssa_align & 3;
let v_align = (ssa_align >> 2) & 3;
let h_part = match h_align {
1 => 1, 2 => 2, 3 => 3, _ => 2, };
let v_part = match v_align {
0 => 0, 1 | 3 => 3, 2 => 6, _ => 0, };
h_part + v_part
}