Follow-up Comment #1, patch #1141 (project wesnoth): Overall, the patch looks fine, a quadtree is indeed the way to go in my opinion. A few things I have noticed:
First (but I guess this one you already know), use a more compact representation for quadtree::tree. Second, your halting condition ((rx - lx) * (ry - ly) > 48) seems dubious to me. Why is it not (rx - lx + 1) * (ry - ly + 1)? How did you decide on 48? Third, in quadtree::rects_ex, I don't understand the computation of tw and th. I would have expected them to finish with - x and - y instead of - 1 - x and - 1 - y. And similarly, I would have expected the assertions to be x + tw <= w and y + th <= h instead of x + tw < w and y + th < h. Fourth, in quadtree::rects_ex again, you don't have to erase the first column and then reparse it, you could directly jump to the end of it and continue from there. That's just an optimization though. _______________________________________________________ Reply to this item at: <http://gna.org/patch/?1141> _______________________________________________ Message posté via/par Gna! http://gna.org/ _______________________________________________ Wesnoth-bugs mailing list Wesnoth-bugs@gna.org https://mail.gna.org/listinfo/wesnoth-bugs