[Scummvm-cvs-logs] SF.net SVN: scummvm:[49039] scummvm/trunk/engines/sci

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat May 15 10:57:13 CEST 2010


Revision: 49039
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49039&view=rev
Author:   m_kiewitz
Date:     2010-05-15 08:57:13 +0000 (Sat, 15 May 2010)

Log Message:
-----------
SCI: SCI_SCREEN_MASK_* now GFX_SCREEN_MASK_*, using enum - added new enum GFX_SCREEN_UPSCALED_*

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/graphics/animate.cpp
    scummvm/trunk/engines/sci/graphics/compare.cpp
    scummvm/trunk/engines/sci/graphics/menu.cpp
    scummvm/trunk/engines/sci/graphics/paint16.cpp
    scummvm/trunk/engines/sci/graphics/paint32.cpp
    scummvm/trunk/engines/sci/graphics/picture.cpp
    scummvm/trunk/engines/sci/graphics/ports.cpp
    scummvm/trunk/engines/sci/graphics/robot.cpp
    scummvm/trunk/engines/sci/graphics/screen.cpp
    scummvm/trunk/engines/sci/graphics/screen.h
    scummvm/trunk/engines/sci/graphics/view.cpp

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-05-15 08:56:27 UTC (rev 49038)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-05-15 08:57:13 UTC (rev 49039)
@@ -463,7 +463,7 @@
 	int argBase = 0;
 
 	if ((argc == 2) || (argc == 4)) {
-		screenMask = SCI_SCREEN_MASK_CONTROL;
+		screenMask = GFX_SCREEN_MASK_CONTROL;
 	} else {
 		screenMask = argv[0].toUint16();
 		argBase = 1;

Modified: scummvm/trunk/engines/sci/graphics/animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.cpp	2010-05-15 08:56:27 UTC (rev 49038)
+++ scummvm/trunk/engines/sci/graphics/animate.cpp	2010-05-15 08:57:13 UTC (rev 49039)
@@ -316,7 +316,7 @@
 			if ((signal & kSignalIgnoreActor) == 0) {
 				rect = listEntry->celRect;
 				rect.top = CLIP<int16>(_ports->kernelPriorityToCoordinate(listEntry->priority) - 1, rect.top, rect.bottom - 1);
-				_paint16->fillRect(rect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15);
+				_paint16->fillRect(rect, GFX_SCREEN_MASK_CONTROL, 0, 0, 15);
 			}
 			listEntry->signal = signal;
 		}
@@ -336,9 +336,9 @@
 			} else {
 				signal &= 0xFFFF ^ kSignalRemoveView;
 				if (signal & kSignalIgnoreActor)
-					bitsHandle = _paint16->bitsSave(listEntry->celRect, SCI_SCREEN_MASK_VISUAL|SCI_SCREEN_MASK_PRIORITY);
+					bitsHandle = _paint16->bitsSave(listEntry->celRect, GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY);
 				else
-					bitsHandle = _paint16->bitsSave(listEntry->celRect, SCI_SCREEN_MASK_ALL);
+					bitsHandle = _paint16->bitsSave(listEntry->celRect, GFX_SCREEN_MASK_ALL);
 				PUT_SEL32(_s->_segMan, curObject, SELECTOR(underBits), bitsHandle);
 			}
 			listEntry->signal = signal;
@@ -361,7 +361,7 @@
 			if ((signal & kSignalIgnoreActor) == 0) {
 				rect = listEntry->celRect;
 				rect.top = CLIP<int16>(_ports->kernelPriorityToCoordinate(listEntry->priority) - 1, rect.top, rect.bottom - 1);
-				_paint16->fillRect(rect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15);
+				_paint16->fillRect(rect, GFX_SCREEN_MASK_CONTROL, 0, 0, 15);
 			}
 		}
 		listIterator++;
@@ -386,7 +386,7 @@
 
 		if (!(signal & (kSignalNoUpdate | kSignalHidden | kSignalAlwaysUpdate))) {
 			// Save background
-			bitsHandle = _paint16->bitsSave(listEntry->celRect, SCI_SCREEN_MASK_ALL);
+			bitsHandle = _paint16->bitsSave(listEntry->celRect, GFX_SCREEN_MASK_ALL);
 			PUT_SEL32(_s->_segMan, curObject, SELECTOR(underBits), bitsHandle);
 
 			// draw corresponding cel
@@ -504,7 +504,7 @@
 		lastCastEntry = _lastCastData;
 		lastCastCount = _lastCastCount;
 		while (lastCastCount > 0) {
-			lastCastEntry->castHandle = _paint16->bitsSave(lastCastEntry->celRect, SCI_SCREEN_MASK_VISUAL|SCI_SCREEN_MASK_PRIORITY);
+			lastCastEntry->castHandle = _paint16->bitsSave(lastCastEntry->celRect, GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY);
 			_paint16->drawCel(lastCastEntry->viewId, lastCastEntry->loopNo, lastCastEntry->celNo, lastCastEntry->celRect, lastCastEntry->priority, lastCastEntry->paletteNo, lastCastEntry->scaleX, lastCastEntry->scaleY);
 			lastCastEntry++; lastCastCount--;
 		}
@@ -546,7 +546,7 @@
 		_paint16->drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect, listEntry->priority, listEntry->paletteNo);
 		if ((listEntry->signal & kSignalIgnoreActor) == 0) {
 			listEntry->celRect.top = CLIP<int16>(_ports->kernelPriorityToCoordinate(listEntry->priority) - 1, listEntry->celRect.top, listEntry->celRect.bottom - 1);
-			_paint16->fillRect(listEntry->celRect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15);
+			_paint16->fillRect(listEntry->celRect, GFX_SCREEN_MASK_CONTROL, 0, 0, 15);
 		}
 
 		listIterator++;

Modified: scummvm/trunk/engines/sci/graphics/compare.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/compare.cpp	2010-05-15 08:56:27 UTC (rev 49038)
+++ scummvm/trunk/engines/sci/graphics/compare.cpp	2010-05-15 08:57:13 UTC (rev 49039)
@@ -53,7 +53,7 @@
 	if (rect.isEmpty())
 		return 0;
 
-	if (screenMask & SCI_SCREEN_MASK_PRIORITY) {
+	if (screenMask & GFX_SCREEN_MASK_PRIORITY) {
 		for (y = rect.top; y < rect.bottom; y++) {
 			for (x = rect.left; x < rect.right; x++) {
 				result |= 1 << _screen->getPriority(x, y);
@@ -161,7 +161,7 @@
 
 	signal = GET_SEL32V(_segMan, curObject, SELECTOR(signal));
 	controlMask = GET_SEL32V(_segMan, curObject, SELECTOR(illegalBits));
-	result = (isOnControl(SCI_SCREEN_MASK_CONTROL, adjustedRect) & controlMask) ? false : true;
+	result = (isOnControl(GFX_SCREEN_MASK_CONTROL, adjustedRect) & controlMask) ? false : true;
 	if ((result) && (signal & (kSignalIgnoreActor | kSignalRemoveView)) == 0) {
 		List *list = _segMan->lookupList(listReference);
 		if (!list)

Modified: scummvm/trunk/engines/sci/graphics/menu.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/menu.cpp	2010-05-15 08:56:27 UTC (rev 49038)
+++ scummvm/trunk/engines/sci/graphics/menu.cpp	2010-05-15 08:57:13 UTC (rev 49039)
@@ -563,12 +563,12 @@
 	}
 
 	// Save background
-	_menuSaveHandle = _paint16->bitsSave(_menuRect, SCI_SCREEN_MASK_VISUAL);
+	_menuSaveHandle = _paint16->bitsSave(_menuRect, GFX_SCREEN_MASK_VISUAL);
 
 	// Do the drawing
-	_paint16->fillRect(_menuRect, SCI_SCREEN_MASK_VISUAL, 0);
+	_paint16->fillRect(_menuRect, GFX_SCREEN_MASK_VISUAL, 0);
 	_menuRect.left++; _menuRect.right--; _menuRect.bottom--;
-	_paint16->fillRect(_menuRect, SCI_SCREEN_MASK_VISUAL, _screen->getColorWhite());
+	_paint16->fillRect(_menuRect, GFX_SCREEN_MASK_VISUAL, _screen->getColorWhite());
 
 	_menuRect.left += 8;
 	topPos = _menuRect.top + 1;
@@ -588,7 +588,7 @@
 				pixelPos.y = topPos + (_ports->_curPort->fontHeight >> 1) - 1;
 				pixelPos.x = _menuRect.left - 7;
 				while (pixelPos.x < (_menuRect.right - 1)) {
-					_screen->putPixel(pixelPos.x, pixelPos.y, SCI_SCREEN_MASK_VISUAL, 0, 0, 0);
+					_screen->putPixel(pixelPos.x, pixelPos.y, GFX_SCREEN_MASK_VISUAL, 0, 0, 0);
 					pixelPos.x += 2;
 				}
 			}
@@ -689,7 +689,7 @@
 
 	calculateMenuAndItemWidth();
 	_oldPort = _ports->setPort(_ports->_menuPort);
-	_barSaveHandle = _paint16->bitsSave(_ports->_menuRect, SCI_SCREEN_MASK_VISUAL);
+	_barSaveHandle = _paint16->bitsSave(_ports->_menuRect, GFX_SCREEN_MASK_VISUAL);
 
 	_ports->penColor(0);
 	_ports->backColor(_screen->getColorWhite());
@@ -810,7 +810,7 @@
 
 	calculateMenuAndItemWidth();
 	_oldPort = _ports->setPort(_ports->_menuPort);
-	_barSaveHandle = _paint16->bitsSave(_ports->_menuRect, SCI_SCREEN_MASK_VISUAL);
+	_barSaveHandle = _paint16->bitsSave(_ports->_menuRect, GFX_SCREEN_MASK_VISUAL);
 
 	_ports->penColor(0);
 	_ports->backColor(_screen->getColorWhite());

Modified: scummvm/trunk/engines/sci/graphics/paint16.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint16.cpp	2010-05-15 08:56:27 UTC (rev 49038)
+++ scummvm/trunk/engines/sci/graphics/paint16.cpp	2010-05-15 08:57:13 UTC (rev 49039)
@@ -173,13 +173,13 @@
 }
 
 void GfxPaint16::clearScreen(byte color) {
-	fillRect(_ports->_curPort->rect, SCI_SCREEN_MASK_ALL, color, 0, 0);
+	fillRect(_ports->_curPort->rect, GFX_SCREEN_MASK_ALL, color, 0, 0);
 }
 
 void GfxPaint16::invertRect(const Common::Rect &rect) {
 	int16 oldpenmode = _ports->_curPort->penMode;
 	_ports->_curPort->penMode = 2;
-	fillRect(rect, SCI_SCREEN_MASK_VISUAL, _ports->_curPort->penClr, _ports->_curPort->backClr);
+	fillRect(rect, GFX_SCREEN_MASK_VISUAL, _ports->_curPort->penClr, _ports->_curPort->backClr);
 	_ports->_curPort->penMode = oldpenmode;
 }
 
@@ -197,17 +197,17 @@
 	for (y = r.top; y < r.bottom; y++) {
 		for (x = r.left; x < r.right; x++) {
 			curVisual = _screen->getVisual(x, y);
-			_screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, curVisual ^ 0x0f, 0, 0);
+			_screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, curVisual ^ 0x0f, 0, 0);
 		}
 	}
 }
 
 void GfxPaint16::eraseRect(const Common::Rect &rect) {
-	fillRect(rect, SCI_SCREEN_MASK_VISUAL, _ports->_curPort->backClr);
+	fillRect(rect, GFX_SCREEN_MASK_VISUAL, _ports->_curPort->backClr);
 }
 
 void GfxPaint16::paintRect(const Common::Rect &rect) {
-	fillRect(rect, SCI_SCREEN_MASK_VISUAL, _ports->_curPort->penClr);
+	fillRect(rect, GFX_SCREEN_MASK_VISUAL, _ports->_curPort->penClr);
 }
 
 void GfxPaint16::fillRect(const Common::Rect &rect, int16 drawFlags, byte clrPen, byte clrBack, byte bControl) {
@@ -222,22 +222,22 @@
 	byte curVisual;
 
 	// Doing visual first
-	if (drawFlags & SCI_SCREEN_MASK_VISUAL) {
+	if (drawFlags & GFX_SCREEN_MASK_VISUAL) {
 		if (oldPenMode == 2) { // invert mode
 			for (y = r.top; y < r.bottom; y++) {
 				for (x = r.left; x < r.right; x++) {
 					curVisual = _screen->getVisual(x, y);
 					if (curVisual == clrPen) {
-						_screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, clrBack, 0, 0);
+						_screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, clrBack, 0, 0);
 					} else if (curVisual == clrBack) {
-						_screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, clrPen, 0, 0);
+						_screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, clrPen, 0, 0);
 					}
 				}
 			}
 		} else { // just fill rect with ClrPen
 			for (y = r.top; y < r.bottom; y++) {
 				for (x = r.left; x < r.right; x++) {
-					_screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, clrPen, 0, 0);
+					_screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, clrPen, 0, 0);
 				}
 			}
 		}
@@ -245,7 +245,7 @@
 
 	if (drawFlags < 2)
 		return;
-	drawFlags &= SCI_SCREEN_MASK_PRIORITY|SCI_SCREEN_MASK_CONTROL;
+	drawFlags &= GFX_SCREEN_MASK_PRIORITY|GFX_SCREEN_MASK_CONTROL;
 
 	if (oldPenMode != 2) {
 		for (y = r.top; y < r.bottom; y++) {
@@ -306,7 +306,7 @@
 	if (workerRect.isEmpty()) // nothing to save
 		return NULL_REG;
 
-	if (screenMask == SCI_SCREEN_MASK_DISPLAY) {
+	if (screenMask == GFX_SCREEN_MASK_DISPLAY) {
 		// Adjust rect to upscaled hires, but dont adjust according to port
 		workerRect.top *= 2; workerRect.bottom *= 2; workerRect.bottom++;
 		workerRect.left *= 2; workerRect.right *= 2; workerRect.right++;
@@ -407,7 +407,7 @@
 }
 
 reg_t GfxPaint16::kernelGraphSaveUpscaledHiresBox(Common::Rect rect) {
-	return bitsSave(rect, SCI_SCREEN_MASK_DISPLAY);
+	return bitsSave(rect, GFX_SCREEN_MASK_DISPLAY);
 }
 
 void GfxPaint16::kernelGraphRestoreBox(reg_t handle) {
@@ -525,9 +525,9 @@
 	}
 
 	if (doSaveUnder)
-		result = bitsSave(rect, SCI_SCREEN_MASK_VISUAL);
+		result = bitsSave(rect, GFX_SCREEN_MASK_VISUAL);
 	if (colorBack != -1)
-		fillRect(rect, SCI_SCREEN_MASK_VISUAL, colorBack, 0, 0);
+		fillRect(rect, GFX_SCREEN_MASK_VISUAL, colorBack, 0, 0);
 	_text16->Box(text, 0, rect, alignment, -1);
 	if (_screen->_picNotValid == 0 && bRedraw)
 		bitsShow(rect);

Modified: scummvm/trunk/engines/sci/graphics/paint32.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint32.cpp	2010-05-15 08:56:27 UTC (rev 49038)
+++ scummvm/trunk/engines/sci/graphics/paint32.cpp	2010-05-15 08:57:13 UTC (rev 49039)
@@ -52,7 +52,7 @@
 	int16 y, x;
 	for (y = rect.top; y < rect.bottom; y++) {
 		for (x = rect.left; x < rect.right; x++) {
-			_screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, color, 0, 0);
+			_screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, color, 0, 0);
 		}
 	}
 }

Modified: scummvm/trunk/engines/sci/graphics/picture.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/picture.cpp	2010-05-15 08:56:27 UTC (rev 49038)
+++ scummvm/trunk/engines/sci/graphics/picture.cpp	2010-05-15 08:57:13 UTC (rev 49039)
@@ -86,7 +86,7 @@
 	int16 x, y;
 	for (y = _ports->getPort()->top; y < _screen->getHeight(); y++) {
 		for (x = 0; x < _screen->getWidth(); x++) {
-			_screen->putPixel(x, y, SCI_SCREEN_MASK_ALL, 255, 0, 0);
+			_screen->putPixel(x, y, GFX_SCREEN_MASK_ALL, 255, 0, 0);
 		}
 	}
 }
@@ -304,7 +304,7 @@
 		while (y < lastY) {
 			curByte = *ptr++;
 			if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y)))
-				_screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL | SCI_SCREEN_MASK_PRIORITY, curByte, priority, 0);
+				_screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL | GFX_SCREEN_MASK_PRIORITY, curByte, priority, 0);
 
 			x++;
 
@@ -321,7 +321,7 @@
 		while (y < lastY) {
 			curByte = *ptr++;
 			if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y)))
-				_screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL | SCI_SCREEN_MASK_PRIORITY, curByte, priority, 0);
+				_screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL | GFX_SCREEN_MASK_PRIORITY, curByte, priority, 0);
 			
 			if (x == leftX) {
 				if (width > rightX - leftX) // Skip extra pixels at the end of the row
@@ -716,35 +716,35 @@
 	byte searchControl = _screen->getControl(p.x, p.y);
 
 	// This logic was taken directly from sierra sci, floodfill will get aborted on various occations
-	if (screenMask & SCI_SCREEN_MASK_VISUAL) {
+	if (screenMask & GFX_SCREEN_MASK_VISUAL) {
 		if ((color == _screen->getColorWhite()) || (searchColor != _screen->getColorWhite()))
 			return;
-	} else if (screenMask & SCI_SCREEN_MASK_PRIORITY) {
+	} else if (screenMask & GFX_SCREEN_MASK_PRIORITY) {
 		if ((priority == 0) || (searchPriority != 0))
 			return;
-	} else if (screenMask & SCI_SCREEN_MASK_CONTROL) {
+	} else if (screenMask & GFX_SCREEN_MASK_CONTROL) {
 		if ((control == 0) || (searchControl != 0))
 			return;
 	}
 
 	// Now remove screens, that already got the right color/priority/control
-	if ((screenMask & SCI_SCREEN_MASK_VISUAL) && (searchColor == color))
-		screenMask ^= SCI_SCREEN_MASK_VISUAL;
-	if ((screenMask & SCI_SCREEN_MASK_PRIORITY) && (searchPriority == priority))
-		screenMask ^= SCI_SCREEN_MASK_PRIORITY;
-	if ((screenMask & SCI_SCREEN_MASK_CONTROL) && (searchControl == control))
-		screenMask ^= SCI_SCREEN_MASK_CONTROL;
+	if ((screenMask & GFX_SCREEN_MASK_VISUAL) && (searchColor == color))
+		screenMask ^= GFX_SCREEN_MASK_VISUAL;
+	if ((screenMask & GFX_SCREEN_MASK_PRIORITY) && (searchPriority == priority))
+		screenMask ^= GFX_SCREEN_MASK_PRIORITY;
+	if ((screenMask & GFX_SCREEN_MASK_CONTROL) && (searchControl == control))
+		screenMask ^= GFX_SCREEN_MASK_CONTROL;
 
 	// Exit, if no screens left
 	if (!screenMask)
 		return;
 
-	if (screenMask & SCI_SCREEN_MASK_VISUAL) {
-		matchMask = SCI_SCREEN_MASK_VISUAL;
-	} else if (screenMask & SCI_SCREEN_MASK_PRIORITY) {
-		matchMask = SCI_SCREEN_MASK_PRIORITY;
+	if (screenMask & GFX_SCREEN_MASK_VISUAL) {
+		matchMask = GFX_SCREEN_MASK_VISUAL;
+	} else if (screenMask & GFX_SCREEN_MASK_PRIORITY) {
+		matchMask = GFX_SCREEN_MASK_PRIORITY;
 	} else {
-		matchMask = SCI_SCREEN_MASK_CONTROL;
+		matchMask = GFX_SCREEN_MASK_CONTROL;
 	}
 
 	// hard borders for filling

Modified: scummvm/trunk/engines/sci/graphics/ports.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/ports.cpp	2010-05-15 08:56:27 UTC (rev 49038)
+++ scummvm/trunk/engines/sci/graphics/ports.cpp	2010-05-15 08:57:13 UTC (rev 49039)
@@ -247,7 +247,7 @@
 	pwnd->hSaved1 = pwnd->hSaved2 = NULL_REG;
 	pwnd->bDrawn = false;
 	if ((style & SCI_WINDOWMGR_STYLE_TRANSPARENT) == 0)
-		pwnd->saveScreenMask = (priority == -1 ? SCI_SCREEN_MASK_VISUAL : SCI_SCREEN_MASK_VISUAL | SCI_SCREEN_MASK_PRIORITY);
+		pwnd->saveScreenMask = (priority == -1 ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL | GFX_SCREEN_MASK_PRIORITY);
 
 	if (title && (style & SCI_WINDOWMGR_STYLE_TITLE)) {
 		pwnd->title = title;
@@ -301,11 +301,11 @@
 	Port *oldport = setPort(_wmgrPort);
 	penColor(0);
 	if ((wndStyle & SCI_WINDOWMGR_STYLE_TRANSPARENT) == 0) {
-		pWnd->hSaved1 = _paint16->bitsSave(pWnd->restoreRect, SCI_SCREEN_MASK_VISUAL);
-		if (pWnd->saveScreenMask & SCI_SCREEN_MASK_PRIORITY) {
-			pWnd->hSaved2 = _paint16->bitsSave(pWnd->restoreRect, SCI_SCREEN_MASK_PRIORITY);
+		pWnd->hSaved1 = _paint16->bitsSave(pWnd->restoreRect, GFX_SCREEN_MASK_VISUAL);
+		if (pWnd->saveScreenMask & GFX_SCREEN_MASK_PRIORITY) {
+			pWnd->hSaved2 = _paint16->bitsSave(pWnd->restoreRect, GFX_SCREEN_MASK_PRIORITY);
 			if ((wndStyle & SCI_WINDOWMGR_STYLE_USER) == 0)
-				_paint16->fillRect(pWnd->restoreRect, SCI_SCREEN_MASK_PRIORITY, 0, 15);
+				_paint16->fillRect(pWnd->restoreRect, GFX_SCREEN_MASK_PRIORITY, 0, 15);
 		}
 	}
 
@@ -327,9 +327,9 @@
 				}
 				r.grow(-1);
 				if (getSciVersion() <= SCI_VERSION_0_LATE)
-					_paint16->fillRect(r, SCI_SCREEN_MASK_VISUAL, 8); // grey titlebar for SCI0
+					_paint16->fillRect(r, GFX_SCREEN_MASK_VISUAL, 8); // grey titlebar for SCI0
 				else
-					_paint16->fillRect(r, SCI_SCREEN_MASK_VISUAL, 0); // black titlebar for SCI01+
+					_paint16->fillRect(r, GFX_SCREEN_MASK_VISUAL, 0); // black titlebar for SCI01+
 				if (!pWnd->title.empty()) {
 					int16 oldcolor = getPort()->penClr;
 					penColor(_screen->getColorWhite());
@@ -346,7 +346,7 @@
 		}
 
 		if (!(wndStyle & SCI_WINDOWMGR_STYLE_TRANSPARENT))
-			_paint16->fillRect(r, SCI_SCREEN_MASK_VISUAL, pWnd->backClr);
+			_paint16->fillRect(r, GFX_SCREEN_MASK_VISUAL, pWnd->backClr);
 
 		_paint16->bitsShow(pWnd->restoreRect);
 	}
@@ -371,11 +371,11 @@
 	reg_t handle;
 
 	if (wnd->saveScreenMask && wnd->bDrawn) {
-		handle = _paint16->bitsSave(wnd->restoreRect, SCI_SCREEN_MASK_VISUAL);
+		handle = _paint16->bitsSave(wnd->restoreRect, GFX_SCREEN_MASK_VISUAL);
 		_paint16->bitsRestore(wnd->hSaved1);
 		wnd->hSaved1 = handle;
-		if (wnd->saveScreenMask & SCI_SCREEN_MASK_PRIORITY) {
-			handle = _paint16->bitsSave(wnd->restoreRect, SCI_SCREEN_MASK_PRIORITY);
+		if (wnd->saveScreenMask & GFX_SCREEN_MASK_PRIORITY) {
+			handle = _paint16->bitsSave(wnd->restoreRect, GFX_SCREEN_MASK_PRIORITY);
 			_paint16->bitsRestore(wnd->hSaved2);
 			wnd->hSaved2 = handle;
 		}

Modified: scummvm/trunk/engines/sci/graphics/robot.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/robot.cpp	2010-05-15 08:56:27 UTC (rev 49038)
+++ scummvm/trunk/engines/sci/graphics/robot.cpp	2010-05-15 08:57:13 UTC (rev 49039)
@@ -168,7 +168,7 @@
 	//for (frame = 0; frame < 30; frame++) {
 	for (y = 0; y < _height; y++) {
 		for (x = 0; x < _width; x++) {
-			_screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, *bitmapData, 0, 0);
+			_screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, *bitmapData, 0, 0);
 			bitmapData++;
 		}
 	}

Modified: scummvm/trunk/engines/sci/graphics/screen.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/screen.cpp	2010-05-15 08:56:27 UTC (rev 49038)
+++ scummvm/trunk/engines/sci/graphics/screen.cpp	2010-05-15 08:57:13 UTC (rev 49039)
@@ -135,18 +135,18 @@
 byte GfxScreen::getDrawingMask(byte color, byte prio, byte control) {
 	byte flag = 0;
 	if (color != 255)
-		flag |= SCI_SCREEN_MASK_VISUAL;
+		flag |= GFX_SCREEN_MASK_VISUAL;
 	if (prio != 255)
-		flag |= SCI_SCREEN_MASK_PRIORITY;
+		flag |= GFX_SCREEN_MASK_PRIORITY;
 	if (control != 255)
-		flag |= SCI_SCREEN_MASK_CONTROL;
+		flag |= GFX_SCREEN_MASK_CONTROL;
 	return flag;
 }
 
 void GfxScreen::putPixel(int x, int y, byte drawMask, byte color, byte priority, byte control) {
 	int offset = y * _width + x;
 
-	if (drawMask & SCI_SCREEN_MASK_VISUAL) {
+	if (drawMask & GFX_SCREEN_MASK_VISUAL) {
 		_visualScreen[offset] = color;
 		if (!_upscaledHires) {
 			_displayScreen[offset] = color;
@@ -158,9 +158,9 @@
 			_displayScreen[displayOffset + _displayWidth + 1] = color;
 		}
 	}
-	if (drawMask & SCI_SCREEN_MASK_PRIORITY)
+	if (drawMask & GFX_SCREEN_MASK_PRIORITY)
 		_priorityScreen[offset] = priority;
-	if (drawMask & SCI_SCREEN_MASK_CONTROL)
+	if (drawMask & GFX_SCREEN_MASK_CONTROL)
 		_controlScreen[offset] = control;
 }
 
@@ -258,19 +258,19 @@
 	int offset = y * _width + x;
 	byte match = 0;
 
-	if (screenMask & SCI_SCREEN_MASK_VISUAL && *(_visualScreen + offset) == t_color)
-		match |= SCI_SCREEN_MASK_VISUAL;
-	if (screenMask & SCI_SCREEN_MASK_PRIORITY && *(_priorityScreen + offset) == t_pri)
-		match |= SCI_SCREEN_MASK_PRIORITY;
-	if (screenMask & SCI_SCREEN_MASK_CONTROL && *(_controlScreen + offset) == t_con)
-		match |= SCI_SCREEN_MASK_CONTROL;
+	if (screenMask & GFX_SCREEN_MASK_VISUAL && *(_visualScreen + offset) == t_color)
+		match |= GFX_SCREEN_MASK_VISUAL;
+	if (screenMask & GFX_SCREEN_MASK_PRIORITY && *(_priorityScreen + offset) == t_pri)
+		match |= GFX_SCREEN_MASK_PRIORITY;
+	if (screenMask & GFX_SCREEN_MASK_CONTROL && *(_controlScreen + offset) == t_con)
+		match |= GFX_SCREEN_MASK_CONTROL;
 	return match;
 }
 
 int GfxScreen::bitsGetDataSize(Common::Rect rect, byte mask) {
 	int byteCount = sizeof(rect) + sizeof(mask);
 	int pixels = rect.width() * rect.height();
-	if (mask & SCI_SCREEN_MASK_VISUAL) {
+	if (mask & GFX_SCREEN_MASK_VISUAL) {
 		byteCount += pixels; // _visualScreen
 		if (!_upscaledHires) {
 			byteCount += pixels; // _displayScreen
@@ -278,13 +278,13 @@
 			byteCount += pixels * 4; // _displayScreen (upscaled hires)
 		}
 	}
-	if (mask & SCI_SCREEN_MASK_PRIORITY) {
+	if (mask & GFX_SCREEN_MASK_PRIORITY) {
 		byteCount += pixels; // _priorityScreen
 	}
-	if (mask & SCI_SCREEN_MASK_CONTROL) {
+	if (mask & GFX_SCREEN_MASK_CONTROL) {
 		byteCount += pixels; // _controlScreen
 	}
-	if (mask & SCI_SCREEN_MASK_DISPLAY) {
+	if (mask & GFX_SCREEN_MASK_DISPLAY) {
 		if (!_upscaledHires)
 			error("bitsGetDataSize() called w/o being in upscaled hires mode");
 		byteCount += pixels; // _displayScreen (coordinates actually are given to us for hires displayScreen)
@@ -297,17 +297,17 @@
 	memcpy(memoryPtr, (void *)&rect, sizeof(rect)); memoryPtr += sizeof(rect);
 	memcpy(memoryPtr, (void *)&mask, sizeof(mask)); memoryPtr += sizeof(mask);
 
-	if (mask & SCI_SCREEN_MASK_VISUAL) {
+	if (mask & GFX_SCREEN_MASK_VISUAL) {
 		bitsSaveScreen(rect, _visualScreen, _width, memoryPtr);
 		bitsSaveDisplayScreen(rect, memoryPtr);
 	}
-	if (mask & SCI_SCREEN_MASK_PRIORITY) {
+	if (mask & GFX_SCREEN_MASK_PRIORITY) {
 		bitsSaveScreen(rect, _priorityScreen, _width, memoryPtr);
 	}
-	if (mask & SCI_SCREEN_MASK_CONTROL) {
+	if (mask & GFX_SCREEN_MASK_CONTROL) {
 		bitsSaveScreen(rect, _controlScreen, _width, memoryPtr);
 	}
-	if (mask & SCI_SCREEN_MASK_DISPLAY) {
+	if (mask & GFX_SCREEN_MASK_DISPLAY) {
 		if (!_upscaledHires)
 			error("bitsSave() called w/o being in upscaled hires mode");
 		bitsSaveScreen(rect, _displayScreen, _displayWidth, memoryPtr);
@@ -356,17 +356,17 @@
 	memcpy((void *)&rect, memoryPtr, sizeof(rect)); memoryPtr += sizeof(rect);
 	memcpy((void *)&mask, memoryPtr, sizeof(mask)); memoryPtr += sizeof(mask);
 
-	if (mask & SCI_SCREEN_MASK_VISUAL) {
+	if (mask & GFX_SCREEN_MASK_VISUAL) {
 		bitsRestoreScreen(rect, memoryPtr, _visualScreen, _width);
 		bitsRestoreDisplayScreen(rect, memoryPtr);
 	}
-	if (mask & SCI_SCREEN_MASK_PRIORITY) {
+	if (mask & GFX_SCREEN_MASK_PRIORITY) {
 		bitsRestoreScreen(rect, memoryPtr, _priorityScreen, _width);
 	}
-	if (mask & SCI_SCREEN_MASK_CONTROL) {
+	if (mask & GFX_SCREEN_MASK_CONTROL) {
 		bitsRestoreScreen(rect, memoryPtr, _controlScreen, _width);
 	}
-	if (mask & SCI_SCREEN_MASK_DISPLAY) {
+	if (mask & GFX_SCREEN_MASK_DISPLAY) {
 		if (!_upscaledHires)
 			error("bitsRestore() called w/o being in upscaled hires mode");
 		bitsRestoreScreen(rect, memoryPtr, _displayScreen, _displayWidth);

Modified: scummvm/trunk/engines/sci/graphics/screen.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/screen.h	2010-05-15 08:56:27 UTC (rev 49038)
+++ scummvm/trunk/engines/sci/graphics/screen.h	2010-05-15 08:57:13 UTC (rev 49039)
@@ -35,12 +35,20 @@
 
 #define SCI_SCREEN_MAXHEIGHT 400
 
-#define SCI_SCREEN_MASK_VISUAL   1
-#define SCI_SCREEN_MASK_PRIORITY 2
-#define SCI_SCREEN_MASK_CONTROL  4
-#define SCI_SCREEN_MASK_DISPLAY  8 // not official sierra sci
-#define SCI_SCREEN_MASK_ALL      SCI_SCREEN_MASK_VISUAL|SCI_SCREEN_MASK_PRIORITY|SCI_SCREEN_MASK_CONTROL
+enum GfxScreenUpscaledMode {
+	GFX_SCREEN_UPSCALED_DISABLED	= 0,
+	GFX_SCREEN_UPSCALED_640x400		= 1,
+	GFX_SCREEN_UPSCALED_640x480		= 2
+};
 
+enum GfxScreenMasks {
+	GFX_SCREEN_MASK_VISUAL		= 1,
+	GFX_SCREEN_MASK_PRIORITY	= 2,
+	GFX_SCREEN_MASK_CONTROL		= 4,
+	GFX_SCREEN_MASK_DISPLAY		= 8, // not official sierra sci, only used internally
+	GFX_SCREEN_MASK_ALL			= GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY|GFX_SCREEN_MASK_CONTROL
+};
+
 #define SCI_SCREEN_UNDITHERMEMORIAL_SIZE 256
 
 /**

Modified: scummvm/trunk/engines/sci/graphics/view.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.cpp	2010-05-15 08:56:27 UTC (rev 49038)
+++ scummvm/trunk/engines/sci/graphics/view.cpp	2010-05-15 08:57:13 UTC (rev 49039)
@@ -507,7 +507,7 @@
 	int16 width, height;
 	byte clearKey = celInfo->clearKey;
 	byte color;
-	byte drawMask = priority == 255 ? SCI_SCREEN_MASK_VISUAL : SCI_SCREEN_MASK_VISUAL|SCI_SCREEN_MASK_PRIORITY;
+	byte drawMask = priority == 255 ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY;
 	int x, y;
 
 	if (_embeddedPal) {
@@ -554,7 +554,7 @@
 	int16 celHeight = celInfo->height, celWidth = celInfo->width;
 	byte clearKey = celInfo->clearKey;
 	byte color;
-	byte drawMask = priority == 255 ? SCI_SCREEN_MASK_VISUAL : SCI_SCREEN_MASK_VISUAL|SCI_SCREEN_MASK_PRIORITY;
+	byte drawMask = priority == 255 ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY;
 	int x, y;
 	uint16 scalingX[320];
 	uint16 scalingY[200];


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