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

@ -162,7 +162,6 @@ public class AndroidLauncher extends AndroidApplication{
}, new AndroidApplicationConfiguration(){{
useImmersiveMode = true;
hideStatusBar = true;
stencil = 8;
}});
checkFiles(getIntent());

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);
});

View file

@ -36,7 +36,6 @@ public class DesktopLauncher extends ClientLauncher{
new SdlApplication(new DesktopLauncher(arg), new SdlConfig(){{
title = "Mindustry";
maximized = true;
stencil = 1;
width = 900;
height = 700;
setWindowIcon(FileType.internal, "icons/icon_64.png");

View file

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=9882706f68a954ce9d29b64cb8224cd4ec3cedc3
archash=383cca56f16c9cb00c77db681860d6f420f25b53

View file

@ -16,7 +16,6 @@ import mindustry.net.*;
import mindustry.ui.*;
import org.robovm.apple.coregraphics.*;
import org.robovm.apple.foundation.*;
import org.robovm.apple.glkit.*;
import org.robovm.apple.uikit.*;
import org.robovm.objc.block.*;
@ -25,7 +24,7 @@ import java.util.*;
import java.util.zip.*;
import static mindustry.Vars.*;
import static org.robovm.apple.foundation.NSPathUtilities.getDocumentsDirectory;
import static org.robovm.apple.foundation.NSPathUtilities.*;
//warnings for deprecated functions related to multi-window applications are not applicable here
@SuppressWarnings("deprecation")
@ -175,9 +174,7 @@ public class IOSLauncher extends IOSApplication.Delegate{
forced = false;
UINavigationController.attemptRotationToDeviceOrientation();
}
}, new IOSApplicationConfiguration(){{
stencilFormat = GLKViewDrawableStencilFormat._8;
}});
}, new IOSApplicationConfiguration());
}
@Override