diff options
author | 2024-12-06 04:04:22 +0100 | |
---|---|---|
committer | 2024-12-06 06:08:26 +0100 | |
commit | 8cd93744894b6c95658d57985759ef98fbd4f14d (patch) | |
tree | 2c04c920684ef573720159cbaf08f934b98aae7d /src/emu/rendlay.cpp | |
parent | 831c9831104ee26d218614d9e4d287f43c8ae4fa (diff) |
rendlay: fix crash with rect element alpha of 0 < n < 1.0/255,
misc: small cleanup
Diffstat (limited to 'src/emu/rendlay.cpp')
-rw-r--r-- | src/emu/rendlay.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp index be5413f99ae..489f232a1ad 100644 --- a/src/emu/rendlay.cpp +++ b/src/emu/rendlay.cpp @@ -2147,7 +2147,7 @@ protected: for (u32 y = bounds.top(); y <= bounds.bottom(); ++y) std::fill_n(&dest.pix(y, bounds.left()), width, f); } - else if (c.a) + else { // compute premultiplied color u32 const a(c.a * 255.0F); @@ -2156,6 +2156,9 @@ protected: u32 const b(u32(c.b * (255.0F * 255.0F)) * a); u32 const inva(255 - a); + if (!a) + return; + // we're translucent, add in the destination pixel contribution for (u32 y = bounds.top(); y <= bounds.bottom(); ++y) { @@ -2189,6 +2192,7 @@ public: u32 const g(c.g * (255.0F * 255.0F) * a); u32 const b(c.b * (255.0F * 255.0F) * a); u32 const inva(255 - a); + if (!a) return; |