stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src/video png.c


From: Jimmy Salmon
Subject: [Stratagus-CVS] stratagus/src/video png.c
Date: Wed, 03 Dec 2003 14:15:37 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Jimmy Salmon <address@hidden>   03/12/03 14:15:36

Modified files:
        src/video      : png.c 

Log message:
        Fixed 24bpp screenshot

Patches:
Index: stratagus/src/video/png.c
diff -u stratagus/src/video/png.c:1.29 stratagus/src/video/png.c:1.30
--- stratagus/src/video/png.c:1.29      Sun Nov 23 14:11:03 2003
+++ stratagus/src/video/png.c   Wed Dec  3 14:15:36 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: png.c,v 1.29 2003/11/23 19:11:03 jsalmon3 Exp $
+//     $Id: png.c,v 1.30 2003/12/03 19:15:36 jsalmon3 Exp $
 
 //@{
 
@@ -325,11 +325,7 @@
                break;
            }
            case 24: {
-               Uint8 c;
-               for (j = 0; j < VideoWidth; ++j) {
-                   c = ((Uint8*)TheScreen->pixels)[j * bpp + i * VideoWidth * 
3];
-                   memcpy(row, (char*)TheScreen->pixels + i * VideoWidth, 
VideoWidth * 3);
-               }
+               memcpy(row, (Uint24*)TheScreen->pixels + i * VideoWidth, 
VideoWidth * 3);
                break;
            }
            case 32: {
@@ -360,7 +356,7 @@
        case 16:
            for (j = 0; j < VideoWidth; ++j) {
                VMemType16 c;
-               c = VideoMemory16[i*VideoWidth+j];
+               c = VideoMemory16[i * VideoWidth + j];
                row[j * 3 + 0] = (((c >> 0) & 0x1f) * 0xff) / 0x1f;
                row[j * 3 + 1] = (((c >> 5) & 0x3f) * 0xff) / 0x3f;
                row[j * 3 + 2] = (((c >> 11) & 0x1f) * 0xff) / 0x1f;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]