src/blitter/32bpp_anim.cpp
changeset 11083 19aff1f3244e
parent 11082 45ab75d184a0
equal deleted inserted replaced
11082:45ab75d184a0 11083:19aff1f3244e
   134 					/* TODO -- We make an assumption here that the remap in fact is transparency, not some color.
   134 					/* TODO -- We make an assumption here that the remap in fact is transparency, not some color.
   135 					 *  This is never a problem with the code we produce, but newgrfs can make it fail... or at least:
   135 					 *  This is never a problem with the code we produce, but newgrfs can make it fail... or at least:
   136 					 *  we produce a result the newgrf maker didn't expect ;) */
   136 					 *  we produce a result the newgrf maker didn't expect ;) */
   137 
   137 
   138 					/* Make the current color a bit more black, so it looks like this image is transparent */
   138 					/* Make the current color a bit more black, so it looks like this image is transparent */
   139 					src_px += n;
       
   140 					src_n += n;
   139 					src_n += n;
   141 
   140 					if (src_px->a == 255) {
   142 					do {
   141 						src_px += n;
   143 						*dst = MakeTransparent(*dst, 192);
   142 						do {
   144 						*anim = remap[*anim];
   143 							*dst = MakeTransparent(*dst, 3, 4);
   145 						anim++;
   144 							*anim = remap[*anim];
   146 						dst++;
   145 							anim++;
   147 					} while (--n != 0);
   146 							dst++;
       
   147 						} while (--n != 0);
       
   148 					} else {
       
   149 						do {
       
   150 							*dst = MakeTransparent(*dst, (256 * 4 - src_px->a), 256 * 4);
       
   151 							*anim = remap[*anim];
       
   152 							anim++;
       
   153 							dst++;
       
   154 							src_px++;
       
   155 						} while (--n != 0);
       
   156 					}
   148 					break;
   157 					break;
   149 
   158 
   150 				default:
   159 				default:
   151 					if (src_px->a == 255) {
   160 					if (src_px->a == 255) {
   152 						do {
   161 						do {