On Fri, Oct 10, 2008 at 11:04 PM, Kai Sterker <[EMAIL PROTECTED]> wrote:
> The other open issue is the rendering, which also had some regressions > since alpha 2. I managed to improve it somewhat, but there are still > some glitches. I believe I know the reason (vertical vs. horizontal > tiles and their base points). Fortunately, all the information > required to treat those two differently should be there where it's > needed. I'll try to have a go at it tomorrow. Not much luck at fixing it, unfortunately. While obviously there is an order in which everything needs to be rendered, I haven't yet found a way to bring the drawing queue into this order. I think I need to wrap my head around the issue some more, to come up with a solution, so here we go: If all tiles were flat, we could sort them by their z-Order first, then by their y-Order. Likewise, if all tiles were vertical, we could sort them by their y-Order first, then by their z-Order. But we have both of them in the same queue, so how do we sort it? Obviously, if two tiles are of the same kind, figuring out the order is simple (as it's already written down above). The problem is how to sort tiles of a different kind. Maybe it's not so bad at all, since there aren't that many different combinations here: (a) ----| (b) ---,--- (c) | (d) |---- | | ---'--- | In case (a) and (c) we draw the flat tile F first, in case (b) and (d) we draw the vertical tile V first. Now there only had to be a nice algorithm that doesn't require to enumerate those different cases one by one. I'm to tired right now to actually try it out, but if somebody wants to have a go, all it takes is a modification to render_info::operator<(). The following lines at the end of the loop in mapview::render() will allow to watch the result in a fairly nice way: // debug rendering by drawing one tile at a time base::timer::sleep (100); gfx::screen::update (); Have fun :-). Otherwise, I'll have to give it a shot one of the following days. Kai _______________________________________________ Adonthell-devel mailing list Adonthell-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/adonthell-devel