mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-19 03:39:15 +00:00
optimisation
This commit is contained in:
1 parent
e5d1f1637c
commit
4cbc62afb0
32 files changed
+36
-16
No files matched your search
@@ -21,31 +21,46 @@ public class RenderShield extends Render {
|
||||
GL11.glTranslated(x, y, z);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
float sin1;
|
||||
float cos1;
|
||||
|
||||
float sin2;
|
||||
float cos2;
|
||||
|
||||
float hsin1 = 0;
|
||||
float hcos1 = 1;
|
||||
|
||||
float hsin2;
|
||||
float hcos2;
|
||||
|
||||
for (float h = 0; h < 360; h += 15) {
|
||||
sin1 = 0;
|
||||
cos1 = 1;
|
||||
|
||||
hsin2 = MathHelper.sin((float) Math.toRadians(h + 15));
|
||||
hcos2 = MathHelper.cos((float) Math.toRadians(h + 15));
|
||||
|
||||
for (float angle = 0; angle < 360; angle += 15) {
|
||||
float sin1 = (float) Math.sin(Math.toRadians(angle));
|
||||
float sin2 = (float) Math.sin(Math.toRadians(angle + 15));
|
||||
|
||||
float cos1 = (float) Math.cos(Math.toRadians(angle));
|
||||
float cos2 = (float) Math.cos(Math.toRadians(angle + 15));
|
||||
|
||||
float hsin1 = (float) Math.sin(Math.toRadians(h));
|
||||
float hsin2 = (float) Math.sin(Math.toRadians(h + 15));
|
||||
|
||||
float hcos1 = (float) Math.cos(Math.toRadians(h));
|
||||
float hcos2 = (float) Math.cos(Math.toRadians(h + 15));
|
||||
sin2 = MathHelper.sin((float) Math.toRadians(angle + 15));
|
||||
cos2 = MathHelper.cos((float) Math.toRadians(angle + 15));
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(sin1 * 2 * hcos1, 2 * hsin1, cos1 * 2 * hcos1, 1, 1);
|
||||
tessellator.addVertexWithUV(sin1 * 2 * hcos2, 2 * hsin2, cos1 * 2 * hcos2, 1, 0);
|
||||
tessellator.addVertexWithUV(sin2 * 2 * hcos2, 2 * hsin2, cos2 * 2 * hcos2, 0, 0);
|
||||
tessellator.addVertexWithUV(sin2 * 2 * hcos1, 2 * hsin1, cos2 * 2 * hcos1, 0, 1);
|
||||
tessellator.addVertexWithUV(sin1 * hcos1, hsin1, cos1 * hcos1, 1, 1);
|
||||
tessellator.addVertexWithUV(sin1 * hcos2, hsin2, cos1 * hcos2, 1, 0);
|
||||
tessellator.addVertexWithUV(sin2 * hcos2, hsin2, cos2 * hcos2, 0, 0);
|
||||
tessellator.addVertexWithUV(sin2 * hcos1, hsin1, cos2 * hcos1, 0, 1);
|
||||
tessellator.draw();
|
||||
|
||||
sin1 = sin2;
|
||||
cos1 = cos2;
|
||||
}
|
||||
|
||||
hsin1 = hsin2;
|
||||
hcos1 = hcos2;
|
||||
}
|
||||
|
||||
GL11.glPopAttrib();
|
||||
|
||||
@@ -83,6 +83,11 @@ public class EntityShield extends Entity implements IProjectile {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBrightnessForRender(float p_70070_1_){
|
||||
return 240;
|
||||
}
|
||||
|
||||
public void applyEntityCollision(Entity entity) {
|
||||
if (entity.riddenByEntity != this && entity.ridingEntity != this) {
|
||||
|
||||
Reference in new issue
Block a user