mirror of
https://github.com/Wurst-Imperium/Wurst7.git
synced 2024-09-20 01:12:13 +02:00
Slightly refactor AutoBuild rendering
This commit is contained in:
parent
cd24e858c6
commit
e2eb0de781
@ -287,16 +287,16 @@ public final class AutoBuildHack extends Hack
|
|||||||
if(status != Status.BUILDING)
|
if(status != Status.BUILDING)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float scale = 1F * 7F / 8F;
|
float scale = 7F / 8F;
|
||||||
double offset = (1D - scale) / 2D;
|
double offset = (1.0 - scale) / 2.0;
|
||||||
Vec3d eyesPos = RotationUtils.getEyesPos();
|
Vec3d eyesPos = RotationUtils.getEyesPos();
|
||||||
double rangeSq = Math.pow(range.getValue(), 2);
|
double rangeSq = range.getValueSq();
|
||||||
|
|
||||||
// GL settings
|
// GL settings
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||||
RenderSystem.setShaderColor(0F, 0F, 0F, 0.5F);
|
RenderSystem.setShaderColor(0, 0, 0, 0.5F);
|
||||||
|
|
||||||
matrixStack.push();
|
matrixStack.push();
|
||||||
|
|
||||||
@ -339,11 +339,11 @@ public final class AutoBuildHack extends Hack
|
|||||||
private void drawGreenBox(MatrixStack matrixStack)
|
private void drawGreenBox(MatrixStack matrixStack)
|
||||||
{
|
{
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
RenderSystem.setShaderColor(0F, 1F, 0F, 0.15F);
|
RenderSystem.setShaderColor(0, 1, 0, 0.15F);
|
||||||
RenderUtils.drawSolidBox(matrixStack);
|
RenderUtils.drawSolidBox(matrixStack);
|
||||||
GL11.glDepthMask(true);
|
GL11.glDepthMask(true);
|
||||||
|
|
||||||
RenderSystem.setShaderColor(0F, 0F, 0F, 0.5F);
|
RenderSystem.setShaderColor(0, 0, 0, 0.5F);
|
||||||
RenderUtils.drawOutlinedBox(matrixStack);
|
RenderUtils.drawOutlinedBox(matrixStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user