Changeset - r9573:3d036a2b3335
[Not reviewed]
master
0 1 0
smatz - 16 years ago 2008-06-21 20:58:34
smatz@openttd.org
(svn r13602) -Codechange: little speedup for 8bpp-optimized blitter
1 file changed with 16 insertions and 12 deletions:
0 comments (0 inline, 0 general)
src/blitter/8bpp_optimized.cpp
Show inline comments
 
@@ -71,24 +71,28 @@ void Blitter_8bppOptimized::Draw(Blitter
 
			/* Skip transparent pixels */
 
			dst += trans;
 
			width -= trans;
 
			if (width <= 0) continue;
 
			if (width <= 0 || pixels == 0) continue;
 
			pixels = min<uint>(pixels, (uint)width);
 
			width -= pixels;
 

	
 
			switch (mode) {
 
				case BM_COLOUR_REMAP:
 
					for (uint x = 0; x < pixels; x++) {
 
						if (bp->remap[*src] != 0) *dst = bp->remap[*src];
 
				case BM_COLOUR_REMAP: {
 
					const uint8 *remap = bp->remap;
 
					do {
 
						uint m = remap[*src];
 
						if (m != 0) *dst = m;
 
						dst++; src++;
 
					}
 
					break;
 
					} while (--pixels != 0);
 
				} break;
 

	
 
				case BM_TRANSPARENT:
 
					for (uint x = 0; x < pixels; x++) {
 
						*dst = bp->remap[*dst];
 
						dst++; src++;
 
					}
 
					break;
 
				case BM_TRANSPARENT: {
 
					const uint8 *remap = bp->remap;
 
					src += pixels;
 
					do {
 
						*dst = remap[*dst];
 
						dst++;
 
					} while (--pixels != 0);
 
				} break;
 

	
 
				default:
 
					memcpy(dst, src, pixels);
0 comments (0 inline, 0 general)