File diff r8263:00e828e1ab1f → r8264:d493cb51fe8a
src/blitter/32bpp_optimized.cpp
Show inline comments
 
/* $Id$ */
 

	
 
#include "../stdafx.h"
 
#include "../zoom_func.h"
 
#include "../gfx_func.h"
 
#include "../debug.h"
 
#include "../table/sprites.h"
 
#include "32bpp_optimized.hpp"
 

	
 
static FBlitter_32bppOptimized iFBlitter_32bppOptimized;
 

	
 
void Blitter_32bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
 
{
 
	const SpriteLoader::CommonPixel *src, *src_line;
 
	uint32 *dst, *dst_line;
 

	
 
	/* Find where to start reading in the source sprite */
 
	src_line = (const SpriteLoader::CommonPixel *)bp->sprite + (bp->skip_top * bp->sprite_width + bp->skip_left) * ScaleByZoom(1, zoom);
 
	dst_line = (uint32 *)bp->dst + bp->top * bp->pitch + bp->left;
 

	
 
	for (int y = 0; y < bp->height; y++) {
 
		dst = dst_line;
 
		dst_line += bp->pitch;
 

	
 
		src = src_line;
 
		src_line += bp->sprite_width * ScaleByZoom(1, zoom);
 

	
 
		for (int x = 0; x < bp->width; x++) {
 
			if (src->a == 0) {
 
				/* src->r is 'misused' here to indicate how much more pixels are following with an alpha of 0 */
 
				int skip = UnScaleByZoom(src->r, zoom);