New scaling system

This commit is contained in:
Anuken
2018-11-12 17:37:25 -05:00
parent 09db6dc424
commit ab9835b896
1167 changed files with 5586 additions and 5540 deletions

View File

@@ -37,7 +37,7 @@ public class Vars{
//time between waves in frames (on normal mode)
public static final float wavespace = 60 * 60 * 1.5f;
public static final float scaling = 1f/4f;
public static float scaling;
public static final float mineTransferRange = 220f;
//set ridiculously high for now
public static final float coreBuildRange = 999999f;
@@ -51,7 +51,6 @@ public class Vars{
public static final float itemSize = 5f;
public static final int tilesize = 8;
public static final int sectorSize = 250;
public static final int mapPadding = 3;
public static final int invalidSector = Integer.MAX_VALUE;
public static Locale[] locales;
public static final Color[] playerColors = {

View File

@@ -25,6 +25,7 @@ import io.anuke.mindustry.type.Recipe;
import io.anuke.mindustry.ui.dialogs.FloatingDialog;
import io.anuke.ucore.core.*;
import io.anuke.ucore.entities.EntityQuery;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.modules.Module;
import io.anuke.ucore.util.*;
@@ -68,6 +69,8 @@ public class Control extends Module{
Core.atlas.setErrorRegion("error");
content.initialize(Content::load);
scaling = 1f / Draw.region("blank").getRegionWidth();
unlocks.load();
Sounds.setFalloff(9000f);
@@ -321,7 +324,7 @@ public class Control extends Module{
Settings.putBool("4.0-warning-2", true);
Settings.save();
}).size(100f, 60f);
dialog.content().add("Reminder: The beta version you are about to play is very unstable, and is [accent]not representative of the final 4.0 release.[]\n\n " +
dialog.content().add("Reminder: The alpha version you are about to play is very unstable, and is [accent]not representative of the final 4.0 release.[]\n\n " +
"\nThere is currently[scarlet] no sound implemented[]; this is intentional.\n" +
"All current art and UI is temporary, and will be re-drawn before release. " +
"\n\n[accent]Saves and maps may be corrupted without warning between updates.").wrap().width(400f);

View File

@@ -15,6 +15,7 @@ import io.anuke.mindustry.entities.traits.BelowLiquidTrait;
import io.anuke.mindustry.entities.units.BaseUnit;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.graphics.*;
import io.anuke.mindustry.world.blocks.defense.ForceProjector.ShieldEntity;
import io.anuke.ucore.core.Core;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Graphics;
@@ -231,13 +232,14 @@ public class Renderer extends RendererModule{
overlays.drawBottom();
drawAndInterpolate(playerGroup, p -> true, Player::drawBuildRequests);
/*
Graphics.beginShaders(Shaders.shield);
EntityDraw.draw(shieldGroup);
EntityDraw.drawWith(shieldGroup, shield -> true, shield -> ((ShieldEntity)shield).drawOver());
Draw.color(Palette.accent);
Graphics.endShaders();
Draw.color();*/
if(shieldGroup.size() > 0){
Graphics.beginShaders(Shaders.shield);
EntityDraw.draw(shieldGroup);
EntityDraw.drawWith(shieldGroup, shield -> true, shield -> ((ShieldEntity) shield).drawOver());
Draw.color(Palette.accent);
Graphics.endShaders();
Draw.color();
}
overlays.drawTop();
@@ -299,13 +301,11 @@ public class Renderer extends RendererModule{
Shaders.outline.color.set(team.color);
Shaders.mix.color.set(Color.WHITE);
//Graphics.beginShaders(Shaders.outline);
Graphics.shader(Shaders.mix, true);
drawAndInterpolate(unitGroups[team.ordinal()], u -> u.isFlying() == flying && !u.isDead(), Unit::drawAll);
drawAndInterpolate(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team, Unit::drawAll);
Graphics.shader();
blocks.drawTeamBlocks(Layer.turret, team);
// Graphics.endShaders();
drawAndInterpolate(unitGroups[team.ordinal()], u -> u.isFlying() == flying && !u.isDead(), Unit::drawOver);
drawAndInterpolate(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team, Unit::drawOver);