diff options
author | hap <happppp@users.noreply.github.com> | 2022-02-28 13:27:50 +0100 |
---|---|---|
committer | hap <happppp@users.noreply.github.com> | 2022-02-28 13:28:04 +0100 |
commit | fba39f5b01b9b7c15a4744d7c478a0ab4bec8390 (patch) | |
tree | 8a8da2c6be1cafe123f5d4b477b265c87b382748 /src/emu | |
parent | fbbb9151ab6939801f3166ee10d9de92993e7eac (diff) |
rendlay: fix possible color overflow on disk element
Diffstat (limited to 'src/emu')
-rw-r--r-- | src/emu/rendlay.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp index 3151fccc5ed..ffe680fa625 100644 --- a/src/emu/rendlay.cpp +++ b/src/emu/rendlay.cpp @@ -2109,7 +2109,7 @@ protected: } else if (c.a) { - // compute premultiplied colors + // compute premultiplied color u32 const a(c.a * 255.0F); u32 const r(u32(c.r * (255.0F * 255.0F)) * a); u32 const g(u32(c.g * (255.0F * 255.0F)) * a); @@ -2145,9 +2145,9 @@ public: render_color const c(color(state)); u32 const f(rgb_t(u8(c.r * 255), u8(c.g * 255), u8(c.b * 255))); u32 const a(c.a * 255.0F); - u32 const r(c.r * c.a * (255.0F * 255.0F * 255.0F)); - u32 const g(c.g * c.a * (255.0F * 255.0F * 255.0F)); - u32 const b(c.b * c.a * (255.0F * 255.0F * 255.0F)); + u32 const r(c.r * (255.0F * 255.0F) * a); + 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; @@ -3109,7 +3109,7 @@ protected: // shift the reels a bit based on this param, allows fine tuning int use_state = (state + m_stateoffset) % max_state_used; - // compute premultiplied colors + // compute premultiplied color render_color const c(color(state)); u32 const r = c.r * 255.0f; u32 const g = c.g * 255.0f; @@ -3261,7 +3261,7 @@ private: // shift the reels a bit based on this param, allows fine tuning int use_state = (state + m_stateoffset) % max_state_used; - // compute premultiplied colors + // compute premultiplied color render_color const c(color(state)); u32 const r = c.r * 255.0f; u32 const g = c.g * 255.0f; @@ -3679,7 +3679,7 @@ void layout_element::component::draw_text( int align, const render_color &color) { - // compute premultiplied colors + // compute premultiplied color u32 const r(color.r * 255.0f); u32 const g(color.g * 255.0f); u32 const b(color.b * 255.0f); |