Ticket #7519: scummvm-stretch12.diff

File scummvm-stretch12.diff, 1.4 KB (added by cyxx, 17 years ago)

WIP patch for enabling ASR in non 320x200 resolutions

  • backends/platform/sdl/graphics.cpp

     
    316316        _overlayWidth = _screenWidth * _scaleFactor;
    317317        _overlayHeight = _screenHeight * _scaleFactor;
    318318
    319         if (_screenHeight != 200)
     319        if (!isStretchable())
    320320                _adjustAspectRatio = false;
    321321
    322322        if (_adjustAspectRatio)
     
    735735}
    736736
    737737void OSystem_SDL::setAspectRatioCorrection(bool enable) {
    738         if ((_screenHeight == 200 && _adjustAspectRatio != enable) ||
     738        if ((isStretchable() && _adjustAspectRatio != enable) ||
    739739                _transactionMode == kTransactionCommit) {
    740740                Common::StackLock lock(_graphicsMutex);
    741741
  • backends/platform/sdl/sdl-common.h

     
    399399
    400400        virtual bool saveScreenshot(const char *filename); // overloaded by CE backend
    401401
    402         int effectiveScreenHeight() const { return (_adjustAspectRatio ? 240 : _screenHeight) * _scaleFactor; }
     402        int effectiveScreenHeight() const { return (_adjustAspectRatio ? real2Aspect(_screenHeight) : _screenHeight) * _scaleFactor; }
     403        bool isStretchable() const { return _screenHeight % 200 == 0; }
    403404
    404405        void setupIcon();
    405406        void handleKbdMouse();