diff --git a/src/main/resources/reference.conf b/src/main/resources/reference.conf index 76939ec69..93efe06e6 100644 --- a/src/main/resources/reference.conf +++ b/src/main/resources/reference.conf @@ -66,6 +66,11 @@ opencomputers { # hologram projector when at maximum scale. Render distance is scaled # down with the actual scale of the hologram. hologramRenderDistance: 64 + + # This controls how often holograms 'flicker'. This is the chance that it + # flickers for *each frame*, meaning if you're running at high FPS you + # may want to lower this a bit, to avoid it flickering too much. + hologramFlickerFrequency: 0.025 } # Computer related settings, concerns server performance and security. diff --git a/src/main/scala/li/cil/oc/Settings.scala b/src/main/scala/li/cil/oc/Settings.scala index 38df2498d..e455b0573 100644 --- a/src/main/scala/li/cil/oc/Settings.scala +++ b/src/main/scala/li/cil/oc/Settings.scala @@ -32,6 +32,7 @@ class Settings(config: Config) { val soundVolume = config.getDouble("client.soundVolume").toFloat max 0 min 2 val fontCharScale = config.getDouble("client.fontCharScale") max 0.5 min 2 val hologramRenderDistance = config.getDouble("client.hologramRenderDistance") max 0 + val hologramFlickerFrequency = config.getDouble("client.hologramFlickerFrequency") max 0 // ----------------------------------------------------------------------- // // computer diff --git a/src/main/scala/li/cil/oc/client/renderer/tileentity/HologramRenderer.scala b/src/main/scala/li/cil/oc/client/renderer/tileentity/HologramRenderer.scala index 6c85741cc..3bdb5e46e 100644 --- a/src/main/scala/li/cil/oc/client/renderer/tileentity/HologramRenderer.scala +++ b/src/main/scala/li/cil/oc/client/renderer/tileentity/HologramRenderer.scala @@ -12,7 +12,7 @@ import net.minecraft.client.renderer.{GLAllocation, Tessellator} import net.minecraft.tileentity.TileEntity import org.lwjgl.opengl.GL11 import scala.util.Random -import org.lwjgl.input.Keyboard +import li.cil.oc.Settings object HologramRenderer extends TileEntitySpecialRenderer with Callable[Int] with RemovalListener[TileEntity, Int] with ITickHandler { val random = new Random() @@ -41,7 +41,7 @@ object HologramRenderer extends TileEntitySpecialRenderer with Callable[Int] wit GL11.glTranslated(-1.5 * hologram.scale, 0, -1.5 * hologram.scale) // Do a bit of flickering, because that's what holograms do! - if (random.nextDouble() < 0.025) { + if (Settings.get.hologramFlickerFrequency > 0 && random.nextDouble() < Settings.get.hologramFlickerFrequency) { GL11.glScaled(1 + random.nextGaussian() * 0.01, 1 + random.nextGaussian() * 0.001, 1 + random.nextGaussian() * 0.01) GL11.glTranslated(random.nextGaussian() * 0.01, random.nextGaussian() * 0.01, random.nextGaussian() * 0.01) }