pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src screenshot.cxx,1.6,1.7


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src screenshot.cxx,1.6,1.7
Date: 6 Oct 2002 17:13:26 -0000

Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv31381

Modified Files:
        screenshot.cxx 
Log Message:
applied screenshot fix from Gervase Lam


Index: screenshot.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/screenshot.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- screenshot.cxx      4 Sep 2002 14:55:11 -0000       1.6
+++ screenshot.cxx      6 Oct 2002 17:13:24 -0000       1.7
@@ -85,11 +85,13 @@
   target->lock();
   sbuffer = (unsigned char*)target->get_data();
   sbuffer_size = target->get_height() * target->get_pitch();
+  unsigned int sbytes_per_pixel = target->get_bytes_per_pixel();
 
   //std::cout << "sbuffer: " << sbuffer_size << std::endl;
   //std::cout << "buffer: " << buffer_size << std::endl;
 
-  for (unsigned int i=0,j=0; i < sbuffer_size; i+=2, j+=3)
+  for (unsigned int i = 0, j = 0; i < sbuffer_size;
+       i += sbytes_per_pixel, j += 3)
     {
       buffer[j + 0] = (*((unsigned short*)(sbuffer+i)) & 
target->get_red_mask())
                       * 255 / target->get_red_mask();





reply via email to

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