no need to updateScreen() if there are no screen blocks marked as dirty

svn-id: r16243
This commit is contained in:
Gregory Montoir 2004-12-21 16:08:14 +00:00
parent 418c5f8473
commit 118cc4d255

View File

@ -83,10 +83,15 @@ Display::~Display() {
delete[] _backdropBuf; delete[] _backdropBuf;
delete[] _panelBuf; delete[] _panelBuf;
delete[] _screenBuf; delete[] _screenBuf;
delete[] _dirtyBlocks;
delete[] _pal.room; delete[] _pal.room;
delete[] _pal.screen; delete[] _pal.screen;
delete[] _pal.panel; delete[] _pal.panel;
delete[] _dynalum.mskBuf;
delete[] _dynalum.lumBuf;
} }
void Display::dynalumInit(const char *roomName, uint16 roomNum) { void Display::dynalumInit(const char *roomName, uint16 roomNum) {
@ -598,6 +603,7 @@ void Display::update(bool dynalum, int16 dynaX, int16 dynaY) {
// _fullRefresh = 1; // _fullRefresh = 1;
if (_fullRefresh) { if (_fullRefresh) {
_system->copyRectToScreen(_screenBuf, SCREEN_W, 0, 0, SCREEN_W, SCREEN_H); _system->copyRectToScreen(_screenBuf, SCREEN_W, 0, 0, SCREEN_W, SCREEN_H);
_system->updateScreen();
--_fullRefresh; --_fullRefresh;
if (_fullRefresh) { if (_fullRefresh) {
memset(_dirtyBlocks, 0, _dirtyBlocksWidth * _dirtyBlocksHeight); memset(_dirtyBlocks, 0, _dirtyBlocksWidth * _dirtyBlocksHeight);
@ -628,9 +634,11 @@ void Display::update(bool dynalum, int16 dynaX, int16 dynaY) {
dbBuf += _dirtyBlocksWidth; dbBuf += _dirtyBlocksWidth;
scrBuf += SCREEN_W * D_BLOCK_H; scrBuf += SCREEN_W * D_BLOCK_H;
} }
if (count != 0) {
_system->updateScreen();
}
debug(7, "Display::update() - Dirtyblocks blit (%d)", count); debug(7, "Display::update() - Dirtyblocks blit (%d)", count);
} }
_system->updateScreen();
} }
void Display::setupPanel() { void Display::setupPanel() {