[Scummvm-cvs-logs] SF.net SVN: scummvm:[51549] scummvm/branches/gsoc2010-opengl/backends/ graphics/opengl/gltexture.cpp
vgvgf at users.sourceforge.net
vgvgf at users.sourceforge.net
Sat Jul 31 21:20:33 CEST 2010
Revision: 51549
http://scummvm.svn.sourceforge.net/scummvm/?rev=51549&view=rev
Author: vgvgf
Date: 2010-07-31 19:20:33 +0000 (Sat, 31 Jul 2010)
Log Message:
-----------
OPENGL: Fix texture updating.
Modified Paths:
--------------
scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/gltexture.cpp
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/gltexture.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/gltexture.cpp 2010-07-31 19:18:35 UTC (rev 51548)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/gltexture.cpp 2010-07-31 19:20:33 UTC (rev 51549)
@@ -142,10 +142,10 @@
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 @@
++y;
src += pitch;
} while (--h);
- //}
+ }
}
void GLTexture::drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list