mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 20:44:05 +09:00
audio engine: resize buffer without restarting the game
This commit is contained in:
@@ -34,6 +34,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
"MENU_IO_SAVE_GAME",
|
||||
"MENU_OPTIONS_CONTROLS",
|
||||
"MENU_LABEL_IME",
|
||||
"MENU_LABEL_SOUND",
|
||||
"MENU_LABEL_LANGUAGE",
|
||||
"MENU_LABEL_SHARE",
|
||||
"MENU_LABEL_QUIT",
|
||||
@@ -86,6 +87,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
private val languageUI = UITitleLanguage(null)
|
||||
private val keyboardSetupUI = UIIMEConfig(null)
|
||||
private val shareUI = UIShare()
|
||||
private val audioUI = UISoundControlPanel(null)
|
||||
|
||||
private var oldScreen = 0
|
||||
private var screen = 0
|
||||
@@ -156,12 +158,15 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
screen = 1; gameMenuButtons.deselect()
|
||||
}
|
||||
3 -> {
|
||||
screen = 5; gameMenuButtons.deselect()
|
||||
screen = 7; gameMenuButtons.deselect()
|
||||
}
|
||||
4 -> {
|
||||
screen = 6; gameMenuButtons.deselect()
|
||||
screen = 5; gameMenuButtons.deselect()
|
||||
}
|
||||
5 -> {
|
||||
screen = 6; gameMenuButtons.deselect()
|
||||
}
|
||||
6 -> {
|
||||
screen = 2; gameMenuButtons.deselect()
|
||||
}
|
||||
}
|
||||
@@ -183,7 +188,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
|
||||
// Completely unrelated to the gameMenuButtons order
|
||||
private val screens = arrayOf(
|
||||
gameMenuButtons, keyboardSetupUI, areYouSureMainMenuButtons, savingUI, keyConfigUI, languageUI, shareUI
|
||||
gameMenuButtons, keyboardSetupUI, areYouSureMainMenuButtons, savingUI, keyConfigUI, languageUI, shareUI, audioUI
|
||||
)
|
||||
|
||||
// `screens` order
|
||||
@@ -222,6 +227,11 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, controlHintX, full.yEnd - 20)
|
||||
shareUI.render(frameDelta, batch, camera)
|
||||
},
|
||||
{ frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, controlHintX, full.yEnd - 20)
|
||||
audioUI.render(frameDelta, batch, camera)
|
||||
},
|
||||
)
|
||||
|
||||
// `screens` order
|
||||
@@ -237,6 +247,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
},
|
||||
{ screenX: Int, screenY: Int, pointer: Int, button: Int -> },
|
||||
{ screenX: Int, screenY: Int, pointer: Int, button: Int -> },
|
||||
{ screenX: Int, screenY: Int, pointer: Int, button: Int -> },
|
||||
)
|
||||
|
||||
// `screens` order
|
||||
@@ -252,6 +263,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
},
|
||||
{ screenX: Int, screenY: Int, pointer: Int, button: Int -> },
|
||||
{ screenX: Int, screenY: Int, pointer: Int, button: Int -> },
|
||||
{ screenX: Int, screenY: Int, pointer: Int, button: Int -> },
|
||||
)
|
||||
|
||||
// `screens` order
|
||||
@@ -265,6 +277,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
{ amountX: Float, amountY: Float -> },
|
||||
{ amountX: Float, amountY: Float -> },
|
||||
{ amountX: Float, amountY: Float -> },
|
||||
{ amountX: Float, amountY: Float -> },
|
||||
)
|
||||
|
||||
override fun show() {
|
||||
|
||||
@@ -31,7 +31,7 @@ class UISoundControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
||||
arrayOf("", { "" }, "pp"),
|
||||
arrayOf("", { Lang["MENU_LABEL_AUDIO_ENGINE"] }, "h1"),
|
||||
arrayOf("audio_speaker_setup", { Lang["MENU_OPTIONS_SPEAKER_SETUP"] }, "textsel,headphone=MENU_OPTIONS_SPEAKER_HEADPHONE,stereo=MENU_OPTIONS_SPEAKER_STEREO"),
|
||||
arrayOf("audio_buffer_size", { Lang["MENU_OPTIONS_App.audioMixerBufferSize"] }, "spinnersel,128,256,512,1024,2048"),
|
||||
arrayOf("audio_buffer_size", { Lang["MENU_OPTIONS_AUDIO_BUFFER_SIZE"] }, "spinnersel,128,256,512,1024,2048"),
|
||||
// arrayOf("", { "(${Lang["MENU_LABEL_RESTART_REQUIRED"]})" }, "p"),
|
||||
arrayOf("", { "${Lang["MENU_LABEL_AUDIO_BUFFER_INSTRUCTION"]}" }, "p"),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user