Fix and enforce namespace naming

This commit is contained in:
elsid 2025-07-20 11:00:19 +02:00
parent 8bf9b205b7
commit 28851411a3
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40
63 changed files with 175 additions and 166 deletions

View File

@ -13,3 +13,7 @@ HeaderFilterRegex: '(apps|components)/'
CheckOptions: CheckOptions:
- key: readability-identifier-naming.ConceptCase - key: readability-identifier-naming.ConceptCase
value: CamelCase value: CamelCase
- key: readability-identifier-naming.NamespaceCase
value: CamelCase
- key: readability-identifier-naming.NamespaceIgnoredRegexp
value: 'osg(DB|FX|Particle|Shadow|Viewer|Util)?'

View File

@ -5,7 +5,7 @@
namespace namespace
{ {
using namespace testing; using namespace testing;
using namespace fx::Lexer; using namespace Fx::Lexer;
struct LexerTest : Test struct LexerTest : Test
{ {

View File

@ -91,7 +91,7 @@ namespace
)" }; )" };
using namespace testing; using namespace testing;
using namespace fx; using namespace Fx;
struct TechniqueTest : Test struct TechniqueTest : Test
{ {

View File

@ -105,7 +105,7 @@ speed: "Speed"
lua.protectedCall([&](LuaUtil::LuaView& view) { lua.protectedCall([&](LuaUtil::LuaView& view) {
sol::state_view& l = view.sol(); sol::state_view& l = view.sol();
internal::CaptureStdout(); internal::CaptureStdout();
l10n::Manager l10nManager(mVFS.get()); L10n::Manager l10nManager(mVFS.get());
l10nManager.setPreferredLocales({ "de", "en" }); l10nManager.setPreferredLocales({ "de", "en" });
EXPECT_THAT(internal::GetCapturedStdout(), "Preferred locales: gmst de en\n"); EXPECT_THAT(internal::GetCapturedStdout(), "Preferred locales: gmst de en\n");

View File

@ -42,7 +42,7 @@ int runLauncher(int argc, char* argv[])
resourcesPath = Files::pathToQString(variables["resources"].as<Files::MaybeQuotedPath>().u8string()); resourcesPath = Files::pathToQString(variables["resources"].as<Files::MaybeQuotedPath>().u8string());
} }
l10n::installQtTranslations(app, "launcher", resourcesPath); L10n::installQtTranslations(app, "launcher", resourcesPath);
Launcher::MainDialog mainWin(configurationManager); Launcher::MainDialog mainWin(configurationManager);

View File

@ -755,7 +755,7 @@ void OMW::Engine::prepareEngine()
mViewer->addEventHandler(mScreenCaptureHandler); mViewer->addEventHandler(mScreenCaptureHandler);
mL10nManager = std::make_unique<l10n::Manager>(mVFS.get()); mL10nManager = std::make_unique<L10n::Manager>(mVFS.get());
mL10nManager->setPreferredLocales(Settings::general().mPreferredLocales, Settings::general().mGmstOverridesL10n); mL10nManager->setPreferredLocales(Settings::general().mPreferredLocales, Settings::general().mGmstOverridesL10n);
mEnvironment.setL10nManager(*mL10nManager); mEnvironment.setL10nManager(*mL10nManager);

View File

@ -113,7 +113,7 @@ namespace MWDialogue
class Journal; class Journal;
} }
namespace l10n namespace L10n
{ {
class Manager; class Manager;
} }
@ -141,7 +141,7 @@ namespace OMW
std::unique_ptr<MWState::StateManager> mStateManager; std::unique_ptr<MWState::StateManager> mStateManager;
std::unique_ptr<MWLua::LuaManager> mLuaManager; std::unique_ptr<MWLua::LuaManager> mLuaManager;
std::unique_ptr<MWLua::Worker> mLuaWorker; std::unique_ptr<MWLua::Worker> mLuaWorker;
std::unique_ptr<l10n::Manager> mL10nManager; std::unique_ptr<L10n::Manager> mL10nManager;
MWBase::Environment mEnvironment; MWBase::Environment mEnvironment;
ToUTF8::FromType mEncoding; ToUTF8::FromType mEncoding;
std::unique_ptr<ToUTF8::Utf8Encoder> mEncoder; std::unique_ptr<ToUTF8::Utf8Encoder> mEncoder;

View File

@ -10,7 +10,7 @@ namespace Resource
class ResourceSystem; class ResourceSystem;
} }
namespace l10n namespace L10n
{ {
class Manager; class Manager;
} }
@ -57,7 +57,7 @@ namespace MWBase
StateManager* mStateManager = nullptr; StateManager* mStateManager = nullptr;
LuaManager* mLuaManager = nullptr; LuaManager* mLuaManager = nullptr;
Resource::ResourceSystem* mResourceSystem = nullptr; Resource::ResourceSystem* mResourceSystem = nullptr;
l10n::Manager* mL10nManager = nullptr; L10n::Manager* mL10nManager = nullptr;
float mFrameRateLimit = 0; float mFrameRateLimit = 0;
float mFrameDuration = 0; float mFrameDuration = 0;
@ -95,7 +95,7 @@ namespace MWBase
void setResourceSystem(Resource::ResourceSystem& value) { mResourceSystem = &value; } void setResourceSystem(Resource::ResourceSystem& value) { mResourceSystem = &value; }
void setL10nManager(l10n::Manager& value) { mL10nManager = &value; } void setL10nManager(L10n::Manager& value) { mL10nManager = &value; }
Misc::NotNullPtr<World> getWorld() const { return mWorld; } Misc::NotNullPtr<World> getWorld() const { return mWorld; }
Misc::NotNullPtr<MWWorld::WorldModel> getWorldModel() const { return mWorldModel; } Misc::NotNullPtr<MWWorld::WorldModel> getWorldModel() const { return mWorldModel; }
@ -122,7 +122,7 @@ namespace MWBase
Misc::NotNullPtr<Resource::ResourceSystem> getResourceSystem() const { return mResourceSystem; } Misc::NotNullPtr<Resource::ResourceSystem> getResourceSystem() const { return mResourceSystem; }
Misc::NotNullPtr<l10n::Manager> getL10nManager() const { return mL10nManager; } Misc::NotNullPtr<L10n::Manager> getL10nManager() const { return mL10nManager; }
float getFrameRateLimit() const { return mFrameRateLimit; } float getFrameRateLimit() const { return mFrameRateLimit; }

View File

@ -91,7 +91,7 @@ namespace MWGui
, mUpdateNextFrame(false) , mUpdateNextFrame(false)
{ {
mPreviewTexture mPreviewTexture
= std::make_unique<osgMyGUI::OSGTexture>(mPreview->getTexture(), mPreview->getTextureStateSet()); = std::make_unique<MyGUIPlatform::OSGTexture>(mPreview->getTexture(), mPreview->getTextureStateSet());
mPreview->rebuild(); mPreview->rebuild();
mMainWidget->castType<MyGUI::Window>()->eventWindowChangeCoord mMainWidget->castType<MyGUI::Window>()->eventWindowChangeCoord

View File

@ -294,7 +294,7 @@ namespace MWGui
if (!mGuiTexture.get()) if (!mGuiTexture.get())
{ {
mGuiTexture = std::make_unique<osgMyGUI::OSGTexture>(mTexture); mGuiTexture = std::make_unique<MyGUIPlatform::OSGTexture>(mTexture);
} }
if (!mCopyFramebufferToTextureCallback) if (!mCopyFramebufferToTextureCallback)

View File

@ -599,27 +599,27 @@ namespace MWGui
osg::ref_ptr<osg::Texture2D> texture = mLocalMapRender->getMapTexture(entry.mCellX, entry.mCellY); osg::ref_ptr<osg::Texture2D> texture = mLocalMapRender->getMapTexture(entry.mCellX, entry.mCellY);
if (texture) if (texture)
{ {
entry.mMapTexture = std::make_unique<osgMyGUI::OSGTexture>(texture); entry.mMapTexture = std::make_unique<MyGUIPlatform::OSGTexture>(texture);
entry.mMapWidget->setRenderItemTexture(entry.mMapTexture.get()); entry.mMapWidget->setRenderItemTexture(entry.mMapTexture.get());
entry.mMapWidget->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f)); entry.mMapWidget->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f));
needRedraw = true; needRedraw = true;
} }
else else
entry.mMapTexture = std::make_unique<osgMyGUI::OSGTexture>(std::string(), nullptr); entry.mMapTexture = std::make_unique<MyGUIPlatform::OSGTexture>(std::string(), nullptr);
} }
if (!entry.mFogTexture && mFogOfWarToggled && mFogOfWarEnabled) if (!entry.mFogTexture && mFogOfWarToggled && mFogOfWarEnabled)
{ {
osg::ref_ptr<osg::Texture2D> tex = mLocalMapRender->getFogOfWarTexture(entry.mCellX, entry.mCellY); osg::ref_ptr<osg::Texture2D> tex = mLocalMapRender->getFogOfWarTexture(entry.mCellX, entry.mCellY);
if (tex) if (tex)
{ {
entry.mFogTexture = std::make_unique<osgMyGUI::OSGTexture>(tex); entry.mFogTexture = std::make_unique<MyGUIPlatform::OSGTexture>(tex);
entry.mFogWidget->setRenderItemTexture(entry.mFogTexture.get()); entry.mFogWidget->setRenderItemTexture(entry.mFogTexture.get());
entry.mFogWidget->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 1.f, 1.f, 0.f)); entry.mFogWidget->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 1.f, 1.f, 0.f));
} }
else else
{ {
entry.mFogWidget->setImageTexture("black"); entry.mFogWidget->setImageTexture("black");
entry.mFogTexture = std::make_unique<osgMyGUI::OSGTexture>(std::string(), nullptr); entry.mFogTexture = std::make_unique<MyGUIPlatform::OSGTexture>(std::string(), nullptr);
} }
needRedraw = true; needRedraw = true;
} }
@ -1280,11 +1280,12 @@ namespace MWGui
{ {
if (!mGlobalMapTexture.get()) if (!mGlobalMapTexture.get())
{ {
mGlobalMapTexture = std::make_unique<osgMyGUI::OSGTexture>(mGlobalMapRender->getBaseTexture()); mGlobalMapTexture = std::make_unique<MyGUIPlatform::OSGTexture>(mGlobalMapRender->getBaseTexture());
mGlobalMapImage->setRenderItemTexture(mGlobalMapTexture.get()); mGlobalMapImage->setRenderItemTexture(mGlobalMapTexture.get());
mGlobalMapImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f)); mGlobalMapImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f));
mGlobalMapOverlayTexture = std::make_unique<osgMyGUI::OSGTexture>(mGlobalMapRender->getOverlayTexture()); mGlobalMapOverlayTexture
= std::make_unique<MyGUIPlatform::OSGTexture>(mGlobalMapRender->getOverlayTexture());
mGlobalMapOverlay->setRenderItemTexture(mGlobalMapOverlayTexture.get()); mGlobalMapOverlay->setRenderItemTexture(mGlobalMapOverlayTexture.get());
mGlobalMapOverlay->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f)); mGlobalMapOverlay->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f));

View File

@ -35,9 +35,9 @@ namespace MWGui
{ {
namespace namespace
{ {
std::shared_ptr<fx::Technique>& getTechnique(const MyGUI::ListBox& list, size_t selected) std::shared_ptr<Fx::Technique>& getTechnique(const MyGUI::ListBox& list, size_t selected)
{ {
return *list.getItemDataAt<std::shared_ptr<fx::Technique>>(selected); return *list.getItemDataAt<std::shared_ptr<Fx::Technique>>(selected);
} }
} }
@ -110,7 +110,7 @@ namespace MWGui
{ {
for (size_t i = 1; i < mConfigArea->getChildCount(); ++i) for (size_t i = 1; i < mConfigArea->getChildCount(); ++i)
{ {
if (auto* child = dynamic_cast<fx::Widgets::UniformBase*>(mConfigArea->getChildAt(i))) if (auto* child = dynamic_cast<Fx::Widgets::UniformBase*>(mConfigArea->getChildAt(i)))
child->toDefault(); child->toDefault();
} }
} }
@ -309,7 +309,7 @@ namespace MWGui
auto technique = processor->loadTechnique(path); auto technique = processor->loadTechnique(path);
if (technique->getStatus() == fx::Technique::Status::File_Not_exists) if (technique->getStatus() == Fx::Technique::Status::File_Not_exists)
return; return;
while (mConfigArea->getChildCount() > 0) while (mConfigArea->getChildCount() > 0)
@ -330,15 +330,15 @@ namespace MWGui
const auto flags = technique->getFlags(); const auto flags = technique->getFlags();
const auto flag_interior = serializeBool(!(flags & fx::Technique::Flag_Disable_Interiors)); const auto flag_interior = serializeBool(!(flags & Fx::Technique::Flag_Disable_Interiors));
const auto flag_exterior = serializeBool(!(flags & fx::Technique::Flag_Disable_Exteriors)); const auto flag_exterior = serializeBool(!(flags & Fx::Technique::Flag_Disable_Exteriors));
const auto flag_underwater = serializeBool(!(flags & fx::Technique::Flag_Disable_Underwater)); const auto flag_underwater = serializeBool(!(flags & Fx::Technique::Flag_Disable_Underwater));
const auto flag_abovewater = serializeBool(!(flags & fx::Technique::Flag_Disable_Abovewater)); const auto flag_abovewater = serializeBool(!(flags & Fx::Technique::Flag_Disable_Abovewater));
switch (technique->getStatus()) switch (technique->getStatus())
{ {
case fx::Technique::Status::Success: case Fx::Technique::Status::Success:
case fx::Technique::Status::Uncompiled: case Fx::Technique::Status::Uncompiled:
{ {
if (technique->getDynamic()) if (technique->getDynamic())
ss << "#{fontcolourhtml=header}#{OMWShaders:ShaderLocked}: #{fontcolourhtml=normal} " ss << "#{fontcolourhtml=header}#{OMWShaders:ShaderLocked}: #{fontcolourhtml=normal} "
@ -360,13 +360,13 @@ namespace MWGui
<< flag_abovewater; << flag_abovewater;
break; break;
} }
case fx::Technique::Status::Parse_Error: case Fx::Technique::Status::Parse_Error:
ss << "#{fontcolourhtml=negative}Shader Compile Error: #{fontcolourhtml=normal} <" ss << "#{fontcolourhtml=negative}Shader Compile Error: #{fontcolourhtml=normal} <"
<< std::string(technique->getName()) << "> failed to compile." << endl << std::string(technique->getName()) << "> failed to compile." << endl
<< endl << endl
<< technique->getLastError(); << technique->getLastError();
break; break;
case fx::Technique::Status::File_Not_exists: case Fx::Technique::Status::File_Not_exists:
break; break;
} }
@ -398,7 +398,7 @@ namespace MWGui
divider->setCaptionWithReplacing(uniform->mHeader); divider->setCaptionWithReplacing(uniform->mHeader);
} }
fx::Widgets::UniformBase* uwidget = mConfigArea->createWidget<fx::Widgets::UniformBase>( Fx::Widgets::UniformBase* uwidget = mConfigArea->createWidget<Fx::Widgets::UniformBase>(
"MW_UniformEdit", { 0, 0, 0, 22 }, MyGUI::Align::Default); "MW_UniformEdit", { 0, 0, 0, 22 }, MyGUI::Align::Default);
uwidget->init(uniform); uwidget->init(uniform);
uwidget->getLabel()->eventMouseWheel += MyGUI::newDelegate(this, &PostProcessorHud::notifyMouseWheel); uwidget->getLabel()->eventMouseWheel += MyGUI::newDelegate(this, &PostProcessorHud::notifyMouseWheel);
@ -489,14 +489,14 @@ namespace MWGui
void PostProcessorHud::registerMyGUIComponents() void PostProcessorHud::registerMyGUIComponents()
{ {
MyGUI::FactoryManager& factory = MyGUI::FactoryManager::getInstance(); MyGUI::FactoryManager& factory = MyGUI::FactoryManager::getInstance();
factory.registerFactory<fx::Widgets::UniformBase>("Widget"); factory.registerFactory<Fx::Widgets::UniformBase>("Widget");
factory.registerFactory<fx::Widgets::EditNumberFloat4>("Widget"); factory.registerFactory<Fx::Widgets::EditNumberFloat4>("Widget");
factory.registerFactory<fx::Widgets::EditNumberFloat3>("Widget"); factory.registerFactory<Fx::Widgets::EditNumberFloat3>("Widget");
factory.registerFactory<fx::Widgets::EditNumberFloat2>("Widget"); factory.registerFactory<Fx::Widgets::EditNumberFloat2>("Widget");
factory.registerFactory<fx::Widgets::EditNumberFloat>("Widget"); factory.registerFactory<Fx::Widgets::EditNumberFloat>("Widget");
factory.registerFactory<fx::Widgets::EditNumberInt>("Widget"); factory.registerFactory<Fx::Widgets::EditNumberInt>("Widget");
factory.registerFactory<fx::Widgets::EditBool>("Widget"); factory.registerFactory<Fx::Widgets::EditBool>("Widget");
factory.registerFactory<fx::Widgets::EditChoice>("Widget"); factory.registerFactory<Fx::Widgets::EditChoice>("Widget");
factory.registerFactory<ListWrapper>("Widget"); factory.registerFactory<ListWrapper>("Widget");
} }
} }

View File

@ -154,7 +154,7 @@ namespace MWGui
mPreview->setAngle(mCurrentAngle); mPreview->setAngle(mCurrentAngle);
mPreviewTexture mPreviewTexture
= std::make_unique<osgMyGUI::OSGTexture>(mPreview->getTexture(), mPreview->getTextureStateSet()); = std::make_unique<MyGUIPlatform::OSGTexture>(mPreview->getTexture(), mPreview->getTextureStateSet());
mPreviewImage->setRenderItemTexture(mPreviewTexture.get()); mPreviewImage->setRenderItemTexture(mPreviewTexture.get());
mPreviewImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f)); mPreviewImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f));

View File

@ -488,7 +488,7 @@ namespace MWGui
texture->setResizeNonPowerOfTwoHint(false); texture->setResizeNonPowerOfTwoHint(false);
texture->setUnRefImageDataAfterApply(true); texture->setUnRefImageDataAfterApply(true);
mScreenshotTexture = std::make_unique<osgMyGUI::OSGTexture>(texture); mScreenshotTexture = std::make_unique<MyGUIPlatform::OSGTexture>(texture);
mScreenshot->setRenderItemTexture(mScreenshotTexture.get()); mScreenshot->setRenderItemTexture(mScreenshotTexture.get());
} }
} }

View File

@ -50,7 +50,7 @@ namespace MWGui
if (!texture) if (!texture)
return; return;
mTexture = std::make_unique<osgMyGUI::OSGTexture>(texture); mTexture = std::make_unique<MyGUIPlatform::OSGTexture>(texture);
setRenderItemTexture(mTexture.get()); setRenderItemTexture(mTexture.get());
getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 1.f, 1.f, 0.f)); getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 1.f, 1.f, 0.f));

View File

@ -205,7 +205,7 @@ namespace MWGui
SDL_GL_GetDrawableSize(window, &dw, &dh); SDL_GL_GetDrawableSize(window, &dw, &dh);
mScalingFactor = Settings::gui().mScalingFactor * (dw / w); mScalingFactor = Settings::gui().mScalingFactor * (dw / w);
mGuiPlatform = std::make_unique<osgMyGUI::Platform>(viewer, guiRoot, resourceSystem->getImageManager(), mGuiPlatform = std::make_unique<MyGUIPlatform::Platform>(viewer, guiRoot, resourceSystem->getImageManager(),
resourceSystem->getVFS(), mScalingFactor, "mygui", logpath / "MyGUI.log"); resourceSystem->getVFS(), mScalingFactor, "mygui", logpath / "MyGUI.log");
mGui = std::make_unique<MyGUI::Gui>(); mGui = std::make_unique<MyGUI::Gui>();
@ -229,8 +229,8 @@ namespace MWGui
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Window>("Widget"); MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Window>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<VideoWidget>("Widget"); MyGUI::FactoryManager::getInstance().registerFactory<VideoWidget>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<BackgroundImage>("Widget"); MyGUI::FactoryManager::getInstance().registerFactory<BackgroundImage>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<osgMyGUI::AdditiveLayer>("Layer"); MyGUI::FactoryManager::getInstance().registerFactory<MyGUIPlatform::AdditiveLayer>("Layer");
MyGUI::FactoryManager::getInstance().registerFactory<osgMyGUI::ScalingLayer>("Layer"); MyGUI::FactoryManager::getInstance().registerFactory<MyGUIPlatform::ScalingLayer>("Layer");
BookPage::registerMyGUIComponents(); BookPage::registerMyGUIComponents();
PostProcessorHud::registerMyGUIComponents(); PostProcessorHud::registerMyGUIComponents();
ItemView::registerComponents(); ItemView::registerComponents();
@ -1127,7 +1127,7 @@ namespace MWGui
std::vector<std::string> split; std::vector<std::string> split;
Misc::StringUtils::split(tag, split, ":"); Misc::StringUtils::split(tag, split, ":");
l10n::Manager& l10nManager = *MWBase::Environment::get().getL10nManager(); L10n::Manager& l10nManager = *MWBase::Environment::get().getL10nManager();
// If a key has a "Context:KeyName" format, use YAML to translate data // If a key has a "Context:KeyName" format, use YAML to translate data
if (split.size() == 2) if (split.size() == 2)

View File

@ -402,7 +402,7 @@ namespace MWGui
Resource::ResourceSystem* mResourceSystem; Resource::ResourceSystem* mResourceSystem;
osg::ref_ptr<SceneUtil::WorkQueue> mWorkQueue; osg::ref_ptr<SceneUtil::WorkQueue> mWorkQueue;
std::unique_ptr<osgMyGUI::Platform> mGuiPlatform; std::unique_ptr<MyGUIPlatform::Platform> mGuiPlatform;
osgViewer::Viewer* mViewer; osgViewer::Viewer* mViewer;
std::unique_ptr<Gui::FontLoader> mFontLoader; std::unique_ptr<Gui::FontLoader> mFontLoader;

View File

@ -35,9 +35,9 @@ namespace MWLua
{ {
struct Shader struct Shader
{ {
std::shared_ptr<fx::Technique> mShader; std::shared_ptr<Fx::Technique> mShader;
Shader(std::shared_ptr<fx::Technique> shader) Shader(std::shared_ptr<Fx::Technique> shader)
: mShader(std::move(shader)) : mShader(std::move(shader))
{ {
} }

View File

@ -46,7 +46,7 @@ namespace MWRender
mMultiviewResolveStateSet->addUniform(new osg::Uniform("lastShader", 0)); mMultiviewResolveStateSet->addUniform(new osg::Uniform("lastShader", 0));
} }
void PingPongCanvas::setPasses(fx::DispatchArray&& passes) void PingPongCanvas::setPasses(Fx::DispatchArray&& passes)
{ {
mPasses = std::move(passes); mPasses = std::move(passes);
} }
@ -54,8 +54,8 @@ namespace MWRender
void PingPongCanvas::setMask(bool underwater, bool exterior) void PingPongCanvas::setMask(bool underwater, bool exterior)
{ {
mMask = 0; mMask = 0;
mMask |= underwater ? fx::Technique::Flag_Disable_Underwater : fx::Technique::Flag_Disable_Abovewater; mMask |= underwater ? Fx::Technique::Flag_Disable_Underwater : Fx::Technique::Flag_Disable_Abovewater;
mMask |= exterior ? fx::Technique::Flag_Disable_Exteriors : fx::Technique::Flag_Disable_Interiors; mMask |= exterior ? Fx::Technique::Flag_Disable_Exteriors : Fx::Technique::Flag_Disable_Interiors;
} }
void PingPongCanvas::drawGeometry(osg::RenderInfo& renderInfo) const void PingPongCanvas::drawGeometry(osg::RenderInfo& renderInfo) const

View File

@ -31,14 +31,14 @@ namespace MWRender
void dirty() { mDirty = true; } void dirty() { mDirty = true; }
void setDirtyAttachments(const std::vector<fx::Types::RenderTarget>& attachments) void setDirtyAttachments(const std::vector<Fx::Types::RenderTarget>& attachments)
{ {
mDirtyAttachments = attachments; mDirtyAttachments = attachments;
} }
const fx::DispatchArray& getPasses() { return mPasses; } const Fx::DispatchArray& getPasses() { return mPasses; }
void setPasses(fx::DispatchArray&& passes); void setPasses(Fx::DispatchArray&& passes);
void setMask(bool underwater, bool exterior); void setMask(bool underwater, bool exterior);
@ -60,8 +60,8 @@ namespace MWRender
bool mAvgLum = false; bool mAvgLum = false;
bool mPostprocessing = false; bool mPostprocessing = false;
fx::DispatchArray mPasses; Fx::DispatchArray mPasses;
fx::FlagsType mMask = 0; Fx::FlagsType mMask = 0;
osg::ref_ptr<osg::Program> mFallbackProgram; osg::ref_ptr<osg::Program> mFallbackProgram;
osg::ref_ptr<osg::Program> mMultiviewResolveProgram; osg::ref_ptr<osg::Program> mMultiviewResolveProgram;
@ -74,7 +74,7 @@ namespace MWRender
osg::ref_ptr<osg::Texture> mTextureDistortion; osg::ref_ptr<osg::Texture> mTextureDistortion;
mutable bool mDirty = false; mutable bool mDirty = false;
mutable std::vector<fx::Types::RenderTarget> mDirtyAttachments; mutable std::vector<Fx::Types::RenderTarget> mDirtyAttachments;
mutable osg::ref_ptr<osg::Viewport> mRenderViewport; mutable osg::ref_ptr<osg::Viewport> mRenderViewport;
mutable osg::ref_ptr<osg::FrameBufferObject> mMultiviewResolveFramebuffer; mutable osg::ref_ptr<osg::FrameBufferObject> mMultiviewResolveFramebuffer;
mutable osg::ref_ptr<osg::FrameBufferObject> mDestinationFBO; mutable osg::ref_ptr<osg::FrameBufferObject> mDestinationFBO;

View File

@ -207,7 +207,7 @@ namespace MWRender
mGLSLVersion = ext->glslLanguageVersion * 100; mGLSLVersion = ext->glslLanguageVersion * 100;
mUBO = ext->isUniformBufferObjectSupported && mGLSLVersion >= 330; mUBO = ext->isUniformBufferObjectSupported && mGLSLVersion >= 330;
mStateUpdater = new fx::StateUpdater(mUBO); mStateUpdater = new Fx::StateUpdater(mUBO);
addChild(mHUDCamera); addChild(mHUDCamera);
addChild(mRootNode); addChild(mRootNode);
@ -251,10 +251,10 @@ namespace MWRender
void PostProcessor::populateTechniqueFiles() void PostProcessor::populateTechniqueFiles()
{ {
for (const auto& path : mVFS->getRecursiveDirectoryIterator(fx::Technique::sSubdir)) for (const auto& path : mVFS->getRecursiveDirectoryIterator(Fx::Technique::sSubdir))
{ {
std::string_view fileExt = Misc::getFileExtension(path); std::string_view fileExt = Misc::getFileExtension(path);
if (path.parent().parent().empty() && fileExt == fx::Technique::sExt) if (path.parent().parent().empty() && fileExt == Fx::Technique::sExt)
{ {
mTechniqueFiles.emplace(path); mTechniqueFiles.emplace(path);
} }
@ -347,7 +347,7 @@ namespace MWRender
for (auto& technique : mTechniques) for (auto& technique : mTechniques)
{ {
if (technique->getStatus() == fx::Technique::Status::File_Not_exists) if (technique->getStatus() == Fx::Technique::Status::File_Not_exists)
continue; continue;
const auto lastWriteTime = mVFS->getLastModified(technique->getFileName()); const auto lastWriteTime = mVFS->getLastModified(technique->getFileName());
@ -400,7 +400,7 @@ namespace MWRender
createObjectsForFrame(frameId); createObjectsForFrame(frameId);
mDirty = false; mDirty = false;
mCanvases[frameId]->setPasses(fx::DispatchArray(mTemplateData)); mCanvases[frameId]->setPasses(Fx::DispatchArray(mTemplateData));
} }
if ((mNormalsSupported && mNormals != mPrevNormals) || (mPassLights != mPrevPassLights)) if ((mNormalsSupported && mNormals != mPrevNormals) || (mPassLights != mPrevPassLights))
@ -565,7 +565,7 @@ namespace MWRender
mNormals = false; mNormals = false;
mPassLights = false; mPassLights = false;
std::vector<fx::Types::RenderTarget> attachmentsToDirty; std::vector<Fx::Types::RenderTarget> attachmentsToDirty;
for (const auto& technique : mTechniques) for (const auto& technique : mTechniques)
{ {
@ -579,7 +579,7 @@ namespace MWRender
continue; continue;
} }
fx::DispatchNode node; Fx::DispatchNode node;
node.mFlags = technique->getFlags(); node.mFlags = technique->getFlags();
@ -592,7 +592,7 @@ namespace MWRender
if (technique->getLights()) if (technique->getLights())
mPassLights = true; mPassLights = true;
if (node.mFlags & fx::Technique::Flag_Disable_SunGlare) if (node.mFlags & Fx::Technique::Flag_Disable_SunGlare)
sunglare = false; sunglare = false;
// required default samplers available to every shader pass // required default samplers available to every shader pass
@ -638,7 +638,7 @@ namespace MWRender
for (const auto& pass : technique->getPasses()) for (const auto& pass : technique->getPasses())
{ {
int subTexUnit = texUnit; int subTexUnit = texUnit;
fx::DispatchNode::SubPass subPass; Fx::DispatchNode::SubPass subPass;
pass->prepareStateSet(subPass.mStateSet, technique->getName()); pass->prepareStateSet(subPass.mStateSet, technique->getName());
@ -673,7 +673,7 @@ namespace MWRender
[renderTarget](const auto& rt) { return renderTarget.mTarget == rt.mTarget; }) [renderTarget](const auto& rt) { return renderTarget.mTarget == rt.mTarget; })
== attachmentsToDirty.cend()) == attachmentsToDirty.cend())
{ {
attachmentsToDirty.push_back(fx::Types::RenderTarget(renderTarget)); attachmentsToDirty.push_back(Fx::Types::RenderTarget(renderTarget));
} }
} }
@ -692,7 +692,7 @@ namespace MWRender
[renderTarget](const auto& rt) { return renderTarget.mTarget == rt.mTarget; }) [renderTarget](const auto& rt) { return renderTarget.mTarget == rt.mTarget; })
== attachmentsToDirty.cend()) == attachmentsToDirty.cend())
{ {
attachmentsToDirty.push_back(fx::Types::RenderTarget(renderTarget)); attachmentsToDirty.push_back(Fx::Types::RenderTarget(renderTarget));
} }
subTexUnit++; subTexUnit++;
} }
@ -705,7 +705,7 @@ namespace MWRender
mTemplateData.emplace_back(std::move(node)); mTemplateData.emplace_back(std::move(node));
} }
mCanvases[frameId]->setPasses(fx::DispatchArray(mTemplateData)); mCanvases[frameId]->setPasses(Fx::DispatchArray(mTemplateData));
if (auto hud = MWBase::Environment::get().getWindowManager()->getPostProcessorHud()) if (auto hud = MWBase::Environment::get().getWindowManager()->getPostProcessorHud())
hud->updateTechniques(); hud->updateTechniques();
@ -717,7 +717,7 @@ namespace MWRender
} }
PostProcessor::Status PostProcessor::enableTechnique( PostProcessor::Status PostProcessor::enableTechnique(
std::shared_ptr<fx::Technique> technique, std::optional<int> location) std::shared_ptr<Fx::Technique> technique, std::optional<int> location)
{ {
if (technique->getLocked() || (location.has_value() && location.value() < 0)) if (technique->getLocked() || (location.has_value() && location.value() < 0))
return Status_Error; return Status_Error;
@ -732,7 +732,7 @@ namespace MWRender
return Status_Toggled; return Status_Toggled;
} }
PostProcessor::Status PostProcessor::disableTechnique(std::shared_ptr<fx::Technique> technique, bool dirty) PostProcessor::Status PostProcessor::disableTechnique(std::shared_ptr<Fx::Technique> technique, bool dirty)
{ {
if (technique->getLocked()) if (technique->getLocked())
return Status_Error; return Status_Error;
@ -748,7 +748,7 @@ namespace MWRender
return Status_Toggled; return Status_Toggled;
} }
bool PostProcessor::isTechniqueEnabled(const std::shared_ptr<fx::Technique>& technique) const bool PostProcessor::isTechniqueEnabled(const std::shared_ptr<Fx::Technique>& technique) const
{ {
if (auto it = std::find(mTechniques.begin(), mTechniques.end(), technique); it == mTechniques.end()) if (auto it = std::find(mTechniques.begin(), mTechniques.end(), technique); it == mTechniques.end())
return false; return false;
@ -756,13 +756,13 @@ namespace MWRender
return technique->isValid(); return technique->isValid();
} }
std::shared_ptr<fx::Technique> PostProcessor::loadTechnique(std::string_view name, bool loadNextFrame) std::shared_ptr<Fx::Technique> PostProcessor::loadTechnique(std::string_view name, bool loadNextFrame)
{ {
VFS::Path::Normalized path = fx::Technique::makeFileName(name); VFS::Path::Normalized path = Fx::Technique::makeFileName(name);
return loadTechnique(VFS::Path::NormalizedView(path), loadNextFrame); return loadTechnique(VFS::Path::NormalizedView(path), loadNextFrame);
} }
std::shared_ptr<fx::Technique> PostProcessor::loadTechnique(VFS::Path::NormalizedView path, bool loadNextFrame) std::shared_ptr<Fx::Technique> PostProcessor::loadTechnique(VFS::Path::NormalizedView path, bool loadNextFrame)
{ {
for (const auto& technique : mTemplates) for (const auto& technique : mTemplates)
if (technique->getFileName() == path) if (technique->getFileName() == path)
@ -778,12 +778,12 @@ namespace MWRender
else else
name = path.stem(); name = path.stem();
auto technique = std::make_shared<fx::Technique>(*mVFS, *mRendering.getResourceSystem()->getImageManager(), auto technique = std::make_shared<Fx::Technique>(*mVFS, *mRendering.getResourceSystem()->getImageManager(),
path, std::move(name), renderWidth(), renderHeight(), mUBO, mNormalsSupported); path, std::move(name), renderWidth(), renderHeight(), mUBO, mNormalsSupported);
technique->compile(); technique->compile();
if (technique->getStatus() != fx::Technique::Status::File_Not_exists) if (technique->getStatus() != Fx::Technique::Status::File_Not_exists)
technique->setLastModificationTime(mVFS->getLastModified(path)); technique->setLastModificationTime(mVFS->getLastModified(path));
if (loadNextFrame) if (loadNextFrame)
@ -840,7 +840,7 @@ namespace MWRender
{ {
for (auto& technique : mTemplates) for (auto& technique : mTemplates)
{ {
if (technique->getStatus() == fx::Technique::Status::File_Not_exists) if (technique->getStatus() == Fx::Technique::Status::File_Not_exists)
continue; continue;
technique->compile(); technique->compile();
} }

View File

@ -58,7 +58,7 @@ namespace MWRender
public: public:
using FBOArray = std::array<osg::ref_ptr<osg::FrameBufferObject>, 6>; using FBOArray = std::array<osg::ref_ptr<osg::FrameBufferObject>, 6>;
using TextureArray = std::array<osg::ref_ptr<osg::Texture>, 6>; using TextureArray = std::array<osg::ref_ptr<osg::Texture>, 6>;
using TechniqueList = std::vector<std::shared_ptr<fx::Technique>>; using TechniqueList = std::vector<std::shared_ptr<Fx::Technique>>;
enum TextureIndex enum TextureIndex
{ {
@ -122,7 +122,7 @@ namespace MWRender
osg::ref_ptr<osg::Camera> getHUDCamera() { return mHUDCamera; } osg::ref_ptr<osg::Camera> getHUDCamera() { return mHUDCamera; }
osg::ref_ptr<fx::StateUpdater> getStateUpdater() { return mStateUpdater; } osg::ref_ptr<Fx::StateUpdater> getStateUpdater() { return mStateUpdater; }
const TechniqueList& getTechniques() { return mTechniques; } const TechniqueList& getTechniques() { return mTechniques; }
@ -132,14 +132,14 @@ namespace MWRender
void resize(); void resize();
Status enableTechnique(std::shared_ptr<fx::Technique> technique, std::optional<int> location = std::nullopt); Status enableTechnique(std::shared_ptr<Fx::Technique> technique, std::optional<int> location = std::nullopt);
Status disableTechnique(std::shared_ptr<fx::Technique> technique, bool dirty = true); Status disableTechnique(std::shared_ptr<Fx::Technique> technique, bool dirty = true);
bool getSupportsNormalsRT() const { return mNormalsSupported; } bool getSupportsNormalsRT() const { return mNormalsSupported; }
template <class T> template <class T>
void setUniform(std::shared_ptr<fx::Technique> technique, const std::string& name, const T& value) void setUniform(std::shared_ptr<Fx::Technique> technique, const std::string& name, const T& value)
{ {
if (!isEnabled()) if (!isEnabled())
return; return;
@ -158,7 +158,7 @@ namespace MWRender
(*it)->setValue(value); (*it)->setValue(value);
} }
std::optional<size_t> getUniformSize(std::shared_ptr<fx::Technique> technique, const std::string& name) std::optional<size_t> getUniformSize(std::shared_ptr<Fx::Technique> technique, const std::string& name)
{ {
auto it = technique->findUniform(name); auto it = technique->findUniform(name);
@ -168,7 +168,7 @@ namespace MWRender
return (*it)->getNumElements(); return (*it)->getNumElements();
} }
bool isTechniqueEnabled(const std::shared_ptr<fx::Technique>& technique) const; bool isTechniqueEnabled(const std::shared_ptr<Fx::Technique>& technique) const;
void setExteriorFlag(bool exterior) { mExteriorFlag = exterior; } void setExteriorFlag(bool exterior) { mExteriorFlag = exterior; }
@ -176,8 +176,8 @@ namespace MWRender
void toggleMode(); void toggleMode();
std::shared_ptr<fx::Technique> loadTechnique(VFS::Path::NormalizedView path, bool loadNextFrame = false); std::shared_ptr<Fx::Technique> loadTechnique(VFS::Path::NormalizedView path, bool loadNextFrame = false);
std::shared_ptr<fx::Technique> loadTechnique(std::string_view name, bool loadNextFrame = false); std::shared_ptr<Fx::Technique> loadTechnique(std::string_view name, bool loadNextFrame = false);
TechniqueList getChain(); TechniqueList getChain();
@ -263,13 +263,13 @@ namespace MWRender
int mHeight; int mHeight;
int mSamples; int mSamples;
osg::ref_ptr<fx::StateUpdater> mStateUpdater; osg::ref_ptr<Fx::StateUpdater> mStateUpdater;
osg::ref_ptr<PingPongCull> mPingPongCull; osg::ref_ptr<PingPongCull> mPingPongCull;
std::array<osg::ref_ptr<PingPongCanvas>, 2> mCanvases; std::array<osg::ref_ptr<PingPongCanvas>, 2> mCanvases;
osg::ref_ptr<TransparentDepthBinCallback> mTransparentDepthPostPass; osg::ref_ptr<TransparentDepthBinCallback> mTransparentDepthPostPass;
osg::ref_ptr<DistortionCallback> mDistortionCallback; osg::ref_ptr<DistortionCallback> mDistortionCallback;
fx::DispatchArray mTemplateData; Fx::DispatchArray mTemplateData;
}; };
} }

View File

@ -45,7 +45,7 @@ int main(int argc, char* argv[])
resourcesPath = Files::pathToQString(variables["resources"].as<Files::MaybeQuotedPath>().u8string()); resourcesPath = Files::pathToQString(variables["resources"].as<Files::MaybeQuotedPath>().u8string());
} }
l10n::installQtTranslations(app, "wizard", resourcesPath); L10n::installQtTranslations(app, "wizard", resourcesPath);
Wizard::MainWizard wizard(std::move(configurationManager)); Wizard::MainWizard wizard(std::move(configurationManager));

View File

@ -5,10 +5,12 @@
#include <string> #include <string>
#include <vector> #include <vector>
// NOLINTBEGIN(readability-identifier-naming)
namespace boost namespace boost
{ {
class any; class any;
} }
// NOLINTEND(readability-identifier-naming)
namespace Fallback namespace Fallback
{ {

View File

@ -9,11 +9,13 @@
#include <components/files/collections.hpp> #include <components/files/collections.hpp>
#include <components/files/fixedpath.hpp> #include <components/files/fixedpath.hpp>
// NOLINTBEGIN(readability-identifier-naming)
namespace boost::program_options namespace boost::program_options
{ {
class options_description; class options_description;
class variables_map; class variables_map;
} }
// NOLINTEND(readability-identifier-naming)
/** /**
* \namespace Files * \namespace Files

View File

@ -276,8 +276,8 @@ namespace Gui
{ {
Log(Debug::Info) << "Loading font file " << fileName; Log(Debug::Info) << "Loading font file " << fileName;
osgMyGUI::DataManager* dataManager MyGUIPlatform::DataManager* dataManager
= dynamic_cast<osgMyGUI::DataManager*>(&osgMyGUI::DataManager::getInstance()); = dynamic_cast<MyGUIPlatform::DataManager*>(&MyGUIPlatform::DataManager::getInstance());
if (!dataManager) if (!dataManager)
{ {
Log(Debug::Error) << "Can not load TrueType font " << fontId << ": osgMyGUI::DataManager is not available."; Log(Debug::Error) << "Can not load TrueType font " << fontId << ": osgMyGUI::DataManager is not available.";
@ -287,7 +287,7 @@ namespace Gui
// TODO: it may be worth to take in account resolution change, but it is not safe to replace used assets // TODO: it may be worth to take in account resolution change, but it is not safe to replace used assets
std::unique_ptr<MyGUI::IDataStream> layersStream(dataManager->getData("openmw_layers.xml")); std::unique_ptr<MyGUI::IDataStream> layersStream(dataManager->getData("openmw_layers.xml"));
MyGUI::IntSize bookSize = getBookSize(layersStream.get()); MyGUI::IntSize bookSize = getBookSize(layersStream.get());
float bookScale = osgMyGUI::ScalingLayer::getScaleFactor(bookSize); float bookScale = MyGUIPlatform::ScalingLayer::getScaleFactor(bookSize);
const auto oldDataPath = dataManager->getDataPath({}); const auto oldDataPath = dataManager->getDataPath({});
dataManager->setResourcePath("fonts"); dataManager->setResourcePath("fonts");

View File

@ -8,7 +8,7 @@
#include <components/misc/strings/format.hpp> #include <components/misc/strings/format.hpp>
namespace fx namespace Fx
{ {
namespace Lexer namespace Lexer
{ {

View File

@ -9,7 +9,7 @@
#include "lexertypes.hpp" #include "lexertypes.hpp"
namespace fx namespace Fx
{ {
namespace Lexer namespace Lexer
{ {

View File

@ -4,7 +4,7 @@
#include <string_view> #include <string_view>
#include <variant> #include <variant>
namespace fx namespace Fx
{ {
namespace Lexer namespace Lexer
{ {

View File

@ -13,11 +13,11 @@
#include "technique.hpp" #include "technique.hpp"
namespace fx namespace Fx
{ {
namespace constants namespace Constants
{ {
constexpr std::array<std::pair<std::string_view, fx::FlagsType>, 6> TechniqueFlag = { { constexpr std::array<std::pair<std::string_view, Fx::FlagsType>, 6> TechniqueFlag = { {
{ "disable_interiors", Technique::Flag_Disable_Interiors }, { "disable_interiors", Technique::Flag_Disable_Interiors },
{ "disable_exteriors", Technique::Flag_Disable_Exteriors }, { "disable_exteriors", Technique::Flag_Disable_Exteriors },
{ "disable_underwater", Technique::Flag_Disable_Underwater }, { "disable_underwater", Technique::Flag_Disable_Underwater },

View File

@ -49,7 +49,7 @@ void main()
} }
namespace fx namespace Fx
{ {
Pass::Pass(Pass::Type type, Pass::Order order, bool ubo) Pass::Pass(Pass::Type type, Pass::Order order, bool ubo)
: mCompiled(false) : mCompiled(false)

View File

@ -18,7 +18,7 @@ namespace osg
class StateSet; class StateSet;
} }
namespace fx namespace Fx
{ {
class Technique; class Technique;

View File

@ -5,7 +5,7 @@
#include <components/resource/scenemanager.hpp> #include <components/resource/scenemanager.hpp>
namespace fx namespace Fx
{ {
std::string StateUpdater::sDefinition = UniformData::getDefinition("_omw_data"); std::string StateUpdater::sDefinition = UniformData::getDefinition("_omw_data");

View File

@ -7,7 +7,7 @@
#include <components/sceneutil/statesetupdater.hpp> #include <components/sceneutil/statesetupdater.hpp>
#include <components/std140/ubo.hpp> #include <components/std140/ubo.hpp>
namespace fx namespace Fx
{ {
class StateUpdater : public SceneUtil::StateSetUpdater class StateUpdater : public SceneUtil::StateSetUpdater
{ {

View File

@ -35,7 +35,7 @@ namespace
}; };
} }
namespace fx namespace Fx
{ {
VFS::Path::Normalized Technique::makeFileName(std::string_view name) VFS::Path::Normalized Technique::makeFileName(std::string_view name)
{ {
@ -280,7 +280,7 @@ namespace fx
if (mRenderTargets.count(mBlockName)) if (mRenderTargets.count(mBlockName))
error(Misc::StringUtils::format("redeclaration of render target '%s'", std::string(mBlockName))); error(Misc::StringUtils::format("redeclaration of render target '%s'", std::string(mBlockName)));
fx::Types::RenderTarget rt; Fx::Types::RenderTarget rt;
rt.mTarget->setTextureSize(mWidth, mHeight); rt.mTarget->setTextureSize(mWidth, mHeight);
rt.mTarget->setSourceFormat(GL_RGB); rt.mTarget->setSourceFormat(GL_RGB);
rt.mTarget->setInternalFormat(GL_RGB); rt.mTarget->setInternalFormat(GL_RGB);
@ -341,7 +341,7 @@ namespace fx
auto& pass = mPassMap[mBlockName]; auto& pass = mPassMap[mBlockName];
if (!pass) if (!pass)
pass = std::make_shared<fx::Pass>(); pass = std::make_shared<Fx::Pass>();
pass->mName = mBlockName; pass->mName = mBlockName;
@ -364,7 +364,7 @@ namespace fx
auto& pass = mPassMap[mBlockName]; auto& pass = mPassMap[mBlockName];
if (!pass) if (!pass)
pass = std::make_shared<fx::Pass>(); pass = std::make_shared<Fx::Pass>();
pass->mUBO = mUBO; pass->mUBO = mUBO;
pass->mName = mBlockName; pass->mName = mBlockName;
@ -388,7 +388,7 @@ namespace fx
auto& pass = mPassMap[mBlockName]; auto& pass = mPassMap[mBlockName];
if (!pass) if (!pass)
pass = std::make_shared<fx::Pass>(); pass = std::make_shared<Fx::Pass>();
pass->mName = mBlockName; pass->mName = mBlockName;
@ -810,7 +810,7 @@ namespace fx
auto& pass = mPassMap[mBlockName]; auto& pass = mPassMap[mBlockName];
if (!pass) if (!pass)
pass = std::make_shared<fx::Pass>(); pass = std::make_shared<Fx::Pass>();
while (!isNext<Lexer::Eof>()) while (!isNext<Lexer::Eof>())
{ {
@ -883,7 +883,7 @@ namespace fx
FlagsType Technique::parseFlags() FlagsType Technique::parseFlags()
{ {
auto parseBit = [this](std::string_view term) { auto parseBit = [this](std::string_view term) {
for (const auto& [identifer, bit] : constants::TechniqueFlag) for (const auto& [identifer, bit] : Constants::TechniqueFlag)
{ {
if (Misc::StringUtils::ciEqual(term, identifer)) if (Misc::StringUtils::ciEqual(term, identifer))
return bit; return bit;
@ -902,7 +902,7 @@ namespace fx
{ {
expect<Lexer::Literal>(); expect<Lexer::Literal>();
for (const auto& [identifer, mode] : constants::FilterMode) for (const auto& [identifer, mode] : Constants::FilterMode)
{ {
if (asLiteral() == identifer) if (asLiteral() == identifer)
return mode; return mode;
@ -915,7 +915,7 @@ namespace fx
{ {
expect<Lexer::Literal>(); expect<Lexer::Literal>();
for (const auto& [identifer, mode] : constants::WrapMode) for (const auto& [identifer, mode] : Constants::WrapMode)
{ {
if (asLiteral() == identifer) if (asLiteral() == identifer)
return mode; return mode;
@ -933,7 +933,7 @@ namespace fx
{ {
expect<Lexer::Literal>(); expect<Lexer::Literal>();
for (const auto& [identifer, mode] : constants::Compression) for (const auto& [identifer, mode] : Constants::Compression)
{ {
if (asLiteral() == identifer) if (asLiteral() == identifer)
return mode; return mode;
@ -946,7 +946,7 @@ namespace fx
{ {
expect<Lexer::Literal>(); expect<Lexer::Literal>();
for (const auto& [identifer, mode] : constants::InternalFormat) for (const auto& [identifer, mode] : Constants::InternalFormat)
{ {
if (asLiteral() == identifer) if (asLiteral() == identifer)
return mode; return mode;
@ -959,7 +959,7 @@ namespace fx
{ {
expect<Lexer::Literal>(); expect<Lexer::Literal>();
for (const auto& [identifer, mode] : constants::SourceType) for (const auto& [identifer, mode] : Constants::SourceType)
{ {
if (asLiteral() == identifer) if (asLiteral() == identifer)
return mode; return mode;
@ -972,7 +972,7 @@ namespace fx
{ {
expect<Lexer::Literal>(); expect<Lexer::Literal>();
for (const auto& [identifer, mode] : constants::SourceFormat) for (const auto& [identifer, mode] : Constants::SourceFormat)
{ {
if (asLiteral() == identifer) if (asLiteral() == identifer)
return mode; return mode;
@ -985,7 +985,7 @@ namespace fx
{ {
expect<Lexer::Literal>(); expect<Lexer::Literal>();
for (const auto& [identifer, mode] : constants::BlendEquation) for (const auto& [identifer, mode] : Constants::BlendEquation)
{ {
if (asLiteral() == identifer) if (asLiteral() == identifer)
return mode; return mode;
@ -998,7 +998,7 @@ namespace fx
{ {
expect<Lexer::Literal>(); expect<Lexer::Literal>();
for (const auto& [identifer, mode] : constants::BlendFunc) for (const auto& [identifer, mode] : Constants::BlendFunc)
{ {
if (asLiteral() == identifer) if (asLiteral() == identifer)
return mode; return mode;
@ -1025,11 +1025,11 @@ namespace fx
*/ */
expect<Lexer::Open_Parenthesis>(); expect<Lexer::Open_Parenthesis>();
std::vector<fx::Types::Choice<SrcT>> choices; std::vector<Fx::Types::Choice<SrcT>> choices;
while (!isNext<Lexer::Eof>()) while (!isNext<Lexer::Eof>())
{ {
fx::Types::Choice<SrcT> choice; Fx::Types::Choice<SrcT> choice;
choice.mLabel = parseString(); choice.mLabel = parseString();
expect<Lexer::Equal>(); expect<Lexer::Equal>();
choice.mValue = getUniformValue<SrcT, T>(); choice.mValue = getUniformValue<SrcT, T>();

View File

@ -29,7 +29,7 @@ namespace VFS
class Manager; class Manager;
} }
namespace fx namespace Fx
{ {
using FlagsType = size_t; using FlagsType = size_t;
@ -85,7 +85,7 @@ namespace fx
} }
// not safe to read/write in draw thread // not safe to read/write in draw thread
std::shared_ptr<fx::Technique> mHandle = nullptr; std::shared_ptr<Fx::Technique> mHandle = nullptr;
FlagsType mFlags = 0; FlagsType mFlags = 0;

View File

@ -12,7 +12,7 @@
#include <components/sceneutil/depth.hpp> #include <components/sceneutil/depth.hpp>
#include <components/settings/shadermanager.hpp> #include <components/settings/shadermanager.hpp>
namespace fx namespace Fx
{ {
namespace Types namespace Types
{ {

View File

@ -6,7 +6,7 @@ namespace
{ {
template <class T, class WidgetT> template <class T, class WidgetT>
void createVectorWidget( void createVectorWidget(
const std::shared_ptr<fx::Types::UniformBase>& uniform, MyGUI::Widget* client, fx::Widgets::UniformBase* base) const std::shared_ptr<Fx::Types::UniformBase>& uniform, MyGUI::Widget* client, Fx::Widgets::UniformBase* base)
{ {
int height = client->getHeight(); int height = client->getHeight();
base->setSize(base->getSize().width, (base->getSize().height - height) + (height * T::num_components)); base->setSize(base->getSize().width, (base->getSize().height - height) + (height * T::num_components));
@ -16,13 +16,13 @@ namespace
{ {
auto* widget = client->createWidget<WidgetT>( auto* widget = client->createWidget<WidgetT>(
"MW_ValueEditNumber", { 0, height * i, client->getWidth(), height }, MyGUI::Align::Default); "MW_ValueEditNumber", { 0, height * i, client->getWidth(), height }, MyGUI::Align::Default);
widget->setData(uniform, static_cast<fx::Widgets::Index>(i)); widget->setData(uniform, static_cast<Fx::Widgets::Index>(i));
base->addItem(widget); base->addItem(widget);
} }
} }
} }
namespace fx namespace Fx
{ {
namespace Widgets namespace Widgets
{ {
@ -127,7 +127,7 @@ namespace fx
mChoices->eventComboChangePosition += MyGUI::newDelegate(this, &EditChoice::notifyComboBoxChanged); mChoices->eventComboChangePosition += MyGUI::newDelegate(this, &EditChoice::notifyComboBoxChanged);
} }
void UniformBase::init(const std::shared_ptr<fx::Types::UniformBase>& uniform) void UniformBase::init(const std::shared_ptr<Fx::Types::UniformBase>& uniform)
{ {
if (uniform->mDisplayName.empty()) if (uniform->mDisplayName.empty())
mLabel->setCaption(uniform->mName); mLabel->setCaption(uniform->mName);

View File

@ -28,7 +28,7 @@ namespace Gui
class AutoSizedButton; class AutoSizedButton;
} }
namespace fx namespace Fx
{ {
namespace Widgets namespace Widgets
{ {
@ -46,7 +46,7 @@ namespace fx
public: public:
virtual ~EditBase() = default; virtual ~EditBase() = default;
void setData(const std::shared_ptr<fx::Types::UniformBase>& uniform, Index index = None) void setData(const std::shared_ptr<Fx::Types::UniformBase>& uniform, Index index = None)
{ {
mUniform = uniform; mUniform = uniform;
mIndex = index; mIndex = index;
@ -57,7 +57,7 @@ namespace fx
virtual void toDefault() = 0; virtual void toDefault() = 0;
protected: protected:
std::shared_ptr<fx::Types::UniformBase> mUniform; std::shared_ptr<Fx::Types::UniformBase> mUniform;
Index mIndex; Index mIndex;
}; };
@ -268,7 +268,7 @@ namespace fx
MYGUI_RTTI_DERIVED(UniformBase) MYGUI_RTTI_DERIVED(UniformBase)
public: public:
void init(const std::shared_ptr<fx::Types::UniformBase>& uniform); void init(const std::shared_ptr<Fx::Types::UniformBase>& uniform);
void toDefault(); void toDefault();

View File

@ -6,7 +6,7 @@
#include <components/debug/debuglog.hpp> #include <components/debug/debuglog.hpp>
#include <components/vfs/manager.hpp> #include <components/vfs/manager.hpp>
namespace l10n namespace L10n
{ {
void Manager::setPreferredLocales(const std::vector<std::string>& langs, bool gmstHasPriority) void Manager::setPreferredLocales(const std::vector<std::string>& langs, bool gmstHasPriority)

View File

@ -10,7 +10,7 @@ namespace VFS
class Manager; class Manager;
} }
namespace l10n namespace L10n
{ {
class Manager class Manager

View File

@ -7,7 +7,7 @@
#include <components/debug/debuglog.hpp> #include <components/debug/debuglog.hpp>
namespace l10n namespace L10n
{ {
MessageBundles::MessageBundles(const std::vector<icu::Locale>& preferredLocales, icu::Locale& fallbackLocale) MessageBundles::MessageBundles(const std::vector<icu::Locale>& preferredLocales, icu::Locale& fallbackLocale)
: mFallbackLocale(fallbackLocale) : mFallbackLocale(fallbackLocale)

View File

@ -10,7 +10,7 @@
#include <unicode/locid.h> #include <unicode/locid.h>
#include <unicode/msgfmt.h> #include <unicode/msgfmt.h>
namespace l10n namespace L10n
{ {
/** /**
* @brief A collection of Message Bundles * @brief A collection of Message Bundles

View File

@ -3,7 +3,7 @@
#include <QLibraryInfo> #include <QLibraryInfo>
#include <QLocale> #include <QLocale>
namespace l10n namespace L10n
{ {
QTranslator AppTranslator{}; QTranslator AppTranslator{};
QTranslator ComponentsTranslator{}; QTranslator ComponentsTranslator{};

View File

@ -4,7 +4,7 @@
#include <QApplication> #include <QApplication>
#include <QTranslator> #include <QTranslator>
namespace l10n namespace L10n
{ {
extern QTranslator AppTranslator; extern QTranslator AppTranslator;
extern QTranslator ComponentsTranslator; extern QTranslator ComponentsTranslator;

View File

@ -8,7 +8,7 @@ namespace
{ {
struct L10nContext struct L10nContext
{ {
std::shared_ptr<const l10n::MessageBundles> mData; std::shared_ptr<const L10n::MessageBundles> mData;
}; };
void getICUArgs(std::string_view messageId, const sol::table& table, std::vector<icu::UnicodeString>& argNames, void getICUArgs(std::string_view messageId, const sol::table& table, std::vector<icu::UnicodeString>& argNames,
@ -52,7 +52,7 @@ namespace sol
namespace LuaUtil namespace LuaUtil
{ {
sol::function initL10nLoader(lua_State* L, l10n::Manager* manager) sol::function initL10nLoader(lua_State* L, L10n::Manager* manager)
{ {
sol::state_view lua(L); sol::state_view lua(L);
sol::usertype<L10nContext> ctxDef = lua.new_usertype<L10nContext>("L10nContext"); sol::usertype<L10nContext> ctxDef = lua.new_usertype<L10nContext>("L10nContext");

View File

@ -3,14 +3,14 @@
#include <sol/sol.hpp> #include <sol/sol.hpp>
namespace l10n namespace L10n
{ {
class Manager; class Manager;
} }
namespace LuaUtil namespace LuaUtil
{ {
sol::function initL10nLoader(lua_State*, l10n::Manager* manager); sol::function initL10nLoader(lua_State*, L10n::Manager* manager);
} }
#endif // COMPONENTS_LUA_L10N_H #endif // COMPONENTS_LUA_L10N_H

View File

@ -453,7 +453,7 @@ namespace LuaUtil
return call(sol::state_view(obj.lua_state())["tostring"], obj); return call(sol::state_view(obj.lua_state())["tostring"], obj);
} }
std::string internal::formatCastingError(const sol::object& obj, const std::type_info& t) std::string Internal::formatCastingError(const sol::object& obj, const std::type_info& t)
{ {
const char* typeName = t.name(); const char* typeName = t.name();
if (t == typeid(int)) if (t == typeid(int))

View File

@ -325,7 +325,7 @@ namespace LuaUtil
// String representation of a Lua object. Should be used for debugging/logging purposes only. // String representation of a Lua object. Should be used for debugging/logging purposes only.
std::string toString(const sol::object&); std::string toString(const sol::object&);
namespace internal namespace Internal
{ {
std::string formatCastingError(const sol::object& obj, const std::type_info&); std::string formatCastingError(const sol::object& obj, const std::type_info&);
} }
@ -334,7 +334,7 @@ namespace LuaUtil
decltype(auto) cast(const sol::object& obj) decltype(auto) cast(const sol::object& obj)
{ {
if (!obj.is<T>()) if (!obj.is<T>())
throw std::runtime_error(internal::formatCastingError(obj, typeid(T))); throw std::runtime_error(Internal::formatCastingError(obj, typeid(T)));
return obj.as<T>(); return obj.as<T>();
} }

View File

@ -5,7 +5,7 @@
#include "myguirendermanager.hpp" #include "myguirendermanager.hpp"
namespace osgMyGUI namespace MyGUIPlatform
{ {
AdditiveLayer::AdditiveLayer() AdditiveLayer::AdditiveLayer()

View File

@ -10,7 +10,7 @@ namespace osg
class StateSet; class StateSet;
} }
namespace osgMyGUI namespace MyGUIPlatform
{ {
/// @brief A Layer rendering with additive blend mode. /// @brief A Layer rendering with additive blend mode.

View File

@ -24,7 +24,7 @@ namespace
}; };
} }
namespace osgMyGUI namespace MyGUIPlatform
{ {
void DataManager::setResourcePath(const std::filesystem::path& path) void DataManager::setResourcePath(const std::filesystem::path& path)

View File

@ -11,7 +11,7 @@ namespace VFS
class Manager; class Manager;
} }
namespace osgMyGUI namespace MyGUIPlatform
{ {
class DataManager : public MyGUI::DataManager class DataManager : public MyGUI::DataManager

View File

@ -4,7 +4,7 @@
#include <components/debug/debuglog.hpp> #include <components/debug/debuglog.hpp>
namespace osgMyGUI namespace MyGUIPlatform
{ {
void CustomLogListener::open() void CustomLogListener::open()
{ {

View File

@ -10,7 +10,7 @@
#include <MyGUI_LevelLogFilter.h> #include <MyGUI_LevelLogFilter.h>
#include <MyGUI_LogSource.h> #include <MyGUI_LogSource.h>
namespace osgMyGUI namespace MyGUIPlatform
{ {
/// \brief Custom MyGUI::ILogListener interface implementation /// \brief Custom MyGUI::ILogListener interface implementation

View File

@ -6,7 +6,7 @@
#include "components/files/conversion.hpp" #include "components/files/conversion.hpp"
namespace osgMyGUI namespace MyGUIPlatform
{ {
Platform::Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::ImageManager* imageManager, Platform::Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::ImageManager* imageManager,

View File

@ -26,7 +26,7 @@ namespace VFS
class Manager; class Manager;
} }
namespace osgMyGUI namespace MyGUIPlatform
{ {
class RenderManager; class RenderManager;

View File

@ -40,12 +40,12 @@
} \ } \
} while (0) } while (0)
namespace osgMyGUI namespace MyGUIPlatform
{ {
class Drawable : public osg::Drawable class Drawable : public osg::Drawable
{ {
osgMyGUI::RenderManager* mParent; MyGUIPlatform::RenderManager* mParent;
osg::ref_ptr<osg::StateSet> mStateSet; osg::ref_ptr<osg::StateSet> mStateSet;
public: public:
@ -58,12 +58,12 @@ namespace osgMyGUI
{ {
} }
void setRenderManager(osgMyGUI::RenderManager* renderManager) { mRenderManager = renderManager; } void setRenderManager(MyGUIPlatform::RenderManager* renderManager) { mRenderManager = renderManager; }
void operator()(osg::Node*, osg::NodeVisitor*) { mRenderManager->update(); } void operator()(osg::Node*, osg::NodeVisitor*) { mRenderManager->update(); }
private: private:
osgMyGUI::RenderManager* mRenderManager; MyGUIPlatform::RenderManager* mRenderManager;
}; };
// Stage 1: collect draw calls. Run during the Cull traversal. // Stage 1: collect draw calls. Run during the Cull traversal.
@ -75,12 +75,12 @@ namespace osgMyGUI
{ {
} }
void setRenderManager(osgMyGUI::RenderManager* renderManager) { mRenderManager = renderManager; } void setRenderManager(MyGUIPlatform::RenderManager* renderManager) { mRenderManager = renderManager; }
void operator()(osg::Node*, osg::NodeVisitor*) { mRenderManager->collectDrawCalls(); } void operator()(osg::Node*, osg::NodeVisitor*) { mRenderManager->collectDrawCalls(); }
private: private:
osgMyGUI::RenderManager* mRenderManager; MyGUIPlatform::RenderManager* mRenderManager;
}; };
// Stage 2: execute the draw calls. Run during the Draw traversal. May run in parallel with the update traversal // Stage 2: execute the draw calls. Run during the Draw traversal. May run in parallel with the update traversal
@ -162,7 +162,7 @@ namespace osgMyGUI
} }
public: public:
Drawable(osgMyGUI::RenderManager* parent = nullptr) Drawable(MyGUIPlatform::RenderManager* parent = nullptr)
: mParent(parent) : mParent(parent)
, mWriteTo(0) , mWriteTo(0)
, mReadFrom(0) , mReadFrom(0)

View File

@ -28,7 +28,7 @@ namespace osg
class StateSet; class StateSet;
} }
namespace osgMyGUI namespace MyGUIPlatform
{ {
class Drawable; class Drawable;

View File

@ -8,7 +8,7 @@
#include <components/debug/debuglog.hpp> #include <components/debug/debuglog.hpp>
#include <components/resource/imagemanager.hpp> #include <components/resource/imagemanager.hpp>
namespace osgMyGUI namespace MyGUIPlatform
{ {
OSGTexture::OSGTexture(const std::string& name, Resource::ImageManager* imageManager) OSGTexture::OSGTexture(const std::string& name, Resource::ImageManager* imageManager)

View File

@ -17,7 +17,7 @@ namespace Resource
class ImageManager; class ImageManager;
} }
namespace osgMyGUI namespace MyGUIPlatform
{ {
class OSGTexture final : public MyGUI::ITexture class OSGTexture final : public MyGUI::ITexture

View File

@ -3,7 +3,7 @@
#include <MyGUI_RenderManager.h> #include <MyGUI_RenderManager.h>
#include <algorithm> #include <algorithm>
namespace osgMyGUI namespace MyGUIPlatform
{ {
/// @brief the ProxyRenderTarget allows to adjust the pixel scale and offset for a "source" render target. /// @brief the ProxyRenderTarget allows to adjust the pixel scale and offset for a "source" render target.

View File

@ -3,7 +3,7 @@
#include <MyGUI_OverlappedLayer.h> #include <MyGUI_OverlappedLayer.h>
namespace osgMyGUI namespace MyGUIPlatform
{ {
///@brief A Layer that lays out and renders widgets in screen-relative coordinates. The "Size" property determines ///@brief A Layer that lays out and renders widgets in screen-relative coordinates. The "Size" property determines