From d44efa817fd997f336ac83f0490212fb21e9bf02 Mon Sep 17 00:00:00 2001 From: Angus Lees Date: Wed, 9 Jun 2010 21:31:48 +0000 Subject: Fix dirty tracking in paletted textures. svn-id: r49552 --- backends/platform/android/video.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'backends/platform/android') diff --git a/backends/platform/android/video.cpp b/backends/platform/android/video.cpp index 09d4dba154..5d16410cea 100644 --- a/backends/platform/android/video.cpp +++ b/backends/platform/android/video.cpp @@ -178,23 +178,22 @@ void GLESTexture::updateBuffer(GLuint x, GLuint y, GLuint w, GLuint h, ENTER("updateBuffer(%u, %u, %u, %u, %p, %d)", x, y, w, h, buf, pitch); glBindTexture(GL_TEXTURE_2D, _texture_name); + setDirtyRect(Common::Rect(x, y, x+w, y+h)); + if (static_cast(w) * bytesPerPixel() == pitch) { glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, glFormat(), glType(), buf); } else { // GLES removed the ability to specify pitch, so we // have to do this row by row. - int i = h; const byte* src = static_cast(buf); do { glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, 1, glFormat(), glType(), src); ++y; src += pitch; - } while (--i); + } while (--h); } - - setDirtyRect(Common::Rect(x, y, x+w, y+h)); } void GLESTexture::fillBuffer(byte x) { @@ -297,6 +296,8 @@ void GLESPaletteTexture::fillBuffer(byte x) { void GLESPaletteTexture::updateBuffer(GLuint x, GLuint y, GLuint w, GLuint h, const void* buf, int pitch) { + _all_dirty = true; + const byte* src = static_cast(buf); byte* dst = static_cast(_surface.getBasePtr(x, y)); do { -- cgit v1.2.3