mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-25 22:58:47 +07:00
Fixed bizzare planet render bugs
This commit is contained in:
parent
bd349803d3
commit
8598b0a23a
Binary file not shown.
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 367 B |
@ -862,7 +862,7 @@ public class NetServer implements ApplicationListener{
|
|||||||
|
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
int curChar = 0;
|
int curChar = 0;
|
||||||
while(curChar < name.length() && result.toString().getBytes().length < maxNameLength){
|
while(curChar < name.length() && result.toString().getBytes(Strings.utf8).length < maxNameLength){
|
||||||
result.append(name.charAt(curChar++));
|
result.append(name.charAt(curChar++));
|
||||||
}
|
}
|
||||||
return result.toString();
|
return result.toString();
|
||||||
|
@ -126,7 +126,6 @@ public class Renderer implements ApplicationListener{
|
|||||||
bloom = null;
|
bloom = null;
|
||||||
}
|
}
|
||||||
bloom = new Bloom(true);
|
bloom = new Bloom(true);
|
||||||
bloom.setClearColor(0f, 0f, 0f, 0f);
|
|
||||||
}catch(Throwable e){
|
}catch(Throwable e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
settings.put("bloom", false);
|
settings.put("bloom", false);
|
||||||
|
@ -52,7 +52,10 @@ public class PlanetDialog extends BaseDialog{
|
|||||||
private final ResourcesDialog resources = new ResourcesDialog();
|
private final ResourcesDialog resources = new ResourcesDialog();
|
||||||
|
|
||||||
private float zoom = 1f, smoothZoom = 1f, selectAlpha = 1f;
|
private float zoom = 1f, smoothZoom = 1f, selectAlpha = 1f;
|
||||||
private Bloom bloom;
|
private Bloom bloom = new Bloom(Core.graphics.getWidth()/4, Core.graphics.getHeight()/4, true, false){{
|
||||||
|
setThreshold(0.8f);
|
||||||
|
blurPasses = 6;
|
||||||
|
}};
|
||||||
private Planet planet = Planets.starter;
|
private Planet planet = Planets.starter;
|
||||||
private @Nullable Sector selected, hovered;
|
private @Nullable Sector selected, hovered;
|
||||||
private Table stable;
|
private Table stable;
|
||||||
@ -64,8 +67,6 @@ public class PlanetDialog extends BaseDialog{
|
|||||||
public PlanetDialog(){
|
public PlanetDialog(){
|
||||||
super("", Styles.fullDialog);
|
super("", Styles.fullDialog);
|
||||||
|
|
||||||
makeBloom();
|
|
||||||
|
|
||||||
Events.on(DisposeEvent.class, () -> {
|
Events.on(DisposeEvent.class, () -> {
|
||||||
skybox.dispose();
|
skybox.dispose();
|
||||||
batch.dispose();
|
batch.dispose();
|
||||||
@ -79,7 +80,7 @@ public class PlanetDialog extends BaseDialog{
|
|||||||
});
|
});
|
||||||
|
|
||||||
Events.on(ResizeEvent.class, e -> {
|
Events.on(ResizeEvent.class, e -> {
|
||||||
makeBloom();
|
bloom.resize(Core.graphics.getWidth() / 4, Core.graphics.getHeight() / 4);
|
||||||
});
|
});
|
||||||
|
|
||||||
TextButtonStyle style = Styles.cleart;
|
TextButtonStyle style = Styles.cleart;
|
||||||
@ -164,19 +165,6 @@ public class PlanetDialog extends BaseDialog{
|
|||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void makeBloom(){
|
|
||||||
if(bloom != null){
|
|
||||||
bloom.dispose();
|
|
||||||
bloom = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
bloom = new Bloom(Core.graphics.getWidth()/4, Core.graphics.getHeight()/4, true, false, true){{
|
|
||||||
setClearColor(0, 0, 0, 0);
|
|
||||||
setThreshold(0.8f);
|
|
||||||
blurPasses = 6;
|
|
||||||
}};
|
|
||||||
}
|
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
cont.clear();
|
cont.clear();
|
||||||
titleTable.remove();
|
titleTable.remove();
|
||||||
@ -188,6 +176,7 @@ public class PlanetDialog extends BaseDialog{
|
|||||||
Draw.flush();
|
Draw.flush();
|
||||||
Gl.clear(Gl.depthBufferBit);
|
Gl.clear(Gl.depthBufferBit);
|
||||||
Gl.enable(Gl.depthTest);
|
Gl.enable(Gl.depthTest);
|
||||||
|
Gl.depthMask(true);
|
||||||
|
|
||||||
Gl.enable(Gl.cullFace);
|
Gl.enable(Gl.cullFace);
|
||||||
Gl.cullFace(Gl.back);
|
Gl.cullFace(Gl.back);
|
||||||
@ -438,18 +427,25 @@ public class PlanetDialog extends BaseDialog{
|
|||||||
|
|
||||||
//stored resources
|
//stored resources
|
||||||
if(selected.hasBase() && selected.save.meta.secinfo.coreItems.size > 0){
|
if(selected.hasBase() && selected.save.meta.secinfo.coreItems.size > 0){
|
||||||
stable.add("Stored Resources:").row();
|
stable.add("Stored:").row();
|
||||||
stable.table(t -> {
|
stable.table(t -> {
|
||||||
t.left();
|
t.left();
|
||||||
|
|
||||||
|
t.table(res -> {
|
||||||
|
int i = 0;
|
||||||
for(Item item : content.items()){
|
for(Item item : content.items()){
|
||||||
int amount = selected.save.meta.secinfo.coreItems.get(item);
|
int amount = selected.save.meta.secinfo.coreItems.get(item);
|
||||||
if(amount > 0){
|
if(amount > 0){
|
||||||
t.image(item.icon(Cicon.small)).padRight(3);
|
res.image(item.icon(Cicon.small)).padRight(3);
|
||||||
t.add(ui.formatAmount(amount)).color(Color.lightGray);
|
res.add(ui.formatAmount(amount)).color(Color.lightGray);
|
||||||
t.row();
|
if(++i % 2 == 0){
|
||||||
|
res.row();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}).row();
|
}).row();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user