summaryrefslogtreecommitdiff
path: root/src/blitter/32bpp_simple.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2014-04-13 19:22:23 +0000
committerpeter1138 <peter1138@openttd.org>2014-04-13 19:22:23 +0000
commit209d3e2e9e95a0d096fd2c18b0d95597edab78f2 (patch)
tree4f4738577099ef79d94e703764277961efd7db6c /src/blitter/32bpp_simple.cpp
parent5fe053988f5b6060a68244096e385dcbe01fc9db (diff)
downloadopenttd-209d3e2e9e95a0d096fd2c18b0d95597edab78f2.tar.xz
(svn r26463) -Fix (r10190ish): Add special handling for PALETTE_CRASH to work for non-8bpp-mapped sprites.
Diffstat (limited to 'src/blitter/32bpp_simple.cpp')
-rw-r--r--src/blitter/32bpp_simple.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/blitter/32bpp_simple.cpp b/src/blitter/32bpp_simple.cpp
index 4a9036a13..30443c50b 100644
--- a/src/blitter/32bpp_simple.cpp
+++ b/src/blitter/32bpp_simple.cpp
@@ -45,6 +45,17 @@ void Blitter_32bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Zoo
}
break;
+ case BM_CRASH_REMAP:
+ if (src->m == 0) {
+ if (src->a != 0) {
+ uint8 g = MakeDark(src->r, src->g, src->b);
+ *dst = ComposeColourRGBA(g, g, g, src->a, *dst);
+ }
+ } else {
+ if (bp->remap[src->m] != 0) *dst = ComposeColourPA(this->AdjustBrightness(this->LookupColourInPalette(bp->remap[src->m]), src->v), src->a, *dst);
+ }
+ break;
+
case BM_TRANSPARENT:
/* TODO -- We make an assumption here that the remap in fact is transparency, not some colour.
* This is never a problem with the code we produce, but newgrfs can make it fail... or at least: