|
-
May 24th, 2013, 10:14 PM
#37
Re: [VB6] - DIB's - Tiles an image
Hey long time no see 
Ill do my best to help ya since I at work on my phone. I assume this stuff is part of your graphics class.
- If you want a tremendous boost in speed, I suggest you not use any calls to functions and subs in your main gameloop that are from a class module. The reason is cause it executes twice as slow than the same function and sub from a regular module.
- Another thing to boost your speed are conversions. If you are storing data in a variable thats a different data type, itll execute slower. So get ready to treat vb6 as "vb.net with option strict on" taking advange of CLng, CStr, Cint, CSng, etc.
- Also dont test your program in IDE mode. Test it as an exe. Youll notoce a huge speed boost.
- Another way to boost speed is to try your best to avoid using / operator unless you absolutely need it. If its being stored in a long or integer variable, use \ instead.
- Another way to boost speed is to avoid as many functions and sub calls as possible. Instead put all the code the function or sub had where the call was made. Doing this is known as Inlining, similar to adding an Inline statement prior to a function in C++. This will dramatically boost the speed of your program.
- In your project properties, you can remove a bunch of things in your compiler options that could potentially slow your program down such as overflow checks. And never compile it to pcode. Do native code instead.
- Error checking tremendously slows down your program. Worst of all, On Error Resume Next
I can go on and on about optimization techniques. But this will step you in the right direction.
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
|