mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 03:40:14 +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++;
|
||||
}
|
||||
|
||||
@ -332,8 +332,8 @@ namespace MWRender
|
||||
{
|
||||
//SDL_AddTimer(delay, sdl_refresh_timer_cb, is);
|
||||
//is->refresh_queue.push_back (delay);
|
||||
|
||||
boost::thread (boost::bind(&timer_callback, delay, is));
|
||||
boost::system_time t = boost::get_system_time() + boost::posix_time::milliseconds(delay);
|
||||
boost::thread (boost::bind(&timer_callback, t, is));
|
||||
}
|
||||
|
||||
void video_display(VideoState *is)
|
||||
|
Loading…
x
Reference in New Issue
Block a user