removing maxBlend function; only use maxAndAssign from now on

This commit is contained in:
minjaesong
2019-02-04 18:47:16 +09:00
parent 5d8e64ca7f
commit 1301943e6a

View File

@@ -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(