[Scummvm-cvs-logs] SF.net SVN: scummvm:[49552] scummvm/trunk/backends/platform/android/video. cpp

anguslees at users.sourceforge.net anguslees at users.sourceforge.net
Wed Jun 9 23:31:48 CEST 2010


Revision: 49552
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49552&view=rev
Author:   anguslees
Date:     2010-06-09 21:31:48 +0000 (Wed, 09 Jun 2010)

Log Message:
-----------
Fix dirty tracking in paletted textures.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/android/video.cpp

Modified: scummvm/trunk/backends/platform/android/video.cpp
===================================================================
--- scummvm/trunk/backends/platform/android/video.cpp	2010-06-09 21:30:06 UTC (rev 49551)
+++ scummvm/trunk/backends/platform/android/video.cpp	2010-06-09 21:31:48 UTC (rev 49552)
@@ -178,23 +178,22 @@
 	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::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 {


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