Remove (almost) all references to pRenderer (#651)

Remove all references to pRenderer, except from the DebugDraw and LyShine Gems that are still being updated.
This commit is contained in:
bosnichd
2021-05-10 10:05:15 -06:00
committed by GitHub
parent 4a2e6a77b5
commit 440c40e490
191 changed files with 118 additions and 23548 deletions
@@ -59,7 +59,6 @@
#include <MathConversion.h>
#include "Objects/ComponentEntityObject.h"
#include "ComponentEntityDebugPrinter.h"
#include "ISourceControl.h"
#include "UI/QComponentEntityEditorMainWindow.h"
@@ -72,7 +71,6 @@
#include <Editor/CryEditDoc.h>
#include <Editor/GameEngine.h>
#include <Editor/DisplaySettings.h>
#include <Editor/Util/CubemapUtils.h>
#include <Editor/IconManager.h>
#include <Editor/Settings.h>
#include <Editor/StringDlg.h>
@@ -141,7 +139,6 @@ SandboxIntegrationManager::SandboxIntegrationManager()
, m_startedUndoRecordingNestingLevel(0)
, m_dc(nullptr)
, m_notificationWindowManager(new AzToolsFramework::SliceOverridesNotificationWindowManager())
, m_entityDebugPrinter(aznew ComponentEntityDebugPrinter())
{
// Required to receive events from the Cry Engine undo system
GetIEditor()->GetUndoManager()->AddListener(this);
@@ -1998,92 +1995,6 @@ void SandboxIntegrationManager::BrowseForAssets(AssetSelectionModel& selection)
AssetBrowserComponentRequestBus::Broadcast(&AssetBrowserComponentRequests::PickAssets, selection, GetMainWindow());
}
void SandboxIntegrationManager::GenerateCubemapForEntity(AZ::EntityId entityId, AZStd::string* cubemapOutputPath, bool hideEntity)
{
GenerateCubemapWithIDForEntity(entityId, AZ::Uuid::CreateNull(), cubemapOutputPath, hideEntity, false);
}
void SandboxIntegrationManager::GenerateCubemapWithIDForEntity(AZ::EntityId entityId, AZ::Uuid cubemapId,
AZStd::string* cubemapOutputPath, bool hideEntity, bool hasCubemapId)
{
AZ::u32 resolution = 0;
EBUS_EVENT_ID_RESULT(resolution, entityId, LmbrCentral::EditorLightComponentRequestBus, GetCubemapResolution);
if (resolution > 0)
{
CComponentEntityObject* componentEntity = CComponentEntityObject::FindObjectForEntity(entityId);
if (componentEntity)
{
QString levelfolder = GetIEditor()->GetGameEngine()->GetLevelPath();
QString levelname = Path::GetFile(levelfolder).toLower();
QString fullGameFolder = QString(Path::GetEditingGameDataFolder().c_str());
QString texturename;
if (hasCubemapId)
{
texturename = QStringLiteral("%1_cm.tif").arg(cubemapId.ToString<QString>(false, false));
}
else
{
texturename = QStringLiteral("%1_cm.tif").arg(static_cast<qulonglong>(componentEntity->GetAssociatedEntityId()));
}
texturename = texturename.toLower();
QString fullFolder = Path::SubDirectoryCaseInsensitive(fullGameFolder, {"textures", "cubemaps", levelname});
QString fullFilename = QDir(fullFolder).absoluteFilePath(texturename);
QString relFilename = QDir(fullGameFolder).relativeFilePath(fullFilename);
bool directlyExists = CFileUtil::CreateDirectory(fullFolder.toUtf8().data());
if (!directlyExists)
{
QMessageBox::warning(GetMainWindow(), QObject::tr("Cubemap Generation Failed"), QString(QObject::tr("Failed to create destination path '%1'")).arg(fullFolder));
return;
}
if (CubemapUtils::GenCubemapWithObjectPathAndSize(fullFilename, componentEntity, static_cast<int>(resolution), hideEntity))
{
AZStd::string assetPath = relFilename.toUtf8().data();
AzFramework::StringFunc::Path::ReplaceExtension(assetPath, ".dds");
EBUS_EVENT_ID(entityId, LmbrCentral::EditorLightComponentRequestBus, SetCubemap, assetPath);
if (cubemapOutputPath)
{
*cubemapOutputPath = AZStd::move(assetPath);
}
}
else
{
QMessageBox::warning(GetMainWindow(), QObject::tr("Cubemap Generation Failed"), QObject::tr("Unspecified error"));
}
}
}
}
void SandboxIntegrationManager::GenerateAllCubemaps()
{
AZStd::string cubemapOutputPath;
std::vector<CBaseObject*> results;
results.reserve(128);
GetIEditor()->GetObjectManager()->FindObjectsOfType(OBJTYPE_AZENTITY, results);
for (std::vector<CBaseObject*>::iterator end = results.end(), item = results.begin(); item != end; ++item)
{
CComponentEntityObject* componentEntity = static_cast<CComponentEntityObject*>(*item);
//check if it's customized cubemap, only generate it if it's not.
bool isCustomizedCubemap = true;
EBUS_EVENT_ID_RESULT(isCustomizedCubemap, componentEntity->GetAssociatedEntityId(), LmbrCentral::EditorLightComponentRequestBus, UseCustomizedCubemap);
if (isCustomizedCubemap)
{
continue;
}
GenerateCubemapForEntity(componentEntity->GetAssociatedEntityId(), nullptr, true);
}
}
void SandboxIntegrationManager::SetColor(float r, float g, float b, float a)
{
if (m_dc)
@@ -2575,19 +2486,6 @@ void SandboxIntegrationManager::Draw2dTextLabel(float x, float y, float size, co
}
}
void SandboxIntegrationManager::DrawTextOn2DBox(const AZ::Vector3& pos, const char* text, float textScale, const AZ::Vector4& textColor, const AZ::Vector4& textBackColor)
{
if (m_dc)
{
m_dc->DrawTextOn2DBox(
AZVec3ToLYVec3(pos),
text,
textScale,
ColorF(AZVec3ToLYVec3(textColor.GetAsVector3()), textColor.GetW()),
ColorF(AZVec3ToLYVec3(textBackColor.GetAsVector3()), textBackColor.GetW()));
}
}
void SandboxIntegrationManager::DrawTextureLabel(ITexture* texture, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags)
{
if (m_dc)
@@ -2614,8 +2512,12 @@ void SandboxIntegrationManager::DrawTextureLabel(ITexture* texture, const AZ::Ve
void SandboxIntegrationManager::DrawTextureLabel(int textureId, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags)
{
ITexture* texture = GetIEditor()->GetRenderer()->EF_GetTextureByID(textureId);
DrawTextureLabel(texture, pos, sizeX, sizeY, texIconFlags);
// ToDo: With Atom?
AZ_UNUSED(textureId);
AZ_UNUSED(pos);
AZ_UNUSED(sizeX);
AZ_UNUSED(sizeY);
AZ_UNUSED(texIconFlags);
}
void SandboxIntegrationManager::SetLineWidth(float width)