Source

pygame / src / alphablit.c

Diff from to

src/alphablit.c

 /*
     pygame - Python Game Library
     Copyright (C) 2000-2001  Pete Shinners
+    Copyright (C) 2006  Rene Dudfield
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
 }
 
 
+
+/*
+ * Macros below are for the blit blending functions.
+ */
+
+
 #define GET_PIXEL(buf, bpp, fmt, pixel)                    \
 do {                                                                       \
         switch (bpp) {                                                           \
     } \
 
 
+/*
+ * Blending functions for the 32bit routines.
+ */
 
 #define BLEND_ADD4(S,D)  \
     tmp = (D) + (S);  (D) = (tmp <= 255 ? tmp: 255); \
     if ((S) > (D)) { (D) = (S); } \
 
 
+/*
+ * These are the dissasembled blending functions.
+ */
 
 #define BLEND_ADD(sR, sG, sB, sA, dR, dG, dB, dA)  \
     dR = (dR+sR <= 255 ? dR+sR: 255); \
     if(sB > dB) { dB = sB; } \
 
 
+/*
+ * blit_blend takes the blending args, and then uses that to select the 
+ *  correct code for blending with.
+ */
 static void blit_blend_THEM(SDL_BlitInfo *info, int the_args) {
     BLEND_TOP_VARS;
 
     switch(the_args) {
+        /*
+         * We use macros to keep the code shorter.
+         * First we see if it is a 32bit RGBA surface.  If so we have some 
+         *  special case code for that.  Otherwise we use the generic code.
+         */
         case PYGAME_BLEND_ADD: {
             BLEND_TOP_4;
             BLEND_ADD4(*src,*dst);