bitblt fix for same device, and better markDirty code

This commit is contained in:
payonel 2020-05-18 02:36:58 -07:00
parent fabe7bac43
commit 1ecd2b1e6e
2 changed files with 3 additions and 5 deletions

View File

@ -648,12 +648,12 @@ object TextBuffer {
override def onBufferSet(col: Int, row: Int, s: String, vertical: Boolean) {
super.onBufferSet(col, row, s, vertical)
dirty = true
markDirty()
}
override def onBufferBitBlt(col: Int, row: Int, w: Int, h: Int, id: Int, fromCol: Int, fromRow: Int): Unit = {
super.onBufferBitBlt(col, row, w, h, id, fromCol, fromRow)
dirty = true
markDirty()
}
override def onBufferRamInit(id: Int, buffer: TextBufferProxy): Unit = {

View File

@ -232,7 +232,7 @@ class GraphicsCard(val tier: Int) extends prefab.ManagedEnvironment with DeviceI
if (dstIdx == srcIdx) {
val tx = col - fromCol
val ty = row - fromRow
dst.copy(col, row, w, h, tx, ty)
dst.copy(fromCol - 1, fromRow - 1, w, h, tx, ty)
result(true)
} else {
// at least one of the two buffers is a gpu buffer
@ -454,8 +454,6 @@ class GraphicsCard(val tier: Int) extends prefab.ManagedEnvironment with DeviceI
val vertical = args.optBoolean(3, false)
screen(s => {
val x2 = if (vertical) x else x + value.length - 1
val y2 = if (!vertical) y else y + value.length - 1
if (consumeViewportPower(s, context, setCosts(tier), value.length, Settings.get.gpuSetCost)) {
s.set(x, y, value, vertical)
result(true)