Don't set lighting if the preset has noLighting = true (#8519)
* Don't set lighting if the preset has noLighting = true Allows lighting in the preset or world processors to take over instead of being forced to disable lighting. * Less confusing style
This commit is contained in:
@@ -82,12 +82,11 @@ public class Universe{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(state.hasSector() && state.getSector().planet.updateLighting){
|
if(state.hasSector() && state.getSector().planet.updateLighting && !(state.getSector().preset != null && state.getSector().preset.noLighting)){
|
||||||
boolean disable = state.getSector().preset != null && state.getSector().preset.noLighting;
|
|
||||||
var planet = state.getSector().planet;
|
var planet = state.getSector().planet;
|
||||||
//update sector light
|
//update sector light
|
||||||
float light = state.getSector().getLight();
|
float light = state.getSector().getLight();
|
||||||
float alpha = disable ? 1f : Mathf.clamp(Mathf.map(light, planet.lightSrcFrom, planet.lightSrcTo, planet.lightDstFrom, planet.lightDstTo));
|
float alpha = Mathf.clamp(Mathf.map(light, planet.lightSrcFrom, planet.lightSrcTo, planet.lightDstFrom, planet.lightDstTo));
|
||||||
|
|
||||||
//assign and map so darkness is not 100% dark
|
//assign and map so darkness is not 100% dark
|
||||||
state.rules.ambientLight.a = 1f - alpha;
|
state.rules.ambientLight.a = 1f - alpha;
|
||||||
|
|||||||
Reference in New Issue
Block a user