Minor tweaks

This commit is contained in:
Anuken
2022-02-18 15:04:48 -05:00
parent 396afb5144
commit f9c0065a99
4 changed files with 14 additions and 9 deletions

View File

@@ -11,12 +11,12 @@ import arc.util.*;
import mindustry.game.EventType.*;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.world.*;
import static mindustry.Vars.*;
/** Highly experimental fog-of-war renderer. */
public class FogRenderer{
private static final float fogSpeed = 1f;
private FrameBuffer buffer = new FrameBuffer();
private LongSeq events = new LongSeq();
private Rect rect = new Rect();
@@ -27,9 +27,6 @@ public class FogRenderer{
lastTeam = null;
events.clear();
});
//TODO draw fog when tile is placed?
}
public void handleEvent(long event){
@@ -72,7 +69,13 @@ public class FogRenderer{
//process new fog events
for(int i = 0; i < events.size; i++){
long e = events.items[i];
Fill.poly(FogEvent.x(e) + 0.5f, FogEvent.y(e) + 0.5f, 20, FogEvent.radius(e) + 0.3f);
Tile tile = world.tile(FogEvent.x(e), FogEvent.y(e));
float o = 0f;
//visual offset for uneven blocks; this is not reflected on the CPU, but it doesn't really matter
if(tile != null && tile.block().size % 2 == 0 && tile.isCenter()){
o = 0.5f;
}
Fill.poly(FogEvent.x(e) + 0.5f + o, FogEvent.y(e) + 0.5f + o, 20, FogEvent.radius(e) + 0.3f);
}
events.clear();