diff options
author | Robert Göffringmann | 2003-06-02 00:53:31 +0000 |
---|---|---|
committer | Robert Göffringmann | 2003-06-02 00:53:31 +0000 |
commit | 1014c98fcbe61768e296beff3346a23768e53a6b (patch) | |
tree | 8a6a0c82c24b180b14a6f7d47e75bb164058c132 /sky | |
parent | 281cce32b9241248a83137aaddabd1fbdc9b6029 (diff) | |
download | scummvm-rg350-1014c98fcbe61768e296beff3346a23768e53a6b.tar.gz scummvm-rg350-1014c98fcbe61768e296beff3346a23768e53a6b.tar.bz2 scummvm-rg350-1014c98fcbe61768e296beff3346a23768e53a6b.zip |
screen combine rectangles now. even a bit less cpu usage.
svn-id: r8258
Diffstat (limited to 'sky')
-rw-r--r-- | sky/screen.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sky/screen.cpp b/sky/screen.cpp index 6e60a0f88a..c8050eefa1 100644 --- a/sky/screen.cpp +++ b/sky/screen.cpp @@ -179,10 +179,14 @@ void SkyScreen::flip(void) { // drawMouseToBackScreen(); uint8 *screenPos = _currentScreen; uint8 *backPos = _backScreen; + uint32 copyX, copyWidth; for (uint8 cnty = 0; cnty < GRID_Y; cnty++) { + copyWidth = 0; for (uint8 cntx = 0; cntx < GRID_X; cntx++) { if (_gameGrid[cnty * GRID_X + cntx] & 1) { _gameGrid[cnty * GRID_X + cntx] &= ~1; + if (!copyWidth) copyX = cntx * GRID_W; + copyWidth += GRID_W; uint8 *copySrc = backPos; uint8 *copyDest = screenPos; for (uint8 gridLineCnt = 0; gridLineCnt < GRID_H; gridLineCnt++) { @@ -190,11 +194,17 @@ void SkyScreen::flip(void) { copySrc += GAME_SCREEN_WIDTH; copyDest += GAME_SCREEN_WIDTH; } - _system->copy_rect(screenPos, GAME_SCREEN_WIDTH, cntx * GRID_W, cnty * GRID_H, GRID_W, GRID_H); + } else if (copyWidth) { + _system->copy_rect(_currentScreen + cnty * GRID_H * GAME_SCREEN_WIDTH + copyX, GAME_SCREEN_WIDTH, copyX, cnty * GRID_H, copyWidth, GRID_H); + copyWidth = 0; } backPos += GRID_W; screenPos += GRID_W; } + if (copyWidth) { + _system->copy_rect(_currentScreen + cnty * GRID_H * GAME_SCREEN_WIDTH + copyX, GAME_SCREEN_WIDTH, copyX, cnty * GRID_H, copyWidth, GRID_H); + copyWidth = 0; + } screenPos += (GRID_H - 1) * GAME_SCREEN_WIDTH; backPos += (GRID_H - 1) * GAME_SCREEN_WIDTH; } |