RoundToGridCeilAlt
function · gxumath · unreached
- Address
0x5c64b0· 50 bytes, up to0x5c64e1- Signature
double __stdcall (float x)- Meaning
- Returns ceil(floor(16x + 0.5)/16) of a float, the same code as 0x5c6470
- Confidence
- verified, proof one
- Finding
- gxumath#decal-grid-rounding
Finding: Decal grid rounding in gxumath
0x5c63d0 (ecx a capability record, edx an (x, y) pair, the output on the stack, ret 4)
writes (g(x), g(y), 1) for g(v) = ceil(floor(16v + 0.5)/16) when the dword at +8 of the record
is nonzero, using 0x5c6470 if the dword at +4 is 0 and 0x5c64b0 if not; the two are the same
code. With +8 zero it writes nothing. The result is a whole number: the 53-bit product 16v
plus the double 0.5 is floored, scaled by 1/16 and ceiled.
The derivation is in the doc.
Callers 1
- SnapDecalPoint gxumath
Callees 2
Calls and jumps by a bare address, from tables/calls.tsv.