This commit is contained in:
Anuken
2021-06-20 09:50:25 -04:00
parent 5d74795c02
commit 448d1e2c77
27 changed files with 63 additions and 84 deletions

View File

@@ -39,7 +39,7 @@ public class Blocks implements ContentList{
dacite, rhyolite, rhyoliteCrater, regolith, yellowStone, redIce, dacite, rhyolite, rhyoliteCrater, regolith, yellowStone, redIce,
redmat, bluemat, redmat, bluemat,
stoneWall, dirtWall, sporeWall, iceWall, daciteWall, sporePine, snowPine, pine, shrubs, whiteTree, whiteTreeDead, sporeCluster, stoneWall, dirtWall, sporeWall, iceWall, daciteWall, sporePine, snowPine, pine, shrubs, whiteTree, whiteTreeDead, sporeCluster,
redweed, purbush, coralChunk, glowBlob, yellowCoral, redweed, purbush, coralChunk, yellowCoral,
regolithWall, yellowStoneWall, rhyoliteWall, carbonWall, redIceWall, ferricStoneWall, regolithWall, yellowStoneWall, rhyoliteWall, carbonWall, redIceWall, ferricStoneWall,
ferricStone, ferricCraters, graphiticStone, ferricStone, ferricCraters, graphiticStone,
iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, shaleBoulder, sandBoulder, daciteBoulder, boulder, snowBoulder, basaltBoulder, grass, salt, iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, shaleBoulder, sandBoulder, daciteBoulder, boulder, snowBoulder, basaltBoulder, grass, salt,
@@ -451,10 +451,6 @@ public class Blocks implements ContentList{
}}; }};
//glowBlob = new Prop("glowblob"){{
// variants = 1;
//}};
boulder = new Prop("boulder"){{ boulder = new Prop("boulder"){{
variants = 2; variants = 2;
stone.asFloor().decoration = this; stone.asFloor().decoration = this;

View File

@@ -3,7 +3,6 @@ package mindustry.editor;
import arc.*; import arc.*;
import arc.scene.ui.*; import arc.scene.ui.*;
import arc.struct.*; import arc.struct.*;
import arc.util.*;
import mindustry.*; import mindustry.*;
import mindustry.game.*; import mindustry.game.*;
import mindustry.io.*; import mindustry.io.*;

View File

@@ -14,7 +14,6 @@ import mindustry.gen.*;
import mindustry.graphics.*; import mindustry.graphics.*;
import mindustry.io.*; import mindustry.io.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.ui.*;
import mindustry.ui.dialogs.*; import mindustry.ui.dialogs.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;

View File

@@ -10,7 +10,6 @@ import mindustry.entities.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.graphics.*; import mindustry.graphics.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.ui.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;

View File

@@ -20,7 +20,6 @@ import mindustry.type.*;
import mindustry.world.*; import mindustry.world.*;
import mindustry.world.blocks.*; import mindustry.world.blocks.*;
import mindustry.world.blocks.ConstructBlock.*; import mindustry.world.blocks.ConstructBlock.*;
import mindustry.world.blocks.storage.CoreBlock.*;
import java.util.*; import java.util.*;

View File

@@ -1,6 +1,5 @@
package mindustry.entities.comp; package mindustry.entities.comp;
import arc.func.*;
import arc.util.io.*; import arc.util.io.*;
import mindustry.annotations.Annotations.*; import mindustry.annotations.Annotations.*;
import mindustry.entities.*; import mindustry.entities.*;

View File

@@ -7,7 +7,6 @@ import mindustry.annotations.Annotations.*;
import mindustry.content.*; import mindustry.content.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.graphics.*; import mindustry.graphics.*;
import mindustry.ui.*;
import mindustry.world.*; import mindustry.world.*;
@EntityDef(value = LaunchCorec.class, serialize = false) @EntityDef(value = LaunchCorec.class, serialize = false)

View File

@@ -13,7 +13,6 @@ import mindustry.entities.*;
import mindustry.game.EventType.*; import mindustry.game.EventType.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.ui.*;
import mindustry.world.*; import mindustry.world.*;
import mindustry.world.blocks.payloads.*; import mindustry.world.blocks.payloads.*;

View File

@@ -10,27 +10,29 @@ public class IndexedRenderer implements Disposable{
private static final int vsize = 5; private static final int vsize = 5;
private final Shader program = new Shader( private final Shader program = new Shader(
"attribute vec4 a_position;\n" + """
"attribute vec4 a_color;\n" + attribute vec4 a_position;
"attribute vec2 a_texCoord0;\n" + attribute vec4 a_color;
"uniform mat4 u_projTrans;\n" + attribute vec2 a_texCoord0;
"varying vec4 v_color;\n" + uniform mat4 u_projTrans;
"varying vec2 v_texCoords;\n" + varying vec4 v_color;
varying vec2 v_texCoords;
void main(){
v_color = a_color;
v_color.a = v_color.a * (255.0/254.0);
v_texCoords = a_texCoord0;
gl_Position = u_projTrans * a_position;
}
""",
"void main(){\n" + """
" v_color = a_color;\n" + varying lowp vec4 v_color;
" v_color.a = v_color.a * (255.0/254.0);\n" + varying vec2 v_texCoords;
" v_texCoords = a_texCoord0;\n" + uniform sampler2D u_texture;
" gl_Position = u_projTrans * a_position;\n" + void main(){
"}", gl_FragColor = v_color * texture2D(u_texture, v_texCoords);
}
"varying lowp vec4 v_color;\n" + """
"varying vec2 v_texCoords;\n" +
"uniform sampler2D u_texture;\n" +
"void main(){\n" +
" gl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n" +
"}"
); );
private Mesh mesh; private Mesh mesh;
private float[] tmpVerts = new float[vsize * 6]; private float[] tmpVerts = new float[vsize * 6];

View File

@@ -396,7 +396,7 @@ public class Voronoi{
private void clipLine(Edge e){ private void clipLine(Edge e){
float pxmin, pxmax, pymin, pymax; float pxmin, pxmax, pymin, pymax;
Site s1, s2; Site s1, s2;
float x1 = 0, x2 = 0, y1 = 0, y2 = 0; float x1, x2, y1, y2;
x1 = e.reg[0].coord.x; x1 = e.reg[0].coord.x;
x2 = e.reg[1].coord.x; x2 = e.reg[1].coord.x;

View File

@@ -14,7 +14,7 @@ public class NoiseMesh extends HexMesh{
this.mesh = MeshBuilder.buildHex(new HexMesher(){ this.mesh = MeshBuilder.buildHex(new HexMesher(){
@Override @Override
public float getHeight(Vec3 position){ public float getHeight(Vec3 position){
return (float)Simplex.noise3d(planet.id + seed, octaves, persistence, scale, 5f + position.x, 5f + position.y, 5f + position.z) * mag; return Simplex.noise3d(planet.id + seed, octaves, persistence, scale, 5f + position.x, 5f + position.y, 5f + position.z) * mag;
} }
@Override @Override

View File

@@ -4,7 +4,6 @@ import arc.*;
import arc.math.geom.*; import arc.math.geom.*;
import arc.struct.*; import arc.struct.*;
import arc.util.*; import arc.util.*;
import arc.util.noise.*;
import mindustry.*; import mindustry.*;
import mindustry.ai.types.*; import mindustry.ai.types.*;
import mindustry.content.*; import mindustry.content.*;

View File

@@ -115,7 +115,7 @@ public abstract class PlanetGenerator extends BasicGenerator implements HexMeshe
@Override @Override
protected float noise(float x, float y, double octaves, double falloff, double scl, double mag){ protected float noise(float x, float y, double octaves, double falloff, double scl, double mag){
Vec3 v = sector.rect.project(x, y); Vec3 v = sector.rect.project(x, y);
return (float)Simplex.noise3d(0, octaves, falloff, 1f / scl, v.x, v.y, v.z) * (float)mag; return Simplex.noise3d(0, octaves, falloff, 1f / scl, v.x, v.y, v.z) * (float)mag;
} }
/** @return the scaling factor for sector rects. */ /** @return the scaling factor for sector rects. */

View File

@@ -48,11 +48,11 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
} }
float rawHeight(Vec3 position){ float rawHeight(Vec3 position){
return (float)Simplex.noise3d(seed, octaves, persistence, 1f/heightScl, 10f + position.x, 10f + position.y, 10f + position.z); return Simplex.noise3d(seed, octaves, persistence, 1f/heightScl, 10f + position.x, 10f + position.y, 10f + position.z);
} }
float rawTemp(Vec3 position){ float rawTemp(Vec3 position){
return position.dst(0, 0, 1)*2.2f - (float)Simplex.noise3d(seed, 8, 0.54f, 1.4f, 10f + position.x, 10f + position.y, 10f + position.z) * 2.9f; return position.dst(0, 0, 1)*2.2f - Simplex.noise3d(seed, 8, 0.54f, 1.4f, 10f + position.x, 10f + position.y, 10f + position.z) * 2.9f;
} }
Block getBlock(Vec3 position){ Block getBlock(Vec3 position){
@@ -61,7 +61,7 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
float height = rawHeight(position); float height = rawHeight(position);
Tmp.v31.set(position); Tmp.v31.set(position);
position = Tmp.v33.set(position).scl(scl); position = Tmp.v33.set(position).scl(scl);
float temp = (float)Simplex.noise3d(seed, 8, 0.6, 1f/2f, 10f + position.x, 10f + position.y + 99f, 10f + position.z); float temp = Simplex.noise3d(seed, 8, 0.6, 1f/2f, 10f + position.x, 10f + position.y + 99f, 10f + position.z);
height *= 1.2f; height *= 1.2f;
height = Mathf.clamp(height); height = Mathf.clamp(height);

View File

@@ -57,7 +57,7 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
float rawHeight(Vec3 position){ float rawHeight(Vec3 position){
position = Tmp.v33.set(position).scl(scl); position = Tmp.v33.set(position).scl(scl);
return (Mathf.pow((float)Simplex.noise3d(seed, 7, 0.5f, 1f/3f, position.x, position.y, position.z), 2.3f) + waterOffset) / (1f + waterOffset); return (Mathf.pow(Simplex.noise3d(seed, 7, 0.5f, 1f/3f, position.x, position.y, position.z), 2.3f) + waterOffset) / (1f + waterOffset);
} }
@Override @Override
@@ -127,12 +127,12 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
position = Tmp.v33.set(position).scl(scl); position = Tmp.v33.set(position).scl(scl);
float rad = scl; float rad = scl;
float temp = Mathf.clamp(Math.abs(position.y * 2f) / (rad)); float temp = Mathf.clamp(Math.abs(position.y * 2f) / (rad));
float tnoise = (float)Simplex.noise3d(seed, 7, 0.56, 1f/3f, position.x, position.y + 999f, position.z); float tnoise = Simplex.noise3d(seed, 7, 0.56, 1f/3f, position.x, position.y + 999f, position.z);
temp = Mathf.lerp(temp, tnoise, 0.5f); temp = Mathf.lerp(temp, tnoise, 0.5f);
height *= 1.2f; height *= 1.2f;
height = Mathf.clamp(height); height = Mathf.clamp(height);
float tar = (float)Simplex.noise3d(seed, 4, 0.55f, 1f/2f, position.x, position.y + 999f, position.z) * 0.3f + Tmp.v31.dst(0, 0, 1f) * 0.2f; float tar = Simplex.noise3d(seed, 4, 0.55f, 1f/2f, position.x, position.y + 999f, position.z) * 0.3f + Tmp.v31.dst(0, 0, 1f) * 0.2f;
Block res = arr[Mathf.clamp((int)(temp * arr.length), 0, arr[0].length - 1)][Mathf.clamp((int)(height * arr[0].length), 0, arr[0].length - 1)]; Block res = arr[Mathf.clamp((int)(temp * arr.length), 0, arr[0].length - 1)][Mathf.clamp((int)(height * arr[0].length), 0, arr[0].length - 1)];
if(tar > 0.5f){ if(tar > 0.5f){
@@ -145,7 +145,7 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
@Override @Override
protected float noise(float x, float y, double octaves, double falloff, double scl, double mag){ protected float noise(float x, float y, double octaves, double falloff, double scl, double mag){
Vec3 v = sector.rect.project(x, y).scl(5f); Vec3 v = sector.rect.project(x, y).scl(5f);
return (float)Simplex.noise3d(seed, octaves, falloff, 1f / scl, v.x, v.y, v.z) * (float)mag; return Simplex.noise3d(seed, octaves, falloff, 1f / scl, v.x, v.y, v.z) * (float)mag;
} }
@Override @Override

View File

@@ -36,7 +36,7 @@ public class TantrosPlanetGenerator extends PlanetGenerator{
@Override @Override
public Color getColor(Vec3 position){ public Color getColor(Vec3 position){
float depth = (float)Simplex.noise3d(seed, 2, 0.56, 1.7f, position.x, position.y, position.z) / 2f; float depth = Simplex.noise3d(seed, 2, 0.56, 1.7f, position.x, position.y, position.z) / 2f;
return c1.write(out).lerp(c2, Mathf.clamp(Mathf.round(depth, 0.15f))).a(0.6f); return c1.write(out).lerp(c2, Mathf.clamp(Mathf.round(depth, 0.15f))).a(0.6f);
} }
@@ -91,14 +91,14 @@ public class TantrosPlanetGenerator extends PlanetGenerator{
} }
float rawHeight(Vec3 position){ float rawHeight(Vec3 position){
return (float)Simplex.noise3d(seed, 8, 0.7f, 1f, position.x, position.y, position.z); return Simplex.noise3d(seed, 8, 0.7f, 1f, position.x, position.y, position.z);
} }
Block getBlock(Vec3 position){ Block getBlock(Vec3 position){
float height = rawHeight(position); float height = rawHeight(position);
Tmp.v31.set(position); Tmp.v31.set(position);
position = Tmp.v33.set(position).scl(2f); position = Tmp.v33.set(position).scl(2f);
float temp = (float)Simplex.noise3d(seed, 8, 0.6, 1f/2f, position.x, position.y + 99f, position.z); float temp = Simplex.noise3d(seed, 8, 0.6, 1f/2f, position.x, position.y + 99f, position.z);
height *= 1.2f; height *= 1.2f;
height = Mathf.clamp(height); height = Mathf.clamp(height);

View File

@@ -7,7 +7,6 @@ import arc.assets.loaders.SoundLoader.*;
import arc.audio.*; import arc.audio.*;
import arc.files.*; import arc.files.*;
import arc.func.*; import arc.func.*;
import arc.struct.*;
import arc.util.*; import arc.util.*;
import arc.util.Log.*; import arc.util.Log.*;
import mindustry.*; import mindustry.*;
@@ -18,7 +17,6 @@ import rhino.module.provider.*;
import java.io.*; import java.io.*;
import java.net.*; import java.net.*;
import java.util.*;
import java.util.regex.*; import java.util.regex.*;
public class Scripts implements Disposable{ public class Scripts implements Disposable{

View File

@@ -26,7 +26,7 @@ public class Weapon implements Cloneable{
static int sequenceNum = 0; static int sequenceNum = 0;
/** displayed weapon region */ /** displayed weapon region */
public String name = ""; public String name;
/** bullet shot */ /** bullet shot */
public BulletType bullet = Bullets.standardCopper; public BulletType bullet = Bullets.standardCopper;
/** shell ejection effect */ /** shell ejection effect */

View File

@@ -56,17 +56,27 @@ public class Links{
private static String report(){ private static String report(){
return "https://github.com/Anuken/Mindustry/issues/new?assignees=&labels=bug&body=" + return "https://github.com/Anuken/Mindustry/issues/new?assignees=&labels=bug&body=" +
Strings.encode(Strings.format( Strings.encode(Strings.format(
"**Platform**: `@`\n" + """
"\n**Build**: `@`\n" + **Platform**: `@`
"\n**Issue**: *Explain your issue in detail.*\n" +
"\n**Steps to reproduce**: *How you happened across the issue, and what exactly you did to make the bug happen.*\n" + **Build**: `@`
"\n**Link(s) to mod(s) used**: `@`\n" +
"\n**Save file**: *The (zipped) save file you were playing on when the bug happened. THIS IS REQUIRED FOR ANY ISSUE HAPPENING IN-GAME, REGARDLESS OF WHETHER YOU THINK IT HAPPENS EVERYWHERE. DO NOT DELETE OR OMIT THIS LINE UNLESS YOU ARE SURE THAT THE ISSUE DOES NOT HAPPEN IN-GAME.*\n" + **Issue**: *Explain your issue in detail.*
"\n**Crash report**: *The contents of relevant crash report files. REQUIRED if you are reporting a crash.*\n" +
"\n---\n" + **Steps to reproduce**: *How you happened across the issue, and what exactly you did to make the bug happen.*
"\n*Place an X (no spaces) between the brackets to confirm that you have read the line below.*" +
"\n- [ ] **I have updated to the latest release (https://github.com/Anuken/Mindustry/releases) to make sure my issue has not been fixed.**" + **Link(s) to mod(s) used**: `@`
"\n- [ ] **I have searched the closed and open issues to make sure that this problem has not already been reported.**",
**Save file**: *The (zipped) save file you were playing on when the bug happened. THIS IS REQUIRED FOR ANY ISSUE HAPPENING IN-GAME, REGARDLESS OF WHETHER YOU THINK IT HAPPENS EVERYWHERE. DO NOT DELETE OR OMIT THIS LINE UNLESS YOU ARE SURE THAT THE ISSUE DOES NOT HAPPEN IN-GAME.*
**Crash report**: *The contents of relevant crash report files. REQUIRED if you are reporting a crash.*
---
*Place an X (no spaces) between the brackets to confirm that you have read the line below.*
- [ ] **I have updated to the latest release (https://github.com/Anuken/Mindustry/releases) to make sure my issue has not been fixed.**
- [ ] **I have searched the closed and open issues to make sure that this problem has not already been reported.**
""",
OS.isAndroid ? "Android " + Core.app.getVersion() : (System.getProperty("os.name") + (OS.is64Bit ? " x64" : " x32")), OS.isAndroid ? "Android " + Core.app.getVersion() : (System.getProperty("os.name") + (OS.is64Bit ? " x64" : " x32")),
Version.combined(), Version.combined(),
Vars.mods.list().any() ? Vars.mods.list().select(LoadedMod::enabled).map(l -> l.meta.author + "/" + l.name + ":" + l.meta.version) : "none")); Vars.mods.list().any() ? Vars.mods.list().select(LoadedMod::enabled).map(l -> l.meta.author + "/" + l.name + ":" + l.meta.version) : "none"));

View File

@@ -212,7 +212,7 @@ public class CustomRulesDialog extends BaseDialog{
main.table(t -> { main.table(t -> {
t.left(); t.left();
t.add(text).left().padRight(5); t.add(text).left().padRight(5);
t.field((integer ? (int)prov.get() : prov.get()) + "", s -> cons.get(Strings.parseInt(s))) t.field((integer ? prov.get() : prov.get()) + "", s -> cons.get(Strings.parseInt(s)))
.padRight(100f) .padRight(100f)
.valid(f -> Strings.parseInt(f) >= min && Strings.parseInt(f) <= max).width(120f).left().addInputDialog(); .valid(f -> Strings.parseInt(f) >= min && Strings.parseInt(f) <= max).width(120f).left().addInputDialog();
}).padTop(0); }).padTop(0);

View File

@@ -497,7 +497,7 @@ public class JoinDialog extends BaseDialog{
void safeConnect(String ip, int port, int version){ void safeConnect(String ip, int port, int version){
if(version != Version.build && Version.build != -1 && version != -1){ if(version != Version.build && Version.build != -1 && version != -1){
ui.showInfo("[scarlet]" + (version > Version.build ? KickReason.clientOutdated : KickReason.serverOutdated).toString() + "\n[]" + ui.showInfo("[scarlet]" + (version > Version.build ? KickReason.clientOutdated : KickReason.serverOutdated) + "\n[]" +
Core.bundle.format("server.versions", Version.build, version)); Core.bundle.format("server.versions", Version.build, version));
}else{ }else{
connect(ip, port); connect(ip, port);

View File

@@ -97,7 +97,7 @@ public class MapPlayDialog extends BaseDialog{
table.row(); table.row();
for(Gamemode mode : Gamemode.values()){ for(Gamemode mode : Gamemode.values()){
if(mode.hidden) continue; if(mode.hidden) continue;
table.labelWrap("[accent]" + mode.toString() + ":[] [lightgray]" + mode.description()).width(400f); table.labelWrap("[accent]" + mode + ":[] [lightgray]" + mode.description()).width(400f);
table.row(); table.row();
} }

View File

@@ -417,23 +417,7 @@ public class SchematicsDialog extends BaseDialog{
int cols = (int)Math.min(20, Core.graphics.getWidth() / 52f); int cols = (int)Math.min(20, Core.graphics.getWidth() / 52f);
/* int i;
int i = 0;
for(var key : defaultIcons){
var value = Icon.icons.get(key);
t.button(value, Styles.cleari, () -> {
sector.info.icon = key;
sector.info.contentIcon = null;
sector.saveInfo();
hide();
updateSelected();
}).checked(key.equals(sector.info.icon));
if(++i % cols == 0) t.row();
}*/
int i = 0;
for(ContentType ctype : defaultContentIcons){ for(ContentType ctype : defaultContentIcons){
t.row(); t.row();

View File

@@ -14,7 +14,6 @@ import mindustry.gen.*;
import mindustry.graphics.*; import mindustry.graphics.*;
import mindustry.input.*; import mindustry.input.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.ui.*;
import mindustry.world.*; import mindustry.world.*;
import mindustry.world.blocks.*; import mindustry.world.blocks.*;
import mindustry.world.meta.*; import mindustry.world.meta.*;

View File

@@ -18,7 +18,6 @@ import mindustry.type.*;
import mindustry.world.*; import mindustry.world.*;
import mindustry.world.blocks.*; import mindustry.world.blocks.*;
import mindustry.world.blocks.distribution.*; import mindustry.world.blocks.distribution.*;
import mindustry.world.meta.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;

View File

@@ -6,7 +6,6 @@ import arc.scene.ui.layout.*;
import arc.util.*; import arc.util.*;
import arc.util.io.*; import arc.util.io.*;
import mindustry.*; import mindustry.*;
import mindustry.ui.*;
import mindustry.world.*; import mindustry.world.*;
import mindustry.world.blocks.*; import mindustry.world.blocks.*;
import mindustry.world.meta.*; import mindustry.world.meta.*;

View File

@@ -10,4 +10,4 @@ kapt.include.compile.classpath=false
kotlin.stdlib.default.dependency=false kotlin.stdlib.default.dependency=false
#needed for android compilation #needed for android compilation
android.useAndroidX=true android.useAndroidX=true
archash=f9bf8552f839d87fa561adafa3085d83a044be9f archash=3de7a709fa1c0ba8cb0131f0fc6b02524e18016b