All right, I had a simple tile engine in DX running at about 60 FPS, and after using this technique, it ran at 800 FPS!!!
VB Code:
Dim TileX as Long, TileY as Long TileX = 0 TileY = 0 For X = 0 To 19 For Y = 0 To 14 'Here, the coordinates where you should blt to are NOT X*TileWidth and Y*TileHeight, but TileX and TileY. In this example, you're avoiding 600 multiplications with additions so it's a LOT faster :) TileY = TileY + TileHeight Next Y TileX = TileX + TileWidth TileY = 0 Next X
Try it, maybe the FPS won't be the same, but it will at least be 1000% faster than the old method![]()









Reply With Quote