forked from teamnwah/openmw-tes3coop
Sleep using the absolute time, so the thread creation doesn't add to the wait
This commit is contained in:
parent
c2e1595445
commit
a62d5bbfe4
1 changed files with 4 additions and 4 deletions
|
@ -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…
Reference in a new issue