mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-12-01 08:31:14 +00:00
- 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
1 changed files with 3 additions and 1 deletions
|
@ -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 a new issue