summaryrefslogtreecommitdiff
path: root/src/blitter
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-01-13 18:03:35 +0000
committerrubidium <rubidium@openttd.org>2014-01-13 18:03:35 +0000
commit5b3b533697bd2803452d0ccf4bcc94550970968f (patch)
tree07ec090b99db373d5cb5404cb979f07b67c751d0 /src/blitter
parent7f6e837b3a5b2efd93fa35ffc0ff7a06d88aeb56 (diff)
downloadopenttd-5b3b533697bd2803452d0ccf4bcc94550970968f.tar.xz
(svn r26253) -Codechange: remove margin limitation to preserve block type (MJP)
Diffstat (limited to 'src/blitter')
-rw-r--r--src/blitter/32bpp_anim_sse4.cpp1
-rw-r--r--src/blitter/32bpp_sse2.cpp7
-rw-r--r--src/blitter/32bpp_sse4.cpp1
-rw-r--r--src/blitter/32bpp_ssse3.cpp1
4 files changed, 7 insertions, 3 deletions
diff --git a/src/blitter/32bpp_anim_sse4.cpp b/src/blitter/32bpp_anim_sse4.cpp
index e1072dd5f..4ee66f544 100644
--- a/src/blitter/32bpp_anim_sse4.cpp
+++ b/src/blitter/32bpp_anim_sse4.cpp
@@ -64,6 +64,7 @@ inline void Blitter_32bppSSE4_Anim::Draw(const Blitter::BlitterParams *bp, ZoomL
uint16 *anim = anim_line;
if (read_mode == RM_WITH_MARGIN) {
+ assert(bt_last == BT_NONE); // or you must ensure block type is preserved
anim += src_rgba_line[0].data;
src += src_rgba_line[0].data;
dst += src_rgba_line[0].data;
diff --git a/src/blitter/32bpp_sse2.cpp b/src/blitter/32bpp_sse2.cpp
index ddaa352e2..fa43eb4c5 100644
--- a/src/blitter/32bpp_sse2.cpp
+++ b/src/blitter/32bpp_sse2.cpp
@@ -56,6 +56,7 @@ inline void Blitter_32bppSSE2::Draw(const Blitter::BlitterParams *bp, ZoomLevel
if (mode == BM_COLOUR_REMAP) src_mv = src_mv_line;
if (read_mode == RM_WITH_MARGIN) {
+ assert(bt_last == BT_NONE); // or you must ensure block type is preserved
src += src_rgba_line[0].data;
dst += src_rgba_line[0].data;
if (mode == BM_COLOUR_REMAP) src_mv += src_rgba_line[0].data;
@@ -181,7 +182,7 @@ void Blitter_32bppSSE2::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomL
Sprite *Blitter_32bppSSE_Base::Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
{
- /* First uint32 of a line = ~1 & the number of transparent pixels from the left.
+ /* First uint32 of a line = the number of transparent pixels from the left.
* Second uint32 of a line = the number of transparent pixels from the right.
* Then all RGBA then all MV.
*/
@@ -261,7 +262,7 @@ Sprite *Blitter_32bppSSE_Base::Encode(const SpriteLoader::Sprite *sprite, Alloca
else break;
dst_rgba++;
}
- (*dst_rgba_line).data = nb_pix_transp & ~1; // "& ~1" to preserve the last block type
+ (*dst_rgba_line).data = nb_pix_transp;
Colour *nb_right = dst_rgba_line + 1;
dst_rgba_line = (Colour*) ((byte*) dst_rgba_line + sd.infos[z].sprite_line_size);
@@ -274,7 +275,7 @@ Sprite *Blitter_32bppSSE_Base::Encode(const SpriteLoader::Sprite *sprite, Alloca
else break;
dst_rgba--;
}
- (*nb_right).data = nb_pix_transp; // no "& ~1" here, must be done when we know bp->width
+ (*nb_right).data = nb_pix_transp;
}
}
diff --git a/src/blitter/32bpp_sse4.cpp b/src/blitter/32bpp_sse4.cpp
index 6bdb9e950..74f10e934 100644
--- a/src/blitter/32bpp_sse4.cpp
+++ b/src/blitter/32bpp_sse4.cpp
@@ -62,6 +62,7 @@ inline void Blitter_32bppSSE4::Draw(const Blitter::BlitterParams *bp, ZoomLevel
if (mode == BM_COLOUR_REMAP) src_mv = src_mv_line;
if (read_mode == RM_WITH_MARGIN) {
+ assert(bt_last == BT_NONE); // or you must ensure block type is preserved
src += src_rgba_line[0].data;
dst += src_rgba_line[0].data;
if (mode == BM_COLOUR_REMAP) src_mv += src_rgba_line[0].data;
diff --git a/src/blitter/32bpp_ssse3.cpp b/src/blitter/32bpp_ssse3.cpp
index 32f073d45..1d7e0f056 100644
--- a/src/blitter/32bpp_ssse3.cpp
+++ b/src/blitter/32bpp_ssse3.cpp
@@ -62,6 +62,7 @@ inline void Blitter_32bppSSSE3::Draw(const Blitter::BlitterParams *bp, ZoomLevel
if (mode == BM_COLOUR_REMAP) src_mv = src_mv_line;
if (read_mode == RM_WITH_MARGIN) {
+ assert(bt_last == BT_NONE); // or you must ensure block type is preserved
src += src_rgba_line[0].data;
dst += src_rgba_line[0].data;
if (mode == BM_COLOUR_REMAP) src_mv += src_rgba_line[0].data;