OPENGL: Restore cursor scaling

This commit is contained in:
Cameron Cawley 2021-11-23 23:17:30 +00:00
parent 8fb4a662fa
commit 3bd4e8c6a4

View File

@ -786,6 +786,13 @@ void OpenGLGraphicsManager::setMouseCursor(const void *buf, uint w, uint h, int
delete _cursor;
_cursor = nullptr;
#ifdef USE_SCALERS
bool wantScaler = (_currentState.scaleFactor > 1) && !dontScale
&& _scalerPlugins[_currentState.scalerIndex]->get<ScalerPluginObject>().canDrawCursor();
#else
bool wantScaler = false;
#endif
GLenum glIntFormat, glFormat, glType;
Graphics::PixelFormat textureFormat;
@ -800,10 +807,14 @@ void OpenGLGraphicsManager::setMouseCursor(const void *buf, uint w, uint h, int
} else {
textureFormat = _defaultFormatAlpha;
}
// TODO: Enable SW scaling for cursors
_cursor = createSurface(textureFormat, true);
_cursor = createSurface(textureFormat, true, wantScaler);
assert(_cursor);
_cursor->enableLinearFiltering(_currentState.filtering);
#ifdef USE_SCALERS
if (wantScaler) {
_cursor->setScaler(_currentState.scalerIndex, _currentState.scaleFactor);
}
#endif
}
_cursor->allocate(w, h);