MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / getResolution

Function getResolution

project/emscripten/boxedwine-shell.js:141–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139 return cpu;
140 }
141 function getResolution() {
142 var resolution = getParameter("resolution");
143 if(!allowParameterOverride()){
144 resolution = null;
145 }else{
146 if (resolution != null) {
147 if (resolution.indexOf('x') > -1) {
148 let resNumbers = resolution.split('x');
149 if (!(resNumbers.length == 2 && isNumber(resNumbers[0]) && isNumber(resNumbers[1]))) {
150 resolution = null;
151 }
152 } else {
153 resolution = null;
154 }
155 }
156 }
157 if (resolution == null) {
158 console.log("not setting Resolution");
159 } else {
160 console.log("setting Resolution to: "+resolution);
161 }
162 return resolution;
163 }
164 function isNumber(num) {
165 const result = Number(num);
166 return !isNaN(result) && result > 0 && result < 2000;

Callers 1

setConfigurationFunction · 0.85

Calls 6

getParameterFunction · 0.85
allowParameterOverrideFunction · 0.85
isNumberFunction · 0.85
indexOfMethod · 0.80
logMethod · 0.80
splitMethod · 0.45

Tested by

no test coverage detected