From 54e36c4ff83d86346479bfae0e9bcef64afb1a49 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 10 Apr 2012 20:16:51 +0000 Subject: (svn r24111) -Codechange: use Colour more instead of manually bitstuffing --- src/blitter/32bpp_optimized.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/blitter/32bpp_optimized.cpp') diff --git a/src/blitter/32bpp_optimized.cpp b/src/blitter/32bpp_optimized.cpp index ee3e05e9d..1c1ac816d 100644 --- a/src/blitter/32bpp_optimized.cpp +++ b/src/blitter/32bpp_optimized.cpp @@ -44,14 +44,14 @@ inline void Blitter_32bppOptimized::Draw(const Blitter::BlitterParams *bp, ZoomL } /* skip lines in dst */ - uint32 *dst = (uint32 *)bp->dst + bp->top * bp->pitch + bp->left; + Colour *dst = (Colour *)bp->dst + bp->top * bp->pitch + bp->left; /* store so we don't have to access it via bp everytime (compiler assumes pointer aliasing) */ const byte *remap = bp->remap; for (int y = 0; y < bp->height; y++) { /* next dst line begins here */ - uint32 *dst_ln = dst + bp->pitch; + Colour *dst_ln = dst + bp->pitch; /* next src line begins here */ const Colour *src_px_ln = (const Colour *)((const byte *)src_px + *(const uint32 *)src_px); @@ -62,7 +62,7 @@ inline void Blitter_32bppOptimized::Draw(const Blitter::BlitterParams *bp, ZoomL src_n += 2; /* we will end this line when we reach this point */ - uint32 *dst_end = dst + bp->skip_left; + Colour *dst_end = dst + bp->skip_left; /* number of pixels with the same aplha channel class */ uint n; @@ -286,10 +286,10 @@ Sprite *Blitter_32bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorPr *dst_n |= rgb_max << 8; /* Pre-convert the mapping channel to a RGB value */ - uint32 colour = this->AdjustBrightness(this->LookupColourInPalette(src->m), rgb_max); - dst_px->r = GB(colour, 16, 8); - dst_px->g = GB(colour, 8, 8); - dst_px->b = GB(colour, 0, 8); + Colour colour = this->AdjustBrightness(this->LookupColourInPalette(src->m), rgb_max); + dst_px->r = colour.r; + dst_px->g = colour.g; + dst_px->b = colour.b; } else { dst_px->r = src->r; dst_px->g = src->g; -- cgit v1.2.3-54-g00ecf