From ce692eb8296c9115e0cebcfa688cd016735d0b86 Mon Sep 17 00:00:00 2001 From: "M. Sz" Date: Thu, 11 Mar 2021 20:24:08 +0100 Subject: [PATCH] pl2: lintfix --- d2common/d2fileformats/d2pl2/pl2_color.go | 7 +++---- d2common/d2fileformats/d2pl2/pl2_color_24bits.go | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/d2common/d2fileformats/d2pl2/pl2_color.go b/d2common/d2fileformats/d2pl2/pl2_color.go index 835c8b2d..d06473e6 100644 --- a/d2common/d2fileformats/d2pl2/pl2_color.go +++ b/d2common/d2fileformats/d2pl2/pl2_color.go @@ -24,7 +24,7 @@ func (p *PL2Color) RGBA() uint32 { // SetRGBA sets PL2Color's value to rgba given func (p *PL2Color) SetRGBA(rgba uint32) { - p.R, p.G, p.B, _ = toComponent(rgba) + p.R, p.G, p.B = toComponent(rgba) } func toComposite(w, x, y, z uint8) uint32 { @@ -36,11 +36,10 @@ func toComposite(w, x, y, z uint8) uint32 { return composite } -func toComponent(wxyz uint32) (w, x, y, z uint8) { +func toComponent(wxyz uint32) (w, x, y uint8) { w = uint8(wxyz >> bitShift24 & mask) x = uint8(wxyz >> bitShift16 & mask) y = uint8(wxyz >> bitShift8 & mask) - z = uint8(wxyz >> bitShift0 & mask) - return w, x, y, z + return w, x, y } diff --git a/d2common/d2fileformats/d2pl2/pl2_color_24bits.go b/d2common/d2fileformats/d2pl2/pl2_color_24bits.go index d6ebf7de..c735a81a 100644 --- a/d2common/d2fileformats/d2pl2/pl2_color_24bits.go +++ b/d2common/d2fileformats/d2pl2/pl2_color_24bits.go @@ -14,5 +14,5 @@ func (p *PL2Color24Bits) RGBA() uint32 { // SetRGBA sets PL2Color's value to rgba given func (p *PL2Color24Bits) SetRGBA(rgba uint32) { - p.R, p.G, p.B, _ = toComponent(rgba) + p.R, p.G, p.B = toComponent(rgba) }