GUI: Fix two-step rendering

This is used when changing directories in the 'add game' dialog or when
choosing another tab in the option dialog. Only blit to the overlay on
the final pass. Gets rid of highly annoying flickers on androids
This commit is contained in:
dhewg 2011-02-24 22:32:32 +01:00
parent c8551b80dd
commit a017cb3d00
3 changed files with 8 additions and 6 deletions

View File

@ -1192,7 +1192,7 @@ void ThemeEngine::debugWidgetPosition(const char *name, const Common::Rect &r) {
/**********************************************************
* Screen/overlay management
*********************************************************/
void ThemeEngine::updateScreen() {
void ThemeEngine::updateScreen(bool render) {
if (!_bufferQueue.empty()) {
_vectorRenderer->setSurface(&_backBuffer);
@ -1217,7 +1217,8 @@ void ThemeEngine::updateScreen() {
_screenQueue.clear();
}
renderDirtyScreen();
if (render)
renderDirtyScreen();
}
void ThemeEngine::addDirtyRect(Common::Rect r) {

View File

@ -280,7 +280,7 @@ public:
* It processes all the drawing queues and then copies dirty rects
* in the current Screen surface to the overlay.
*/
void updateScreen();
void updateScreen(bool render = true);
/** @name FONT MANAGEMENT METHODS */

View File

@ -201,14 +201,15 @@ void GuiManager::redraw() {
_theme->clearAll();
_theme->openDialog(true, ThemeEngine::kShadingNone);
for (i = 0; i < _dialogStack.size() - 1; i++) {
for (i = 0; i < _dialogStack.size() - 1; i++)
_dialogStack[i]->drawDialog();
}
_theme->finishBuffering();
// fall through
case kRedrawOpenDialog:
_theme->updateScreen();
_theme->updateScreen(false);
_theme->openDialog(true, shading);
_dialogStack.top()->drawDialog();
_theme->finishBuffering();