|
1 /* $Id$ */ |
|
2 |
|
3 /** @file 8bpp_optimized.cpp */ |
|
4 |
1 #include "../stdafx.h" |
5 #include "../stdafx.h" |
2 #include "../zoom.hpp" |
6 #include "../zoom.hpp" |
3 #include "../gfx.h" |
7 #include "../gfx.h" |
4 #include "../debug.h" |
8 #include "../debug.h" |
5 #include "8bpp_optimized.hpp" |
9 #include "8bpp_optimized.hpp" |
6 |
10 |
7 static FBlitter_8bppOptimized iFBlitter_8bppOptimized; |
11 static FBlitter_8bppOptimized iFBlitter_8bppOptimized; |
8 |
12 |
9 void Blitter_8bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) |
13 void Blitter_8bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) |
10 { |
14 { |
11 const byte *src, *src_next; |
15 const uint8 *src, *src_next; |
12 Pixel8 *dst, *dst_line; |
16 uint8 *dst, *dst_line; |
13 uint offset = 0; |
17 uint offset = 0; |
14 |
18 |
15 /* Find the offset of this zoom-level */ |
19 /* Find the offset of this zoom-level */ |
16 offset = ((const byte *)bp->sprite)[(int)zoom * 2] | ((const byte *)bp->sprite)[(int)zoom * 2 + 1] << 8; |
20 offset = ((const uint8 *)bp->sprite)[(int)zoom * 2] | ((const byte *)bp->sprite)[(int)zoom * 2 + 1] << 8; |
17 |
21 |
18 /* Find where to start reading in the source sprite */ |
22 /* Find where to start reading in the source sprite */ |
19 src = (const byte *)bp->sprite + offset; |
23 src = (const uint8 *)bp->sprite + offset; |
20 dst_line = (Pixel8 *)bp->dst + bp->top * bp->pitch + bp->left; |
24 dst_line = (uint8 *)bp->dst + bp->top * bp->pitch + bp->left; |
21 |
25 |
22 /* Skip over the top lines in the source image */ |
26 /* Skip over the top lines in the source image */ |
23 for (int y = 0; y < bp->skip_top; y++) { |
27 for (int y = 0; y < bp->skip_top; y++) { |
24 uint trans, pixels; |
28 uint trans, pixels; |
25 for (;;) { |
29 for (;;) { |