mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-10 23:28:52 +07:00
Removed fog classes
This commit is contained in:
parent
c1a7b452e0
commit
13e5df62c9
@ -93,7 +93,6 @@ public class Vars{
|
||||
//camera zoom displayed on startup
|
||||
public static int baseCameraScale;
|
||||
public static boolean showBlockDebug = false;
|
||||
public static boolean showFog = false;
|
||||
public static boolean headless = false;
|
||||
public static float controllerMin = 0.25f;
|
||||
public static float baseControllerSpeed = 11f;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package io.anuke.mindustry.core;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Pixmap;
|
||||
@ -53,7 +52,6 @@ public class Renderer extends RendererModule{
|
||||
public final BlockRenderer blocks = new BlockRenderer();
|
||||
public final MinimapRenderer minimap = new MinimapRenderer();
|
||||
public final OverlayRenderer overlays = new OverlayRenderer();
|
||||
public final FogRenderer fog = new FogRenderer();
|
||||
|
||||
private int targetscale = baseCameraScale;
|
||||
private Rectangle rect = new Rectangle(), rect2 = new Rectangle();
|
||||
@ -249,12 +247,6 @@ public class Renderer extends RendererModule{
|
||||
|
||||
overlays.drawTop();
|
||||
|
||||
if(showFog){
|
||||
batch.end();
|
||||
fog.draw();
|
||||
batch.begin();
|
||||
}
|
||||
|
||||
batch.getTransformMatrix().idt();
|
||||
|
||||
//Graphics.beginCam();
|
||||
@ -333,11 +325,6 @@ public class Renderer extends RendererModule{
|
||||
camera.position.set(lastX, lastY, 0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose(){
|
||||
fog.dispose();
|
||||
}
|
||||
|
||||
public Vector2 averagePosition(){
|
||||
avgPosition.setZero();
|
||||
|
||||
@ -365,7 +352,6 @@ public class Renderer extends RendererModule{
|
||||
float vpW = Core.camera.viewportWidth, vpH = Core.camera.viewportHeight;
|
||||
int w = world.width()*tilesize, h = world.height()*tilesize;
|
||||
int pw = pixelSurface.width(), ph = pixelSurface.height();
|
||||
showFog = false;
|
||||
disableUI = true;
|
||||
pixelSurface.setSize(w, h, true);
|
||||
Graphics.getEffectSurface().setSize(w, h, true);
|
||||
@ -376,7 +362,6 @@ public class Renderer extends RendererModule{
|
||||
|
||||
draw();
|
||||
|
||||
showFog = true;
|
||||
disableUI = false;
|
||||
Core.camera.viewportWidth = vpW;
|
||||
Core.camera.viewportHeight = vpH;
|
||||
|
@ -165,7 +165,6 @@ public class Saves{
|
||||
|
||||
public void save(){
|
||||
long time = totalPlaytime;
|
||||
renderer.fog.writeFog();
|
||||
long prev = totalPlaytime;
|
||||
totalPlaytime = time;
|
||||
|
||||
|
@ -1,8 +1,5 @@
|
||||
package io.anuke.mindustry.ui;
|
||||
|
||||
import com.badlogic.gdx.graphics.Texture.TextureFilter;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import io.anuke.mindustry.graphics.Shaders;
|
||||
import io.anuke.ucore.core.Core;
|
||||
import io.anuke.ucore.core.Graphics;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
@ -11,7 +8,7 @@ import io.anuke.ucore.scene.event.InputEvent;
|
||||
import io.anuke.ucore.scene.event.InputListener;
|
||||
import io.anuke.ucore.scene.ui.layout.Table;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
import static io.anuke.mindustry.Vars.renderer;
|
||||
|
||||
public class Minimap extends Table{
|
||||
|
||||
@ -20,8 +17,6 @@ public class Minimap extends Table{
|
||||
|
||||
margin(5);
|
||||
|
||||
TextureRegion r = new TextureRegion();
|
||||
|
||||
Element elem = new Element(){
|
||||
@Override
|
||||
public void draw(){
|
||||
@ -32,30 +27,6 @@ public class Minimap extends Table{
|
||||
if(renderer.minimap.getTexture() != null){
|
||||
renderer.minimap.drawEntities(x, y, width, height);
|
||||
}
|
||||
|
||||
if(showFog){
|
||||
renderer.fog.getTexture().setFilter(TextureFilter.Nearest, TextureFilter.Nearest);
|
||||
|
||||
r.setRegion(renderer.minimap.getRegion());
|
||||
float pad = renderer.fog.getPadding();
|
||||
|
||||
float px = r.getU() * world.width() + pad;
|
||||
float py = r.getV() * world.height() + pad;
|
||||
float px2 = r.getU2() * world.width() + pad;
|
||||
float py2 = r.getV2() * world.height() + pad;
|
||||
|
||||
r.setTexture(renderer.fog.getTexture());
|
||||
r.setU(px / (world.width() + pad*2f));
|
||||
r.setV(1f - py / (world.height() + pad*2f));
|
||||
r.setU2(px2 / (world.width() + pad*2f));
|
||||
r.setV2(1f - py2 / (world.height() + pad*2f));
|
||||
|
||||
Graphics.shader(Shaders.fog);
|
||||
Draw.crect(r, x, y, width, height);
|
||||
Graphics.shader();
|
||||
|
||||
renderer.fog.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user