mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-11-17 15:48:17 +01:00
Fixed tilerenderer.
This commit is contained in:
parent
09b321de02
commit
6306a9acb7
@ -50,7 +50,8 @@ func NewRenderer(xOfs, zOfs int16, width, height int) (renderer *Renderer) {
|
||||
xOfs: xOfs,
|
||||
zOfs: zOfs,
|
||||
yBuffer: yBuffer,
|
||||
cBuffer: cBuffer}
|
||||
cBuffer: cBuffer,
|
||||
yMin: yMin}
|
||||
return
|
||||
}
|
||||
|
||||
@ -65,11 +66,9 @@ func (r *Renderer) RenderBlock(block *common.Block, nameIndex map[string]int32)
|
||||
|
||||
// We do not need to render the block if the whole 16x16 area
|
||||
// is already filled and the block is strictly below.
|
||||
w := r.width << 4
|
||||
ofs := int(bz)*w<<4 + int(bx)<<4
|
||||
|
||||
blockY := int32(block.Coord.Y) << 4
|
||||
pos := int(bz)*r.width + int(bx)
|
||||
//fmt.Printf("pos: %d %d\n", pos, len(r.yMin))
|
||||
if blockY < r.yMin[pos] {
|
||||
r.Rejected++
|
||||
return
|
||||
@ -81,6 +80,9 @@ func (r *Renderer) RenderBlock(block *common.Block, nameIndex map[string]int32)
|
||||
return
|
||||
}
|
||||
|
||||
w := r.width << 4
|
||||
ofs := int(bz)*w<<4 + int(bx)<<4
|
||||
|
||||
yMin := int32(math.MaxInt32)
|
||||
for z := 0; z < 16; z++ {
|
||||
for x := 0; x < 16; x++ {
|
||||
|
Loading…
Reference in New Issue
Block a user