Skip to content

Commit

Permalink
remove unnecessary parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
octarine-noise committed Mar 25, 2015
1 parent 3b15496 commit bacfcf2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 31 deletions.
Expand Up @@ -325,7 +325,7 @@ public void renderCrossedSideQuads(Double3 drawBase, ForgeDirection dir, double
}
}

protected void renderCrossedBlockQuadsTranslate(ForgeDirection axisMain, Double3 blockCenter, double halfSize, Double3 offsetVec, IIcon crossLeafIcon, int uvRot, boolean isAirTop, boolean isAirBottom) {
protected void renderCrossedBlockQuadsTranslate(ForgeDirection axisMain, Double3 blockCenter, double halfSize, Double3 offsetVec, IIcon crossLeafIcon, int uvRot) {
Double3 drawCenter = blockCenter;
if (offsetVec != null) drawCenter = drawCenter.add(offsetVec);

Expand All @@ -336,22 +336,21 @@ protected void renderCrossedBlockQuadsTranslate(ForgeDirection axisMain, Double3
Double3 horz2 = axis1.sub(axis2).scale(halfSize);
Double3 vert1 = new Double3(axisMain).scale(halfSize * 1.41);

renderCrossedBlockQuadsInternal(axisMain, drawCenter, horz1, horz2, vert1, crossLeafIcon, uvRot, isAirTop, isAirBottom);
renderCrossedBlockQuadsInternal(axisMain, drawCenter, horz1, horz2, vert1, crossLeafIcon, uvRot);
}

protected void renderCrossedBlockQuadsSkew(ForgeDirection axisMain, Double3 blockCenter, double halfSize, Double3 offsetVec1, Double3 offsetVec2, IIcon crossLeafIcon, int uvRot, boolean isAirTop, boolean isAirBottom) {
protected void renderCrossedBlockQuadsSkew(ForgeDirection axisMain, Double3 blockCenter, double halfSize, Double3 offsetVec1, Double3 offsetVec2, IIcon crossLeafIcon, int uvRot) {
Double3 axis1 = new Double3(faceDir1[axisMain.ordinal()]);
Double3 axis2 = new Double3(faceDir2[axisMain.ordinal()]);

Double3 horz1 = axis1.add(axis2).scale(halfSize).add(axis1.scale(offsetVec1.x)).add(axis2.scale(offsetVec1.z)).add(new Double3(axisMain).scale(offsetVec1.y));
Double3 horz2 = axis1.sub(axis2).scale(halfSize).add(axis1.scale(offsetVec2.x)).add(axis2.scale(offsetVec2.z)).add(new Double3(axisMain).scale(offsetVec2.y));
Double3 vert1 = new Double3(axisMain).scale(halfSize * 1.41);

renderCrossedBlockQuadsInternal(axisMain, blockCenter, horz1, horz2, vert1, crossLeafIcon, uvRot, isAirTop, isAirBottom);
renderCrossedBlockQuadsInternal(axisMain, blockCenter, horz1, horz2, vert1, crossLeafIcon, uvRot);
}

private void renderCrossedBlockQuadsInternal(ForgeDirection axisMain, Double3 drawCenter, Double3 horz1, Double3 horz2, Double3 vert1, IIcon crossLeafIcon, int uvRot, boolean isAirTop, boolean isAirBottom) {
// XYZ NPP
private void renderCrossedBlockQuadsInternal(ForgeDirection axisMain, Double3 drawCenter, Double3 horz1, Double3 horz2, Double3 vert1, IIcon crossLeafIcon, int uvRot) {
if (Minecraft.isAmbientOcclusionEnabled() && !noShading) {
ForgeDirection axis1 = faceDir1[axisMain.ordinal()];
ForgeDirection axis2 = faceDir2[axisMain.ordinal()];
Expand All @@ -361,37 +360,21 @@ private void renderCrossedBlockQuadsInternal(ForgeDirection axisMain, Double3 dr
getAoLookupMax(axisMain, axis1, axis2.getOpposite()),
getAoLookupMax(axisMain.getOpposite(), axis1, axis2.getOpposite()),
getAoLookupMax(axisMain.getOpposite(), axis2, axis1.getOpposite()));
// isAirTop ? getAoLookup(axisMain, axis1.getOpposite(), axis2) : getAoLookup(axis2, axis1.getOpposite(), axisMain),
// isAirTop ? getAoLookup(axisMain, axis1, axis2.getOpposite()) : getAoLookup(axis1, axis2.getOpposite(), axisMain),
// isAirBottom ? getAoLookup(axisMain.getOpposite(), axis1, axis2.getOpposite()) : getAoLookup(axis1, axisMain.getOpposite(), axis2.getOpposite()),
// isAirBottom ? getAoLookup(axisMain.getOpposite(), axis1.getOpposite(), axis2) : getAoLookup(axis2, axis1.getOpposite(), axisMain.getOpposite()));
renderQuadWithShading(crossLeafIcon, drawCenter, horz1.inverse(), vert1, uvRot,
getAoLookupMax(axisMain, axis2.getOpposite(), axis1),
getAoLookupMax(axisMain, axis1.getOpposite(), axis2),
getAoLookupMax(axisMain.getOpposite(), axis1.getOpposite(), axis2),
getAoLookupMax(axisMain.getOpposite(), axis2.getOpposite(), axis1));
// isAirTop ? getAoLookup(axisMain, axis1, axis2.getOpposite()) : getAoLookup(axis2.getOpposite(), axis1, axisMain),
// isAirTop ? getAoLookup(axisMain, axis1.getOpposite(), axis2) : getAoLookup(axis1.getOpposite(), axis2, axisMain),
// isAirBottom ? getAoLookup(axisMain.getOpposite(), axis1.getOpposite(), axis2) : getAoLookup(axis1.getOpposite(), axisMain.getOpposite(), axis2),
// isAirBottom ? getAoLookup(axisMain.getOpposite(), axis1, axis2.getOpposite()) : getAoLookup(axis2.getOpposite(), axis1, axisMain.getOpposite()));
renderQuadWithShading(crossLeafIcon, drawCenter, horz2, vert1, uvRot,
getAoLookupMax(axisMain, axis1.getOpposite(), axis2.getOpposite()),
getAoLookupMax(axisMain, axis2, axis1),
getAoLookupMax(axisMain.getOpposite(), axis2, axis1),
getAoLookupMax(axisMain.getOpposite(), axis1.getOpposite(), axis2.getOpposite()));
// isAirTop ? getAoLookup(axisMain, axis1.getOpposite(), axis2.getOpposite()) : getAoLookup(axis1.getOpposite(), axisMain, axis2.getOpposite()),
// isAirTop ? getAoLookup(axisMain, axis1, axis2) : getAoLookup(axis2, axis1, axisMain),
// isAirBottom ? getAoLookup(axisMain.getOpposite(), axis1, axis2) : getAoLookup(axis2, axis1, axisMain.getOpposite()),
// isAirBottom ? getAoLookup(axisMain.getOpposite(), axis1.getOpposite(), axis2.getOpposite()) : getAoLookup(axis1.getOpposite(), axis2.getOpposite(), axisMain.getOpposite()));
renderQuadWithShading(crossLeafIcon, drawCenter, horz2.inverse(), vert1, uvRot,
getAoLookupMax(axisMain, axis1, axis2),
getAoLookupMax(axisMain, axis2.getOpposite(), axis1.getOpposite()),
getAoLookupMax(axisMain.getOpposite(), axis2.getOpposite(), axis1.getOpposite()),
getAoLookupMax(axisMain.getOpposite(), axis1, axis2));
// isAirTop ? getAoLookup(axisMain, axis1, axis2) : getAoLookup(axis1, axis2, axisMain),
// isAirTop ? getAoLookup(axisMain, axis1.getOpposite(), axis2.getOpposite()) : getAoLookup(axis2.getOpposite(), axis1.getOpposite(), axisMain),
// isAirBottom ? getAoLookup(axisMain.getOpposite(), axis1.getOpposite(), axis2.getOpposite()) : getAoLookup(axis2.getOpposite(), axis1.getOpposite(), axisMain.getOpposite()),
// isAirBottom ? getAoLookup(axisMain.getOpposite(), axis1, axis2) : getAoLookup(axis1, axis2, axisMain.getOpposite()));
} else {
renderQuad(crossLeafIcon, drawCenter, horz1, vert1, uvRot);
renderQuad(crossLeafIcon, drawCenter, horz1.inverse(), vert1, uvRot);
Expand Down
Expand Up @@ -69,7 +69,7 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b
renderCrossedBlockQuadsSkew(ForgeDirection.UP, blockCenter,
0.65,
pRot[iconVariation].scaleAxes(0.1, 0.0, 0.1),
pRot[(iconVariation + 1) & 63].scaleAxes(0.1, 0.0, 0.1), cactusRoundIcon, iconVariation, false, false);
pRot[(iconVariation + 1) & 63].scaleAxes(0.1, 0.0, 0.1), cactusRoundIcon, iconVariation);
return true;
}

Expand Down
Expand Up @@ -76,28 +76,28 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b
Double3 offset2 = pRot[(offsetVariation + 1) & 63].scaleAxes(Config.leavesHOffset, Config.leavesVOffset, Config.leavesHOffset);

if (Config.leavesSkew) {
renderCrossedBlockQuadsSkew(ForgeDirection.UP, blockCenter, halfSize, offset1, offset2, leafInfo.roundLeafTexture, uvVariation, isAirTop, isAirBottom);
renderCrossedBlockQuadsSkew(ForgeDirection.UP, blockCenter, halfSize, offset1, offset2, leafInfo.roundLeafTexture, uvVariation);
if (Config.leavesDense) {
renderCrossedBlockQuadsSkew(ForgeDirection.EAST, blockCenter, halfSize, offset1, offset2, leafInfo.roundLeafTexture, uvVariation, isAirTop, isAirBottom);
renderCrossedBlockQuadsSkew(ForgeDirection.SOUTH, blockCenter, halfSize, offset1, offset2, leafInfo.roundLeafTexture, uvVariation, isAirTop, isAirBottom);
renderCrossedBlockQuadsSkew(ForgeDirection.EAST, blockCenter, halfSize, offset1, offset2, leafInfo.roundLeafTexture, uvVariation);
renderCrossedBlockQuadsSkew(ForgeDirection.SOUTH, blockCenter, halfSize, offset1, offset2, leafInfo.roundLeafTexture, uvVariation);
}
if (isSnowTop) {
// clear biome colors
setShadingsGray(0.9f, aoYPXZNN, aoYPXZNP, aoYPXZPN, aoYPXZPP);
Tessellator.instance.setColorOpaque(230, 230, 230);
renderCrossedBlockQuadsSkew(ForgeDirection.UP, blockCenter, halfSize, offset1, offset2, snowedLeavesIcons.get(uvVariation), 0, true, isAirBottom);
renderCrossedBlockQuadsSkew(ForgeDirection.UP, blockCenter, halfSize, offset1, offset2, snowedLeavesIcons.get(uvVariation), 0);
}
} else {
renderCrossedBlockQuadsTranslate(ForgeDirection.UP, blockCenter, halfSize, offset1, leafInfo.roundLeafTexture, uvVariation, isAirTop, isAirBottom);
renderCrossedBlockQuadsTranslate(ForgeDirection.UP, blockCenter, halfSize, offset1, leafInfo.roundLeafTexture, uvVariation);
if (Config.leavesDense) {
renderCrossedBlockQuadsTranslate(ForgeDirection.EAST, blockCenter, halfSize, offset1, leafInfo.roundLeafTexture, uvVariation, isAirTop, isAirBottom);
renderCrossedBlockQuadsTranslate(ForgeDirection.SOUTH, blockCenter, halfSize, offset1, leafInfo.roundLeafTexture, uvVariation, isAirTop, isAirBottom);
renderCrossedBlockQuadsTranslate(ForgeDirection.EAST, blockCenter, halfSize, offset1, leafInfo.roundLeafTexture, uvVariation);
renderCrossedBlockQuadsTranslate(ForgeDirection.SOUTH, blockCenter, halfSize, offset1, leafInfo.roundLeafTexture, uvVariation);
}
if (isSnowTop) {
// clear biome colors
setShadingsGray(0.9f, aoYPXZNN, aoYPXZNP, aoYPXZPN, aoYPXZPP);
Tessellator.instance.setColorOpaque(230, 230, 230);
renderCrossedBlockQuadsTranslate(ForgeDirection.UP, blockCenter, halfSize, offset1, snowedLeavesIcons.get(uvVariation), 0, true, isAirBottom);
renderCrossedBlockQuadsTranslate(ForgeDirection.UP, blockCenter, halfSize, offset1, snowedLeavesIcons.get(uvVariation), 0);
}
}

Expand Down

0 comments on commit bacfcf2

Please sign in to comment.