aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/opengl
diff options
context:
space:
mode:
authorAlejandro Marzini2010-07-30 02:58:35 +0000
committerAlejandro Marzini2010-07-30 02:58:35 +0000
commit37f7748a4abe9bf915871345797826641899ba49 (patch)
tree16dfea77830e1581674f74ec41b89f4dd3396e72 /backends/graphics/opengl
parentffb5868ac5d998bd6537a5c018dd00358cff2c26 (diff)
downloadscummvm-rg350-37f7748a4abe9bf915871345797826641899ba49.tar.gz
scummvm-rg350-37f7748a4abe9bf915871345797826641899ba49.tar.bz2
scummvm-rg350-37f7748a4abe9bf915871345797826641899ba49.zip
OPENGL: Fix crash on Broken Sword 2 when refreshing screen.
I must admit that I do not know why it does crash, but it seems that updating row by row is safer and does not makes problems. svn-id: r51491
Diffstat (limited to 'backends/graphics/opengl')
-rw-r--r--backends/graphics/opengl/gltexture.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/backends/graphics/opengl/gltexture.cpp b/backends/graphics/opengl/gltexture.cpp
index 708788eeae..d7a1b0a236 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) {
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) {