From f8b554aff8f69020a98c90cabd0af312c653dadd Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 6 Mar 2020 15:30:51 -0500 Subject: [PATCH] Fixed some basic crashes --- core/assets/shaders/planet.vertex.glsl | 3 --- core/src/mindustry/content/Blocks.java | 2 +- core/src/mindustry/core/ContentLoader.java | 1 - core/src/mindustry/entities/def/TileComp.java | 6 +++--- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/core/assets/shaders/planet.vertex.glsl b/core/assets/shaders/planet.vertex.glsl index b579d9b41d..58ed7b7258 100755 --- a/core/assets/shaders/planet.vertex.glsl +++ b/core/assets/shaders/planet.vertex.glsl @@ -9,10 +9,7 @@ uniform vec3 u_ambientColor; varying vec4 v_col; -const vec3 ambientColor = vec3(1.0); const vec3 diffuse = vec3(0.2); -const vec3 v1 = vec3(1.0, 0.0, 1.0); -const vec3 v2 = vec3(1.0, 0.5, 0.0); void main(){ vec3 norc = u_ambientColor * (diffuse + vec3(clamp((dot(a_normal, u_lightdir) + 1.0) / 2.0, 0.0, 1.0))); diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 33d635cc05..dbc39105b4 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -92,7 +92,7 @@ public class Blocks implements ContentList{ hasShadow = false; } - public void draw(){} + public void drawBase(Tile tile){} public void load(){} public void init(){} public boolean isHidden(){ diff --git a/core/src/mindustry/core/ContentLoader.java b/core/src/mindustry/core/ContentLoader.java index b425eea7e4..30360315bc 100644 --- a/core/src/mindustry/core/ContentLoader.java +++ b/core/src/mindustry/core/ContentLoader.java @@ -100,7 +100,6 @@ public class ContentLoader{ /** Calls Content#load() on everything. Use only after all modules have been created on the client.*/ public void load(){ - Log.info("CALLING LOAD()"); initialize(Content::load); } diff --git a/core/src/mindustry/entities/def/TileComp.java b/core/src/mindustry/entities/def/TileComp.java index a8183ce087..fd0308b628 100644 --- a/core/src/mindustry/entities/def/TileComp.java +++ b/core/src/mindustry/entities/def/TileComp.java @@ -63,7 +63,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc{ /** Sets this tile entity data to this and adds it if necessary. */ public Tilec init(Tile tile, boolean shouldAdd){ this.tile = tile; - this.block = block(); + this.block = tile.block(); set(tile.drawx(), tile.drawy()); if(block.activeSound != Sounds.none){ @@ -186,11 +186,11 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc{ } public int rotation(){ - return rotation(); + return tile.rotation(); } public void rotation(int rotation){ - rotation(rotation); + tile.rotation(rotation); } public Floor floor(){