Fixed player names not displaying

This commit is contained in:
Anuken
2018-07-04 15:01:29 -04:00
parent 6ff44fddd0
commit 071d0fbbf7
3 changed files with 13 additions and 11 deletions

View File

@@ -192,10 +192,7 @@ public class Renderer extends RendererModule{
batch.setProjectionMatrix(camera.combined); batch.setProjectionMatrix(camera.combined);
if(pixelate) Graphics.surface(pixelSurface, false);
Graphics.surface(pixelSurface, false);
else
batch.begin();
drawPadding(); drawPadding();
@@ -222,6 +219,7 @@ public class Renderer extends RendererModule{
Graphics.endShaders(); Graphics.endShaders();
} }
drawAllTeams(false); drawAllTeams(false);
blocks.skipLayer(Layer.turret); blocks.skipLayer(Layer.turret);
@@ -236,18 +234,19 @@ public class Renderer extends RendererModule{
drawAndInterpolate(playerGroup, p -> true, Player::drawBuildRequests); drawAndInterpolate(playerGroup, p -> true, Player::drawBuildRequests);
overlays.drawTop(); overlays.drawTop();
if(pixelate) Graphics.flushSurface();
Graphics.flushSurface();
if(showPaths && debug) drawDebug(); if(showPaths && debug) drawDebug();
drawAndInterpolate(playerGroup, p -> !p.isLocal && !p.isDead(), Player::drawName);
batch.end(); batch.end();
if(showFog){ if(showFog){
fog.draw(); fog.draw();
} }
batch.begin();
drawAndInterpolate(playerGroup, p -> !p.isDead() && !p.isLocal, Player::drawName);
batch.end();
} }
private void drawAllTeams(boolean flying){ private void drawAllTeams(boolean flying){

View File

@@ -162,6 +162,11 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
} }
} }
@Override
public boolean isValid() {
return super.isValid() && isAdded();
}
@Override @Override
public Timer getTimer() { public Timer getTimer() {
return timer; return timer;

View File

@@ -123,14 +123,12 @@ public class FogRenderer implements Disposable{
Graphics.shader(); Graphics.shader();
Graphics.begin(); Graphics.begin();
Core.batch.draw(renderer.pixelSurface.texture(), px, py + vh, vw, -vh); Core.batch.draw(renderer.pixelSurface.texture(), px, py + vh, vw, -vh);
Graphics.end(); Graphics.end();
if(Core.batch instanceof ClipSpriteBatch){ if(Core.batch instanceof ClipSpriteBatch){
((ClipSpriteBatch) Core.batch).enableClip(true); ((ClipSpriteBatch) Core.batch).enableClip(true);
} }
} }
public Texture getTexture(){ public Texture getTexture(){