diff options
author | Angus Lees | 2010-06-09 21:31:48 +0000 |
---|---|---|
committer | Angus Lees | 2010-06-09 21:31:48 +0000 |
commit | d44efa817fd997f336ac83f0490212fb21e9bf02 (patch) | |
tree | 3cf7b5f92fb2a5efc542b88e71b5cc55edea6297 /backends/platform | |
parent | d8050029f9940ec7abe0a3868f17e55319bad9c3 (diff) | |
download | scummvm-rg350-d44efa817fd997f336ac83f0490212fb21e9bf02.tar.gz scummvm-rg350-d44efa817fd997f336ac83f0490212fb21e9bf02.tar.bz2 scummvm-rg350-d44efa817fd997f336ac83f0490212fb21e9bf02.zip |
Fix dirty tracking in paletted textures.
svn-id: r49552
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/android/video.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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<int>(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<const byte*>(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<const byte*>(buf); byte* dst = static_cast<byte*>(_surface.getBasePtr(x, y)); do { |