pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] rev 2343 - trunk/src


From: Ingo Ruhnke
Subject: [Pingus-CVS] rev 2343 - trunk/src
Date: Thu, 24 Jun 2004 18:41:28 +0200

Author: grumbel
Date: 2004-06-24 18:41:28 +0200 (Thu, 24 Jun 2004)
New Revision: 2343

Modified:
   trunk/src/blitter.cxx
Log:
- fixed blitter

Modified: trunk/src/blitter.cxx
===================================================================
--- trunk/src/blitter.cxx       2004-06-24 14:09:17 UTC (rev 2342)
+++ trunk/src/blitter.cxx       2004-06-24 16:41:28 UTC (rev 2343)
@@ -341,17 +341,19 @@
         }
       else
         {
+          float a = color.get_alpha()/255.0f;
+
           for (int y = start_y; y < end_y; ++y)
             {
               cl_uint8* tptr = target_buf + 3*((twidth*(y + rect.top)) + 
rect.left + start_x);
 
               for (int x = start_x; x < end_x; ++x)
                 { 
-                  float a = color.get_alpha()/255.0f;
+                  cl_uint8* mytptr = tptr; // FIXME: No idea why I have to use 
mytptr[0..2] and can't use *tptr
 
-                  *tptr++ = Math::mid(0, int((1.0f - a) * *tptr + a * 
color.get_red()) , 255);
-                  *tptr++ = Math::mid(0, int((1.0f - a) * *tptr + a * 
color.get_green()), 255);
-                  *tptr++ = Math::mid(0, int((1.0f - a) * *tptr + a * 
color.get_blue())  , 255);
+                  *tptr++ = Math::mid(0, int(((1.0f - a) * (mytptr[0])) + a * 
color.get_blue()) , 255); //blue
+                  *tptr++ = Math::mid(0, int(((1.0f - a) * (mytptr[1])) + a * 
color.get_green()), 255); //green
+                  *tptr++ = Math::mid(0, int(((1.0f - a) * (mytptr[2])) + a * 
color.get_red()), 255); //red
                 }
             }
         }





reply via email to

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