mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-06 06:15:32 +00:00
Merge branch 'more_cleanup' into 'master'
Code cleanup See merge request OpenMW/openmw!3746
This commit is contained in:
commit
57066bcac1
6 changed files with 11 additions and 12 deletions
|
@ -154,7 +154,7 @@ bool Launcher::GraphicsPage::loadSettings()
|
|||
if (Settings::shadows().mEnableIndoorShadows)
|
||||
indoorShadowsCheckBox->setCheckState(Qt::Checked);
|
||||
|
||||
auto boundMethod = Settings::shadows().mComputeSceneBounds.get();
|
||||
const auto& boundMethod = Settings::shadows().mComputeSceneBounds.get();
|
||||
if (boundMethod == "bounds")
|
||||
shadowComputeSceneBoundsComboBox->setCurrentIndex(0);
|
||||
else if (boundMethod == "primitives")
|
||||
|
|
|
@ -300,11 +300,9 @@ namespace MWGui
|
|||
return MyGUI::IntCoord(position.left - halfMarkerSize, position.top - halfMarkerSize, markerSize, markerSize);
|
||||
}
|
||||
|
||||
MyGUI::Widget* LocalMapBase::createDoorMarker(
|
||||
const std::string& name, const MyGUI::VectorString& notes, float x, float y) const
|
||||
MyGUI::Widget* LocalMapBase::createDoorMarker(const std::string& name, float x, float y) const
|
||||
{
|
||||
MarkerUserData data(mLocalMapRender);
|
||||
data.notes = notes;
|
||||
data.caption = name;
|
||||
MarkerWidget* markerWidget = mLocalMap->createWidget<MarkerWidget>(
|
||||
"MarkerButton", getMarkerCoordinates(x, y, data, 8), MyGUI::Align::Default);
|
||||
|
@ -662,8 +660,9 @@ namespace MWGui
|
|||
MarkerUserData* data;
|
||||
if (mDoorMarkersToRecycle.empty())
|
||||
{
|
||||
markerWidget = createDoorMarker(marker.name, destNotes, marker.x, marker.y);
|
||||
markerWidget = createDoorMarker(marker.name, marker.x, marker.y);
|
||||
data = markerWidget->getUserData<MarkerUserData>();
|
||||
data->notes = std::move(destNotes);
|
||||
doorMarkerCreated(markerWidget);
|
||||
}
|
||||
else
|
||||
|
@ -672,7 +671,7 @@ namespace MWGui
|
|||
mDoorMarkersToRecycle.pop_back();
|
||||
|
||||
data = markerWidget->getUserData<MarkerUserData>();
|
||||
data->notes = destNotes;
|
||||
data->notes = std::move(destNotes);
|
||||
data->caption = marker.name;
|
||||
markerWidget->setCoord(getMarkerCoordinates(marker.x, marker.y, *data, 8));
|
||||
markerWidget->setVisible(true);
|
||||
|
|
|
@ -170,8 +170,7 @@ namespace MWGui
|
|||
MyGUI::IntPoint getMarkerPosition(float worldX, float worldY, MarkerUserData& markerPos) const;
|
||||
MyGUI::IntCoord getMarkerCoordinates(
|
||||
float worldX, float worldY, MarkerUserData& markerPos, size_t markerSize) const;
|
||||
MyGUI::Widget* createDoorMarker(
|
||||
const std::string& name, const MyGUI::VectorString& notes, float x, float y) const;
|
||||
MyGUI::Widget* createDoorMarker(const std::string& name, float x, float y) const;
|
||||
MyGUI::IntCoord getMarkerCoordinates(MyGUI::Widget* widget, size_t markerSize) const;
|
||||
|
||||
virtual void notifyPlayerUpdate() {}
|
||||
|
|
|
@ -122,7 +122,8 @@ namespace MWLua
|
|||
return "ESM3_FactionRank[" + rec.mFactionId.toDebugString() + ", " + std::to_string(rec.mRankIndex + 1)
|
||||
+ "]";
|
||||
};
|
||||
rankT["name"] = sol::readonly_property([](const FactionRank& rec) { return rec.mRankName; });
|
||||
rankT["name"]
|
||||
= sol::readonly_property([](const FactionRank& rec) -> std::string_view { return rec.mRankName; });
|
||||
rankT["primarySkillValue"] = sol::readonly_property([](const FactionRank& rec) { return rec.mPrimarySkill; });
|
||||
rankT["favouredSkillValue"] = sol::readonly_property([](const FactionRank& rec) { return rec.mFavouredSkill; });
|
||||
rankT["factionReaction"] = sol::readonly_property([](const FactionRank& rec) { return rec.mFactReaction; });
|
||||
|
|
|
@ -161,7 +161,8 @@ namespace MWLua
|
|||
auto vfs = MWBase::Environment::get().getResourceSystem()->getVFS();
|
||||
|
||||
sol::usertype<FileHandle> handle = context.mLua->sol().new_usertype<FileHandle>("FileHandle");
|
||||
handle["fileName"] = sol::readonly_property([](const FileHandle& self) { return self.mFileName; });
|
||||
handle["fileName"]
|
||||
= sol::readonly_property([](const FileHandle& self) -> std::string_view { return self.mFileName; });
|
||||
handle[sol::meta_function::to_string] = [](const FileHandle& self) {
|
||||
return "FileHandle{'" + self.mFileName + "'" + (!self.mFilePtr ? ", closed" : "") + "}";
|
||||
};
|
||||
|
|
|
@ -315,8 +315,7 @@ namespace Stereo
|
|||
else
|
||||
{
|
||||
auto* ds = osg::DisplaySettings::instance().get();
|
||||
auto viewMatrix = mMainCamera->getViewMatrix();
|
||||
auto projectionMatrix = mMainCamera->getProjectionMatrix();
|
||||
const auto& projectionMatrix = mMainCamera->getProjectionMatrix();
|
||||
auto s = ds->getEyeSeparation() * Constants::UnitsPerMeter;
|
||||
mViewOffsetMatrix[0]
|
||||
= osg::Matrixd(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, s, 0.0, 0.0, 1.0);
|
||||
|
|
Loading…
Reference in a new issue