[Scummvm-cvs-logs] SF.net SVN: scummvm:[44659] scummvm/trunk/engines/sci/gui
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Mon Oct 5 14:04:39 CEST 2009
Revision: 44659
http://scummvm.svn.sourceforge.net/scummvm/?rev=44659&view=rev
Author: thebluegr
Date: 2009-10-05 12:04:39 +0000 (Mon, 05 Oct 2009)
Log Message:
-----------
Minimize unnecessary calls to updateScreen() in the new GUI. This improves drawing speed dramatically
Modified Paths:
--------------
scummvm/trunk/engines/sci/gui/gui.cpp
scummvm/trunk/engines/sci/gui/gui_gfx.cpp
scummvm/trunk/engines/sci/gui/gui_screen.cpp
scummvm/trunk/engines/sci/gui/gui_screen.h
Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-05 11:42:04 UTC (rev 44658)
+++ scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-05 12:04:39 UTC (rev 44659)
@@ -213,7 +213,7 @@
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 @@
_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::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 @@
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 @@
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::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 @@
void SciGui::graphRestoreBox(reg_t handle) {
_gfx->RestoreBits(handle);
- _screen->updateScreen();
+ _screen->copyToScreen();
}
void SciGui::paletteSet(int resourceNo, int flags) {
@@ -384,7 +384,7 @@
}
//_gfx->AnimateUpdateScreen();
- _screen->updateScreen();
+ _screen->copyToScreen();
_gfx->AnimateRestoreAndDelete();
_gfx->SetPort(oldPort);
Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp 2009-10-05 11:42:04 UTC (rev 44658)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp 2009-10-05 12:04:39 UTC (rev 44659)
@@ -298,7 +298,6 @@
bpal[i * 4 + 3] = 100;
}
_system->setPalette(bpal, 0, 256);
- _system->updateScreen();
}
void SciGuiGfx::GetCLUT(GuiPalette*pal) {
@@ -832,7 +831,7 @@
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();
}
Modified: scummvm/trunk/engines/sci/gui/gui_screen.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_screen.cpp 2009-10-05 11:42:04 UTC (rev 44658)
+++ scummvm/trunk/engines/sci/gui/gui_screen.cpp 2009-10-05 12:04:39 UTC (rev 44659)
@@ -71,9 +71,8 @@
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) {
Modified: scummvm/trunk/engines/sci/gui/gui_screen.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_screen.h 2009-10-05 11:42:04 UTC (rev 44658)
+++ scummvm/trunk/engines/sci/gui/gui_screen.h 2009-10-05 12:04:39 UTC (rev 44659)
@@ -46,7 +46,7 @@
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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list