Pls explain this procedure * solved
Im debugging my friend's program and I can't understand the use of this piece of code:
Code:
Public Sub FPS()
Do While mlngFrameTime + (1000 \ MAX_FPS) > gdx.TickCount
DoEvents
Loop
mlngFrameTime = gdx.TickCount
If mlngTimer + 1000 <= gdx.TickCount Then
mlngTimer = gdx.TickCount
mintFPS = mintFPSCounter + 1
mintFPSCounter = 0
Else
mintFPSCounter = mintFPSCounter + 1
End If
End Sub
mintFPS and mintFPSCounter are used only in this procedure . My first thought was a logical error, but I don't know what the procedure is for, hence, how it should have been coded.
FPS is used only in the FadeIn procedure (called) and in the main loop (DDraw.FPS). I think it's used to run DoEvents, since the main loop doesn't have one, but I can't figure out the purpose of the If statement. Neither could she, so she left it in the program after building up on a template she downloaded.
If you could give me a better code for whatever purpose this code was meant for, I'd really appreciate it. :)