[Scummvm-cvs-logs] SF.net SVN: scummvm:[48979] scummvm/trunk

dhewg at users.sourceforge.net dhewg at users.sourceforge.net
Sun May 9 14:30:20 CEST 2010


Revision: 48979
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48979&view=rev
Author:   dhewg
Date:     2010-05-09 12:30:20 +0000 (Sun, 09 May 2010)

Log Message:
-----------
Since configure allows HQ scalers without the normal onces, allow this combination.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/sdl/graphics.cpp
    scummvm/trunk/backends/platform/sdl/sdl.cpp
    scummvm/trunk/graphics/module.mk
    scummvm/trunk/graphics/scaler.h

Modified: scummvm/trunk/backends/platform/sdl/graphics.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/graphics.cpp	2010-05-09 12:14:16 UTC (rev 48978)
+++ scummvm/trunk/backends/platform/sdl/graphics.cpp	2010-05-09 12:30:20 UTC (rev 48979)
@@ -45,23 +45,27 @@
 	{"supereagle", "SuperEagle", GFX_SUPEREAGLE},
 	{"advmame2x", "AdvMAME2x", GFX_ADVMAME2X},
 	{"advmame3x", "AdvMAME3x", GFX_ADVMAME3X},
+	{"tv2x", "TV2x", GFX_TV2X},
+	{"dotmatrix", "DotMatrix", GFX_DOTMATRIX},
+#endif
 #ifdef USE_HQ_SCALERS
 	{"hq2x", "HQ2x", GFX_HQ2X},
 	{"hq3x", "HQ3x", GFX_HQ3X},
 #endif
-	{"tv2x", "TV2x", GFX_TV2X},
-	{"dotmatrix", "DotMatrix", GFX_DOTMATRIX},
-#endif
 	{0, 0, 0}
 };
 
 // Table of relative scalers magnitudes
 // [definedScale - 1][scaleFactor - 1]
 static ScalerProc *scalersMagn[3][3] = {
-#ifdef USE_SCALERS
+#if defined(USE_SCALERS)
 	{ Normal1x, AdvMame2x, AdvMame3x },
 	{ Normal1x, Normal1x, Normal1o5x },
 	{ Normal1x, Normal1x, Normal1x }
+#elif defined(USE_HQ_SCALERS)
+	{ Normal1x, HQ2x, HQ3x },
+	{ Normal1x, Normal1x, Normal1x },
+	{ Normal1x, Normal1x, Normal1x }
 #else // remove dependencies on other scalers
 	{ Normal1x, Normal1x, Normal1x },
 	{ Normal1x, Normal1x, Normal1x },
@@ -80,7 +84,7 @@
 		{ GFX_NORMAL, GFX_DOTMATRIX, -1, -1 }
 	};
 
-#ifdef USE_SCALERS
+#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
 static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY);
 #endif
 
@@ -331,6 +335,13 @@
 	case GFX_ADVMAME3X:
 		newScaleFactor = 3;
 		break;
+	case GFX_TV2X:
+		newScaleFactor = 2;
+		break;
+	case GFX_DOTMATRIX:
+		newScaleFactor = 2;
+		break;
+#endif // USE_SCALERS
 #ifdef USE_HQ_SCALERS
 	case GFX_HQ2X:
 		newScaleFactor = 2;
@@ -339,13 +350,6 @@
 		newScaleFactor = 3;
 		break;
 #endif
-	case GFX_TV2X:
-		newScaleFactor = 2;
-		break;
-	case GFX_DOTMATRIX:
-		newScaleFactor = 2;
-		break;
-#endif // USE_SCALERS
 
 	default:
 		warning("unknown gfx mode %d", mode);
@@ -395,6 +399,13 @@
 	case GFX_ADVMAME3X:
 		newScalerProc = AdvMame3x;
 		break;
+	case GFX_TV2X:
+		newScalerProc = TV2x;
+		break;
+	case GFX_DOTMATRIX:
+		newScalerProc = DotMatrix;
+		break;
+#endif // USE_SCALERS
 #ifdef USE_HQ_SCALERS
 	case GFX_HQ2X:
 		newScalerProc = HQ2x;
@@ -403,13 +414,6 @@
 		newScalerProc = HQ3x;
 		break;
 #endif
-	case GFX_TV2X:
-		newScalerProc = TV2x;
-		break;
-	case GFX_DOTMATRIX:
-		newScalerProc = DotMatrix;
-		break;
-#endif // USE_SCALERS
 
 	default:
 		error("Unknown gfx mode %d", _videoMode.mode);
@@ -898,7 +902,7 @@
 			r->w = r->w * scale1;
 			r->h = dst_h * scale1;
 
-#ifdef USE_SCALERS
+#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
 			if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayVisible)
 				r->h = stretch200To240((uint8 *) _hwscreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1);
 #endif
@@ -1110,7 +1114,7 @@
 		h = height - y;
 	}
 
-#ifdef USE_SCALERS
+#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
 	if (_videoMode.aspectRatioCorrection && !_overlayVisible && !realCoordinates) {
 		makeRectStretchable(x, y, w, h);
 	}
@@ -1371,7 +1375,7 @@
 	_scalerProc((byte *)(_tmpscreen->pixels) + _tmpscreen->pitch + 2, _tmpscreen->pitch,
 	(byte *)_overlayscreen->pixels, _overlayscreen->pitch, _videoMode.screenWidth, _videoMode.screenHeight);
 
-#ifdef USE_SCALERS
+#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
 	if (_videoMode.aspectRatioCorrection)
 		stretch200To240((uint8 *)_overlayscreen->pixels, _overlayscreen->pitch,
 						_videoMode.overlayWidth, _videoMode.screenHeight * _videoMode.scaleFactor, 0, 0, 0);
@@ -1664,7 +1668,7 @@
 		_mouseCurState.vHotY = _mouseCurState.hotY;
 	}
 
-#ifdef USE_SCALERS
+#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
 	int rH1 = rH; // store original to pass to aspect-correction function later
 #endif
 
@@ -1702,8 +1706,10 @@
 	// If possible, use the same scaler for the cursor as for the rest of
 	// the game. This only works well with the non-blurring scalers so we
 	// actually only use the 1x, 1.5x, 2x and AdvMame scalers.
-
-	if (_cursorTargetScale == 1 && (_videoMode.mode == GFX_DOUBLESIZE || _videoMode.mode == GFX_TRIPLESIZE))
+	if (_cursorTargetScale == 1 && (_videoMode.mode == GFX_DOUBLESIZE ||
+									_videoMode.mode == GFX_TRIPLESIZE ||
+									_videoMode.mode == GFX_HQ2X ||
+									_videoMode.mode == GFX_HQ3X))
 		scalerProc = _scalerProc;
 	else
 		scalerProc = scalersMagn[_cursorTargetScale - 1][_videoMode.scaleFactor - 1];
@@ -1712,7 +1718,7 @@
 		_mouseOrigSurface->pitch, (byte *)_mouseSurface->pixels, _mouseSurface->pitch,
 		_mouseCurState.w, _mouseCurState.h);
 
-#ifdef USE_SCALERS
+#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
 	if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1)
 		cursorStretch200To240((uint8 *)_mouseSurface->pixels, _mouseSurface->pitch, rW, rH1, 0, 0, 0);
 #endif
@@ -1721,9 +1727,9 @@
 	SDL_UnlockSurface(_mouseOrigSurface);
 }
 
-#ifdef USE_SCALERS
+#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
 // Basically it is kVeryFastAndUglyAspectMode of stretch200To240 from
-// common/scale/aspect.cpp
+// graphics/scale/aspect.cpp
 static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY) {
 	int maxDstY = real2Aspect(origSrcY + height - 1);
 	int y;

Modified: scummvm/trunk/backends/platform/sdl/sdl.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/sdl.cpp	2010-05-09 12:14:16 UTC (rev 48978)
+++ scummvm/trunk/backends/platform/sdl/sdl.cpp	2010-05-09 12:30:20 UTC (rev 48979)
@@ -94,7 +94,7 @@
 	_kh = h;
 }
 
-#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && defined(USE_SCALERS)
+#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && (defined(USE_SCALERS) || defined(USE_HQ_SCALERS))
 static const size_t AR_COUNT = 4;
 static const char*       desiredAspectRatioAsStrings[AR_COUNT] = {            "auto",            "4/3",            "16/9",            "16/10" };
 static const AspectRatio desiredAspectRatios[AR_COUNT]         = { AspectRatio(0, 0), AspectRatio(4,3), AspectRatio(16,9), AspectRatio(16,10) };
@@ -150,12 +150,16 @@
 	memset(&_transactionDetails, 0, sizeof(_transactionDetails));
 
 	_cksumValid = false;
-#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && defined(USE_SCALERS)
+#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && (defined(USE_SCALERS) || defined(USE_HQ_SCALERS))
 	_videoMode.mode = GFX_DOUBLESIZE;
 	_videoMode.scaleFactor = 2;
 	_videoMode.aspectRatioCorrection = ConfMan.getBool("aspect_ratio");
 	_videoMode.desiredAspectRatio = getDesiredAspectRatio();
+#ifdef USE_SCALERS
 	_scalerProc = Normal2x;
+#else
+	_scalerProc = HQ2x;
+#endif
 #else // for small screen platforms
 	_videoMode.mode = GFX_NORMAL;
 	_videoMode.scaleFactor = 1;

Modified: scummvm/trunk/graphics/module.mk
===================================================================
--- scummvm/trunk/graphics/module.mk	2010-05-09 12:14:16 UTC (rev 48978)
+++ scummvm/trunk/graphics/module.mk	2010-05-09 12:30:20 UTC (rev 48979)
@@ -48,8 +48,15 @@
 	scaler/Normal2xARM.o
 endif
 
+endif
+
 ifdef USE_HQ_SCALERS
+ifndef USE_SCALERS
 MODULE_OBJS += \
+	scaler/aspect.o
+endif
+
+MODULE_OBJS += \
 	scaler/hq2x.o \
 	scaler/hq3x.o
 
@@ -61,7 +68,5 @@
 
 endif
 
-endif
-
 # Include common rules
 include $(srcdir)/rules.mk

Modified: scummvm/trunk/graphics/scaler.h
===================================================================
--- scummvm/trunk/graphics/scaler.h	2010-05-09 12:14:16 UTC (rev 48978)
+++ scummvm/trunk/graphics/scaler.h	2010-05-09 12:30:20 UTC (rev 48979)
@@ -42,7 +42,6 @@
 DECLARE_SCALER(Normal1x);
 
 #ifdef USE_SCALERS
-
 DECLARE_SCALER(Normal2x);
 DECLARE_SCALER(Normal3x);
 DECLARE_SCALER(Normal1o5x);
@@ -56,14 +55,13 @@
 
 DECLARE_SCALER(TV2x);
 DECLARE_SCALER(DotMatrix);
+#endif // #ifdef USE_SCALERS
 
 #ifdef USE_HQ_SCALERS
 DECLARE_SCALER(HQ2x);
 DECLARE_SCALER(HQ3x);
 #endif
 
-#endif // #ifdef USE_SCALERS
-
 // creates a 160x100 thumbnail for 320x200 games
 // and 160x120 thumbnail for 320x240 and 640x480 games
 // only 565 mode


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