mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-07-06 01:50:42 +02:00
When an tile is rendered the writing to disk can be done in background
concurrently to the rendering of the next tile.
This commit is contained in:
@ -7,7 +7,6 @@ package common
|
||||
import (
|
||||
"image"
|
||||
"image/color"
|
||||
"image/draw"
|
||||
"math"
|
||||
)
|
||||
|
||||
@ -59,6 +58,10 @@ func (r *Renderer) SetPos(xOfs, zOfs int16) {
|
||||
r.zOfs = zOfs
|
||||
}
|
||||
|
||||
func (r *Renderer) GetPos() (int16, int16) {
|
||||
return r.xOfs, r.zOfs
|
||||
}
|
||||
|
||||
func (r *Renderer) initBuffers() {
|
||||
yb := r.yBuffer
|
||||
yb = yb[:len(yb)]
|
||||
@ -269,12 +272,6 @@ 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