Fixed green line bug - Removed stencil+depth buffers

This commit is contained in:
Anuken
2021-02-16 13:02:15 -05:00
parent fdd1c01ac3
commit b0082c92c5
7 changed files with 22 additions and 29 deletions

View File

@@ -67,7 +67,6 @@ public class Renderer implements ApplicationListener{
@Override
public void update(){
Color.white.set(1f, 1f, 1f, 1f);
Gl.clear(Gl.stencilBufferBit);
float dest = Mathf.round(targetscale, 0.5f);
camerascale = Mathf.lerpDelta(camerascale, dest, 0.1f);

View File

@@ -637,20 +637,11 @@ public class HudFragment extends Fragment{
if(Float.isNaN(value) || Float.isInfinite(value)) value = 1f;
drawInner(Pal.darkishGray);
Draw.beginStencil();
Fill.crect(x, y, width, height * value);
Draw.beginStenciled();
drawInner(Tmp.c1.set(color).lerp(Color.white, blink));
Draw.endStencil();
drawInner(Pal.darkishGray, 1f);
drawInner(Tmp.c1.set(color).lerp(Color.white, blink), value);
}
void drawInner(Color color){
void drawInner(Color color, float fract){
if(flip){
x += width;
width = -width;
@@ -660,19 +651,26 @@ public class HudFragment extends Fragment{
float bh = height/2f;
Draw.color(color);
float f1 = Math.min(fract * 2f, 1f), f2 = (fract - 0.5f) * 2f;
float bo = -(1f - f1) * (width - stroke);
Fill.quad(
x, y,
x + stroke, y,
x + width, y + bh,
x + width - stroke, y + bh
x + width + bo, y + bh * f1,
x + width - stroke + bo, y + bh * f1
);
Fill.quad(
x + width, y + bh,
x + width - stroke, y + bh,
x, y + height,
x + stroke, y + height
);
if(f2 > 0){
float bx = x + (width - stroke) * (1f - f2);
Fill.quad(
x + width, y + bh,
x + width - stroke, y + bh,
bx, y + height * fract,
bx + stroke, y + height * fract
);
}
Draw.reset();

View File

@@ -145,6 +145,7 @@ public class PowerNode extends PowerBlock{
getPotentialLinks(tile, other -> {
Drawf.square(other.x, other.y, other.block.size * tilesize / 2f + 2f, Pal.place);
insulators(tile.x, tile.y, other.tileX(), other.tileY(), cause -> {
Drawf.square(cause.x, cause.y, cause.block.size * tilesize / 2f + 2f, Pal.plastanium);
});