13-05-2008, 12:01 AM
Spodi Wrote:No, not is not. Your rendering time is still random in context with the rest of the program. You want to render in order - its not about performance, its not about thread safety, its just about logic. You can mix in updates with rendering at times (although its a bit harder to follow and not very well structured) but you can not throw around your rendering times randomly.
If you are rendering to a separate buffer, put the code where you want it in the call to render to that separate buffer. Keep it linear and simple.
Why would it have to be "in order"? The movement of players is just as random. If what youre saying is true, I need a better explanation, here's a bit a code I planned to use.
Code:
Sub SpellAnim(ByVal Spell As Long, ByVal x As Long, ByVal y As Long)
Dim SpellTimer As Long
Dim z As Long
z = 0
Do While z -1
If GetTickCount > SpellTimer + Spell(i).Interval Then
If z 12 Then
SpellTimer = GetTickCount
Call BltSpell(i, x, y)
x = x + 1
Else
x = -1
End If
DoEvents
Loop
End Sub
OOo I just realized, what if this procedure was executed again during the DoEvents, what would happen with the same sub running at the same time. Also while we're on the topic, I wanted to create some serverside timers for some map events. What if there were say, a dozen of these timers active on the server, would it be noticable?