mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-11-08 03:00:26 +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("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 {
|
||||
width int
|
||||
height int
|
||||
xOfs int16
|
||||
zOfs int16
|
||||
yBuffer []int32
|
||||
yMin []int32
|
||||
cBuffer []int32
|
||||
Rejected int
|
||||
width int
|
||||
height int
|
||||
xOfs int16
|
||||
zOfs int16
|
||||
yBuffer []int32
|
||||
yMin []int32
|
||||
cBuffer []int32
|
||||
RejectedBlocks int
|
||||
SolidBlocks int
|
||||
TransparentBlocks int
|
||||
}
|
||||
|
||||
type YOrder struct {
|
||||
|
@ -172,7 +174,7 @@ func (r *Renderer) RenderBlock(block *Block, colors *Colors) (err error) {
|
|||
blockY := int32(block.Coord.Y) << 4
|
||||
pos := int(bz)*r.width + int(bx)
|
||||
if blockY < r.yMin[pos] {
|
||||
r.Rejected++
|
||||
r.RejectedBlocks++
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -183,10 +185,16 @@ func (r *Renderer) RenderBlock(block *Block, colors *Colors) (err error) {
|
|||
}
|
||||
|
||||
if db.AirOnly {
|
||||
r.Rejected++
|
||||
r.RejectedBlocks++
|
||||
return
|
||||
}
|
||||
|
||||
if db.Transparent {
|
||||
r.TransparentBlocks++
|
||||
} else {
|
||||
r.SolidBlocks++
|
||||
}
|
||||
|
||||
w := r.width << 4
|
||||
ofs := int(bz)*w<<4 + int(bx)<<4
|
||||
yB := r.yBuffer
|
||||
|
|
Loading…
Reference in New Issue
Block a user