diff --git a/src/main/resources/reference.conf b/src/main/resources/reference.conf index f1958a4c4..b206c4c84 100644 --- a/src/main/resources/reference.conf +++ b/src/main/resources/reference.conf @@ -456,15 +456,14 @@ opencomputers { # The amount of energy a screen consumes per tick. For each lit pixel # (each character that is not blank) this cost increases linearly: # for basic screens, if all pixels are lit the cost per tick will be - # twice as high as this value. Higher tier screens can become even - # more expensive to run, due to their higher resolution. If a screen - # cannot consume the defined amount of energy it will stop rendering - # the text that should be displayed on it. It will *not* forget that - # text, however, so when enough power is available again it will - # restore the previously displayed text (with any changes possibly - # made in the meantime). Note that for multi-block screens *each* - # screen that is part of it will consume this amount of energy per - # tick. + # this value. Higher tier screens can become even more expensive to + # run, due to their higher resolution. If a screen cannot consume the + # defined amount of energy it will stop rendering the text that + # should be displayed on it. It will *not* forget that text, however, + # so when enough power is available again it will restore the + # previously displayed text (with any changes possibly made in the + # meantime). Note that for multi-block screens *each* screen that is + # part of it will consume this amount of energy per tick. screen: 0.05 # The amount of energy a hologram projetor consumes per tick. This diff --git a/src/main/scala/li/cil/oc/common/tileentity/Screen.scala b/src/main/scala/li/cil/oc/common/tileentity/Screen.scala index f7a5ed1b4..07769710a 100644 --- a/src/main/scala/li/cil/oc/common/tileentity/Screen.scala +++ b/src/main/scala/li/cil/oc/common/tileentity/Screen.scala @@ -208,9 +208,9 @@ class Screen(var tier: Int) extends traits.TextBuffer with SidedEnvironment with // The relative lit area is the number of pixels that are not blank // versus the number of pixels in the *current* resolution. This is // scaled to multi-block screens, since we only compute this for the - // origin. We add 1 to make sure we at least consume `screenCost`. + // origin. val (w, h) = buffer.resolution - relativeLitArea = 1 + width * height * buffer.lines.foldLeft(0) { + relativeLitArea = width * height * buffer.lines.foldLeft(0) { (acc, line) => acc + line.count(' ' !=) } / (w * h).toDouble }