Change up strcasecmp/strncasecmp to be more C++y

This commit is contained in:
iikorni
2026-08-30 16:40:12 -05:00
parent 7a697986c6
commit da2a9a8fbc
32 changed files with 351 additions and 790 deletions
+10 -10
View File
@@ -1612,28 +1612,28 @@ void VID_Init(void) {
fullscreen = true;
} else {
auto p = common::check_param("-width");
if (p.has_value() && p.value() < com_argc - 1) {
width = std::atoi(com_argv[p.value() + 1]);
if (p.has_value() && p.value() < common::_argv.size() - 1) {
width = std::atoi(common::_argv[p.value() + 1].c_str());
if (!common::check_param("-height").has_value())
height = width * 3 / 4;
}
p = common::check_param("-height");
if (p.has_value() && p.value() < com_argc - 1) {
height = std::atoi(com_argv[p.value() + 1]);
if (p.has_value() && p.value() < common::_argv.size() - 1) {
height = std::atoi(common::_argv[p.value() + 1].c_str());
if (!common::check_param("-width").has_value())
width = height * 4 / 3;
}
p = common::check_param("-refreshrate");
if (p.has_value() && p.value() < com_argc - 1)
refreshrate = std::atoi(com_argv[p.value() + 1]);
if (p.has_value() && p.value() < common::_argv.size() - 1)
refreshrate = std::atoi(common::_argv[p.value() + 1].c_str());
p = common::check_param("-bpp");
if (p.has_value() && p.value() < com_argc - 1)
bpp = std::atoi(com_argv[p.value() + 1]);
if (p.has_value() && p.value() < common::_argv.size() - 1)
bpp = std::atoi(common::_argv[p.value() + 1].c_str());
if (common::check_param("-window").has_value() || common::check_param("-w").has_value())
fullscreen = false;
@@ -1642,8 +1642,8 @@ void VID_Init(void) {
}
auto p = common::check_param("-fsaa");
if (p.has_value() && p.value() < com_argc - 1)
fsaa = atoi(com_argv[p.value() + 1]);
if (p.has_value() && p.value() < common::_argv.size() - 1)
fsaa = atoi(common::_argv[p.value() + 1].c_str());
if (!VID_ValidMode(width, height, refreshrate, bpp, fullscreen)) {
width = (int) vid_width.value;