fix vsync on js...again

This commit is contained in:
RandomityGuy 2024-06-22 20:45:20 +05:30
parent f7be905972
commit 868cf71120
2 changed files with 4 additions and 0 deletions

View file

@ -229,7 +229,9 @@ class Settings {
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
#end
AudioManager.updateVolumes();
#if hl
Window.getInstance().vsync = optionsSettings.vsync;
#end
@:privateAccess cast(MarbleGame.instance.scene.renderer, Renderer).onResize();
MarbleGame.canvas.render(MarbleGame.canvas.scene2d);

View file

@ -110,11 +110,13 @@ class VideoOptionsGui extends GuiImage {
}, 0.35);
displayOpt.setCurrentOption(Settings.optionsSettings.isFullScreen ? 0 : 1);
#if hl
var vsyncOpt = optionCollection.addOption(1, "VSync", ["Disabled", "Enabled"], (idx) -> {
Settings.optionsSettings.vsync = (idx == 1);
return true;
}, 0.35);
vsyncOpt.setCurrentOption(Settings.optionsSettings.vsync ? 1 : 0);
#end
function numberRange(start:Int, stop:Int, step:Int) {
var range = [];