aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/platform/sdl/graphics.cpp62
-rw-r--r--backends/platform/sdl/sdl.cpp8
-rwxr-xr-xconfigure18
-rw-r--r--graphics/module.mk9
-rw-r--r--graphics/scaler.h4
5 files changed, 41 insertions, 60 deletions
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 425cc367f4..b3ef101e9e 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -45,27 +45,23 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
{"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] = {
-#if defined(USE_SCALERS)
+#ifdef 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 },
@@ -84,7 +80,7 @@ static const int s_gfxModeSwitchTable[][4] = {
{ GFX_NORMAL, GFX_DOTMATRIX, -1, -1 }
};
-#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
+#ifdef USE_SCALERS
static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY);
#endif
@@ -335,13 +331,6 @@ bool OSystem_SDL::setGraphicsMode(int mode) {
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;
@@ -350,6 +339,13 @@ bool OSystem_SDL::setGraphicsMode(int mode) {
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);
@@ -399,13 +395,6 @@ void OSystem_SDL::setGraphicsModeIntern() {
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;
@@ -414,6 +403,13 @@ void OSystem_SDL::setGraphicsModeIntern() {
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);
@@ -902,7 +898,7 @@ void OSystem_SDL::internUpdateScreen() {
r->w = r->w * scale1;
r->h = dst_h * scale1;
-#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
+#ifdef USE_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
@@ -1114,7 +1110,7 @@ void OSystem_SDL::addDirtyRect(int x, int y, int w, int h, bool realCoordinates)
h = height - y;
}
-#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
+#ifdef USE_SCALERS
if (_videoMode.aspectRatioCorrection && !_overlayVisible && !realCoordinates) {
makeRectStretchable(x, y, w, h);
}
@@ -1375,7 +1371,7 @@ void OSystem_SDL::clearOverlay() {
_scalerProc((byte *)(_tmpscreen->pixels) + _tmpscreen->pitch + 2, _tmpscreen->pitch,
(byte *)_overlayscreen->pixels, _overlayscreen->pitch, _videoMode.screenWidth, _videoMode.screenHeight);
-#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
+#ifdef USE_SCALERS
if (_videoMode.aspectRatioCorrection)
stretch200To240((uint8 *)_overlayscreen->pixels, _overlayscreen->pitch,
_videoMode.overlayWidth, _videoMode.screenHeight * _videoMode.scaleFactor, 0, 0, 0);
@@ -1668,7 +1664,7 @@ void OSystem_SDL::blitCursor() {
_mouseCurState.vHotY = _mouseCurState.hotY;
}
-#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
+#ifdef USE_SCALERS
int rH1 = rH; // store original to pass to aspect-correction function later
#endif
@@ -1706,10 +1702,8 @@ void OSystem_SDL::blitCursor() {
// 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 ||
- _videoMode.mode == GFX_HQ2X ||
- _videoMode.mode == GFX_HQ3X))
+
+ if (_cursorTargetScale == 1 && (_videoMode.mode == GFX_DOUBLESIZE || _videoMode.mode == GFX_TRIPLESIZE))
scalerProc = _scalerProc;
else
scalerProc = scalersMagn[_cursorTargetScale - 1][_videoMode.scaleFactor - 1];
@@ -1718,7 +1712,7 @@ void OSystem_SDL::blitCursor() {
_mouseOrigSurface->pitch, (byte *)_mouseSurface->pixels, _mouseSurface->pitch,
_mouseCurState.w, _mouseCurState.h);
-#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
+#ifdef USE_SCALERS
if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1)
cursorStretch200To240((uint8 *)_mouseSurface->pixels, _mouseSurface->pitch, rW, rH1, 0, 0, 0);
#endif
@@ -1727,9 +1721,9 @@ void OSystem_SDL::blitCursor() {
SDL_UnlockSurface(_mouseOrigSurface);
}
-#if defined(USE_SCALERS) || defined(USE_HQ_SCALERS)
+#ifdef USE_SCALERS
// Basically it is kVeryFastAndUglyAspectMode of stretch200To240 from
-// graphics/scale/aspect.cpp
+// common/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;
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index c9363fae51..6b23acfb8b 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -94,7 +94,7 @@ AspectRatio::AspectRatio(int w, int h) {
_kh = h;
}
-#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && (defined(USE_SCALERS) || defined(USE_HQ_SCALERS))
+#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && defined(USE_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,16 +150,12 @@ void OSystem_SDL::initBackend() {
memset(&_transactionDetails, 0, sizeof(_transactionDetails));
_cksumValid = false;
-#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && (defined(USE_SCALERS) || defined(USE_HQ_SCALERS))
+#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && defined(USE_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;
diff --git a/configure b/configure
index dd07823fa3..2edcd1798b 100755
--- a/configure
+++ b/configure
@@ -1436,7 +1436,6 @@ if test -n "$_host"; then
_need_memalign=yes
_backend="dc"
_build_scalers="no"
- _build_hq_scalers="no"
_mad="yes"
_zlib="yes"
add_line_to_config_mk 'ronindir = /usr/local/ronin'
@@ -1447,7 +1446,6 @@ if test -n "$_host"; then
_need_memalign=yes
_backend="wii"
_build_scalers="no"
- _build_hq_scalers="no"
_mt32emu="no"
_port_mk="backends/platform/wii/wii.mk"
add_line_to_config_mk 'GAMECUBE = 1'
@@ -1574,7 +1572,6 @@ if test -n "$_host"; then
_need_memalign=yes
_backend="ps2"
_build_scalers="no"
- _build_hq_scalers="no"
_mt32emu="no"
# HACK to enable mad & zlib (they are not properly detected due to linker issues).
# This trick doesn't work for tremor right now, as the PS2 port the resulting library
@@ -1602,7 +1599,6 @@ if test -n "$_host"; then
_need_memalign=yes
_backend="psp"
_build_scalers="no"
- _build_hq_scalers="no"
_mt32emu="no"
_port_mk="backends/platform/psp/psp.mk"
;;
@@ -1618,8 +1614,6 @@ if test -n "$_host"; then
add_line_to_config_mk 'USE_ARM_SCALER_ASM = 1'
_backend="samsungtv"
_mt32emu="no"
- _build_scalers="yes"
- _build_hq_scalers="yes"
_vkeybd="yes"
;;
wii)
@@ -1627,7 +1621,6 @@ if test -n "$_host"; then
_need_memalign=yes
_backend="wii"
_build_scalers="no"
- _build_hq_scalers="no"
_port_mk="backends/platform/wii/wii.mk"
add_line_to_config_mk 'GAMECUBE = 0'
add_line_to_config_h "#define DEBUG_WII_USBGECKO"
@@ -1913,6 +1906,7 @@ add_to_config_mk_if_yes "$_16bit" 'USE_RGB_COLOR = 1'
# Check whether to enable the (hq) scalers
#
if test "$_build_scalers" = no ; then
+ _build_hq_scalers=no
_def_scalers='#undef USE_SCALERS'
else
_def_scalers='#define USE_SCALERS'
@@ -2318,11 +2312,11 @@ if test "$_16bit" = yes ; then
fi
if test "$_build_scalers" = yes ; then
- echo_n ", scalers"
-fi
-
-if test "$_build_hq_scalers" = yes ; then
- echo_n ", HQ scalers"
+ if test "$_build_hq_scalers" = yes ; then
+ echo_n ", HQ scalers"
+ else
+ echo_n ", scalers"
+ fi
fi
if test "$_mt32emu" = yes ; then
diff --git a/graphics/module.mk b/graphics/module.mk
index 85a1afe3a8..15fbf092b3 100644
--- a/graphics/module.mk
+++ b/graphics/module.mk
@@ -48,14 +48,7 @@ MODULE_OBJS += \
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
@@ -68,5 +61,7 @@ endif
endif
+endif
+
# Include common rules
include $(srcdir)/rules.mk
diff --git a/graphics/scaler.h b/graphics/scaler.h
index 1ee1503967..22bda5273a 100644
--- a/graphics/scaler.h
+++ b/graphics/scaler.h
@@ -42,6 +42,7 @@ typedef void ScalerProc(const uint8 *srcPtr, uint32 srcPitch,
DECLARE_SCALER(Normal1x);
#ifdef USE_SCALERS
+
DECLARE_SCALER(Normal2x);
DECLARE_SCALER(Normal3x);
DECLARE_SCALER(Normal1o5x);
@@ -55,13 +56,14 @@ DECLARE_SCALER(AdvMame3x);
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