I've been working on my game editor and doing some performance tests. In the meantime I realized that my editors performance goes significant down if I draw a large map and zoom it.
100% zoom = 112 tiles on the screen
50% zoom = 364 tiles on the screen
25% zoom = 1350 tiles on the screen
12.5% zoom = 5247 tiles on the screen
5247 is a much of it. But that are only these tiles which are need to draw.
for (var layerX = minTileX; layerX < maxTileX; layerX++) for (var layerY = minTileY; layerY < maxTileY; layerY++)
I decided to render areas of the map to rendertargets and draw only these. The framerate goes up. But if I want to scroll it goes down again, because it have to recreate and render all rendertargets.
Maybe I could draw the whole map on rendertargets (256*256 pixel per rendertarget => 63 rendertargets on a 500*500 large tilemap with 32px tiles)? But I dont think thats is the right way to do it.