diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index 749b68a874..8a609f6bb7 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -482,11 +482,11 @@ namespace MWGui void SettingsWindow::onResolutionAccept() { - auto resultion = mResolutionList->getItemDataAt>(mResolutionList->getIndexSelected()); - if (resultion) + auto resolution = mResolutionList->getItemDataAt>(mResolutionList->getIndexSelected()); + if (resolution) { - Settings::video().mResolutionX.set(resultion->first); - Settings::video().mResolutionY.set(resultion->second); + Settings::video().mResolutionX.set(resolution->first); + Settings::video().mResolutionY.set(resolution->second); apply(); } @@ -506,8 +506,8 @@ namespace MWGui for (size_t i = 0; i < mResolutionList->getItemCount(); ++i) { - auto resultion = mResolutionList->getItemDataAt>(i); - if (resultion && resultion->first == currentX && resultion->second == currentY) + auto resolution = mResolutionList->getItemDataAt>(i); + if (resolution && resolution->first == currentX && resolution->second == currentY) { mResolutionList->setIndexSelected(i); break; @@ -873,12 +873,12 @@ namespace MWGui // check if this resolution is supported in fullscreen if (mResolutionList->getIndexSelected() != MyGUI::ITEM_NONE) { - auto resultion + auto resolution = mResolutionList->getItemDataAt>(mResolutionList->getIndexSelected()); - if (resultion) + if (resolution) { - Settings::video().mResolutionX.set(resultion->first); - Settings::video().mResolutionY.set(resultion->second); + Settings::video().mResolutionX.set(resolution->first); + Settings::video().mResolutionY.set(resolution->second); } } @@ -886,18 +886,18 @@ namespace MWGui int fallbackX = 0, fallbackY = 0; for (size_t i = 0; i < mResolutionList->getItemCount(); ++i) { - auto resultion = mResolutionList->getItemDataAt>(i); - if (!resultion) + auto resolution = mResolutionList->getItemDataAt>(i); + if (!resolution) continue; if (i == 0) { - fallbackX = resultion->first; - fallbackY = resultion->second; + fallbackX = resolution->first; + fallbackY = resolution->second; } - if (resultion->first == Settings::video().mResolutionX - && resultion->second == Settings::video().mResolutionY) + if (resolution->first == Settings::video().mResolutionX + && resolution->second == Settings::video().mResolutionY) supported = true; } diff --git a/components/lua/inputactions.cpp b/components/lua/inputactions.cpp index 71e2263bd4..c220bdf331 100644 --- a/components/lua/inputactions.cpp +++ b/components/lua/inputactions.cpp @@ -1,6 +1,5 @@ #include "inputactions.hpp" -#include #include #include @@ -116,14 +115,14 @@ namespace LuaUtil void Registry::insert(const Info& info) { if (mIds.find(info.mKey) != mIds.end()) - throw std::domain_error(std::format("Action key \"{}\" is already in use", info.mKey)); + throw std::domain_error("Action key \"" + info.mKey + "\" is already in use"); if (info.mKey.empty()) throw std::domain_error("Action key can't be an empty string"); if (info.mL10n.empty()) throw std::domain_error("Localization context can't be empty"); if (!validateActionValue(info.mDefaultValue, info.mType)) - throw std::logic_error(std::format( - "Invalid value: \"{}\" for action \"{}\"", LuaUtil::toString(info.mDefaultValue), info.mKey)); + throw std::logic_error("Invalid value: \"" + LuaUtil::toString(info.mDefaultValue) + "\" for action \"" + + info.mKey + "\""); Id id = mBindingTree.insert(); mKeys.push_back(info.mKey); mIds[std::string(info.mKey)] = id; @@ -156,7 +155,7 @@ namespace LuaUtil { auto iter = mIds.find(key); if (iter == mIds.end()) - throw std::logic_error(std::format("Unknown action key: \"{}\"", key)); + throw std::logic_error("Unknown action key: \"" + std::string(key) + "\""); return iter->second; } @@ -182,9 +181,16 @@ namespace LuaUtil Id id = safeIdByKey(key); Info info = mInfo[id]; if (info.mType != type) - throw std::logic_error( - std::format("Attempt to get value of type \"{}\" from action \"{}\" with type \"{}\"", - typeName(type), key, typeName(info.mType))); + { + std::string message("Attempt to get value of type \""); + message += typeName(type); + message += "\" from action \""; + message += key; + message += "\" with type \""; + message += typeName(info.mType); + message += "\""; + throw std::logic_error(message); + } return mValues[id]; } @@ -269,14 +275,14 @@ namespace LuaUtil { auto it = mIds.find(key); if (it == mIds.end()) - throw std::domain_error(std::format("Unknown trigger key \"{}\"", key)); + throw std::domain_error("Unknown trigger key \"" + std::string(key) + "\""); return it->second; } void Registry::insert(const Info& info) { if (mIds.find(info.mKey) != mIds.end()) - throw std::domain_error(std::format("Trigger key \"{}\" is already in use", info.mKey)); + throw std::domain_error("Trigger key \"" + info.mKey + "\" is already in use"); if (info.mKey.empty()) throw std::domain_error("Trigger key can't be an empty string"); if (info.mL10n.empty()) diff --git a/components/sceneutil/animblendrules.cpp b/components/sceneutil/animblendrules.cpp index 2702584e63..a67de075b2 100644 --- a/components/sceneutil/animblendrules.cpp +++ b/components/sceneutil/animblendrules.cpp @@ -1,6 +1,5 @@ #include "animblendrules.hpp" -#include #include #include @@ -103,7 +102,8 @@ namespace SceneUtil } else { - throw std::domain_error(std::format("'blending_rules' object not found in '{}' file!", configPath.value())); + throw std::domain_error( + "'blending_rules' object not found in '" + std::string(configPath.value()) + "' file!"); } // If no rules then dont allocate any instance