diff options
-rw-r--r-- | backends/epoc/portdefs.h | 2 | ||||
-rw-r--r-- | backends/sdl/graphics.cpp | 20 | ||||
-rw-r--r-- | backends/sdl/sdl.cpp | 8 | ||||
-rw-r--r-- | common/module.mk | 8 | ||||
-rw-r--r-- | common/scaler.cpp | 3 | ||||
-rw-r--r-- | scumm/thumbnail.cpp | 2 |
6 files changed, 29 insertions, 14 deletions
diff --git a/backends/epoc/portdefs.h b/backends/epoc/portdefs.h index 4bcf1a56ca..6a475019bf 100644 --- a/backends/epoc/portdefs.h +++ b/backends/epoc/portdefs.h @@ -36,7 +36,7 @@ // the place in Symbian FS where scummvm.ini & std***.txt are saved #define SYMBIAN32_DOC_DIR "C:\\documents\\EScummVM\\" // includes final \\! -#define DISABLE_HQ_SCALERS // we only need 1x +#define DISABLE_SCALERS // we only need 1x // hack in some tricks to work around not having these fcns for Symbian // and we _really_ don't wanna link with any other windows LIBC library! diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp index 1f339da656..00e2d9625e 100644 --- a/backends/sdl/graphics.cpp +++ b/backends/sdl/graphics.cpp @@ -48,7 +48,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { // Table of relative scalers magnitudes // [definedScale - 1][_scaleFactor - 1] static ScalerProc *scalersMagn[3][3] = { -#ifndef __SYMBIAN32__ +#ifndef DISABLE_SCALERS { Normal1x, AdvMame2x, AdvMame3x }, { Normal1x, Normal1x, Normal1o5x }, { Normal1x, Normal1x, Normal1x } @@ -151,7 +151,7 @@ bool OSystem_SDL::setGraphicsMode(int mode) { newScaleFactor = 1; newScalerProc = Normal1x; break; -#ifndef __SYMBIAN32__ // remove dependencies on other scalers +#ifndef DISABLE_SCALERS case GFX_DOUBLESIZE: newScaleFactor = 2; newScalerProc = Normal2x; @@ -199,7 +199,7 @@ bool OSystem_SDL::setGraphicsMode(int mode) { newScaleFactor = 2; newScalerProc = DotMatrix; break; -#endif // __SYMBIAN32__ +#endif // DISABLE_SCALERS default: warning("unknown gfx mode %d", mode); @@ -208,7 +208,7 @@ bool OSystem_SDL::setGraphicsMode(int mode) { _transactionDetails.normal1xScaler = (mode == GFX_NORMAL); -#ifndef __SYMBIAN32__ // this code introduces a dependency on Normal2x() +#ifndef DISABLE_SCALERS // Do not let switch to lesser than overlay size resolutions if (_screenWidth * newScaleFactor < _overlayWidth) { if (_scaleFactor == 1) { // Force 2x mode @@ -284,6 +284,10 @@ int OSystem_SDL::getGraphicsMode() const { } void OSystem_SDL::initSize(uint w, uint h, int overlayScale) { +#ifdef DISABLE_SCALERS + overlayScale = 1; +#endif + // Avoid redundant res changes if ((int)w == _screenWidth && (int)h == _screenHeight && (int)overlayScale == _overlayScale && @@ -669,7 +673,7 @@ void OSystem_SDL::internUpdateScreen() { r->w = r->w * scale1 / scale2; r->h = dst_h * scale1 / scale2; -#ifndef __SYMBIAN32__ // don't want to introduce dep on aspect.cpp +#ifndef DISABLE_SCALERS if (_adjustAspectRatio && orig_dst_y < height) r->h = stretch200To240((uint8 *) _hwscreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1 / scale2); #endif @@ -930,7 +934,7 @@ void OSystem_SDL::addDirtyRect(int x, int y, int w, int h, bool mouseRect) { h = height - y; } -#ifndef __SYMBIAN32__ // don't want to introduce dep on aspect.cpp +#ifndef DISABLE_SCALERS if (_adjustAspectRatio) { makeRectStretchable(x, y, w, h); if (_scaleFactor == 3 && _overlayScale == 2 && _overlayVisible) { @@ -1406,13 +1410,16 @@ void OSystem_SDL::blitCursor() { _mouseOrigSurface->pitch, (byte *)_mouseSurface->pixels, _mouseSurface->pitch, _mouseCurState.w, _mouseCurState.h); +#ifndef DISABLE_SCALERS if (_adjustAspectRatio) cursorStretch200To240((uint8 *)_mouseSurface->pixels, _mouseSurface->pitch, hW, hH1, 0, 0, 0); +#endif SDL_UnlockSurface(_mouseSurface); SDL_UnlockSurface(_mouseOrigSurface); } +#ifndef DISABLE_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) { @@ -1432,6 +1439,7 @@ static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height return 1 + maxDstY - srcY; } +#endif void OSystem_SDL::toggleMouseGrab() { if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_OFF) diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp index 43042df8e4..6318519a0b 100644 --- a/backends/sdl/sdl.cpp +++ b/backends/sdl/sdl.cpp @@ -63,7 +63,7 @@ void OSystem_SDL::initBackend() { SDL_EnableUNICODE(1); _cksumValid = false; -#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) +#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && !defined(DISABLE_SCALERS) _mode = GFX_DOUBLESIZE; _scaleFactor = 2; _scalerProc = Normal2x; @@ -73,7 +73,13 @@ void OSystem_SDL::initBackend() { _mode = GFX_NORMAL; _scaleFactor = 1; _scalerProc = Normal1x; + +#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) + _fullscreen = ConfMan.getBool("fullscreen"); +#else _fullscreen = true; +#endif + _adjustAspectRatio = false; #endif _scalerType = 0; diff --git a/common/module.mk b/common/module.mk index 9d455e153a..7fd5396457 100644 --- a/common/module.mk +++ b/common/module.mk @@ -11,17 +11,17 @@ MODULE_OBJS := \ common/timer.o \ common/util.o \ common/savefile.o \ - common/system.o + common/system.o \ + common/scaler.o \ + common/scaler/thumbnail.o ifndef DISABLE_SCALERS MODULE_OBJS += \ - common/scaler.o \ common/scaler/2xsai.o \ common/scaler/aspect.o \ common/scaler/scale2x.o \ common/scaler/scale3x.o \ - common/scaler/scalebit.o \ - common/scaler/thumbnail.o + common/scaler/scalebit.o ifndef DISABLE_HQ_SCALERS MODULE_OBJS += \ diff --git a/common/scaler.cpp b/common/scaler.cpp index 4b30b1b9b1..1a4c77fd05 100644 --- a/common/scaler.cpp +++ b/common/scaler.cpp @@ -147,6 +147,7 @@ void Normal1x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPit } } +#ifndef DISABLE_SCALERS /** * Trivial nearest-neighbour 2x scaler. */ @@ -316,3 +317,5 @@ void DotMatrix(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPi q += nextlineDst << 1; } } + +#endif diff --git a/scumm/thumbnail.cpp b/scumm/thumbnail.cpp index b558059bc1..2733939cca 100644 --- a/scumm/thumbnail.cpp +++ b/scumm/thumbnail.cpp @@ -102,9 +102,7 @@ Graphics::Surface *ScummEngine::loadThumbnail(Common::InSaveFile *file) { void ScummEngine::saveThumbnail(Common::OutSaveFile *file) { Graphics::Surface thumb; -#if !defined(DISABLE_SCALERS) && !defined(DISABLE_HQ_SCALERS) // fcn has dep on HQ_SCALERS: thumbnail gets created as empty if (!createThumbnailFromScreen(&thumb)) -#endif thumb.create(kThumbnailWidth, kThumbnailHeight2, sizeof(uint16)); ThumbnailHeader header; |