summaryrefslogtreecommitdiff
path: root/src/blitter/32bpp_anim_sse4.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2017-03-18 17:14:53 +0000
committerfrosch <frosch@openttd.org>2017-03-18 17:14:53 +0000
commit19188818eae21fd3ff3b3c5ae35cde693b31ec28 (patch)
tree375ba310792b954eb79bc8a95c5298c7008c1fd3 /src/blitter/32bpp_anim_sse4.cpp
parent36d709e04716327f254a4803af8fc7b5f8da9a97 (diff)
downloadopenttd-19188818eae21fd3ff3b3c5ae35cde693b31ec28.tar.xz
(svn r27796) -Fix [FS#6545]: 32bpp-anim blitters assumed that pitch and width of the screen were equal.
Diffstat (limited to 'src/blitter/32bpp_anim_sse4.cpp')
-rw-r--r--src/blitter/32bpp_anim_sse4.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/blitter/32bpp_anim_sse4.cpp b/src/blitter/32bpp_anim_sse4.cpp
index 7d4b66fca..987cb0c6a 100644
--- a/src/blitter/32bpp_anim_sse4.cpp
+++ b/src/blitter/32bpp_anim_sse4.cpp
@@ -35,7 +35,8 @@ inline void Blitter_32bppSSE4_Anim::Draw(const Blitter::BlitterParams *bp, ZoomL
{
const byte * const remap = bp->remap;
Colour *dst_line = (Colour *) bp->dst + bp->top * bp->pitch + bp->left;
- uint16 *anim_line = this->anim_buf + ((uint32 *)bp->dst - (uint32 *)_screen.dst_ptr) + bp->top * this->anim_buf_width + bp->left;
+ assert(_screen.pitch == this->anim_buf_pitch); // precondition for translating 'bp->dst' into an 'anim_buf' offset below.
+ uint16 *anim_line = this->anim_buf + ((uint32 *)bp->dst - (uint32 *)_screen.dst_ptr) + bp->top * this->anim_buf_pitch + bp->left;
int effective_width = bp->width;
/* Find where to start reading in the source sprite. */
@@ -353,7 +354,7 @@ next_line:
if (mode != BM_TRANSPARENT) src_mv_line += si->sprite_width;
src_rgba_line = (const Colour*) ((const byte*) src_rgba_line + si->sprite_line_size);
dst_line += bp->pitch;
- anim_line += this->anim_buf_width;
+ anim_line += this->anim_buf_pitch;
}
}
IGNORE_UNINITIALIZED_WARNING_STOP