diff options
author | Alejandro Marzini | 2010-07-31 19:20:33 +0000 |
---|---|---|
committer | Alejandro Marzini | 2010-07-31 19:20:33 +0000 |
commit | fc94a3246a7ba26bf49205941a65e3acc3adb800 (patch) | |
tree | d27abdf2fdf63a4d0acfd3cafff40789784b21b1 /backends/graphics/opengl/gltexture.cpp | |
parent | fb4086cadb8ce3e473dae40558d713e7a31b3858 (diff) | |
download | scummvm-rg350-fc94a3246a7ba26bf49205941a65e3acc3adb800.tar.gz scummvm-rg350-fc94a3246a7ba26bf49205941a65e3acc3adb800.tar.bz2 scummvm-rg350-fc94a3246a7ba26bf49205941a65e3acc3adb800.zip |
OPENGL: Fix texture updating.
svn-id: r51549
Diffstat (limited to 'backends/graphics/opengl/gltexture.cpp')
-rw-r--r-- | backends/graphics/opengl/gltexture.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/backends/graphics/opengl/gltexture.cpp b/backends/graphics/opengl/gltexture.cpp index d7a1b0a236..7514fd0662 100644 --- a/backends/graphics/opengl/gltexture.cpp +++ b/backends/graphics/opengl/gltexture.cpp @@ -142,10 +142,10 @@ 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) { + if (static_cast<int>(w) * _bytesPerPixel == pitch && w == _textureWidth) { glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, _glFormat, _glType, buf); CHECK_GL_ERROR(); - } else {*/ + } else { // Update the texture row by row const byte *src = static_cast<const byte *>(buf); do { @@ -154,7 +154,7 @@ void GLTexture::updateBuffer(const void *buf, int pitch, GLuint x, GLuint y, GLu ++y; src += pitch; } while (--h); - //} + } } void GLTexture::drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) { |