Hello, Matthieu Fertré a écrit : > I'm not sure it's always possible to remove the duplicates. It should be > possible if on each layer (4 layers: sky, wind particles, ground, all > other objects), 2 objects of the same size can not be at a same position > => collisions between all objects of a same layer. > I'm pretty sure that not all particles collides, so...
Too bad we can't fix the thing at the source. Most developper-time consuming and less obvious, anyway. > So, in my opinion, the detection of duplicated rectangles must be done > in Map::OptimizeCache(). Methods Map::ToRedrawOnScreen() and > Map::ToRedrawOnMap() should stay silly methods. I think that on the other hand, as long as Map::ToRedrawOnWhatever is not in a time-critical path, it should do the job: that's the best spot to optimize. Let me show you my train of thought about this. Prerequisite: Have something to actually benchmark what is faster (I have my own idea about this). Steps: - Following Kyle's notice, having duplicates is not such a big problem: (a) contains (a), so (a) can probably be removed during the occlusion test - Is sorting the list then performing occlusion the fastest, ie is sorting really needed? - If that is faster, then isn't it faster although to have an automatically sorted list by adding each element at its correctly ordered location; you have a smaller set to work on Best regards, Kurosu _______________________________________________ Wormux-dev mailing list Wormux-dev@gna.org https://mail.gna.org/listinfo/wormux-dev