Merge branch openmw:master into master

This commit is contained in:
Igilq 2025-08-12 08:14:35 +00:00
commit 930ea09ce1
68 changed files with 262 additions and 261 deletions

View File

@ -507,7 +507,7 @@ Ubuntu_Clang_tests_Debug:
stage: test stage: test
variables: variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
EXAMPLE_SUITE_REVISION: 599987b52bd2d064e26299d3317b11049499f32b EXAMPLE_SUITE_REVISION: 3e01d10e073474a886a9efe3658088db14869627
cache: cache:
paths: paths:
- .cache/pip - .cache/pip

View File

@ -90,7 +90,7 @@ namespace ESSImport
scriptedAnim.mAbsolute = true; scriptedAnim.mAbsolute = true;
// Neither loop count nor queueing seems to be supported by the ess format. // Neither loop count nor queueing seems to be supported by the ess format.
scriptedAnim.mLoopCount = std::numeric_limits<size_t>::max(); scriptedAnim.mLoopCount = std::numeric_limits<size_t>::max();
state.mScriptedAnims.push_back(scriptedAnim); state.mScriptedAnims.push_back(std::move(scriptedAnim));
} }
else else
// TODO: Handle 0xFF index, which seems to be used for finished animations. // TODO: Handle 0xFF index, which seems to be used for finished animations.

View File

@ -303,7 +303,7 @@ namespace ESSImport
marker.mWorldY = notepos[1]; marker.mWorldY = notepos[1];
marker.mNote = std::move(note); marker.mNote = std::move(note);
marker.mCell = cell.mId; marker.mCell = cell.mId;
mMarkers.push_back(marker); mMarkers.push_back(std::move(marker));
} }
newcell.mRefs = std::move(cellrefs); newcell.mRefs = std::move(cellrefs);

View File

@ -584,7 +584,7 @@ namespace ESSImport
script.load(esm); script.load(esm);
ESM::GlobalScript out; ESM::GlobalScript out;
convertSCPT(script, out); convertSCPT(script, out);
mScripts.push_back(out); mScripts.push_back(std::move(out));
} }
void write(ESM::ESMWriter& esm) override void write(ESM::ESMWriter& esm) override
{ {

View File

@ -136,9 +136,9 @@ namespace ESSImport
sub.mName = esm.retSubName().toString(); sub.mName = esm.retSubName().toString();
sub.mData.resize(esm.getSubSize()); sub.mData.resize(esm.getSubSize());
esm.getExact(sub.mData.data(), sub.mData.size()); esm.getExact(sub.mData.data(), sub.mData.size());
rec.mSubrecords.push_back(sub); rec.mSubrecords.push_back(std::move(sub));
} }
file.mRecords.push_back(rec); file.mRecords.push_back(std::move(rec));
} }
} }

View File

@ -49,7 +49,7 @@ namespace ESSImport
} }
if (!separateStacks) if (!separateStacks)
mItems.push_back(item); mItems.push_back(std::move(item));
} }
// equipped items // equipped items

View File

@ -38,7 +38,7 @@ namespace ESSImport
unsigned char xnam; // sentinel unsigned char xnam; // sentinel
esm.getHNT(xnam, "XNAM"); esm.getHNT(xnam, "XNAM");
mActiveSpells.push_back(spell); mActiveSpells.push_back(std::move(spell));
} }
} }

View File

@ -420,14 +420,14 @@
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="QCheckBox" name="smoothAnimTransitionsCheckBox"> <widget class="QCheckBox" name="smoothAnimTransitionsCheckBox">
<property name="toolTip"> <property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If enabled - makes transitions between different animations/poses much smoother. Also allows to load animation blending config YAML files that can be bundled with animations in order to customise blending styles.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If enabled - makes transitions between different animations/poses much smoother. Also allows to load animation blending config YAML files that can be bundled with animations in order to customise blending styles.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Smooth Animation Transitions</string> <string>Smooth Animation Transitions</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
@ -1089,68 +1089,20 @@
<attribute name="title"> <attribute name="title">
<string>Audio</string> <string>Audio</string>
</attribute> </attribute>
<layout class="QVBoxLayout"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<layout class="QHBoxLayout"> <layout class="QGridLayout" name="audioLayout">
<item> <item row="1" column="1">
<widget class="QLabel" name="audioDeviceSelectorLabel">
<property name="toolTip">
<string>Select your preferred audio device.</string>
</property>
<property name="text">
<string>Audio Device</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="audioDeviceSelectorComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>283</width>
<height>0</height>
</size>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<item>
<property name="text">
<string>Default</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="enableHRTFLabel">
<property name="toolTip">
<string>This setting controls HRTF, which simulates 3D sound on stereo systems.</string>
</property>
<property name="text">
<string>HRTF</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="enableHRTFComboBox"> <widget class="QComboBox" name="enableHRTFComboBox">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>283</width> <width>0</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@ -1174,11 +1126,74 @@
</item> </item>
</widget> </widget>
</item> </item>
</layout> <item row="1" column="0">
</item> <widget class="QLabel" name="enableHRTFLabel">
<item> <property name="toolTip">
<layout class="QHBoxLayout"> <string>This setting controls HRTF, which simulates 3D sound on stereo systems.</string>
<item> </property>
<property name="text">
<string>HRTF</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="cameraListenerCheckBox">
<property name="toolTip">
<string>In third-person view, use the camera as the sound listener instead of the player character.</string>
</property>
<property name="text">
<string>Use the Camera as the Sound Listener</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="dopplerLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls the strength of the Doppler effect. Zero means it is completely disabled.&lt;/p&gt;&lt;p&gt;The Doppler effect increases or decreases the pitch of sounds relative to the velocity of the sound source and the listener.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Doppler Factor</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="dopplerSpinBox">
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="value">
<double>0.250000000000000</double>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="hrtfProfileSelectorComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<item>
<property name="text">
<string>Default</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="hrtfProfileSelectorLabel"> <widget class="QLabel" name="hrtfProfileSelectorLabel">
<property name="toolTip"> <property name="toolTip">
<string>Select your preferred HRTF profile.</string> <string>Select your preferred HRTF profile.</string>
@ -1188,17 +1203,27 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="0">
<widget class="QComboBox" name="hrtfProfileSelectorComboBox"> <widget class="QLabel" name="audioDeviceSelectorLabel">
<property name="toolTip">
<string>Select your preferred audio device.</string>
</property>
<property name="text">
<string>Audio Device</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="audioDeviceSelectorComboBox">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>283</width> <width>0</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@ -1214,61 +1239,6 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QCheckBox" name="cameraListenerCheckBox">
<property name="toolTip">
<string>In third-person view, use the camera as the sound listener instead of the player character.</string>
</property>
<property name="text">
<string>Use the Camera as the Sound Listener</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="dopplerLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls the strength of the Doppler effect. Zero means it is completely disabled.&lt;/p&gt;&lt;p&gt;The Doppler effect increases or decreases the pitch of sounds relative to the velocity of the sound source and the listener.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Doppler Factor</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="dopplerSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>283</width>
<height>0</height>
</size>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="value">
<double>0.250000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
@ -1276,8 +1246,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>0</width> <width>20</width>
<height>0</height> <height>40</height>
</size> </size>
</property> </property>
</spacer> </spacer>

View File

@ -351,7 +351,7 @@ MwIniImporter::multistrmap MwIniImporter::loadIniFile(const std::filesystem::pat
if (it == map.end()) if (it == map.end())
it = map.emplace_hint(it, std::move(key), std::vector<std::string>()); it = map.emplace_hint(it, std::move(key), std::vector<std::string>());
it->second.push_back(std::string(value)); it->second.emplace_back(value);
} }
return map; return map;
@ -393,7 +393,7 @@ MwIniImporter::multistrmap MwIniImporter::loadCfgFile(const std::filesystem::pat
{ {
map.insert(std::make_pair(key, std::vector<std::string>())); map.insert(std::make_pair(key, std::vector<std::string>()));
} }
map[key].push_back(value); map[key].push_back(std::move(value));
} }
return map; return map;

View File

@ -166,7 +166,7 @@ std::pair<Files::PathContainer, std::vector<std::string>> CS::Editor::readConfig
if (!local.empty()) if (!local.empty())
{ {
std::filesystem::create_directories(local); std::filesystem::create_directories(local);
dataLocal.push_back(local); dataLocal.push_back(std::move(local));
} }
mCfgMgr.filterOutNonExistingPaths(dataDirs); mCfgMgr.filterOutNonExistingPaths(dataDirs);
mCfgMgr.filterOutNonExistingPaths(dataLocal); mCfgMgr.filterOutNonExistingPaths(dataLocal);

View File

@ -365,7 +365,7 @@ std::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseNAry(const Token& keywo
if (mError) if (mError)
return std::shared_ptr<Node>(); return std::shared_ptr<Node>();
nodes.push_back(node); nodes.push_back(std::move(node));
token = getNextToken(); token = getNextToken();

View File

@ -1466,7 +1466,7 @@ namespace CSMWorld
newRow.mCellName.clear(); newRow.mCellName.clear();
if (position >= (int)list.size()) if (position >= (int)list.size())
list.push_back(newRow); list.push_back(std::move(newRow));
else else
list.insert(list.begin() + position, newRow); list.insert(list.begin() + position, newRow);
@ -1636,7 +1636,7 @@ namespace CSMWorld
newRow.mCellName.clear(); newRow.mCellName.clear();
if (position >= (int)list.size()) if (position >= (int)list.size())
list.push_back(newRow); list.push_back(std::move(newRow));
else else
list.insert(list.begin() + position, newRow); list.insert(list.begin() + position, newRow);

View File

@ -449,7 +449,7 @@ CSVRender::WorldspaceHitResult CSVRender::WorldspaceWidget::mousePick(
mView->getCamera()->accept(visitor); mView->getCamera()->accept(visitor);
auto intersections = intersector->getIntersections(); const auto& intersections = intersector->getIntersections();
std::vector<osgUtil::LineSegmentIntersector::Intersection> validIntersections std::vector<osgUtil::LineSegmentIntersector::Intersection> validIntersections
= { intersections.begin(), intersections.end() }; = { intersections.begin(), intersections.end() };

View File

@ -133,10 +133,10 @@ QModelIndexList CSVWorld::RegionMap::getMissingRegionCells() const
for (QModelIndexList::const_iterator iter(selected.begin()); iter != selected.end(); ++iter) for (QModelIndexList::const_iterator iter(selected.begin()); iter != selected.end(); ++iter)
{ {
std::string region = model->data(*iter, CSMWorld::RegionMap::Role_Region).toString().toUtf8().constData(); std::string_view region = model->data(*iter, CSMWorld::RegionMap::Role_Region).toString().toUtf8().constData();
if (!region.empty()) if (!region.empty())
regions.insert(region); regions.emplace(region);
} }
QModelIndexList list; QModelIndexList list;

View File

@ -86,7 +86,7 @@ bool parseOptions(int argc, char** argv, OMW::Engine& engine, Files::Configurati
.u8string()); // This call to u8string is redundant, but required to .u8string()); // This call to u8string is redundant, but required to
// build on MSVC 14.26 due to implementation bugs. // build on MSVC 14.26 due to implementation bugs.
if (!local.empty()) if (!local.empty())
dataDirs.push_back(local); dataDirs.push_back(std::move(local));
cfgMgr.filterOutNonExistingPaths(dataDirs); cfgMgr.filterOutNonExistingPaths(dataDirs);

View File

@ -111,7 +111,7 @@ namespace MWDialogue
// there is no need to show empty entries in journal // there is no need to show empty entries in journal
if (!entry.getText().empty()) if (!entry.getText().empty())
{ {
mJournal.push_back(entry); mJournal.push_back(std::move(entry));
MWBase::Environment::get().getWindowManager()->messageBox("#{sJournalEntry}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sJournalEntry}");
} }
} }

View File

@ -207,7 +207,7 @@ namespace MWGui
mQueue.pop_front(); mQueue.pop_front();
if (mRepeat) if (mRepeat)
mQueue.push_back(op); mQueue.push_back(std::move(op));
} }
float ScreenFader::getCurrentAlpha() float ScreenFader::getCurrentAlpha()

View File

@ -422,7 +422,7 @@ namespace MWGui
continue; // fake locale to get gmst strings from content files continue; // fake locale to get gmst strings from content files
if (std::find(availableLanguages.begin(), availableLanguages.end(), localeName) if (std::find(availableLanguages.begin(), availableLanguages.end(), localeName)
== availableLanguages.end()) == availableLanguages.end())
availableLanguages.push_back(localeName); availableLanguages.push_back(std::move(localeName));
} }
} }

View File

@ -42,7 +42,7 @@ namespace MWGui
newEffectSource.mRemainingTime = effect.mTimeLeft; newEffectSource.mRemainingTime = effect.mTimeLeft;
newEffectSource.mSource = params.getDisplayName(); newEffectSource.mSource = params.getDisplayName();
newEffectSource.mTotalTime = effect.mDuration; newEffectSource.mTotalTime = effect.mDuration;
effects[effect.mEffectId].push_back(newEffectSource); effects[effect.mEffectId].push_back(std::move(newEffectSource));
} }
} }

View File

@ -164,7 +164,7 @@ namespace MWGui
newSpell.mActive = invStore.isEquipped(item); newSpell.mActive = invStore.isEquipped(item);
} }
mSpells.push_back(newSpell); mSpells.push_back(std::move(newSpell));
} }
std::stable_sort(mSpells.begin(), mSpells.end(), sortSpells); std::stable_sort(mSpells.begin(), mSpells.end(), sortSpells);

View File

@ -702,9 +702,10 @@ namespace MWInput
void BindingsManager::saveBindings() void BindingsManager::saveBindings()
{ {
const std::string newFileName = Files::pathToUnicodeString(mUserFile) + ".new"; std::string newFileName;
try try
{ {
newFileName = Files::pathToUnicodeString(mUserFile) + ".new";
if (mInputBinder->save(newFileName)) if (mInputBinder->save(newFileName))
{ {
std::filesystem::rename(Files::pathFromUnicodeString(newFileName), mUserFile); std::filesystem::rename(Files::pathFromUnicodeString(newFileName), mUserFile);

View File

@ -19,7 +19,8 @@ namespace MWLua
= [](const ESM::Script& rec) { return "ESM3_Script[" + rec.mId.toDebugString() + "]"; }; = [](const ESM::Script& rec) { return "ESM3_Script[" + rec.mId.toDebugString() + "]"; };
recordBindingsClass["id"] recordBindingsClass["id"]
= sol::readonly_property([](const ESM::Script& rec) { return rec.mId.serializeText(); }); = sol::readonly_property([](const ESM::Script& rec) { return rec.mId.serializeText(); });
recordBindingsClass["text"] = sol::readonly_property([](const ESM::Script& rec) { return rec.mScriptText; }); recordBindingsClass["text"]
= sol::readonly_property([](const ESM::Script& rec) -> std::string_view { return rec.mScriptText; });
addRecordFunctionBinding<ESM::Script>(api, context); addRecordFunctionBinding<ESM::Script>(api, context);

View File

@ -161,7 +161,7 @@ namespace MWLua
{ {
binary = LuaUtil::serialize(*data, mLocalSerializer.get()); binary = LuaUtil::serialize(*data, mLocalSerializer.get());
} }
mLuaEvents.addLocalEvent({ getId(target), name, binary }); mLuaEvents.addLocalEvent({ getId(target), name, std::move(binary) });
} }
void LuaManager::update() void LuaManager::update()

View File

@ -442,9 +442,9 @@ namespace MWLua
sol::optional<Object> ammo = options.get<sol::optional<Object>>("ammo"); sol::optional<Object> ammo = options.get<sol::optional<Object>>("ammo");
context.mLuaManager->addAction( context.mLuaManager->addAction(
[self = self, damages = std::move(damageCpp), attacker = options.get<sol::optional<Object>>("attacker"), [self = Object(self), damages = std::move(damageCpp),
weapon = ammo ? ammo : weapon, successful = options.get<bool>("successful"), attacker = options.get<sol::optional<Object>>("attacker"), weapon = ammo ? ammo : weapon,
sourceType = sourceType] { successful = options.get<bool>("successful"), sourceType = sourceType] {
MWWorld::Ptr attackerPtr; MWWorld::Ptr attackerPtr;
MWWorld::Ptr weaponPtr; MWWorld::Ptr weaponPtr;
if (attacker) if (attacker)

View File

@ -168,7 +168,7 @@ namespace MWLua
LuaUi::Layer::Options options; LuaUi::Layer::Options options;
options.mInteractive = LuaUtil::getValueOrDefault(LuaUtil::getFieldOrNil(opt, "interactive"), true); options.mInteractive = LuaUtil::getValueOrDefault(LuaUtil::getFieldOrNil(opt, "interactive"), true);
context.mLuaManager->addAction( context.mLuaManager->addAction(
[=]() { [afterName = std::move(afterName), name = std::move(name), options]() {
size_t index = LuaUi::Layer::indexOf(afterName); size_t index = LuaUi::Layer::indexOf(afterName);
if (index == LuaUi::Layer::count()) if (index == LuaUi::Layer::count())
throw std::logic_error( throw std::logic_error(

View File

@ -48,7 +48,8 @@ namespace MWLua
auto weatherT = lua.new_usertype<MWWorld::Weather>("Weather"); auto weatherT = lua.new_usertype<MWWorld::Weather>("Weather");
weatherT[sol::meta_function::to_string] weatherT[sol::meta_function::to_string]
= [](const MWWorld::Weather& w) -> std::string { return "Weather[" + w.mName + "]"; }; = [](const MWWorld::Weather& w) -> std::string { return "Weather[" + w.mName + "]"; };
weatherT["name"] = sol::readonly_property([](const MWWorld::Weather& w) { return w.mName; }); weatherT["name"]
= sol::readonly_property([](const MWWorld::Weather& w) -> std::string_view { return w.mName; });
weatherT["windSpeed"] = sol::readonly_property([](const MWWorld::Weather& w) { return w.mWindSpeed; }); weatherT["windSpeed"] = sol::readonly_property([](const MWWorld::Weather& w) { return w.mWindSpeed; });
weatherT["cloudSpeed"] = sol::readonly_property([](const MWWorld::Weather& w) { return w.mCloudSpeed; }); weatherT["cloudSpeed"] = sol::readonly_property([](const MWWorld::Weather& w) { return w.mCloudSpeed; });
weatherT["cloudTexture"] = sol::readonly_property([vfs](const MWWorld::Weather& w) { weatherT["cloudTexture"] = sol::readonly_property([vfs](const MWWorld::Weather& w) {
@ -139,7 +140,8 @@ namespace MWLua
weatherT["scriptId"] = sol::readonly_property([](const MWWorld::Weather& w) { return w.mScriptId; }); weatherT["scriptId"] = sol::readonly_property([](const MWWorld::Weather& w) { return w.mScriptId; });
weatherT["recordId"] = sol::readonly_property([](const MWWorld::Weather& w) { return w.mId.serializeText(); }); weatherT["recordId"] = sol::readonly_property([](const MWWorld::Weather& w) { return w.mId.serializeText(); });
api["getCurrent"] = []() { return MWBase::Environment::get().getWorld()->getCurrentWeather(); }; api["getCurrent"]
= []() -> const MWWorld::Weather* { return &MWBase::Environment::get().getWorld()->getCurrentWeather(); };
api["getNext"] api["getNext"]
= []() -> const MWWorld::Weather* { return MWBase::Environment::get().getWorld()->getNextWeather(); }; = []() -> const MWWorld::Weather* { return MWBase::Environment::get().getWorld()->getNextWeather(); };
api["getTransition"] = []() { return MWBase::Environment::get().getWorld()->getWeatherTransition(); }; api["getTransition"] = []() { return MWBase::Environment::get().getWorld()->getWeatherTransition(); };

View File

@ -241,7 +241,25 @@ namespace MWMechanics
// Erase no longer active spells and effects // Erase no longer active spells and effects
for (auto spellIt = mSpells.begin(); spellIt != mSpells.end();) for (auto spellIt = mSpells.begin(); spellIt != mSpells.end();)
{ {
if (!spellIt->hasFlag(ESM::ActiveSpells::Flag_Temporary)) if (spellIt->hasFlag(ESM::ActiveSpells::Flag_SpellStore))
{
const ESM::Spell* spell
= MWBase::Environment::get().getESMStore()->get<ESM::Spell>().search(spellIt->mSourceSpellId);
if (spell && ptr.getClass().getCreatureStats(ptr).getSpells().hasSpell(spell))
++spellIt;
else
{
if (spell == nullptr)
Log(Debug::Error) << "Dropping non-existent active effect: " << spellIt->mSourceSpellId;
auto params = *spellIt;
spellIt = mSpells.erase(spellIt);
for (const auto& effect : params.mEffects)
onMagicEffectRemoved(ptr, params, effect);
applyPurges(ptr, &spellIt);
}
continue;
}
else if (!spellIt->hasFlag(ESM::ActiveSpells::Flag_Temporary))
{ {
++spellIt; ++spellIt;
continue; continue;
@ -416,20 +434,7 @@ namespace MWMechanics
if (context.mEraseRemoved) if (context.mEraseRemoved)
{ {
bool remove = false; bool remove = false;
if (spellIt->hasFlag(ESM::ActiveSpells::Flag_SpellStore)) if (spellIt->hasFlag(ESM::ActiveSpells::Flag_Equipment))
{
try
{
auto& spells = ptr.getClass().getCreatureStats(ptr).getSpells();
remove = !spells.hasSpell(spellIt->mSourceSpellId);
}
catch (const std::runtime_error& e)
{
remove = true;
Log(Debug::Error) << "Removing active effect: " << e.what();
}
}
else if (spellIt->hasFlag(ESM::ActiveSpells::Flag_Equipment))
{ {
// Remove effects tied to equipment that has been unequipped // Remove effects tied to equipment that has been unequipped
const auto& store = ptr.getClass().getInventoryStore(ptr); const auto& store = ptr.getClass().getInventoryStore(ptr);

View File

@ -628,7 +628,7 @@ std::vector<std::string> MWMechanics::Alchemy::effectsDescription(const MWWorld:
const ESM::Skill* skill = store->get<ESM::Skill>().search(ESM::Skill::indexToRefId(data.mSkills[i])); const ESM::Skill* skill = store->get<ESM::Skill>().search(ESM::Skill::indexToRefId(data.mSkills[i]));
std::string effect = getMagicEffectString(*mgef.find(effectID), attribute, skill); std::string effect = getMagicEffectString(*mgef.find(effectID), attribute, skill);
effects.push_back(effect); effects.push_back(std::move(effect));
} }
} }
return effects; return effects;

View File

@ -2531,7 +2531,7 @@ namespace MWMechanics
anim.mTime = 0.f; anim.mTime = 0.f;
} }
state.mScriptedAnims.push_back(anim); state.mScriptedAnims.push_back(std::move(anim));
} }
} }
@ -2563,7 +2563,7 @@ namespace MWMechanics
entry.mTime = (time - start) / (stop - start); entry.mTime = (time - start) / (stop - start);
} }
mAnimQueue.push_back(entry); mAnimQueue.push_back(std::move(entry));
} }
playAnimQueue(); playAnimQueue();
@ -2644,7 +2644,7 @@ namespace MWMechanics
mAnimQueue.resize(1); mAnimQueue.resize(1);
} }
mAnimQueue.push_back(entry); mAnimQueue.push_back(std::move(entry));
if (playImmediately) if (playImmediately)
playAnimQueue(mode == 2); playAnimQueue(mode == 2);
@ -2675,7 +2675,7 @@ namespace MWMechanics
if (mAnimQueue.size() > 1) if (mAnimQueue.size() > 1)
mAnimQueue.resize(1); mAnimQueue.resize(1);
mAnimQueue.push_back(entry); mAnimQueue.push_back(std::move(entry));
if (mAnimQueue.size() == 1) if (mAnimQueue.size() == 1)
playAnimQueue(); playAnimQueue();

View File

@ -398,6 +398,23 @@ namespace
{ ESM::MagicEffect::BoundShield, "sMagicBoundShieldID" }, { ESM::MagicEffect::BoundShield, "sMagicBoundShieldID" },
{ ESM::MagicEffect::BoundSpear, "sMagicBoundSpearID" }, { ESM::MagicEffect::BoundSpear, "sMagicBoundSpearID" },
}; };
using SpellsPurge = void (MWMechanics::Spells::*)();
void purgePermanent(const MWWorld::Ptr& target, SpellsPurge method, ESM::Spell::SpellType type)
{
MWMechanics::CreatureStats& stats = target.getClass().getCreatureStats(target);
(stats.getSpells().*method)();
stats.getActiveSpells().purge(
[type](const MWMechanics::ActiveSpells::ActiveSpellParams& params) {
if (params.hasFlag(ESM::ActiveSpells::Flag_SpellStore))
{
const ESM::Spell* spell = params.getSpell();
return spell && spell->mData.mType == type;
}
return false;
},
target);
}
} }
namespace MWMechanics namespace MWMechanics
@ -412,13 +429,13 @@ namespace MWMechanics
switch (effect.mEffectId) switch (effect.mEffectId)
{ {
case ESM::MagicEffect::CureCommonDisease: case ESM::MagicEffect::CureCommonDisease:
target.getClass().getCreatureStats(target).getSpells().purgeCommonDisease(); purgePermanent(target, &Spells::purgeCommonDisease, ESM::Spell::ST_Disease);
break; break;
case ESM::MagicEffect::CureBlightDisease: case ESM::MagicEffect::CureBlightDisease:
target.getClass().getCreatureStats(target).getSpells().purgeBlightDisease(); purgePermanent(target, &Spells::purgeBlightDisease, ESM::Spell::ST_Blight);
break; break;
case ESM::MagicEffect::RemoveCurse: case ESM::MagicEffect::RemoveCurse:
target.getClass().getCreatureStats(target).getSpells().purgeCurses(); purgePermanent(target, &Spells::purgeCurses, ESM::Spell::ST_Curse);
break; break;
case ESM::MagicEffect::CureCorprusDisease: case ESM::MagicEffect::CureCorprusDisease:
target.getClass().getCreatureStats(target).getActiveSpells().purgeEffect( target.getClass().getCreatureStats(target).getActiveSpells().purgeEffect(

View File

@ -185,7 +185,7 @@ namespace MWRender
auto distortion = loadTechnique("internal_distortion"); auto distortion = loadTechnique("internal_distortion");
distortion->setInternal(true); distortion->setInternal(true);
distortion->setLocked(true); distortion->setLocked(true);
mInternalTechniques.push_back(distortion); mInternalTechniques.push_back(std::move(distortion));
osg::GraphicsContext* gc = viewer->getCamera()->getGraphicsContext(); osg::GraphicsContext* gc = viewer->getCamera()->getGraphicsContext();
osg::GLExtensions* ext = gc->getState()->get<osg::GLExtensions>(); osg::GLExtensions* ext = gc->getState()->get<osg::GLExtensions>();

View File

@ -130,7 +130,7 @@ namespace MWScript
if (ptr) if (ptr)
mReference = *ptr; mReference = *ptr;
else else
mGlobalScriptDesc = globalScriptDesc; mGlobalScriptDesc = std::move(globalScriptDesc);
} }
ESM::RefId InterpreterContext::getTarget() const ESM::RefId InterpreterContext::getTarget() const

View File

@ -537,7 +537,11 @@ namespace MWScript
return; return;
MWMechanics::CreatureStats& creatureStats = ptr.getClass().getCreatureStats(ptr); MWMechanics::CreatureStats& creatureStats = ptr.getClass().getCreatureStats(ptr);
creatureStats.getSpells().remove(id); const ESM::Spell* spell = MWBase::Environment::get().getESMStore()->get<ESM::Spell>().find(id);
creatureStats.getSpells().remove(spell);
if (spell->mData.mType == ESM::Spell::ST_Ability || spell->mData.mType == ESM::Spell::ST_Blight
|| spell->mData.mType == ESM::Spell::ST_Curse || spell->mData.mType == ESM::Spell::ST_Disease)
creatureStats.getActiveSpells().removeEffectsBySourceSpellId(ptr, id);
MWBase::WindowManager* wm = MWBase::Environment::get().getWindowManager(); MWBase::WindowManager* wm = MWBase::Environment::get().getWindowManager();

View File

@ -58,7 +58,7 @@ void MWState::Character::addSlot(const std::filesystem::path& path, const std::s
if (!Misc::StringUtils::ciEqual(getFirstGameFile(slot.mProfile.mContentFiles), game)) if (!Misc::StringUtils::ciEqual(getFirstGameFile(slot.mProfile.mContentFiles), game))
return; // this file is for a different game -> ignore return; // this file is for a different game -> ignore
mSlots.push_back(slot); mSlots.push_back(std::move(slot));
} }
void MWState::Character::addSlot(const ESM::SavedGame& profile) void MWState::Character::addSlot(const ESM::SavedGame& profile)
@ -92,7 +92,7 @@ void MWState::Character::addSlot(const ESM::SavedGame& profile)
slot.mProfile = profile; slot.mProfile = profile;
slot.mTimeStamp = std::filesystem::file_time_type::clock::now(); slot.mTimeStamp = std::filesystem::file_time_type::clock::now();
mSlots.push_back(slot); mSlots.push_back(std::move(slot));
} }
MWState::Character::Character(const std::filesystem::path& saves, const std::string& game) MWState::Character::Character(const std::filesystem::path& saves, const std::string& game)
@ -174,7 +174,7 @@ const MWState::Slot* MWState::Character::updateSlot(const Slot* slot, const ESM:
mSlots.erase(mSlots.begin() + index); mSlots.erase(mSlots.begin() + index);
mSlots.push_back(newSlot); mSlots.push_back(std::move(newSlot));
return &mSlots.back(); return &mSlots.back();
} }

View File

@ -25,7 +25,7 @@ MWState::CharacterManager::CharacterManager(std::filesystem::path saves, const s
Character character(characterDir, mGame); Character character(characterDir, mGame);
if (character.begin() != character.end()) if (character.begin() != character.end())
mCharacters.push_back(character); mCharacters.push_back(std::move(character));
} }
} }
mCharacters.sort(); mCharacters.sort();

View File

@ -150,7 +150,7 @@ namespace
} }
if (changed) if (changed)
npcsToReplace.push_back(npc); npcsToReplace.push_back(std::move(npc));
} }
return npcsToReplace; return npcsToReplace;

View File

@ -335,7 +335,7 @@ namespace MWWorld
} }
state.mProjectileId = mPhysics->addProjectile(caster, pos, model, true); state.mProjectileId = mPhysics->addProjectile(caster, pos, model, true);
state.mToDelete = false; state.mToDelete = false;
mMagicBolts.push_back(state); mMagicBolts.push_back(std::move(state));
} }
void ProjectileManager::launchProjectile(const Ptr& actor, const ConstPtr& projectile, const osg::Vec3f& pos, void ProjectileManager::launchProjectile(const Ptr& actor, const ConstPtr& projectile, const osg::Vec3f& pos,
@ -361,7 +361,7 @@ namespace MWWorld
state.mProjectileId = mPhysics->addProjectile(actor, pos, model, false); state.mProjectileId = mPhysics->addProjectile(actor, pos, model, false);
state.mToDelete = false; state.mToDelete = false;
mProjectiles.push_back(state); mProjectiles.push_back(std::move(state));
} }
void ProjectileManager::updateCasters() void ProjectileManager::updateCasters()
@ -725,7 +725,7 @@ namespace MWWorld
createModel(state, model, osg::Vec3f(esm.mPosition), osg::Quat(esm.mOrientation), false, false, createModel(state, model, osg::Vec3f(esm.mPosition), osg::Quat(esm.mOrientation), false, false,
osg::Vec4(0, 0, 0, 0)); osg::Vec4(0, 0, 0, 0));
mProjectiles.push_back(state); mProjectiles.push_back(std::move(state));
return true; return true;
} }
if (type == ESM::REC_MPRJ) if (type == ESM::REC_MPRJ)

View File

@ -1096,7 +1096,7 @@ namespace MWWorld
Weather weather( Weather weather(
id, mWeatherSettings.size(), name, fStromWindSpeed, mRainSpeed, dlFactor, dlOffset, particleEffect); id, mWeatherSettings.size(), name, fStromWindSpeed, mRainSpeed, dlFactor, dlOffset, particleEffect);
mWeatherSettings.push_back(weather); mWeatherSettings.push_back(std::move(weather));
} }
inline void WeatherManager::importRegions() inline void WeatherManager::importRegions()

View File

@ -1955,7 +1955,7 @@ namespace MWWorld
newMarker.x = pos.pos[0]; newMarker.x = pos.pos[0];
newMarker.y = pos.pos[1]; newMarker.y = pos.pos[1];
mOut.push_back(newMarker); mOut.push_back(std::move(newMarker));
} }
return true; return true;
} }

View File

@ -138,7 +138,7 @@ namespace Bsa
fileName.resize(fileNameSize); fileName.resize(fileNameSize);
input.read(fileName.data(), fileName.size()); input.read(fileName.data(), fileName.size());
fileName.push_back('\0'); fileName.push_back('\0');
mFileNames.push_back(fileName); mFileNames.push_back(std::move(fileName));
mFiles[i].setNameInfos(0, &mFileNames.back()); mFiles[i].setNameInfos(0, &mFileNames.back());
} }

View File

@ -129,7 +129,7 @@ namespace Bsa
fileName.resize(fileNameSize); fileName.resize(fileNameSize);
input.read(fileName.data(), fileName.size()); input.read(fileName.data(), fileName.size());
fileName.push_back('\0'); fileName.push_back('\0');
mFileNames.push_back(fileName); mFileNames.push_back(std::move(fileName));
mFiles[i].setNameInfos(0, &mFileNames.back()); mFiles[i].setNameInfos(0, &mFileNames.back());
} }

View File

@ -22,7 +22,7 @@ namespace Compiler
std::copy(mCodeBlock.begin(), mCodeBlock.end(), std::back_inserter(entry.second)); std::copy(mCodeBlock.begin(), mCodeBlock.end(), std::back_inserter(entry.second));
mIfCode.push_back(entry); mIfCode.push_back(std::move(entry));
mCodeBlock.clear(); mCodeBlock.clear();

View File

@ -327,7 +327,7 @@ namespace Compiler
if (mExplicit.empty() && getContext().isId(ESM::RefId::stringRefId(name2))) if (mExplicit.empty() && getContext().isId(ESM::RefId::stringRefId(name2)))
{ {
mExplicit = name2; mExplicit = std::move(name2);
return true; return true;
} }

View File

@ -205,7 +205,7 @@ namespace Compiler
else if (!c.isMinusSign() && isStringCharacter(c)) else if (!c.isMinusSign() && isStringCharacter(c))
{ {
/// workaround that allows names to begin with digits /// workaround that allows names to begin with digits
return scanName(c, parser, cont, value); return scanName(c, parser, cont, std::move(value));
} }
else if (c == '.') else if (c == '.')
{ {

View File

@ -202,7 +202,7 @@ bool Config::GameSettings::readFile(
if (settings.isEmpty()) if (settings.isEmpty())
{ {
settings = cache; // This is the first time we read a file settings = std::move(cache); // This is the first time we read a file
validatePaths(); validatePaths();
return true; return true;
} }

View File

@ -23,31 +23,30 @@ namespace ESM
ESM::LandData::LandData(const ESM::Land& land, int loadFlags) ESM::LandData::LandData(const ESM::Land& land, int loadFlags)
: mData(loadData(land, loadFlags)) : mData(loadData(land, loadFlags))
, mHeights(mData->mHeights)
, mNormals(mData->mNormals)
, mColors(mData->mColours)
, mTextures(mData->mTextures)
, mLoadFlags(mData->mDataLoaded) , mLoadFlags(mData->mDataLoaded)
, mMinHeight(mData->mMinHeight) , mMinHeight(mData->mMinHeight)
, mMaxHeight(mData->mMaxHeight) , mMaxHeight(mData->mMaxHeight)
, mSize(Constants::CellSizeInUnits) , mSize(Constants::CellSizeInUnits)
, mLandSize(ESM::Land::LAND_SIZE) , mLandSize(ESM::Land::LAND_SIZE)
, mPlugin(land.getPlugin()) , mPlugin(land.getPlugin())
, mHeights(mData->mHeights)
, mNormals(mData->mNormals)
, mColors(mData->mColours)
, mTextures(mData->mTextures)
, mIsEsm4(false)
{ {
} }
ESM::LandData::LandData(const ESM4::Land& land, int /*loadFlags*/) ESM::LandData::LandData(const ESM4::Land& land, int /*loadFlags*/)
: mLoadFlags(land.mDataTypes) // ESM4::Land is always fully loaded. TODO: implement lazy loading : mHeightsData(ESM4::Land::sLandNumVerts)
, mHeightsData(ESM4::Land::sLandNumVerts) , mNormals(land.mVertNorm)
, mColors(land.mVertColr)
, mTextures(textures)
, mLoadFlags(land.mDataTypes) // ESM4::Land is always fully loaded. TODO: implement lazy loading
, mMinHeight(std::numeric_limits<float>::max()) , mMinHeight(std::numeric_limits<float>::max())
, mMaxHeight(std::numeric_limits<float>::lowest()) , mMaxHeight(std::numeric_limits<float>::lowest())
, mSize(Constants::ESM4CellSizeInUnits) , mSize(Constants::ESM4CellSizeInUnits)
, mLandSize(ESM4::Land::sVertsPerSide) , mLandSize(ESM4::Land::sVertsPerSide)
, mPlugin(land.mId.mContentFile) , mPlugin(land.mId.mContentFile)
, mNormals(land.mVertNorm)
, mColors(land.mVertColr)
, mTextures(textures)
, mIsEsm4(true) , mIsEsm4(true)
{ {
float rowOffset = land.mHeightMap.heightOffset; float rowOffset = land.mHeightMap.heightOffset;

View File

@ -51,19 +51,19 @@ namespace ESM
private: private:
std::unique_ptr<const ESM::LandRecordData> mData; std::unique_ptr<const ESM::LandRecordData> mData;
int mLoadFlags = 0;
std::vector<float> mHeightsData; std::vector<float> mHeightsData;
float mMinHeight = 0.f;
float mMaxHeight = 0.f;
float mSize = 0.f;
int mLandSize = 0;
int mPlugin = 0;
std::span<const float> mHeights; std::span<const float> mHeights;
std::span<const std::int8_t> mNormals; std::span<const std::int8_t> mNormals;
std::span<const std::uint8_t> mColors; std::span<const std::uint8_t> mColors;
std::span<const std::uint16_t> mTextures; std::span<const std::uint16_t> mTextures;
std::array<ESM4::Land::Texture, 4> mEsm4Textures; std::array<ESM4::Land::Texture, 4> mEsm4Textures;
bool mIsEsm4; int mLoadFlags = 0;
float mMinHeight = 0.f;
float mMaxHeight = 0.f;
float mSize = 0.f;
int mLandSize = 0;
int mPlugin = 0;
bool mIsEsm4 = false;
}; };
} }

View File

@ -55,25 +55,25 @@ namespace ESM
{ {
pack.mType = AI_Wander; pack.mType = AI_Wander;
esm.getSubComposite(pack.mWander); esm.getSubComposite(pack.mWander);
mList.push_back(pack); mList.push_back(std::move(pack));
} }
else if (esm.retSubName() == AI_Travel) else if (esm.retSubName() == AI_Travel)
{ {
pack.mType = AI_Travel; pack.mType = AI_Travel;
esm.getSubComposite(pack.mTravel); esm.getSubComposite(pack.mTravel);
mList.push_back(pack); mList.push_back(std::move(pack));
} }
else if (esm.retSubName() == AI_Escort || esm.retSubName() == AI_Follow) else if (esm.retSubName() == AI_Escort || esm.retSubName() == AI_Follow)
{ {
pack.mType = (esm.retSubName() == AI_Escort) ? AI_Escort : AI_Follow; pack.mType = (esm.retSubName() == AI_Escort) ? AI_Escort : AI_Follow;
esm.getSubComposite(pack.mTarget); esm.getSubComposite(pack.mTarget);
mList.push_back(pack); mList.push_back(std::move(pack));
} }
else if (esm.retSubName() == AI_Activate) else if (esm.retSubName() == AI_Activate)
{ {
pack.mType = AI_Activate; pack.mType = AI_Activate;
esm.getSubComposite(pack.mActivate); esm.getSubComposite(pack.mActivate);
mList.push_back(pack); mList.push_back(std::move(pack));
} }
} }

View File

@ -23,7 +23,7 @@ namespace ESM
esm.getHNOT(anim.mAbsolute, "ABST"); esm.getHNOT(anim.mAbsolute, "ABST");
esm.getHNT(anim.mLoopCount, "COUN"); esm.getHNT(anim.mLoopCount, "COUN");
mScriptedAnims.push_back(anim); mScriptedAnims.push_back(std::move(anim));
} }
} }

View File

@ -127,7 +127,7 @@ namespace ESM
Header::MasterData d; Header::MasterData d;
d.name = name; d.name = name;
d.size = size; d.size = size;
mHeader.mMaster.push_back(d); mHeader.mMaster.push_back(std::move(d));
} }
void ESMWriter::save(std::ostream& file) void ESMWriter::save(std::ostream& file)

View File

@ -82,7 +82,7 @@ namespace ESM
if (dataFormat <= MaxOldFogOfWarFormatVersion) if (dataFormat <= MaxOldFogOfWarFormatVersion)
convertFogOfWar(tex.mImageData); convertFogOfWar(tex.mImageData);
mFogTextures.push_back(tex); mFogTextures.push_back(std::move(tex));
} }
} }

View File

@ -38,7 +38,7 @@ namespace ESM
MasterData m; MasterData m;
m.name = esm.getHString(); m.name = esm.getHString();
esm.getHNT(m.size, "DATA"); esm.getHNT(m.size, "DATA");
mMaster.push_back(m); mMaster.push_back(std::move(m));
} }
esm.getHNOT("GMDT", mGameData.mCurrentHealth, mGameData.mMaximumHealth, mGameData.mHour, mGameData.unknown1, esm.getHNOT("GMDT", mGameData.mCurrentHealth, mGameData.mMaximumHealth, mGameData.mHour, mGameData.unknown1,

View File

@ -14,7 +14,7 @@ namespace ESM
{ {
Dest dodt; Dest dodt;
esm.getSubComposite(dodt.mPos); esm.getSubComposite(dodt.mPos);
mList.push_back(dodt); mList.push_back(std::move(dodt));
} }
else if (esm.retSubName().toInt() == fourCC("DNAM")) else if (esm.retSubName().toInt() == fourCC("DNAM"))
{ {

View File

@ -59,7 +59,7 @@ void ESM4::Ingredient::load(ESM4::Reader& reader)
if (!reader.getZString(scriptEffectName)) if (!reader.getZString(scriptEffectName))
throw std::runtime_error("INGR FULL data read error"); throw std::runtime_error("INGR FULL data read error");
mScriptEffect.push_back(scriptEffectName); mScriptEffect.push_back(std::move(scriptEffectName));
break; break;
} }

View File

@ -130,7 +130,7 @@ void ESM4::Navigation::NavMeshInfo::load(ESM4::Reader& reader)
{ {
Navigation::IslandInfo island2; Navigation::IslandInfo island2;
island2.load(reader); island2.load(reader);
islandInfo.push_back(island2); // Maybe don't use a vector for just one entry? islandInfo.push_back(std::move(island2)); // Maybe don't use a vector for just one entry?
} }
// else if (flags == FLG_Island) // FIXME: debug only // else if (flags == FLG_Island) // FIXME: debug only
// std::cerr << "nvmi no island but has 0x20 flag" << std::endl; // std::cerr << "nvmi no island but has 0x20 flag" << std::endl;
@ -350,7 +350,7 @@ void ESM4::Navigation::load(ESM4::Reader& reader)
// std::cout << "\nNVMI start" << std::endl; // std::cout << "\nNVMI start" << std::endl;
NavMeshInfo nvmi; NavMeshInfo nvmi;
nvmi.load(reader); nvmi.load(reader);
mNavMeshInfo.push_back(nvmi); mNavMeshInfo.push_back(std::move(nvmi));
break; break;
} }
case ESM::fourCC("NVSI"): // from Dawnguard onwards case ESM::fourCC("NVSI"): // from Dawnguard onwards

View File

@ -178,7 +178,7 @@ void ESM4::NavMesh::NVNMstruct::load(ESM4::Reader& reader)
{ {
reader.get(*it); reader.get(*it);
} }
triSegments.push_back(indices); triSegments.push_back(std::move(indices));
} }
if (triSegments.size() != divisor * divisor) if (triSegments.size() != divisor * divisor)
throw std::runtime_error("Triangle segments size is not the square of divisor"); throw std::runtime_error("Triangle segments size is not the square of divisor");
@ -221,7 +221,7 @@ void ESM4::NavMesh::load(ESM4::Reader& reader)
NVNMstruct nvnm; NVNMstruct nvnm;
nvnm.load(reader); nvnm.load(reader);
mData.push_back(nvnm); // FIXME try swap mData.push_back(std::move(nvnm)); // FIXME try swap
break; break;
} }
case ESM::fourCC("ONAM"): case ESM::fourCC("ONAM"):

View File

@ -114,7 +114,7 @@ void ESM4::Pathgrid::load(ESM4::Reader& reader)
for (std::size_t i = 0; i < numNodes; ++i) for (std::size_t i = 0; i < numNodes; ++i)
reader.get(objLink.linkedNodes.at(i)); reader.get(objLink.linkedNodes.at(i));
mObjects.push_back(objLink); mObjects.push_back(std::move(objLink));
break; break;
} }

View File

@ -58,7 +58,7 @@ void ESM4::SigilStone::load(ESM4::Reader& reader)
std::string scriptEffectName; std::string scriptEffectName;
if (!reader.getZString(scriptEffectName)) if (!reader.getZString(scriptEffectName))
throw std::runtime_error("SGST FULL data read error"); throw std::runtime_error("SGST FULL data read error");
mScriptEffect.push_back(scriptEffectName); mScriptEffect.push_back(std::move(scriptEffectName));
} }
break; break;
} }

View File

@ -65,7 +65,7 @@ void ESM4::Header::load(ESM4::Reader& reader)
// NOTE: some mods do not have DATA following MAST so can't read DATA here // NOTE: some mods do not have DATA following MAST so can't read DATA here
m.size = 0; m.size = 0;
mMaster.push_back(m); mMaster.push_back(std::move(m));
break; break;
} }
case ESM::fourCC("DATA"): case ESM::fourCC("DATA"):

View File

@ -1033,7 +1033,7 @@ namespace Fx
choice.mLabel = parseString(); choice.mLabel = parseString();
expect<Lexer::Equal>(); expect<Lexer::Equal>();
choice.mValue = getUniformValue<SrcT, T>(); choice.mValue = getUniformValue<SrcT, T>();
choices.push_back(choice); choices.push_back(std::move(choice));
if (isNext<Lexer::Comma>()) if (isNext<Lexer::Comma>())
{ {

View File

@ -1395,7 +1395,7 @@ bool Optimizer::MergeGeometryVisitor::mergeGroup(osg::Group& group)
subset.push_back(geometry); subset.push_back(geometry);
if (subset.size()>1) needToDoMerge = true; if (subset.size()>1) needToDoMerge = true;
} }
if (!subset.empty()) mergeList.push_back(subset); if (!subset.empty()) mergeList.push_back(std::move(subset));
} }
if (needToDoMerge) if (needToDoMerge)

View File

@ -339,7 +339,7 @@ namespace Shader
if (!parseLinkDirective(source, linkTarget, templateName, foundPos)) if (!parseLinkDirective(source, linkTarget, templateName, foundPos))
return false; return false;
if (!linkTarget.empty() && linkTarget != templateName) if (!linkTarget.empty() && linkTarget != templateName)
linkedShaderTemplateNames.push_back(linkTarget); linkedShaderTemplateNames.push_back(std::move(linkTarget));
} }
else else
{ {

View File

@ -507,15 +507,17 @@ namespace Stereo
if (!Stereo::getMultiview()) if (!Stereo::getMultiview())
{ {
auto eye = static_cast<int>(Stereo::Manager::instance().getEye(cv)); auto eye = static_cast<int>(Stereo::Manager::instance().getEye(cv));
if (eye < 2)
if (msaa)
{ {
renderStage->setFrameBufferObject(mMultiviewFramebuffer->layerMsaaFbo(eye)); if (msaa)
renderStage->setMultisampleResolveFramebufferObject(mMultiviewFramebuffer->layerFbo(eye)); {
} renderStage->setFrameBufferObject(mMultiviewFramebuffer->layerMsaaFbo(eye));
else renderStage->setMultisampleResolveFramebufferObject(mMultiviewFramebuffer->layerFbo(eye));
{ }
renderStage->setFrameBufferObject(mMultiviewFramebuffer->layerFbo(eye)); else
{
renderStage->setFrameBufferObject(mMultiviewFramebuffer->layerFbo(eye));
}
} }
} }
@ -543,7 +545,7 @@ namespace Stereo
{ {
} }
MultiviewFramebuffer::~MultiviewFramebuffer() {} MultiviewFramebuffer::~MultiviewFramebuffer() = default;
void MultiviewFramebuffer::attachColorComponent(GLint sourceFormat, GLint sourceType, GLint internalFormat) void MultiviewFramebuffer::attachColorComponent(GLint sourceFormat, GLint sourceType, GLint internalFormat)
{ {

View File

@ -1468,11 +1468,11 @@ to default Morrowind fonts. Check this box if you still prefer original fonts ov
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls the strength of the Doppler effect. Zero means it is completely disabled.&lt;/p&gt;&lt;p&gt;The Doppler effect increases or decreases the pitch of sounds relative to the velocity of the sound source and the listener.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <source>Doppler Factor</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<source>Doppler Factor</source> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls the strength of the Doppler effect. Zero means it is completely disabled.&lt;/p&gt;&lt;p&gt;The Doppler effect increases or decreases the pitch of sounds relative to the velocity of the sound source and the listener.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>

View File

@ -1468,11 +1468,11 @@ to default Morrowind fonts. Check this box if you still prefer original fonts ov
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls the strength of the Doppler effect. Zero means it is completely disabled.&lt;/p&gt;&lt;p&gt;The Doppler effect increases or decreases the pitch of sounds relative to the velocity of the sound source and the listener.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <source>Doppler Factor</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<source>Doppler Factor</source> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls the strength of the Doppler effect. Zero means it is completely disabled.&lt;/p&gt;&lt;p&gt;The Doppler effect increases or decreases the pitch of sounds relative to the velocity of the sound source and the listener.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation></translation> <translation></translation>
</message> </message>
</context> </context>

View File

@ -1471,11 +1471,11 @@ to default Morrowind fonts. Check this box if you still prefer original fonts ov
<translation>Afficher les info-bulles du contrôleur par défaut</translation> <translation>Afficher les info-bulles du contrôleur par défaut</translation>
</message> </message>
<message> <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls the strength of the Doppler effect. Zero means it is completely disabled.&lt;/p&gt;&lt;p&gt;The Doppler effect increases or decreases the pitch of sounds relative to the velocity of the sound source and the listener.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <source>Doppler Factor</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<source>Doppler Factor</source> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls the strength of the Doppler effect. Zero means it is completely disabled.&lt;/p&gt;&lt;p&gt;The Doppler effect increases or decreases the pitch of sounds relative to the velocity of the sound source and the listener.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>

View File

@ -1482,13 +1482,13 @@ to default Morrowind fonts. Check this box if you still prefer original fonts ov
<source>Show Controller Tooltips By Default</source> <source>Show Controller Tooltips By Default</source>
<translation>Подсказки для геймпадов по умолчанию</translation> <translation>Подсказки для геймпадов по умолчанию</translation>
</message> </message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls the strength of the Doppler effect. Zero means it is completely disabled.&lt;/p&gt;&lt;p&gt;The Doppler effect increases or decreases the pitch of sounds relative to the velocity of the sound source and the listener.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Определяет силу эффекта Доплера. Нулевое значение означает, что эффект отключен полностью.&lt;/p&gt;&lt;p&gt;Эффект Доплера увеличивает или уменьшает высоту звуков в зависимости от скорости источника звука и слушателя.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message> <message>
<source>Doppler Factor</source> <source>Doppler Factor</source>
<translation>Множитель эффекта Доплера</translation> <translation>Множитель эффекта Доплера</translation>
</message> </message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls the strength of the Doppler effect. Zero means it is completely disabled.&lt;/p&gt;&lt;p&gt;The Doppler effect increases or decreases the pitch of sounds relative to the velocity of the sound source and the listener.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Определяет силу эффекта Доплера. Нулевое значение означает, что эффект отключен полностью.&lt;/p&gt;&lt;p&gt;Эффект Доплера увеличивает или уменьшает высоту звуков в зависимости от скорости источника звука и слушателя.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -1486,13 +1486,13 @@ de ordinarie fonterna i Morrowind. Bocka denna ruta om du ändå föredrar ordin
<source>Show Controller Tooltips By Default</source> <source>Show Controller Tooltips By Default</source>
<translation>Visa handkontrollinforutor som standard</translation> <translation>Visa handkontrollinforutor som standard</translation>
</message> </message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls the strength of the Doppler effect. Zero means it is completely disabled.&lt;/p&gt;&lt;p&gt;The Doppler effect increases or decreases the pitch of sounds relative to the velocity of the sound source and the listener.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Kontrollerar styrkan dopplereffekten. Noll innebär helt inaktiverat.&lt;/p&gt;&lt;p&gt;Dopplereffekten höjer eller sänker tonhöjden på ljud i förhållande till ljudkällans hastighet och lyssnaren.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message> <message>
<source>Doppler Factor</source> <source>Doppler Factor</source>
<translation>Dopplerfaktor</translation> <translation>Dopplerfaktor</translation>
</message> </message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls the strength of the Doppler effect. Zero means it is completely disabled.&lt;/p&gt;&lt;p&gt;The Doppler effect increases or decreases the pitch of sounds relative to the velocity of the sound source and the listener.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Kontrollerar styrkan dopplereffekten. Noll innebär helt inaktiverat.&lt;/p&gt;&lt;p&gt;Dopplereffekten höjer eller sänker tonhöjden på ljud i förhållande till ljudkällans hastighet och lyssnaren.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
</context> </context>
</TS> </TS>