Bloom option
This commit is contained in:
@@ -341,6 +341,7 @@ error.alreadyconnected = Already connected.
|
|||||||
error.mapnotfound = Map file not found!
|
error.mapnotfound = Map file not found!
|
||||||
error.io = Network I/O error.
|
error.io = Network I/O error.
|
||||||
error.any = Unknown network error.
|
error.any = Unknown network error.
|
||||||
|
error.bloom = Failed to initialize bloom.\nYour device may not support it.
|
||||||
|
|
||||||
zone.groundZero.name = Ground Zero
|
zone.groundZero.name = Ground Zero
|
||||||
zone.desertWastes.name = Desert Wastes
|
zone.desertWastes.name = Desert Wastes
|
||||||
@@ -485,6 +486,7 @@ setting.mutesound.name = Mute Sound
|
|||||||
setting.crashreport.name = Send Anonymous Crash Reports
|
setting.crashreport.name = Send Anonymous Crash Reports
|
||||||
setting.chatopacity.name = Chat Opacity
|
setting.chatopacity.name = Chat Opacity
|
||||||
setting.playerchat.name = Display In-Game Chat
|
setting.playerchat.name = Display In-Game Chat
|
||||||
|
setting.bloom.name = Bloom
|
||||||
keybind.title = Rebind Keys
|
keybind.title = Rebind Keys
|
||||||
category.general.name = General
|
category.general.name = General
|
||||||
category.view.name = View
|
category.view.name = View
|
||||||
|
|||||||
@@ -44,7 +44,9 @@ public class Renderer implements ApplicationListener{
|
|||||||
|
|
||||||
public Renderer(){
|
public Renderer(){
|
||||||
camera = new Camera();
|
camera = new Camera();
|
||||||
bloom = new Bloom(true);
|
if(settings.getBool("bloom")){
|
||||||
|
setupBloom();
|
||||||
|
}
|
||||||
Lines.setCircleVertices(20);
|
Lines.setCircleVertices(20);
|
||||||
Shaders.init();
|
Shaders.init();
|
||||||
|
|
||||||
@@ -132,14 +134,45 @@ public class Renderer implements ApplicationListener{
|
|||||||
minimap.dispose();
|
minimap.dispose();
|
||||||
shieldBuffer.dispose();
|
shieldBuffer.dispose();
|
||||||
blocks.dispose();
|
blocks.dispose();
|
||||||
bloom.dispose();
|
if(bloom != null){
|
||||||
|
bloom.dispose();
|
||||||
|
bloom = null;
|
||||||
|
}
|
||||||
Events.fire(new DisposeEvent());
|
Events.fire(new DisposeEvent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resize(int width, int height){
|
public void resize(int width, int height){
|
||||||
bloom.dispose();
|
if(settings.getBool("bloom")){
|
||||||
bloom = new Bloom(true);
|
setupBloom();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setupBloom(){
|
||||||
|
try{
|
||||||
|
if(bloom != null){
|
||||||
|
bloom.dispose();
|
||||||
|
}
|
||||||
|
bloom = new Bloom(true);
|
||||||
|
}catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
settings.put("bloom", false);
|
||||||
|
settings.save();
|
||||||
|
ui.showError("$error.bloom");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toggleBloom(boolean enabled){
|
||||||
|
if(enabled){
|
||||||
|
if(bloom == null){
|
||||||
|
setupBloom();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(bloom != null){
|
||||||
|
bloom.dispose();
|
||||||
|
bloom = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateShake(float scale){
|
void updateShake(float scale){
|
||||||
@@ -206,14 +239,18 @@ public class Renderer implements ApplicationListener{
|
|||||||
drawAllTeams(true);
|
drawAllTeams(true);
|
||||||
|
|
||||||
Draw.flush();
|
Draw.flush();
|
||||||
bloom.setClearColor(0f, 0f, 0f, 0f);
|
if(bloom != null && !pixelator.enabled()){
|
||||||
bloom.capture();
|
bloom.setClearColor(0f, 0f, 0f, 0f);
|
||||||
|
bloom.capture();
|
||||||
|
}
|
||||||
|
|
||||||
draw(bulletGroup);
|
draw(bulletGroup);
|
||||||
draw(effectGroup);
|
draw(effectGroup);
|
||||||
|
|
||||||
Draw.flush();
|
Draw.flush();
|
||||||
bloom.render();
|
if(bloom != null && !pixelator.enabled()){
|
||||||
|
bloom.render();
|
||||||
|
}
|
||||||
|
|
||||||
overlays.drawBottom();
|
overlays.drawBottom();
|
||||||
draw(playerGroup, p -> true, Player::drawBuildRequests);
|
draw(playerGroup, p -> true, Player::drawBuildRequests);
|
||||||
|
|||||||
@@ -218,6 +218,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
graphics.checkPref("indicators", true);
|
graphics.checkPref("indicators", true);
|
||||||
graphics.checkPref("animatedwater", false);
|
graphics.checkPref("animatedwater", false);
|
||||||
graphics.checkPref("animatedshields", !mobile);
|
graphics.checkPref("animatedshields", !mobile);
|
||||||
|
graphics.checkPref("bloom", false, val -> renderer.toggleBloom(val));
|
||||||
graphics.checkPref("lasers", true);
|
graphics.checkPref("lasers", true);
|
||||||
graphics.checkPref("pixelate", false);
|
graphics.checkPref("pixelate", false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user