48 glowBounce =
new FaderUtil(0f, 0.1f + (
float) Math.random() * 0.1f, 0.1f + (
float) Math.random() * 0.1f);
60 float sizeRangeMult = 0.5f + 0.5f *
field.
params.density;
67 float w =
sprite.getWidth();
68 float h =
sprite.getHeight();
73 float cellX = (int) (Math.random() * cols);
74 float cellY = (int) (Math.random() * rows);
76 float ctw =
sprite.getTextureWidth() / (float) cols;
77 float cth =
sprite.getTextureHeight() / (float) rows;
79 sprite.setTexX(cellX * ctw);
80 sprite.setTexY(cellY * cth);
84 glow.setTexX(cellX * ctw);
85 glow.setTexY(cellY * cth);
86 glow.setTexWidth(ctw);
87 glow.setTexHeight(cth);
100 facing = (float) Math.random() * 360f;
101 angVel = (float) Math.random() * 360f - 180f;
103 float spawnRadius = field.params.bandWidthInEngine *
field.
getExpander().getBrightness();
106 float r = (float) Math.random();
107 r = (float) Math.sqrt(r);
108 float dist = r * spawnRadius;
110 loc = Misc.getUnitVectorAtDegreeAngle((
float)Math.random() * 360f);
113 vel = Misc.getUnitVectorAtDegreeAngle((
float)Math.random() * 360f);
117 vel.x += off - (float) Math.random() * 0.5f * off;
118 vel.y += off - (float) Math.random() * 0.5f * off;
119 if ((
float) Math.random() > 0.5f) {
124 float speed = 20f + (float) Math.random() * 100f;
127 timeLeft = 1f + (float) Math.random();
136 if (alphaMult <= 0)
return;
139 SectorEntityToken lightSource = entity.getLightSource();
140 if (lightSource !=
null && entity.getLightColor() !=
null) {
141 sprite.setColor(entity.getLightColor());
143 sprite.setColor(Color.white);
148 sprite.setAlphaMult(alphaMult *
fader.getBrightness());
151 if (lightSource !=
null && !entity.getLightSource().hasTag(Tags.AMBIENT_LS)) {
156 GL11.glColorMask(
false,
false,
false,
true);
158 GL11.glTranslatef(
loc.x,
loc.y, 0);
159 Misc.renderQuadAlpha(0 - w/2f - 1f, 0 - h/2f - 1f, w + 2f, h + 2f, Misc.zeroColor, 0f);
161 sprite.setBlendFunc(GL11.GL_ONE, GL11.GL_ZERO);
164 float lightDir = Misc.getAngleInDegreesStrict(
field.
getEntity().getLocation(), lightSource.getLocation());
167 shadowMask.setBlendFunc(GL11.GL_ZERO, GL11.GL_SRC_ALPHA);
170 GL11.glColorMask(
true,
true,
true,
false);
171 shadowMask.setBlendFunc(GL11.GL_DST_ALPHA, GL11.GL_ONE_MINUS_DST_ALPHA);
178 glow.setAdditiveBlend();
179 glow.setAlphaMult(alphaMult *
fader.getBrightness() *
190 alphaMult *=
fader.getBrightness();
192 if (alphaMult <= 0)
return;
197 GL11.glTranslatef(
loc.x,
loc.y, 0);
199 GL11.glDisable(GL11.GL_TEXTURE_2D);
200 GL11.glEnable(GL11.GL_LINE_SMOOTH);
201 GL11.glHint(GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST);
203 float thickness = 1.5f;
204 GL11.glLineWidth(thickness);
206 GL11.glEnable(GL11.GL_BLEND);
208 GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
211 Color color =
Global.
getSector().getFaction(Factions.NEUTRAL).getBaseUIColor();
217 float size =
width + 5f;
218 float half = size * 0.5f;
219 float corner = size * 0.25f;
228 }
else if (
indFader.isFadingIn() && f < 0.4f) {
229 float p = (f - 0.1f) / (0.4f - 0.1f);
230 glow = (float) (Math.sin(p * (
float) Math.PI * 6f - (float) Math.PI) + 1f) / 2f;
239 for (
int i = 0; i < 2; i++) {
241 GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
244 if (b <= 0)
continue;
246 GL11.glBegin(GL11.GL_LINE_STRIP);
247 Misc.setColor(color, b);
248 GL11.glVertex2f(x - half, y + half - corner);
249 GL11.glVertex2f(x - half, y + half);
250 GL11.glVertex2f(x - half + corner, y + half);
253 GL11.glBegin(GL11.GL_LINE_STRIP);
254 Misc.setColor(color, b);
255 GL11.glVertex2f(x + half, y + half - corner);
256 GL11.glVertex2f(x + half, y + half);
257 GL11.glVertex2f(x + half - corner, y + half);
260 GL11.glBegin(GL11.GL_LINE_STRIP);
261 Misc.setColor(color, b);
262 GL11.glVertex2f(x - half, y - half + corner);
263 GL11.glVertex2f(x - half, y - half);
264 GL11.glVertex2f(x - half + corner, y - half);
267 GL11.glBegin(GL11.GL_LINE_STRIP);
268 Misc.setColor(color, b);
269 GL11.glVertex2f(x + half, y - half + corner);
270 GL11.glVertex2f(x + half, y - half);
271 GL11.glVertex2f(x + half - corner, y - half);
277 GL11.glDisable(GL11.GL_LINE_SMOOTH);