forked from MinecraftUtilities/Backend
cleanup isometric head
This commit is contained in:
parent
9acb7c259a
commit
9debdece9e
@ -146,14 +146,13 @@ public class Skin {
|
|||||||
@AllArgsConstructor @Getter
|
@AllArgsConstructor @Getter
|
||||||
public enum PartPosition {
|
public enum PartPosition {
|
||||||
/**
|
/**
|
||||||
* Skin postions
|
* Skin positions
|
||||||
*/
|
*/
|
||||||
HEAD(8, 8, 8, 8, null),
|
HEAD_FACE(8, 8, 8, 8, null),
|
||||||
HEAD_TOP(8, 0, 8, 8, null),
|
HEAD_TOP(8, 0, 8, 8, null),
|
||||||
HEAD_FRONT(8, 8, 8, 8, null),
|
|
||||||
HEAD_LEFT(0, 8, 8, 8, null),
|
HEAD_LEFT(0, 8, 8, 8, null),
|
||||||
|
|
||||||
BODY(20, 20, 8, 12, null),
|
BODY_FRONT(20, 20, 8, 12, null),
|
||||||
BODY_BACK(20, 36, 8, 12, null),
|
BODY_BACK(20, 36, 8, 12, null),
|
||||||
BODY_LEFT(32, 52, 8, 12, null),
|
BODY_LEFT(32, 52, 8, 12, null),
|
||||||
BODY_RIGHT(44, 20, 8, 12, null),
|
BODY_RIGHT(44, 20, 8, 12, null),
|
||||||
@ -167,8 +166,8 @@ public class Skin {
|
|||||||
/**
|
/**
|
||||||
* Skin overlay (layer) positions
|
* Skin overlay (layer) positions
|
||||||
*/
|
*/
|
||||||
|
HEAD_OVERLAY_FACE(40, 8, 8, 8, null),
|
||||||
HEAD_OVERLAY_TOP(40, 0, 8, 8, null),
|
HEAD_OVERLAY_TOP(40, 0, 8, 8, null),
|
||||||
HEAD_OVERLAY_FRONT(40, 8, 8, 8, null),
|
|
||||||
HEAD_OVERLAY_LEFT(48, 8, 8, 8, null),
|
HEAD_OVERLAY_LEFT(48, 8, 8, 8, null),
|
||||||
|
|
||||||
BODY_OVERLAY_FRONT(20, 36, 8, 12, null),
|
BODY_OVERLAY_FRONT(20, 36, 8, 12, null),
|
||||||
|
@ -23,15 +23,15 @@ public class BodyRenderer extends SkinRenderer {
|
|||||||
Graphics2D graphics = outputImage.createGraphics();
|
Graphics2D graphics = outputImage.createGraphics();
|
||||||
|
|
||||||
// Get all the required body parts
|
// Get all the required body parts
|
||||||
BufferedImage head = this.getSkinPart(skin, Skin.PartPosition.HEAD, 1);
|
BufferedImage face = this.getSkinPart(skin, Skin.PartPosition.HEAD_FACE, 1);
|
||||||
BufferedImage body = this.getSkinPart(skin, Skin.PartPosition.BODY, 1);
|
BufferedImage body = this.getSkinPart(skin, Skin.PartPosition.BODY_FRONT, 1);
|
||||||
BufferedImage rightArm = this.getSkinPart(skin, Skin.PartPosition.RIGHT_ARM, 1);
|
BufferedImage rightArm = this.getSkinPart(skin, Skin.PartPosition.RIGHT_ARM, 1);
|
||||||
BufferedImage leftArm = this.getSkinPart(skin, Skin.PartPosition.LEFT_ARM, 1);
|
BufferedImage leftArm = this.getSkinPart(skin, Skin.PartPosition.LEFT_ARM, 1);
|
||||||
BufferedImage rightLeg = this.getSkinPart(skin, Skin.PartPosition.RIGHT_LEG, 1);
|
BufferedImage rightLeg = this.getSkinPart(skin, Skin.PartPosition.RIGHT_LEG, 1);
|
||||||
BufferedImage leftLeg = this.getSkinPart(skin, Skin.PartPosition.LEFT_LEG, 1);
|
BufferedImage leftLeg = this.getSkinPart(skin, Skin.PartPosition.LEFT_LEG, 1);
|
||||||
|
|
||||||
if (renderOverlay) { // Render the skin layers
|
if (renderOverlay) { // Render the skin layers
|
||||||
applyOverlay(head, this.getSkinPart(skin, Skin.PartPosition.HEAD_OVERLAY_FRONT, 1));
|
applyOverlay(face, this.getSkinPart(skin, Skin.PartPosition.HEAD_OVERLAY_FACE, 1));
|
||||||
applyOverlay(body, this.getSkinPart(skin, Skin.PartPosition.BODY_OVERLAY_FRONT, 1));
|
applyOverlay(body, this.getSkinPart(skin, Skin.PartPosition.BODY_OVERLAY_FRONT, 1));
|
||||||
applyOverlay(rightArm, this.getSkinPart(skin, Skin.PartPosition.RIGHT_ARM_OVERLAY, 1));
|
applyOverlay(rightArm, this.getSkinPart(skin, Skin.PartPosition.RIGHT_ARM_OVERLAY, 1));
|
||||||
applyOverlay(leftArm, this.getSkinPart(skin, Skin.PartPosition.LEFT_ARM_OVERLAY, 1));
|
applyOverlay(leftArm, this.getSkinPart(skin, Skin.PartPosition.LEFT_ARM_OVERLAY, 1));
|
||||||
@ -40,7 +40,7 @@ public class BodyRenderer extends SkinRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Draw the body
|
// Draw the body
|
||||||
graphics.drawImage(head, 4, 0, null);
|
graphics.drawImage(face, 4, 0, null);
|
||||||
graphics.drawImage(body, 4, 8, null);
|
graphics.drawImage(body, 4, 8, null);
|
||||||
graphics.drawImage(rightArm, skin.getModel() == Skin.Model.SLIM ? 1 : 0, 8, null);
|
graphics.drawImage(rightArm, skin.getModel() == Skin.Model.SLIM ? 1 : 0, 8, null);
|
||||||
graphics.drawImage(leftArm, 12, 8, null);
|
graphics.drawImage(leftArm, 12, 8, null);
|
||||||
|
@ -21,10 +21,10 @@ public class HeadRenderer extends SkinRenderer {
|
|||||||
Graphics2D graphics = outputImage.createGraphics();
|
Graphics2D graphics = outputImage.createGraphics();
|
||||||
|
|
||||||
graphics.setTransform(AffineTransform.getScaleInstance(scale, scale));
|
graphics.setTransform(AffineTransform.getScaleInstance(scale, scale));
|
||||||
graphics.drawImage(this.getSkinPart(skin, Skin.PartPosition.HEAD, 1), 0, 0, null);
|
graphics.drawImage(this.getSkinPart(skin, Skin.PartPosition.HEAD_FACE, 1), 0, 0, null);
|
||||||
|
|
||||||
if (renderOverlay) { // Render the skin layers
|
if (renderOverlay) { // Render the skin layers
|
||||||
applyOverlay(outputImage, this.getSkinPart(skin, Skin.PartPosition.HEAD_OVERLAY_FRONT, 1));
|
applyOverlay(outputImage, this.getSkinPart(skin, Skin.PartPosition.HEAD_OVERLAY_FACE, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getBytes(outputImage, skin, partName);
|
return super.getBytes(outputImage, skin, partName);
|
||||||
|
@ -34,12 +34,12 @@ public class IsometricHeadRenderer extends SkinRenderer {
|
|||||||
|
|
||||||
// Get all the required head parts
|
// Get all the required head parts
|
||||||
BufferedImage headTop = this.getSkinPart(skin, Skin.PartPosition.HEAD_TOP, scale);
|
BufferedImage headTop = this.getSkinPart(skin, Skin.PartPosition.HEAD_TOP, scale);
|
||||||
BufferedImage headFront = this.getSkinPart(skin, Skin.PartPosition.HEAD_FRONT, scale);
|
BufferedImage headFront = this.getSkinPart(skin, Skin.PartPosition.HEAD_FACE, scale);
|
||||||
BufferedImage headLeft = this.getSkinPart(skin, Skin.PartPosition.HEAD_LEFT, scale);
|
BufferedImage headLeft = this.getSkinPart(skin, Skin.PartPosition.HEAD_LEFT, scale);
|
||||||
|
|
||||||
if (renderOverlay) { // Render the skin layers
|
if (renderOverlay) { // Render the skin layers
|
||||||
applyOverlay(headTop, this.getSkinPart(skin, Skin.PartPosition.HEAD_OVERLAY_TOP, scale));
|
applyOverlay(headTop, this.getSkinPart(skin, Skin.PartPosition.HEAD_OVERLAY_TOP, scale));
|
||||||
applyOverlay(headFront, this.getSkinPart(skin, Skin.PartPosition.HEAD_OVERLAY_FRONT, scale));
|
applyOverlay(headFront, this.getSkinPart(skin, Skin.PartPosition.HEAD_OVERLAY_FACE, scale));
|
||||||
applyOverlay(headLeft, this.getSkinPart(skin, Skin.PartPosition.HEAD_OVERLAY_LEFT, scale));
|
applyOverlay(headLeft, this.getSkinPart(skin, Skin.PartPosition.HEAD_OVERLAY_LEFT, scale));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user