Closed RamonUnch closed 2 years ago
I've tested it and it's a bit slower, at least on PCem (486). I'll test tomorrow on real hardware to see how it behaves.
This is interesting indeed, I actually have no old hardware to test this. maybe the side-case dx==0 does reduces performances. In this case a perfect branchless equivalent would be needed:
side = (!!node->dx) & ((y <= node->y) ^ (node->dx >= 0));
Or something like that. I will see if I get some time.
Indeed does not seems to be a good idea in the end, I will hence close the issue then.
Well the idea is still the same that i submitted before:
is almost equivalent to
side = (y <= node->y) ^ (node->dx >= 0);
This applies toR_PointInSubsector()
and to the crazy nested ternary operators insideP_CrossSubsector()
andP_CrossBSPNode()
the only side case being when dx=0, then
side
can be set to true which was not possible before. I am not 100% sure this is correct though. Do you have any demo to check for regression or something.