mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-08 06:41: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
|
||||||
/.vscode
|
/.vscode
|
||||||
/saves
|
/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)) {
|
for (y <- row until ((row + color.length) min data.height)) {
|
||||||
val line = color(y - row)
|
val line = color(y - row)
|
||||||
for (x <- col until ((col + line.length) min data.width)) {
|
for (x <- col until ((col + line.length) min data.width)) {
|
||||||
val packedBackground = data.format.deflate(PackedColor.Color(line(x - col))) & 0x00FF
|
val packedBackground = data.color(y)(x) & 0x00FF
|
||||||
val packedForeground = data.color(row)(col) & 0xFF00
|
val packedForeground = (data.format.deflate(PackedColor.Color(line(x - col))) << PackedColor.ForegroundShift) & 0xFF00
|
||||||
data.color(row)(col) = (packedForeground | packedBackground).toShort
|
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)) {
|
for (y <- row until ((row + color.length) min data.height)) {
|
||||||
val line = color(y - row)
|
val line = color(y - row)
|
||||||
for (x <- col until ((col + line.length) min data.width)) {
|
for (x <- col until ((col + line.length) min data.width)) {
|
||||||
val packedBackground = data.color(row)(col) & 0x00FF
|
val packedBackground = data.format.deflate(PackedColor.Color(line(x - col))) & 0x00FF
|
||||||
val packedForeground = (data.format.deflate(PackedColor.Color(line(x - col))) << PackedColor.ForegroundShift) & 0xFF00
|
val packedForeground = data.color(y)(x) & 0xFF00
|
||||||
data.color(row)(col) = (packedForeground | packedBackground).toShort
|
data.color(y)(x) = (packedForeground | packedBackground).toShort
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user