graphics - fixed 1 empty GPU, display

This commit is contained in:
Sebastian Hildebrandt 2019-01-10 14:08:13 +01:00
parent e4136624f2
commit d43ec39352

View File

@ -187,7 +187,7 @@ function graphics(callback) {
if (_3dcontrollerpos !== -1 && vgapos === -1) { if (_3dcontrollerpos !== -1 && vgapos === -1) {
vgapos = _3dcontrollerpos; vgapos = _3dcontrollerpos;
} }
if (Object.keys(currentController).length > 0) {// already a controller found if (currentController.vendor || currentController.model || currentController.bus || currentController.vram !== -1 || currentController.vramDynamic) { // already a controller found
controllers.push(currentController); controllers.push(currentController);
currentController = { currentController = {
vendor: '', vendor: '',
@ -246,7 +246,7 @@ function graphics(callback) {
} }
} }
} }
if (Object.keys(currentController).length > 0) {// still controller information available if (currentController.vendor || currentController.model || currentController.bus || currentController.vram !== -1 || currentController.vramDynamic) { // already a controller found
controllers.push(currentController); controllers.push(currentController);
} }
return (controllers); return (controllers);
@ -325,7 +325,7 @@ function graphics(callback) {
for (let i = 1; i < lines.length; i++) { // start with second line for (let i = 1; i < lines.length; i++) { // start with second line
if ('' !== lines[i].trim()) { if ('' !== lines[i].trim()) {
if (' ' !== lines[i][0] && '\t' !== lines[i][0] && lines[i].toLowerCase().indexOf(' connected ') !== -1) { // first line of new entry if (' ' !== lines[i][0] && '\t' !== lines[i][0] && lines[i].toLowerCase().indexOf(' connected ') !== -1) { // first line of new entry
if (Object.keys(currentDisplay).length > 0) { // push last display to array if (currentDisplay.model || currentDisplay.main || currentDisplay.builtin || currentDisplay.connection || currentDisplay.sizex !== -1 || currentDisplay.pixeldepth !== -1 || currentDisplay.resolutionx !== -1) { // push last display to array
displays.push(currentDisplay); displays.push(currentDisplay);
currentDisplay = { currentDisplay = {
model: '', model: '',
@ -369,7 +369,7 @@ function graphics(callback) {
} }
// pushen displays // pushen displays
if (Object.keys(currentDisplay).length > 0) { // still information there if (currentDisplay.model || currentDisplay.main || currentDisplay.builtin || currentDisplay.connection || currentDisplay.sizex !== -1 || currentDisplay.pixeldepth !== -1 || currentDisplay.resolutionx !== -1) { // still information there
displays.push(currentDisplay); displays.push(currentDisplay);
} }
return displays; return displays;