mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-23 16:50:18 +01:00
Only use the transparent image generation if there where any transparent blocks.
This commit is contained in:
parent
b8bae923ec
commit
f5d84f0b7b
@ -166,7 +166,8 @@ func (r *Renderer) Reset() {
|
||||
r.yMin[i] = math.MinInt32
|
||||
}
|
||||
|
||||
if r.tBuffer != nil {
|
||||
if r.TransparentBlocks > 0 {
|
||||
r.TransparentBlocks = 0
|
||||
for i, t := range r.tBuffer {
|
||||
if t != nil {
|
||||
r.spans.FreeAll(t)
|
||||
@ -174,6 +175,8 @@ func (r *Renderer) Reset() {
|
||||
}
|
||||
}
|
||||
}
|
||||
r.SolidBlocks = 0
|
||||
r.RejectedBlocks = 0
|
||||
}
|
||||
|
||||
func (r *Renderer) IsFilled() bool {
|
||||
@ -416,7 +419,7 @@ func (r *Renderer) CreateShadedImage(
|
||||
|
||||
pix := image.Pix
|
||||
|
||||
if r.tBuffer != nil { // Fast path for transparent images.
|
||||
if r.TransparentBlocks > 0 { // Fast path for transparent images.
|
||||
for z := height - 1; z >= 0; z-- {
|
||||
for x := 0; x < width; x++ {
|
||||
colIdx := r.cBuffer[ofs]
|
||||
|
Loading…
Reference in New Issue
Block a user