mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-01-11 09:20:17 +01:00
Collect more statistics about number of solid and transparent blocks and print them in mttilemapper.
This commit is contained in:
parent
99ff99a8f4
commit
2aa9ee0e24
@ -117,5 +117,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("num blocks: %d\n", numBlocks)
|
log.Printf("num blocks: %d\n", numBlocks)
|
||||||
log.Printf("rejected blocks: %d\n", renderer.Rejected)
|
log.Printf("rejected blocks: %d\n", renderer.RejectedBlocks)
|
||||||
|
log.Printf("transparent blocks: %d\n", renderer.TransparentBlocks)
|
||||||
|
log.Printf("solid blocks: %d\n", renderer.SolidBlocks)
|
||||||
}
|
}
|
||||||
|
@ -17,14 +17,16 @@ type Area struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Renderer struct {
|
type Renderer struct {
|
||||||
width int
|
width int
|
||||||
height int
|
height int
|
||||||
xOfs int16
|
xOfs int16
|
||||||
zOfs int16
|
zOfs int16
|
||||||
yBuffer []int32
|
yBuffer []int32
|
||||||
yMin []int32
|
yMin []int32
|
||||||
cBuffer []int32
|
cBuffer []int32
|
||||||
Rejected int
|
RejectedBlocks int
|
||||||
|
SolidBlocks int
|
||||||
|
TransparentBlocks int
|
||||||
}
|
}
|
||||||
|
|
||||||
type YOrder struct {
|
type YOrder struct {
|
||||||
@ -172,7 +174,7 @@ func (r *Renderer) RenderBlock(block *Block, colors *Colors) (err error) {
|
|||||||
blockY := int32(block.Coord.Y) << 4
|
blockY := int32(block.Coord.Y) << 4
|
||||||
pos := int(bz)*r.width + int(bx)
|
pos := int(bz)*r.width + int(bx)
|
||||||
if blockY < r.yMin[pos] {
|
if blockY < r.yMin[pos] {
|
||||||
r.Rejected++
|
r.RejectedBlocks++
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,10 +185,16 @@ func (r *Renderer) RenderBlock(block *Block, colors *Colors) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if db.AirOnly {
|
if db.AirOnly {
|
||||||
r.Rejected++
|
r.RejectedBlocks++
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if db.Transparent {
|
||||||
|
r.TransparentBlocks++
|
||||||
|
} else {
|
||||||
|
r.SolidBlocks++
|
||||||
|
}
|
||||||
|
|
||||||
w := r.width << 4
|
w := r.width << 4
|
||||||
ofs := int(bz)*w<<4 + int(bx)<<4
|
ofs := int(bz)*w<<4 + int(bx)<<4
|
||||||
yB := r.yBuffer
|
yB := r.yBuffer
|
||||||
|
Loading…
Reference in New Issue
Block a user