diff options
author | Andre Heider | 2010-05-09 11:00:17 +0000 |
---|---|---|
committer | Andre Heider | 2010-05-09 11:00:17 +0000 |
commit | a3e428f6dbfd39c14495909b5e748d8581e3ad2b (patch) | |
tree | a8385d0bdfc21d8a3a279a12e85aab920e266ef1 /backends/platform/sdl | |
parent | cff786341f22352066da235a288b876c3c2b1612 (diff) | |
download | scummvm-rg350-a3e428f6dbfd39c14495909b5e748d8581e3ad2b.tar.gz scummvm-rg350-a3e428f6dbfd39c14495909b5e748d8581e3ad2b.tar.bz2 scummvm-rg350-a3e428f6dbfd39c14495909b5e748d8581e3ad2b.zip |
Rename DISABLE_*SCALERS to USE_*SCALERS, and move the mk/cpp defines to configure.
svn-id: r48977
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r-- | backends/platform/sdl/graphics.cpp | 32 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 5 |
2 files changed, 20 insertions, 17 deletions
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index 290f531278..b3ef101e9e 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -37,7 +37,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { {"1x", "Normal (no scaling)", GFX_NORMAL}, -#ifndef DISABLE_SCALERS +#ifdef USE_SCALERS {"2x", "2x", GFX_DOUBLESIZE}, {"3x", "3x", GFX_TRIPLESIZE}, {"2xsai", "2xSAI", GFX_2XSAI}, @@ -45,7 +45,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { {"supereagle", "SuperEagle", GFX_SUPEREAGLE}, {"advmame2x", "AdvMAME2x", GFX_ADVMAME2X}, {"advmame3x", "AdvMAME3x", GFX_ADVMAME3X}, -#ifndef DISABLE_HQ_SCALERS +#ifdef USE_HQ_SCALERS {"hq2x", "HQ2x", GFX_HQ2X}, {"hq3x", "HQ3x", GFX_HQ3X}, #endif @@ -58,7 +58,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { // Table of relative scalers magnitudes // [definedScale - 1][scaleFactor - 1] static ScalerProc *scalersMagn[3][3] = { -#ifndef DISABLE_SCALERS +#ifdef USE_SCALERS { Normal1x, AdvMame2x, AdvMame3x }, { Normal1x, Normal1x, Normal1o5x }, { Normal1x, Normal1x, Normal1x } @@ -80,7 +80,7 @@ static const int s_gfxModeSwitchTable[][4] = { { GFX_NORMAL, GFX_DOTMATRIX, -1, -1 } }; -#ifndef DISABLE_SCALERS +#ifdef USE_SCALERS static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY); #endif @@ -308,7 +308,7 @@ bool OSystem_SDL::setGraphicsMode(int mode) { case GFX_NORMAL: newScaleFactor = 1; break; -#ifndef DISABLE_SCALERS +#ifdef USE_SCALERS case GFX_DOUBLESIZE: newScaleFactor = 2; break; @@ -331,7 +331,7 @@ bool OSystem_SDL::setGraphicsMode(int mode) { case GFX_ADVMAME3X: newScaleFactor = 3; break; -#ifndef DISABLE_HQ_SCALERS +#ifdef USE_HQ_SCALERS case GFX_HQ2X: newScaleFactor = 2; break; @@ -345,7 +345,7 @@ bool OSystem_SDL::setGraphicsMode(int mode) { case GFX_DOTMATRIX: newScaleFactor = 2; break; -#endif // DISABLE_SCALERS +#endif // USE_SCALERS default: warning("unknown gfx mode %d", mode); @@ -372,7 +372,7 @@ void OSystem_SDL::setGraphicsModeIntern() { case GFX_NORMAL: newScalerProc = Normal1x; break; -#ifndef DISABLE_SCALERS +#ifdef USE_SCALERS case GFX_DOUBLESIZE: newScalerProc = Normal2x; break; @@ -395,7 +395,7 @@ void OSystem_SDL::setGraphicsModeIntern() { case GFX_ADVMAME3X: newScalerProc = AdvMame3x; break; -#ifndef DISABLE_HQ_SCALERS +#ifdef USE_HQ_SCALERS case GFX_HQ2X: newScalerProc = HQ2x; break; @@ -409,7 +409,7 @@ void OSystem_SDL::setGraphicsModeIntern() { case GFX_DOTMATRIX: newScalerProc = DotMatrix; break; -#endif // DISABLE_SCALERS +#endif // USE_SCALERS default: error("Unknown gfx mode %d", _videoMode.mode); @@ -898,7 +898,7 @@ void OSystem_SDL::internUpdateScreen() { r->w = r->w * scale1; r->h = dst_h * scale1; -#ifndef DISABLE_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 @@ -1110,7 +1110,7 @@ void OSystem_SDL::addDirtyRect(int x, int y, int w, int h, bool realCoordinates) h = height - y; } -#ifndef DISABLE_SCALERS +#ifdef USE_SCALERS if (_videoMode.aspectRatioCorrection && !_overlayVisible && !realCoordinates) { makeRectStretchable(x, y, w, h); } @@ -1371,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); -#ifndef DISABLE_SCALERS +#ifdef USE_SCALERS if (_videoMode.aspectRatioCorrection) stretch200To240((uint8 *)_overlayscreen->pixels, _overlayscreen->pitch, _videoMode.overlayWidth, _videoMode.screenHeight * _videoMode.scaleFactor, 0, 0, 0); @@ -1664,7 +1664,7 @@ void OSystem_SDL::blitCursor() { _mouseCurState.vHotY = _mouseCurState.hotY; } -#ifndef DISABLE_SCALERS +#ifdef USE_SCALERS int rH1 = rH; // store original to pass to aspect-correction function later #endif @@ -1712,7 +1712,7 @@ void OSystem_SDL::blitCursor() { _mouseOrigSurface->pitch, (byte *)_mouseSurface->pixels, _mouseSurface->pitch, _mouseCurState.w, _mouseCurState.h); -#ifndef DISABLE_SCALERS +#ifdef USE_SCALERS if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1) cursorStretch200To240((uint8 *)_mouseSurface->pixels, _mouseSurface->pitch, rW, rH1, 0, 0, 0); #endif @@ -1721,7 +1721,7 @@ void OSystem_SDL::blitCursor() { SDL_UnlockSurface(_mouseOrigSurface); } -#ifndef DISABLE_SCALERS +#ifdef USE_SCALERS // Basically it is kVeryFastAndUglyAspectMode of stretch200To240 from // common/scale/aspect.cpp static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY) { diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 246327786d..6b23acfb8b 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -94,9 +94,11 @@ AspectRatio::AspectRatio(int w, int h) { _kh = h; } +#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) }; + static AspectRatio getDesiredAspectRatio() { //TODO : We could parse an arbitrary string, if we code enough proper validation Common::String desiredAspectRatio = ConfMan.get("desired_screen_aspect_ratio"); @@ -111,6 +113,7 @@ static AspectRatio getDesiredAspectRatio() { // TODO : Report a warning return AspectRatio(0, 0); } +#endif void OSystem_SDL::initBackend() { assert(!_inited); @@ -147,7 +150,7 @@ void OSystem_SDL::initBackend() { memset(&_transactionDetails, 0, sizeof(_transactionDetails)); _cksumValid = false; -#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && !defined(DISABLE_SCALERS) +#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && defined(USE_SCALERS) _videoMode.mode = GFX_DOUBLESIZE; _videoMode.scaleFactor = 2; _videoMode.aspectRatioCorrection = ConfMan.getBool("aspect_ratio"); |