Fix colors with 40bpp-anim
This commit is contained in:
@@ -180,6 +180,7 @@ public:
|
||||
/* CM */
|
||||
uint8 cm_mdict[64*64*64] = {0};
|
||||
uint8 CM_GetMForRGB(uint8 r, uint8 g, uint8 b) {
|
||||
if (r==0 && g==0 && b==0) return 0;
|
||||
r &= 252; g &= 252; b &= 252;
|
||||
auto key = (r << 10) | (g << 4) | (b >> 2);
|
||||
auto m = this->cm_mdict[key];
|
||||
|
||||
@@ -365,7 +365,7 @@ template <bool Tpal_to_rgb> Sprite *Blitter_32bppOptimized::EncodeInternal(const
|
||||
dst_px->r = src->r;
|
||||
dst_px->g = src->g;
|
||||
dst_px->b = src->b;
|
||||
*dst_n = this->CM_GetMForRGB(src->r, src->g, src->b) | (DEFAULT_BRIGHTNESS << 8);
|
||||
if (Tpal_to_rgb) *dst_n = this->CM_GetMForRGB(src->r, src->g, src->b) | (DEFAULT_BRIGHTNESS << 8);
|
||||
}
|
||||
dst_px++;
|
||||
dst_n++;
|
||||
|
||||
@@ -189,7 +189,7 @@ inline void Blitter_40bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel
|
||||
/* In case the m-channel is zero, only apply the crash remap by darkening the RGB colour. */
|
||||
if (m == 0) {
|
||||
*dst = mode == BM_CRASH_REMAP ? this->MakeDark(*src_px) : *src_px;
|
||||
*anim = 0;
|
||||
*anim = mode == BM_CRASH_REMAP ? 0 : remap[this->CM_GetMForRGB(src_px->r, src_px->g, src_px->b)];
|
||||
} else {
|
||||
uint r = remap[m];
|
||||
if (r != 0) {
|
||||
|
||||
Reference in New Issue
Block a user