1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-16 04:25:23 +00:00

pl2: lintfix

This commit is contained in:
M. Sz 2021-03-11 20:24:08 +01:00
parent a7b8f82204
commit ce692eb829
2 changed files with 4 additions and 5 deletions

View File

@ -24,7 +24,7 @@ func (p *PL2Color) RGBA() uint32 {
// SetRGBA sets PL2Color's value to rgba given // SetRGBA sets PL2Color's value to rgba given
func (p *PL2Color) SetRGBA(rgba uint32) { 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 { func toComposite(w, x, y, z uint8) uint32 {
@ -36,11 +36,10 @@ func toComposite(w, x, y, z uint8) uint32 {
return composite return composite
} }
func toComponent(wxyz uint32) (w, x, y, z uint8) { func toComponent(wxyz uint32) (w, x, y uint8) {
w = uint8(wxyz >> bitShift24 & mask) w = uint8(wxyz >> bitShift24 & mask)
x = uint8(wxyz >> bitShift16 & mask) x = uint8(wxyz >> bitShift16 & mask)
y = uint8(wxyz >> bitShift8 & mask) y = uint8(wxyz >> bitShift8 & mask)
z = uint8(wxyz >> bitShift0 & mask)
return w, x, y, z return w, x, y
} }

View File

@ -14,5 +14,5 @@ func (p *PL2Color24Bits) RGBA() uint32 {
// SetRGBA sets PL2Color's value to rgba given // SetRGBA sets PL2Color's value to rgba given
func (p *PL2Color24Bits) SetRGBA(rgba uint32) { func (p *PL2Color24Bits) SetRGBA(rgba uint32) {
p.R, p.G, p.B, _ = toComponent(rgba) p.R, p.G, p.B = toComponent(rgba)
} }