From 510029c1d1974d3e0d417e87da30261357fec510 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 17 Oct 2018 11:04:01 +0300 Subject: Clean up StudioUtils Made StudioUtils a class of static functions instead of global functions. Also cleaned up the code a bit where changes happened because of this change. Change-Id: Ic583dd25bf228c7e344be6664b6651958d84906e Reviewed-by: Mahmoud Badri Reviewed-by: Janne Kangas Reviewed-by: Miikka Heikkinen --- src/Authoring/Studio/Render/StudioRenderer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/Authoring/Studio/Render/StudioRenderer.cpp') diff --git a/src/Authoring/Studio/Render/StudioRenderer.cpp b/src/Authoring/Studio/Render/StudioRenderer.cpp index 61af4114..8b08a6fe 100644 --- a/src/Authoring/Studio/Render/StudioRenderer.cpp +++ b/src/Authoring/Studio/Render/StudioRenderer.cpp @@ -303,7 +303,8 @@ struct SRendererImpl : public IStudioRenderer, try { m_RenderContext = std::make_shared(inWindow); - Q3DStudio::CString theResourcePath = Q3DStudio::CString::fromQString(resourcePath()); + Q3DStudio::CString theResourcePath = Q3DStudio::CString::fromQString( + StudioUtils::resourcePath()); NVScopedRefCounted theCore = qt3ds::render::IQt3DSRenderContextCore::Create( m_RenderContext->GetRenderContext().GetFoundation(), @@ -353,7 +354,7 @@ struct SRendererImpl : public IStudioRenderer, m_Rect = inRect; if (IsInitialized()) { - m_pixelRatio = devicePixelRatio(); + m_pixelRatio = StudioUtils::devicePixelRatio(); m_RenderContext->BeginRender(); NVRenderContext &theContext = m_RenderContext->GetRenderContext(); theContext.SetViewport(qt3ds::render::NVRenderRect(0, 0, inRect.width(), @@ -675,8 +676,9 @@ struct SRendererImpl : public IStudioRenderer, QString projectPath = g_StudioApp.GetCore()->getProjectFile().getProjectPath(); if (!projectPath.isEmpty()) { // Add the installed font folders from the res dir. - Q3DStudio::CString thePath(Q3DStudio::CString::fromQString( - resourcePath() + QStringLiteral("/Font"))); + Q3DStudio::CString thePath( + Q3DStudio::CString::fromQString( + StudioUtils::resourcePath() + QStringLiteral("/Font"))); m_Context->GetTextRenderer()->AddSystemFontDirectory( m_Context->GetStringTable().RegisterStr(thePath.c_str())); m_Context->GetTextRenderer()->AddProjectFontDirectory( -- cgit v1.2.3