aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJohannes Schickel2011-02-24 17:08:51 +0100
committerJohannes Schickel2011-02-24 17:10:49 +0100
commitd81bb9794f59787ced1edde4c867aa307cec68fb (patch)
treeb0228cfbc9c6a49910e52ce77e405d3754694b42 /backends
parent8bd01f69b202e12ba656524a8e64691b5fb08414 (diff)
downloadscummvm-rg350-d81bb9794f59787ced1edde4c867aa307cec68fb.tar.gz
scummvm-rg350-d81bb9794f59787ced1edde4c867aa307cec68fb.tar.bz2
scummvm-rg350-d81bb9794f59787ced1edde4c867aa307cec68fb.zip
OPENGL: Prefer single operation texture updates.
When doing glTexSubImage2D we do not need to assure that the source data has the same width as the texture when we want to update the data, we just need to assure that the width * Bpp cound matches the pitch.
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/opengl/gltexture.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/backends/graphics/opengl/gltexture.cpp b/backends/graphics/opengl/gltexture.cpp
index cd9e23cb71..7b7d40f174 100644
--- a/backends/graphics/opengl/gltexture.cpp
+++ b/backends/graphics/opengl/gltexture.cpp
@@ -149,7 +149,7 @@ void GLTexture::updateBuffer(const void *buf, int pitch, GLuint x, GLuint y, GLu
glBindTexture(GL_TEXTURE_2D, _textureName); CHECK_GL_ERROR();
// Check if the buffer has its data contiguously
- if (static_cast<int>(w) * _bytesPerPixel == pitch && w == _textureWidth) {
+ if (static_cast<int>(w) * _bytesPerPixel == pitch) {
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h,
_glFormat, _glType, buf); CHECK_GL_ERROR();
} else {