mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-29 09:35:39 +00:00
Added a sanity check to the --resolution flag to keep the values within reason.
This commit is contained in:
parent
03fec8b74d
commit
b115a94668
|
@ -183,6 +183,12 @@ bool parseArgs(int argc, char* argv[])
|
||||||
}
|
}
|
||||||
int width = atoi(argv[i + 1]);
|
int width = atoi(argv[i + 1]);
|
||||||
int height = atoi(argv[i + 2]);
|
int height = atoi(argv[i + 2]);
|
||||||
|
if (width < 640 || height < 480 || width > 7680 || height > 4320 ||
|
||||||
|
height < width / 4 || width < height / 2) {
|
||||||
|
std::cerr << "Error: Unsupported resolution "
|
||||||
|
<< width << "x" << height << " supplied.\n";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Settings::getInstance()->setInt("WindowWidth", width);
|
Settings::getInstance()->setInt("WindowWidth", width);
|
||||||
Settings::getInstance()->setInt("WindowHeight", height);
|
Settings::getInstance()->setInt("WindowHeight", height);
|
||||||
i += 2;
|
i += 2;
|
||||||
|
|
Loading…
Reference in a new issue