mirror of https://github.com/ZDoom/qzdoom.git
- optimized P_PointInSubsector.
It costs more to convert the floating point coordinate for each node check than to convert it once up front and only use fixed point math afterward.
This commit is contained in:
parent
c5c032911c
commit
8c1eb201eb
|
@ -1344,9 +1344,11 @@ subsector_t *P_PointInSubsector (double x, double y)
|
|||
|
||||
node = gamenodes + numgamenodes - 1;
|
||||
|
||||
fixed_t xx = FLOAT2FIXED(x);
|
||||
fixed_t yy = FLOAT2FIXED(y);
|
||||
do
|
||||
{
|
||||
side = R_PointOnSide (x, y, node);
|
||||
side = R_PointOnSide (xx, yy, node);
|
||||
node = (node_t *)node->children[side];
|
||||
}
|
||||
while (!((size_t)node & 1));
|
||||
|
|
Loading…
Reference in New Issue