[Scummvm-cvs-logs] SF.net SVN: scummvm:[35892] scummvm/trunk/engines/tucker

cyx at users.sourceforge.net cyx at users.sourceforge.net
Sun Jan 18 05:00:11 CET 2009


Revision: 35892
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35892&view=rev
Author:   cyx
Date:     2009-01-18 04:00:11 +0000 (Sun, 18 Jan 2009)

Log Message:
-----------
merged Graphics::copyTo640/Graphics::copyFrom640

Modified Paths:
--------------
    scummvm/trunk/engines/tucker/graphics.cpp
    scummvm/trunk/engines/tucker/graphics.h
    scummvm/trunk/engines/tucker/resource.cpp
    scummvm/trunk/engines/tucker/sequences.cpp
    scummvm/trunk/engines/tucker/tucker.cpp

Modified: scummvm/trunk/engines/tucker/graphics.cpp
===================================================================
--- scummvm/trunk/engines/tucker/graphics.cpp	2009-01-18 03:22:33 UTC (rev 35891)
+++ scummvm/trunk/engines/tucker/graphics.cpp	2009-01-18 04:00:11 UTC (rev 35892)
@@ -157,18 +157,10 @@
 	}
 }
 
-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;
 	}
 }

Modified: scummvm/trunk/engines/tucker/graphics.h
===================================================================
--- scummvm/trunk/engines/tucker/graphics.h	2009-01-18 03:22:33 UTC (rev 35891)
+++ scummvm/trunk/engines/tucker/graphics.h	2009-01-18 04:00:11 UTC (rev 35892)
@@ -55,8 +55,7 @@
 	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);
 

Modified: scummvm/trunk/engines/tucker/resource.cpp
===================================================================
--- scummvm/trunk/engines/tucker/resource.cpp	2009-01-18 03:22:33 UTC (rev 35891)
+++ scummvm/trunk/engines/tucker/resource.cpp	2009-01-18 04:00:11 UTC (rev 35892)
@@ -427,7 +427,7 @@
 	_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 @@
 	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 @@
 	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 @@
 	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;
 }

Modified: scummvm/trunk/engines/tucker/sequences.cpp
===================================================================
--- scummvm/trunk/engines/tucker/sequences.cpp	2009-01-18 03:22:33 UTC (rev 35891)
+++ scummvm/trunk/engines/tucker/sequences.cpp	2009-01-18 04:00:11 UTC (rev 35892)
@@ -81,9 +81,9 @@
 			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 @@
 	_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 @@
 			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 @@
 			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 @@
 			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 @@
 			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 @@
 	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 @@
 	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();

Modified: scummvm/trunk/engines/tucker/tucker.cpp
===================================================================
--- scummvm/trunk/engines/tucker/tucker.cpp	2009-01-18 03:22:33 UTC (rev 35891)
+++ scummvm/trunk/engines/tucker/tucker.cpp	2009-01-18 04:00:11 UTC (rev 35892)
@@ -467,10 +467,10 @@
 			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();


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