mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-07-06 01:50:42 +02:00
Cache empty tiles to speed up seeding. Enforce Go 1.4 for the ability to compress better.
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
"container/heap"
|
||||
"image"
|
||||
"image/color"
|
||||
"image/draw"
|
||||
"math"
|
||||
)
|
||||
|
||||
@ -181,6 +182,10 @@ func (r *Renderer) IsFilled() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (r *Renderer) IsEmpty() bool {
|
||||
return r.SolidBlocks == 0 && r.TransparentBlocks == 0
|
||||
}
|
||||
|
||||
func (r *Renderer) RenderBlock(block *Block, colors *Colors) (err error) {
|
||||
|
||||
bx := block.Coord.X - r.xOfs
|
||||
@ -392,6 +397,12 @@ func safeColor(x int32) uint8 {
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *Renderer) CreateShadedImage(
|
||||
xOfs, zOfs, width, height int,
|
||||
cols *Colors, background color.RGBA) *image.RGBA {
|
||||
|
Reference in New Issue
Block a user