Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

ratio_q12_i32

Function ratio_q12_i32 

Source
pub fn ratio_q12_i32(numerator: i32, denominator: i32) -> i32
Expand description

Overflow-safe non-negative Q12 ratio, clamped to one.

HL-PSX also uses this for projection and guard-band interpolation outside polygon traversal, preventing a second overflow fix under a game-specific name.