From 54a737aa617856332595de6c1a9ffa1aa4c0e975 Mon Sep 17 00:00:00 2001 From: ceikry Date: Fri, 5 Nov 2021 11:35:06 -0500 Subject: [PATCH] Perfected wall rendering --- src/main/kotlin/ui/MapCell.kt | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/main/kotlin/ui/MapCell.kt b/src/main/kotlin/ui/MapCell.kt index 8e87037..17e281a 100644 --- a/src/main/kotlin/ui/MapCell.kt +++ b/src/main/kotlin/ui/MapCell.kt @@ -265,16 +265,16 @@ class MapCell : JPanel() { if (sc.id == 85) return when (sc.rotation) { 0 -> { - pointX1 = 2; pointY1 = this.height; pointX2 = 2; pointY2 = 0 + pointX1 = 1; pointY1 = this.height - 1; pointX2 = 1; pointY2 = 1 } 1 -> { - pointX1 = 0; pointY1 = 2; pointX2 = this.width; pointY2 = 2 + pointX1 = 1; pointY1 = 1; pointX2 = this.width - 1; pointY2 = 1 } 2 -> { - pointX1 = this.width - 2; pointY1 = 0; pointX2 = this.width - 2; pointY2 = this.height + pointX1 = this.width - 1; pointY1 = 1; pointX2 = this.width - 1; pointY2 = this.height - 1 } 3 -> { - pointX1 = 0; pointY1 = this.height - 2; pointX2 = this.width; pointY2 = this.height - 2 + pointX1 = 1; pointY1 = this.height - 1; pointX2 = this.width - 1; pointY2 = this.height - 1 } } if (sc.definition.interactive == 1 && sc.type == 0) { @@ -290,23 +290,16 @@ class MapCell : JPanel() { var yArray: IntArray = intArrayOf(0, 0, 0, 0) when (sc.rotation) { 0 -> { - xArray = intArrayOf(2, 2, 2, this.width); yArray = intArrayOf(2, this.height, 2, 2) + xArray = intArrayOf(1, 1, 1, this.width - 1); yArray = intArrayOf(1, this.height - 1, 1, 1) } 1 -> { - xArray = intArrayOf(0, this.width, this.width - 2, this.width - 2); yArray = - intArrayOf(2, 2, 2, this.height) + xArray = intArrayOf(1, this.width - 1, this.width - 1, this.width - 1); yArray = intArrayOf(1, 1, 1, this.height - 1) } 2 -> { - xArray = intArrayOf(0, this.width, this.width, this.width); yArray = - intArrayOf(this.height - 2, this.height - 2, 0, this.height - 2) + xArray = intArrayOf(1, this.width - 1, this.width - 1, this.width - 1); yArray = intArrayOf(this.height - 1, this.height - 1, 1, this.height - 1) } 3 -> { - xArray = intArrayOf(0, 0, 0, this.width); intArrayOf( - 0, - this.height - 2, - this.height - 2, - this.height - 2 - ) + xArray = intArrayOf(1,1,1,this.width - 1); yArray = intArrayOf(1,this.height - 1, this.height - 1, this.height - 1) } } if (sc.definition.interactive == 1) {