(svn r26463) -Fix (r10190ish): Add special handling for PALETTE_CRASH to work for non-8bpp-mapped sprites.

This commit is contained in:
peter1138
2014-04-13 19:22:23 +00:00
parent 5fe053988f
commit 209d3e2e9e
10 changed files with 147 additions and 6 deletions

View File

@@ -313,6 +313,25 @@ bmcr_alpha_blend_single:
if (src[0].a) anim[0] = 0;
}
break;
case BM_CRASH_REMAP:
for (uint x = (uint) bp->width; x > 0; x--) {
if (src_mv->m == 0) {
if (src->a != 0) {
uint8 g = MakeDark(src->r, src->g, src->b);
*dst = ComposeColourRGBA(g, g, g, src->a, *dst);
*anim = 0;
}
} else {
uint r = remap[src_mv->m];
if (r != 0) *dst = ComposeColourPANoCheck(this->AdjustBrightness(this->LookupColourInPalette(r), src_mv->v), src->a, *dst);
}
src_mv++;
dst++;
src++;
anim++;
}
break;
}
next_line:
@@ -373,6 +392,7 @@ bm_normal:
}
break;
case BM_TRANSPARENT: Draw<BM_TRANSPARENT, RM_NONE, BT_NONE, true, true>(bp, zoom); return;
case BM_CRASH_REMAP: Draw<BM_CRASH_REMAP, RM_NONE, BT_NONE, true, true>(bp, zoom); return;
}
}