[Scummvm-cvs-logs] scummvm master -> ae88f41596b1331496db4dce30e84d5948244518

bluegr md5 at scummvm.org
Sun Feb 20 11:21:42 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ae88f41596 SCI: Slight cleanup


Commit: ae88f41596b1331496db4dce30e84d5948244518
    https://github.com/scummvm/scummvm/commit/ae88f41596b1331496db4dce30e84d5948244518
Author: md5 (md5 at scummvm.org)
Date: 2011-02-20T02:20:40-08:00

Commit Message:
SCI: Slight cleanup

Changed paths:
    engines/sci/graphics/paint16.cpp
    engines/sci/graphics/view.cpp



diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp
index 0bb3fc8..935dd4e 100644
--- a/engines/sci/graphics/paint16.cpp
+++ b/engines/sci/graphics/paint16.cpp
@@ -121,11 +121,10 @@ void GfxPaint16::drawCel(GfxView *view, int16 loopNo, int16 celNo, const Common:
 
 	Common::Rect clipRectTranslated = clipRect;
 	_ports->offsetRect(clipRectTranslated);
-	if (scaleX == 128 && scaleY == 128) {
+	if (scaleX == 128 && scaleY == 128)
 		view->draw(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo, false);
-	} else {
+	else
 		view->drawScaled(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, scaleX, scaleY);
-	}
 }
 
 // This is used as replacement for drawCelAndShow() when hires-cels are drawn to
@@ -278,9 +277,8 @@ void GfxPaint16::fillRect(const Common::Rect &rect, int16 drawFlags, byte color,
 }
 
 void GfxPaint16::frameRect(const Common::Rect &rect) {
-	Common::Rect r;
+	Common::Rect r = rect;
 	// left
-	r = rect;
 	r.right = rect.left + 1;
 	paintRect(r);
 	// right
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index a8fc8e7..3c1f417 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -346,12 +346,9 @@ void GfxView::getCelRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, C
 
 void GfxView::getCelSpecialHoyle4Rect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect &outRect) const {
 	const CelInfo *celInfo = getCelInfo(loopNo, celNo);
-	int16 adjustY = y - celInfo->height + celInfo->displaceY + 1;
-	int16 adjustX = x - ((celInfo->width - 1) >> 1) + celInfo->displaceX;
-	outRect.top += adjustY;
-	outRect.bottom += adjustY;
-	outRect.left += adjustX;
-	outRect.right += adjustX;
+	int16 adjustY = y + celInfo->displaceY - celInfo->height + 1;
+	int16 adjustX = x + celInfo->displaceX - ((celInfo->width - 1) >> 1);
+	outRect.translate(adjustX, adjustY);
 }
 
 void GfxView::getCelScaledRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, int16 scaleX, int16 scaleY, Common::Rect &outRect) const {
@@ -655,10 +652,9 @@ void GfxView::draw(const Common::Rect &rect, const Common::Rect &clipRect, const
 	const byte drawMask = (priority == 255) ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY;
 	int x, y;
 
-	if (_embeddedPal) {
+	if (_embeddedPal)
 		// Merge view palette in...
 		_palette->set(&_viewPalette, false);
-	}
 
 	const int16 width = MIN(clipRect.width(), celWidth);
 	const int16 height = MIN(clipRect.height(), celHeight);
@@ -679,7 +675,7 @@ void GfxView::draw(const Common::Rect &rect, const Common::Rect &clipRect, const
 						// UpscaledHires means view is hires and is supposed to
 						// get drawn onto lowres screen.
 						// FIXME(?): we can't read priority directly with the
-						// hires coordinates. may not be needed at all in kq6
+						// hires coordinates. May not be needed at all in kq6
 						_screen->putPixelOnDisplay(x2, y2, palette->mapping[color]);
 					}
 				}
@@ -718,10 +714,9 @@ void GfxView::drawScaled(const Common::Rect &rect, const Common::Rect &clipRect,
 	int16 scaledWidth, scaledHeight;
 	int pixelNo, scaledPixel, scaledPixelNo, prevScaledPixelNo;
 
-	if (_embeddedPal) {
+	if (_embeddedPal)
 		// Merge view palette in...
 		_palette->set(&_viewPalette, false);
-	}
 
 	scaledWidth = (celInfo->width * scaleX) >> 7;
 	scaledHeight = (celInfo->height * scaleY) >> 7;






More information about the Scummvm-git-logs mailing list