Commits

Anonymous committed 7bf110b

tostring works with alpha and colorkey

  • Participants
  • Parent commits ad329e5

Comments (0)

Files changed (2)

 # BREAK = change breaks existing code
 # BUG	= fixed a bug that was (or could have been) crashing
 
+November 12, 2001
+	image.tostring() now works with alpha/colorkey
+
 November 3, 2001
         filled shape drawing now clips properly [BUG]
         Rect object correctly compare (==,<,>)
 					data[0] = (char)surf->format->palette->colors[color].r;
 					data[1] = (char)surf->format->palette->colors[color].g;
 					data[2] = (char)surf->format->palette->colors[color].b;
-					data[3] = hascolorkey ? (char)(color==colorkey) : (char)255;
+					data[3] = hascolorkey ? (char)(color==colorkey)*255 : (char)255;
 					data += 4;
 				}
 			}break;
 					data[0] = (char)(((color & Rmask) >> Rshift) << Rloss);
 					data[1] = (char)(((color & Gmask) >> Gshift) << Gloss);
 					data[2] = (char)(((color & Bmask) >> Bshift) << Bloss);
-					data[3] = hascolorkey ? (char)(color==colorkey) : 
-								(char)(Amask ? (((color & Amask) >> Ashift) << Aloss) : 255);
+					data[3] = hascolorkey ? (char)(color==colorkey)*255 : 
+								(char)(Amask ? (((color & Amask) >> Ashift) << Aloss)*255 : 255);
 					data += 4;
 				}
 			}break;
 					data[0] = (char)(((color & Rmask) >> Rshift) << Rloss);
 					data[1] = (char)(((color & Gmask) >> Gshift) << Gloss);
 					data[2] = (char)(((color & Bmask) >> Bshift) << Bloss);
-					data[3] = hascolorkey ? (char)(color==colorkey) :
-								(char)(Amask ? (((color & Amask) >> Ashift) << Aloss) : 255);
+					data[3] = hascolorkey ? (char)(color==colorkey)*255 :
+								(char)(Amask ? (((color & Amask) >> Ashift) << Aloss)*255 : 255);
 					data += 4;
 				}
 			}break;
 					data[0] = (char)(((color & Rmask) >> Rshift) << Rloss);
 					data[1] = (char)(((color & Gmask) >> Gshift) << Rloss);
 					data[2] = (char)(((color & Bmask) >> Bshift) << Rloss);
-					data[3] = hascolorkey ? (char)(color==colorkey) :
-								(char)(Amask ? (((color & Amask) >> Ashift) << Rloss) : 255);
+					data[3] = hascolorkey ? (char)(color==colorkey)*255 :
+								(char)(Amask ? (((color & Amask) >> Ashift) << Rloss)*255 : 255);
 					data += 4;
 				}
 			}break;