mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
option for clients to select whether text on screens should be anti-aliased or not
This commit is contained in:
parent
55524c4a78
commit
ca52ec37a6
BIN
assets/opencomputers/textures/font/chars_aliased.png
Normal file
BIN
assets/opencomputers/textures/font/chars_aliased.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
@ -21,6 +21,7 @@ class Settings(config: Config) {
|
||||
val screenTextFadeStartDistance = config.getDouble("client.screenTextFadeStartDistance")
|
||||
val maxScreenTextRenderDistance = config.getDouble("client.maxScreenTextRenderDistance")
|
||||
val textLinearFiltering = config.getBoolean("client.textLinearFiltering")
|
||||
val textAntiAlias = config.getBoolean("client.textAntiAlias")
|
||||
val rTreeDebugRenderer = false // *Not* to be configurable via config file.
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
@ -11,6 +11,7 @@ import scala.io.Source
|
||||
|
||||
object MonospaceFontRenderer {
|
||||
val font = new ResourceLocation(Settings.resourceDomain, "textures/font/chars.png")
|
||||
val fontAliased = new ResourceLocation(Settings.resourceDomain, "textures/font/chars_aliased.png")
|
||||
|
||||
private val chars = Source.fromInputStream(MonospaceFontRenderer.getClass.getResourceAsStream("/assets/" + Settings.resourceDomain + "/textures/font/chars.txt"))("UTF-8").mkString
|
||||
|
||||
@ -71,7 +72,10 @@ object MonospaceFontRenderer {
|
||||
def drawString(x: Int, y: Int, value: Array[Char], color: Array[Short], depth: PackedColor.Depth.Value) = {
|
||||
if (color.length != value.length) throw new IllegalArgumentException("Color count must match char count.")
|
||||
|
||||
textureManager.bindTexture(MonospaceFontRenderer.font)
|
||||
if (Settings.get.textAntiAlias)
|
||||
textureManager.bindTexture(MonospaceFontRenderer.font)
|
||||
else
|
||||
textureManager.bindTexture(MonospaceFontRenderer.fontAliased)
|
||||
GL11.glPushMatrix()
|
||||
GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_TEXTURE_BIT)
|
||||
GL11.glTranslatef(x, y, 0)
|
||||
|
@ -1351,7 +1351,7 @@ class Computer(val owner: tileentity.Computer) extends ManagedComponent with Con
|
||||
catch {
|
||||
case e: LuaRuntimeException =>
|
||||
OpenComputers.log.warning("Kernel crashed. This is a bug!\n" + e.toString + "\tat " + e.getLuaStackTrace.mkString("\n\tat "))
|
||||
crash("kernel panic")
|
||||
crash("kernel panic: this is a bug, check your log file and report it")
|
||||
case e: LuaGcMetamethodException =>
|
||||
if (e.getMessage != null) crash("kernel panic:\n" + e.getMessage)
|
||||
else crash("kernel panic:\nerror in garbage collection metamethod")
|
||||
@ -1361,7 +1361,7 @@ class Computer(val owner: tileentity.Computer) extends ManagedComponent with Con
|
||||
crash("not enough memory")
|
||||
case e: Throwable =>
|
||||
OpenComputers.log.log(Level.WARNING, "Unexpected error in kernel. This is a bug!\n", e)
|
||||
crash("kernel panic")
|
||||
crash("kernel panic: this is a bug, check your log file and report it")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,10 @@ opencomputers {
|
||||
# anymore (for example for box drawing characters. Look it up on
|
||||
# Wikipedia.)
|
||||
textLinearFiltering: false
|
||||
|
||||
# If you prefer the text on the screens to be aliased (you know, *not*
|
||||
# anti-aliased / smoothed) turn this option off.
|
||||
textAntiAlias: true
|
||||
}
|
||||
|
||||
# Computer related settings, concerns server performance and security.
|
||||
|
Loading…
x
Reference in New Issue
Block a user