diff options
author | Gregory Montoir | 2009-01-18 04:00:11 +0000 |
---|---|---|
committer | Gregory Montoir | 2009-01-18 04:00:11 +0000 |
commit | 1511099a7b3f5d9e31135e901b6c03b75f620f18 (patch) | |
tree | dd7a5f44deed182faffecfe5c20c1d22969bf80c /engines | |
parent | 8ea8966c02d6d62bac7af6e3b48e6acc7857353d (diff) | |
download | scummvm-rg350-1511099a7b3f5d9e31135e901b6c03b75f620f18.tar.gz scummvm-rg350-1511099a7b3f5d9e31135e901b6c03b75f620f18.tar.bz2 scummvm-rg350-1511099a7b3f5d9e31135e901b6c03b75f620f18.zip |
merged Graphics::copyTo640/Graphics::copyFrom640
svn-id: r35892
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tucker/graphics.cpp | 12 | ||||
-rw-r--r-- | engines/tucker/graphics.h | 3 | ||||
-rw-r--r-- | engines/tucker/resource.cpp | 8 | ||||
-rw-r--r-- | engines/tucker/sequences.cpp | 18 | ||||
-rw-r--r-- | engines/tucker/tucker.cpp | 4 |
5 files changed, 18 insertions, 27 deletions
diff --git a/engines/tucker/graphics.cpp b/engines/tucker/graphics.cpp index bc88081e01..804c6f83dc 100644 --- a/engines/tucker/graphics.cpp +++ b/engines/tucker/graphics.cpp @@ -157,18 +157,10 @@ void Graphics::decodeRLE_320(uint8 *dst, const uint8 *src, int w, int h) { } } -void Graphics::copyFrom640(const uint8 *src, uint8 *dst, int w, int h) { +void Graphics::copyRect(uint8 *dst, int dstPitch, uint8 *src, int srcPitch, int w, int h) { for (int y = 0; y < h; ++y) { memcpy(dst, src, w); - dst += w; - src += 640; - } -} - -void Graphics::copyTo640(uint8 *dst, const uint8 *src, int w, int srcPitch, int h) { - for (int y = 0; y < h; ++y) { - memcpy(dst, src, w); - dst += 640; + dst += dstPitch; src += srcPitch; } } diff --git a/engines/tucker/graphics.h b/engines/tucker/graphics.h index 3362a6219e..6f4e4c8ace 100644 --- a/engines/tucker/graphics.h +++ b/engines/tucker/graphics.h @@ -55,8 +55,7 @@ public: static void decodeRLE_248(uint8 *dst, const uint8 *src, int w, int h, int y1, int y2, bool xflip); static void decodeRLE_320(uint8 *dst, const uint8 *src, int w, int h); - static void copyFrom640(const uint8 *src, uint8 *dst, int w, int h); - static void copyTo640(uint8 *dst, const uint8 *src, int w, int srcPitch, int h); + static void copyRect(uint8 *dst, int dstPitch, uint8 *src, int srcPitch, int w, int h); static void drawStringChar(uint8 *dst, uint8 chr, int pitch, uint8 chrColor, const uint8 *src); diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index 3521a4690f..178b6fb793 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -427,7 +427,7 @@ void TuckerEngine::loadLoc() { _locationHeight = (_locationNum < 73) ? 140 : 200; sprintf(filename, (i == 1) ? "loc%02d.pcx" : "loc%02da.pcx", _locationNum); copyLocBitmap(filename, 0, false); - Graphics::copyFrom640(_locationBackgroundGfxBuf, _quadBackgroundGfxBuf, 320, _locationHeight); + Graphics::copyRect(_quadBackgroundGfxBuf, 320, _locationBackgroundGfxBuf, 640, 320, _locationHeight); if (_locationHeight == 200) { return; } @@ -436,7 +436,7 @@ void TuckerEngine::loadLoc() { if (i > 1) { sprintf(filename, "loc%02db.pcx", _locationNum); copyLocBitmap(filename, 320, false); - Graphics::copyFrom640(_locationBackgroundGfxBuf + 320, _quadBackgroundGfxBuf + 44800, 320, 140); + Graphics::copyRect(_quadBackgroundGfxBuf + 44800, 320, _locationBackgroundGfxBuf + 320, 640, 320, _locationHeight); if (i == 2) { sprintf(filename, "path%02db.pcx", _locationNum); copyLocBitmap(filename, 320, true); @@ -445,7 +445,7 @@ void TuckerEngine::loadLoc() { if (i > 2) { sprintf(filename, "loc%02dc.pcx", _locationNum); copyLocBitmap(filename, 0, false); - Graphics::copyFrom640(_locationBackgroundGfxBuf, _quadBackgroundGfxBuf + 89600, 320, 140); + Graphics::copyRect(_quadBackgroundGfxBuf + 89600, 320, _locationBackgroundGfxBuf, 640, 320, 140); } if (_locationNum == 1) { _loadLocBufPtr = _quadBackgroundGfxBuf + 89600; @@ -454,7 +454,7 @@ void TuckerEngine::loadLoc() { if (i > 3) { sprintf(filename, "loc%02dd.pcx", _locationNum); copyLocBitmap(filename, 0, false); - Graphics::copyFrom640(_locationBackgroundGfxBuf + 320, _quadBackgroundGfxBuf + 134400, 320, 140); + Graphics::copyRect(_quadBackgroundGfxBuf + 134400, 320, _locationBackgroundGfxBuf + 320, 640, 320, 140); } _fullRedrawCounter = 2; } diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index e946d586fb..bb064cff9f 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -81,9 +81,9 @@ void TuckerEngine::handleCreditsSequence() { imgNum = 0; } if (num < 6) { - Graphics::copyTo640(_locationBackgroundGfxBuf, _quadBackgroundGfxBuf, 320, 320, 200); + Graphics::copyRect(_locationBackgroundGfxBuf, 640, _quadBackgroundGfxBuf, 320, 320, 200); } else { - Graphics::copyTo640(_locationBackgroundGfxBuf, imgBuf + imgNum * 64000, 320, 320, 200); + Graphics::copyRect(_locationBackgroundGfxBuf, 640, imgBuf + imgNum * 64000, 320, 320, 200); drawCreditsString(5, 48, counter2 * 6); drawCreditsString(5, 60, counter2 * 6 + 1); drawCreditsString(5, 80, counter2 * 6 + 2); @@ -173,7 +173,7 @@ void TuckerEngine::handleCongratulationsSequence() { _fadePaletteCounter = 0; stopSounds(); loadImage("congrat.pcx", _loadTempBuf, 1); - Graphics::copyTo640(_locationBackgroundGfxBuf, _loadTempBuf, 320, 320, 200); + Graphics::copyRect(_locationBackgroundGfxBuf, 640, _loadTempBuf, 320, 320, 200); _fullRedrawCounter = 2; redrawScreen(0); while (!_quitGame && _timerCounter2 < 450) { @@ -243,7 +243,7 @@ void TuckerEngine::handleNewPartSequence() { fadeOutPalette(); ++_fadePaletteCounter; } - Graphics::copyTo640(_locationBackgroundGfxBuf, _quadBackgroundGfxBuf, 320, 320, 200); + Graphics::copyRect(_locationBackgroundGfxBuf, 640, _quadBackgroundGfxBuf, 320, 320, 200); _fullRedrawCounter = 2; updateSprites(); drawSprite(0); @@ -260,7 +260,7 @@ void TuckerEngine::handleNewPartSequence() { fadeInPalette(); --_fadePaletteCounter; } - Graphics::copyTo640(_locationBackgroundGfxBuf, _quadBackgroundGfxBuf, 320, 320, 200); + Graphics::copyRect(_locationBackgroundGfxBuf, 640, _quadBackgroundGfxBuf, 320, 320, 200); _fullRedrawCounter = 2; updateSprites(); drawSprite(0); @@ -295,7 +295,7 @@ void TuckerEngine::handleMeanwhileSequence() { fadeOutPalette(); ++_fadePaletteCounter; } - Graphics::copyTo640(_locationBackgroundGfxBuf, _quadBackgroundGfxBuf + 89600, 320, 320, 200); + Graphics::copyRect(_locationBackgroundGfxBuf, 640, _quadBackgroundGfxBuf + 89600, 320, 320, 200); _fullRedrawCounter = 2; redrawScreen(0); waitForTimer(3); @@ -306,7 +306,7 @@ void TuckerEngine::handleMeanwhileSequence() { fadeInPalette(); --_fadePaletteCounter; } - Graphics::copyTo640(_locationBackgroundGfxBuf, _quadBackgroundGfxBuf + 89600, 320, 320, 200); + Graphics::copyRect(_locationBackgroundGfxBuf, 640, _quadBackgroundGfxBuf + 89600, 320, 320, 200); _fullRedrawCounter = 2; redrawScreen(0); waitForTimer(3); @@ -338,7 +338,7 @@ void TuckerEngine::handleMapSequence() { while (!_quitGame) { waitForTimer(2); updateMouseState(); - Graphics::copyTo640(_locationBackgroundGfxBuf + _scrollOffset, _quadBackgroundGfxBuf + 89600, 320, 320, 200); + Graphics::copyRect(_locationBackgroundGfxBuf + _scrollOffset, 640, _quadBackgroundGfxBuf + 89600, 320, 320, 200); _fullRedrawCounter = 2; if (_flagsTable[7] > 0 && _mousePosX > 30 && _mousePosX < 86 && _mousePosY > 36 && _mousePosY < 86) { textNum = 13; @@ -460,7 +460,7 @@ int TuckerEngine::handleSpecialObjectSelectionSequence() { while (!_quitGame) { waitForTimer(2); updateMouseState(); - Graphics::copyTo640(_locationBackgroundGfxBuf + _scrollOffset, _quadBackgroundGfxBuf, 320, 320, 200); + Graphics::copyRect(_locationBackgroundGfxBuf + _scrollOffset, 640, _quadBackgroundGfxBuf, 320, 320, 200); _fullRedrawCounter = 2; if (_fadePaletteCounter < 14) { fadeOutPalette(); diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index c95426a6a0..84b430f7bd 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -467,10 +467,10 @@ void TuckerEngine::mainLoop() { continue; } if (_scrollOffset < 320) { - Graphics::copyTo640(_locationBackgroundGfxBuf + _scrollOffset, _currentGfxBackground + _scrollOffset, 320 - _scrollOffset, 320, _locationHeight); + Graphics::copyRect(_locationBackgroundGfxBuf + _scrollOffset, 640, _currentGfxBackground + _scrollOffset, 320, 320 - _scrollOffset, _locationHeight); } if (_scrollOffset > 0) { - Graphics::copyTo640(_locationBackgroundGfxBuf + 320, _currentGfxBackground + 44800, _scrollOffset, 320, _locationHeight); + Graphics::copyRect(_locationBackgroundGfxBuf + 320, 640, _currentGfxBackground + 44800, 320, _scrollOffset, _locationHeight); } drawData3(); execData3PreUpdate(); |