1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 12:54:00 +00:00

Use the standard cursor if the custom cursor can't be used

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
This commit is contained in:
Paul Cercueil 2015-12-11 15:59:16 +01:00
parent f1f82af64e
commit 06719df868

View File

@ -217,14 +217,17 @@ namespace SDLUtil
void SDLCursorManager::_createCursorFromResource(const std::string& name, int rotDegrees, osg::Image* image, Uint8 size_x, Uint8 size_y, Uint8 hotspot_x, Uint8 hotspot_y)
{
#ifdef ANDROID
return;
#endif
osg::ref_ptr<osg::Image> decompressed;
if (mCursorMap.find(name) != mCursorMap.end())
return;
osg::ref_ptr<osg::Image> decompressed = decompress(image, static_cast<float>(rotDegrees));
try {
decompressed = decompress(image, static_cast<float>(rotDegrees));
} catch (...) {
osg::notify(osg::NOTICE)<<"Using default cursor."<<std::endl;
return;
}
SDL_Surface* surf = SDLUtil::imageToSurface(decompressed, false);