fix lighting
This commit is contained in:
parent
e289dc7d5b
commit
2ea8656390
4 changed files with 14 additions and 13 deletions
|
@ -40,12 +40,12 @@ public final class Moon extends Dimension {
|
|||
if(planet == null)
|
||||
return super.calcSunColor();
|
||||
Star star = UniverseRegistry.getStar(planet);
|
||||
return star == null ? super.calcSunColor() : (star.getSkyColor() | (star.isExterminated() ? 0x80000000 : 0));
|
||||
return star == null ? super.calcSunColor() : ((star.getSkyColor() & 0xffffff) | (star.isExterminated() ? 0x80000000 : 0));
|
||||
}
|
||||
|
||||
protected int[] calcMoonColors() {
|
||||
Planet planet = UniverseRegistry.getPlanet(this);
|
||||
return planet == null ? super.calcMoonColors() : new int[] {planet.getSkyColor() | (planet.isExterminated() ? 0x80000000 : 0)};
|
||||
return planet == null ? super.calcMoonColors() : new int[] {(planet.getSkyColor() & 0xffffff) | (planet.isExterminated() ? 0x80000000 : 0)};
|
||||
}
|
||||
|
||||
public boolean isBaseDestroyed() {
|
||||
|
|
|
@ -49,14 +49,14 @@ public final class Planet extends Dimension {
|
|||
|
||||
protected int calcSunColor() {
|
||||
Star star = UniverseRegistry.getStar(this);
|
||||
return star == null ? super.calcSunColor() : (star.getSkyColor() | (star.isExterminated() ? 0x80000000 : 0));
|
||||
return star == null ? super.calcSunColor() : ((star.getSkyColor() & 0xffffff) | (star.isExterminated() ? 0x80000000 : 0));
|
||||
}
|
||||
|
||||
protected int[] calcMoonColors() {
|
||||
List<Moon> moons = UniverseRegistry.getMoons(this);
|
||||
int[] colors = new int[moons.size()];
|
||||
for(int z = 0; z < colors.length; z++) {
|
||||
colors[z] = moons.get(z).getSkyColor() | (moons.get(z).isExterminated() ? 0x80000000 : 0);
|
||||
colors[z] = (moons.get(z).getSkyColor() & 0xffffff) | (moons.get(z).isExterminated() ? 0x80000000 : 0);
|
||||
}
|
||||
return colors;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue