diff --git a/components/sdlutil/sdlcursormanager.cpp b/components/sdlutil/sdlcursormanager.cpp index ad03083de..411fb3694 100644 --- a/components/sdlutil/sdlcursormanager.cpp +++ b/components/sdlutil/sdlcursormanager.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -81,6 +82,8 @@ namespace osg::ref_ptr decompress (osg::ref_ptr source, float rotDegrees) { + // TODO: use software decompression once S3TC patent expires + int width = source->s(); int height = source->t(); @@ -130,9 +133,13 @@ namespace osg::ref_ptr geom; #if defined(__APPLE__) - // Extra flip needed on Intel graphics OS X systems due to a driver bug + // Extra flip needed on OS X systems due to a driver bug + const char* envval = getenv("OPENMW_CURSOR_WORKAROUND"); + bool workaround = !envval || envval == std::string("1"); std::string vendorString = (const char*)glGetString(GL_VENDOR); - if (vendorString.find("Intel") != std::string::npos) + if (!envval) + workaround = vendorString.find("Intel") != std::string::npos || vendorString.find("ATI") != std::string::npos || vendorString.find("AMD") != std::string::npos; + if (workaround) geom = osg::createTexturedQuadGeometry(osg::Vec3(-1,1,0), osg::Vec3(2,0,0), osg::Vec3(0,-2,0)); else #endif