Handle negative Y in topo shader
This commit is contained in:
parent
d11f254a52
commit
149f84eaf6
1 changed files with 5 additions and 3 deletions
|
|
@ -202,10 +202,12 @@ public class TopoHDShader implements HDShader {
|
||||||
if (isHidden(blocktype)) {
|
if (isHidden(blocktype)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
int y = mapiter.getY();
|
||||||
|
if (y < 0) y = 0; // Clamp at zero for now
|
||||||
/* See if we're close to an edge */
|
/* See if we're close to an edge */
|
||||||
int[] xyz = ps.getSubblockCoord();
|
int[] xyz = ps.getSubblockCoord();
|
||||||
// Only color lines when spacing is matched
|
// Only color lines when spacing is matched
|
||||||
Color lcolor = ((ps.getMapIterator().getY() % linespacing) == 0)?linecolor:null;
|
Color lcolor = ((y % linespacing) == 0)?linecolor:null;
|
||||||
|
|
||||||
/* See which face we're on (only do lines on top face) */
|
/* See which face we're on (only do lines on top face) */
|
||||||
switch(ps.getLastBlockStep()) {
|
switch(ps.getLastBlockStep()) {
|
||||||
|
|
@ -229,7 +231,7 @@ public class TopoHDShader implements HDShader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
c.setColor(fillcolor[mapiter.getY() >> heightshift]);
|
c.setColor(fillcolor[y >> heightshift]);
|
||||||
inWater = false;
|
inWater = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -248,7 +250,7 @@ public class TopoHDShader implements HDShader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
c.setColor(fillcolor[mapiter.getY() >> heightshift]);
|
c.setColor(fillcolor[y >> heightshift]);
|
||||||
inWater = false;
|
inWater = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue