mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-27 21:21:41 +00:00
fix probably
This commit is contained in:
parent
b28da95535
commit
465066f864
3 changed files with 50 additions and 52 deletions
|
|
@ -72,9 +72,7 @@ class Renderer extends h3d.scene.Renderer {
|
||||||
depthBuffer = null;
|
depthBuffer = null;
|
||||||
}
|
}
|
||||||
pixelRatio = 1;
|
pixelRatio = 1;
|
||||||
#if js
|
pixelRatio = Window.getInstance().windowToPixelRatio / Math.min(Settings.optionsSettings.maxPixelRatio, Window.getInstance().windowToPixelRatio);
|
||||||
pixelRatio = js.Browser.window.devicePixelRatio / Math.min(Settings.optionsSettings.maxPixelRatio, js.Browser.window.devicePixelRatio);
|
|
||||||
#end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override function getPassByName(name:String):h3d.pass.Base {
|
override function getPassByName(name:String):h3d.pass.Base {
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,7 @@ class Settings {
|
||||||
#end
|
#end
|
||||||
|
|
||||||
public static function applySettings() {
|
public static function applySettings() {
|
||||||
#if hl
|
#if (hl && !android)
|
||||||
Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight);
|
Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight);
|
||||||
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
||||||
#end
|
#end
|
||||||
|
|
|
||||||
|
|
@ -56,54 +56,56 @@ class VideoOptionsGui extends GuiImage {
|
||||||
optionCollection.extent = new Vector(815, 500);
|
optionCollection.extent = new Vector(815, 500);
|
||||||
innerCtrl.addChild(optionCollection);
|
innerCtrl.addChild(optionCollection);
|
||||||
|
|
||||||
var resolutionOpt = optionCollection.addOption(1, "Fullscreen Res", [
|
if (!Util.isTouchDevice()) {
|
||||||
"1024 x 800",
|
var resolutionOpt = optionCollection.addOption(1, "Fullscreen Res", [
|
||||||
"1280 x 720",
|
"1024 x 800",
|
||||||
"1366 x 768",
|
"1280 x 720",
|
||||||
"1440 x 900",
|
"1366 x 768",
|
||||||
"1600 x 900",
|
"1440 x 900",
|
||||||
"1920 x 1080"
|
"1600 x 900",
|
||||||
], (idx) -> {
|
"1920 x 1080"
|
||||||
switch (idx) {
|
], (idx) -> {
|
||||||
case 0:
|
switch (idx) {
|
||||||
Settings.optionsSettings.screenWidth = 1024;
|
case 0:
|
||||||
Settings.optionsSettings.screenHeight = 800;
|
Settings.optionsSettings.screenWidth = 1024;
|
||||||
case 1:
|
Settings.optionsSettings.screenHeight = 800;
|
||||||
Settings.optionsSettings.screenWidth = 1280;
|
case 1:
|
||||||
Settings.optionsSettings.screenHeight = 720;
|
Settings.optionsSettings.screenWidth = 1280;
|
||||||
case 2:
|
Settings.optionsSettings.screenHeight = 720;
|
||||||
Settings.optionsSettings.screenWidth = 1366;
|
case 2:
|
||||||
Settings.optionsSettings.screenHeight = 768;
|
Settings.optionsSettings.screenWidth = 1366;
|
||||||
case 3:
|
Settings.optionsSettings.screenHeight = 768;
|
||||||
Settings.optionsSettings.screenWidth = 1440;
|
case 3:
|
||||||
Settings.optionsSettings.screenHeight = 900;
|
Settings.optionsSettings.screenWidth = 1440;
|
||||||
case 4:
|
Settings.optionsSettings.screenHeight = 900;
|
||||||
Settings.optionsSettings.screenWidth = 1600;
|
case 4:
|
||||||
Settings.optionsSettings.screenHeight = 900;
|
Settings.optionsSettings.screenWidth = 1600;
|
||||||
case 5:
|
Settings.optionsSettings.screenHeight = 900;
|
||||||
Settings.optionsSettings.screenWidth = 1920;
|
case 5:
|
||||||
Settings.optionsSettings.screenHeight = 1080;
|
Settings.optionsSettings.screenWidth = 1920;
|
||||||
}
|
Settings.optionsSettings.screenHeight = 1080;
|
||||||
return true;
|
}
|
||||||
}, 0.35);
|
return true;
|
||||||
|
}, 0.35);
|
||||||
|
|
||||||
resolutionOpt.optionText.text.text = '${Settings.optionsSettings.screenWidth} x ${Settings.optionsSettings.screenHeight}';
|
resolutionOpt.optionText.text.text = '${Settings.optionsSettings.screenWidth} x ${Settings.optionsSettings.screenHeight}';
|
||||||
var curOpt = [
|
var curOpt = [
|
||||||
"1024 x 800",
|
"1024 x 800",
|
||||||
"1280 x 720",
|
"1280 x 720",
|
||||||
"1366 x 768",
|
"1366 x 768",
|
||||||
"1440 x 900",
|
"1440 x 900",
|
||||||
"1600 x 900",
|
"1600 x 900",
|
||||||
"1920 x 1080"
|
"1920 x 1080"
|
||||||
].indexOf(resolutionOpt.optionText.text.text);
|
].indexOf(resolutionOpt.optionText.text.text);
|
||||||
if (curOpt != -1)
|
if (curOpt != -1)
|
||||||
resolutionOpt.setCurrentOption(curOpt);
|
resolutionOpt.setCurrentOption(curOpt);
|
||||||
|
|
||||||
var displayOpt = optionCollection.addOption(1, "Resolution", ["Fullscreen", "Windowed"], (idx) -> {
|
var displayOpt = optionCollection.addOption(1, "Resolution", ["Fullscreen", "Windowed"], (idx) -> {
|
||||||
Settings.optionsSettings.isFullScreen = (idx == 0);
|
Settings.optionsSettings.isFullScreen = (idx == 0);
|
||||||
return true;
|
return true;
|
||||||
}, 0.35);
|
}, 0.35);
|
||||||
displayOpt.setCurrentOption(Settings.optionsSettings.isFullScreen ? 0 : 1);
|
displayOpt.setCurrentOption(Settings.optionsSettings.isFullScreen ? 0 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
var vsyncOpt = optionCollection.addOption(1, "VSync", ["Disabled", "Enabled"], (idx) -> {
|
var vsyncOpt = optionCollection.addOption(1, "VSync", ["Disabled", "Enabled"], (idx) -> {
|
||||||
Settings.optionsSettings.vsync = (idx == 1);
|
Settings.optionsSettings.vsync = (idx == 1);
|
||||||
|
|
@ -132,7 +134,6 @@ class VideoOptionsGui extends GuiImage {
|
||||||
}, 0.35);
|
}, 0.35);
|
||||||
rfOpt.setCurrentOption(Settings.optionsSettings.reflectionDetail);
|
rfOpt.setCurrentOption(Settings.optionsSettings.reflectionDetail);
|
||||||
|
|
||||||
#if js
|
|
||||||
var pxOpt = optionCollection.addOption(1, "Pixel Ratio", ["Max 0.5", "Max 1", "Max 1.5", "Max 2", "Max Infinity"], (idx) -> {
|
var pxOpt = optionCollection.addOption(1, "Pixel Ratio", ["Max 0.5", "Max 1", "Max 1.5", "Max 2", "Max Infinity"], (idx) -> {
|
||||||
if (idx == 0)
|
if (idx == 0)
|
||||||
Settings.optionsSettings.maxPixelRatio = 0.5;
|
Settings.optionsSettings.maxPixelRatio = 0.5;
|
||||||
|
|
@ -159,7 +160,6 @@ class VideoOptionsGui extends GuiImage {
|
||||||
else if (Settings.optionsSettings.maxPixelRatio == 100)
|
else if (Settings.optionsSettings.maxPixelRatio == 100)
|
||||||
curPixelRatioIndex = 4;
|
curPixelRatioIndex = 4;
|
||||||
pxOpt.setCurrentOption(curPixelRatioIndex);
|
pxOpt.setCurrentOption(curPixelRatioIndex);
|
||||||
#end
|
|
||||||
|
|
||||||
var bottomBar = new GuiControl();
|
var bottomBar = new GuiControl();
|
||||||
bottomBar.position = new Vector(0, 590);
|
bottomBar.position = new Vector(0, 590);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue