use of riskyken.armourersWorkshop.api.common.IRectangle3D in project Armourers-Workshop by RiskyKen.
the class SkinRenderHelper method renderGuidePart.
private static void renderGuidePart(ISkinPartType part, float scale, boolean showGuides, boolean hidden) {
Minecraft.getMinecraft().getTextureManager().bindTexture(guideImage);
IRectangle3D buildRec = part.getBuildingSpace();
IRectangle3D guideRec = part.getGuideSpace();
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
if (showGuides) {
// render building grid
//
renderGuideBox(buildRec.getX(), buildRec.getY(), buildRec.getZ(), buildRec.getWidth(), buildRec.getHeight(), buildRec.getDepth(), scale);
// render origin
GL11.glColor4f(0F, 1F, 0F, 0.5F);
renderGuideBox(-0.5F, -0.5F, -0.5F, 1, 1, 1, scale);
}
if (ConfigHandlerClient.showArmourerDebugRender) {
// render debug box
GL11.glColor4f(1F, 0F, 0F, 0.25F);
renderGuideBox(guideRec.getX(), guideRec.getY(), guideRec.getZ(), guideRec.getWidth(), guideRec.getHeight(), guideRec.getDepth(), scale);
}
if (hidden) {
GL11.glColor4f(0F, 0F, 1F, 0.25F);
renderGuideBox(guideRec.getX(), guideRec.getY(), guideRec.getZ(), guideRec.getWidth(), guideRec.getHeight(), guideRec.getDepth(), scale);
}
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
use of riskyken.armourersWorkshop.api.common.IRectangle3D in project Armourers-Workshop by RiskyKen.
the class GuiMiniArmourerBuildingModel method drawBuildingCubes.
private void drawBuildingCubes(boolean fake) {
if (cubes == null) {
// return;
}
renderCubes.clear();
fakeCubeRenders = 0;
// GL11.glDisable(GL11.GL_NORMALIZE);
GL11.glDisable(GL11.GL_TEXTURE_2D);
if (fake) {
GL11.glDisable(GL11.GL_LIGHTING);
IRectangle3D guideSpace = currentSkinPartType.getGuideSpace();
for (int ix = 0; ix < guideSpace.getWidth(); ix++) {
for (int iy = 0; iy < guideSpace.getHeight(); iy++) {
for (int iz = 0; iz < guideSpace.getDepth(); iz++) {
byte x = (byte) (ix + guideSpace.getX());
byte y = (byte) (iy + guideSpace.getY());
byte z = (byte) (iz + guideSpace.getZ());
MiniCube cube = new MiniCube(CubeRegistry.INSTANCE.getCubeFormId((byte) 0));
cube.setX(x);
cube.setY(y);
cube.setZ(z);
renderCubes.add(cube);
}
}
}
fakeCubeRenders = renderCubes.size();
}
float scale = 0.0625F;
int colourId = 1;
renderCubes.addAll(cubes);
IRenderBuffer buff = RenderBridge.INSTANCE;
buff.startDrawingQuads();
for (int i = 0; i < renderCubes.size(); i++) {
MiniCube cube = renderCubes.get(i);
if (cube != null) {
if (cube.isGlowing() & !fake) {
GL11.glDisable(GL11.GL_LIGHTING);
ModRenderHelper.disableLighting();
}
ICubeColour colour = new CubeColour();
if (fake) {
colour.setColour(GuiMiniArmourerHelper.getColourFromId(colourId).getRGB(), 0);
colour.setColour(GuiMiniArmourerHelper.getColourFromId(colourId + 1).getRGB(), 1);
colour.setColour(GuiMiniArmourerHelper.getColourFromId(colourId + 2).getRGB(), 2);
colour.setColour(GuiMiniArmourerHelper.getColourFromId(colourId + 3).getRGB(), 3);
colour.setColour(GuiMiniArmourerHelper.getColourFromId(colourId + 4).getRGB(), 4);
colour.setColour(GuiMiniArmourerHelper.getColourFromId(colourId + 5).getRGB(), 5);
} else {
colour = cube.getCubeColour();
}
renderArmourBlock((byte) cube.getX(), (byte) cube.getY(), (byte) cube.getZ(), colour, scale, false);
if (cube.isGlowing() & !fake) {
ModRenderHelper.enableLighting();
GL11.glEnable(GL11.GL_LIGHTING);
}
}
colourId += 6;
}
buff.draw();
if (fake) {
GL11.glEnable(GL11.GL_LIGHTING);
}
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
Aggregations