OPENGL: Don't update the cursor's texture when the cursor is invisible

Updating the cursor's texture is not necessary if it is not going to be drawn.

Fixes glDrawArrays sometimes failing due to using a framebuffer with an
incomplete color attachment. In SCI32 games, the framebuffer is incomplete
because the engine does not define pixel data for the cursor.
This commit is contained in:
Bastien Bouclet 2017-05-07 18:08:03 +02:00
parent a795c450bb
commit 23abcffbc5

View file

@ -402,7 +402,7 @@ void OpenGLGraphicsManager::updateScreen() {
// Update changes to textures.
_gameScreen->updateGLTexture();
if (_cursor) {
if (_cursorVisible && _cursor) {
_cursor->updateGLTexture();
}
_overlay->updateGLTexture();