src/blitter/8bpp_optimized.cpp
branchnoai
changeset 9628 b5c2449616b5
parent 9627 6a7c8ead2328
child 9629 66dde6412125
equal deleted inserted replaced
9627:6a7c8ead2328 9628:b5c2449616b5
    10 
    10 
    11 static FBlitter_8bppOptimized iFBlitter_8bppOptimized;
    11 static FBlitter_8bppOptimized iFBlitter_8bppOptimized;
    12 
    12 
    13 void Blitter_8bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
    13 void Blitter_8bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
    14 {
    14 {
    15 	const byte *src, *src_next;
    15 	const uint8 *src, *src_next;
    16 	Pixel8 *dst, *dst_line;
    16 	uint8 *dst, *dst_line;
    17 	uint offset = 0;
    17 	uint offset = 0;
    18 
    18 
    19 	/* Find the offset of this zoom-level */
    19 	/* Find the offset of this zoom-level */
    20 	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;
    21 
    21 
    22 	/* Find where to start reading in the source sprite */
    22 	/* Find where to start reading in the source sprite */
    23 	src = (const byte *)bp->sprite + offset;
    23 	src = (const uint8 *)bp->sprite + offset;
    24 	dst_line = (Pixel8 *)bp->dst + bp->top * bp->pitch + bp->left;
    24 	dst_line = (uint8 *)bp->dst + bp->top * bp->pitch + bp->left;
    25 
    25 
    26 	/* Skip over the top lines in the source image */
    26 	/* Skip over the top lines in the source image */
    27 	for (int y = 0; y < bp->skip_top; y++) {
    27 	for (int y = 0; y < bp->skip_top; y++) {
    28 		uint trans, pixels;
    28 		uint trans, pixels;
    29 		for (;;) {
    29 		for (;;) {