(svn r22820) -Codechange: perform a full (re)draw cycle in the first draw during progress instead of waiting 200ms

This commit is contained in:
rubidium
2011-08-24 12:18:53 +00:00
parent 38ad276acc
commit 70179db81e
6 changed files with 32 additions and 13 deletions

View File

@@ -15,6 +15,7 @@
/** Are we in a modal progress or not? */
bool _in_modal_progress = false;
bool _first_in_modal_loop = false;
/** Rights for the performing work. */
ThreadMutex *_modal_progress_work_mutex = ThreadMutex::New();
/** Rights for the painting. */
@@ -22,9 +23,23 @@ ThreadMutex *_modal_progress_paint_mutex = ThreadMutex::New();
/**
* Set the modal progress state.
* @note Makes IsFirstModalProgressLoop return true for the next call.
* @param state The new state; are we modal or not?
*/
void SetModalProgress(bool state)
{
_in_modal_progress = state;
_first_in_modal_loop = true;
}
/**
* Check whether this is the first modal progress loop.
* @note Set by SetModalProgress, unset by calling this method.
* @return True if this is the first loop.
*/
bool IsFirstModalProgressLoop()
{
bool ret = _first_in_modal_loop;
_first_in_modal_loop = false;
return ret;
}