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