removed unnecessary Math.sqrt

This commit is contained in:
lax1dude 2023-10-26 22:23:17 -07:00
parent e21aceff9f
commit 47db5ab389
5 changed files with 5412 additions and 5399 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -739,6 +739,8 @@ public class GuiIngame extends Gui {
public void renderCrosshairs(int w, int h) { public void renderCrosshairs(int w, int h) {
tex_icons.bindTexture(); tex_icons.bindTexture();
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
EaglerAdapter.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND); EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND);
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_ONE_MINUS_DST_COLOR, EaglerAdapter.GL_ONE_MINUS_SRC_COLOR); EaglerAdapter.glBlendFunc(EaglerAdapter.GL_ONE_MINUS_DST_COLOR, EaglerAdapter.GL_ONE_MINUS_SRC_COLOR);

View File

@ -22,7 +22,7 @@ public class TexturedQuad {
par1ArrayOfPositionTextureVertex[1] = par1ArrayOfPositionTextureVertex[1].setTexturePosition((float) par2 / par6 + var8, (float) par3 / par7 + var9); par1ArrayOfPositionTextureVertex[1] = par1ArrayOfPositionTextureVertex[1].setTexturePosition((float) par2 / par6 + var8, (float) par3 / par7 + var9);
par1ArrayOfPositionTextureVertex[2] = par1ArrayOfPositionTextureVertex[2].setTexturePosition((float) par2 / par6 + var8, (float) par5 / par7 - var9); par1ArrayOfPositionTextureVertex[2] = par1ArrayOfPositionTextureVertex[2].setTexturePosition((float) par2 / par6 + var8, (float) par5 / par7 - var9);
par1ArrayOfPositionTextureVertex[3] = par1ArrayOfPositionTextureVertex[3].setTexturePosition((float) par4 / par6 - var8, (float) par5 / par7 - var9); par1ArrayOfPositionTextureVertex[3] = par1ArrayOfPositionTextureVertex[3].setTexturePosition((float) par4 / par6 - var8, (float) par5 / par7 - var9);
this.normal = normal; this.normal = normal.normalize();
} }
public void flipFace() { public void flipFace() {

View File

@ -347,6 +347,17 @@ public class Tessellator {
* Sets the normal for the current draw call. * Sets the normal for the current draw call.
*/ */
public void setNormal(float par1, float par2, float par3) { public void setNormal(float par1, float par2, float par3) {
this.hasNormals = true;
int var4 = (int)(par1 * 127.0F) + 127;
int var5 = (int)(par2 * 127.0F) + 127;
int var6 = (int)(par3 * 127.0F) + 127;
this.normal = var4 & 255 | (var5 & 255) << 8 | (var6 & 255) << 16;
}
/**
* Sets the normal for the current draw call.
*/
public void setNormalN(float par1, float par2, float par3) {
this.hasNormals = true; this.hasNormals = true;
float len = (float) Math.sqrt(par1 * par1 + par2 * par2 + par3 * par3); float len = (float) Math.sqrt(par1 * par1 + par2 * par2 + par3 * par3);
int var4 = (int)((par1 / len) * 127.0F) + 127; int var4 = (int)((par1 / len) * 127.0F) + 127;