Changeset - r28334:e41ee4d6fc7c
[Not reviewed]
master
0 5 0
Peter Nelson - 11 months ago 2023-12-25 20:59:37
peter1138@openttd.org
Fix 9ce1626b: Some blitters have `bp->remap` aliased to `remap` for performance. (#11626)

While this probably doesn't make a huge difference for the custom transparent remap code path, the alias is there so use it.
5 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/blitter/32bpp_anim.cpp
Show inline comments
 
@@ -215,13 +215,13 @@ inline void Blitter_32bppAnim::Draw(cons
 
				case BM_TRANSPARENT_REMAP:
 
					/* Apply custom transparency remap. */
 
					src_n += n;
 
					if (src_px->a != 0) {
 
						src_px += n;
 
						do {
 
							*dst = this->LookupColourInPalette(bp->remap[GetNearestColourIndex(*dst)]);
 
							*dst = this->LookupColourInPalette(remap[GetNearestColourIndex(*dst)]);
 
							*anim = 0;
 
							anim++;
 
							dst++;
 
						} while (--n != 0);
 
					} else {
 
						dst += n;
src/blitter/32bpp_anim_sse4.cpp
Show inline comments
 
@@ -319,13 +319,13 @@ bmcr_alpha_blend_single:
 
				break;
 

	
 
			case BM_TRANSPARENT_REMAP:
 
				/* Apply custom transparency remap. */
 
				for (uint x = (uint) bp->width; x > 0; x--) {
 
					if (src->a != 0) {
 
						*dst = this->LookupColourInPalette(bp->remap[GetNearestColourIndex(*dst)]);
 
						*dst = this->LookupColourInPalette(remap[GetNearestColourIndex(*dst)]);
 
						*anim = 0;
 
					}
 
					src_mv++;
 
					dst++;
 
					src++;
 
					anim++;
src/blitter/32bpp_optimized.cpp
Show inline comments
 
@@ -206,13 +206,13 @@ inline void Blitter_32bppOptimized::Draw
 
				case BM_TRANSPARENT_REMAP:
 
					/* Apply custom transparency remap. */
 
					src_n += n;
 
					if (src_px->a != 0) {
 
						src_px += n;
 
						do {
 
							*dst = this->LookupColourInPalette(bp->remap[GetNearestColourIndex(*dst)]);
 
							*dst = this->LookupColourInPalette(remap[GetNearestColourIndex(*dst)]);
 
							dst++;
 
						} while (--n != 0);
 
					} else {
 
						dst += n;
 
						src_px += n;
 
					}
src/blitter/32bpp_sse_func.hpp
Show inline comments
 
@@ -393,13 +393,13 @@ bmcr_alpha_blend_single:
 
				break;
 

	
 
			case BM_TRANSPARENT_REMAP:
 
				/* Apply custom transparency remap. */
 
				for (uint x = (uint) bp->width; x > 0; x--) {
 
					if (src->a != 0) {
 
						*dst = this->LookupColourInPalette(bp->remap[GetNearestColourIndex(*dst)]);
 
						*dst = this->LookupColourInPalette(remap[GetNearestColourIndex(*dst)]);
 
					}
 
					src_mv++;
 
					dst++;
 
					src++;
 
				}
 
				break;
src/blitter/40bpp_anim.cpp
Show inline comments
 
@@ -264,15 +264,15 @@ inline void Blitter_40bppAnim::Draw(cons
 
					/* Apply custom transparency remap. */
 
					src_n += n;
 
					if (src_px->a != 0) {
 
						src_px += n;
 
						do {
 
							if (*anim != 0) {
 
								*anim = bp->remap[*anim];
 
								*anim = remap[*anim];
 
							} else {
 
								*dst = this->LookupColourInPalette(bp->remap[GetNearestColourIndex(*dst)]);
 
								*dst = this->LookupColourInPalette(remap[GetNearestColourIndex(*dst)]);
 
								*anim = 0;
 
							}
 
							anim++;
 
							dst++;
 
						} while (--n != 0);
 
					} else {
0 comments (0 inline, 0 general)