mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 03:05:30 -04:00
This commit is contained in:
commit
5ba5b3cea8
@ -82,6 +82,15 @@ opencomputers {
|
|||||||
# may want to lower this a bit, to avoid it flickering too much.
|
# may want to lower this a bit, to avoid it flickering too much.
|
||||||
hologramFlickerFrequency: 0.025
|
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
|
# 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
|
# quite certain the code in the font render is valid, display list
|
||||||
# compatible OpenGL, but it seems to cause 'invalid operation' errors
|
# compatible OpenGL, but it seems to cause 'invalid operation' errors
|
||||||
|
@ -38,6 +38,13 @@ class Settings(config: Config) {
|
|||||||
val hologramFadeStartDistance = config.getDouble("client.hologramFadeStartDistance") max 0
|
val hologramFadeStartDistance = config.getDouble("client.hologramFadeStartDistance") max 0
|
||||||
val hologramRenderDistance = config.getDouble("client.hologramRenderDistance") max 0
|
val hologramRenderDistance = config.getDouble("client.hologramRenderDistance") max 0
|
||||||
val hologramFlickerFrequency = config.getDouble("client.hologramFlickerFrequency") 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 logOpenGLErrors = config.getBoolean("client.logOpenGLErrors")
|
||||||
val useOldTextureFontRenderer = config.getBoolean("client.useOldTextureFontRenderer")
|
val useOldTextureFontRenderer = config.getBoolean("client.useOldTextureFontRenderer")
|
||||||
|
|
||||||
@ -239,7 +246,6 @@ object Settings {
|
|||||||
val scriptPath = "/assets/" + resourceDomain + "/lua/"
|
val scriptPath = "/assets/" + resourceDomain + "/lua/"
|
||||||
val screenResolutionsByTier = Array((50, 16), (80, 25), (160, 50))
|
val screenResolutionsByTier = Array((50, 16), (80, 25), (160, 50))
|
||||||
val screenDepthsByTier = Array(ColorDepth.OneBit, ColorDepth.FourBit, ColorDepth.EightBit)
|
val screenDepthsByTier = Array(ColorDepth.OneBit, ColorDepth.FourBit, ColorDepth.EightBit)
|
||||||
val hologramMaxScaleByTier = Array(3, 4)
|
|
||||||
val robotComplexityByTier = Array(12, 24, 32, 9001)
|
val robotComplexityByTier = Array(12, 24, 32, 9001)
|
||||||
var rTreeDebugRenderer = false
|
var rTreeDebugRenderer = false
|
||||||
var blockRenderId = -1
|
var blockRenderId = -1
|
||||||
|
@ -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.""")
|
@Callback(doc = """function(value:number) -- Set the render scale. A larger scale consumes more energy.""")
|
||||||
def setScale(computer: Context, args: Arguments): Array[AnyRef] = {
|
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)
|
ServerPacketSender.sendHologramScale(this)
|
||||||
null
|
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 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)
|
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)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user