diff options
author | rubidium <rubidium@openttd.org> | 2012-04-10 20:16:51 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2012-04-10 20:16:51 +0000 |
commit | 54e36c4ff83d86346479bfae0e9bcef64afb1a49 (patch) | |
tree | e5a3d23f17267095d47dda66face3f2e7c77d67a /src/blitter/32bpp_simple.cpp | |
parent | bf867483005c034e0040a976b94a2dc8698bd35f (diff) | |
download | openttd-54e36c4ff83d86346479bfae0e9bcef64afb1a49.tar.xz |
(svn r24111) -Codechange: use Colour more instead of manually bitstuffing
Diffstat (limited to 'src/blitter/32bpp_simple.cpp')
-rw-r--r-- | src/blitter/32bpp_simple.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/blitter/32bpp_simple.cpp b/src/blitter/32bpp_simple.cpp index 3a80fe991..73487e54c 100644 --- a/src/blitter/32bpp_simple.cpp +++ b/src/blitter/32bpp_simple.cpp @@ -21,11 +21,11 @@ static FBlitter_32bppSimple iFBlitter_32bppSimple; void Blitter_32bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) { const Blitter_32bppSimple::Pixel *src, *src_line; - uint32 *dst, *dst_line; + Colour *dst, *dst_line; /* Find where to start reading in the source sprite */ src_line = (const Blitter_32bppSimple::Pixel *)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; + dst_line = (Colour *)bp->dst + bp->top * bp->pitch + bp->left; for (int y = 0; y < bp->height; y++) { dst = dst_line; @@ -66,7 +66,7 @@ void Blitter_32bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Zoo void Blitter_32bppSimple::DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) { - uint32 *udst = (uint32 *)dst; + Colour *udst = (Colour *)dst; if (pal == PALETTE_TO_TRANSPARENT) { do { @@ -122,10 +122,10 @@ Sprite *Blitter_32bppSimple::Encode(SpriteLoader::Sprite *sprite, AllocatorProc dst[i].v = rgb_max; /* Pre-convert the mapping channel to a RGB value */ - uint colour = this->AdjustBrightness(this->LookupColourInPalette(src->m), dst[i].v); - dst[i].r = GB(colour, 16, 8); - dst[i].g = GB(colour, 8, 8); - dst[i].b = GB(colour, 0, 8); + Colour colour = this->AdjustBrightness(this->LookupColourInPalette(src->m), dst[i].v); + dst[i].r = colour.r; + dst[i].g = colour.g; + dst[i].b = colour.b; dst[i].a = src->a; dst[i].m = src->m; } |