Minimize unnecessary calls to updateScreen() in the new GUI. This improves drawing speed dramatically

svn-id: r44659
This commit is contained in:
Filippos Karapetis 2009-10-05 12:04:39 +00:00
parent 6e38de3905
commit 4d699301c7
4 changed files with 14 additions and 16 deletions

View file

@ -213,7 +213,7 @@ void SciGui::display(const char *text, int argc, reg_t *argv) {
currport->curTop = tTop;
currport->curLeft = tLeft;
_screen->updateScreen();
_screen->copyToScreen();
}
void SciGui::textSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight) {
@ -243,7 +243,7 @@ void SciGui::drawPicture(GuiResourceId pictureId, uint16 style, uint16 flags, in
_gfx->drawPicture(pictureId, style, addToFlag, EGApaletteNo);
_windowMgr->EndUpdate(_windowMgr->_picWind);
}
_screen->updateScreen();
_screen->copyToScreen();
_gfx->SetPort(oldPort);
_gfx->_picNotValid = true;
@ -252,7 +252,7 @@ void SciGui::drawPicture(GuiResourceId pictureId, uint16 style, uint16 flags, in
void SciGui::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo) {
_gfx->drawCel(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo);
_gfx->SetCLUT(&_gfx->_sysPalette);
_screen->updateScreen();
_screen->copyToScreen();
}
void SciGui::drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool inverse) {
@ -267,7 +267,7 @@ void SciGui::drawControlButton(Common::Rect rect, reg_t obj, const char *text, i
rect.grow(1);
_gfx->FrameRect(rect);
}
_screen->updateScreen();
_screen->copyToScreen();
}
void SciGui::drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, bool inverse) {
@ -278,7 +278,7 @@ void SciGui::drawControlText(Common::Rect rect, reg_t obj, const char *text, int
if (style & 8) { // selected
_gfx->FrameRect(rect);
}
_screen->updateScreen();
_screen->copyToScreen();
}
void SciGui::drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 style, bool inverse) {
@ -290,22 +290,22 @@ void SciGui::drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId,
void SciGui::graphFillBoxForeground(Common::Rect rect) {
_gfx->PaintRect(rect);
_screen->updateScreen();
_screen->copyToScreen();
}
void SciGui::graphFillBoxBackground(Common::Rect rect) {
_gfx->EraseRect(rect);
_screen->updateScreen();
_screen->copyToScreen();
}
void SciGui::graphFillBox(Common::Rect rect, uint16 colorMask, int16 color, int16 priority, int16 control) {
_gfx->FillRect(rect, colorMask, color, priority, control);
_screen->updateScreen();
_screen->copyToScreen();
}
void SciGui::graphDrawLine(Common::Rect rect, int16 color, int16 priority, int16 control) {
_gfx->Draw_Line(rect.left, rect.top, rect.right, rect.bottom, color, priority, control);
_screen->updateScreen();
_screen->copyToScreen();
}
reg_t SciGui::graphSaveBox(Common::Rect rect, uint16 flags) {
@ -314,7 +314,7 @@ reg_t SciGui::graphSaveBox(Common::Rect rect, uint16 flags) {
void SciGui::graphRestoreBox(reg_t handle) {
_gfx->RestoreBits(handle);
_screen->updateScreen();
_screen->copyToScreen();
}
void SciGui::paletteSet(int resourceNo, int flags) {
@ -384,7 +384,7 @@ void SciGui::animate(reg_t listReference, bool cycle, int argc, reg_t *argv) {
}
//_gfx->AnimateUpdateScreen();
_screen->updateScreen();
_screen->copyToScreen();
_gfx->AnimateRestoreAndDelete();
_gfx->SetPort(oldPort);