Fixed screen resolution changes not being applied to the GUI without re-opening it.

This commit is contained in:
Florian Nücke 2014-05-31 01:45:33 +02:00
parent 22d020004c
commit 4c39ee547c
2 changed files with 14 additions and 9 deletions

View File

@ -375,8 +375,15 @@ object TextBuffer {
var dirty = false
var lastChange = 0L
var nodeAddress = ""
def markDirty() {
dirty = true
lastChange = owner.owner.world.getWorldTime
}
def render() = false
def onScreenColorChange()
@ -418,36 +425,35 @@ object TextBuffer {
class ClientProxy(val owner: TextBuffer) extends Proxy {
override def render() = {
val wasDirty = dirty
TextBufferRenderCache.render(owner)
wasDirty
lastChange == owner.owner.world.getWorldTime
}
override def onScreenColorChange() {
dirty = true
markDirty()
}
override def onScreenCopy(col: Int, row: Int, w: Int, h: Int, tx: Int, ty: Int) {
super.onScreenCopy(col, row, w, h, tx, ty)
dirty = true
markDirty()
}
override def onScreenDepthChange(depth: ColorDepth) {
dirty = true
markDirty()
}
override def onScreenFill(col: Int, row: Int, w: Int, h: Int, c: Char) {
super.onScreenFill(col, row, w, h, c)
dirty = true
markDirty()
}
override def onScreenPaletteChange(index: Int) {
dirty = true
markDirty()
}
override def onScreenResolutionChange(w: Int, h: Int) {
super.onScreenResolutionChange(w, h)
dirty = true
markDirty()
}
override def onScreenSet(col: Int, row: Int, s: String, vertical: Boolean) {

View File

@ -9,7 +9,6 @@ import li.cil.oc.common.component
import li.cil.oc.util.PackedColor
import net.minecraft.nbt.NBTTagCompound
import net.minecraft.util.StatCollector
import scala.collection.convert.WrapAsScala._
abstract class GraphicsCard extends component.ManagedComponent {
val node = Network.newNode(this, Visibility.Neighbors).