That looks very good!
Yeah, what I tried to define was the A method, I think I will go like this. I'll try to find a performance-friendly way to iterate through every objects (even if I don't think there will be thousands of objects, especially just on the view region).
Pre-sort them. =)
Save your tilemap, but also save your object-map ontop of it. Your object-map contains a list of objects pre-sorted by their y position.
Then, you do this:
//Draw objects north of the player.
for every object with object.y < player.y
{
drawObject();
}
//Draw the player.
drawPlayer();
//Draw objects south of the player.
for every object with object.y > player.y
{
drawObject();
}
Since most graphics APIs make (0,0) be the upper-left corner of the image you are drawing, you actually need to sort by (object.y + object.height), because objects (like trees) might be taller than the player, and you're actually trying to sort by the bottom of the object (the tree trunk, the player's feet, etc...), not the top.