From 5d12dad974b484bc4fc1b27dcc6c6e4106e6cfc4 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Mon, 4 Feb 2019 18:47:16 +0900 Subject: [PATCH] removing maxBlend function; only use maxAndAssign from now on --- .../terrarum/worlddrawer/LightmapRendererNew.kt | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/net/torvald/terrarum/worlddrawer/LightmapRendererNew.kt b/src/net/torvald/terrarum/worlddrawer/LightmapRendererNew.kt index 1bb865dd4..08fafc547 100644 --- a/src/net/torvald/terrarum/worlddrawer/LightmapRendererNew.kt +++ b/src/net/torvald/terrarum/worlddrawer/LightmapRendererNew.kt @@ -362,7 +362,7 @@ object LightmapRenderer { val ux = m.x + for_x_start - overscan_open val uy = m.y + for_y_start - overscan_open - (oldCol ?: colourNull) maxBlend calculate(ux, uy) + (oldCol ?: colourNull).cpy().maxAndAssign(calculate(ux, uy)) } } } @@ -772,20 +772,6 @@ object LightmapRenderer { ) } - /** Get each channel from two RGB values, return new RGB that has max value of each channel - * @param rgb - * @param rgb2 - * @return - */ - infix fun Color.maxBlend(other: Color): Color { - return Color( - if (this.r > other.r) this.r else other.r, - if (this.g > other.g) this.g else other.g, - if (this.b > other.b) this.b else other.b, - if (this.a > other.a) this.a else other.a - ) - } - /** infix is removed to clarify the association direction */ fun Color.maxAndAssign(other: Color): Color { this.set(