From af9a34a6af53b528ea654d23a960acdbb2425af3 Mon Sep 17 00:00:00 2001 From: payonel Date: Sat, 23 May 2020 23:45:01 -0700 Subject: [PATCH] fixed mixed tier gpu and screen bitblt --- src/main/scala/li/cil/oc/util/TextBuffer.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/scala/li/cil/oc/util/TextBuffer.scala b/src/main/scala/li/cil/oc/util/TextBuffer.scala index 382a425a5..3f867ff49 100644 --- a/src/main/scala/li/cil/oc/util/TextBuffer.scala +++ b/src/main/scala/li/cil/oc/util/TextBuffer.scala @@ -215,7 +215,14 @@ class TextBuffer(var width: Int, var height: Int, initialFormat: PackedColor.Col val dstColorLine = color(row_index + yOffset) for (xOffset <- 0 until w) { val srcChar = src.buffer(fromRow + yOffset - 1)(fromCol + xOffset - 1) - val srcColor = src.color(fromRow + yOffset - 1)(fromCol + xOffset - 1) + var srcColor = src.color(fromRow + yOffset - 1)(fromCol + xOffset - 1) + + if (this.format.depth != src.format.depth) { + val fg = PackedColor.Color(PackedColor.unpackForeground(srcColor, src.format)) + val bg = PackedColor.Color(PackedColor.unpackBackground(srcColor, src.format)) + srcColor = PackedColor.pack(fg, bg, format) + } + if (srcChar != dstCharLine(col_index + xOffset) || srcColor != dstColorLine(col_index + xOffset)) { changed = true dstCharLine(col_index + xOffset) = srcChar