From 9debdece9ed83d007711b3f57762ad18b7a852b1 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 11 Apr 2024 08:11:21 +0100 Subject: [PATCH] cleanup isometric head --- src/main/java/cc.fascinated/model/player/Skin.java | 9 ++++----- .../cc.fascinated/service/skin/impl/BodyRenderer.java | 8 ++++---- .../cc.fascinated/service/skin/impl/HeadRenderer.java | 4 ++-- .../service/skin/impl/IsometricHeadRenderer.java | 4 ++-- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/main/java/cc.fascinated/model/player/Skin.java b/src/main/java/cc.fascinated/model/player/Skin.java index 3822090..5f3921d 100644 --- a/src/main/java/cc.fascinated/model/player/Skin.java +++ b/src/main/java/cc.fascinated/model/player/Skin.java @@ -146,14 +146,13 @@ public class Skin { @AllArgsConstructor @Getter 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_FRONT(8, 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_LEFT(32, 52, 8, 12, null), BODY_RIGHT(44, 20, 8, 12, null), @@ -167,8 +166,8 @@ public class Skin { /** * Skin overlay (layer) positions */ + HEAD_OVERLAY_FACE(40, 8, 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), BODY_OVERLAY_FRONT(20, 36, 8, 12, null), diff --git a/src/main/java/cc.fascinated/service/skin/impl/BodyRenderer.java b/src/main/java/cc.fascinated/service/skin/impl/BodyRenderer.java index ad8aa96..12d4d07 100644 --- a/src/main/java/cc.fascinated/service/skin/impl/BodyRenderer.java +++ b/src/main/java/cc.fascinated/service/skin/impl/BodyRenderer.java @@ -23,15 +23,15 @@ public class BodyRenderer extends SkinRenderer { Graphics2D graphics = outputImage.createGraphics(); // Get all the required body parts - BufferedImage head = this.getSkinPart(skin, Skin.PartPosition.HEAD, 1); - BufferedImage body = this.getSkinPart(skin, Skin.PartPosition.BODY, 1); + BufferedImage face = this.getSkinPart(skin, Skin.PartPosition.HEAD_FACE, 1); + BufferedImage body = this.getSkinPart(skin, Skin.PartPosition.BODY_FRONT, 1); BufferedImage rightArm = this.getSkinPart(skin, Skin.PartPosition.RIGHT_ARM, 1); BufferedImage leftArm = this.getSkinPart(skin, Skin.PartPosition.LEFT_ARM, 1); BufferedImage rightLeg = this.getSkinPart(skin, Skin.PartPosition.RIGHT_LEG, 1); BufferedImage leftLeg = this.getSkinPart(skin, Skin.PartPosition.LEFT_LEG, 1); 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(rightArm, this.getSkinPart(skin, Skin.PartPosition.RIGHT_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 - graphics.drawImage(head, 4, 0, null); + graphics.drawImage(face, 4, 0, null); graphics.drawImage(body, 4, 8, null); graphics.drawImage(rightArm, skin.getModel() == Skin.Model.SLIM ? 1 : 0, 8, null); graphics.drawImage(leftArm, 12, 8, null); diff --git a/src/main/java/cc.fascinated/service/skin/impl/HeadRenderer.java b/src/main/java/cc.fascinated/service/skin/impl/HeadRenderer.java index 0f7de56..017bdfa 100644 --- a/src/main/java/cc.fascinated/service/skin/impl/HeadRenderer.java +++ b/src/main/java/cc.fascinated/service/skin/impl/HeadRenderer.java @@ -21,10 +21,10 @@ public class HeadRenderer extends SkinRenderer { Graphics2D graphics = outputImage.createGraphics(); 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 - 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); diff --git a/src/main/java/cc.fascinated/service/skin/impl/IsometricHeadRenderer.java b/src/main/java/cc.fascinated/service/skin/impl/IsometricHeadRenderer.java index 6e09b1c..1ff62c6 100644 --- a/src/main/java/cc.fascinated/service/skin/impl/IsometricHeadRenderer.java +++ b/src/main/java/cc.fascinated/service/skin/impl/IsometricHeadRenderer.java @@ -34,12 +34,12 @@ public class IsometricHeadRenderer extends SkinRenderer { // Get all the required head parts 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); if (renderOverlay) { // Render the skin layers 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)); }