mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-07-15 22:40:30 +02:00
Fix issues found by staticcheck
This commit is contained in:
@ -6,8 +6,8 @@ package common
|
||||
|
||||
import (
|
||||
"image/color"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
)
|
||||
@ -177,7 +177,7 @@ func (btc *BaseTileCreator) WriteFunc(i, j int, update BaseTileUpdateFunc) func(
|
||||
if update == nil && btc.renderer.IsEmpty() {
|
||||
return func() (bool, error) {
|
||||
//log.Printf("Writing empty (%d, %d) to file %s\n", x, z, path)
|
||||
return true, ioutil.WriteFile(path, btc.blankImage(), 0666)
|
||||
return true, os.WriteFile(path, btc.blankImage(), 0666)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -131,6 +131,6 @@ func HashImage(img *image.RGBA) []byte {
|
||||
|
||||
func BackgroundImage(width, height int, bg color.RGBA) *image.RGBA {
|
||||
m := image.NewRGBA(image.Rect(0, 0, width, height))
|
||||
draw.Draw(m, m.Bounds(), &image.Uniform{bg}, image.ZP, draw.Src)
|
||||
draw.Draw(m, m.Bounds(), &image.Uniform{bg}, image.Point{}, draw.Src)
|
||||
return m
|
||||
}
|
||||
|
@ -64,19 +64,16 @@ func (r *Renderer) GetPos() (int16, int16) {
|
||||
|
||||
func (r *Renderer) initBuffers() {
|
||||
yb := r.yBuffer
|
||||
yb = yb[:len(yb)]
|
||||
for i := range yb {
|
||||
yb[i] = math.MinInt32
|
||||
}
|
||||
|
||||
cb := r.cBuffer
|
||||
cb = cb[:len(cb)]
|
||||
for i := range cb {
|
||||
cb[i] = -1
|
||||
}
|
||||
|
||||
ym := r.yMin
|
||||
ym = ym[:len(ym)]
|
||||
for i := range ym {
|
||||
ym[i] = math.MinInt32
|
||||
}
|
||||
|
Reference in New Issue
Block a user