Legacy cleanup, part 2 (#3659)
* Legacy cleanup, part 2 There are still things that can be removed, those will be likely done in part three: `The Return of the Cleanup` :) Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Fix windows build Somehow there were some unfixed errors from enabled warnings? I'm unsure if I've pulled repo in unstable state, or those were somehow missed. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
This commit is contained in:
@@ -188,7 +188,7 @@ void CImageHistogramDisplay::paintEvent([[maybe_unused]] QPaintEvent* event)
|
||||
float scale = 0;
|
||||
|
||||
i = static_cast<int>(((float)x / graphWidth) * (kNumColorLevels - 1));
|
||||
i = CLAMP(i, 0, kNumColorLevels - 1);
|
||||
i = AZStd::clamp(i, 0, kNumColorLevels - 1);
|
||||
|
||||
switch (m_drawMode)
|
||||
{
|
||||
@@ -253,7 +253,7 @@ void CImageHistogramDisplay::paintEvent([[maybe_unused]] QPaintEvent* event)
|
||||
for (size_t x = 0, xCount = abs(rcGraph.width()); x < xCount; ++x)
|
||||
{
|
||||
i = static_cast<int>(((float)x / graphWidth) * (kNumColorLevels - 1));
|
||||
i = CLAMP(i, 0, kNumColorLevels - 1);
|
||||
i = AZStd::clamp(i, 0, kNumColorLevels - 1);
|
||||
crtX = static_cast<UINT>(rcGraph.left() + x + 1);
|
||||
scaleR = scaleG = scaleB = scaleA = 0;
|
||||
|
||||
@@ -345,7 +345,7 @@ void CImageHistogramDisplay::paintEvent([[maybe_unused]] QPaintEvent* event)
|
||||
{
|
||||
pos = (float)x / graphWidth;
|
||||
i = static_cast<int>((float)((int)(pos * kNumColorLevels) % aThirdOfNumColorLevels) / aThirdOfNumColorLevels * kNumColorLevels);
|
||||
i = CLAMP(i, 0, kNumColorLevels - 1);
|
||||
i = AZStd::clamp(i, 0, kNumColorLevels - 1);
|
||||
scale = 0;
|
||||
|
||||
// R
|
||||
|
||||
@@ -101,7 +101,7 @@ void CSplineCtrl::PointToTimeValue(const QPoint& point, float& time, float& valu
|
||||
{
|
||||
time = XOfsToTime(point.x());
|
||||
float t = float(m_rcSpline.bottom() - point.y()) / m_rcSpline.height();
|
||||
value = LERP(m_fMinValue, m_fMaxValue, t);
|
||||
value = AZ::Lerp(m_fMinValue, m_fMaxValue, t);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -109,7 +109,7 @@ float CSplineCtrl::XOfsToTime(int x)
|
||||
{
|
||||
// m_fMinTime to m_fMaxTime time range.
|
||||
float t = float(x - m_rcSpline.left()) / m_rcSpline.width();
|
||||
return LERP(m_fMinTime, m_fMaxTime, t);
|
||||
return AZ::Lerp(m_fMinTime, m_fMaxTime, t);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
// CryCommon
|
||||
#include <CryCommon/HMDBus.h>
|
||||
#include <CryCommon/IRenderAuxGeom.h>
|
||||
#include <CryCommon/physinterface.h>
|
||||
|
||||
// AzFramework
|
||||
#include <AzFramework/Render/IntersectorInterface.h>
|
||||
@@ -70,7 +69,6 @@
|
||||
#include "Include/IDisplayViewport.h"
|
||||
#include "Objects/ObjectManager.h"
|
||||
#include "ProcessInfo.h"
|
||||
#include "IPostEffectGroup.h"
|
||||
#include "EditorPreferencesPageGeneral.h"
|
||||
#include "ViewportManipulatorController.h"
|
||||
#include "EditorViewportSettings.h"
|
||||
@@ -100,7 +98,6 @@
|
||||
#include <QtGui/private/qhighdpiscaling_p.h>
|
||||
|
||||
#include <IEntityRenderState.h>
|
||||
#include <IPhysics.h>
|
||||
#include <IStatObj.h>
|
||||
|
||||
AZ_CVAR(
|
||||
|
||||
@@ -356,10 +356,9 @@ void CExportManager::AddMesh(Export::CObject* pObj, const IIndexedMesh* pIndMesh
|
||||
|
||||
for (int v = 0; v < meshDesc.m_nCoorCount; ++v)
|
||||
{
|
||||
Export::UV tc;
|
||||
meshDesc.m_pTexCoord[v].ExportTo(tc.u, tc.v);
|
||||
tc.v = 1.0f - tc.v;
|
||||
pObj->m_texCoords.push_back(tc);
|
||||
Vec2 uv = meshDesc.m_pTexCoord[v].GetUV();
|
||||
uv.y = 1.0f - uv.y;
|
||||
pObj->m_texCoords.push_back({uv.x,uv.y});
|
||||
}
|
||||
|
||||
if (pIndMesh->GetSubSetCount() && !(pIndMesh->GetSubSetCount() == 1 && pIndMesh->GetSubSet(0).nNumIndices == 0))
|
||||
|
||||
@@ -161,61 +161,6 @@ void* CTriMesh::ReAllocElements(void* old_ptr, int new_elem_num, int size_of_ele
|
||||
return realloc(old_ptr, new_elem_num * size_of_element);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Unshare all vertices and split on 3 arrays, positions/texcoords.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CTriMesh::SetFromMesh(CMesh& mesh)
|
||||
{
|
||||
bbox = mesh.m_bbox;
|
||||
|
||||
int maxVerts = mesh.GetIndexCount();
|
||||
|
||||
SetVertexCount(maxVerts);
|
||||
SetUVCount(maxVerts);
|
||||
if (mesh.m_pColor0)
|
||||
{
|
||||
SetColorsCount(maxVerts);
|
||||
}
|
||||
|
||||
SetFacesCount(mesh.GetIndexCount());
|
||||
|
||||
int numv = 0;
|
||||
int numface = 0;
|
||||
for (int nSubset = 0; nSubset < mesh.GetSubSetCount(); nSubset++)
|
||||
{
|
||||
SMeshSubset& subset = mesh.m_subsets[nSubset];
|
||||
for (int i = subset.nFirstIndexId; i < subset.nFirstIndexId + subset.nNumIndices; i += 3)
|
||||
{
|
||||
CTriFace& face = pFaces[numface++];
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
int idx = mesh.m_pIndices[i + j];
|
||||
pVertices[numv].pos = mesh.m_pPositions ? mesh.m_pPositions[idx] : mesh.m_pPositionsF16[idx].ToVec3();
|
||||
pWeights[numv] = 0.0f;
|
||||
pUV[numv] = mesh.m_pTexCoord[idx];
|
||||
if (mesh.m_pColor0)
|
||||
{
|
||||
pColors[numv] = mesh.m_pColor0[idx];
|
||||
}
|
||||
|
||||
face.v [j] = numv;
|
||||
face.uv[j] = numv;
|
||||
face.n [j] = mesh.m_pNorms[idx].GetN();
|
||||
face.MatID = static_cast<unsigned char>(subset.nMatID);
|
||||
face.flags = 0;
|
||||
|
||||
numv++;
|
||||
}
|
||||
}
|
||||
}
|
||||
SetFacesCount(numface);
|
||||
SharePositions();
|
||||
ShareUV();
|
||||
UpdateEdges();
|
||||
|
||||
CalcFaceNormals();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
inline int FindVertexInHash(const Vec3& vPosToFind, const CTriVertex* pVectors, std::vector<int>& hash, float fEpsilon)
|
||||
{
|
||||
@@ -360,76 +305,6 @@ void CTriMesh::CalcFaceNormals()
|
||||
#define TEX_EPS 0.001f
|
||||
#define VER_EPS 0.001f
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CTriMesh::UpdateIndexedMesh(IIndexedMesh* pIndexedMesh) const
|
||||
{
|
||||
{
|
||||
const int maxVerts = nFacesCount * 3;
|
||||
|
||||
pIndexedMesh->SetVertexCount(maxVerts);
|
||||
pIndexedMesh->SetTexCoordCount(maxVerts);
|
||||
if (pColors)
|
||||
{
|
||||
pIndexedMesh->SetColorCount(maxVerts);
|
||||
}
|
||||
pIndexedMesh->SetIndexCount(0);
|
||||
pIndexedMesh->SetFaceCount(nFacesCount);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// To find really used materials
|
||||
std::vector<int> usedMaterialIds;
|
||||
uint16 MatIdToSubset[MAX_SUB_MATERIALS];
|
||||
uint16 nLastSubsetId = 0;
|
||||
memset(MatIdToSubset, 0, sizeof(MatIdToSubset));
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CMesh& mesh = *pIndexedMesh->GetMesh();
|
||||
AABB bb;
|
||||
bb.Reset();
|
||||
for (int i = 0; i < nFacesCount; ++i)
|
||||
{
|
||||
const CTriFace& face = pFaces[i];
|
||||
SMeshFace& meshFace = mesh.m_pFaces[i];
|
||||
|
||||
// Remap new used material ID to index of chunk id.
|
||||
if (!MatIdToSubset[face.MatID])
|
||||
{
|
||||
MatIdToSubset[face.MatID] = 1 + nLastSubsetId++;
|
||||
usedMaterialIds.push_back(face.MatID); // Order of material ids in usedMaterialIds correspond to the indices of chunks.
|
||||
}
|
||||
meshFace.nSubset = static_cast<unsigned char>(MatIdToSubset[face.MatID] - 1);
|
||||
|
||||
for (int j = 0; j < 3; ++j)
|
||||
{
|
||||
const int dstVIdx = i * 3 + j;
|
||||
|
||||
mesh.m_pPositions[dstVIdx] = pVertices[face.v[j]].pos;
|
||||
mesh.m_pNorms[dstVIdx] = SMeshNormal(face.n[j]);
|
||||
mesh.m_pTexCoord[dstVIdx] = pUV[face.uv[j]];
|
||||
if (pColors)
|
||||
{
|
||||
mesh.m_pColor0[dstVIdx] = pColors[face.v[j]];
|
||||
}
|
||||
|
||||
meshFace.v[j] = dstVIdx;
|
||||
|
||||
bb.Add(mesh.m_pPositions[dstVIdx]);
|
||||
}
|
||||
}
|
||||
|
||||
pIndexedMesh->SetBBox(bb);
|
||||
|
||||
pIndexedMesh->SetSubSetCount(static_cast<int>(usedMaterialIds.size()));
|
||||
for (int i = 0; i < usedMaterialIds.size(); i++)
|
||||
{
|
||||
pIndexedMesh->SetSubsetMaterialId(i, usedMaterialIds[i]);
|
||||
}
|
||||
|
||||
pIndexedMesh->Optimize();
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CTriMesh::CopyStream(CTriMesh& fromMesh, int stream)
|
||||
{
|
||||
|
||||
@@ -198,8 +198,6 @@ public:
|
||||
void GetStreamInfo(int stream, void*& pStream, int& nElementSize) const;
|
||||
int GetStreamSize(int stream) const { return m_streamSize[stream]; };
|
||||
|
||||
void SetFromMesh(CMesh& mesh);
|
||||
void UpdateIndexedMesh(IIndexedMesh* pIndexedMesh) const;
|
||||
// Calculate per face normal.
|
||||
void CalcFaceNormals();
|
||||
|
||||
|
||||
@@ -8,14 +8,12 @@
|
||||
|
||||
|
||||
// Description : Classes to deal with commands
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_INCLUDE_COMMAND_H
|
||||
#define CRYINCLUDE_EDITOR_INCLUDE_COMMAND_H
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <AzCore/std/string/conversions.h>
|
||||
#include <CryCommon/LegacyAllocator.h>
|
||||
#include "Util/EditorUtils.h"
|
||||
|
||||
inline AZStd::string ToString(const QString& s)
|
||||
@@ -23,8 +21,20 @@ inline AZStd::string ToString(const QString& s)
|
||||
return s.toUtf8().data();
|
||||
}
|
||||
|
||||
|
||||
class CCommand
|
||||
{
|
||||
static inline bool FromString(int32 &val, const char* s) {
|
||||
if(!s)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
val = (int)strtol(s, nullptr, 10);
|
||||
if(val==0 && errno!=0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public:
|
||||
CCommand(
|
||||
const AZStd::string& module,
|
||||
@@ -77,7 +87,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
int GetArgCount() const
|
||||
size_t GetArgCount() const
|
||||
{ return m_args.size(); }
|
||||
const AZStd::string& GetArg(int i) const
|
||||
{
|
||||
@@ -85,7 +95,7 @@ public:
|
||||
return m_args[i];
|
||||
}
|
||||
private:
|
||||
DynArray<AZStd::string> m_args;
|
||||
AZStd::vector<AZStd::string,AZ::StdLegacyAllocator> m_args;
|
||||
unsigned char m_stringFlags; // This is needed to quote string parameters when logging a command.
|
||||
};
|
||||
|
||||
@@ -115,7 +125,7 @@ protected:
|
||||
static inline AZStd::string ToString_(const char* val)
|
||||
{ return val; }
|
||||
template <typename T>
|
||||
static bool FromString_(T& t, const char* s) { return ::FromString(t, s); }
|
||||
static bool FromString_(T& t, const char* s) { return FromString(t, s); }
|
||||
static inline bool FromString_(const char*& val, const char* s)
|
||||
{ return (val = s) != 0; }
|
||||
|
||||
@@ -789,4 +799,3 @@ QString CCommand6<LIST(6, P)>::Execute(const CCommand::CArgs& args)
|
||||
}
|
||||
return "";
|
||||
}
|
||||
#endif // CRYINCLUDE_EDITOR_INCLUDE_COMMAND_H
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../Include/SandboxAPI.h"
|
||||
#include <CryCommon/LegacyAllocator.h>
|
||||
#include <set>
|
||||
|
||||
class QWidget;
|
||||
@@ -103,7 +104,7 @@ struct IFileUtil
|
||||
}
|
||||
};
|
||||
|
||||
typedef DynArray<FileDesc> FileArray;
|
||||
using FileArray = AZStd::vector<FileDesc, AZ::StdLegacyAllocator>;
|
||||
|
||||
typedef bool (* ScanDirectoryUpdateCallBack)(const QString& msg);
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
//! Get array of objects, managed by manager (not contain sub objects of groups).
|
||||
//! @param layer if 0 get objects for all layers, or layer to get objects from.
|
||||
virtual void GetObjects(CBaseObjectsArray& objects) const = 0;
|
||||
virtual void GetObjects(DynArray<CBaseObject*>& objects) const = 0;
|
||||
//virtual void GetObjects(DynArray<CBaseObject*>& objects) const = 0;
|
||||
|
||||
//! Get array of objects that pass the filter.
|
||||
//! @param filter The filter functor, return true if you want to get the certain obj, return false if want to skip it.
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#include <AzTest/AzTest.h>
|
||||
#include <IEditor.h>
|
||||
#include <SFunctor.h>
|
||||
#include <RenderHelpers/AxisHelper.h>
|
||||
|
||||
class CEditorMock
|
||||
@@ -85,8 +84,8 @@ public:
|
||||
MOCK_METHOD0(GetObjectManager, struct IObjectManager* ());
|
||||
MOCK_METHOD0(GetSettingsManager, CSettingsManager* ());
|
||||
MOCK_METHOD1(GetDBItemManager, IDataBaseManager* (EDataBaseItemType));
|
||||
MOCK_METHOD0(GetMaterialManagerLibrary, IBaseLibraryManager* ());
|
||||
MOCK_METHOD0(GetIEditorMaterialManager, IEditorMaterialManager* ());
|
||||
MOCK_METHOD0(GetMaterialManagerLibrary, IBaseLibraryManager* ());
|
||||
MOCK_METHOD0(GetIEditorMaterialManager, IEditorMaterialManager* ());
|
||||
MOCK_METHOD0(GetIconManager, IIconManager* ());
|
||||
MOCK_METHOD0(GetMusicManager, CMusicManager* ());
|
||||
MOCK_METHOD2(GetTerrainElevation, float(float , float ));
|
||||
@@ -183,7 +182,7 @@ public:
|
||||
MOCK_METHOD0(GetEnv, SSystemGlobalEnvironment* ());
|
||||
MOCK_METHOD0(GetImageUtil, IImageUtil* ());
|
||||
MOCK_METHOD0(GetEditorSettings, SEditorSettings* ());
|
||||
MOCK_METHOD0(GetLogFile, ILogFile* ());
|
||||
MOCK_METHOD0(GetLogFile, ILogFile* ());
|
||||
MOCK_METHOD0(UnloadPlugins, void());
|
||||
MOCK_METHOD0(LoadPlugins, void());
|
||||
MOCK_METHOD1(GetSearchPath, QString(EEditorPathName));
|
||||
|
||||
@@ -2057,53 +2057,7 @@ bool CBaseObject::IsChildOf(CBaseObject* node)
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CBaseObject::GetAllChildren(TBaseObjects& outAllChildren, CBaseObject* pObj) const
|
||||
{
|
||||
const CBaseObject* pBaseObj = pObj ? pObj : this;
|
||||
|
||||
for (size_t i = 0, iChildCount(pBaseObj->GetChildCount()); i < iChildCount; ++i)
|
||||
{
|
||||
CBaseObject* pChild = pBaseObj->GetChild(i);
|
||||
if (pChild == nullptr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
outAllChildren.push_back(pChild);
|
||||
GetAllChildren(outAllChildren, pChild);
|
||||
}
|
||||
}
|
||||
|
||||
void CBaseObject::GetAllChildren(DynArray< _smart_ptr<CBaseObject> >& outAllChildren, CBaseObject* pObj) const
|
||||
{
|
||||
const CBaseObject* pBaseObj = pObj ? pObj : this;
|
||||
|
||||
for (size_t i = 0, iChildCount(pBaseObj->GetChildCount()); i < iChildCount; ++i)
|
||||
{
|
||||
CBaseObject* pChild = pBaseObj->GetChild(i);
|
||||
if (pChild == nullptr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
outAllChildren.push_back(pChild);
|
||||
GetAllChildren(outAllChildren, pChild);
|
||||
}
|
||||
}
|
||||
|
||||
void CBaseObject::GetAllChildren(CSelectionGroup& outAllChildren, CBaseObject* pObj) const
|
||||
{
|
||||
const CBaseObject* pBaseObj = pObj ? pObj : this;
|
||||
|
||||
for (size_t i = 0, iChildCount(pBaseObj->GetChildCount()); i < iChildCount; ++i)
|
||||
{
|
||||
CBaseObject* pChild = pBaseObj->GetChild(i);
|
||||
if (pChild == nullptr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
outAllChildren.AddObject(pChild);
|
||||
GetAllChildren(outAllChildren, pChild);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CBaseObject::CloneChildren(CBaseObject* pFromObject)
|
||||
|
||||
@@ -408,10 +408,6 @@ public:
|
||||
CBaseObject* GetParent() const { return m_parent; };
|
||||
//! Scans hierarchy up to determine if we child of specified node.
|
||||
virtual bool IsChildOf(CBaseObject* node);
|
||||
//! Get all child objects
|
||||
void GetAllChildren(TBaseObjects& outAllChildren, CBaseObject* pObj = nullptr) const;
|
||||
void GetAllChildren(DynArray< _smart_ptr<CBaseObject> >& outAllChildren, CBaseObject* pObj = nullptr) const;
|
||||
void GetAllChildren(CSelectionGroup& outAllChildren, CBaseObject* pObj = nullptr) const;
|
||||
//! Clone Children
|
||||
void CloneChildren(CBaseObject* pFromObject);
|
||||
//! Attach new child node.
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "SandboxAPI.h"
|
||||
#include <Cry_Color.h>
|
||||
#include <Cry_Geo.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
|
||||
#include <QColor>
|
||||
|
||||
|
||||
@@ -759,16 +759,16 @@ void CObjectManager::GetObjects(CBaseObjectsArray& objects) const
|
||||
}
|
||||
}
|
||||
|
||||
void CObjectManager::GetObjects(DynArray<CBaseObject*>& objects) const
|
||||
{
|
||||
CBaseObjectsArray objectArray;
|
||||
GetObjects(objectArray);
|
||||
objects.clear();
|
||||
for (size_t i = 0, iCount(objectArray.size()); i < iCount; ++i)
|
||||
{
|
||||
objects.push_back(objectArray[i]);
|
||||
}
|
||||
}
|
||||
//void CObjectManager::GetObjects(DynArray<CBaseObject*>& objects) const
|
||||
//{
|
||||
// CBaseObjectsArray objectArray;
|
||||
// GetObjects(objectArray);
|
||||
// objects.clear();
|
||||
// for (size_t i = 0, iCount(objectArray.size()); i < iCount; ++i)
|
||||
// {
|
||||
// objects.push_back(objectArray[i]);
|
||||
// }
|
||||
//}
|
||||
|
||||
void CObjectManager::GetObjects(CBaseObjectsArray& objects, BaseObjectFilterFunctor const& filter) const
|
||||
{
|
||||
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
//! Get array of objects, managed by manager (not contain sub objects of groups).
|
||||
//! @param layer if 0 get objects for all layers, or layer to get objects from.
|
||||
void GetObjects(CBaseObjectsArray& objects) const;
|
||||
void GetObjects(DynArray<CBaseObject*>& objects) const;
|
||||
//void GetObjects(DynArray<CBaseObject*>& objects) const;
|
||||
|
||||
//! Get array of objects that pass the filter.
|
||||
//! @param filter The filter functor, return true if you want to get the certain obj, return false if want to skip it.
|
||||
|
||||
@@ -59,8 +59,8 @@ public:
|
||||
}
|
||||
const QString iconsDir = gSettings.searchPaths[EDITOR_PATH_UI_ICONS][0];
|
||||
CFileUtil::ScanDirectory(iconsDir, "*.png", pngFiles);
|
||||
m_iconImages.reserve(pngFiles.size());
|
||||
m_iconFiles.reserve(pngFiles.size());
|
||||
m_iconImages.reserve(static_cast<int>(pngFiles.size()));
|
||||
m_iconFiles.reserve(static_cast<int>(pngFiles.size()));
|
||||
for (size_t i = 0; i < pngFiles.size(); ++i)
|
||||
{
|
||||
const QString path = Path::Make(iconsDir, pngFiles[i].filename);
|
||||
|
||||
@@ -62,11 +62,6 @@ CDynamicArray2D::~CDynamicArray2D()
|
||||
}
|
||||
|
||||
|
||||
void CDynamicArray2D::GetMemoryUsage(ICrySizer* pSizer)
|
||||
{
|
||||
pSizer->Add((char*)this, m_Dimension1 * m_Dimension2 * sizeof(float) + sizeof(*this));
|
||||
}
|
||||
|
||||
void CDynamicArray2D::ScaleImage(CDynamicArray2D* pDestination)
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -24,8 +24,6 @@ public:
|
||||
virtual ~CDynamicArray2D();
|
||||
//
|
||||
void ScaleImage(CDynamicArray2D* pDestination);
|
||||
//
|
||||
void GetMemoryUsage(ICrySizer* pSizer);
|
||||
|
||||
|
||||
float** m_Array; //
|
||||
|
||||
@@ -28,7 +28,7 @@ QColor ScaleColor(const QColor& c, float aScale)
|
||||
const float g = static_cast<float>(aColor.green()) * aScale;
|
||||
const float b = static_cast<float>(aColor.blue()) * aScale;
|
||||
|
||||
return QColor(CLAMP(static_cast<int>(r), 0, 255), CLAMP(static_cast<int>(g), 0, 255), CLAMP(static_cast<int>(b), 0, 255));
|
||||
return QColor(AZStd::clamp(static_cast<int>(r), 0, 255), AZStd::clamp(static_cast<int>(g), 0, 255), AZStd::clamp(static_cast<int>(b), 0, 255));
|
||||
}
|
||||
|
||||
CAlphaBitmap::CAlphaBitmap()
|
||||
|
||||
@@ -105,7 +105,7 @@ void CImageHistogram::ComputeHistogram(BYTE* pImageData, UINT aWidth, UINT aHeig
|
||||
++m_count[3][a];
|
||||
|
||||
lumIndex = (r + b + g) / 3;
|
||||
lumIndex = CLAMP(lumIndex, 0, kNumColorLevels - 1);
|
||||
lumIndex = AZStd::clamp(lumIndex, 0, kNumColorLevels - 1);
|
||||
++m_lumCount[lumIndex];
|
||||
|
||||
if (m_maxCount[0] < m_count[0][r])
|
||||
|
||||
@@ -1491,7 +1491,7 @@ void QtViewport::OnRawInput([[maybe_unused]] UINT wParam, HRAWINPUT lParam)
|
||||
float as = 0.001f * gSettings.cameraMoveSpeed;
|
||||
Ang3 ypr = CCamera::CreateAnglesYPR(Matrix33(viewTM));
|
||||
ypr.x += -all6DOFs[5] * as * fScaleYPR;
|
||||
ypr.y = CLAMP(ypr.y + all6DOFs[3] * as * fScaleYPR, -1.5f, 1.5f); // to keep rotation in reasonable range
|
||||
ypr.y = AZStd::clamp(ypr.y + all6DOFs[3] * as * fScaleYPR, -1.5f, 1.5f); // to keep rotation in reasonable range
|
||||
ypr.z = 0; // to have camera always upward
|
||||
|
||||
viewTM = Matrix34(CCamera::CreateOrientationYPR(ypr), viewTM.GetTranslation());
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
|
||||
#include <AtomLyIntegration/AtomViewportDisplayInfo/AtomViewportInfoDisplayBus.h>
|
||||
|
||||
// CryCommon
|
||||
#include <CryCommon/SFunctor.h>
|
||||
|
||||
// Editor
|
||||
#include "Settings.h"
|
||||
#include "ViewPane.h"
|
||||
@@ -800,8 +797,8 @@ void CViewportTitleDlg::OnSystemEvent(ESystemEvent event, UINT_PTR wparam, UINT_
|
||||
const int eventHeight = static_cast<int>(lparam);
|
||||
const QWidget* viewport = m_pViewPane->GetViewport();
|
||||
|
||||
// This should eventually be converted to an EBus to make it easy to connect to the correct viewport
|
||||
// sending the event. But for now, just detect that we've gotten width/height values that match our
|
||||
// This should eventually be converted to an EBus to make it easy to connect to the correct viewport
|
||||
// sending the event. But for now, just detect that we've gotten width/height values that match our
|
||||
// associated viewport
|
||||
if (viewport && (eventWidth == viewport->width()) && (eventHeight == viewport->height()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user