mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-09 09:39:53 +00:00
Sleep using the absolute time, so the thread creation doesn't add to the wait
This commit is contained in:
parent
c2e1595445
commit
a62d5bbfe4
@ -321,9 +321,9 @@ namespace MWRender
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void timer_callback (int delay, VideoState* is)
|
void timer_callback (boost::system_time t, VideoState* is)
|
||||||
{
|
{
|
||||||
boost::this_thread::sleep (boost::posix_time::milliseconds(delay));
|
boost::this_thread::sleep (t);
|
||||||
is->refresh++;
|
is->refresh++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -332,8 +332,8 @@ namespace MWRender
|
|||||||
{
|
{
|
||||||
//SDL_AddTimer(delay, sdl_refresh_timer_cb, is);
|
//SDL_AddTimer(delay, sdl_refresh_timer_cb, is);
|
||||||
//is->refresh_queue.push_back (delay);
|
//is->refresh_queue.push_back (delay);
|
||||||
|
boost::system_time t = boost::get_system_time() + boost::posix_time::milliseconds(delay);
|
||||||
boost::thread (boost::bind(&timer_callback, delay, is));
|
boost::thread (boost::bind(&timer_callback, t, is));
|
||||||
}
|
}
|
||||||
|
|
||||||
void video_display(VideoState *is)
|
void video_display(VideoState *is)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user