diff options
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/sdl/graphics.cpp | 62 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 8 |
2 files changed, 30 insertions, 40 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; |