Originally Posted by ircdirk
Ok, ill let u now when i need help But there is one thing u can do. Sometimes theres more than 100 cords for one objective so maybe u can change your functions not to be limited to 100 points???
Another thing is that some quests have more than 1000 cords per objective in wowhead db. So the quest file will be so large that it will make load WoW much much longer. I think like max 100-200 cords for objective will be fine but dont know how to choose them. First 100 wouldnt be good in this case...
|
It is not limited in amount of coords, it is just that the x/y coordinates on the grid are limited to 0-99, because that is actually the case. The corresponding code is this:
Code:
for ($c = 0; $c < count($coords); $c++) { ...
This takes all coordinates, not only the first 100.
But here's an idea: you could pre-filter the coords - those that rounded amount to the same point doesn't need to run through the bresenham algorithm once more - this could improve the speed on those objective with more than 1000 points:
Code:
function coords2grid($coords, $radius = 5, $shrink) {
$grid = newgrid();
$points = newgrid();
for ($c = 0; $c < count($coords); $c++) {
$cx = round($coords[$c]['x']);
$cy = round($coords[$c]['y']);
if ($points[$cx][$cy] == 1) { continue; }
$points[$cx][$cy] = 1;
$rx = $radius;
$ry = 0;
$rerr = $radius;
...