From a3e428f6dbfd39c14495909b5e748d8581e3ad2b Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sun, 9 May 2010 11:00:17 +0000 Subject: Rename DISABLE_*SCALERS to USE_*SCALERS, and move the mk/cpp defines to configure. svn-id: r48977 --- backends/platform/PalmOS/Src/prefixes/compile.h | 2 +- backends/platform/dc/Makefile | 1 - backends/platform/ds/arm9/makefile | 1 - backends/platform/gp2x/gp2x-common.h | 1 - backends/platform/gp2x/graphics.cpp | 2 +- backends/platform/gp2xwiz/gp2xwiz-graphics.cpp | 2 +- backends/platform/linuxmoto/linuxmoto-graphics.cpp | 2 +- backends/platform/n64/Makefile | 2 -- backends/platform/ps2/Makefile.gdb | 4 --- backends/platform/ps2/Makefile.ps2 | 4 --- backends/platform/psp/Makefile | 4 --- backends/platform/sdl/graphics.cpp | 32 +++++++++++----------- backends/platform/sdl/sdl.cpp | 5 +++- .../symbian/BuildPackageUpload_AllVersions.pl | 2 -- backends/platform/wince/Makefile | 11 +++++++- backends/platform/wince/wince-sdl.cpp | 2 +- 16 files changed, 35 insertions(+), 42 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/PalmOS/Src/prefixes/compile.h b/backends/platform/PalmOS/Src/prefixes/compile.h index cb91957104..bb7230187a 100644 --- a/backends/platform/PalmOS/Src/prefixes/compile.h +++ b/backends/platform/PalmOS/Src/prefixes/compile.h @@ -48,7 +48,7 @@ #undef ENABLE_DRASCULA // ScummVM -#define DISABLE_HQ_SCALERS +#define USE_SCALERS #define DISABLE_FANCY_THEMES //#define CT_NO_TRANSPARENCY //#define REDUCE_MEMORY_USAGE diff --git a/backends/platform/dc/Makefile b/backends/platform/dc/Makefile index a19e119c76..2dcf9b7a7c 100644 --- a/backends/platform/dc/Makefile +++ b/backends/platform/dc/Makefile @@ -29,7 +29,6 @@ RM_REC = rm -rf AR = sh-elf-ar cru RANLIB = sh-elf-ranlib HAVE_GCC3 = true -DISABLE_SCALERS = true USE_RGB_COLOR = true ifdef DYNAMIC_MODULES diff --git a/backends/platform/ds/arm9/makefile b/backends/platform/ds/arm9/makefile index 86e40c7e2f..eca170ef96 100644 --- a/backends/platform/ds/arm9/makefile +++ b/backends/platform/ds/arm9/makefile @@ -286,7 +286,6 @@ RANLIB = arm-eabi-ranlib OBJCOPY = arm-eabi-objcopy AS = arm-eabi-as HAVE_GCC3 = true -DISABLE_SCALERS = true ifdef DYNAMIC_MODULES DEFINES += -DDYNAMIC_MODULES diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h index 4199a5d032..79eb3f65cf 100644 --- a/backends/platform/gp2x/gp2x-common.h +++ b/backends/platform/gp2x/gp2x-common.h @@ -34,7 +34,6 @@ #define __GP2X__ #define USE_OSD -/* #define DISABLE_SCALERS */ #define MIXER_DOUBLE_BUFFERING 1 namespace Audio { diff --git a/backends/platform/gp2x/graphics.cpp b/backends/platform/gp2x/graphics.cpp index 8f6f67c5d6..243c37dcb1 100644 --- a/backends/platform/gp2x/graphics.cpp +++ b/backends/platform/gp2x/graphics.cpp @@ -1114,7 +1114,7 @@ void OSystem_GP2X::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); diff --git a/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp b/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp index b23c3388e1..b20087e6d9 100644 --- a/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp +++ b/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp @@ -398,7 +398,7 @@ void OSystem_GP2XWIZ::internUpdateScreen() { r->y = dst_y; -#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 diff --git a/backends/platform/linuxmoto/linuxmoto-graphics.cpp b/backends/platform/linuxmoto/linuxmoto-graphics.cpp index 01d954f9b9..8f718c82f6 100644 --- a/backends/platform/linuxmoto/linuxmoto-graphics.cpp +++ b/backends/platform/linuxmoto/linuxmoto-graphics.cpp @@ -422,7 +422,7 @@ void OSystem_LINUXMOTO::internUpdateScreen() { r->x = dst_x; r->y = dst_y; -#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 diff --git a/backends/platform/n64/Makefile b/backends/platform/n64/Makefile index fa2b4ae9b5..914e6e9c9e 100644 --- a/backends/platform/n64/Makefile +++ b/backends/platform/n64/Makefile @@ -45,8 +45,6 @@ RM_REC = rm -rf VERBOSE_BUILD=1 HAVE_GCC3=1 -DISABLE_SCALERS=1 -DISABLE_HQ_SCALER=1 USE_RGB_COLOR=0 ENABLED=STATIC_PLUGIN diff --git a/backends/platform/ps2/Makefile.gdb b/backends/platform/ps2/Makefile.gdb index 25fee65e30..41ac58d629 100644 --- a/backends/platform/ps2/Makefile.gdb +++ b/backends/platform/ps2/Makefile.gdb @@ -7,10 +7,6 @@ PS2_EXTRA_LIBS = /zlib/lib /libmad/ee/lib /SjPcm/ee/lib /tremor/tremor ENABLED=STATIC_PLUGIN -#control build -DISABLE_SCALERS = true -DISABLE_HQ_SCALERS = true - ENABLE_SCUMM = $(ENABLED) ENABLE_SCUMM_7_8 = $(ENABLED) #ENABLE_HE = $(ENABLED) diff --git a/backends/platform/ps2/Makefile.ps2 b/backends/platform/ps2/Makefile.ps2 index 8c1d8f81fe..bf7ac0aca0 100644 --- a/backends/platform/ps2/Makefile.ps2 +++ b/backends/platform/ps2/Makefile.ps2 @@ -7,10 +7,6 @@ PS2_EXTRA_LIBS = /zlib/lib /libmad/ee/lib /SjPcm/ee/lib /tremor/tremor ENABLED=STATIC_PLUGIN -#control build -DISABLE_SCALERS = true -DISABLE_HQ_SCALERS = true - ENABLE_SCUMM = $(ENABLED) ENABLE_SCUMM_7_8 = $(ENABLED) ENABLE_HE = $(ENABLED) diff --git a/backends/platform/psp/Makefile b/backends/platform/psp/Makefile index 6f76f6d805..8e83563d10 100644 --- a/backends/platform/psp/Makefile +++ b/backends/platform/psp/Makefile @@ -91,10 +91,6 @@ PLUGIN_SUFFIX = .plg PLUGIN_EXTRA_DEPS = plugin.syms scummvm-psp.elf PLUGIN_LDFLAGS = -nostartfiles -Wl,-q,--just-symbols=scummvm-psp.org.elf,-Tplugin.ld,--retain-symbols-file,plugin.syms -lstdc++ -lc -# Remove unneeded scalers -DISABLE_SCALERS = true -DISABLE_HQ_SCALERS = true - # PSP-specific variables STRIP = psp-strip MKSFO = mksfoex -d MEMSIZE=1 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"); diff --git a/backends/platform/symbian/BuildPackageUpload_AllVersions.pl b/backends/platform/symbian/BuildPackageUpload_AllVersions.pl index fbfdaeeeef..3543dc8d19 100644 --- a/backends/platform/symbian/BuildPackageUpload_AllVersions.pl +++ b/backends/platform/symbian/BuildPackageUpload_AllVersions.pl @@ -61,8 +61,6 @@ $ftp_url = "FTP://$FTP_User\@$FTP_Host/$FTP_Dir/"; $ExtraMacros = "MACRO NONSTANDARD_PORT\n"; $ExtraMacros .= "MACRO ENABLE_VKEYBD\n"; $ExtraMacros .= "MACRO DISABLE_FANCY_THEMES\n"; -$ExtraMacros .= "MACRO DISABLE_SCALERS\n"; -$ExtraMacros .= "MACRO DISABLE_HQ_SCALERS\n"; # prep nice list of SDKs #while( ($SDK, $RootDir) = each(%SDK_RootDirs) ) diff --git a/backends/platform/wince/Makefile b/backends/platform/wince/Makefile index f81d97f075..8ad134648b 100644 --- a/backends/platform/wince/Makefile +++ b/backends/platform/wince/Makefile @@ -70,7 +70,8 @@ REMOTE_DIRECTORY = \Storage Card\Program Files\Scummvm ######################################################################## ## You're probably not going to want to change these defines... -#DISABLE_HQ_SCALERS = 1 +USE_SCALERS = 1 +USE_HQ_SCALERS = 1 USE_ARM_SOUND_ASM = 1 USE_ARM_SMUSH_ASM = 1 USE_ARM_GFX_ASM = 1 @@ -155,6 +156,14 @@ DEFINES += -DUSE_FLAC LIBS += -lFLAC endif +ifdef USE_SCALERS +DEFINES += -DUSE_SCALERS +endif + +ifdef USE_HQ_SCALERS +DEFINES += -DUSE_HQ_SCALERS +endif + ifdef USE_ARM_SMUSH_ASM DEFINES += -DUSE_ARM_SMUSH_ASM endif diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 068935582b..7ce689fb63 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -1305,7 +1305,7 @@ bool OSystem_WINCE3::setGraphicsMode(int mode) { _videoMode.scaleFactor = 3; _scalerProc = AdvMame3x; break; -#ifndef DISABLE_HQ_SCALERS +#ifdef USE_HQ_SCALERS case GFX_HQ2X: _videoMode.scaleFactor = 2; _scalerProc = HQ2x; -- cgit v1.2.3