⛊ Drake7707 Posted June 12, 2006 Report Posted June 12, 2006 well i gave it some thought and in some occasions (like move or hand) there is a lot of data that is recalculated every time, while it was still valid. So instead of redrawing every tile in updatelevel, do this: for when a selection is active - bitblt the old piclevel onto the piclevel with the difference in offset for the selection movedthat way, the selection doesn't need to be drawn again - iterate over every tile, draw those who aren't in the selection (as every tile not in selection will have the wrong offset)- when tiles in selection, only draw those whose tiles became visible that were previously not (like moving to the left for 4 tiles) will bitblt with x-4 and draw tiles from selection for the last 4 columns. This greatly reduces the amount of drawings done. I don't know yet how much faster it will be (there is some overhead) but i'll give it a try when i have time Same could be done for the hand tool, but instead of having the offset as selection move, have the offset of the dragx of the hand itself. This has some problems with grid colors being moved also but i'll give it a try. (if you have time sama, you can try too )
★ SOS Posted June 13, 2006 Report Posted June 13, 2006 Have you ever thought of just doing this in nice and hardware-accelerated Direct3D?
⛊ Drake7707 Posted June 13, 2006 Author Report Posted June 13, 2006 yes, although i don't want to be dependent on directx or opengl.
⛊ Drake7707 Posted June 21, 2006 Author Report Posted June 21, 2006 i've done the updatelevel for the hand tool, and any other moving factors in that matter. The results are quite spectacular, as i suspected. With zoomed out twice, and fully filled, i had 250ms in the ide before.After the upgrade of updatelevel i have as much as 80ms maximum, average is more like 40-50ms. And i don't want to use directx, because now i have to rely on optimalisations to get things fast. And optimalisations are always good, also for older computers. If i use directx to speed things up, i still have slow code, and i'm only delaying the problem until more needs to be drawn.
★ SOS Posted June 21, 2006 Report Posted June 21, 2006 I... disagree on the DirectX part Even horrible crappy terrible Direct3D code would run faster than plain old GDI drawing which you are using now.
Recommended Posts