Implement new voidstone animation, expose some more API methods

This commit is contained in:
tterrag1098 committed 2015-05-27 04:25:56 -04:00
1 parent da64d4a803
commit 5b20e0728a
8 files changed
+181 -118

No files matched your search

@@ -56,7 +56,7 @@ public class RenderBlocksCTM extends RenderBlocks {
this.y = y;
this.z = z;
}
private static double u, v, xDiff, yDiff, zDiff, uDiff, vDiff;
void render(RenderBlocksCTM inst, ForgeDirection normal, int cacheID) {
@@ -66,7 +66,7 @@ public class RenderBlocksCTM extends RenderBlocks {
}
u = cacheID == 1 || cacheID == 2 ? inst.maxU : inst.minU;
v = cacheID < 2 ? inst.maxV : inst.minV;
uDiff = inst.maxU - inst.minU;
vDiff = inst.maxV - inst.minV;
@@ -289,8 +289,8 @@ public class RenderBlocksCTM extends RenderBlocks {
| ((blueBitChannel / lightVals.length) & 0xF0000) | ((sunlightBitChannel / lightVals.length) & 0xF00000);
}
protected void side(SubSide side, int iconIndex) {
protected void side(Block block, SubSide side, int iconIndex) {
IIcon icon;
TextureSubmap map;
if (iconIndex >= 16) {
@@ -299,9 +299,14 @@ public class RenderBlocksCTM extends RenderBlocks {
} else {
map = submap;
}
int x = iconIndex % map.getWidth();
int y = iconIndex / map.getHeight();
icon = map.getSubIcon(x, y);
if (map == null) {
icon = getBlockIconFromSide(block, side.normal.ordinal());
} else {
int x = iconIndex % map.getWidth();
int y = iconIndex / map.getHeight();
icon = map.getSubIcon(x, y);
}
double umax = icon.getMaxU();
double umin = icon.getMinU();
@@ -346,14 +351,14 @@ public class RenderBlocksCTM extends RenderBlocks {
fillColormap(colorBlueBottomRight, colorBlueTopRight, colorBlueTopLeft, colorBlueBottomLeft, blumap);
getLight(0, 0);
side(XNEG_LB, tex[0]);
side(block, XNEG_LB, tex[0]);
getLight(1, 0);
side(XNEG_RB, tex[1]);
side(block, XNEG_RB, tex[1]);
getLight(1, 1);
side(XNEG_RT, tex[2]);
side(block, XNEG_RT, tex[2]);
getLight(0, 1);
side(XNEG_LT, tex[3]);
side(block, XNEG_LT, tex[3]);
post(ForgeDirection.WEST);
}
}
@@ -376,16 +381,16 @@ public class RenderBlocksCTM extends RenderBlocks {
fillColormap(colorRedTopLeft, colorRedBottomLeft, colorRedBottomRight, colorRedTopRight, redmap);
fillColormap(colorGreenTopLeft, colorGreenBottomLeft, colorGreenBottomRight, colorGreenTopRight, grnmap);
fillColormap(colorBlueTopLeft, colorBlueBottomLeft, colorBlueBottomRight, colorBlueTopRight, blumap);
getLight(0, 0);
side(XPOS_LB, tex[0]);
side(block, XPOS_LB, tex[0]);
getLight(1, 0);
side(XPOS_RB, tex[1]);
side(block, XPOS_RB, tex[1]);
getLight(1, 1);
side(XPOS_RT, tex[2]);
side(block, XPOS_RT, tex[2]);
getLight(0, 1);
side(XPOS_LT, tex[3]);
side(block, XPOS_LT, tex[3]);
post(ForgeDirection.EAST);
}
}
@@ -408,16 +413,16 @@ public class RenderBlocksCTM extends RenderBlocks {
fillColormap(colorRedBottomRight, colorRedTopRight, colorRedTopLeft, colorRedBottomLeft, redmap);
fillColormap(colorGreenBottomRight, colorGreenTopRight, colorGreenTopLeft, colorGreenBottomLeft, grnmap);
fillColormap(colorBlueBottomRight, colorBlueTopRight, colorBlueTopLeft, colorBlueBottomLeft, blumap);
getLight(0, 0);
side(ZNEG_LB, tex[0]);
side(block, ZNEG_LB, tex[0]);
getLight(1, 0);
side(ZNEG_RB, tex[1]);
side(block, ZNEG_RB, tex[1]);
getLight(1, 1);
side(ZNEG_RT, tex[2]);
side(block, ZNEG_RT, tex[2]);
getLight(0, 1);
side(ZNEG_LT, tex[3]);
side(block, ZNEG_LT, tex[3]);
post(ForgeDirection.NORTH);
}
}
@@ -440,16 +445,16 @@ public class RenderBlocksCTM extends RenderBlocks {
fillColormap(colorRedBottomLeft, colorRedBottomRight, colorRedTopRight, colorRedTopLeft, redmap);
fillColormap(colorGreenBottomLeft, colorGreenBottomRight, colorGreenTopRight, colorGreenTopLeft, grnmap);
fillColormap(colorBlueBottomLeft, colorBlueBottomRight, colorBlueTopRight, colorBlueTopLeft, blumap);
getLight(0, 0);
side(ZPOS_LB, tex[0]);
side(block, ZPOS_LB, tex[0]);
getLight(1, 0);
side(ZPOS_RB, tex[1]);
side(block, ZPOS_RB, tex[1]);
getLight(1, 1);
side(ZPOS_RT, tex[2]);
side(block, ZPOS_RT, tex[2]);
getLight(0, 1);
side(ZPOS_LT, tex[3]);
side(block, ZPOS_LT, tex[3]);
post(ForgeDirection.SOUTH);
}
}
@@ -472,16 +477,16 @@ public class RenderBlocksCTM extends RenderBlocks {
fillColormap(colorRedBottomLeft, colorRedBottomRight, colorRedTopRight, colorRedTopLeft, redmap);
fillColormap(colorGreenBottomLeft, colorGreenBottomRight, colorGreenTopRight, colorGreenTopLeft, grnmap);
fillColormap(colorBlueBottomLeft, colorBlueBottomRight, colorBlueTopRight, colorBlueTopLeft, blumap);
getLight(0, 0);
side(YNEG_LB, tex[0]);
side(block, YNEG_LB, tex[0]);
getLight(1, 0);
side(YNEG_RB, tex[1]);
side(block, YNEG_RB, tex[1]);
getLight(1, 1);
side(YNEG_RT, tex[2]);
side(block, YNEG_RT, tex[2]);
getLight(0, 1);
side(YNEG_LT, tex[3]);
side(block, YNEG_LT, tex[3]);
post(ForgeDirection.DOWN);
}
}
@@ -504,16 +509,16 @@ public class RenderBlocksCTM extends RenderBlocks {
fillColormap(colorRedTopRight, colorRedTopLeft, colorRedBottomLeft, colorRedBottomRight, redmap);
fillColormap(colorGreenTopRight, colorGreenTopLeft, colorGreenBottomLeft, colorGreenBottomRight, grnmap);
fillColormap(colorBlueTopRight, colorBlueTopLeft, colorBlueBottomLeft, colorBlueBottomRight, blumap);
getLight(0, 0);
side(YPOS_LB, tex[0]);
side(block, YPOS_LB, tex[0]);
getLight(1, 0);
side(YPOS_RB, tex[1]);
side(block, YPOS_RB, tex[1]);
getLight(1, 1);
side(YPOS_RT, tex[2]);
side(block, YPOS_RT, tex[2]);
getLight(0, 1);
side(YPOS_LT, tex[3]);
side(block, YPOS_LT, tex[3]);
post(ForgeDirection.UP);
}
}
@@ -264,7 +264,7 @@ public enum TextureType {
/* Some util stuff for shared code between v* and r* */
protected static IIcon getVIcon(TextureType type, TextureSubmap map, int x, int y, int z, int side) {
public static IIcon getVIcon(TextureType type, TextureSubmap map, int x, int y, int z, int side) {
int variationSize = (type == TextureType.V9) ? 3 : 2;
int xModulus = x % variationSize;
@@ -299,7 +299,7 @@ public enum TextureType {
return map.getSubIcon(index % variationSize, index / variationSize);
}
protected static IIcon getRIcon(TextureType type, TextureSubmap map, int x, int y, int z, int side) {
public static IIcon getRIcon(TextureType type, TextureSubmap map, int x, int y, int z, int side) {
rand.setSeed(getCoordinateRandom(x, y, z));
rand.nextBoolean();
int size = type == TextureType.R4 ? 2 : type == TextureType.R9 ? 3 : 4;