diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index ff9a892af..48ce41d8c 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -82,6 +82,15 @@ opencomputers { # may want to lower this a bit, to avoid it flickering too much. hologramFlickerFrequency: 0.025 + # Maximum scale of the Hologram + # Normal size is 3x2x3 + # 3 means a maximum of 9x6x9 + # Warning: To big will maks grafik problems. + hologramMaxScale: [ + 3 + 4 + ] + # Used to suppress log spam for OpenGL errors on derpy drivers. I'm # quite certain the code in the font render is valid, display list # compatible OpenGL, but it seems to cause 'invalid operation' errors diff --git a/src/main/scala/li/cil/oc/Settings.scala b/src/main/scala/li/cil/oc/Settings.scala index 3af863a36..1e22f493a 100644 --- a/src/main/scala/li/cil/oc/Settings.scala +++ b/src/main/scala/li/cil/oc/Settings.scala @@ -38,6 +38,13 @@ class Settings(config: Config) { val hologramFadeStartDistance = config.getDouble("client.hologramFadeStartDistance") max 0 val hologramRenderDistance = config.getDouble("client.hologramRenderDistance") max 0 val hologramFlickerFrequency = config.getDouble("client.hologramFlickerFrequency") max 0 + val hologramMaxScaleByTier = Array(config.getIntList("client.hologramMaxScale"): _*) match { + case Array(tier1, tier2) => + Array(tier1: Int, tier2: Int) + case _ => + OpenComputers.log.warning("Bad number of hologramMaxScale, ignoring.") + Array(3, 4) + } val logOpenGLErrors = config.getBoolean("client.logOpenGLErrors") val useOldTextureFontRenderer = config.getBoolean("client.useOldTextureFontRenderer") @@ -239,7 +246,6 @@ object Settings { val scriptPath = "/assets/" + resourceDomain + "/lua/" val screenResolutionsByTier = Array((50, 16), (80, 25), (160, 50)) val screenDepthsByTier = Array(ColorDepth.OneBit, ColorDepth.FourBit, ColorDepth.EightBit) - val hologramMaxScaleByTier = Array(3, 4) val robotComplexityByTier = Array(12, 24, 32, 9001) var rTreeDebugRenderer = false var blockRenderId = -1 diff --git a/src/main/scala/li/cil/oc/common/tileentity/Hologram.scala b/src/main/scala/li/cil/oc/common/tileentity/Hologram.scala index 1889ca8a0..da0437f23 100644 --- a/src/main/scala/li/cil/oc/common/tileentity/Hologram.scala +++ b/src/main/scala/li/cil/oc/common/tileentity/Hologram.scala @@ -205,7 +205,7 @@ class Hologram(var tier: Int) extends traits.Environment with SidedEnvironment w @Callback(doc = """function(value:number) -- Set the render scale. A larger scale consumes more energy.""") def setScale(computer: Context, args: Arguments): Array[AnyRef] = { - scale = math.max(0.333333, math.min(Settings.hologramMaxScaleByTier(tier), args.checkDouble(0))) + scale = math.max(0.333333, math.min(Settings.get.hologramMaxScaleByTier(tier), args.checkDouble(0))) ServerPacketSender.sendHologramScale(this) null } @@ -297,9 +297,9 @@ class Hologram(var tier: Int) extends traits.Environment with SidedEnvironment w override def shouldRenderInPass(pass: Int) = pass == 1 - override def getMaxRenderDistanceSquared = scale / Settings.hologramMaxScaleByTier.max * Settings.get.hologramRenderDistance * Settings.get.hologramRenderDistance + override def getMaxRenderDistanceSquared = scale / Settings.get.hologramMaxScaleByTier.max * Settings.get.hologramRenderDistance * Settings.get.hologramRenderDistance - def getFadeStartDistanceSquared = scale / Settings.hologramMaxScaleByTier.max * Settings.get.hologramFadeStartDistance * Settings.get.hologramFadeStartDistance + def getFadeStartDistanceSquared = scale / Settings.get.hologramMaxScaleByTier.max * Settings.get.hologramFadeStartDistance * Settings.get.hologramFadeStartDistance override def getRenderBoundingBox = AxisAlignedBB.getAABBPool.getAABB(xCoord + 0.5 - 1.5 * scale, yCoord, zCoord - scale, xCoord + 0.5 + 1.5 * scale, yCoord + 0.25 + 2 * scale, zCoord + 0.5 + 1.5 * scale)