231 if (
data ==
null)
return;
234 if (
level <= 0)
return;
236 if (!
getFleet().isPlayerFleet())
return;
255 float bandWidthInTexture = 256;
259 float radEnd = radStart + 75f;
261 float circ = (float) (Math.PI * 2f * (radStart + radEnd) / 2f);
263 float pixelsPerSegment = circ / 360f;
265 float segments = Math.round(circ / pixelsPerSegment);
271 float startRad = (float) Math.toRadians(0);
272 float endRad = (float) Math.toRadians(360f);
273 float spanRad = Math.abs(endRad - startRad);
274 float anglePerSegment = spanRad / segments;
282 GL11.glTranslatef(x, y, 0);
287 GL11.glEnable(GL11.GL_TEXTURE_2D);
292 GL11.glEnable(GL11.GL_BLEND);
294 GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
296 boolean outlineMode =
false;
299 GL11.glDisable(GL11.GL_TEXTURE_2D);
300 GL11.glDisable(GL11.GL_BLEND);
301 GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
305 float thickness = (radEnd - radStart) * 1f;
306 float radius = radStart;
308 float texProgress = 0f;
311 float texPerSegment = pixelsPerSegment * texHeight / imageHeight * bandWidthInTexture / thickness;
315 float totalTex = Math.max(1f, Math.round(texPerSegment * segments));
316 texPerSegment = totalTex / segments;
323 Color color =
new Color(25,215,255,255);
327 for (
int iter = 0; iter < 2; iter++) {
334 texProgress = segments/2f * texPerSegment;
338 GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
342 float leftTX = (float) bandIndex * texWidth * bandWidthInTexture / imageWidth;
343 float rightTX = (float) (bandIndex + 1f) * texWidth * bandWidthInTexture / imageWidth - 0.001f;
345 GL11.glBegin(GL11.GL_QUAD_STRIP);
346 for (
float i = 0; i < segments + 1; i++) {
348 float segIndex = i % (int) segments;
353 phaseAngleRad = (float) Math.toRadians(
phaseAngle) + (segIndex * anglePerSegment * 29f);
355 phaseAngleRad = (float) Math.toRadians(-
phaseAngle) + (segIndex * anglePerSegment * 17f);
359 float angle = (float) Math.toDegrees(segIndex * anglePerSegment);
363 float pulseSin = (float) Math.sin(phaseAngleRad);
364 float pulseMax = thickness * 0.5f;
366 pulseMax = thickness * 0.2f;
371 float pulseAmount = pulseSin * pulseMax;
373 float pulseInner = pulseAmount * 0.1f;
380 float theta = anglePerSegment * segIndex;;
381 float cos = (float) Math.cos(theta);
382 float sin = (float) Math.sin(theta);
384 float rInner = r - pulseInner;
388 float rOuter = r + thickness - pulseAmount;
396 if (grav > 750) grav = 750;
408 float alpha = alphaMult;
409 alpha *= 0.25f + Math.min(grav / 100, 0.75f);
422 float x1 = cos * rInner;
423 float y1 = sin * rInner;
424 float x2 = cos * rOuter;
425 float y2 = sin * rOuter;
427 x2 += (float) (Math.cos(phaseAngleRad) * pixelsPerSegment * 0.33f);
428 y2 += (float) (Math.sin(phaseAngleRad) * pixelsPerSegment * 0.33f);
431 GL11.glColor4ub((
byte)color.getRed(),
432 (
byte)color.getGreen(),
433 (
byte)color.getBlue(),
434 (
byte)((
float) color.getAlpha() * alphaMult * alpha));
436 GL11.glTexCoord2f(leftTX, texProgress);
437 GL11.glVertex2f(x1, y1);
438 GL11.glTexCoord2f(rightTX, texProgress);
439 GL11.glVertex2f(x2, y2);
441 texProgress += texPerSegment * 1f;
450 GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);