|
-
Oct 20th, 2001, 06:40 PM
#9
transcendental analytic
Originally posted by Jotaf98
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
ewww
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|