Merge branch 'develop' into LYN-4700
Signed-off-by: igarri <igarri@amazon.com>
This commit is contained in:
@@ -212,10 +212,10 @@
|
||||
"Configuration": {
|
||||
"ModelAsset": {
|
||||
"assetId": {
|
||||
"guid": "{935F694A-8639-515B-8133-81CDC7948E5B}",
|
||||
"subId": 277333723
|
||||
"guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}",
|
||||
"subId": 277889906
|
||||
},
|
||||
"assetHint": "objects/groudplane/groundplane_521x521m.azmodel"
|
||||
"assetHint": "objects/groudplane/groundplane_512x512m.azmodel"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2771,6 +2771,80 @@
|
||||
<source>VECTOR2_CREATEONE_OUTPUT0_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_NAME">
|
||||
<source>VECTOR2_DIRECTIONTO_NAME</source>
|
||||
<comment>Class/Bus: Vector2 Event/Method: DirectionTo</comment>
|
||||
<translation type="unfinished">Get Direction Vector</translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_TOOLTIP">
|
||||
<source>VECTOR2_DIRECTIONTO_TOOLTIP</source>
|
||||
<translation>Returns a direction vector between two points and the distance between them, by default the direction will be normalized, it may be optionally scaled using the Scale parameter if different from 1.0</translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_CATEGORY">
|
||||
<source>VECTOR2_DIRECTIONTO_CATEGORY</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_OUT_NAME">
|
||||
<source>VECTOR2_DIRECTIONTO_OUT_NAME</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_OUT_TOOLTIP">
|
||||
<source>VECTOR2_DIRECTIONTO_OUT_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTOL_IN_NAME">
|
||||
<source>VECTOR2_DIRECTIONTOL_IN_NAME</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_IN_TOOLTIP">
|
||||
<source>VECTOR2_DIRECTIONTO_IN_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_OUTPUT0_NAME">
|
||||
<source>VECTOR2_DIRECTIONTO_OUTPUT0_NAME</source>
|
||||
<comment>C++ Type: const Vector2</comment>
|
||||
<translation type="unfinished">Direction</translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_OUTPUT0_TOOLTIP">
|
||||
<source>VECTOR2_DIRECTIONTO_OUTPUT0_TOOLTIP</source>
|
||||
<translation>The direction between To and From normalized and optionally scaled</translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_OUTPUT1_NAME">
|
||||
<source>VECTOR2_DIRECTIONTO_OUTPUT1_NAME</source>
|
||||
<comment>C++ Type: float</comment>
|
||||
<translation type="unfinished">Distance</translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_OUTPUT1_TOOLTIP">
|
||||
<source>VECTOR2_DIRECTIONTO_OUTPUT1_TOOLTIP</source>
|
||||
<translation>The distance between To and From</translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_PARAM0_NAME">
|
||||
<source>VECTOR2_DIRECTIONTO_PARAM0_NAME</source>
|
||||
<comment>Simple Type: Vector2 C++ Type: Vector2*</comment>
|
||||
<translation type="unfinished">From</translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_PARAM0_TOOLTIP">
|
||||
<source>VECTOR2_DIRECTIONTO_PARAM0_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_PARAM1_NAME">
|
||||
<source>VECTOR2_DIRECTIONTO_PARAM1_NAME</source>
|
||||
<comment>Simple Type: Vector2 C++ Type: Vector2*</comment>
|
||||
<translation type="unfinished">To</translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_PARAM1_TOOLTIP">
|
||||
<source>VECTOR2_DIRECTIONTO_PARAM1_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_PARAM2_NAME">
|
||||
<source>VECTOR2_DIRECTIONTO_PARAM2_NAME</source>
|
||||
<comment>Simple Type: Vector2 C++ Type: Vector2*</comment>
|
||||
<translation type="unfinished">Scale</translation>
|
||||
</message>
|
||||
<message id="VECTOR2_DIRECTIONTO_PARAM2_TOOLTIP">
|
||||
<source>VECTOR2_DIRECTIONTO_PARAM2_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR2_GETPROJECTED_NAME">
|
||||
<source>VECTOR2_GETPROJECTED_NAME</source>
|
||||
<comment>Class/Bus: Vector2 Event/Method: GetProjected</comment>
|
||||
@@ -32262,6 +32336,80 @@ An Entity can be selected by using the pick button, or by dragging an Entity fro
|
||||
<source>VECTOR4_GETRECIPROCAL_PARAM0_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_NAME">
|
||||
<source>VECTOR4_DIRECTIONTO_NAME</source>
|
||||
<comment>Class/Bus: Vector4 Event/Method: DirectionTo</comment>
|
||||
<translation type="unfinished">Get Direction Vector</translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_TOOLTIP">
|
||||
<source>VECTOR4_DIRECTIONTO_TOOLTIP</source>
|
||||
<translation>Returns a direction vector between two points and the distance between them, by default the direction will be normalized, it may be optionally scaled using the Scale parameter if different from 1.0</translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_CATEGORY">
|
||||
<source>VECTOR4_DIRECTIONTO_CATEGORY</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_OUT_NAME">
|
||||
<source>VECTOR4_DIRECTIONTO_OUT_NAME</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_OUT_TOOLTIP">
|
||||
<source>VECTOR4_DIRECTIONTO_OUT_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTOL_IN_NAME">
|
||||
<source>VECTOR4_DIRECTIONTOL_IN_NAME</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_IN_TOOLTIP">
|
||||
<source>VECTOR4_DIRECTIONTO_IN_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_OUTPUT0_NAME">
|
||||
<source>VECTOR4_DIRECTIONTO_OUTPUT0_NAME</source>
|
||||
<comment>C++ Type: const Vector4</comment>
|
||||
<translation type="unfinished">Direction</translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_OUTPUT0_TOOLTIP">
|
||||
<source>VECTOR4_DIRECTIONTO_OUTPUT0_TOOLTIP</source>
|
||||
<translation>The direction between To and From normalized and optionally scaled</translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_OUTPUT1_NAME">
|
||||
<source>VECTOR4_DIRECTIONTO_OUTPUT1_NAME</source>
|
||||
<comment>C++ Type: float</comment>
|
||||
<translation type="unfinished">Distance</translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_OUTPUT1_TOOLTIP">
|
||||
<source>VECTOR4_DIRECTIONTO_OUTPUT1_TOOLTIP</source>
|
||||
<translation>The distance between To and From</translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_PARAM0_NAME">
|
||||
<source>VECTOR4_DIRECTIONTO_PARAM0_NAME</source>
|
||||
<comment>Simple Type: Vector4 C++ Type: Vector4*</comment>
|
||||
<translation type="unfinished">From</translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_PARAM0_TOOLTIP">
|
||||
<source>VECTOR4_DIRECTIONTO_PARAM0_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_PARAM1_NAME">
|
||||
<source>VECTOR4_DIRECTIONTO_PARAM1_NAME</source>
|
||||
<comment>Simple Type: Vector4 C++ Type: Vector4*</comment>
|
||||
<translation type="unfinished">To</translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_PARAM1_TOOLTIP">
|
||||
<source>VECTOR4_DIRECTIONTO_PARAM1_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_PARAM2_NAME">
|
||||
<source>VECTOR4_DIRECTIONTO_PARAM2_NAME</source>
|
||||
<comment>Simple Type: Vector4 C++ Type: Vector4*</comment>
|
||||
<translation type="unfinished">Scale</translation>
|
||||
</message>
|
||||
<message id="VECTOR4_DIRECTIONTO_PARAM2_TOOLTIP">
|
||||
<source>VECTOR4_DIRECTIONTO_PARAM2_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR4_AXISX_NAME">
|
||||
<source>VECTOR4_AXISX_NAME</source>
|
||||
<comment>Class/Bus: Vector4 Event/Method: CreateAxisX</comment>
|
||||
@@ -37469,6 +37617,80 @@ An Entity can be selected by using the pick button, or by dragging an Entity fro
|
||||
<source>VECTOR3_GETRECIPROCAL_PARAM0_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_NAME">
|
||||
<source>VECTOR3_DIRECTIONTO_NAME</source>
|
||||
<comment>Class/Bus: Vector3 Event/Method: DirectionTo</comment>
|
||||
<translation type="unfinished">Get Direction Vector</translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_TOOLTIP">
|
||||
<source>VECTOR3_DIRECTIONTO_TOOLTIP</source>
|
||||
<translation>Returns a direction vector between two points and the distance between them, by default the direction will be normalized, it may be optionally scaled using the Scale parameter if different from 1.0</translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_CATEGORY">
|
||||
<source>VECTOR3_DIRECTIONTO_CATEGORY</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_OUT_NAME">
|
||||
<source>VECTOR3_DIRECTIONTO_OUT_NAME</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_OUT_TOOLTIP">
|
||||
<source>VECTOR3_DIRECTIONTO_OUT_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTOL_IN_NAME">
|
||||
<source>VECTOR3_DIRECTIONTOL_IN_NAME</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_IN_TOOLTIP">
|
||||
<source>VECTOR3_DIRECTIONTO_IN_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_OUTPUT0_NAME">
|
||||
<source>VECTOR3_DIRECTIONTO_OUTPUT0_NAME</source>
|
||||
<comment>C++ Type: const Vector3</comment>
|
||||
<translation type="unfinished">Direction</translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_OUTPUT0_TOOLTIP">
|
||||
<source>VECTOR3_DIRECTIONTO_OUTPUT0_TOOLTIP</source>
|
||||
<translation>The direction between To and From normalized and optionally scaled</translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_OUTPUT1_NAME">
|
||||
<source>VECTOR3_DIRECTIONTO_OUTPUT1_NAME</source>
|
||||
<comment>C++ Type: float</comment>
|
||||
<translation type="unfinished">Distance</translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_OUTPUT1_TOOLTIP">
|
||||
<source>VECTOR3_DIRECTIONTO_OUTPUT1_TOOLTIP</source>
|
||||
<translation>The distance between To and From</translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_PARAM0_NAME">
|
||||
<source>VECTOR3_DIRECTIONTO_PARAM0_NAME</source>
|
||||
<comment>Simple Type: Vector3 C++ Type: Vector3*</comment>
|
||||
<translation type="unfinished">From</translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_PARAM0_TOOLTIP">
|
||||
<source>VECTOR3_DIRECTIONTO_PARAM0_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_PARAM1_NAME">
|
||||
<source>VECTOR3_DIRECTIONTO_PARAM1_NAME</source>
|
||||
<comment>Simple Type: Vector3 C++ Type: Vector3*</comment>
|
||||
<translation type="unfinished">To</translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_PARAM1_TOOLTIP">
|
||||
<source>VECTOR3_DIRECTIONTO_PARAM1_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_PARAM2_NAME">
|
||||
<source>VECTOR3_DIRECTIONTO_PARAM2_NAME</source>
|
||||
<comment>Simple Type: Vector3 C++ Type: Vector3*</comment>
|
||||
<translation type="unfinished">Scale</translation>
|
||||
</message>
|
||||
<message id="VECTOR3_DIRECTIONTO_PARAM2_TOOLTIP">
|
||||
<source>VECTOR3_DIRECTIONTO_PARAM2_TOOLTIP</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message id="VECTOR3_PROJECT_NAME">
|
||||
<source>VECTOR3_PROJECT_NAME</source>
|
||||
<comment>Class/Bus: Vector3 Event/Method: Project</comment>
|
||||
|
||||
+3
-2
@@ -64,7 +64,8 @@ def C15096740_Material_LibraryUpdatedCorrectly():
|
||||
|
||||
# Constants
|
||||
library_property_path = "Configuration|Physics Material|Library"
|
||||
default_material_path = "surfacetypemateriallibrary.physmaterial"
|
||||
|
||||
default_material_path = os.path.join("assets", "physics", "surfacetypemateriallibrary.physmaterial")
|
||||
new_material_path = os.path.join("physicssurfaces", "default_phys_materials.physmaterial")
|
||||
|
||||
helper.init_idle()
|
||||
@@ -82,7 +83,7 @@ def C15096740_Material_LibraryUpdatedCorrectly():
|
||||
default_asset = Asset.find_asset_by_path(default_material_path)
|
||||
test_component.set_component_property_value(library_property_path, default_asset.id)
|
||||
default_asset.id = test_component.get_component_property_value(library_property_path)
|
||||
Report.result(Tests.override_default_library, default_asset.get_path() == default_material_path)
|
||||
Report.result(Tests.override_default_library, default_asset.get_path() == default_material_path.replace(os.sep, '/'))
|
||||
|
||||
# 4) Switch it back again to the default material library.
|
||||
test_component.set_component_property_value(library_property_path, azasset.AssetId())
|
||||
|
||||
@@ -133,7 +133,7 @@ class Physmaterial_Editor:
|
||||
def _set_path(self):
|
||||
# type: (str) -> str
|
||||
if self.document_filename == None:
|
||||
self.document_filename = os.path.join(self.project_folder, "surfacetypemateriallibrary.physmaterial")
|
||||
self.document_filename = os.path.join(self.project_folder, "assets", "physics", "surfacetypemateriallibrary.physmaterial")
|
||||
else:
|
||||
for (root, directories, root_files) in os.walk(self.project_folder):
|
||||
for root_file in root_files:
|
||||
|
||||
@@ -121,9 +121,10 @@
|
||||
},
|
||||
"MaterialLibrary": {
|
||||
"assetId": {
|
||||
"guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}"
|
||||
"guid": "{62446378-67F8-5E49-AC31-761DD5942695}"
|
||||
},
|
||||
"assetHint": "surfacetypemateriallibrary.physmaterial"
|
||||
"loadBehavior": "QueueLoad",
|
||||
"assetHint": "assets/physics/surfacetypemateriallibrary.physmaterial"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,9 +109,10 @@
|
||||
},
|
||||
"MaterialLibrary": {
|
||||
"assetId": {
|
||||
"guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}"
|
||||
"guid": "{62446378-67F8-5E49-AC31-761DD5942695}"
|
||||
},
|
||||
"assetHint": "surfacetypemateriallibrary.physmaterial"
|
||||
"loadBehavior": "QueueLoad",
|
||||
"assetHint": "assets/physics/surfacetypemateriallibrary.physmaterial"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -121,9 +121,10 @@
|
||||
},
|
||||
"MaterialLibrary": {
|
||||
"assetId": {
|
||||
"guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}"
|
||||
"guid": "{62446378-67F8-5E49-AC31-761DD5942695}"
|
||||
},
|
||||
"assetHint": "surfacetypemateriallibrary.physmaterial"
|
||||
"loadBehavior": "QueueLoad",
|
||||
"assetHint": "assets/physics/surfacetypemateriallibrary.physmaterial"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,9 +121,10 @@
|
||||
},
|
||||
"MaterialLibrary": {
|
||||
"assetId": {
|
||||
"guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}"
|
||||
"guid": "{62446378-67F8-5E49-AC31-761DD5942695}"
|
||||
},
|
||||
"assetHint": "surfacetypemateriallibrary.physmaterial"
|
||||
"loadBehavior": "QueueLoad",
|
||||
"assetHint": "assets/physics/surfacetypemateriallibrary.physmaterial"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,9 +121,10 @@
|
||||
},
|
||||
"MaterialLibrary": {
|
||||
"assetId": {
|
||||
"guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}"
|
||||
"guid": "{62446378-67F8-5E49-AC31-761DD5942695}"
|
||||
},
|
||||
"assetHint": "surfacetypemateriallibrary.physmaterial"
|
||||
"loadBehavior": "QueueLoad",
|
||||
"assetHint": "assets/physics/surfacetypemateriallibrary.physmaterial"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,9 +103,10 @@
|
||||
},
|
||||
"MaterialLibrary": {
|
||||
"assetId": {
|
||||
"guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}"
|
||||
"guid": "{62446378-67F8-5E49-AC31-761DD5942695}"
|
||||
},
|
||||
"assetHint": "surfacetypemateriallibrary.physmaterial"
|
||||
"loadBehavior": "QueueLoad",
|
||||
"assetHint": "assets/physics/surfacetypemateriallibrary.physmaterial"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ int32 CHierarchy::FindNodeIndexByName(const char* name) const
|
||||
const CHierarchy::SNode* CHierarchy::FindNode(const char* name) const
|
||||
{
|
||||
int32 index = FindNodeIndexByName(name);
|
||||
return index < 0 ? NULL : &m_nodes[index];
|
||||
return index < 0 ? nullptr : &m_nodes[index];
|
||||
}
|
||||
|
||||
void CHierarchy::CreateFrom(IDefaultSkeleton* pIDefaultSkeleton)
|
||||
|
||||
@@ -56,8 +56,8 @@ void CMapper::ClearLocations()
|
||||
uint32 count = uint32(m_nodes.size());
|
||||
for (uint32 i = 0; i < count; ++i)
|
||||
{
|
||||
m_nodes[i].position = NULL;
|
||||
m_nodes[i].orientation = NULL;
|
||||
m_nodes[i].position = nullptr;
|
||||
m_nodes[i].orientation = nullptr;
|
||||
}
|
||||
|
||||
m_locations.clear();
|
||||
@@ -141,7 +141,7 @@ void CMapper::Map(QuatT* pResult)
|
||||
}
|
||||
|
||||
CHierarchy::SNode* pParent = pNode->parent < 0 ?
|
||||
NULL : m_hierarchy.GetNode(pNode->parent);
|
||||
nullptr : m_hierarchy.GetNode(pNode->parent);
|
||||
if (pParent)
|
||||
{
|
||||
pResult[i].t =
|
||||
@@ -173,7 +173,7 @@ void CMapper::Map(QuatT* pResult)
|
||||
}
|
||||
|
||||
CHierarchy::SNode* pParent = pNode->parent < 0 ?
|
||||
NULL : m_hierarchy.GetNode(pNode->parent);
|
||||
nullptr : m_hierarchy.GetNode(pNode->parent);
|
||||
if (!pParent)
|
||||
{
|
||||
pResult[i].q = absolutes[i];
|
||||
|
||||
@@ -37,8 +37,8 @@ CMapperOperatorDesc::CMapperOperatorDesc(const char* name)
|
||||
CMapperOperator::CMapperOperator(const char* className, uint32 positionCount, uint32 orientationCount)
|
||||
{
|
||||
m_className = className;
|
||||
m_position.resize(positionCount, NULL);
|
||||
m_orientation.resize(orientationCount, NULL);
|
||||
m_position.resize(positionCount, nullptr);
|
||||
m_orientation.resize(orientationCount, nullptr);
|
||||
}
|
||||
|
||||
CMapperOperator::~CMapperOperator()
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- Editor/AnimationContext.cpp
|
||||
+++ Editor/AnimationContext.cpp
|
||||
@@ -612,7 +612,7 @@ void CAnimationContext::UpdateAnimatedLights()
|
||||
return;
|
||||
|
||||
std::vector<CBaseObject*> entityObjects;
|
||||
- GetIEditor()->GetObjectManager()->FindObjectsOfType<CEntityObject*>(entityObjects);
|
||||
+ GetIEditor()->GetObjectManager()->FindObjectsOfType(&CEntityObject::staticMetaObject, entityObjects);
|
||||
std::for_each(std::begin(entityObjects), std::end(entityObjects),
|
||||
[this](CBaseObject *pBaseObject)
|
||||
{
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
AzToolsFramework::EditorEvents::Bus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
~ListenerForShowAssetEditorEvent()
|
||||
~ListenerForShowAssetEditorEvent() override
|
||||
{
|
||||
AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// AzToolsFramework
|
||||
#include <AzToolsFramework/PythonTerminal/ScriptTermDialog.h>
|
||||
|
||||
CAutoRegisterCommandHelper* CAutoRegisterCommandHelper::s_pFirst = 0;
|
||||
CAutoRegisterCommandHelper* CAutoRegisterCommandHelper::s_pLast = 0;
|
||||
CAutoRegisterCommandHelper* CAutoRegisterCommandHelper::s_pFirst = nullptr;
|
||||
CAutoRegisterCommandHelper* CAutoRegisterCommandHelper::s_pLast = nullptr;
|
||||
|
||||
CAutoRegisterCommandHelper* CAutoRegisterCommandHelper::GetFirst()
|
||||
{
|
||||
@@ -31,7 +31,7 @@ CAutoRegisterCommandHelper* CAutoRegisterCommandHelper::GetFirst()
|
||||
CAutoRegisterCommandHelper::CAutoRegisterCommandHelper(void(*registerFunc)(CEditorCommandManager &))
|
||||
{
|
||||
m_registerFunc = registerFunc;
|
||||
m_pNext = 0;
|
||||
m_pNext = nullptr;
|
||||
|
||||
if (!s_pLast)
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
|
||||
void RegisterAutoCommands();
|
||||
|
||||
bool AddCommand(CCommand* pCommand, TPfnDeleter deleter = NULL);
|
||||
bool AddCommand(CCommand* pCommand, TPfnDeleter deleter = nullptr);
|
||||
bool UnregisterCommand(const char* module, const char* name);
|
||||
bool RegisterUICommand(
|
||||
const char* module,
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
CBitmapToolTip(QWidget* parent = nullptr);
|
||||
virtual ~CBitmapToolTip();
|
||||
|
||||
BOOL Create(const RECT& rect);
|
||||
bool Create(const RECT& rect);
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
@@ -29,7 +29,7 @@ CColorGradientCtrl::CColorGradientCtrl(QWidget* parent)
|
||||
m_nHitKeyIndex = -1;
|
||||
m_nKeyDrawRadius = 3;
|
||||
m_bTracking = false;
|
||||
m_pSpline = 0;
|
||||
m_pSpline = nullptr;
|
||||
m_fMinTime = -1;
|
||||
m_fMaxTime = 1;
|
||||
m_fMinValue = -1;
|
||||
@@ -474,7 +474,7 @@ void CColorGradientCtrl::SetActiveKey(int nIndex)
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CColorGradientCtrl::SetSpline(ISplineInterpolator* pSpline, BOOL bRedraw)
|
||||
void CColorGradientCtrl::SetSpline(ISplineInterpolator* pSpline, bool bRedraw)
|
||||
{
|
||||
if (pSpline != m_pSpline)
|
||||
{
|
||||
@@ -501,7 +501,7 @@ ISplineInterpolator* CColorGradientCtrl::GetSpline()
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CColorGradientCtrl::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
BOOL bProcessed = false;
|
||||
bool bProcessed = false;
|
||||
|
||||
if (m_nActiveKey != -1 && m_pSpline)
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
// Lock value of first and last key to be the same.
|
||||
void LockFirstAndLastKeys(bool bLock) { m_bLockFirstLastKey = bLock; }
|
||||
|
||||
void SetSpline(ISplineInterpolator* pSpline, BOOL bRedraw = FALSE);
|
||||
void SetSpline(ISplineInterpolator* pSpline, bool bRedraw = false);
|
||||
ISplineInterpolator* GetSpline();
|
||||
|
||||
void SetTimeMarker(float fTime);
|
||||
|
||||
@@ -62,14 +62,14 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
void highlightBlock(const QString &text)
|
||||
void highlightBlock(const QString &text) override
|
||||
{
|
||||
auto pos = -1;
|
||||
QTextCharFormat myClassFormat;
|
||||
myClassFormat.setFontWeight(QFont::Bold);
|
||||
myClassFormat.setBackground(Qt::yellow);
|
||||
|
||||
while (1)
|
||||
while (true)
|
||||
{
|
||||
pos = text.indexOf(m_searchTerm, pos+1, Qt::CaseInsensitive);
|
||||
|
||||
@@ -338,6 +338,8 @@ CConsoleSCB::CConsoleSCB(QWidget* parent)
|
||||
connect(findPreviousAction, &QAction::triggered, this, &CConsoleSCB::findPrevious);
|
||||
ui->findPrevButton->addAction(findPreviousAction);
|
||||
|
||||
GetIEditor()->RegisterNotifyListener(this);
|
||||
|
||||
connect(ui->button, &QPushButton::clicked, this, &CConsoleSCB::showVariableEditor);
|
||||
connect(ui->findButton, &QPushButton::clicked, this, &CConsoleSCB::toggleConsoleSearch);
|
||||
connect(ui->textEdit, &ConsoleTextEdit::searchBarRequested, this, [this]
|
||||
@@ -376,6 +378,8 @@ CConsoleSCB::~CConsoleSCB()
|
||||
{
|
||||
AzToolsFramework::EditorPreferencesNotificationBus::Handler::BusDisconnect();
|
||||
|
||||
GetIEditor()->UnregisterNotifyListener(this);
|
||||
|
||||
s_consoleSCB = nullptr;
|
||||
CLogFile::AttachEditBox(nullptr);
|
||||
}
|
||||
@@ -567,7 +571,7 @@ static CVarBlock* VarBlockFromConsoleVars()
|
||||
size_t cmdCount = console->GetSortedVars(&cmds[0], cmds.size());
|
||||
|
||||
CVarBlock* vb = new CVarBlock;
|
||||
IVariable* pVariable = 0;
|
||||
IVariable* pVariable = nullptr;
|
||||
for (int i = 0; i < cmdCount; i++)
|
||||
{
|
||||
ICVar* pCVar = console->GetCVar(cmds[i]);
|
||||
@@ -1352,4 +1356,19 @@ CConsoleSCB* CConsoleSCB::GetCreatedInstance()
|
||||
return s_consoleSCB;
|
||||
}
|
||||
|
||||
void CConsoleSCB::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case eNotify_OnBeginGameMode:
|
||||
if (gSettings.clearConsoleOnGameModeStart)
|
||||
{
|
||||
ui->textEdit->clear();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#include <Controls/moc_ConsoleSCB.cpp>
|
||||
|
||||
@@ -159,6 +159,7 @@ private:
|
||||
class CConsoleSCB
|
||||
: public QWidget
|
||||
, private AzToolsFramework::EditorPreferencesNotificationBus::Handler
|
||||
, public IEditorNotifyListener
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -187,6 +188,8 @@ private Q_SLOTS:
|
||||
void findNext();
|
||||
|
||||
private:
|
||||
void OnEditorNotifyEvent(EEditorNotifyEvent event) override;
|
||||
|
||||
QScopedPointer<Ui::Console> ui;
|
||||
int m_richEditTextLength;
|
||||
|
||||
|
||||
@@ -19,22 +19,22 @@ CHotTrackingTreeCtrl::CHotTrackingTreeCtrl(QWidget* parent)
|
||||
: QTreeWidget(parent)
|
||||
{
|
||||
setMouseTracking(true);
|
||||
m_hHoverItem = NULL;
|
||||
m_hHoverItem = nullptr;
|
||||
}
|
||||
|
||||
void CHotTrackingTreeCtrl::mouseMoveEvent(QMouseEvent* event)
|
||||
{
|
||||
QTreeWidgetItem* hItem = itemAt(event->pos());
|
||||
|
||||
if (m_hHoverItem != NULL)
|
||||
if (m_hHoverItem != nullptr)
|
||||
{
|
||||
QFont font = m_hHoverItem->font(0);
|
||||
font.setBold(false);
|
||||
m_hHoverItem->setFont(0, font);
|
||||
m_hHoverItem = NULL;
|
||||
m_hHoverItem = nullptr;
|
||||
}
|
||||
|
||||
if (hItem != NULL)
|
||||
if (hItem != nullptr)
|
||||
{
|
||||
QFont font = hItem->font(0);
|
||||
font.setBold(true);
|
||||
|
||||
@@ -27,7 +27,7 @@ void ReflectedPropertiesPanel::DeleteVars()
|
||||
{
|
||||
ClearVarBlock();
|
||||
m_updateCallbacks.clear();
|
||||
m_varBlock = 0;
|
||||
m_varBlock = nullptr;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -198,7 +198,7 @@ void ReflectedPropertyControl::CreateItems(XmlNodeRef node)
|
||||
|
||||
void ReflectedPropertyControl::CreateItems(XmlNodeRef node, CVarBlockPtr& outBlockPtr, IVariable::OnSetCallback* func, bool splitCamelCaseIntoWords)
|
||||
{
|
||||
SelectItem(0);
|
||||
SelectItem(nullptr);
|
||||
|
||||
outBlockPtr = new CVarBlock;
|
||||
for (size_t i = 0, iGroupCount(node->getChildCount()); i < iGroupCount; ++i)
|
||||
@@ -505,7 +505,7 @@ void ReflectedPropertyControl::RemoveAllItems()
|
||||
void ReflectedPropertyControl::ClearVarBlock()
|
||||
{
|
||||
RemoveAllItems();
|
||||
m_pVarBlock = 0;
|
||||
m_pVarBlock = nullptr;
|
||||
}
|
||||
|
||||
void ReflectedPropertyControl::RecreateAllItems()
|
||||
@@ -688,11 +688,11 @@ void ReflectedPropertyControl::OnItemChange(ReflectedPropertyItem *item, bool de
|
||||
// callback until after the current event queue is processed, so that we aren't changing other widgets
|
||||
// as a ton of them are still being created.
|
||||
Qt::ConnectionType connectionType = deferCallbacks ? Qt::QueuedConnection : Qt::DirectConnection;
|
||||
if (m_updateVarFunc != 0 && m_bEnableCallback)
|
||||
if (m_updateVarFunc && m_bEnableCallback)
|
||||
{
|
||||
QMetaObject::invokeMethod(this, "DoUpdateCallback", connectionType, Q_ARG(IVariable*, item->GetVariable()));
|
||||
}
|
||||
if (m_updateObjectFunc != 0 && m_bEnableCallback)
|
||||
if (m_updateObjectFunc && m_bEnableCallback)
|
||||
{
|
||||
// KDAB: This callback has same signature as DoUpdateCallback. I think the only reason there are 2 is because some
|
||||
// EntityObject registers callback and some derived objects want to register their own callback. the normal UpdateCallback
|
||||
@@ -709,7 +709,7 @@ void ReflectedPropertyControl::DoUpdateCallback(IVariable *var)
|
||||
const bool variableStillExists = FindVariable(var);
|
||||
AZ_Assert(variableStillExists, "This variable and the item containing it were destroyed during a deferred callback. Change to non-deferred callback.");
|
||||
|
||||
if (m_updateVarFunc == 0 || !variableStillExists)
|
||||
if (!m_updateVarFunc || !variableStillExists)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -724,7 +724,7 @@ void ReflectedPropertyControl::DoUpdateObjectCallback(IVariable *var)
|
||||
const bool variableStillExists = FindVariable(var);
|
||||
AZ_Assert(variableStillExists, "This variable and the item containing it were destroyed during a deferred callback. Change to non-deferred callback.");
|
||||
|
||||
if (m_updateVarFunc == 0 || !variableStillExists)
|
||||
if ( !m_updateVarFunc || !variableStillExists)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -904,7 +904,7 @@ void ReflectedPropertyControl::SetUndoCallback(UndoCallback &callback)
|
||||
|
||||
void ReflectedPropertyControl::ClearUndoCallback()
|
||||
{
|
||||
m_undoFunc = 0;
|
||||
m_undoFunc = nullptr;
|
||||
}
|
||||
|
||||
bool ReflectedPropertyControl::FindVariable(IVariable *categoryItem) const
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
}
|
||||
|
||||
//helps implement ReflectedPropertyControl::ReplaceVarBlock
|
||||
void ReplaceVarBlock(CVarBlock *varBlock)
|
||||
void ReplaceVarBlock(CVarBlock *varBlock) override
|
||||
{
|
||||
m_containerVar->Clear();
|
||||
UpdateCommon(m_item->GetVariable(), varBlock);
|
||||
@@ -207,7 +207,7 @@ void ReflectedPropertyItem::SetVariable(IVariable *var)
|
||||
ReleaseVariable();
|
||||
|
||||
m_pVariable = pInputVar;
|
||||
assert(m_pVariable != NULL);
|
||||
assert(m_pVariable != nullptr);
|
||||
|
||||
m_pVariable->AddOnSetCallback(&m_onSetCallback);
|
||||
m_pVariable->AddOnSetEnumCallback(&m_onSetEnumCallback);
|
||||
@@ -332,7 +332,7 @@ void ReflectedPropertyItem::RemoveAllChildren()
|
||||
{
|
||||
for (int i = 0; i < m_childs.size(); i++)
|
||||
{
|
||||
m_childs[i]->m_parent = 0;
|
||||
m_childs[i]->m_parent = nullptr;
|
||||
}
|
||||
|
||||
m_childs.clear();
|
||||
@@ -473,7 +473,7 @@ void ReflectedPropertyItem::ReleaseVariable()
|
||||
m_pVariable->RemoveOnSetCallback(&m_onSetCallback);
|
||||
m_pVariable->RemoveOnSetEnumCallback(&m_onSetEnumCallback);
|
||||
}
|
||||
m_pVariable = 0;
|
||||
m_pVariable = nullptr;
|
||||
delete m_reflectedVarAdapter;
|
||||
m_reflectedVarAdapter = nullptr;
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ protected:
|
||||
|
||||
public:
|
||||
//! Get number of child nodes.
|
||||
int GetChildCount() const { return m_childs.size(); };
|
||||
int GetChildCount() const { return static_cast<int>(m_childs.size()); };
|
||||
//! Get Child by id.
|
||||
ReflectedPropertyItem* GetChild(int index) const { return m_childs[index]; }
|
||||
PropertyType GetType() const { return m_type; }
|
||||
|
||||
@@ -473,7 +473,7 @@ void ReflectedVarUserAdapter::SyncReflectedVarToIVar(IVariable *pVariable)
|
||||
|
||||
//extract the list of custom items from the IVariable user data
|
||||
IVariable::IGetCustomItems* pGetCustomItems = static_cast<IVariable::IGetCustomItems*> (pVariable->GetUserData().value<void *>());
|
||||
if (pGetCustomItems != 0)
|
||||
if (pGetCustomItems != nullptr)
|
||||
{
|
||||
std::vector<IVariable::IGetCustomItems::SItem> items;
|
||||
QString dlgTitle;
|
||||
|
||||
@@ -30,7 +30,7 @@ CSplineCtrl::CSplineCtrl(QWidget* parent)
|
||||
m_nHitKeyIndex = -1;
|
||||
m_nKeyDrawRadius = 3;
|
||||
m_bTracking = false;
|
||||
m_pSpline = 0;
|
||||
m_pSpline = nullptr;
|
||||
m_gridX = 10;
|
||||
m_gridY = 10;
|
||||
m_fMinTime = -1;
|
||||
@@ -40,7 +40,7 @@ CSplineCtrl::CSplineCtrl(QWidget* parent)
|
||||
m_fTooltipScaleX = 1;
|
||||
m_fTooltipScaleY = 1;
|
||||
m_bLockFirstLastKey = false;
|
||||
m_pTimelineCtrl = 0;
|
||||
m_pTimelineCtrl = nullptr;
|
||||
|
||||
m_bSelectedKeys.reserve(0);
|
||||
|
||||
@@ -417,7 +417,7 @@ void CSplineCtrl::SetActiveKey(int nIndex)
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CSplineCtrl::SetSpline(ISplineInterpolator* pSpline, BOOL bRedraw)
|
||||
void CSplineCtrl::SetSpline(ISplineInterpolator* pSpline, bool bRedraw)
|
||||
{
|
||||
if (pSpline != m_pSpline)
|
||||
{
|
||||
@@ -596,7 +596,7 @@ CSplineCtrl::EHitCode CSplineCtrl::HitTest(const QPoint& point)
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void CSplineCtrl::StartTracking()
|
||||
{
|
||||
m_bTracking = TRUE;
|
||||
m_bTracking = true;
|
||||
|
||||
GetIEditor()->BeginUndo();
|
||||
|
||||
@@ -674,7 +674,7 @@ void CSplineCtrl::StopTracking()
|
||||
|
||||
GetIEditor()->AcceptUndo("Spline Move");
|
||||
|
||||
m_bTracking = FALSE;
|
||||
m_bTracking = false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
// Lock value of first and last key to be the same.
|
||||
void LockFirstAndLastKeys(bool bLock) { m_bLockFirstLastKey = bLock; }
|
||||
|
||||
void SetSpline(ISplineInterpolator* pSpline, BOOL bRedraw = FALSE);
|
||||
void SetSpline(ISplineInterpolator* pSpline, bool bRedraw = false);
|
||||
ISplineInterpolator* GetSpline();
|
||||
|
||||
void SetTimeMarker(float fTime);
|
||||
|
||||
@@ -69,8 +69,8 @@ protected:
|
||||
AbstractSplineWidget* pCtrl = FindControl(m_pCtrl);
|
||||
m_splineEntries.resize(m_splineEntries.size() + 1);
|
||||
SplineEntry& entry = m_splineEntries.back();
|
||||
ISplineSet* pSplineSet = (pCtrl ? pCtrl->m_pSplineSet : 0);
|
||||
entry.id = (pSplineSet ? pSplineSet->GetIDFromSpline(pSpline) : 0);
|
||||
ISplineSet* pSplineSet = (pCtrl ? pCtrl->m_pSplineSet : nullptr);
|
||||
entry.id = (pSplineSet ? pSplineSet->GetIDFromSpline(pSpline) : nullptr);
|
||||
entry.pSpline = pSpline;
|
||||
|
||||
const int numKeys = pSpline->GetKeyCount();
|
||||
@@ -81,10 +81,10 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
virtual int GetSize() { return sizeof(*this); }
|
||||
virtual QString GetDescription() { return "UndoSplineCtrlEx"; };
|
||||
int GetSize() override { return sizeof(*this); }
|
||||
QString GetDescription() override { return "UndoSplineCtrlEx"; };
|
||||
|
||||
virtual void Undo(bool bUndo)
|
||||
void Undo(bool bUndo) override
|
||||
{
|
||||
AbstractSplineWidget* pCtrl = FindControl(m_pCtrl);
|
||||
if (pCtrl)
|
||||
@@ -104,7 +104,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void Redo()
|
||||
void Redo() override
|
||||
{
|
||||
AbstractSplineWidget* pCtrl = FindControl(m_pCtrl);
|
||||
if (pCtrl)
|
||||
@@ -134,7 +134,7 @@ private:
|
||||
void SerializeSplines(_smart_ptr<ISplineBackup> SplineEntry::* backup, bool bLoading)
|
||||
{
|
||||
AbstractSplineWidget* pCtrl = FindControl(m_pCtrl);
|
||||
ISplineSet* pSplineSet = (pCtrl ? pCtrl->m_pSplineSet : 0);
|
||||
ISplineSet* pSplineSet = (pCtrl ? pCtrl->m_pSplineSet : nullptr);
|
||||
for (auto it = m_splineEntries.begin(); it != m_splineEntries.end(); ++it)
|
||||
{
|
||||
SplineEntry& entry = *it;
|
||||
@@ -157,19 +157,19 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
typedef std::list<AbstractSplineWidget*> CSplineCtrls;
|
||||
using CSplineCtrls = std::list<AbstractSplineWidget *>;
|
||||
|
||||
static AbstractSplineWidget* FindControl(AbstractSplineWidget* pCtrl)
|
||||
{
|
||||
if (!pCtrl)
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto iter = std::find(s_activeCtrls.begin(), s_activeCtrls.end(), pCtrl);
|
||||
if (iter == s_activeCtrls.end())
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return *iter;
|
||||
@@ -193,10 +193,10 @@ public:
|
||||
|
||||
static CSplineCtrls s_activeCtrls;
|
||||
|
||||
virtual bool IsSelectionChanged() const
|
||||
bool IsSelectionChanged() const override
|
||||
{
|
||||
AbstractSplineWidget* pCtrl = FindControl(m_pCtrl);
|
||||
ISplineSet* pSplineSet = (pCtrl ? pCtrl->m_pSplineSet : 0);
|
||||
ISplineSet* pSplineSet = (pCtrl ? pCtrl->m_pSplineSet : nullptr);
|
||||
|
||||
for (auto it = m_splineEntries.begin(); it != m_splineEntries.end(); ++it)
|
||||
{
|
||||
@@ -256,11 +256,11 @@ SplineWidget::~SplineWidget()
|
||||
AbstractSplineWidget::AbstractSplineWidget()
|
||||
: m_defaultKeyTangentType(SPLINE_KEY_TANGENT_NONE)
|
||||
{
|
||||
m_pTimelineCtrl = 0;
|
||||
m_pTimelineCtrl = nullptr;
|
||||
|
||||
m_totalSplineCount = 0;
|
||||
m_pHitSpline = 0;
|
||||
m_pHitDetailSpline = 0;
|
||||
m_pHitSpline = nullptr;
|
||||
m_pHitDetailSpline = nullptr;
|
||||
m_nHitKeyIndex = -1;
|
||||
m_nHitDimension = -1;
|
||||
m_bHitIncomingHandle = true;
|
||||
@@ -301,7 +301,7 @@ AbstractSplineWidget::AbstractSplineWidget()
|
||||
|
||||
m_boLeftMouseButtonDown = false;
|
||||
|
||||
m_pSplineSet = 0;
|
||||
m_pSplineSet = nullptr;
|
||||
|
||||
m_controlAmplitude = false;
|
||||
|
||||
@@ -1633,7 +1633,7 @@ void SplineWidget::wheelEvent(QWheelEvent* event)
|
||||
|
||||
void SplineWidget::keyPressEvent(QKeyEvent* e)
|
||||
{
|
||||
BOOL bProcessed = false;
|
||||
bool bProcessed = false;
|
||||
|
||||
switch (e->key())
|
||||
{
|
||||
@@ -1780,7 +1780,7 @@ void AbstractSplineWidget::SetHorizontalExtent([[maybe_unused]] int min, [[maybe
|
||||
//si.nPage = max(0,m_rcClient.Width() - m_leftOffset*2);
|
||||
//si.nPage = 1;
|
||||
//si.nPage = 1;
|
||||
SetScrollInfo( SB_HORZ,&si,TRUE );
|
||||
SetScrollInfo( SB_HORZ,&si,true );
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -1792,7 +1792,7 @@ ISplineInterpolator* AbstractSplineWidget::HitSpline(const QPoint& point)
|
||||
return m_pHitSpline;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1806,8 +1806,8 @@ AbstractSplineWidget::EHitCode AbstractSplineWidget::HitTest(const QPoint& point
|
||||
PointToTimeValue(point, time, val);
|
||||
|
||||
m_hitCode = HIT_NOTHING;
|
||||
m_pHitSpline = NULL;
|
||||
m_pHitDetailSpline = NULL;
|
||||
m_pHitSpline = nullptr;
|
||||
m_pHitDetailSpline = nullptr;
|
||||
m_nHitKeyIndex = -1;
|
||||
m_nHitDimension = -1;
|
||||
m_bHitIncomingHandle = true;
|
||||
@@ -1968,8 +1968,8 @@ void AbstractSplineWidget::StopTracking()
|
||||
void AbstractSplineWidget::ScaleAmplitudeKeys(float time, float startValue, float offset)
|
||||
{
|
||||
//TODO: Test it in the facial animation pane and fix it...
|
||||
m_pHitSpline = 0;
|
||||
m_pHitDetailSpline = 0;
|
||||
m_pHitSpline = nullptr;
|
||||
m_pHitDetailSpline = nullptr;
|
||||
m_nHitKeyIndex = -1;
|
||||
m_nHitDimension = -1;
|
||||
|
||||
@@ -2071,8 +2071,8 @@ void AbstractSplineWidget::TimeScaleKeys(float time, float startTime, float endT
|
||||
float timeScaleC = endTime - startTime * timeScaleM;
|
||||
|
||||
// Loop through all keys that are selected.
|
||||
m_pHitSpline = 0;
|
||||
m_pHitDetailSpline = 0;
|
||||
m_pHitSpline = nullptr;
|
||||
m_pHitDetailSpline = nullptr;
|
||||
m_nHitKeyIndex = -1;
|
||||
|
||||
float affectedRangeMin = FLT_MAX;
|
||||
@@ -2179,8 +2179,8 @@ void AbstractSplineWidget::ValueScaleKeys(float startValue, float endValue)
|
||||
}
|
||||
|
||||
// Loop through all keys that are selected.
|
||||
m_pHitSpline = 0;
|
||||
m_pHitDetailSpline = 0;
|
||||
m_pHitSpline = nullptr;
|
||||
m_pHitDetailSpline = nullptr;
|
||||
m_nHitKeyIndex = -1;
|
||||
m_nHitDimension = -1;
|
||||
|
||||
@@ -2212,8 +2212,8 @@ void AbstractSplineWidget::ValueScaleKeys(float startValue, float endValue)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void AbstractSplineWidget::MoveSelectedKeys(Vec2 offset, bool copyKeys)
|
||||
{
|
||||
m_pHitSpline = 0;
|
||||
m_pHitDetailSpline = 0;
|
||||
m_pHitSpline = nullptr;
|
||||
m_pHitDetailSpline = nullptr;
|
||||
m_nHitKeyIndex = -1;
|
||||
m_nHitDimension = -1;
|
||||
|
||||
@@ -2275,8 +2275,8 @@ void AbstractSplineWidget::RemoveKey(ISplineInterpolator* pSpline, int nKey)
|
||||
|
||||
SendNotifyEvent(SPLN_BEFORE_CHANGE);
|
||||
|
||||
m_pHitSpline = 0;
|
||||
m_pHitDetailSpline = 0;
|
||||
m_pHitSpline = nullptr;
|
||||
m_pHitDetailSpline = nullptr;
|
||||
m_nHitKeyIndex = -1;
|
||||
if (nKey != -1)
|
||||
{
|
||||
@@ -2294,8 +2294,8 @@ void AbstractSplineWidget::RemoveSelectedKeys()
|
||||
|
||||
SendNotifyEvent(SPLN_BEFORE_CHANGE);
|
||||
|
||||
m_pHitSpline = 0;
|
||||
m_pHitDetailSpline = 0;
|
||||
m_pHitSpline = nullptr;
|
||||
m_pHitDetailSpline = nullptr;
|
||||
m_nHitKeyIndex = -1;
|
||||
|
||||
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
|
||||
@@ -2558,11 +2558,11 @@ public:
|
||||
};
|
||||
void AbstractSplineWidget::DuplicateSelectedKeys()
|
||||
{
|
||||
m_pHitSpline = 0;
|
||||
m_pHitDetailSpline = 0;
|
||||
m_pHitSpline = nullptr;
|
||||
m_pHitDetailSpline = nullptr;
|
||||
m_nHitKeyIndex = -1;
|
||||
|
||||
typedef std::vector<CKeyCopyInfo> KeysToAddContainer;
|
||||
using KeysToAddContainer = std::vector<CKeyCopyInfo>;
|
||||
KeysToAddContainer keysToInsert;
|
||||
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
|
||||
{
|
||||
@@ -2600,7 +2600,7 @@ void AbstractSplineWidget::ZeroAll()
|
||||
{
|
||||
GetIEditor()->BeginUndo();
|
||||
|
||||
typedef std::vector<ISplineInterpolator*> SplineContainer;
|
||||
using SplineContainer = std::vector<ISplineInterpolator *>;
|
||||
SplineContainer splines;
|
||||
for (int splineIndex = 0; splineIndex < int(m_splines.size()); ++splineIndex)
|
||||
{
|
||||
@@ -2632,7 +2632,7 @@ void AbstractSplineWidget::KeyAll()
|
||||
{
|
||||
GetIEditor()->BeginUndo();
|
||||
|
||||
typedef std::vector<ISplineInterpolator*> SplineContainer;
|
||||
using SplineContainer = std::vector<ISplineInterpolator *>;
|
||||
SplineContainer splines;
|
||||
for (int splineIndex = 0; splineIndex < int(m_splines.size()); ++splineIndex)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ TimelineWidget::TimelineWidget(QWidget* parent /* = nullptr */)
|
||||
|
||||
m_bIgnoreSetTime = false;
|
||||
|
||||
m_pKeyTimeSet = 0;
|
||||
m_pKeyTimeSet = nullptr;
|
||||
|
||||
m_markerStyle = MARKER_STYLE_SECONDS;
|
||||
m_fps = 30.0f;
|
||||
|
||||
@@ -80,12 +80,12 @@ namespace
|
||||
, m_trigger(trigger)
|
||||
{}
|
||||
|
||||
virtual ~EditorListener()
|
||||
~EditorListener() override
|
||||
{
|
||||
GetIEditor()->UnregisterNotifyListener(this);
|
||||
}
|
||||
|
||||
void OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
void OnEditorNotifyEvent(EEditorNotifyEvent event) override
|
||||
{
|
||||
m_trigger(event);
|
||||
}
|
||||
@@ -544,12 +544,12 @@ void LevelEditorMenuHandler::PopulateEditMenu(ActionManager::MenuWrapper& editMe
|
||||
|
||||
auto snapMenu = modifyMenu.AddMenu(tr("Snap"));
|
||||
|
||||
snapMenu.AddAction(ID_SNAPANGLE);
|
||||
snapMenu.AddAction(AzToolsFramework::SnapAngle);
|
||||
|
||||
auto transformModeMenu = modifyMenu.AddMenu(tr("Transform Mode"));
|
||||
transformModeMenu.AddAction(ID_EDITMODE_MOVE);
|
||||
transformModeMenu.AddAction(ID_EDITMODE_ROTATE);
|
||||
transformModeMenu.AddAction(ID_EDITMODE_SCALE);
|
||||
transformModeMenu.AddAction(AzToolsFramework::EditModeMove);
|
||||
transformModeMenu.AddAction(AzToolsFramework::EditModeRotate);
|
||||
transformModeMenu.AddAction(AzToolsFramework::EditModeScale);
|
||||
|
||||
editMenu.AddSeparator();
|
||||
|
||||
|
||||
@@ -423,7 +423,7 @@ namespace Editor
|
||||
{
|
||||
UINT rawInputSize;
|
||||
const UINT rawInputHeaderSize = sizeof(RAWINPUTHEADER);
|
||||
GetRawInputData((HRAWINPUT)msg->lParam, RID_INPUT, NULL, &rawInputSize, rawInputHeaderSize);
|
||||
GetRawInputData((HRAWINPUT)msg->lParam, RID_INPUT, nullptr, &rawInputSize, rawInputHeaderSize);
|
||||
|
||||
AZStd::array<BYTE, sizeof(RAWINPUT)> rawInputBytesArray;
|
||||
LPBYTE rawInputBytes = rawInputBytesArray.data();
|
||||
|
||||
@@ -26,7 +26,7 @@ class EditorCoreTestEnvironment
|
||||
public:
|
||||
AZ_TEST_CLASS_ALLOCATOR(EditorCoreTestEnvironment);
|
||||
|
||||
virtual ~EditorCoreTestEnvironment()
|
||||
~EditorCoreTestEnvironment() override
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+8
-73
@@ -375,9 +375,6 @@ void CCryEditApp::RegisterActionHandlers()
|
||||
});
|
||||
ON_COMMAND(ID_MOVE_OBJECT, OnMoveObject)
|
||||
ON_COMMAND(ID_RENAME_OBJ, OnRenameObj)
|
||||
ON_COMMAND(ID_EDITMODE_MOVE, OnEditmodeMove)
|
||||
ON_COMMAND(ID_EDITMODE_ROTATE, OnEditmodeRotate)
|
||||
ON_COMMAND(ID_EDITMODE_SCALE, OnEditmodeScale)
|
||||
ON_COMMAND(ID_UNDO, OnUndo)
|
||||
ON_COMMAND(ID_TOOLBAR_WIDGET_REDO, OnUndo) // Can't use the same ID, because for the menu we can't have a QWidgetAction, while for the toolbar we want one
|
||||
ON_COMMAND(ID_IMPORT_ASSET, OnOpenAssetImporter)
|
||||
@@ -2579,75 +2576,6 @@ void CCryEditApp::OnRenameObj()
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnEditmodeMove()
|
||||
{
|
||||
using namespace AzToolsFramework;
|
||||
EditorTransformComponentSelectionRequestBus::Event(
|
||||
GetEntityContextId(),
|
||||
&EditorTransformComponentSelectionRequests::SetTransformMode,
|
||||
EditorTransformComponentSelectionRequests::Mode::Translation);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnEditmodeRotate()
|
||||
{
|
||||
using namespace AzToolsFramework;
|
||||
EditorTransformComponentSelectionRequestBus::Event(
|
||||
GetEntityContextId(),
|
||||
&EditorTransformComponentSelectionRequests::SetTransformMode,
|
||||
EditorTransformComponentSelectionRequests::Mode::Rotation);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnEditmodeScale()
|
||||
{
|
||||
using namespace AzToolsFramework;
|
||||
EditorTransformComponentSelectionRequestBus::Event(
|
||||
GetEntityContextId(),
|
||||
&EditorTransformComponentSelectionRequests::SetTransformMode,
|
||||
EditorTransformComponentSelectionRequests::Mode::Scale);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnUpdateEditmodeMove(QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequests::Mode mode;
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequestBus::EventResult(
|
||||
mode, AzToolsFramework::GetEntityContextId(),
|
||||
&AzToolsFramework::EditorTransformComponentSelectionRequests::GetTransformMode);
|
||||
|
||||
action->setChecked(mode == AzToolsFramework::EditorTransformComponentSelectionRequests::Mode::Translation);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnUpdateEditmodeRotate(QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequests::Mode mode;
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequestBus::EventResult(
|
||||
mode, AzToolsFramework::GetEntityContextId(),
|
||||
&AzToolsFramework::EditorTransformComponentSelectionRequests::GetTransformMode);
|
||||
|
||||
action->setChecked(mode == AzToolsFramework::EditorTransformComponentSelectionRequests::Mode::Rotation);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnUpdateEditmodeScale(QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequests::Mode mode;
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequestBus::EventResult(
|
||||
mode, AzToolsFramework::GetEntityContextId(),
|
||||
&AzToolsFramework::EditorTransformComponentSelectionRequests::GetTransformMode);
|
||||
|
||||
action->setChecked(mode == AzToolsFramework::EditorTransformComponentSelectionRequests::Mode::Scale);
|
||||
}
|
||||
|
||||
void CCryEditApp::OnViewSwitchToGame()
|
||||
{
|
||||
if (IsInPreviewMode())
|
||||
@@ -2901,7 +2829,14 @@ void CCryEditApp::OpenProjectManager(const AZStd::string& screen)
|
||||
{
|
||||
// provide the current project path for in case we want to update the project
|
||||
AZ::IO::FixedMaxPathString projectPath = AZ::Utils::GetProjectPath();
|
||||
const AZStd::string commandLineOptions = AZStd::string::format(" --screen %s --project-path %s", screen.c_str(), projectPath.c_str());
|
||||
#if !AZ_TRAIT_OS_PLATFORM_APPLE && !AZ_TRAIT_OS_USE_WINDOWS_FILE_PATHS
|
||||
const char* argumentQuoteString = R"(")";
|
||||
#else
|
||||
const char* argumentQuoteString = R"(\")";
|
||||
#endif
|
||||
const AZStd::string commandLineOptions = AZStd::string::format(R"( --screen %s --project-path %s%s%s)",
|
||||
screen.c_str(),
|
||||
argumentQuoteString, projectPath.c_str(), argumentQuoteString);
|
||||
bool launchSuccess = AzFramework::ProjectManager::LaunchProjectManager(commandLineOptions);
|
||||
if (!launchSuccess)
|
||||
{
|
||||
|
||||
@@ -208,12 +208,6 @@ public:
|
||||
void DeleteSelectedEntities(bool includeDescendants);
|
||||
void OnMoveObject();
|
||||
void OnRenameObj();
|
||||
void OnEditmodeMove();
|
||||
void OnEditmodeRotate();
|
||||
void OnEditmodeScale();
|
||||
void OnUpdateEditmodeMove(QAction* action);
|
||||
void OnUpdateEditmodeRotate(QAction* action);
|
||||
void OnUpdateEditmodeScale(QAction* action);
|
||||
void OnUndo();
|
||||
void OnOpenAssetImporter();
|
||||
void OnUpdateSelected(QAction* action);
|
||||
|
||||
+63
-84
@@ -108,21 +108,12 @@ namespace Internal
|
||||
// CCryEditDoc construction/destruction
|
||||
|
||||
CCryEditDoc::CCryEditDoc()
|
||||
: doc_validate_surface_types(0)
|
||||
: doc_validate_surface_types(nullptr)
|
||||
, m_modifiedModuleFlags(eModifiedNothing)
|
||||
// It assumes loaded levels have already been exported. Can be a big fat lie, though.
|
||||
// The right way would require us to save to the level folder the export status of the
|
||||
// level.
|
||||
, m_boLevelExported(true)
|
||||
, m_modified(false)
|
||||
, m_envProbeHeight(200.0f)
|
||||
, m_envProbeSliceRelativePath("EngineAssets/Slices/DefaultLevelSetup.slice")
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Set member variables to initial values
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
m_bLoadFailed = false;
|
||||
m_waterColor = QColor(0, 0, 255);
|
||||
|
||||
m_fogTemplate = GetIEditor()->FindTemplate("Fog");
|
||||
m_environmentTemplate = GetIEditor()->FindTemplate("Environment");
|
||||
@@ -136,7 +127,6 @@ CCryEditDoc::CCryEditDoc()
|
||||
m_environmentTemplate = XmlHelpers::CreateXmlNode("Environment");
|
||||
}
|
||||
|
||||
m_bDocumentReady = false;
|
||||
GetIEditor()->SetDocument(this);
|
||||
CLogFile::WriteLine("Document created");
|
||||
RegisterConsoleVariables();
|
||||
@@ -195,7 +185,7 @@ CCryEditDoc::DocumentEditingMode CCryEditDoc::GetEditMode() const
|
||||
|
||||
QString CCryEditDoc::GetActivePathName() const
|
||||
{
|
||||
return DocumentEditingMode() == CCryEditDoc::DocumentEditingMode::SliceEdit ? GetSlicePathName() : GetLevelPathName();
|
||||
return GetEditMode() == CCryEditDoc::DocumentEditingMode::SliceEdit ? GetSlicePathName() : GetLevelPathName();
|
||||
}
|
||||
|
||||
QString CCryEditDoc::GetTitle() const
|
||||
@@ -260,9 +250,9 @@ void CCryEditDoc::DeleteContents()
|
||||
GetIEditor()->FlushUndo();
|
||||
|
||||
// Notify listeners.
|
||||
for (std::list<IDocListener*>::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it)
|
||||
for (IDocListener* listener : m_listeners)
|
||||
{
|
||||
(*it)->OnCloseDocument();
|
||||
listener->OnCloseDocument();
|
||||
}
|
||||
|
||||
GetIEditor()->ResetViews();
|
||||
@@ -458,7 +448,7 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Load water color.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
(*arrXmlAr[DMAS_GENERAL]).root->getAttr("WaterColor", m_waterColor);
|
||||
(*arrXmlAr[DMAS_GENERAL]).root->getAttr("WaterColor", m_waterColor);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Load View Settings
|
||||
@@ -507,9 +497,9 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename)
|
||||
CAutoLogTime logtime("Post Load");
|
||||
|
||||
// Notify listeners.
|
||||
for (std::list<IDocListener*>::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it)
|
||||
for (IDocListener* listener : m_listeners)
|
||||
{
|
||||
(*it)->OnLoadDocument();
|
||||
listener->OnLoadDocument();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -708,7 +698,8 @@ bool CCryEditDoc::SaveModified()
|
||||
return true;
|
||||
}
|
||||
|
||||
auto button = QMessageBox::question(AzToolsFramework::GetActiveWindow(), QString(), tr("Save changes to %1?").arg(GetTitle()), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
||||
auto button = QMessageBox::question(AzToolsFramework::GetActiveWindow(), QString(), tr("Save changes to %1?").arg(GetTitle()),
|
||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
||||
switch (button)
|
||||
{
|
||||
case QMessageBox::Cancel:
|
||||
@@ -933,8 +924,7 @@ bool CCryEditDoc::OnSaveDocument(const QString& lpszPathName)
|
||||
}
|
||||
|
||||
TSaveDocContext context;
|
||||
if (shouldSaveLevel &&
|
||||
BeforeSaveDocument(lpszPathName, context))
|
||||
if (shouldSaveLevel && BeforeSaveDocument(lpszPathName, context))
|
||||
{
|
||||
DoSaveDocument(lpszPathName, context);
|
||||
saveSuccess = AfterSaveDocument(lpszPathName, context);
|
||||
@@ -972,7 +962,7 @@ bool CCryEditDoc::BeforeSaveDocument(const QString& lpszPathName, TSaveDocContex
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool CCryEditDoc::HasLayerNameConflicts()
|
||||
bool CCryEditDoc::HasLayerNameConflicts() const
|
||||
{
|
||||
AZStd::vector<AZ::Entity*> editorEntities;
|
||||
AzToolsFramework::EditorEntityContextRequestBus::Broadcast(
|
||||
@@ -1004,43 +994,42 @@ bool CCryEditDoc::HasLayerNameConflicts()
|
||||
bool CCryEditDoc::DoSaveDocument(const QString& filename, TSaveDocContext& context)
|
||||
{
|
||||
bool& bSaved = context.bSaved;
|
||||
if (bSaved)
|
||||
if (!bSaved)
|
||||
{
|
||||
// Paranoia - we shouldn't get this far into the save routine without a level loaded (empty levelPath)
|
||||
// If nothing is loaded, we don't need to save anything
|
||||
if (filename.isEmpty())
|
||||
{
|
||||
bSaved = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Save Tag Point locations to file if auto save of tag points disabled
|
||||
if (!gSettings.bAutoSaveTagPoints)
|
||||
{
|
||||
CCryEditApp::instance()->SaveTagLocations();
|
||||
}
|
||||
|
||||
QString normalizedPath = Path::ToUnixPath(filename);
|
||||
if (IsSliceFile(normalizedPath))
|
||||
{
|
||||
bSaved = SaveSlice(normalizedPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
bSaved = SaveLevel(normalizedPath);
|
||||
}
|
||||
|
||||
// Changes filename for this document.
|
||||
SetPathName(normalizedPath);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Paranoia - we shouldn't get this far into the save routine without a level loaded (empty levelPath)
|
||||
// If nothing is loaded, we don't need to save anything
|
||||
if (filename.isEmpty())
|
||||
{
|
||||
bSaved = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Save Tag Point locations to file if auto save of tag points disabled
|
||||
if (!gSettings.bAutoSaveTagPoints)
|
||||
{
|
||||
CCryEditApp::instance()->SaveTagLocations();
|
||||
}
|
||||
|
||||
QString normalizedPath = Path::ToUnixPath(filename);
|
||||
if (IsSliceFile(normalizedPath))
|
||||
{
|
||||
bSaved = SaveSlice(normalizedPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
bSaved = SaveLevel(normalizedPath);
|
||||
}
|
||||
|
||||
// Changes filename for this document.
|
||||
SetPathName(normalizedPath);
|
||||
return bSaved;
|
||||
}
|
||||
|
||||
bool CCryEditDoc::AfterSaveDocument([[maybe_unused]] const QString& lpszPathName, TSaveDocContext& context, bool bShowPrompt)
|
||||
{
|
||||
bool& bSaved = context.bSaved;
|
||||
bool bSaved = context.bSaved;
|
||||
|
||||
GetIEditor()->Notify(eNotify_OnEndSceneSave);
|
||||
|
||||
@@ -1067,8 +1056,7 @@ bool CCryEditDoc::AfterSaveDocument([[maybe_unused]] const QString& lpszPathName
|
||||
static void GetUserSettingsFile(const QString& levelFolder, QString& userSettings)
|
||||
{
|
||||
const char* pUserName = GetISystem()->GetUserName();
|
||||
QString fileName;
|
||||
fileName = QStringLiteral("%1_usersettings.editor_xml").arg(pUserName);
|
||||
QString fileName = QStringLiteral("%1_usersettings.editor_xml").arg(pUserName);
|
||||
userSettings = Path::Make(levelFolder, fileName);
|
||||
}
|
||||
|
||||
@@ -1182,9 +1170,9 @@ bool CCryEditDoc::SaveLevel(const QString& filename)
|
||||
}
|
||||
|
||||
QString oldFilePath = QDir(oldLevelFolder).absoluteFilePath(sourceName);
|
||||
QString newFilePath = QDir(newLevelFolder).absoluteFilePath(sourceName);
|
||||
QString newFilePath = QDir(newLevelFolder).absoluteFilePath(destName);
|
||||
CFileUtil::CopyFile(oldFilePath, newFilePath);
|
||||
} while (findHandle = pIPak->FindNext(findHandle));
|
||||
} while ((findHandle = pIPak->FindNext(findHandle)));
|
||||
pIPak->FindClose(findHandle);
|
||||
}
|
||||
|
||||
@@ -1506,7 +1494,7 @@ bool CCryEditDoc::LoadEntitiesFromLevel(const QString& levelPakFile)
|
||||
{
|
||||
AZStd::vector<char> fileBuffer;
|
||||
fileBuffer.resize(entitiesFile.GetLength());
|
||||
if (fileBuffer.size() > 0)
|
||||
if (!fileBuffer.empty())
|
||||
{
|
||||
if (fileBuffer.size() == entitiesFile.ReadRaw(fileBuffer.begin(), fileBuffer.size()))
|
||||
{
|
||||
@@ -1910,7 +1898,7 @@ void CCryEditDoc::UnregisterListener(IDocListener* listener)
|
||||
m_listeners.remove(listener);
|
||||
}
|
||||
|
||||
void CCryEditDoc::LogLoadTime(int time)
|
||||
void CCryEditDoc::LogLoadTime(int time) const
|
||||
{
|
||||
QString appFilePath = QDir::toNativeSeparators(QCoreApplication::applicationFilePath());
|
||||
QString exePath = Path::GetPath(appFilePath);
|
||||
@@ -1922,21 +1910,18 @@ void CCryEditDoc::LogLoadTime(int time)
|
||||
SetFileAttributes(filename.toUtf8().data(), FILE_ATTRIBUTE_ARCHIVE);
|
||||
#endif
|
||||
|
||||
FILE* file = nullptr;
|
||||
azfopen(&file, filename.toUtf8().data(), "at");
|
||||
|
||||
if (file)
|
||||
QFile file(filename);
|
||||
if (!file.open(QFile::Append | QFile::Text))
|
||||
{
|
||||
char version[50];
|
||||
GetIEditor()->GetFileVersion().ToShortString(version, AZ_ARRAY_SIZE(version));
|
||||
|
||||
QString text;
|
||||
|
||||
time = time / 1000;
|
||||
text = QStringLiteral("\n[%1] Level %2 loaded in %3 seconds").arg(version, level).arg(time);
|
||||
fwrite(text.toUtf8().data(), text.toUtf8().length(), 1, file);
|
||||
fclose(file);
|
||||
return;
|
||||
}
|
||||
|
||||
char version[50];
|
||||
GetIEditor()->GetFileVersion().ToShortString(version, AZ_ARRAY_SIZE(version));
|
||||
|
||||
time = time / 1000;
|
||||
QString text = QStringLiteral("\n[%1] Level %2 loaded in %3 seconds").arg(version, level).arg(time);
|
||||
file.write(text.toUtf8());
|
||||
}
|
||||
|
||||
void CCryEditDoc::SetDocumentReady(bool bReady)
|
||||
@@ -1944,7 +1929,7 @@ void CCryEditDoc::SetDocumentReady(bool bReady)
|
||||
m_bDocumentReady = bReady;
|
||||
}
|
||||
|
||||
void CCryEditDoc::GetMemoryUsage(ICrySizer* pSizer)
|
||||
void CCryEditDoc::GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
{
|
||||
SIZER_COMPONENT_NAME(pSizer, "UndoManager(estimate)");
|
||||
@@ -2068,12 +2053,9 @@ void CCryEditDoc::InitEmptyLevel(int /*resolution*/, int /*unitSize*/, bool /*bU
|
||||
{
|
||||
// Notify listeners.
|
||||
std::list<IDocListener*> listeners = m_listeners;
|
||||
std::list<IDocListener*>::iterator it, next;
|
||||
for (it = listeners.begin(); it != listeners.end(); it = next)
|
||||
for (IDocListener* listener : listeners)
|
||||
{
|
||||
next = it;
|
||||
next++;
|
||||
(*it)->OnNewDocument();
|
||||
listener->OnNewDocument();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2134,25 +2116,23 @@ void CCryEditDoc::OnEnvironmentPropertyChanged(IVariable* pVar)
|
||||
{
|
||||
return;
|
||||
}
|
||||
QString childValue;
|
||||
|
||||
if (pVar->GetDataType() == IVariable::DT_COLOR)
|
||||
{
|
||||
Vec3 value;
|
||||
pVar->Get(value);
|
||||
QString buff;
|
||||
QColor gammaColor = ColorLinearToGamma(ColorF(value.x, value.y, value.z));
|
||||
buff = QStringLiteral("%1,%2,%3").arg(gammaColor.red()).arg(gammaColor.green()).arg(gammaColor.blue());
|
||||
childNode->setAttr("value", buff.toUtf8().data());
|
||||
childValue = QStringLiteral("%1,%2,%3").arg(gammaColor.red()).arg(gammaColor.green()).arg(gammaColor.blue());
|
||||
}
|
||||
else
|
||||
{
|
||||
QString value;
|
||||
pVar->Get(value);
|
||||
childNode->setAttr("value", value.toUtf8().data());
|
||||
pVar->Get(childValue);
|
||||
}
|
||||
childNode->setAttr("value", childValue.toUtf8().data());
|
||||
}
|
||||
|
||||
QString CCryEditDoc::GetCryIndexPath(const LPCTSTR levelFilePath)
|
||||
QString CCryEditDoc::GetCryIndexPath(const LPCTSTR levelFilePath) const
|
||||
{
|
||||
QString levelPath = Path::GetPath(levelFilePath);
|
||||
QString levelName = Path::GetFileName(levelFilePath);
|
||||
@@ -2183,8 +2163,7 @@ BOOL CCryEditDoc::LoadXmlArchiveArray(TDocMultiArchive& arrXmlAr, const QString&
|
||||
}
|
||||
|
||||
CPakFile pakFile;
|
||||
bool loadFromPakSuccess;
|
||||
loadFromPakSuccess = xmlAr.LoadFromPak(levelPath, pakFile);
|
||||
bool loadFromPakSuccess = xmlAr.LoadFromPak(levelPath, pakFile);
|
||||
pIPak->ClosePack(absoluteLevelPath.toUtf8().data());
|
||||
if (!loadFromPakSuccess)
|
||||
{
|
||||
|
||||
+16
-14
@@ -91,7 +91,7 @@ public: // Create from serialization only
|
||||
// ClassWizard generated virtual function overrides
|
||||
virtual bool OnOpenDocument(const QString& lpszPathName);
|
||||
|
||||
const bool IsLevelLoadFailed() const { return m_bLoadFailed; }
|
||||
bool IsLevelLoadFailed() const { return m_bLoadFailed; }
|
||||
|
||||
//! Marks this document as having errors.
|
||||
void SetHasErrors() { m_hasErrors = true; }
|
||||
@@ -121,7 +121,7 @@ public: // Create from serialization only
|
||||
|
||||
CClouds* GetClouds() { return m_pClouds; }
|
||||
void SetWaterColor(const QColor& col) { m_waterColor = col; }
|
||||
QColor GetWaterColor() { return m_waterColor; }
|
||||
QColor GetWaterColor() const { return m_waterColor; }
|
||||
XmlNodeRef& GetFogTemplate() { return m_fogTemplate; }
|
||||
XmlNodeRef& GetEnvironmentTemplate() { return m_environmentTemplate; }
|
||||
void OnEnvironmentPropertyChanged(IVariable* pVar);
|
||||
@@ -129,7 +129,7 @@ public: // Create from serialization only
|
||||
void RegisterListener(IDocListener* listener);
|
||||
void UnregisterListener(IDocListener* listener);
|
||||
|
||||
void GetMemoryUsage(ICrySizer* pSizer);
|
||||
void GetMemoryUsage(ICrySizer* pSizer) const;
|
||||
|
||||
static bool IsBackupOrTempLevelSubdirectory(const QString& folderName);
|
||||
protected:
|
||||
@@ -161,14 +161,14 @@ protected:
|
||||
void SerializeFogSettings(CXmlArchive& xmlAr);
|
||||
virtual void SerializeViewSettings(CXmlArchive& xmlAr);
|
||||
void SerializeNameSelection(CXmlArchive& xmlAr);
|
||||
void LogLoadTime(int time);
|
||||
void LogLoadTime(int time) const;
|
||||
|
||||
struct TSaveDocContext
|
||||
{
|
||||
bool bSaved;
|
||||
};
|
||||
bool BeforeSaveDocument(const QString& lpszPathName, TSaveDocContext& context);
|
||||
bool HasLayerNameConflicts();
|
||||
bool HasLayerNameConflicts() const;
|
||||
bool DoSaveDocument(const QString& lpszPathName, TSaveDocContext& context);
|
||||
bool AfterSaveDocument(const QString& lpszPathName, TSaveDocContext& context, bool bShowPrompt = true);
|
||||
|
||||
@@ -180,7 +180,7 @@ protected:
|
||||
void OnStartLevelResourceList();
|
||||
static void OnValidateSurfaceTypesChanged(ICVar*);
|
||||
|
||||
QString GetCryIndexPath(const LPCTSTR levelFilePath);
|
||||
QString GetCryIndexPath(const LPCTSTR levelFilePath) const;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// SliceEditorEntityOwnershipServiceNotificationBus::Handler
|
||||
@@ -188,24 +188,26 @@ protected:
|
||||
void OnSliceInstantiationFailed(const AZ::Data::AssetId& sliceAssetId, const AzFramework::SliceInstantiationTicket& /*ticket*/) override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool m_bLoadFailed;
|
||||
QColor m_waterColor;
|
||||
bool m_bLoadFailed = false;
|
||||
QColor m_waterColor = QColor(0, 0, 255);
|
||||
XmlNodeRef m_fogTemplate;
|
||||
XmlNodeRef m_environmentTemplate;
|
||||
CClouds* m_pClouds;
|
||||
std::list<IDocListener*> m_listeners;
|
||||
bool m_bDocumentReady;
|
||||
ICVar* doc_validate_surface_types;
|
||||
bool m_bDocumentReady = false;
|
||||
ICVar* doc_validate_surface_types = nullptr;
|
||||
int m_modifiedModuleFlags;
|
||||
bool m_boLevelExported;
|
||||
bool m_modified;
|
||||
// On construction, it assumes loaded levels have already been exported. Can be a big fat lie, though.
|
||||
// The right way would require us to save to the level folder the export status of the level.
|
||||
bool m_boLevelExported = true;
|
||||
bool m_modified = false;
|
||||
QString m_pathName;
|
||||
QString m_slicePathName;
|
||||
QString m_title;
|
||||
AZ::Data::AssetId m_envProbeSliceAssetId;
|
||||
float m_terrainSize;
|
||||
const char* m_envProbeSliceRelativePath;
|
||||
const float m_envProbeHeight;
|
||||
const char* m_envProbeSliceRelativePath = "EngineAssets/Slices/DefaultLevelSetup.slice";
|
||||
const float m_envProbeHeight = 200.0f;
|
||||
bool m_hasErrors = false; ///< This is used to warn the user that they may lose work when they go to save.
|
||||
};
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
|
||||
|
||||
CErrorsDlg::CErrorsDlg(QWidget* pParent /*=NULL*/)
|
||||
CErrorsDlg::CErrorsDlg(QWidget* pParent /*=nullptr*/)
|
||||
: QDialog(pParent)
|
||||
, ui(new Ui::CErrorsDlg)
|
||||
{
|
||||
|
||||
@@ -159,7 +159,7 @@ void CPythonScriptsDialog::OnExecute()
|
||||
QList<QStandardItem*> selectedItems = ui->treeView->GetSelectedItems();
|
||||
QStandardItem* selectedItem = selectedItems.empty() ? nullptr : selectedItems.first();
|
||||
|
||||
if (selectedItem == NULL)
|
||||
if (selectedItem == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize)
|
||||
->Field("PreviewPanel", &GeneralSettings::m_previewPanel)
|
||||
->Field("ApplyConfigSpec", &GeneralSettings::m_applyConfigSpec)
|
||||
->Field("EnableSourceControl", &GeneralSettings::m_enableSourceControl)
|
||||
->Field("ClearConsole", &GeneralSettings::m_clearConsoleOnGameModeStart)
|
||||
->Field("ConsoleBackgroundColorTheme", &GeneralSettings::m_consoleBackgroundColorTheme)
|
||||
->Field("AutoloadLastLevel", &GeneralSettings::m_autoLoadLastLevel)
|
||||
->Field("ShowTimeInConsole", &GeneralSettings::m_bShowTimeInConsole)
|
||||
@@ -77,6 +78,8 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize)
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_previewPanel, "Show Geometry Preview Panel", "Show Geometry Preview Panel")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_applyConfigSpec, "Hide objects by config spec", "Hide objects by config spec")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_enableSourceControl, "Enable Source Control", "Enable Source Control")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_clearConsoleOnGameModeStart, "Clear Console at game startup", "Clear Console when game mode starts")
|
||||
->DataElement(AZ::Edit::UIHandlers::ComboBox, &GeneralSettings::m_consoleBackgroundColorTheme, "Console Background", "Console Background")
|
||||
->EnumAttribute(AzToolsFramework::ConsoleColorTheme::Light, "Light")
|
||||
->EnumAttribute(AzToolsFramework::ConsoleColorTheme::Dark, "Dark")
|
||||
@@ -142,6 +145,7 @@ void CEditorPreferencesPage_General::OnApply()
|
||||
gSettings.bPreviewGeometryWindow = m_generalSettings.m_previewPanel;
|
||||
gSettings.bApplyConfigSpecInEditor = m_generalSettings.m_applyConfigSpec;
|
||||
gSettings.enableSourceControl = m_generalSettings.m_enableSourceControl;
|
||||
gSettings.clearConsoleOnGameModeStart = m_generalSettings.m_clearConsoleOnGameModeStart;
|
||||
gSettings.consoleBackgroundColorTheme = m_generalSettings.m_consoleBackgroundColorTheme;
|
||||
gSettings.bShowTimeInConsole = m_generalSettings.m_bShowTimeInConsole;
|
||||
gSettings.bShowDashboardAtStartup = m_messaging.m_showDashboard;
|
||||
@@ -176,6 +180,7 @@ void CEditorPreferencesPage_General::InitializeSettings()
|
||||
m_generalSettings.m_previewPanel = gSettings.bPreviewGeometryWindow;
|
||||
m_generalSettings.m_applyConfigSpec = gSettings.bApplyConfigSpecInEditor;
|
||||
m_generalSettings.m_enableSourceControl = gSettings.enableSourceControl;
|
||||
m_generalSettings.m_clearConsoleOnGameModeStart = gSettings.clearConsoleOnGameModeStart;
|
||||
m_generalSettings.m_consoleBackgroundColorTheme = gSettings.consoleBackgroundColorTheme;
|
||||
m_generalSettings.m_bShowTimeInConsole = gSettings.bShowTimeInConsole;
|
||||
m_generalSettings.m_autoLoadLastLevel = gSettings.bAutoloadLastLevelAtStartup;
|
||||
|
||||
@@ -46,6 +46,7 @@ private:
|
||||
bool m_previewPanel;
|
||||
bool m_applyConfigSpec;
|
||||
bool m_enableSourceControl;
|
||||
bool m_clearConsoleOnGameModeStart;
|
||||
AzToolsFramework::ConsoleColorTheme m_consoleBackgroundColorTheme;
|
||||
bool m_autoLoadLastLevel;
|
||||
bool m_bShowTimeInConsole;
|
||||
|
||||
@@ -1240,6 +1240,13 @@ AZStd::shared_ptr<AtomToolsFramework::ModularViewportCameraController> CreateMod
|
||||
AzFramework::ViewportId viewportId)
|
||||
{
|
||||
auto controller = AZStd::make_shared<AtomToolsFramework::ModularViewportCameraController>();
|
||||
|
||||
controller->SetCameraPriorityBuilderCallback(
|
||||
[](AtomToolsFramework::CameraControllerPriorityFn& cameraControllerPriorityFn)
|
||||
{
|
||||
cameraControllerPriorityFn = AtomToolsFramework::DefaultCameraControllerPriority;
|
||||
});
|
||||
|
||||
controller->SetCameraPropsBuilderCallback(
|
||||
[](AzFramework::CameraProps& cameraProps)
|
||||
{
|
||||
|
||||
@@ -258,19 +258,19 @@ public:
|
||||
m_relCameraRotX = 0;
|
||||
m_relCameraRotZ = 0;
|
||||
|
||||
uint32 numSample6 = m_arrAnimatedCharacterPath.size();
|
||||
uint32 numSample6 = static_cast<uint32>(m_arrAnimatedCharacterPath.size());
|
||||
for (uint32 i = 0; i < numSample6; i++)
|
||||
{
|
||||
m_arrAnimatedCharacterPath[i] = Vec3(ZERO);
|
||||
}
|
||||
|
||||
numSample6 = m_arrSmoothEntityPath.size();
|
||||
numSample6 = static_cast<uint32>(m_arrSmoothEntityPath.size());
|
||||
for (uint32 i = 0; i < numSample6; i++)
|
||||
{
|
||||
m_arrSmoothEntityPath[i] = Vec3(ZERO);
|
||||
}
|
||||
|
||||
uint32 numSample7 = m_arrRunStrafeSmoothing.size();
|
||||
uint32 numSample7 = static_cast<uint32>(m_arrRunStrafeSmoothing.size());
|
||||
for (uint32 i = 0; i < numSample7; i++)
|
||||
{
|
||||
m_arrRunStrafeSmoothing[i] = 0;
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
bool IsEmpty() const;
|
||||
|
||||
//! Get number of contained error records.
|
||||
int GetErrorCount() const { return m_errors.size(); };
|
||||
int GetErrorCount() const { return static_cast<int>(m_errors.size()); };
|
||||
//! Get access to indexed error record.
|
||||
CErrorRecord& GetError(int i);
|
||||
//! Clear all error records.
|
||||
|
||||
@@ -96,7 +96,7 @@ Export::CObject::CObject(const char* pName)
|
||||
|
||||
cameraTargetNodeName[0] = '\0';
|
||||
|
||||
m_pLastObject = 0;
|
||||
m_pLastObject = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,14 +116,14 @@ void Export::CData::Clear()
|
||||
// CExportManager
|
||||
CExportManager::CExportManager()
|
||||
: m_isPrecaching(false)
|
||||
, m_pBaseObj(0)
|
||||
, m_pBaseObj(nullptr)
|
||||
, m_FBXBakedExportFPS(0.0f)
|
||||
, m_fScale(100.0f)
|
||||
, // this scale is used by CryEngine RC
|
||||
m_bAnimationExport(false)
|
||||
, m_bExportLocalCoords(false)
|
||||
, m_numberOfExportFrames(0)
|
||||
, m_pivotEntityObject(0)
|
||||
, m_pivotEntityObject(nullptr)
|
||||
, m_bBakedKeysSequenceExport(true)
|
||||
, m_animTimeExportPrimarySequenceCurrentTime(0.0f)
|
||||
, m_animKeyTimeExport(true)
|
||||
@@ -290,7 +290,7 @@ void CExportManager::ProcessEntityAnimationTrack(
|
||||
const AZ::EntityId entityId, Export::CObject* pObj, AnimParamType entityTrackParamType)
|
||||
{
|
||||
CTrackViewAnimNode* pEntityNode = GetIEditor()->GetSequenceManager()->GetActiveAnimNode(entityId);
|
||||
CTrackViewTrack* pEntityTrack = (pEntityNode ? pEntityNode->GetTrackForParameter(entityTrackParamType) : 0);
|
||||
CTrackViewTrack* pEntityTrack = (pEntityNode ? pEntityNode->GetTrackForParameter(entityTrackParamType) : nullptr);
|
||||
|
||||
if (!pEntityTrack)
|
||||
{
|
||||
@@ -397,7 +397,7 @@ void CExportManager::AddMesh(Export::CObject* pObj, const IIndexedMesh* pIndMesh
|
||||
else
|
||||
{
|
||||
Export::CMesh* pMesh = new Export::CMesh();
|
||||
if (meshDesc.m_nFaceCount == 0 && meshDesc.m_nIndexCount != 0 && meshDesc.m_pIndices != 0)
|
||||
if (meshDesc.m_nFaceCount == 0 && meshDesc.m_nIndexCount != 0 && meshDesc.m_pIndices != nullptr)
|
||||
{
|
||||
const vtx_idx* pIndices = &meshDesc.m_pIndices[0];
|
||||
int nTris = meshDesc.m_nIndexCount / 3;
|
||||
@@ -431,7 +431,7 @@ void CExportManager::AddMesh(Export::CObject* pObj, const IIndexedMesh* pIndMesh
|
||||
|
||||
bool CExportManager::AddStatObj(Export::CObject* pObj, IStatObj* pStatObj, Matrix34A* pTm)
|
||||
{
|
||||
IIndexedMesh* pIndMesh = 0;
|
||||
IIndexedMesh* pIndMesh = nullptr;
|
||||
|
||||
if (pStatObj->GetSubObjectCount())
|
||||
{
|
||||
@@ -440,7 +440,7 @@ bool CExportManager::AddStatObj(Export::CObject* pObj, IStatObj* pStatObj, Matri
|
||||
IStatObj::SSubObject* pSubObj = pStatObj->GetSubObject(i);
|
||||
if (pSubObj && pSubObj->nType == STATIC_SUB_OBJECT_MESH && pSubObj->pStatObj)
|
||||
{
|
||||
pIndMesh = 0;
|
||||
pIndMesh = nullptr;
|
||||
if (m_isOccluder)
|
||||
{
|
||||
if (pSubObj->pStatObj->GetLodObject(2))
|
||||
@@ -542,7 +542,7 @@ bool CExportManager::AddObject(CBaseObject* pBaseObj)
|
||||
|
||||
if (m_isPrecaching)
|
||||
{
|
||||
AddMeshes(0);
|
||||
AddMeshes(nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -554,7 +554,7 @@ bool CExportManager::AddObject(CBaseObject* pBaseObj)
|
||||
m_objectMap[pBaseObj] = int(m_data.m_objects.size() - 1);
|
||||
|
||||
AddMeshes(pObj);
|
||||
m_pBaseObj = 0;
|
||||
m_pBaseObj = nullptr;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -678,7 +678,7 @@ bool CExportManager::ProcessObjectsForExport()
|
||||
for (size_t objectID = 0; objectID < m_data.m_objects.size(); ++objectID)
|
||||
{
|
||||
Export::CObject* pObj2 = m_data.m_objects[objectID];
|
||||
CBaseObject* pObject = 0;
|
||||
CBaseObject* pObject = nullptr;
|
||||
|
||||
if (QString::compare(pObj2->name, kPrimaryCameraName) == 0)
|
||||
{
|
||||
@@ -983,7 +983,7 @@ bool CExportManager::AddObjectsFromSequence(CTrackViewSequence* pSequence, XmlNo
|
||||
{
|
||||
if (pSubSequence && !pSubSequence->IsDisabled())
|
||||
{
|
||||
XmlNodeRef subSeqNode = 0;
|
||||
XmlNodeRef subSeqNode = nullptr;
|
||||
|
||||
if (!seqNode)
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ bool COBJExporter::ExportToFile(const char* filename, const Export::IData* pExpo
|
||||
while (nParent >= 0 && nParent < pExportData->GetObjectCount())
|
||||
{
|
||||
const Export::Object* pParentObj = pExportData->GetObject(nParent);
|
||||
assert(NULL != pParentObj);
|
||||
assert(nullptr != pParentObj);
|
||||
|
||||
Vec3 pos2(pParentObj->pos.x, pParentObj->pos.y, pParentObj->pos.z);
|
||||
Quat rot2(pParentObj->rot.w, pParentObj->rot.v.x, pParentObj->rot.v.y, pParentObj->rot.v.z);
|
||||
|
||||
@@ -566,7 +566,7 @@ void CGameEngine::SwitchToInGame()
|
||||
streamer->QueueRequest(flush);
|
||||
wait.acquire();
|
||||
}
|
||||
|
||||
|
||||
GetIEditor()->Notify(eNotify_OnBeginGameMode);
|
||||
|
||||
m_pISystem->GetIMovieSystem()->EnablePhysicsEvents(true);
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CTriMesh::CTriMesh()
|
||||
{
|
||||
pFaces = NULL;
|
||||
pVertices = NULL;
|
||||
pWSVertices = NULL;
|
||||
pUV = NULL;
|
||||
pColors = NULL;
|
||||
pEdges = NULL;
|
||||
pWeights = NULL;
|
||||
pFaces = nullptr;
|
||||
pVertices = nullptr;
|
||||
pWSVertices = nullptr;
|
||||
pUV = nullptr;
|
||||
pColors = nullptr;
|
||||
pEdges = nullptr;
|
||||
pWeights = nullptr;
|
||||
|
||||
nFacesCount = 0;
|
||||
nVertCount = 0;
|
||||
@@ -67,7 +67,7 @@ void CTriMesh::ReallocStream(int stream, int nNewCount)
|
||||
{
|
||||
return; // Stream already have required size.
|
||||
}
|
||||
void* pStream = 0;
|
||||
void* pStream = nullptr;
|
||||
int nElementSize = 0;
|
||||
GetStreamInfo(stream, pStream, nElementSize);
|
||||
pStream = ReAllocElements(pStream, nNewCount, nElementSize);
|
||||
@@ -256,7 +256,7 @@ void CTriMesh::SharePositions()
|
||||
std::vector<int> arrHashTable[256];
|
||||
|
||||
CTriVertex* pNewVerts = new CTriVertex[GetVertexCount()];
|
||||
SMeshColor* pNewColors = 0;
|
||||
SMeshColor* pNewColors = nullptr;
|
||||
if (pColors)
|
||||
{
|
||||
pNewColors = new SMeshColor[GetVertexCount()];
|
||||
@@ -433,8 +433,8 @@ void CTriMesh::UpdateIndexedMesh(IIndexedMesh* pIndexedMesh) const
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CTriMesh::CopyStream(CTriMesh& fromMesh, int stream)
|
||||
{
|
||||
void* pTrgStream = 0;
|
||||
void* pSrcStream = 0;
|
||||
void* pTrgStream = nullptr;
|
||||
void* pSrcStream = nullptr;
|
||||
int nElemSize = 0;
|
||||
fromMesh.GetStreamInfo(stream, pSrcStream, nElemSize);
|
||||
if (pSrcStream)
|
||||
|
||||
@@ -334,12 +334,12 @@ struct IAssetItem
|
||||
virtual void OnEndPreview() = 0;
|
||||
// Description:
|
||||
// If the asset has a special preview panel with utility controls, to be placed at the top of the Preview window, it can return an child dialog window
|
||||
// otherwise it can return NULL, if no panel is available
|
||||
// otherwise it can return nullptr, if no panel is available
|
||||
// Arguments:
|
||||
// pParentWnd - a valid CDialog*, or NULL
|
||||
// pParentWnd - a valid CDialog*, or nullptr
|
||||
// Return Value:
|
||||
// A valid child dialog window handle, if this asset wants to have a custom panel in the top side of the Asset Preview window,
|
||||
// otherwise it can return NULL, if no panel is available
|
||||
// otherwise it can return nullptr, if no panel is available
|
||||
// See Also:
|
||||
// OnBeginPreview(), OnEndPreview()
|
||||
virtual QWidget* GetCustomPreviewPanelHeader(QWidget* pParentWnd) = 0;
|
||||
|
||||
@@ -186,8 +186,15 @@ struct IFileUtil
|
||||
virtual ECopyTreeResult CopyTree(const QString& strSourceDirectory, const QString& strTargetDirectory, bool boRecurse = true, bool boConfirmOverwrite = false) = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// @param LPPROGRESS_ROUTINE pfnProgress - called by the system to notify of file copy progress
|
||||
// @param LPBOOL pbCancel - when the contents of this BOOL are set to TRUE, the system cancels the copy operation
|
||||
/**
|
||||
* @brief CopyFile
|
||||
* @param strSourceFile
|
||||
* @param strTargetFile
|
||||
* @param boConfirmOverwrite
|
||||
* @param pfnProgress - called by the system to notify of file copy progress
|
||||
* @param pbCancel - when the contents of this bool are set to true, the system cancels the copy operation
|
||||
* @return
|
||||
*/
|
||||
virtual ECopyTreeResult CopyFile(const QString& strSourceFile, const QString& strTargetFile, bool boConfirmOverwrite = false, ProgressRoutine pfnProgress = nullptr, bool* pbCancel = nullptr) = 0;
|
||||
|
||||
// As we don't have a FileUtil interface here, we have to duplicate some code :-( in order to keep
|
||||
|
||||
@@ -46,6 +46,7 @@ AZ_POP_DISABLE_WARNING
|
||||
#include <AzToolsFramework/API/EditorAnimationSystemRequestBus.h>
|
||||
#include <AzToolsFramework/SourceControl/QtSourceControlNotificationHandler.h>
|
||||
#include <AzToolsFramework/PythonTerminal/ScriptTermDialog.h>
|
||||
#include <AzToolsFramework/ViewportSelection/EditorTransformComponentSelectionRequestBus.h>
|
||||
|
||||
// AzQtComponents
|
||||
#include <AzQtComponents/Buses/ShortcutDispatch.h>
|
||||
@@ -731,32 +732,84 @@ void MainWindow::InitActions()
|
||||
.SetStatusTip(tr("Restore saved state (Fetch)"));
|
||||
|
||||
// Modify actions
|
||||
am->AddAction(ID_EDITMODE_MOVE, tr("Move"))
|
||||
am->AddAction(AzToolsFramework::EditModeMove, tr("Move"))
|
||||
.SetIcon(Style::icon("Move"))
|
||||
.SetApplyHoverEffect()
|
||||
.SetShortcut(tr("1"))
|
||||
.SetToolTip(tr("Move (1)"))
|
||||
.SetCheckable(true)
|
||||
.SetStatusTip(tr("Select and move selected object(s)"))
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateEditmodeMove);
|
||||
am->AddAction(ID_EDITMODE_ROTATE, tr("Rotate"))
|
||||
.RegisterUpdateCallback([](QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequests::Mode mode;
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequestBus::EventResult(
|
||||
mode, AzToolsFramework::GetEntityContextId(),
|
||||
&AzToolsFramework::EditorTransformComponentSelectionRequests::GetTransformMode);
|
||||
|
||||
action->setChecked(mode == AzToolsFramework::EditorTransformComponentSelectionRequests::Mode::Translation);
|
||||
})
|
||||
.Connect(
|
||||
&QAction::triggered,
|
||||
[]()
|
||||
{
|
||||
EditorTransformComponentSelectionRequestBus::Event(
|
||||
GetEntityContextId(), &EditorTransformComponentSelectionRequests::SetTransformMode,
|
||||
EditorTransformComponentSelectionRequests::Mode::Translation);
|
||||
});
|
||||
am->AddAction(AzToolsFramework::EditModeRotate, tr("Rotate"))
|
||||
.SetIcon(Style::icon("Translate"))
|
||||
.SetApplyHoverEffect()
|
||||
.SetShortcut(tr("2"))
|
||||
.SetToolTip(tr("Rotate (2)"))
|
||||
.SetCheckable(true)
|
||||
.SetStatusTip(tr("Select and rotate selected object(s)"))
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateEditmodeRotate);
|
||||
am->AddAction(ID_EDITMODE_SCALE, tr("Scale"))
|
||||
.RegisterUpdateCallback([](QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequests::Mode mode;
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequestBus::EventResult(
|
||||
mode, AzToolsFramework::GetEntityContextId(),
|
||||
&AzToolsFramework::EditorTransformComponentSelectionRequests::GetTransformMode);
|
||||
|
||||
action->setChecked(mode == AzToolsFramework::EditorTransformComponentSelectionRequests::Mode::Rotation);
|
||||
})
|
||||
.Connect(
|
||||
&QAction::triggered,
|
||||
[]()
|
||||
{
|
||||
EditorTransformComponentSelectionRequestBus::Event(
|
||||
GetEntityContextId(), &EditorTransformComponentSelectionRequests::SetTransformMode,
|
||||
EditorTransformComponentSelectionRequests::Mode::Rotation);
|
||||
});
|
||||
am->AddAction(AzToolsFramework::EditModeScale, tr("Scale"))
|
||||
.SetIcon(Style::icon("Scale"))
|
||||
.SetApplyHoverEffect()
|
||||
.SetShortcut(tr("3"))
|
||||
.SetToolTip(tr("Scale (3)"))
|
||||
.SetCheckable(true)
|
||||
.SetStatusTip(tr("Select and scale selected object(s)"))
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateEditmodeScale);
|
||||
.RegisterUpdateCallback([](QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
|
||||
am->AddAction(ID_SNAP_TO_GRID, tr("Snap to grid"))
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequests::Mode mode;
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequestBus::EventResult(
|
||||
mode, AzToolsFramework::GetEntityContextId(),
|
||||
&AzToolsFramework::EditorTransformComponentSelectionRequests::GetTransformMode);
|
||||
|
||||
action->setChecked(mode == AzToolsFramework::EditorTransformComponentSelectionRequests::Mode::Scale);
|
||||
})
|
||||
.Connect( &QAction::triggered,[]()
|
||||
{
|
||||
EditorTransformComponentSelectionRequestBus::Event(
|
||||
GetEntityContextId(), &EditorTransformComponentSelectionRequests::SetTransformMode,
|
||||
EditorTransformComponentSelectionRequests::Mode::Scale);
|
||||
});
|
||||
|
||||
am->AddAction(AzToolsFramework::SnapToGrid, tr("Snap to grid"))
|
||||
.SetIcon(Style::icon("Grid"))
|
||||
.SetApplyHoverEffect()
|
||||
.SetShortcut(tr("G"))
|
||||
@@ -769,7 +822,7 @@ void MainWindow::InitActions()
|
||||
})
|
||||
.Connect(&QAction::triggered, []() { SandboxEditor::SetGridSnapping(!SandboxEditor::GridSnappingEnabled()); });
|
||||
|
||||
am->AddAction(ID_SNAPANGLE, tr("Snap angle"))
|
||||
am->AddAction(AzToolsFramework::SnapAngle, tr("Snap angle"))
|
||||
.SetIcon(Style::icon("Angle"))
|
||||
.SetApplyHoverEffect()
|
||||
.SetStatusTip(tr("Snap angle"))
|
||||
|
||||
@@ -59,11 +59,17 @@ namespace AzQtComponents
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
class Ticker;
|
||||
}
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
class QtSourceControlNotificationHandler;
|
||||
|
||||
//! @name Reverse URLs.
|
||||
//! Used to identify common actions and override them when necessary.
|
||||
//@{
|
||||
constexpr inline AZ::Crc32 EditModeMove = AZ_CRC_CE("com.o3de.action.editor.editmode.move");
|
||||
constexpr inline AZ::Crc32 EditModeRotate = AZ_CRC_CE("com.o3de.action.editor.editmode.rotate");
|
||||
constexpr inline AZ::Crc32 EditModeScale = AZ_CRC_CE("com.o3de.action.editor.editmode.scale");
|
||||
constexpr inline AZ::Crc32 SnapToGrid = AZ_CRC_CE("com.o3de.action.editor.snaptogrid");
|
||||
constexpr inline AZ::Crc32 SnapAngle = AZ_CRC_CE("com.o3de.action.editor.snapangle");
|
||||
//@}
|
||||
}
|
||||
|
||||
#define MAINFRM_LAYOUT_NORMAL "NormalLayout"
|
||||
|
||||
@@ -74,12 +74,12 @@ void DisplayContext::DrawTri(const Vec3& p1, const Vec3& p2, const Vec3& p3)
|
||||
|
||||
void DisplayContext::DrawTriangles(const AZStd::vector<Vec3>& vertices, const ColorB& color)
|
||||
{
|
||||
pRenderAuxGeom->DrawTriangles(vertices.begin(), vertices.size(), color);
|
||||
pRenderAuxGeom->DrawTriangles(vertices.begin(), static_cast<uint32>(vertices.size()), color);
|
||||
}
|
||||
|
||||
void DisplayContext::DrawTrianglesIndexed(const AZStd::vector<Vec3>& vertices, const AZStd::vector<vtx_idx>& indices, const ColorB& color)
|
||||
{
|
||||
pRenderAuxGeom->DrawTriangles(vertices.begin(), vertices.size(), indices.begin(), indices.size(), color);
|
||||
pRenderAuxGeom->DrawTriangles(vertices.begin(), static_cast<uint32>(vertices.size()), indices.begin(), static_cast<uint32_t>(indices.size()), color);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -862,7 +862,7 @@ void DisplayContext::DrawLine(const Vec3& p1, const Vec3& p2, const QColor& rgb1
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void DisplayContext::DrawLines(const AZStd::vector<Vec3>& points, const ColorF& color)
|
||||
{
|
||||
pRenderAuxGeom->DrawLines(points.begin(), points.size(), color, m_thickness);
|
||||
pRenderAuxGeom->DrawLines(points.begin(), static_cast<uint32>(points.size()), color, m_thickness);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -1287,8 +1287,8 @@ void DisplayContext::Flush2D()
|
||||
uvs[3] = 0;
|
||||
uvt[3] = 0;
|
||||
|
||||
int nLabels = m_textureLabels.size();
|
||||
for (int i = 0; i < nLabels; i++)
|
||||
const size_t nLabels = m_textureLabels.size();
|
||||
for (size_t i = 0; i < nLabels; i++)
|
||||
{
|
||||
STextureLabel& t = m_textureLabels[i];
|
||||
float w2 = t.w * 0.5f;
|
||||
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Return number of event targets of Script.
|
||||
int GetEventTargetCount() const { return m_eventTargets.size(); };
|
||||
int GetEventTargetCount() const { return static_cast<int>(m_eventTargets.size()); };
|
||||
CEntityEventTarget& GetEventTarget(int index) { return m_eventTargets[index]; };
|
||||
//! Add new event target, returns index of created event target.
|
||||
//! Event targets are Always entities.
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
// Entity Links.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Return number of event targets of Script.
|
||||
int GetEntityLinkCount() const { return m_links.size(); };
|
||||
int GetEntityLinkCount() const { return static_cast<int>(m_links.size()); };
|
||||
CEntityLink& GetEntityLink(int index) { return m_links[index]; };
|
||||
virtual int AddEntityLink(const QString& name, GUID targetEntityId);
|
||||
virtual bool EntityLinkExists(const QString& name, GUID targetEntityId);
|
||||
|
||||
@@ -70,7 +70,7 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
|
||||
CBaseObject* LoadObject(const XmlNodeRef& objNode, CBaseObject* pPrevObject = NULL);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
int GetLoadedObjectsCount() { return m_loadedObjects.size(); }
|
||||
int GetLoadedObjectsCount() { return static_cast<int>(m_loadedObjects.size()); }
|
||||
CBaseObject* GetLoadedObject(int nIndex) const { return m_loadedObjects[nIndex].pObject; }
|
||||
|
||||
//! If true new loaded objects will be assigned new GUIDs.
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
class CBaseObjectsCache
|
||||
{
|
||||
public:
|
||||
int GetObjectCount() const { return m_objects.size(); }
|
||||
int GetObjectCount() const { return static_cast<int>(m_objects.size()); }
|
||||
CBaseObject* GetObject(int nIndex) const { return m_objects[nIndex]; }
|
||||
void AddObject(CBaseObject* object);
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
//! And save resulting objects to saveTo selection.
|
||||
void FilterParents();
|
||||
//! Get number of child filtered objects.
|
||||
int GetFilteredCount() const { return m_filtered.size(); }
|
||||
int GetFilteredCount() const { return static_cast<int>(m_filtered.size()); }
|
||||
CBaseObject* GetFilteredObject(int i) const { return m_filtered[i]; }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -803,7 +803,7 @@ void SandboxIntegrationManager::SetupLayerContextMenu(QMenu* menu)
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
const int selectedLayerCount = layersInSelection.size();
|
||||
const int selectedLayerCount = static_cast<int>(layersInSelection.size());
|
||||
QString saveTitle = QObject::tr("Save layer");
|
||||
if(selectedLayerCount > 1)
|
||||
{
|
||||
|
||||
@@ -259,7 +259,7 @@ QVariant OutlinerListModel::dataForName(const QModelIndex& index, int role) cons
|
||||
if (highlightTextIndex >= 0)
|
||||
{
|
||||
const QString BACKGROUND_COLOR{ "#707070" };
|
||||
label.insert(highlightTextIndex + m_filterString.length(), "</span>");
|
||||
label.insert(static_cast<int>(highlightTextIndex + m_filterString.length()), "</span>");
|
||||
label.insert(highlightTextIndex, "<span style=\"background-color: " + BACKGROUND_COLOR + "\">");
|
||||
}
|
||||
} while(highlightTextIndex > 0);
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace PerforceConnection
|
||||
|
||||
setEnabled(false);
|
||||
|
||||
int numSettingsToGet = m_retrievedSettings.size();
|
||||
int numSettingsToGet = static_cast<int>(m_retrievedSettings.size());
|
||||
|
||||
auto applySettingResultFunction = [this, &numSettingsToGet](AZStd::string setting, const SourceControlSettingInfo& info) -> void
|
||||
{
|
||||
|
||||
@@ -546,7 +546,7 @@ bool CAxisHelper::HitTestForRotationCircle(const Matrix34& worldTM, IDisplayView
|
||||
Vec3 vShortestHitPos;
|
||||
float shortestDist = 3e11f;
|
||||
|
||||
for (int i = 0, iCount(vList.size()); i < iCount; ++i)
|
||||
for (int i = 0, iCount(static_cast<int>(vList.size())); i < iCount; ++i)
|
||||
{
|
||||
const Vec3& v0 = vList[i];
|
||||
const Vec3& v1 = vList[(i + 1) % iCount];
|
||||
|
||||
@@ -2342,7 +2342,7 @@ bool CRenderViewport::AddCameraMenuItems(QMenu* menu)
|
||||
AZ::EBusAggregateResults<AZ::EntityId> getCameraResults;
|
||||
Camera::CameraBus::BroadcastResult(getCameraResults, &Camera::CameraRequests::GetCameras);
|
||||
|
||||
const int numCameras = getCameraResults.values.size();
|
||||
const int numCameras = static_cast<int>(getCameraResults.values.size());
|
||||
|
||||
// only enable if we're editing a sequence in Track View and have cameras in the level
|
||||
bool enableSequenceCameraMenu = (GetIEditor()->GetAnimation()->GetSequence() && numCameras);
|
||||
@@ -2354,7 +2354,7 @@ bool CRenderViewport::AddCameraMenuItems(QMenu* menu)
|
||||
connect(action, &QAction::triggered, this, &CRenderViewport::SetSequenceCamera);
|
||||
|
||||
QVector<QAction*> additionalCameras;
|
||||
additionalCameras.reserve(getCameraResults.values.size());
|
||||
additionalCameras.reserve(static_cast<int>(getCameraResults.values.size()));
|
||||
|
||||
for (const AZ::EntityId& entityId : getCameraResults.values)
|
||||
{
|
||||
@@ -2930,7 +2930,7 @@ void CRenderViewport::RenderSelectedRegion()
|
||||
// Draw volume
|
||||
dc.DepthWriteOff();
|
||||
dc.CullOff();
|
||||
dc.pRenderAuxGeom->DrawTriangles(&verts[0], verts.size(), &inds[0], numInds, &colors[0]);
|
||||
dc.pRenderAuxGeom->DrawTriangles(&verts[0], static_cast<uint32>(verts.size()), &inds[0], numInds, &colors[0]);
|
||||
dc.CullOn();
|
||||
dc.DepthWriteOn();
|
||||
}
|
||||
|
||||
@@ -275,19 +275,19 @@ public:
|
||||
m_relCameraRotX = 0;
|
||||
m_relCameraRotZ = 0;
|
||||
|
||||
uint32 numSample6 = m_arrAnimatedCharacterPath.size();
|
||||
uint32 numSample6 = static_cast<uint32>(m_arrAnimatedCharacterPath.size());
|
||||
for (uint32 i = 0; i < numSample6; i++)
|
||||
{
|
||||
m_arrAnimatedCharacterPath[i] = Vec3(ZERO);
|
||||
}
|
||||
|
||||
numSample6 = m_arrSmoothEntityPath.size();
|
||||
numSample6 = static_cast<uint32>(m_arrSmoothEntityPath.size());
|
||||
for (uint32 i = 0; i < numSample6; i++)
|
||||
{
|
||||
m_arrSmoothEntityPath[i] = Vec3(ZERO);
|
||||
}
|
||||
|
||||
uint32 numSample7 = m_arrRunStrafeSmoothing.size();
|
||||
uint32 numSample7 = static_cast<uint32>(m_arrRunStrafeSmoothing.size());
|
||||
for (uint32 i = 0; i < numSample7; i++)
|
||||
{
|
||||
m_arrRunStrafeSmoothing[i] = 0;
|
||||
|
||||
@@ -82,7 +82,6 @@
|
||||
#define ID_TOOLS_CUSTOMIZEKEYBOARD 32914
|
||||
#define ID_EXPORT_INDOORS 32915
|
||||
#define ID_VIEW_CYCLE2DVIEWPORT 32916
|
||||
#define ID_SNAPANGLE 32917
|
||||
#define ID_PHYSICS_GETPHYSICSSTATE 32937
|
||||
#define ID_PHYSICS_RESETPHYSICSSTATE 32938
|
||||
#define ID_GAME_SYNCPLAYER 32941
|
||||
@@ -108,9 +107,6 @@
|
||||
#define ID_MOVE_OBJECT 33481
|
||||
#define ID_RENAME_OBJ 33483
|
||||
#define ID_FETCH 33496
|
||||
#define ID_EDITMODE_ROTATE 33506
|
||||
#define ID_EDITMODE_SCALE 33507
|
||||
#define ID_EDITMODE_MOVE 33508
|
||||
#define ID_SELECTION_DELETE 33512
|
||||
#define ID_EDIT_ESCAPE 33513
|
||||
#define ID_UNDO 33524
|
||||
@@ -137,7 +133,6 @@
|
||||
#define ID_ADDNODE 33570
|
||||
#define ID_ADDSCENETRACK 33573
|
||||
#define ID_FIND 33574
|
||||
#define ID_SNAP_TO_GRID 33575
|
||||
#define ID_TAG_LOC1 33576
|
||||
#define ID_TAG_LOC2 33577
|
||||
#define ID_TAG_LOC3 33578
|
||||
|
||||
@@ -189,6 +189,7 @@ SEditorSettings::SEditorSettings()
|
||||
|
||||
consoleBackgroundColorTheme = AzToolsFramework::ConsoleColorTheme::Dark;
|
||||
bShowTimeInConsole = false;
|
||||
clearConsoleOnGameModeStart = false;
|
||||
|
||||
enableSceneInspector = false;
|
||||
|
||||
@@ -528,6 +529,8 @@ void SEditorSettings::Save()
|
||||
|
||||
SaveValue("Settings", "ConsoleBackgroundColorThemeV2", (int)consoleBackgroundColorTheme);
|
||||
|
||||
SaveValue("Settings", "ClearConsoleOnGameModeStart", clearConsoleOnGameModeStart);
|
||||
|
||||
SaveValue("Settings", "ShowTimeInConsole", bShowTimeInConsole);
|
||||
|
||||
SaveValue("Settings", "EnableSceneInspector", enableSceneInspector);
|
||||
@@ -747,6 +750,8 @@ void SEditorSettings::Load()
|
||||
consoleBackgroundColorTheme = AzToolsFramework::ConsoleColorTheme::Dark;
|
||||
}
|
||||
|
||||
LoadValue("Settings", "ClearConsoleOnGameModeStart", clearConsoleOnGameModeStart);
|
||||
|
||||
LoadValue("Settings", "ShowTimeInConsole", bShowTimeInConsole);
|
||||
|
||||
LoadValue("Settings", "EnableSceneInspector", enableSceneInspector);
|
||||
@@ -1085,7 +1090,7 @@ void SEditorSettings::ConvertPath(const AZStd::string_view sourcePath, AZStd::st
|
||||
|
||||
AzToolsFramework::EditorSettingsAPIRequests::SettingOutcome SEditorSettings::GetValue(const AZStd::string_view path)
|
||||
{
|
||||
if (path.find("|") < 0)
|
||||
if (path.find("|") == AZStd::string_view::npos)
|
||||
{
|
||||
return { AZStd::string("Invalid Path - could not find separator \"|\"") };
|
||||
}
|
||||
@@ -1103,7 +1108,7 @@ AzToolsFramework::EditorSettingsAPIRequests::SettingOutcome SEditorSettings::Get
|
||||
|
||||
AzToolsFramework::EditorSettingsAPIRequests::SettingOutcome SEditorSettings::SetValue(const AZStd::string_view path, const AZStd::any& value)
|
||||
{
|
||||
if (path.find("|") < 0)
|
||||
if (path.find("|") == AZStd::string_view::npos)
|
||||
{
|
||||
return { AZStd::string("Invalid Path - could not find separator \"|\"") };
|
||||
}
|
||||
|
||||
@@ -388,6 +388,7 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
|
||||
|
||||
//! Source Control Enabling.
|
||||
bool enableSourceControl;
|
||||
bool clearConsoleOnGameModeStart;
|
||||
|
||||
//! Text editor.
|
||||
QString textEditorForScript;
|
||||
|
||||
@@ -27,7 +27,7 @@ class QWidget;
|
||||
class CTrackViewAnimNodeBundle
|
||||
{
|
||||
public:
|
||||
unsigned int GetCount() const { return m_animNodes.size(); }
|
||||
unsigned int GetCount() const { return static_cast<unsigned int>(m_animNodes.size()); }
|
||||
CTrackViewAnimNode* GetNode(const unsigned int index) { return m_animNodes[index]; }
|
||||
const CTrackViewAnimNode* GetNode(const unsigned int index) const { return m_animNodes[index]; }
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
|
||||
virtual bool AreAllKeysOfSameType() const override { return m_bAllOfSameType; }
|
||||
|
||||
virtual unsigned int GetKeyCount() const override { return m_keys.size(); }
|
||||
virtual unsigned int GetKeyCount() const override { return static_cast<unsigned int>(m_keys.size()); }
|
||||
virtual CTrackViewKeyHandle GetKey(unsigned int index) override { return m_keys[index]; }
|
||||
|
||||
virtual void SelectKeys(const bool bSelected) override;
|
||||
@@ -174,7 +174,7 @@ public:
|
||||
CTrackViewNode* GetParentNode() const { return m_pParentNode; }
|
||||
|
||||
// Children
|
||||
unsigned int GetChildCount() const { return m_childNodes.size(); }
|
||||
unsigned int GetChildCount() const { return static_cast<unsigned int>(m_childNodes.size()); }
|
||||
CTrackViewNode* GetChild(unsigned int index) const { return m_childNodes[index].get(); }
|
||||
|
||||
// Snap time value to prev/next key in sequence
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
|
||||
virtual void OnEditorNotifyEvent(EEditorNotifyEvent event);
|
||||
|
||||
unsigned int GetCount() const { return m_sequences.size(); }
|
||||
unsigned int GetCount() const { return static_cast<int>(m_sequences.size()); }
|
||||
|
||||
void CreateSequence(QString name, SequenceType sequenceType);
|
||||
void DeleteSequence(CTrackViewSequence* pSequence);
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
: m_bAllOfSameType(true)
|
||||
, m_bHasRotationTrack(false) {}
|
||||
|
||||
unsigned int GetCount() const { return m_tracks.size(); }
|
||||
unsigned int GetCount() const { return static_cast<unsigned int>(m_tracks.size()); }
|
||||
CTrackViewTrack* GetTrack(const unsigned int index) { return m_tracks[index]; }
|
||||
const CTrackViewTrack* GetTrack(const unsigned int index) const { return m_tracks[index]; }
|
||||
|
||||
|
||||
@@ -61,12 +61,12 @@ public:
|
||||
// Confetti: Get the size of m_undoObjects
|
||||
virtual int GetCount() const
|
||||
{
|
||||
return m_undoObjects.size();
|
||||
return static_cast<int>(m_undoObjects.size());
|
||||
}
|
||||
virtual bool IsEmpty() const { return m_undoObjects.empty(); };
|
||||
virtual void Undo(bool bUndo)
|
||||
{
|
||||
for (int i = m_undoObjects.size() - 1; i >= 0; i--)
|
||||
for (int i = static_cast<int>(m_undoObjects.size() - 1); i >= 0; i--)
|
||||
{
|
||||
m_undoObjects[i]->Undo(bUndo);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Get number of currently existing viewports.
|
||||
virtual int GetViewCount() { return m_viewports.size(); };
|
||||
virtual int GetViewCount() { return static_cast<int>(m_viewports.size()); };
|
||||
//! Get viewport by index.
|
||||
//! @param index 0 <= index < GetViewportCount()
|
||||
virtual CViewport* GetView(int index) { return m_viewports[index]; }
|
||||
|
||||
@@ -953,13 +953,13 @@ void CViewportTitleDlg::CheckForCameraSpeedUpdate()
|
||||
void CViewportTitleDlg::OnGridSnappingToggled()
|
||||
{
|
||||
m_gridSizeActionWidget->setEnabled(m_enableGridSnappingAction->isChecked());
|
||||
MainWindow::instance()->GetActionManager()->GetAction(ID_SNAP_TO_GRID)->trigger();
|
||||
MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapToGrid)->trigger();
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnAngleSnappingToggled()
|
||||
{
|
||||
m_angleSizeActionWidget->setEnabled(m_enableAngleSnappingAction->isChecked());
|
||||
MainWindow::instance()->GetActionManager()->GetAction(ID_SNAPANGLE)->trigger();
|
||||
MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapAngle)->trigger();
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnGridSpinBoxChanged(double value)
|
||||
@@ -974,14 +974,14 @@ void CViewportTitleDlg::OnAngleSpinBoxChanged(double value)
|
||||
|
||||
void CViewportTitleDlg::UpdateOverFlowMenuState()
|
||||
{
|
||||
bool gridSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(ID_SNAP_TO_GRID)->isChecked();
|
||||
bool gridSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapToGrid)->isChecked();
|
||||
{
|
||||
QSignalBlocker signalBlocker(m_enableGridSnappingAction);
|
||||
m_enableGridSnappingAction->setChecked(gridSnappingActive);
|
||||
}
|
||||
m_gridSizeActionWidget->setEnabled(gridSnappingActive);
|
||||
|
||||
bool angleSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(ID_SNAPANGLE)->isChecked();
|
||||
bool angleSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapAngle)->isChecked();
|
||||
{
|
||||
QSignalBlocker signalBlocker(m_enableAngleSnappingAction);
|
||||
m_enableAngleSnappingAction->setChecked(angleSnappingActive);
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace AZ
|
||||
}
|
||||
|
||||
auto stackEntry = AZStd::make_shared<BlockCache>(
|
||||
cacheSize, blockSize, aznumeric_caster(hardware.m_maxPhysicalSectorSize), false);
|
||||
cacheSize, aznumeric_cast<AZ::u32>(blockSize), aznumeric_cast<AZ::u32>(hardware.m_maxPhysicalSectorSize), false);
|
||||
stackEntry->SetNext(AZStd::move(parent));
|
||||
return stackEntry;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace AZ
|
||||
}
|
||||
|
||||
auto stackEntry = AZStd::make_shared<DedicatedCache>(
|
||||
cacheSize, blockSize, aznumeric_caster(hardware.m_maxPhysicalSectorSize), m_writeOnlyEpilog);
|
||||
cacheSize, aznumeric_cast<AZ::u32>(blockSize), aznumeric_cast<AZ::u32>(hardware.m_maxPhysicalSectorSize), m_writeOnlyEpilog);
|
||||
stackEntry->SetNext(AZStd::move(parent));
|
||||
return stackEntry;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace AZ
|
||||
static Aabb CreateCenterRadius(const Vector3& center, float radius);
|
||||
|
||||
//! Creates an AABB which contains the specified points.
|
||||
static Aabb CreatePoints(const Vector3* pts, int numPts);
|
||||
static Aabb CreatePoints(const Vector3* pts, size_t numPts);
|
||||
|
||||
//! Creates an AABB which contains the specified OBB.
|
||||
static Aabb CreateFromObb(const Obb& obb);
|
||||
|
||||
@@ -60,10 +60,10 @@ namespace AZ
|
||||
}
|
||||
|
||||
|
||||
AZ_MATH_INLINE Aabb Aabb::CreatePoints(const Vector3* pts, int numPts)
|
||||
AZ_MATH_INLINE Aabb Aabb::CreatePoints(const Vector3* pts, size_t numPts)
|
||||
{
|
||||
Aabb aabb = Aabb::CreateFromPoint(pts[0]);
|
||||
for (int i = 1; i < numPts; ++i)
|
||||
for (size_t i = 1; i < numPts; ++i)
|
||||
{
|
||||
aabb.AddPoint(pts[i]);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <AzCore/Memory/OSAllocator.h>
|
||||
#include <AzCore/std/containers/unordered_map.h>
|
||||
#include <AzCore/Math/Crc.h>
|
||||
#include <AzCore/std/parallel/scoped_lock.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -75,6 +76,42 @@ namespace AZ
|
||||
bool operator==(const OSStdAllocator& a, const OSStdAllocator& b) { (void)a; (void)b; return true; }
|
||||
bool operator!=(const OSStdAllocator& a, const OSStdAllocator& b) { (void)a; (void)b; return false; }
|
||||
|
||||
void EnvironmentVariableHolderBase::UnregisterAndDestroy(DestructFunc destruct, bool moduleRelease)
|
||||
{
|
||||
const bool releaseByUseCount = (--m_useCount == 0);
|
||||
// We take over the lock, and release it before potentially destroying/freeing ourselves
|
||||
{
|
||||
AZStd::scoped_lock envLockHolder(AZStd::adopt_lock, m_mutex);
|
||||
const bool releaseByModule = (moduleRelease && !m_canTransferOwnership && m_moduleOwner == AZ::Environment::GetModuleId());
|
||||
|
||||
if (!releaseByModule && !releaseByUseCount)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// if the environment that created us is gone the owner can be null
|
||||
// which means (assuming intermodule allocator) that the variable is still alive
|
||||
// but can't be found as it's not part of any environment.
|
||||
if (m_environmentOwner)
|
||||
{
|
||||
m_environmentOwner->RemoveVariable(m_guid);
|
||||
m_environmentOwner = nullptr;
|
||||
}
|
||||
if (m_isConstructed)
|
||||
{
|
||||
destruct(this, DestroyTarget::Member); // destruct the value
|
||||
}
|
||||
}
|
||||
// m_mutex is no longer held here, envLockHolder has released it above.
|
||||
if (releaseByUseCount)
|
||||
{
|
||||
// m_mutex is unlocked before this is deleted
|
||||
Environment::AllocatorInterface* allocator = m_allocator;
|
||||
// Call child class dtor and clear the memory
|
||||
destruct(this, DestroyTarget::Self);
|
||||
allocator->DeAllocate(this);
|
||||
}
|
||||
}
|
||||
|
||||
// instance of the environment
|
||||
EnvironmentInterface* EnvironmentInterface::s_environment = nullptr;
|
||||
|
||||
@@ -110,7 +147,7 @@ namespace AZ
|
||||
#ifdef AZ_ENVIRONMENT_VALIDATE_ON_EXIT
|
||||
AZ_Assert(m_numAttached == 0, "We should not delete an environment while there are %d modules attached! Unload all DLLs first!", m_numAttached);
|
||||
#endif
|
||||
|
||||
|
||||
for (auto variableIt : m_variableMap)
|
||||
{
|
||||
EnvironmentVariableHolderBase* holder = reinterpret_cast<EnvironmentVariableHolderBase*>(variableIt.second);
|
||||
|
||||
@@ -200,6 +200,11 @@ namespace AZ
|
||||
class EnvironmentVariableHolderBase
|
||||
{
|
||||
friend class EnvironmentImpl;
|
||||
protected:
|
||||
enum class DestroyTarget {
|
||||
Member,
|
||||
Self
|
||||
};
|
||||
public:
|
||||
EnvironmentVariableHolderBase(u32 guid, AZ::Internal::EnvironmentInterface* environmentOwner, bool canOwnershipTransfer, Environment::AllocatorInterface* allocator)
|
||||
: m_environmentOwner(environmentOwner)
|
||||
@@ -217,12 +222,21 @@ namespace AZ
|
||||
return m_isConstructed;
|
||||
}
|
||||
|
||||
bool IsOwner() const
|
||||
{
|
||||
return m_moduleOwner == Environment::GetModuleId();
|
||||
}
|
||||
|
||||
u32 GetId() const
|
||||
{
|
||||
return m_guid;
|
||||
}
|
||||
|
||||
protected:
|
||||
using DestructFunc = void (*)(EnvironmentVariableHolderBase *, DestroyTarget);
|
||||
// Assumes the m_mutex is already locked.
|
||||
// On return m_mutex is in an unlocked state.
|
||||
void UnregisterAndDestroy(DestructFunc destruct, bool moduleRelease);
|
||||
|
||||
AZ::Internal::EnvironmentInterface* m_environmentOwner; ///< Used to know which environment we should use to free the variable if we can't transfer ownership
|
||||
void* m_moduleOwner; ///< Used when the variable can't transfered across module and we need to destruct the variable when the module is going away
|
||||
bool m_canTransferOwnership; ///< True if variable can be allocated in one module and freed in other. Usually true for POD types when they share allocator.
|
||||
@@ -242,41 +256,29 @@ namespace AZ
|
||||
memset(&m_value, 0, sizeof(T));
|
||||
}
|
||||
|
||||
template <class... Args>
|
||||
template<class... Args>
|
||||
void ConstructImpl(const AZStd::false_type& /* AZStd::has_trivial_constructor<T> */, Args&&... args)
|
||||
{
|
||||
// Construction of non-trivial types is left up to the type's constructor.
|
||||
new(&m_value) T(AZStd::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
void DestructImpl(const AZStd::true_type& /* AZStd::is_trivially_destructible<T> */)
|
||||
static void DestructDispatchNoLock(EnvironmentVariableHolderBase *base, DestroyTarget selfDestruct)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void DestructImpl(const AZStd::false_type& /* AZStd::is_trivially_destructible<T> */)
|
||||
{
|
||||
reinterpret_cast<T*>(&m_value)->~T();
|
||||
}
|
||||
|
||||
// Assumes the lock is already held
|
||||
void UnregisterAndDestruct()
|
||||
{
|
||||
// if the environment that created us is gone the owner can be null
|
||||
// which means (assuming intermodule allocator) that the variable is still alive
|
||||
// but can't be found as it's not part of any environment.
|
||||
if (m_environmentOwner)
|
||||
auto *self = reinterpret_cast<EnvironmentVariableHolder *>(base);
|
||||
if (selfDestruct == DestroyTarget::Self)
|
||||
{
|
||||
m_environmentOwner->RemoveVariable(m_guid);
|
||||
m_environmentOwner = nullptr;
|
||||
self->~EnvironmentVariableHolder();
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_isConstructed)
|
||||
AZ_Assert(self->m_isConstructed, "Variable is not constructed. Please check your logic and guard if needed!");
|
||||
self->m_isConstructed = false;
|
||||
self->m_moduleOwner = nullptr;
|
||||
if constexpr(!AZStd::is_trivially_destructible_v<T>)
|
||||
{
|
||||
DestructNoLock();
|
||||
reinterpret_cast<T*>(&self->m_value)->~T();
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
EnvironmentVariableHolder(u32 guid, bool isOwnershipTransfer, Environment::AllocatorInterface* allocator)
|
||||
: EnvironmentVariableHolderBase(guid, Environment::GetInstance(), isOwnershipTransfer, allocator)
|
||||
@@ -287,12 +289,6 @@ namespace AZ
|
||||
{
|
||||
AZ_Assert(!m_isConstructed, "To get the destructor we should have already destructed the variable!");
|
||||
}
|
||||
|
||||
bool IsOwner() const
|
||||
{
|
||||
return m_moduleOwner == Environment::GetModuleId();
|
||||
}
|
||||
|
||||
void AddRef()
|
||||
{
|
||||
AZStd::lock_guard<AZStd::spin_mutex> lock(m_mutex);
|
||||
@@ -303,30 +299,8 @@ namespace AZ
|
||||
void Release()
|
||||
{
|
||||
m_mutex.lock();
|
||||
|
||||
if (--s_moduleUseCount == 0)
|
||||
{
|
||||
if (!m_canTransferOwnership && m_moduleOwner == AZ::Environment::GetModuleId())
|
||||
{
|
||||
UnregisterAndDestruct();
|
||||
}
|
||||
}
|
||||
|
||||
if (--m_useCount == 0)
|
||||
{
|
||||
UnregisterAndDestruct();
|
||||
|
||||
// unlock before this is deleted
|
||||
m_mutex.unlock();
|
||||
|
||||
Environment::AllocatorInterface* allocator = m_allocator;
|
||||
// Call dtor and clear the memory
|
||||
this->~EnvironmentVariableHolder();
|
||||
allocator->DeAllocate(this);
|
||||
return;
|
||||
}
|
||||
|
||||
m_mutex.unlock();
|
||||
const bool moduleRelease = (--s_moduleUseCount == 0);
|
||||
UnregisterAndDestroy(DestructDispatchNoLock, moduleRelease);
|
||||
}
|
||||
|
||||
void Construct()
|
||||
@@ -352,18 +326,10 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
void DestructNoLock()
|
||||
{
|
||||
AZ_Assert(m_isConstructed, "Variable is not constructed. Please check your logic and guard if needed!");
|
||||
m_isConstructed = false;
|
||||
m_moduleOwner = nullptr;
|
||||
DestructImpl(typename AZStd::is_trivially_destructible<T>::type());
|
||||
}
|
||||
|
||||
void Destruct()
|
||||
{
|
||||
AZStd::lock_guard<AZStd::spin_mutex> lock(m_mutex);
|
||||
DestructNoLock();
|
||||
DestructDispatchNoLock(this, DestroyTarget::Member);
|
||||
}
|
||||
|
||||
// variable storage
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace AZ
|
||||
if (context.ShouldKeepDefaults() || !defaultValue || (valAsByteStream != *static_cast<const JsonByteStream*>(defaultValue)))
|
||||
{
|
||||
const auto base64ByteStream = AZ::StringFunc::Base64::Encode(valAsByteStream.data(), valAsByteStream.size());
|
||||
outputValue.SetString(base64ByteStream.c_str(), base64ByteStream.size(), context.GetJsonAllocator());
|
||||
outputValue.SetString(base64ByteStream.c_str(), static_cast<rapidjson::SizeType>(base64ByteStream.size()), context.GetJsonAllocator());
|
||||
return context.Report(Tasks::WriteValue, Outcomes::Success, "ByteStream successfully stored.");
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace AZStd
|
||||
// 20.9.3.2, observer:
|
||||
constexpr rep count() const { return m_rep; }
|
||||
// 20.9.3.3, arithmetic:
|
||||
constexpr duration operator+() const { *this; }
|
||||
constexpr duration operator+() const { return *this; }
|
||||
constexpr duration operator-() const { return duration(-m_rep); }
|
||||
constexpr duration& operator++() { ++m_rep; return *this; }
|
||||
constexpr duration operator++(int) { return duration(m_rep++); }
|
||||
|
||||
@@ -1056,7 +1056,7 @@ namespace AZStd
|
||||
inline void insert(const iterator& pos, ForwardIterator first, ForwardIterator last, const AZStd::forward_iterator_tag&)
|
||||
{
|
||||
size_type size = AZStd::distance(first, last);
|
||||
AZSTD_CONTAINER_ASSERT(size >= 0, "AZStd::ring_buffer::insert - there are no elements to insert!");
|
||||
AZSTD_CONTAINER_ASSERT(first > last, "AZStd::ring_buffer::insert - there are no elements to insert!");
|
||||
if (size == 0)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -294,7 +294,7 @@ namespace AZStd
|
||||
T& m_v;
|
||||
constexpr addr_impl_ref(T& v)
|
||||
: m_v(v) {}
|
||||
constexpr addr_impl_ref& operator=(const addr_impl_ref& v) { m_v = v; }
|
||||
constexpr addr_impl_ref& operator=(const addr_impl_ref& v) { m_v = v; return *this; }
|
||||
constexpr operator T& () const { return m_v; }
|
||||
};
|
||||
|
||||
|
||||
@@ -163,7 +163,11 @@ namespace AzFramework
|
||||
AZ_TracePrintfOnce("AssetSystemComponent", "Failed to find asset platform, setting 'pc'\n");
|
||||
outputConnectionSettings.m_assetPlatform = "pc";
|
||||
}
|
||||
outputConnectionSettings.m_assetPlatform = assetsPlatform;
|
||||
else
|
||||
{
|
||||
outputConnectionSettings.m_assetPlatform = assetsPlatform;
|
||||
}
|
||||
|
||||
if (outputConnectionSettings.m_assetPlatform.empty())
|
||||
{
|
||||
assetsPlatform = AzFramework::OSPlatformToDefaultAssetPlatform(AZ_TRAIT_OS_PLATFORM_CODENAME);
|
||||
|
||||
@@ -227,8 +227,10 @@ namespace AzFramework
|
||||
|
||||
EntitySpawnTicket::EntitySpawnTicket(EntitySpawnTicket&& rhs)
|
||||
: m_payload(rhs.m_payload)
|
||||
, m_id(rhs.m_id)
|
||||
{
|
||||
rhs.m_payload = nullptr;
|
||||
rhs.m_id = 0;
|
||||
}
|
||||
|
||||
EntitySpawnTicket::EntitySpawnTicket(AZ::Data::Asset<Spawnable> spawnable)
|
||||
|
||||
+1
-1
@@ -269,7 +269,7 @@ namespace AzFramework
|
||||
int numEnvironmentVars = 0;
|
||||
if (processLaunchInfo.m_environmentVariables)
|
||||
{
|
||||
const int numEnvironmentVars = processLaunchInfo.m_environmentVariables->size();
|
||||
numEnvironmentVars = processLaunchInfo.m_environmentVariables->size();
|
||||
// Adding one more as exec expects the array to have a nullptr as the last element
|
||||
environmentVariables = new char*[numEnvironmentVars + 1];
|
||||
for (int i = 0; i < numEnvironmentVars; i++)
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace UnitTest
|
||||
// If an entry is removed from the octree as an unintended side effect of updating an existing entry,
|
||||
// GetEntryCount can't be relied upon to report the actual entry count.
|
||||
// So manually count the entries when using the entry count for validation.
|
||||
uint32_t manualEntryCount = 0;
|
||||
size_t manualEntryCount = 0;
|
||||
visScene->EnumerateNoCull([&manualEntryCount](const AzFramework::IVisibilityScene::NodeData& nodeData) { manualEntryCount += nodeData.m_entries.size(); });
|
||||
|
||||
EXPECT_EQ(manualEntryCount, expectedEntryCount);
|
||||
@@ -409,7 +409,7 @@ namespace UnitTest
|
||||
}
|
||||
|
||||
// Expect all the entries to be in the scene
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, visEntries.size());
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, static_cast<uint32_t>(visEntries.size()));
|
||||
|
||||
// Update them, without making any actual changes
|
||||
for (AzFramework::VisibilityEntry& entry : visEntries)
|
||||
@@ -418,6 +418,6 @@ namespace UnitTest
|
||||
}
|
||||
|
||||
// Expect all the entries to be in the scene
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, visEntries.size());
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, static_cast<uint32_t>(visEntries.size()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,6 +366,24 @@ namespace UnitTest
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(SpawnableEntitiesManagerTest, EntitySpawnTicket_Move_Works)
|
||||
{
|
||||
AzFramework::EntitySpawnTicket ticket1(*m_spawnableAsset);
|
||||
AzFramework::EntitySpawnTicket ticket2(*m_spawnableAsset);
|
||||
|
||||
const AzFramework::EntitySpawnTicket::Id ticket1Id = ticket1.GetId();
|
||||
const AzFramework::EntitySpawnTicket::Id ticket2Id = ticket2.GetId();
|
||||
|
||||
AzFramework::EntitySpawnTicket ticketMoveConstructor(AZStd::move(ticket1));
|
||||
EXPECT_TRUE(ticketMoveConstructor.IsValid());
|
||||
EXPECT_EQ(ticketMoveConstructor.GetId(), ticket1Id);
|
||||
|
||||
AzFramework::EntitySpawnTicket ticketMoveOperator;
|
||||
ticketMoveOperator = AZStd::move(ticket2);
|
||||
EXPECT_TRUE(ticketMoveOperator.IsValid());
|
||||
EXPECT_EQ(ticketMoveOperator.GetId(), ticket2Id);
|
||||
}
|
||||
|
||||
TEST_F(SpawnableEntitiesManagerTest, SpawnAllEntities_DeleteTicketBeforeCall_NoCrash)
|
||||
{
|
||||
{
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace AzNetworking
|
||||
}
|
||||
timeoutItem->UpdateTimeoutTime(startTimeMs);
|
||||
|
||||
NetworkOutputSerializer serializer(buffer.GetBuffer(), buffer.GetSize());
|
||||
NetworkOutputSerializer serializer(buffer.GetBuffer(), static_cast<uint32_t>(buffer.GetSize()));
|
||||
if (m_state == ConnectionState::Connecting)
|
||||
{
|
||||
const ConnectResult connectResult = m_networkInterface.GetConnectionListener().ValidateConnect(GetRemoteAddress(), header, serializer);
|
||||
@@ -198,7 +198,7 @@ namespace AzNetworking
|
||||
{
|
||||
TcpPacketEncodingBuffer buffer;
|
||||
{
|
||||
NetworkInputSerializer serializer(buffer.GetBuffer(), buffer.GetCapacity());
|
||||
NetworkInputSerializer serializer(buffer.GetBuffer(), static_cast<uint32_t>(buffer.GetCapacity()));
|
||||
if (!const_cast<IPacket&>(packet).Serialize(serializer))
|
||||
{
|
||||
AZ_Assert(false, "SendReliablePacket: Unable to serialize packet [Type: %d]", packet.GetPacketType());
|
||||
@@ -272,7 +272,7 @@ namespace AzNetworking
|
||||
{
|
||||
TcpPacketHeader header(packetType, aznumeric_cast<uint16_t>(payloadBuffer.GetSize()));
|
||||
header.SetPacketFlag(PacketFlag::Compressed, shouldCompress);
|
||||
NetworkInputSerializer serializer(headerBuffer.GetBuffer(), headerBuffer.GetCapacity());
|
||||
NetworkInputSerializer serializer(headerBuffer.GetBuffer(), static_cast<uint32_t>(headerBuffer.GetCapacity()));
|
||||
if (!header.Serialize(serializer))
|
||||
{
|
||||
return false;
|
||||
@@ -313,7 +313,7 @@ namespace AzNetworking
|
||||
m_networkInterface.GetMetrics().m_sendBytesCompressedDelta += (payloadSize - compressionMemBytesUsed);
|
||||
|
||||
writeBuffer.Resize(aznumeric_cast<int32_t>(compressionMemBytesUsed));
|
||||
payloadSize = writeBuffer.GetSize();
|
||||
payloadSize = static_cast<uint32_t>(writeBuffer.GetSize());
|
||||
srcData = writeBuffer.GetBuffer();
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace AzNetworking
|
||||
{
|
||||
template <uint32_t SIZE>
|
||||
inline TcpRingBuffer<SIZE>::TcpRingBuffer()
|
||||
: m_impl(m_buffer.data(), m_buffer.size())
|
||||
: m_impl(m_buffer.data(), static_cast<uint32_t>(m_buffer.size()))
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace AzNetworking
|
||||
if (dtlsData.GetSize() > 0)
|
||||
{
|
||||
const uint8_t* encryptedData = dtlsData.GetBuffer();
|
||||
const uint32_t encryptedSize = dtlsData.GetSize();
|
||||
const uint32_t encryptedSize = static_cast<uint32_t>(dtlsData.GetSize());
|
||||
BIO_write(m_readBio, encryptedData, encryptedSize);
|
||||
}
|
||||
DtlsEndpoint::HandshakeState prevState = m_state;
|
||||
@@ -196,7 +196,7 @@ namespace AzNetworking
|
||||
// Need to do this... connection negotiation may have left data in the write bio that we need to send out
|
||||
if (BIO_ctrl_pending(m_writeBio) > 0)
|
||||
{
|
||||
const uint32_t maxBufferSize = outHandshakeData.GetCapacity();
|
||||
const uint32_t maxBufferSize = static_cast<uint32_t>(outHandshakeData.GetCapacity());
|
||||
outHandshakeData.Resize(maxBufferSize);
|
||||
const int32_t dataSize = BIO_read(m_writeBio, outHandshakeData.GetBuffer(), maxBufferSize);
|
||||
outHandshakeData.Resize(dataSize);
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace AzNetworking
|
||||
return true;
|
||||
}
|
||||
|
||||
totalPacketSize += packetFragments[index]->GetChunkBuffer().GetSize();
|
||||
totalPacketSize += static_cast<uint32_t>(packetFragments[index]->GetChunkBuffer().GetSize());
|
||||
}
|
||||
|
||||
// We now mark this sequence as delivered, so if by some chance all the individual chunks get redelivered again we don't double deliver the reconstructed packet
|
||||
@@ -125,7 +125,7 @@ namespace AzNetworking
|
||||
uint8_t* bufferPointer = buffer.GetBuffer();
|
||||
for (uint32_t index = 0; index < packetFragments.size(); ++index)
|
||||
{
|
||||
const uint32_t chunkSize = packetFragments[index]->GetChunkBuffer().GetSize();
|
||||
const uint32_t chunkSize = static_cast<uint32_t>(packetFragments[index]->GetChunkBuffer().GetSize());
|
||||
memcpy(bufferPointer, packetFragments[index]->GetChunkBuffer().GetBuffer(), chunkSize);
|
||||
bufferPointer += chunkSize;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ namespace AzNetworking
|
||||
// We can erase all the chunks now, packet is completed
|
||||
m_packetFragments.erase(fragmentSequence);
|
||||
|
||||
NetworkOutputSerializer networkSerializer(buffer.GetBuffer(), buffer.GetSize());
|
||||
NetworkOutputSerializer networkSerializer(buffer.GetBuffer(), static_cast<uint32_t>(buffer.GetSize()));
|
||||
{
|
||||
ISerializer& networkISerializer = networkSerializer; // To get the default typeinfo parameters in ISerializer
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ namespace AzNetworking
|
||||
continue;
|
||||
}
|
||||
decodedPacketData = m_decompressBuffer.GetBuffer();
|
||||
decodedPacketSize = m_decompressBuffer.GetSize();
|
||||
decodedPacketSize = static_cast<int32_t>(m_decompressBuffer.GetSize());
|
||||
}
|
||||
GetMetrics().m_recvBytesUncompressed += decodedPacketSize;
|
||||
|
||||
@@ -504,7 +504,7 @@ namespace AzNetworking
|
||||
{
|
||||
buffer.Resize(buffer.GetCapacity());
|
||||
|
||||
NetworkInputSerializer networkSerializer(buffer.GetBuffer(), buffer.GetCapacity());
|
||||
NetworkInputSerializer networkSerializer(buffer.GetBuffer(), static_cast<uint32_t>(buffer.GetCapacity()));
|
||||
ISerializer& serializer = networkSerializer; // To get the default typeinfo parameters in ISerializer
|
||||
|
||||
if (!header.SerializePacketFlags(serializer))
|
||||
@@ -527,7 +527,7 @@ namespace AzNetworking
|
||||
|
||||
buffer.Resize(serializer.GetSize());
|
||||
}
|
||||
uint32_t packetSize = buffer.GetSize();
|
||||
uint32_t packetSize = static_cast<uint32_t>(buffer.GetSize());
|
||||
uint8_t* packetData = buffer.GetBuffer();
|
||||
|
||||
// If the packet doesn't fit within our MTU (minus potential SSL encryption overhead), break it up
|
||||
@@ -559,7 +559,7 @@ namespace AzNetworking
|
||||
UdpPacketEncodingBuffer writeBuffer;
|
||||
if (m_compressor && shouldCompress)
|
||||
{
|
||||
NetworkInputSerializer flagSerializer(writeBuffer.GetBuffer(), writeBuffer.GetCapacity());
|
||||
NetworkInputSerializer flagSerializer(writeBuffer.GetBuffer(), static_cast<uint32_t>(writeBuffer.GetCapacity()));
|
||||
ISerializer& serializer = flagSerializer; // To get the default typeinfo parameters in ISerializer
|
||||
|
||||
header.SetPacketFlag(PacketFlag::Compressed, true);
|
||||
@@ -572,7 +572,7 @@ namespace AzNetworking
|
||||
AZ_Assert(flagSize == 1, "Flag bitfield should serialize to one byte");
|
||||
|
||||
// Compress the packet, make sure to offset by the size of the flag which is now serialized
|
||||
const uint32_t payloadSize = buffer.GetSize() - flagSize;
|
||||
const uint32_t payloadSize = static_cast<uint32_t>(buffer.GetSize() - flagSize);
|
||||
uint8_t* payload = buffer.GetBuffer() + flagSize;
|
||||
const AZStd::size_t maxSizeNeeded = m_compressor->GetMaxCompressedBufferSize(payloadSize);
|
||||
AZStd::size_t compressionMemBytesUsed = 0;
|
||||
@@ -588,7 +588,7 @@ namespace AzNetworking
|
||||
if (compressionMemBytesUsed < payloadSize)
|
||||
{
|
||||
writeBuffer.Resize(aznumeric_cast<int32_t>(flagSize + compressionMemBytesUsed));
|
||||
packetSize = writeBuffer.GetSize();
|
||||
packetSize = static_cast<uint32_t>(writeBuffer.GetSize());
|
||||
packetData = writeBuffer.GetBuffer();
|
||||
// Track byte delta caused by compression
|
||||
GetMetrics().m_sendBytesCompressedDelta += (packetSize - compressionMemBytesUsed);
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace AzNetworking
|
||||
}
|
||||
|
||||
IpAddress address;
|
||||
const uint32_t bufferHead = receiveBuffer.GetSize();
|
||||
const uint32_t bufferHead = static_cast<uint32_t>(receiveBuffer.GetSize());
|
||||
if (bufferHead + MaxUdpTransmissionUnit >= receiveBuffer.GetCapacity())
|
||||
{
|
||||
AZLOG_INFO("Receive buffer full, leaving data on the socket. Size exceeded by %d",
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace AzNetworking
|
||||
#ifdef ENABLE_LATENCY_DEBUG
|
||||
int32_t UdpSocket::SendInternalDeferred(const DeferredData& data) const
|
||||
{
|
||||
return SendInternal(data.m_address, data.m_dataBuffer.GetBuffer(), data.m_dataBuffer.GetSize(), data.m_encrypt, *data.m_dtlsEndpoint);
|
||||
return SendInternal(data.m_address, data.m_dataBuffer.GetBuffer(), static_cast<uint32_t>(data.m_dataBuffer.GetSize()), data.m_encrypt, *data.m_dtlsEndpoint);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace AzToolsFramework
|
||||
SourceControlFileInfo GetSceneSourceControlInfo() override;
|
||||
|
||||
bool AreAnyEntitiesSelected() override { return !m_selectedEntities.empty(); }
|
||||
int GetSelectedEntitiesCount() override { return m_selectedEntities.size(); }
|
||||
int GetSelectedEntitiesCount() override { return static_cast<int>(m_selectedEntities.size()); }
|
||||
const EntityIdList& GetSelectedEntities() override { return m_selectedEntities; }
|
||||
const EntityIdList& GetHighlightedEntities() override { return m_highlightedEntities; }
|
||||
void SetSelectedEntities(const EntityIdList& selectedEntities) override;
|
||||
|
||||
@@ -34,8 +34,6 @@ namespace AzToolsFramework::AssetUtils::Internal
|
||||
return {};
|
||||
}
|
||||
|
||||
const int pathLen = sourceFolder.length() + 1;
|
||||
|
||||
AZ::IO::Path sourceWildcard{ sourceFolder };
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user