mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
removing maxBlend function; only use maxAndAssign from now on
This commit is contained in:
@@ -362,7 +362,7 @@ object LightmapRenderer {
|
|||||||
val ux = m.x + for_x_start - overscan_open
|
val ux = m.x + for_x_start - overscan_open
|
||||||
val uy = m.y + for_y_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 */
|
/** infix is removed to clarify the association direction */
|
||||||
fun Color.maxAndAssign(other: Color): Color {
|
fun Color.maxAndAssign(other: Color): Color {
|
||||||
this.set(
|
this.set(
|
||||||
|
|||||||
Reference in New Issue
Block a user