diff options
| author | Filippos Karapetis | 2009-10-05 12:04:39 +0000 | 
|---|---|---|
| committer | Filippos Karapetis | 2009-10-05 12:04:39 +0000 | 
| commit | 4d699301c75b18a9a2526f19ef85b1c05c2a0070 (patch) | |
| tree | 9b2414a763f7967b9c2496d7d08ce3c6f5cfac86 | |
| parent | 6e38de3905ec7f5cbbfb991b4a4f960027550b3a (diff) | |
| download | scummvm-rg350-4d699301c75b18a9a2526f19ef85b1c05c2a0070.tar.gz scummvm-rg350-4d699301c75b18a9a2526f19ef85b1c05c2a0070.tar.bz2 scummvm-rg350-4d699301c75b18a9a2526f19ef85b1c05c2a0070.zip | |
Minimize unnecessary calls to updateScreen() in the new GUI. This improves drawing speed dramatically
svn-id: r44659
| -rw-r--r-- | engines/sci/gui/gui.cpp | 22 | ||||
| -rw-r--r-- | engines/sci/gui/gui_gfx.cpp | 3 | ||||
| -rw-r--r-- | engines/sci/gui/gui_screen.cpp | 3 | ||||
| -rw-r--r-- | engines/sci/gui/gui_screen.h | 2 | 
4 files changed, 14 insertions, 16 deletions
| diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp index a66f0e9d55..c682e76c7b 100644 --- a/engines/sci/gui/gui.cpp +++ b/engines/sci/gui/gui.cpp @@ -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); diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp index 62494ca627..4698844160 100644 --- a/engines/sci/gui/gui_gfx.cpp +++ b/engines/sci/gui/gui_gfx.cpp @@ -298,7 +298,6 @@ void SciGuiGfx::SetCLUT(GuiPalette*pal) {  		bpal[i * 4 + 3] = 100;  	}  	_system->setPalette(bpal, 0, 256); -	_system->updateScreen();  }  void SciGuiGfx::GetCLUT(GuiPalette*pal) { @@ -832,7 +831,7 @@ void SciGuiGfx::ShowBits(const Common::Rect &r, uint16 flags) {  	OffsetRect(rect);  	assert((flags&0x8000) == 0); -	_screen->updateScreen(); +	_screen->copyToScreen();  //	_system->copyRectToScreen(GetSegment(flags) + _baseTable[rect.top] + rect.left, 320, rect.left, rect.top, rect.width(), rect.height());  //	_system->updateScreen();  } diff --git a/engines/sci/gui/gui_screen.cpp b/engines/sci/gui/gui_screen.cpp index 1a143fe0d1..672b0775eb 100644 --- a/engines/sci/gui/gui_screen.cpp +++ b/engines/sci/gui/gui_screen.cpp @@ -71,9 +71,8 @@ byte *SciGuiScreen::initScreen(uint16 pixelCount) {  	return screen;  } -void SciGuiScreen::updateScreen() { +void SciGuiScreen::copyToScreen() {  	_system->copyRectToScreen(_displayScreen, _displayWidth, 0, 0, _displayWidth, _displayHeight); -	_system->updateScreen();  }  byte SciGuiScreen::getDrawingMask(byte color, byte prio, byte control) { diff --git a/engines/sci/gui/gui_screen.h b/engines/sci/gui/gui_screen.h index 94aca7ed9b..417c2e9de0 100644 --- a/engines/sci/gui/gui_screen.h +++ b/engines/sci/gui/gui_screen.h @@ -46,7 +46,7 @@ public:  	void init(void);  	byte *initScreen(uint16 pixelCount); -	void updateScreen(); +	void copyToScreen();  	byte getDrawingMask(byte color, byte prio, byte control);  	void putPixel(int x, int y, byte drawMask, byte color, byte prio, byte control); | 
