Merge branch 'development' into cmake/linux_fix_warn_unused

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

# Conflicts:
#	Code/Editor/Objects/TrackGizmo.cpp
This commit is contained in:
Esteban Papp
2021-08-25 14:50:05 -07:00
113 changed files with 380 additions and 14845 deletions
+1
View File
@@ -14,6 +14,7 @@
#include <QPoint>
#include <QRect>
#include "Cry_Vector2.h"
#include <AzCore/Casting/numeric_cast.h>
//////////////////////////////////////////////////////////////////////////
class CWndGridHelper
-1
View File
@@ -78,7 +78,6 @@ AZ_POP_DISABLE_WARNING
// CryCommon
#include <CryCommon/ITimer.h>
#include <CryCommon/IPhysics.h>
#include <CryCommon/ILevelSystem.h>
// Editor
+10 -71
View File
@@ -54,6 +54,8 @@
// CryCommon
#include <CryCommon/HMDBus.h>
#include <CryCommon/IRenderAuxGeom.h>
#include <CryCommon/physinterface.h>
// AzFramework
#include <AzFramework/Render/IntersectorInterface.h>
@@ -739,9 +741,13 @@ void EditorViewportWidget::OnBeginPrepareRender()
RenderAll();
// Draw 2D helpers.
#ifdef LYSHINE_ATOM_TODO
TransformationMatrices backupSceneMatrices;
#endif
m_debugDisplay->DepthTestOff();
//m_renderer->Set2DMode(m_rcClient.right(), m_rcClient.bottom(), backupSceneMatrices);
#ifdef LYSHINE_ATOM_TODO
m_renderer->Set2DMode(m_rcClient.right(), m_rcClient.bottom(), backupSceneMatrices);
#endif
auto prevState = m_debugDisplay->GetState();
m_debugDisplay->SetState(e_Mode3D | e_AlphaBlended | e_FillModeSolid | e_CullModeBack | e_DepthWriteOn | e_DepthTestOn);
@@ -1283,7 +1289,7 @@ void EditorViewportWidget::SetViewportId(int id)
m_renderViewport->GetControllerList()->Add(AZStd::make_shared<SandboxEditor::ViewportManipulatorController>());
m_renderViewport->GetControllerList()->Add(CreateModularViewportCameraController(AzFramework::ViewportId(id)));
m_renderViewport->SetViewportSettings(&g_EditorViewportSettings);
UpdateScene();
@@ -1643,7 +1649,7 @@ void EditorViewportWidget::SetViewTM(const Matrix34& camMatrix, bool bMoveOnly)
{
// Should be impossible anyways
AZ_Assert(false, "Internal logic error - view entity Id and view source type out of sync. Please report this as a bug");
return ShouldUpdateObject::No;
return ShouldUpdateObject::No;
}
// Check that the current view is the same view as the view entity view
@@ -2008,73 +2014,6 @@ Vec3 EditorViewportWidget::ViewToWorldNormal(const QPoint& vp, bool onlyTerrain,
return Vec3(0, 0, 1);
}
//////////////////////////////////////////////////////////////////////////
bool EditorViewportWidget::AdjustObjectPosition(const ray_hit& hit, Vec3& outNormal, Vec3& outPos) const
{
Matrix34A objMat, objMatInv;
Matrix33 objRot, objRotInv;
if (hit.pCollider->GetiForeignData() != PHYS_FOREIGN_ID_STATIC)
{
return false;
}
IRenderNode* pNode = (IRenderNode*) hit.pCollider->GetForeignData(PHYS_FOREIGN_ID_STATIC);
if (!pNode || !pNode->GetEntityStatObj())
{
return false;
}
IStatObj* pEntObject = pNode->GetEntityStatObj(hit.partid, 0, &objMat, false);
if (!pEntObject || !pEntObject->GetRenderMesh())
{
return false;
}
objRot = Matrix33(objMat);
objRot.NoScale(); // No scale.
objRotInv = objRot;
objRotInv.Invert();
float fWorldScale = objMat.GetColumn(0).GetLength(); // GetScale
float fWorldScaleInv = 1.0f / fWorldScale;
// transform decal into object space
objMatInv = objMat;
objMatInv.Invert();
// put into normal object space hit direction of projection
Vec3 invhitn = -(hit.n);
Vec3 vOS_HitDir = objRotInv.TransformVector(invhitn).GetNormalized();
// put into position object space hit position
Vec3 vOS_HitPos = objMatInv.TransformPoint(hit.pt);
vOS_HitPos -= vOS_HitDir * RENDER_MESH_TEST_DISTANCE * fWorldScaleInv;
IRenderMesh* pRM = pEntObject->GetRenderMesh();
AABB aabbRNode;
pRM->GetBBox(aabbRNode.min, aabbRNode.max);
Vec3 vOut(0, 0, 0);
if (!Intersect::Ray_AABB(Ray(vOS_HitPos, vOS_HitDir), aabbRNode, vOut))
{
return false;
}
if (!pRM || !pRM->GetVerticesCount())
{
return false;
}
if (RayRenderMeshIntersection(pRM, vOS_HitPos, vOS_HitDir, outPos, outNormal))
{
outNormal = objRot.TransformVector(outNormal).GetNormalized();
outPos = objMat.TransformPoint(outPos);
return true;
}
return false;
}
//////////////////////////////////////////////////////////////////////////
bool EditorViewportWidget::RayRenderMeshIntersection(IRenderMesh* pRenderMesh, const Vec3& vInPos, const Vec3& vInDir, Vec3& vOutPos, Vec3& vOutNormal) const
{
@@ -2507,7 +2446,7 @@ void EditorViewportWidget::SetViewFromEntityPerspective(const AZ::EntityId& enti
void EditorViewportWidget::SetViewAndMovementLockFromEntityPerspective(const AZ::EntityId& entityId, [[maybe_unused]] bool lockCameraMovement)
{
// This is an editor event, so is only serviced during edit mode, not play game mode
//
//
if (m_playInEditorState != PlayInEditorState::Editor)
{
AZ_Warning("EditorViewportWidget", false,
-1
View File
@@ -220,7 +220,6 @@ private:
// Draw a selected region if it has been selected
void RenderSelectedRegion();
bool AdjustObjectPosition(const ray_hit& hit, Vec3& outNormal, Vec3& outPos) const;
bool RayRenderMeshIntersection(IRenderMesh* pRenderMesh, const Vec3& vInPos, const Vec3& vInDir, Vec3& vOutPos, Vec3& vOutNormal) const;
bool AddCameraMenuItems(QMenu* menu);
-3
View File
@@ -15,9 +15,6 @@
#pragma once
struct IStatObj;
struct IMaterial;
#include "Include/IIconManager.h" // for IIconManager
#include "IEditor.h" // for IDocListener
-4
View File
@@ -6,8 +6,6 @@
*
*/
#pragma once
#ifndef CRYINCLUDE_EDITOR_INCLUDE_IEDITORMATERIAL_H
#define CRYINCLUDE_EDITOR_INCLUDE_IEDITORMATERIAL_H
#include "BaseLibraryItem.h"
@@ -20,5 +18,3 @@ struct IEditorMaterial
virtual _smart_ptr<IMaterial> GetMatInfo(bool bUseExistingEngineMaterial = false) = 0;
virtual void DisableHighlightForFrame() = 0;
};
#endif
-1
View File
@@ -63,7 +63,6 @@ struct SANDBOX_API DisplayContext
CDisplaySettings* settings;
IDisplayViewport* view;
IRenderer* renderer;
IRenderAuxGeom* pRenderAuxGeom;
IIconManager* pIconManager;
CCamera* camera;
+23 -2
View File
@@ -26,7 +26,6 @@
DisplayContext::DisplayContext()
{
view = 0;
renderer = 0;
flags = 0;
settings = 0;
pIconManager = 0;
@@ -1083,7 +1082,10 @@ void DisplayContext::DrawTerrainLine(Vec3 worldPos1, Vec3 worldPos2)
//////////////////////////////////////////////////////////////////////////
void DisplayContext::DrawTextLabel(const Vec3& pos, float size, const char* text, const bool bCenter, [[maybe_unused]] int srcOffsetX, [[maybe_unused]] int scrOffsetY)
{
ColorF col(m_color4b.r * (1.0f / 255.0f), m_color4b.g * (1.0f / 255.0f), m_color4b.b * (1.0f / 255.0f), m_color4b.a * (1.0f / 255.0f));
AZ_ErrorOnce(nullptr, false, "DisplayContext::DrawTextLabel needs to be removed/ported to use Atom");
#if 0
ColorF col(m_color4b.r * (1.0f / 255.0f), m_color4b.g * (1.0f / 255.0f), m_color4b.b * (1.0f / 255.0f), m_color4b.a * (1.0f / 255.0f));
float fCol[4] = { col.r, col.g, col.b, col.a };
if (flags & DISPLAY_2D)
@@ -1096,13 +1098,28 @@ void DisplayContext::DrawTextLabel(const Vec3& pos, float size, const char* text
{
renderer->DrawLabelEx(pos, size, fCol, true, true, text);
}
#else
AZ_UNUSED(pos);
AZ_UNUSED(size);
AZ_UNUSED(text);
AZ_UNUSED(bCenter);
#endif
}
//////////////////////////////////////////////////////////////////////////
void DisplayContext::Draw2dTextLabel(float x, float y, float size, const char* text, bool bCenter)
{
AZ_ErrorOnce(nullptr, false, "DisplayContext::Draw2dTextLabel needs to be removed/ported to use Atom");
#if 0
float col[4] = { m_color4b.r * (1.0f / 255.0f), m_color4b.g * (1.0f / 255.0f), m_color4b.b * (1.0f / 255.0f), m_color4b.a * (1.0f / 255.0f) };
renderer->Draw2dLabel(x, y, size, col, bCenter, "%s", text);
#else
AZ_UNUSED(x);
AZ_UNUSED(y);
AZ_UNUSED(size);
AZ_UNUSED(text);
AZ_UNUSED(bCenter);
#endif
}
//////////////////////////////////////////////////////////////////////////
@@ -1269,6 +1286,9 @@ void DisplayContext::Flush2D()
int rcw, rch;
view->GetDimensions(&rcw, &rch);
AZ_ErrorOnce(nullptr, false, "DisplayContext::Flush2D needs to be removed/ported to use Atom");
#if 0
TransformationMatrices backupSceneMatrices;
renderer->Set2DMode(rcw, rch, backupSceneMatrices, 0.0f, 1.0f);
@@ -1310,6 +1330,7 @@ void DisplayContext::Flush2D()
}
renderer->Unset2DMode(backupSceneMatrices);
#endif
m_textureLabels.clear();
}
+5 -1
View File
@@ -175,12 +175,15 @@ void CTrackGizmo::DrawAxis(DisplayContext& dc, const Vec3& org)
y = y * fScreenScale;
z = z * fScreenScale;
Vec3 colX(1, 0, 0), colY(0, 1, 0), colZ(0, 0, 1);
AZ_ErrorOnce(nullptr, false, "CTrackGizmo::DrawAxis needs to be removed/ported to use Atom");
#if 0
float col[4] = { 1, 1, 1, 1 };
dc.renderer->DrawLabelEx(org + x, 1.2f, col, true, true, "X");
dc.renderer->DrawLabelEx(org + y, 1.2f, col, true, true, "Y");
dc.renderer->DrawLabelEx(org + z, 1.2f, col, true, true, "Z");
Vec3 colX(1, 0, 0), colY(0, 1, 0), colZ(0, 0, 1);
if (s_highlightAxis)
{
float col2[4] = { 1, 0, 0, 1 };
@@ -200,6 +203,7 @@ void CTrackGizmo::DrawAxis(DisplayContext& dc, const Vec3& org)
dc.renderer->DrawLabelEx(org + z, 1.2f, col2, true, true, "Z");
}
}
#endif
x = x * 0.8f;
y = y * 0.8f;
+1
View File
@@ -13,6 +13,7 @@
#include "Include/IEditorClassFactory.h"
#include "Util/GuidUtil.h"
#include <map>
//! Derive from this class to decrease the amount of work for creating a new class description
//! Provides standard reference counter implementation for IUnknown
@@ -40,6 +40,7 @@
#include <LmbrCentral/Rendering/MaterialOwnerBus.h>
#include <IDisplayViewport.h>
#include <CryCommon/Cry_GeoIntersect.h>
#include <MathConversion.h>
#include <TrackView/TrackViewAnimNode.h>
#include <ViewManager.h>
+1 -1
View File
@@ -987,7 +987,7 @@ QString CSettingsManager::GenerateContentHash(XmlNodeRef& node, QString sourceNa
return sourceName;
}
uint32 hash = CCrc32::ComputeLowercase(node->getXML(0));
uint32 hash = AZ::Crc32(node->getXML(0));
hashStr = QString::number(hash);
return hashStr;
@@ -13,6 +13,7 @@
// CryCommon
#include <CryCommon/Maestro/Types/AnimParamType.h>
#include <CryCommon/IFont.h>
// Editor
#include "Settings.h"
+1 -1
View File
@@ -24,7 +24,7 @@ QColor ColorLinearToGamma(ColorF col)
g = (float)(g <= 0.0031308 ? (12.92 * g) : (1.055 * pow((double)g, 1.0 / 2.4) - 0.055));
b = (float)(b <= 0.0031308 ? (12.92 * b) : (1.055 * pow((double)b, 1.0 / 2.4) - 0.055));
return QColor(FtoI(r * 255.0f), FtoI(g * 255.0f), FtoI(b * 255.0f), FtoI(a * 255.0f));
return QColor(int(r * 255.0f), int(g * 255.0f), int(b * 255.0f), int(a * 255.0f));
}
//////////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -205,7 +205,7 @@ QColor ColorLinearToGamma(ColorF col)
g = (float)(g <= 0.0031308 ? (12.92 * g) : (1.055 * pow((double)g, 1.0 / 2.4) - 0.055));
b = (float)(b <= 0.0031308 ? (12.92 * b) : (1.055 * pow((double)b, 1.0 / 2.4) - 0.055));
return QColor(FtoI(r * 255.0f), FtoI(g * 255.0f), FtoI(b * 255.0f), FtoI(a * 255.0f));
return QColor(int(r * 255.0f), int(g * 255.0f), int(b * 255.0f), int(a * 255.0f));
}
//////////////////////////////////////////////////////////////////////////
+1
View File
@@ -14,6 +14,7 @@
#pragma once
#include <Editor/Util/EditorUtils.h>
#include <CryCommon/Cry_GeoIntersect.h>
//! Half PI
#define PI_HALF (3.1415926535897932384626433832795f / 2.0f)
+1
View File
@@ -9,6 +9,7 @@
#include "StringHelpers.h"
#include "Util.h"
#include <cwctype>
int StringHelpers::CompareIgnoreCase(const AZStd::string& str0, const AZStd::string& str1)
{