Merge branch 'master' of github.com:MightyPirates/OpenComputers into MC1.7

This commit is contained in:
Florian Nücke 2014-04-02 20:15:24 +02:00
commit dc92987fc9
2 changed files with 10 additions and 11 deletions

View File

@ -456,15 +456,14 @@ opencomputers {
# The amount of energy a screen consumes per tick. For each lit pixel # The amount of energy a screen consumes per tick. For each lit pixel
# (each character that is not blank) this cost increases linearly: # (each character that is not blank) this cost increases linearly:
# for basic screens, if all pixels are lit the cost per tick will be # 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 # this value. Higher tier screens can become even more expensive to
# more expensive to run, due to their higher resolution. If a screen # run, due to their higher resolution. If a screen cannot consume the
# cannot consume the defined amount of energy it will stop rendering # defined amount of energy it will stop rendering the text that
# the text that should be displayed on it. It will *not* forget that # should be displayed on it. It will *not* forget that text, however,
# text, however, so when enough power is available again it will # so when enough power is available again it will restore the
# restore the previously displayed text (with any changes possibly # previously displayed text (with any changes possibly made in the
# made in the meantime). Note that for multi-block screens *each* # meantime). Note that for multi-block screens *each* screen that is
# screen that is part of it will consume this amount of energy per # part of it will consume this amount of energy per tick.
# tick.
screen: 0.05 screen: 0.05
# The amount of energy a hologram projetor consumes per tick. This # The amount of energy a hologram projetor consumes per tick. This

View File

@ -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 // The relative lit area is the number of pixels that are not blank
// versus the number of pixels in the *current* resolution. This is // versus the number of pixels in the *current* resolution. This is
// scaled to multi-block screens, since we only compute this for the // 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 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(' ' !=) (acc, line) => acc + line.count(' ' !=)
} / (w * h).toDouble } / (w * h).toDouble
} }