diff --git a/src/config.lua b/src/config.lua index 350254e..bd8e31f 100644 --- a/src/config.lua +++ b/src/config.lua @@ -130,6 +130,7 @@ function config.load() default(data, "loennInstalledVersion", "") default(data, "updateModsOnStartup", "none") + default(data, "useOpenGL", "disabled") default(data, "extradata", {}) end diff --git a/src/scenes/options.lua b/src/scenes/options.lua index ca040e0..b26f36a 100644 --- a/src/scenes/options.lua +++ b/src/scenes/options.lua @@ -86,6 +86,11 @@ local updateModsOnStartupOptions = { { text = "Disabled (Default)", data = "none" } } +local useOpenGLOptions = { + { text = "Enabled", data = "enabled" }, + { text = "Disabled (Default)", data = "disabled" } +} + local extradatas = { { text = "Noto Sans CJK (~50 MB)", info = "Chinese, Japanese, Korean font files.", path = "olympus-extra-cjk.zip", url = "https://0x0a.de/olympus-extra/olympus-extra-cjk.zip" } } @@ -297,6 +302,8 @@ local root = uie.column({ }):with(uiu.fillWidth) }):with(uiu.fillWidth(8 + 1 / optioncount)):with(uiu.at(4 / optioncount, 0)), + + }):with(uiu.fillWidth), uie.group({}), @@ -350,6 +357,18 @@ local root = uie.column({ }):with(uiu.fillWidth) }):with(uiu.fillWidth(8 + 1 / optioncount)):with(uiu.at(3 / optioncount, 0)), + uie.column({ + uie.label("Use OpenGL"), + uie.dropdown(useOpenGLOptions, function(self, value) + config.useOpenGL = value + config.save() + end):with({ + placeholder = "???", + selectedData = config.useOpenGL + }):with(uiu.fillWidth) + }):with(uiu.fillWidth(8 + 1 / optioncount)):with(uiu.at(4 / optioncount, 0)), + + }):with(uiu.fillWidth), uie.group({}), diff --git a/src/utils.lua b/src/utils.lua index 3c0b873..e2a83ca 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -323,6 +323,7 @@ end local launching = {} + function utils.launch(path, vanilla, notify, force) local key = string.format("%s | %s", path, vanilla and "vanilla" or "everest") if launching[key] then @@ -333,8 +334,10 @@ function utils.launch(path, vanilla, notify, force) end launching[key] = threader.routine(function() + + local config = require("config") + if not path then - local config = require("config") if config then path = config.installs[config.install].path end @@ -348,7 +351,13 @@ function utils.launch(path, vanilla, notify, force) local alert = require("alert") notify = notify and require("notify") or alert - local launch = sharp.launch(path, vanilla and "--vanilla" or "", (force or not notify) and true or false) + local opengl = false + if config then + opengl = config.useOpenGL == "enabled" + end + + local flags = (vanilla and "--vanilla " or "") .. (opengl and "--graphics OpenGL " or "") + local launch = sharp.launch(path, flags, (force or not notify) and true or false) local container if vanilla then