4.6.10-patch2

Resolved #9363 #9356 - solved font crash exception
This commit is contained in:
Yair Morgenstern 2023-05-10 10:28:44 +03:00
parent a3ef6fa314
commit be20c917cc
3 changed files with 3 additions and 11 deletions

View File

@ -3,8 +3,8 @@ package com.unciv.build
object BuildConfig {
const val kotlinVersion = "1.8.0"
const val appName = "Unciv"
const val appCodeNumber = 863
const val appVersion = "4.6.10-patch1"
const val appCodeNumber = 864
const val appVersion = "4.6.10-patch2"
const val gdxVersion = "1.11.0"
const val roboVMVersion = "2.3.1"

View File

@ -531,7 +531,7 @@ open class UncivGame(val isConsoleMode: Boolean = false) : Game(), PlatformSpeci
companion object {
//region AUTOMATICALLY GENERATED VERSION DATA - DO NOT CHANGE THIS REGION, INCLUDING THIS COMMENT
val VERSION = Version("4.6.10-patch1", 863)
val VERSION = Version("4.6.10-patch2", 864)
//endregion
lateinit var Current: UncivGame

View File

@ -197,7 +197,6 @@ object Fonts {
lateinit var fontImplementation: FontImplementation
lateinit var font: BitmapFont
var oldFont: BitmapFont? = null
/** This resets all cached font data in object Fonts.
* Do not call from normal code - reset the Skin instead: `BaseScreen.setSkin()`
@ -205,13 +204,6 @@ object Fonts {
fun resetFont() {
val settings = GUI.getSettings()
fontImplementation.setFontFamily(settings.fontFamilyData, settings.getFontSize())
if (::font.isInitialized) {
// We don't dispose the old font immediately since there may be objects using it.
// Instead, we wait for the *next* time the font is reset - since by then all usages of the old font should not exist either - #9338
// Don't font.dispose() even it it seems obvious -> leaves only black rectangles - See #9325
(oldFont?.data as? NativeBitmapFontData)?.dispose()
oldFont = font
}
font = fontImplementation.getBitmapFont()
font.data.markupEnabled = true
}