summaryrefslogtreecommitdiff
path: root/src/blitter/32bpp_anim.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-04-10 20:16:51 +0000
committerrubidium <rubidium@openttd.org>2012-04-10 20:16:51 +0000
commit54e36c4ff83d86346479bfae0e9bcef64afb1a49 (patch)
treee5a3d23f17267095d47dda66face3f2e7c77d67a /src/blitter/32bpp_anim.cpp
parentbf867483005c034e0040a976b94a2dc8698bd35f (diff)
downloadopenttd-54e36c4ff83d86346479bfae0e9bcef64afb1a49.tar.xz
(svn r24111) -Codechange: use Colour more instead of manually bitstuffing
Diffstat (limited to 'src/blitter/32bpp_anim.cpp')
-rw-r--r--src/blitter/32bpp_anim.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/blitter/32bpp_anim.cpp b/src/blitter/32bpp_anim.cpp
index acc726215..7681d25ed 100644
--- a/src/blitter/32bpp_anim.cpp
+++ b/src/blitter/32bpp_anim.cpp
@@ -31,13 +31,13 @@ inline void Blitter_32bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel
src_n = (const uint16 *)((const byte *)src_n + *(const uint32 *)src_n);
}
- uint32 *dst = (uint32 *)bp->dst + bp->top * bp->pitch + bp->left;
+ Colour *dst = (Colour *)bp->dst + bp->top * bp->pitch + bp->left;
uint16 *anim = this->anim_buf + ((uint32 *)bp->dst - (uint32 *)_screen.dst_ptr) + bp->top * this->anim_buf_width + bp->left;
const byte *remap = bp->remap; // store so we don't have to access it via bp everytime
for (int y = 0; y < bp->height; y++) {
- uint32 *dst_ln = dst + bp->pitch;
+ Colour *dst_ln = dst + bp->pitch;
uint16 *anim_ln = anim + this->anim_buf_width;
const Colour *src_px_ln = (const Colour *)((const byte *)src_px + *(const uint32 *)src_px);
@@ -46,7 +46,7 @@ inline void Blitter_32bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel
const uint16 *src_n_ln = (const uint16 *)((const byte *)src_n + *(const uint32 *)src_n);
src_n += 2;
- uint32 *dst_end = dst + bp->skip_left;
+ Colour *dst_end = dst + bp->skip_left;
uint n;
@@ -219,7 +219,7 @@ void Blitter_32bppAnim::DrawColourMappingRect(void *dst, int width, int height,
return;
}
- uint32 *udst = (uint32 *)dst;
+ Colour *udst = (Colour *)dst;
uint16 *anim;
anim = this->anim_buf + ((uint32 *)dst - (uint32 *)_screen.dst_ptr);
@@ -256,7 +256,7 @@ void Blitter_32bppAnim::DrawColourMappingRect(void *dst, int width, int height,
void Blitter_32bppAnim::SetPixel(void *video, int x, int y, uint8 colour)
{
- *((uint32 *)video + x + y * _screen.pitch) = LookupColourInPalette(colour);
+ *((Colour *)video + x + y * _screen.pitch) = LookupColourInPalette(colour);
/* Set the colour in the anim-buffer too, if we are rendering to the screen */
if (_screen_disable_anim) return;
@@ -271,13 +271,13 @@ void Blitter_32bppAnim::DrawRect(void *video, int width, int height, uint8 colou
return;
}
- uint32 colour32 = LookupColourInPalette(colour);
+ Colour colour32 = LookupColourInPalette(colour);
uint16 *anim_line;
anim_line = ((uint32 *)video - (uint32 *)_screen.dst_ptr) + this->anim_buf;
do {
- uint32 *dst = (uint32 *)video;
+ Colour *dst = (Colour *)video;
uint16 *anim = anim_line;
for (int i = width; i > 0; i--) {
@@ -296,13 +296,13 @@ void Blitter_32bppAnim::CopyFromBuffer(void *video, const void *src, int width,
{
assert(!_screen_disable_anim);
assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
- uint32 *dst = (uint32 *)video;
+ Colour *dst = (Colour *)video;
const uint32 *usrc = (const uint32 *)src;
uint16 *anim_line = ((uint32 *)video - (uint32 *)_screen.dst_ptr) + this->anim_buf;
for (; height > 0; height--) {
/* We need to keep those for palette animation. */
- uint32 *dst_pal = dst;
+ Colour *dst_pal = dst;
uint16 *anim_pal = anim_line;
memcpy(dst, usrc, width * sizeof(uint32));
@@ -422,7 +422,7 @@ void Blitter_32bppAnim::PaletteAnimate(const Palette &palette)
assert(this->palette.first_dirty == PALETTE_ANIM_START || this->palette.first_dirty == 0);
const uint16 *anim = this->anim_buf;
- uint32 *dst = (uint32 *)_screen.dst_ptr;
+ Colour *dst = (Colour *)_screen.dst_ptr;
/* Let's walk the anim buffer and try to find the pixels */
for (int y = this->anim_buf_height; y != 0 ; y--) {