mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-08-03 11:07:23 -04:00
fix raw set fg and bg methods for row, col, and even the color fields. closes #3401
This commit is contained in:
parent
90be0181bc
commit
4a50b50725
4
.gitignore
vendored
4
.gitignore
vendored
@ -25,3 +25,7 @@
|
||||
# VSCode
|
||||
/.vscode
|
||||
/saves
|
||||
/logs
|
||||
/config
|
||||
/options.txt
|
||||
/usernamecache.json
|
||||
|
@ -130,9 +130,9 @@ trait TextBufferProxy extends api.internal.TextBuffer {
|
||||
for (y <- row until ((row + color.length) min data.height)) {
|
||||
val line = color(y - row)
|
||||
for (x <- col until ((col + line.length) min data.width)) {
|
||||
val packedBackground = data.format.deflate(PackedColor.Color(line(x - col))) & 0x00FF
|
||||
val packedForeground = data.color(row)(col) & 0xFF00
|
||||
data.color(row)(col) = (packedForeground | packedBackground).toShort
|
||||
val packedBackground = data.color(y)(x) & 0x00FF
|
||||
val packedForeground = (data.format.deflate(PackedColor.Color(line(x - col))) << PackedColor.ForegroundShift) & 0xFF00
|
||||
data.color(y)(x) = (packedForeground | packedBackground).toShort
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -141,9 +141,9 @@ trait TextBufferProxy extends api.internal.TextBuffer {
|
||||
for (y <- row until ((row + color.length) min data.height)) {
|
||||
val line = color(y - row)
|
||||
for (x <- col until ((col + line.length) min data.width)) {
|
||||
val packedBackground = data.color(row)(col) & 0x00FF
|
||||
val packedForeground = (data.format.deflate(PackedColor.Color(line(x - col))) << PackedColor.ForegroundShift) & 0xFF00
|
||||
data.color(row)(col) = (packedForeground | packedBackground).toShort
|
||||
val packedBackground = data.format.deflate(PackedColor.Color(line(x - col))) & 0x00FF
|
||||
val packedForeground = data.color(y)(x) & 0xFF00
|
||||
data.color(y)(x) = (packedForeground | packedBackground).toShort
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user