Main loop/Movie FPS

Blitz3D Forums/Blitz3D Programming/Main loop/Movie FPS

Naughty Alien(Posted 2005) [#1]
..after latest Blitz3D update (1.91), I start to playing with movie as a texure again..my question is how to properly escape from locking ingame main loop FPS with movie FPS (movie is in loop all time)..so, how to keep separate main loop and movie FPS? I did something with stop updating movie within main loop, and its working, but picture is not smooth anymore...on another side, if I dont do that, main loop FPS following movie FPS (25 fps in my case)...so..anyone knows elegant solution for this issue?


John Blackledge(Posted 2005) [#2]
Someone said that in effect you couldn't/didn't need to control FPS - that Blitz will update the frame counter by the correct amount every time UpdateWorld is called.

Otherwise with variable timings induced by changing in-game fps trying to also control smooth movie playback would be nitemare.

In other words, movie playback has it's own internal timer(?).


Paolo(Posted 2005) [#3]
If you are using a frame-tweening technique, you must
not call the DrawMovie() command inside the main loop.
Each time you open a movie, it starts being played on
the background, you have to write a separate code (outside
the main loop) so that you only call the DrawMovie when
you know for sure a new frame is in the animation,
so if you have a 30fps movie then write a code which calls
DrawMovie every 33 milliseconds and so ...

something like this:
;--- VIDEO PROYECTADO ---
movies_millis=MilliSecs()-movies_millis
movies_storemillis=movies_storemillis+movies_millis
movies_millis=MilliSecs()
If movies_storemillis>32
movies_storemillis=0

	DrawMovie()
	CopyRect (to texture here)

EndIf
;----------------------------------



Beaker(Posted 2005) [#4]
Also, its advisable to put a little Delay in your main loop.


Naughty Alien(Posted 2005) [#5]
..Eurythmia..your advice working very well..thanks a lot to all of you guys...