[Scummvm-cvs-logs] SF.net SVN: scummvm:[39340] residual/trunk/engine/tinygl/image_util.cpp
aquadran at users.sourceforge.net
aquadran at users.sourceforge.net
Wed Mar 11 22:28:44 CET 2009
Revision: 39340
http://scummvm.svn.sourceforge.net/scummvm/?rev=39340&view=rev
Author: aquadran
Date: 2009-03-11 21:28:42 +0000 (Wed, 11 Mar 2009)
Log Message:
-----------
i hope it fix big endian issue with tinygl texture drawing
Modified Paths:
--------------
residual/trunk/engine/tinygl/image_util.cpp
Modified: residual/trunk/engine/tinygl/image_util.cpp
===================================================================
--- residual/trunk/engine/tinygl/image_util.cpp 2009-03-11 21:11:52 UTC (rev 39339)
+++ residual/trunk/engine/tinygl/image_util.cpp 2009-03-11 21:28:42 UTC (rev 39340)
@@ -12,8 +12,13 @@
p2 = (unsigned char *)pixmap;
for (i = 0; i < n; i++) {
unsigned short pixel = ((p[0] & 0xF8) << 8) | ((p[1] & 0xFC) << 3) | ((p[2] & 0xF8) >> 3);
+#ifdef SYSTEM_BIG_ENDIAN
+ p2[3 * i + 0] = pixel >> 8;
+ p2[3 * i + 1] = pixel & 0xff;
+#else
+ p2[3 * i + 0] = pixel & 0xff;
p2[3 * i + 1] = pixel >> 8;
- p2[3 * i + 0] = pixel & 0xff;
+#endif
p2[3 * i + 2] = p[3];
p += 4;
}
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