66 public void render(
float cx,
float cy,
float facing,
float alphaMult) {
67 if (alphaMult <= 0)
return;
70 GL11.glTranslatef(
entity.getLocation().x,
entity.getLocation().y, 0);
72 SectorEntityToken lightSource =
entity.getLightSource();
74 if (lightSource !=
null &&
entity.getLightColor() !=
null) {
80 sprite.setColor(Color.white);
86 sprite.setAngle(facing - 90f);
88 sprite.setAlphaMult(alphaMult);
89 sprite.renderAtCenter(cx, cy);
92 glow.setAngle(facing - 90f);
93 glow.setAdditiveBlend();
94 glow.setAlphaMult(alphaMult);
95 glow.renderAtCenter(cx, cy);
104 float w =
overlay.getWidth() * 1.41f;
108 GL11.glColorMask(
false,
false,
false,
true);
109 Misc.renderQuadAlpha(0 - w/2f - 1f, 0 - h/2f - 1f, w + 2f, h + 2f, Misc.zeroColor, 0f);
111 sprite.setBlendFunc(GL11.GL_ONE, GL11.GL_ZERO);
112 sprite.renderAtCenter(cx, cy);
114 overlay.setAlphaMult(alphaMult);
115 overlay.setAngle(facing - 90f + overlayAngleOffset);
116 overlay.setBlendFunc(GL11.GL_ZERO, GL11.GL_SRC_ALPHA);
117 overlay.renderAtCenter(cx, cy);
119 GL11.glColorMask(
true,
true,
true,
false);
120 overlay.setBlendFunc(GL11.GL_DST_ALPHA, GL11.GL_ONE_MINUS_DST_ALPHA);
121 overlay.renderAtCenter(cx, cy);
124 if (lightSource !=
null && !
entity.getLightSource().hasTag(Tags.AMBIENT_LS)) {
129 GL11.glColorMask(
false,
false,
false,
true);
130 Misc.renderQuadAlpha(0 - w/2f - 1f, 0 - h/2f - 1f, w + 2f, h + 2f, Misc.zeroColor, 0f);
132 sprite.setBlendFunc(GL11.GL_ONE, GL11.GL_ZERO);
133 sprite.renderAtCenter(cx, cy);
135 float lightDir = Misc.getAngleInDegreesStrict(
entity.getLocation(), lightSource.getLocation());
138 shadowMask.setBlendFunc(GL11.GL_ZERO, GL11.GL_SRC_ALPHA);
141 GL11.glColorMask(
true,
true,
true,
false);
142 shadowMask.setBlendFunc(GL11.GL_DST_ALPHA, GL11.GL_ONE_MINUS_DST_ALPHA);