Merge pull request #5532 from aws-lumberyard-dev/optimization/unused_files
Optimization: remove unused files
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/base.h>
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <AzCore/Math/Vector2.h>
|
||||
|
||||
class CVegetationMap;
|
||||
struct CVegetationInstance;
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
namespace EditorVegetation
|
||||
{
|
||||
/**
|
||||
* Bus used to talk to VegetationMap across the application
|
||||
*/
|
||||
class EditorVegetationRequests
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
using Bus = AZ::EBus<EditorVegetationRequests>;
|
||||
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
typedef CVegetationMap* BusIdType;
|
||||
|
||||
virtual ~EditorVegetationRequests() {}
|
||||
|
||||
virtual AZStd::vector<CVegetationInstance*> GetObjectInstances(const AZ::Vector2& min, const AZ::Vector2& max) = 0;
|
||||
virtual void DeleteObjectInstance(CVegetationInstance* instance) = 0;
|
||||
};
|
||||
|
||||
using EditorVegetationRequestsBus = AZ::EBus<EditorVegetationRequests>;
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "NullArchiveComponent.h"
|
||||
|
||||
#include <AzCore/Component/TickBus.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
|
||||
void NullArchiveComponent::Activate()
|
||||
{
|
||||
ArchiveCommandsBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
void NullArchiveComponent::Deactivate()
|
||||
{
|
||||
ArchiveCommandsBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
std::future<bool> DefaultFuture()
|
||||
{
|
||||
std::promise<bool> p;
|
||||
p.set_value(false);
|
||||
return p.get_future();
|
||||
}
|
||||
|
||||
std::future<bool> NullArchiveComponent::CreateArchive(
|
||||
const AZStd::string& /*archivePath*/,
|
||||
const AZStd::string& /*dirToArchive*/)
|
||||
{
|
||||
return DefaultFuture();
|
||||
}
|
||||
|
||||
std::future<bool> NullArchiveComponent::ExtractArchive(
|
||||
const AZStd::string& /*archivePath*/,
|
||||
const AZStd::string& /*destinationPath*/)
|
||||
{
|
||||
return DefaultFuture();
|
||||
}
|
||||
|
||||
std::future<bool> NullArchiveComponent::ExtractFile(
|
||||
const AZStd::string& /*archivePath*/,
|
||||
const AZStd::string& /*fileInArchive*/,
|
||||
const AZStd::string& /*destinationPath*/)
|
||||
{
|
||||
return DefaultFuture();
|
||||
}
|
||||
|
||||
bool NullArchiveComponent::ListFilesInArchive(const AZStd::string& /*archivePath*/, AZStd::vector<AZStd::string>& /*outFileEntries*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::future<bool> NullArchiveComponent::AddFileToArchive(
|
||||
const AZStd::string& /*archivePath*/,
|
||||
const AZStd::string& /*fileToAdd*/,
|
||||
const AZStd::string& /*pathInArchive*/)
|
||||
{
|
||||
return DefaultFuture();
|
||||
}
|
||||
|
||||
std::future<bool> NullArchiveComponent::AddFilesToArchive(
|
||||
const AZStd::string& /*archivePath*/,
|
||||
const AZStd::string& /*workingDirectory*/,
|
||||
const AZStd::string& /*listFilePath*/)
|
||||
{
|
||||
return DefaultFuture();
|
||||
}
|
||||
|
||||
void NullArchiveComponent::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context);
|
||||
if (serialize)
|
||||
{
|
||||
serialize->Class<NullArchiveComponent, AZ::Component>()
|
||||
;
|
||||
}
|
||||
}
|
||||
} // namespace AzToolsFramework
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Component/Component.h>
|
||||
#include <AzToolsFramework/Archive/ArchiveAPI.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
class NullArchiveComponent
|
||||
: public AZ::Component
|
||||
, private ArchiveCommandsBus::Handler
|
||||
{
|
||||
public:
|
||||
AZ_COMPONENT(NullArchiveComponent, "{D665B6B1-5FF4-4203-B19F-BBDB82587129}")
|
||||
|
||||
NullArchiveComponent() = default;
|
||||
~NullArchiveComponent() override = default;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// AZ::Component overrides
|
||||
void Activate() override;
|
||||
void Deactivate() override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
private:
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// ArchiveCommandsBus::Handler overrides
|
||||
[[nodiscard]] std::future<bool> CreateArchive(
|
||||
const AZStd::string& archivePath,
|
||||
const AZStd::string& dirToArchive) override;
|
||||
|
||||
[[nodiscard]] std::future<bool> ExtractArchive(
|
||||
const AZStd::string& archivePath,
|
||||
const AZStd::string& destinationPath) override;
|
||||
|
||||
[[nodiscard]] std::future<bool> ExtractFile(
|
||||
const AZStd::string& archivePath,
|
||||
const AZStd::string& fileInArchive,
|
||||
const AZStd::string& destinationPath) override;
|
||||
|
||||
bool ListFilesInArchive(const AZStd::string& archivePath, AZStd::vector<AZStd::string>& outFileEntries) override;
|
||||
|
||||
[[nodiscard]] std::future<bool> AddFileToArchive(
|
||||
const AZStd::string& archivePath,
|
||||
const AZStd::string& workingDirectory,
|
||||
const AZStd::string& fileToAdd) override;
|
||||
|
||||
[[nodiscard]] std::future<bool> AddFilesToArchive(
|
||||
const AZStd::string& archivePath,
|
||||
const AZStd::string& workingDirectory,
|
||||
const AZStd::string& listFilePath) override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
};
|
||||
} // namespace AzToolsFramework
|
||||
@@ -286,5 +286,3 @@ namespace AzToolsFramework
|
||||
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#include <AzToolsFramework/AssetBrowser/AssetBrowserBus.inl>
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <AzCore/std/function/function_fwd.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
|
||||
#include <QImage>
|
||||
|
||||
class QImage;
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
namespace AssetBrowser
|
||||
{
|
||||
class AssetBrowserModel;
|
||||
|
||||
//! Sends requests to output preview image for texture assets. Used for internal only!
|
||||
class AssetBrowserTexturePreviewRequests
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
|
||||
// Only a single handler is allowed
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
|
||||
//! Request to get a preview image for texture product
|
||||
//@return whether the output image is valid or not
|
||||
virtual bool GetProductTexturePreview(const char* /*fullProductFileName*/, QImage& /*previewImage*/, AZStd::string& /*productInfo*/, AZStd::string& /*productAlphaInfo*/) { return false; }
|
||||
};
|
||||
|
||||
using AssetBrowserTexturePreviewRequestsBus = AZ::EBus<AssetBrowserTexturePreviewRequests>;
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
-186
@@ -1,186 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#include "SortFilterProxyModel.hxx"
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
namespace AssetBrowser
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//SortFilterProxyModel
|
||||
SortFilterProxyModel::SortFilterProxyModel(QObject* parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
, m_assetMatchFiltersOperator(AzToolsFramework::FilterOperatorType::And)
|
||||
{
|
||||
//uncomment any column you want to see in the view
|
||||
m_showColumn.insert(AssetBrowserEntry::Column::Name);
|
||||
//m_showColumn.insert( Entry::Column_SourceID );
|
||||
//m_showColumn.insert( Entry::Column_FingerprintValue );
|
||||
//m_showColumn.insert( Entry::Colbumn_Guid );
|
||||
//m_showColumn.insert( Entry::Column_ScanFolderID );
|
||||
//m_showColumn.insert( Entry::Column_ProductID );
|
||||
//m_showColumn.insert( Entry::Column_JobID );
|
||||
//m_showColumn.insert( Entry::Column_JobKey );
|
||||
//m_showColumn.insert( Entry::Column_SubID );
|
||||
//m_showColumn.insert( Entry::Column_AssetType );
|
||||
//m_showColumn.insert( Entry::Column_Platform );
|
||||
//m_showColumn.insert( Entry::Column_ClassID );
|
||||
}
|
||||
|
||||
void SortFilterProxyModel::OnSearchCriteriaChanged(QStringList& criteriaList, AzToolsFramework::FilterOperatorType filterOperator)
|
||||
{
|
||||
removeAllAssetMatchFilters();
|
||||
setAssetMatchFilterOperator(filterOperator);
|
||||
|
||||
for (QString criteria : criteriaList)
|
||||
{
|
||||
auto parts = criteria.split(": ", QString::SkipEmptyParts);
|
||||
addAssetMatchFilter(parts.last().toUtf8().constData());
|
||||
}
|
||||
}
|
||||
|
||||
void SortFilterProxyModel::addAssetTypeFilter(AZ::Data::AssetType assetType)
|
||||
{
|
||||
m_assetTypeFilters.push_back(assetType);
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
void SortFilterProxyModel::addAssetPathFilter(const char* assetPathFilter)
|
||||
{
|
||||
m_assetPathFilters.push_back(assetPathFilter);
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
void SortFilterProxyModel::removeAllAssetPathFilters()
|
||||
{
|
||||
m_assetPathFilters.clear();
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
void SortFilterProxyModel::setAssetMatchSubDirFilter(bool val)
|
||||
{
|
||||
m_includeSubdir = val;
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
void SortFilterProxyModel::removeAllAssetMatchFilters()
|
||||
{
|
||||
m_assetMatchFilters.clear();
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
void SortFilterProxyModel::addAssetMatchFilter(const char* assetMatchFilter)
|
||||
{
|
||||
m_assetMatchFilters.push_back(assetMatchFilter);
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
void SortFilterProxyModel::setAssetMatchFilterOperator(AzToolsFramework::FilterOperatorType type)
|
||||
{
|
||||
m_assetMatchFiltersOperator = type;
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
bool SortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
|
||||
{
|
||||
//get the source idx, if invalid early out
|
||||
QModelIndex idx = sourceModel()->index(source_row, 0, source_parent);
|
||||
if (!idx.isValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//the entry is the internal pointer of the index
|
||||
auto entry = static_cast<AssetBrowserEntry*>(idx.internalPointer());
|
||||
|
||||
if (!entry->isValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//we only want to see assets that have at least one child product that has a valid assetType
|
||||
if (entry->GetEntryType() == AssetBrowserEntry::AssetEntryType::Source)
|
||||
{
|
||||
//we have a asset with at least one valid child product assetType
|
||||
//we only want to see assets that have at least one child product that matches the assetType filter
|
||||
if (!m_assetTypeFilters.empty())
|
||||
{
|
||||
for (int i = 0; i < entry->GetChildCount(); ++i)
|
||||
{
|
||||
auto product = static_cast<ProductAssetBrowserEntry*>(entry->GetChild(i));
|
||||
if (product->isValid())
|
||||
{
|
||||
if (AZStd::find(m_assetTypeFilters.begin(), m_assetTypeFilters.end(), product->GetAssetType()) == m_assetTypeFilters.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//we only want to see assets that match all the match filters
|
||||
if (!m_assetMatchFilters.empty())
|
||||
{
|
||||
if (m_assetMatchFiltersOperator == AzToolsFramework::FilterOperatorType::And)
|
||||
{
|
||||
for (const auto& item : m_assetMatchFilters)
|
||||
{
|
||||
if (!entry->Match(item.c_str()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_assetMatchFiltersOperator == AzToolsFramework::FilterOperatorType::Or)
|
||||
{
|
||||
for (const auto& item : m_assetMatchFilters)
|
||||
{
|
||||
if (entry->Match(item.c_str()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SortFilterProxyModel::filterAcceptsColumn(int source_column, const QModelIndex& source_parent) const
|
||||
{
|
||||
(void)source_parent;
|
||||
|
||||
//if the column is in the set we want to show it
|
||||
return m_showColumn.find(static_cast<AssetBrowserEntry::Column>(source_column)) != m_showColumn.end();
|
||||
}
|
||||
|
||||
bool SortFilterProxyModel::lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const
|
||||
{
|
||||
if (source_left.column() == source_right.column())
|
||||
{
|
||||
QVariant leftData = sourceModel()->data(source_left);
|
||||
QVariant rightData = sourceModel()->data(source_right);
|
||||
if ((leftData.type() == QVariant::String) &&
|
||||
(rightData.type() == QVariant::String))
|
||||
{
|
||||
QString leftString = leftData.toString();
|
||||
QString rightString = rightData.toString();
|
||||
return QString::compare(leftString, rightString, Qt::CaseInsensitive) > 0;
|
||||
}
|
||||
}
|
||||
return QSortFilterProxyModel::lessThan(source_left, source_right);
|
||||
}
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework// namespace AssetBrowser
|
||||
|
||||
#include <AssetBrowser/moc_SortFilterProxyModel.cpp>
|
||||
-124
@@ -1,124 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/Asset/AssetTypeInfoBus.h>
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <AzFramework/API/ApplicationAPI.h>
|
||||
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
|
||||
#include <AzToolsFramework/AssetBrowser/Thumbnails/ProductThumbnail.h>
|
||||
#include <QPixmap>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
namespace AssetBrowser
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// ProductThumbnailKey
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ProductThumbnailKey::ProductThumbnailKey(const AZ::Data::AssetId& assetId)
|
||||
: ThumbnailKey()
|
||||
, m_assetId(assetId)
|
||||
{
|
||||
AZ::Data::AssetInfo info;
|
||||
AZ::Data::AssetCatalogRequestBus::BroadcastResult(info, &AZ::Data::AssetCatalogRequests::GetAssetInfoById, m_assetId);
|
||||
m_assetType = info.m_assetType;
|
||||
}
|
||||
|
||||
const AZ::Data::AssetId& ProductThumbnailKey::GetAssetId() const { return m_assetId; }
|
||||
|
||||
const AZ::Data::AssetType& ProductThumbnailKey::GetAssetType() const { return m_assetType; }
|
||||
|
||||
size_t ProductThumbnailKey::GetHash() const
|
||||
{
|
||||
return m_assetType.GetHash();
|
||||
}
|
||||
|
||||
bool ProductThumbnailKey::Equals(const ThumbnailKey* other) const
|
||||
{
|
||||
if (!ThumbnailKey::Equals(other))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// products displayed in Asset Browser have icons based on asset type, so multiple different products with same asset type will have same thumbnail
|
||||
return m_assetId == azrtti_cast<const ProductThumbnailKey*>(other)->GetAssetId();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// ProductThumbnail
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static const char* DEFAULT_PRODUCT_ICON_PATH = "Editor/Icons/AssetBrowser/DefaultProduct_16.svg";
|
||||
|
||||
ProductThumbnail::ProductThumbnail(Thumbnailer::SharedThumbnailKey key, int thumbnailSize)
|
||||
: Thumbnail(key, thumbnailSize)
|
||||
{}
|
||||
|
||||
void ProductThumbnail::LoadThread()
|
||||
{
|
||||
auto productKey = azrtti_cast<const ProductThumbnailKey*>(m_key.data());
|
||||
AZ_Assert(productKey, "Incorrect key type, excpected ProductThumbnailKey");
|
||||
|
||||
QString iconPath;
|
||||
AZ::AssetTypeInfoBus::EventResult(iconPath, productKey->GetAssetType(), &AZ::AssetTypeInfo::GetBrowserIcon);
|
||||
if (!iconPath.isEmpty())
|
||||
{
|
||||
// is it an embedded resource or absolute path?
|
||||
bool isUsablePath = (iconPath.startsWith(":") || (!AzFramework::StringFunc::Path::IsRelative(iconPath.toUtf8().constData())));
|
||||
|
||||
if (!isUsablePath)
|
||||
{
|
||||
// getting here means it needs resolution. Can we find the real path of the file? This also searches in gems for sources.
|
||||
bool foundIt = false;
|
||||
AZStd::string watchFolder;
|
||||
AZ::Data::AssetInfo assetInfo;
|
||||
AzToolsFramework::AssetSystemRequestBus::BroadcastResult(foundIt, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, iconPath.toUtf8().constData(), assetInfo, watchFolder);
|
||||
|
||||
if (foundIt)
|
||||
{
|
||||
// the absolute path is join(watchfolder, relativepath); // since its relative to the watch folder.
|
||||
AZStd::string finalPath;
|
||||
AzFramework::StringFunc::Path::Join(watchFolder.c_str(), assetInfo.m_relativePath.c_str(), finalPath);
|
||||
iconPath = QString::fromUtf8(finalPath.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// no pixmap specified - use default.
|
||||
iconPath = QString::fromUtf8(DEFAULT_PRODUCT_ICON_PATH);
|
||||
}
|
||||
|
||||
m_icon = QIcon(iconPath);
|
||||
|
||||
if (m_icon.isNull())
|
||||
{
|
||||
m_state = State::Failed;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// ProductThumbnailCache
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ProductThumbnailCache::ProductThumbnailCache()
|
||||
: ThumbnailCache<ProductThumbnail>() {}
|
||||
|
||||
ProductThumbnailCache::~ProductThumbnailCache() = default;
|
||||
|
||||
const char* ProductThumbnailCache::GetProviderName() const
|
||||
{
|
||||
return ProviderName;
|
||||
}
|
||||
|
||||
bool ProductThumbnailCache::IsSupportedThumbnail(Thumbnailer::SharedThumbnailKey key) const
|
||||
{
|
||||
return azrtti_istypeof<const ProductThumbnailKey*>(key.data());
|
||||
}
|
||||
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#include "AssetBrowser/Thumbnails/moc_AssetBrowserProductThumbnail.cpp"
|
||||
-1
@@ -14,7 +14,6 @@
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <AzToolsFramework/SQLite/SQLiteConnection.h>
|
||||
#include <AzToolsFramework/API/AssetDatabaseBus.h>
|
||||
#include <AzToolsFramework/Debug/TraceContext.h>
|
||||
#include <AzToolsFramework/SQLite/SQLiteQuery.h>
|
||||
#include <AzToolsFramework/SQLite/SQLiteBoundColumnSet.h>
|
||||
#include <cinttypes>
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#if 0
|
||||
|
||||
#include "EntityTransformCommand.h"
|
||||
#include <HexEdFramework/FrameworkCore/SelectionMessages.h>
|
||||
#include <HexEd/WorldEditor/ToolsComponents/TransformComponentBus.h>
|
||||
#include <AzToolsFramework/Undo/UndoCacheInterface.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
TransformCommand::TransformCommand(const AZ::u64& contextId, const AZStd::string& friendlyName, const EntityList& captureEntities)
|
||||
: UndoSystem::URSequencePoint(friendlyName)
|
||||
, m_contextId(contextId)
|
||||
{
|
||||
for (auto it = captureEntities.begin(); it != captureEntities.end(); ++it)
|
||||
{
|
||||
SRT current;
|
||||
EBUS_EVENT_ID_RESULT(current, *it, TransformComponentMessages::Bus, GetLocalSRT);
|
||||
m_priorTransforms[*it] = current;
|
||||
m_nextTransforms[*it] = current;
|
||||
}
|
||||
|
||||
m_undoCacheInterface = AZ::Interface<UndoSystem::UndoCacheInterface>::Get();
|
||||
AZ_Assert(m_undoCacheInterface, "Could not get UndoCacheInterface on TransformCommand construction.");
|
||||
}
|
||||
|
||||
void TransformCommand::Post()
|
||||
{
|
||||
// add to undo stack
|
||||
UndoSystem::UndoStack* undoStack = NULL;
|
||||
EBUS_EVENT_ID_RESULT(undoStack, m_contextId, SelectionMessages::Bus, GetUndoStack);
|
||||
|
||||
if (undoStack)
|
||||
{
|
||||
undoStack->Post(this);
|
||||
}
|
||||
|
||||
for (auto it = m_priorTransforms.begin(); it != m_priorTransforms.end(); ++it)
|
||||
{
|
||||
m_undoCacheInterface->UpdateCache(it->first);
|
||||
}
|
||||
}
|
||||
|
||||
void TransformCommand::Undo()
|
||||
{
|
||||
for (auto it = m_priorTransforms.begin(); it != m_priorTransforms.end(); ++it)
|
||||
{
|
||||
EBUS_EVENT_ID(it->first, TransformComponentMessages::Bus, SetLocalSRT, it->second);
|
||||
m_undoCacheInterface->UpdateCache(it->first);
|
||||
}
|
||||
}
|
||||
|
||||
void TransformCommand::Redo()
|
||||
{
|
||||
for (auto it = m_nextTransforms.begin(); it != m_nextTransforms.end(); ++it)
|
||||
{
|
||||
EBUS_EVENT_ID(it->first, TransformComponentMessages::Bus, SetLocalSRT, it->second);
|
||||
m_undoCacheInterface->UpdateCache(it->first);
|
||||
}
|
||||
}
|
||||
|
||||
void TransformCommand::CaptureNewTransform(const AZ::EntityId entityId)
|
||||
{
|
||||
AZ_Assert(m_priorTransforms.find(entityId) != m_priorTransforms.end(), "You can't add new transforms during an operation");
|
||||
AZ_Assert(m_nextTransforms.find(entityId) != m_nextTransforms.end(), "You can't add new transforms during an operation");
|
||||
|
||||
SRT current;
|
||||
EBUS_EVENT_ID_RESULT(current, entityId, TransformComponentMessages::Bus, GetLocalSRT);
|
||||
m_nextTransforms[entityId] = current;
|
||||
}
|
||||
|
||||
void TransformCommand::RevertToPriorTransform(const AZ::EntityId entityId)
|
||||
{
|
||||
AZ_Assert(m_priorTransforms.find(entityId) != m_priorTransforms.end(), "No such entity!");
|
||||
|
||||
m_nextTransforms[entityId] = m_priorTransforms[entityId];
|
||||
EBUS_EVENT_ID(entityId, TransformComponentMessages::Bus, SetLocalSRT, m_priorTransforms[entityId]);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#ifndef TRANSFORM_COMMAND_H
|
||||
#define TRANSFORM_COMMAND_H
|
||||
|
||||
#if 0
|
||||
|
||||
#include <AzCore/base.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
#include <AzCore/Component/ComponentBus.h>
|
||||
#include <HexEdFramework/FrameworkCore/UndoSystem.h>
|
||||
#include <HexEd/WorldEditor/ToolsComponents/TransformComponentBus.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
namespace UndoSystem
|
||||
{
|
||||
class UndoCacheInterface;
|
||||
}
|
||||
|
||||
typedef AZStd::vector<AZ::EntityId> EntityList;
|
||||
|
||||
// transform command specializes undo to just care about the transform of an entity instead of the entire thing, for performance.
|
||||
class TransformCommand
|
||||
: public UndoSystem::URSequencePoint
|
||||
{
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR(TransformCommand, AZ::SystemAllocator, 0);
|
||||
AZ_RTTI(TransformCommand);
|
||||
|
||||
TransformCommand(const AZ::u64& contextId, const AZStd::string& friendlyName, const EditorFramework::EntityList& captureEntities);
|
||||
virtual ~TransformCommand() {}
|
||||
|
||||
// the default will work for selections with out an undo stack(maybe move the undo stack here too
|
||||
void CaptureNewTransform(const AZ::EntityId entityId);
|
||||
void RevertToPriorTransform(const AZ::EntityId entityID);
|
||||
|
||||
virtual void Undo();
|
||||
virtual void Redo();
|
||||
|
||||
virtual void Post();
|
||||
|
||||
protected:
|
||||
AZ::u64 m_contextId;
|
||||
|
||||
typedef AZStd::unordered_map<AZ::EntityId, Components::SRT> CapturedTransforms;
|
||||
|
||||
CapturedTransforms m_priorTransforms;
|
||||
CapturedTransforms m_nextTransforms;
|
||||
|
||||
private:
|
||||
UndoCacheInterface* m_undoCacheInterface;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // disabled
|
||||
|
||||
#endif
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/base.h>
|
||||
#include <AzCore/Memory/Memory.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
#include <AzFramework/Application/Application.h>
|
||||
#include <AzToolsFramework/Undo/UndoSystem.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
/**
|
||||
* AzToolsFramework URSequencePoint wrapper around legacy IUndoObject
|
||||
* Allows using IUndoObject with AzToolsFramework undo system
|
||||
*/
|
||||
template<typename UndoObjectType>
|
||||
class LegacyCommand
|
||||
: public AzToolsFramework::UndoSystem::URSequencePoint
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(LegacyCommand<UndoObjectType>, "{9ED33CB6-04D0-4924-A121-D8C27DC09066}", AzToolsFramework::UndoSystem::URSequencePoint);
|
||||
AZ_CLASS_ALLOCATOR(LegacyCommand<UndoObjectType>, AZ::SystemAllocator, 0);
|
||||
|
||||
explicit LegacyCommand(const AZStd::string& friendlyName, AZStd::unique_ptr<UndoObjectType>&& legacyUndo)
|
||||
: AzToolsFramework::UndoSystem::URSequencePoint(friendlyName)
|
||||
{
|
||||
m_legacyUndo = AZStd::move(legacyUndo);
|
||||
}
|
||||
virtual ~LegacyCommand() = default;
|
||||
|
||||
void Undo() override { m_legacyUndo->Undo(); }
|
||||
void Redo() override { m_legacyUndo->Redo(); }
|
||||
|
||||
bool Changed() const override { return true; }
|
||||
|
||||
protected:
|
||||
AZStd::unique_ptr<UndoObjectType> m_legacyUndo;
|
||||
};
|
||||
} // namespace AzToolsFramework
|
||||
-149
@@ -1,149 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzToolsFramework/Debug/TraceContext.h>
|
||||
#include <AzToolsFramework/Debug/TraceContextBufferedFormatter.h>
|
||||
|
||||
#ifdef AZ_ENABLE_TRACE_CONTEXT
|
||||
|
||||
#include <AzCore/Math/Uuid.h>
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
#include <AzToolsFramework/Debug/TraceContextStackInterface.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#endif // AZ_ENABLE_TRACE_CONTEXT
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
namespace Debug
|
||||
{
|
||||
|
||||
#ifdef AZ_ENABLE_TRACE_CONTEXT
|
||||
|
||||
int TraceContextBufferedFormatter::Print(char* buffer, size_t bufferSize, const TraceContextStackInterface& stack, bool printUuids, size_t startIndex)
|
||||
{
|
||||
if (bufferSize == 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Make sure there's always a terminator, even if nothing has been written.
|
||||
buffer[0] = 0;
|
||||
|
||||
size_t stackSize = stack.GetStackCount();
|
||||
for (size_t i = startIndex; i < stackSize; ++i)
|
||||
{
|
||||
int written = 0;
|
||||
switch (stack.GetType(i))
|
||||
{
|
||||
case TraceContextStackInterface::ContentType::StringType:
|
||||
written = azsnprintf(buffer, bufferSize, "%s=%s\n", stack.GetKey(i), stack.GetStringValue(i));
|
||||
break;
|
||||
case TraceContextStackInterface::ContentType::BoolType:
|
||||
written = azsnprintf(buffer, bufferSize, "%s=%c\n", stack.GetKey(i), (stack.GetBoolValue(i) ? '1' : '0'));
|
||||
break;
|
||||
case TraceContextStackInterface::ContentType::IntType:
|
||||
written = azsnprintf(buffer, bufferSize, "%s=%" PRIi64 "\n", stack.GetKey(i), stack.GetIntValue(i));
|
||||
break;
|
||||
case TraceContextStackInterface::ContentType::UintType:
|
||||
written = azsnprintf(buffer, bufferSize, "%s=%" PRIu64 "\n", stack.GetKey(i), stack.GetUIntValue(i));
|
||||
break;
|
||||
case TraceContextStackInterface::ContentType::FloatType:
|
||||
written = azsnprintf(buffer, bufferSize, "%s=%f\n", stack.GetKey(i), stack.GetFloatValue(i));
|
||||
break;
|
||||
case TraceContextStackInterface::ContentType::DoubleType:
|
||||
written = azsnprintf(buffer, bufferSize, "%s=%f\n", stack.GetKey(i), stack.GetDoubleValue(i));
|
||||
break;
|
||||
case TraceContextStackInterface::ContentType::UuidType:
|
||||
if (printUuids)
|
||||
{
|
||||
written = azsnprintf(buffer, bufferSize, "%s=", stack.GetKey(i));
|
||||
if (written > 0)
|
||||
{
|
||||
int uuidWritten = PrintUuid(buffer + written, bufferSize - written, stack.GetUuidValue(i));
|
||||
written = (uuidWritten < 0 ? -1 : (written + uuidWritten));
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
case TraceContextStackInterface::ContentType::Undefined:
|
||||
written = azsnprintf(buffer, bufferSize, "<UNDEFINED>\n");
|
||||
break;
|
||||
default:
|
||||
written = azsnprintf(buffer, bufferSize, "<UNKNOWN>\n");
|
||||
break;
|
||||
}
|
||||
|
||||
// If successful azsnprintf will return the number of characters that were
|
||||
// written, so move the buffer forward and reduce the available space.
|
||||
// Otherwise see if there's anything written that needs to be recovered
|
||||
// or to simply move to the next entry upon re-entry.
|
||||
if (written > 0)
|
||||
{
|
||||
buffer += written;
|
||||
bufferSize -= written;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the startIndex is the same as the current index, this is the first
|
||||
// entry to be written. It means this is the largest the buffer will
|
||||
// ever get, so leave whatever has been written in place. Do however
|
||||
// add a newline.
|
||||
if (startIndex == i)
|
||||
{
|
||||
if (bufferSize >= 2)
|
||||
{
|
||||
buffer[bufferSize - 2] = '\n';
|
||||
buffer[bufferSize - 1] = 0;
|
||||
}
|
||||
return aznumeric_caster(i + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bufferSize > 0)
|
||||
{
|
||||
// Remove whatever part has been written as it's not complete.
|
||||
*buffer = 0;
|
||||
}
|
||||
}
|
||||
return aznumeric_caster(i);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int TraceContextBufferedFormatter::PrintUuid(char* buffer, size_t bufferSize, const AZ::Uuid& uuid)
|
||||
{
|
||||
int written = uuid.ToString(buffer, aznumeric_caster(bufferSize), false);
|
||||
if (written > 0)
|
||||
{
|
||||
if (bufferSize > written)
|
||||
{
|
||||
buffer[written - 1] = '\n';
|
||||
buffer[written] = 0;
|
||||
return written + 1;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
#else // AZ_ENABLE_TRACE_CONTEXT
|
||||
|
||||
int TraceContextBufferedFormatter::Print(char* /*buffer*/, size_t /*bufferSize*/,
|
||||
const TraceContextStackInterface& /*stack*/, bool /*printUuids*/, size_t /*startIndex*/)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif // AZ_ENABLE_TRACE_CONTEXT
|
||||
} // Debug
|
||||
} // AzToolsFramework
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/base.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
struct Uuid;
|
||||
}
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
namespace Debug
|
||||
{
|
||||
class TraceContextStackInterface;
|
||||
|
||||
// TraceContexBufferedFormatter takes a trace context stack and prints it to the given buffer.
|
||||
// It's aimed to be used with small to micro sized character buffers. (At least 50-100
|
||||
// characters is advised.) If the entire context couldn't be written to the buffer, Build
|
||||
// can be called repeatedly with the returned index to continue printing the buffer. If a
|
||||
// single context entry doesn't fit in the buffer, TraceContexBufferedFormatter will attempt
|
||||
// to write as much data as can be fitted in the buffer.
|
||||
//
|
||||
// Typical usage looks like:
|
||||
// TraceContextSingleStackHandler stackHandler;
|
||||
// ...
|
||||
// TraceContexBufferedFormatter buffered;
|
||||
// char buffer[64];
|
||||
// int index = 0;
|
||||
// do
|
||||
// {
|
||||
// index = buffered.Build(buffer, stackHandler.GetStack(), true, index);
|
||||
// Print(buffer);
|
||||
// } while (index >= 0);
|
||||
//
|
||||
// Example output:
|
||||
// String=text
|
||||
// Integer=42
|
||||
// Float=3.141500
|
||||
// Uuid=E2C7EEFA-B1CA-465F-A4BC-30514F76B7B5
|
||||
|
||||
class TraceContextBufferedFormatter
|
||||
{
|
||||
public:
|
||||
// Prints the trace context to the given buffer, tags.
|
||||
// If printUuids is true, the uuid of objects and tags is printed as well.
|
||||
// Use startIndex to continue from a specific entry.
|
||||
// Returns the index of the next entry to be written or -1 if no entries are left.
|
||||
static int Print(char* buffer, size_t bufferSize, const TraceContextStackInterface& stack, bool printUuids, size_t startIndex = 0);
|
||||
|
||||
template<size_t size>
|
||||
static inline int Print(char(&buffer)[size], const TraceContextStackInterface& stack, bool printUuids, size_t startIndex = 0);
|
||||
|
||||
private:
|
||||
static int PrintUuid(char* buffer, size_t bufferSize, const AZ::Uuid& uuid);
|
||||
};
|
||||
} // Debug
|
||||
} // AzToolsFramework
|
||||
|
||||
#include <AzToolsFramework/Debug/TraceContextBufferedFormatter.inl>
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
namespace Debug
|
||||
{
|
||||
template<size_t size>
|
||||
inline int TraceContextBufferedFormatter::Print(char(&buffer)[size], const TraceContextStackInterface& stack, bool printUuids, size_t startIndex)
|
||||
{
|
||||
return Print(buffer, size, stack, printUuids, startIndex);
|
||||
}
|
||||
} // Debug
|
||||
} // AzToolsFramework
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
#include <AzCore/std/string/string.h>
|
||||
|
||||
class QWidget;
|
||||
class QPainter;
|
||||
class QStyleOptionViewItem;
|
||||
class QAbstractItemModel;
|
||||
class QModelIndex;
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
namespace Thumbnailer
|
||||
{
|
||||
//! Thumbnail delegate can be used as within item views to draw thumbnails
|
||||
class ThumbnailDelegate
|
||||
: public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ThumbnailDelegate(QWidget* parent = nullptr);
|
||||
~ThumbnailDelegate() override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// QStyledItemDelegate
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
|
||||
QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
|
||||
void setEditorData(QWidget* editor, const QModelIndex& index) const override;
|
||||
void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override;
|
||||
//! Set location where thumbnails are searched
|
||||
void SetThumbnailContext(const char* thumbnailContext);
|
||||
|
||||
private:
|
||||
AZStd::string m_thumbnailContext;
|
||||
};
|
||||
} // namespace Thumbnailer
|
||||
} // namespace AzToolsFramework
|
||||
@@ -22,7 +22,7 @@ namespace AzToolsFramework
|
||||
{
|
||||
namespace Thumbnailer
|
||||
{
|
||||
//! A widget used to display thumbnail. To display thumbnails within item views, use ThumbnailDelegate
|
||||
//! A widget used to display thumbnail
|
||||
class ThumbnailWidget
|
||||
: public QWidget
|
||||
{
|
||||
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
-53
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ComponentPaletteModelFilter.hxx"
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
|
||||
ComponentPaletteModelFilter::ComponentPaletteModelFilter(QObject* parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
bool ComponentPaletteModelFilter::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
|
||||
{
|
||||
const QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
|
||||
if (!index.isValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!filterRegExp().isValid())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
auto componentClass = reinterpret_cast<const AZ::SerializeContext::ClassData*>(sourceModel()->data(index, Qt::ItemDataRole::UserRole + 1).toULongLong());
|
||||
if (componentClass)
|
||||
{
|
||||
const QString componentName = sourceModel()->data(index, Qt::DisplayRole).toString();
|
||||
return componentName.contains(filterRegExp());
|
||||
}
|
||||
|
||||
const int childRowCount = sourceModel()->rowCount(index);
|
||||
for (int childRow = 0; childRow < childRowCount; ++childRow)
|
||||
{
|
||||
if (filterAcceptsRow(childRow, index))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#include "UI/ComponentPalette/moc_ComponentPaletteModelFilter.cpp"
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <QSortFilterProxyModel>
|
||||
#endif
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
class ComponentPaletteModelFilter : public QSortFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ComponentPaletteModelFilter(QObject* parent = nullptr);
|
||||
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
|
||||
|
||||
protected:
|
||||
QRegExp m_filterRegExp;
|
||||
};
|
||||
}
|
||||
-67
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "UIFrameworkAPI.h"
|
||||
#include <AzCore/Math/Uuid.h>
|
||||
#include <AzCore/std/delegate/delegate.h>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
# include <QtGui/qpa/qplatformnativeinterface.h>
|
||||
#endif
|
||||
|
||||
#include <AzToolsFramework/UI/UICore/OverwritePromptDialog.hxx>
|
||||
|
||||
#include <QWindow>
|
||||
#include <QtGui/QGuiApplication>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
namespace
|
||||
{
|
||||
// an aggregator utility which essentially provides the operation of returning the last result of an ebus event
|
||||
// which returned something which returns a non-false value (like for example if its a pointer, then the last non-null value)
|
||||
template<class T>
|
||||
struct EBusLastNonNullResult
|
||||
{
|
||||
T value;
|
||||
EBusLastNonNullResult() { value = NULL; }
|
||||
AZ_FORCE_INLINE void operator=(const T& rhs)
|
||||
{
|
||||
if (rhs)
|
||||
{
|
||||
value = rhs;
|
||||
}
|
||||
}
|
||||
AZ_FORCE_INLINE T& operator->() { return value; }
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct EBusAnyTrueResult
|
||||
{
|
||||
T value;
|
||||
AZ_FORCE_INLINE void operator=(const T& rhs) { value = rhs || value; }
|
||||
AZ_FORCE_INLINE T& operator->() { return value; }
|
||||
};
|
||||
}
|
||||
|
||||
bool GetOverwritePromptResult(QWidget* pParentWidget, const char* assetNameToOvewrite)
|
||||
{
|
||||
OverwritePromptDialog dlg(pParentWidget);
|
||||
if (assetNameToOvewrite)
|
||||
{
|
||||
dlg.UpdateLabel(QString::fromUtf8(assetNameToOvewrite));
|
||||
}
|
||||
|
||||
if (!dlg.exec() == QDialog::Accepted)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return dlg.m_result;
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#include "DHQSlider.hxx"
|
||||
#include "PropertyQTConstants.h"
|
||||
#include <QtWidgets/QAbstractSpinBox>
|
||||
AZ_PUSH_DISABLE_WARNING(4244 4251, "-Wunknown-warning-option") // 4244: conversion from 'int' to 'float', possible loss of data
|
||||
// 4251: 'QInputEvent::modState': class 'QFlags<Qt::KeyboardModifier>' needs to have dll-interface to be used by clients of class 'QInputEvent'
|
||||
#include <QWheelEvent>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
void DHQSlider::wheelEvent(QWheelEvent* e)
|
||||
{
|
||||
if (hasFocus())
|
||||
{
|
||||
QSlider::wheelEvent(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
e->ignore();
|
||||
}
|
||||
}
|
||||
|
||||
void InitializeSliderPropertyWidgets(QSlider* slider, QAbstractSpinBox* spinbox)
|
||||
{
|
||||
if (slider == nullptr || spinbox == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// A 2:1 ratio between spinbox and slider gives the slider more room,
|
||||
// but leaves some space for the spin box to expand.
|
||||
const int spinBoxStretch = 1;
|
||||
const int sliderStretch = 2;
|
||||
|
||||
QSizePolicy sizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
|
||||
sizePolicy.setHorizontalStretch(spinBoxStretch);
|
||||
spinbox->setSizePolicy(sizePolicy);
|
||||
spinbox->setMinimumWidth(PropertyQTConstant_MinimumWidth);
|
||||
spinbox->setFixedHeight(PropertyQTConstant_DefaultHeight);
|
||||
spinbox->setFocusPolicy(Qt::StrongFocus);
|
||||
|
||||
sizePolicy.setHorizontalStretch(sliderStretch);
|
||||
slider->setSizePolicy(sizePolicy);
|
||||
slider->setMinimumWidth(PropertyQTConstant_MinimumWidth);
|
||||
slider->setFixedHeight(PropertyQTConstant_DefaultHeight);
|
||||
slider->setFocusPolicy(Qt::StrongFocus);
|
||||
slider->setFocusProxy(spinbox);
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef AZ_Q_SLIDER_HXX
|
||||
#define AZ_Q_SLIDER_HXX
|
||||
|
||||
#include <AzCore/base.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include <QtWidgets/QSlider>
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
class QAbstractSpinBox;
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
class DHQSlider
|
||||
: public QSlider
|
||||
{
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR(DHQSlider, AZ::SystemAllocator, 0);
|
||||
|
||||
explicit DHQSlider(QWidget* parent = 0)
|
||||
: QSlider(parent) {}
|
||||
|
||||
DHQSlider(Qt::Orientation orientation, QWidget* parent = 0)
|
||||
: QSlider(orientation, parent) {}
|
||||
|
||||
void wheelEvent(QWheelEvent* e);
|
||||
};
|
||||
|
||||
// Share widget initialization code between double and int based slider properties.
|
||||
void InitializeSliderPropertyWidgets(QSlider*, QAbstractSpinBox*);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzToolsFramework/Debug/TraceContext.h>
|
||||
#include <AzCore/PlatformDef.h>
|
||||
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // 4251: 'QRawFont::d': class 'QExplicitlySharedDataPointer<QRawFontPrivate>' needs to have dll-interface to be used by clients of class 'QRawFont'
|
||||
// 4800: 'QTextEngine *const ': forcing value to bool 'true' or 'false' (performance warning)
|
||||
#include <QTextBlock>
|
||||
|
||||
+1
-2
@@ -18,8 +18,7 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option")
|
||||
#include <QPainter>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
#include <QtWidgets/QToolButton>
|
||||
|
||||
#include "../UICore/ColorPickerDelegate.hxx"
|
||||
#include <QtGui/QRegExpValidator>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
|
||||
-1
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
#include <cmath>
|
||||
#include "PropertyDoubleSliderCtrl.hxx"
|
||||
#include "DHQSlider.hxx"
|
||||
#include "PropertyQTConstants.h"
|
||||
AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags<Qt::AlignmentFlag>' needs to have dll-interface to be used by clients of class 'QLayoutItem'
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
|
||||
-346
@@ -1,346 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#ifndef PROPERTYEDITOR_UITYPES_H
|
||||
#define PROPERTYEDITOR_UITYPES_H
|
||||
|
||||
#include <AzCore/base.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include "PropertyEditor/EditorClassReflectionTest.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
namespace PropertySystem
|
||||
{
|
||||
typedef AZStd::function < void(const AZStd::string& FieldName, AZStd::vector<AZStd::string>& dEnumNames) >
|
||||
EnumNamesCallback;
|
||||
|
||||
class EditorUIInfo_Enum
|
||||
: public EditorUIInfo
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_Enum, EditorUIInfo);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_Enum, AZ::SystemAllocator, 0);
|
||||
|
||||
EnumNamesCallback m_enumNamesCallBack;
|
||||
|
||||
EditorUIInfo_Enum(EnumNamesCallback enumNamesCallBack, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo(inFlags)
|
||||
, m_enumNamesCallBack(enumNamesCallBack)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_EnumComboBox
|
||||
: public EditorUIInfo_Enum
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_EnumComboBox, EditorUIInfo_Enum);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_EnumComboBox, AZ::SystemAllocator, 0);
|
||||
|
||||
EditorUIInfo_EnumComboBox(EnumNamesCallback enumNamesCallBack, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo_Enum(enumNamesCallBack, inFlags)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
typedef AZStd::function < void(const AZStd::string& FieldName, AZStd::vector<AZStd::string>& dEnumNames) >
|
||||
ChoiceNamesCallback;
|
||||
|
||||
class EditorUIInfo_Choice
|
||||
: public EditorUIInfo
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_Choice, EditorUIInfo);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_Choice, AZ::SystemAllocator, 0);
|
||||
|
||||
ChoiceNamesCallback m_choiceNamesCallBack;
|
||||
|
||||
EditorUIInfo_Choice(ChoiceNamesCallback choiceNamesCallBack, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo(inFlags)
|
||||
, m_choiceNamesCallBack(choiceNamesCallBack)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_ChoiceComboBox
|
||||
: public EditorUIInfo_Choice
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_ChoiceComboBox, EditorUIInfo_Choice);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_ChoiceComboBox, AZ::SystemAllocator, 0);
|
||||
|
||||
EditorUIInfo_ChoiceComboBox(ChoiceNamesCallback choiceNamesCallBack, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo_Choice(choiceNamesCallBack, inFlags)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_Bool
|
||||
: public EditorUIInfo
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_Bool, EditorUIInfo);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_Bool, AZ::SystemAllocator, 0);
|
||||
|
||||
EditorUIInfo_Bool(AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo(inFlags)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_BoolComboBox
|
||||
: public EditorUIInfo_Bool
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_BoolComboBox, EditorUIInfo_Bool);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_BoolComboBox, AZ::SystemAllocator, 0);
|
||||
|
||||
EditorUIInfo_BoolComboBox(AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo_Bool(inFlags)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_BoolDialogBox
|
||||
: public EditorUIInfo_Bool
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_BoolDialogBox, EditorUIInfo_Bool);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_BoolDialogBox, AZ::SystemAllocator, 0);
|
||||
|
||||
EditorUIInfo_BoolDialogBox(AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo_Bool(inFlags)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class EditorUIInfo_Int
|
||||
: public EditorUIInfo
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_Int, EditorUIInfo);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_Int, AZ::SystemAllocator, 0);
|
||||
|
||||
int m_minVal;
|
||||
int m_maxVal;
|
||||
|
||||
EditorUIInfo_Int(int minVal = INT_MIN, int maxVal = INT_MAX, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo(inFlags)
|
||||
, m_minVal(minVal)
|
||||
, m_maxVal(maxVal)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_IntSpinBox
|
||||
: public EditorUIInfo_Int
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_IntSpinBox, EditorUIInfo_Int);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_IntSpinBox, AZ::SystemAllocator, 0);
|
||||
|
||||
EditorUIInfo_IntSpinBox(int minVal = INT_MIN, int maxVal = INT_MAX, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo_Int(minVal, maxVal, inFlags)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_IntSlider
|
||||
: public EditorUIInfo_Int
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_IntSlider, EditorUIInfo_Int);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_IntSlider, AZ::SystemAllocator, 0);
|
||||
|
||||
int m_step;
|
||||
|
||||
EditorUIInfo_IntSlider(int step = 1, int minVal = INT_MIN, int maxVal = INT_MAX, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo_Int(minVal, maxVal, inFlags)
|
||||
, m_step(step)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_Float
|
||||
: public EditorUIInfo
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_Float, EditorUIInfo);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_Float, AZ::SystemAllocator, 0);
|
||||
|
||||
float m_minVal;
|
||||
float m_maxVal;
|
||||
|
||||
EditorUIInfo_Float(float minVal = std::numeric_limits<float>::min(), float maxVal = std::numeric_limits<float>::max(), AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo(inFlags)
|
||||
, m_minVal(minVal)
|
||||
, m_maxVal(maxVal)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_FloatSpinBox
|
||||
: public EditorUIInfo_Float
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_FloatSpinBox, EditorUIInfo_Float);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_FloatSpinBox, AZ::SystemAllocator, 0);
|
||||
|
||||
EditorUIInfo_FloatSpinBox(float minVal = std::numeric_limits<float>::min(), float maxVal = std::numeric_limits<float>::max(), AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo_Float(minVal, maxVal, inFlags)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_FloatSlider
|
||||
: public EditorUIInfo_Float
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_FloatSlider, EditorUIInfo_Float);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_FloatSlider, AZ::SystemAllocator, 0);
|
||||
|
||||
float m_step;
|
||||
|
||||
EditorUIInfo_FloatSlider(float step = 1.f, float minVal = std::numeric_limits<float>::min(), float maxVal = std::numeric_limits<float>::max(), AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo_Float(minVal, maxVal, inFlags)
|
||||
, m_step(step)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_Double
|
||||
: public EditorUIInfo
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_Double, EditorUIInfo);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_Double, AZ::SystemAllocator, 0);
|
||||
|
||||
double m_minVal;
|
||||
double m_maxVal;
|
||||
|
||||
EditorUIInfo_Double(double minVal = DBL_MIN, double maxVal = DBL_MAX, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo(inFlags)
|
||||
, m_minVal(minVal)
|
||||
, m_maxVal(maxVal)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_DoubleSpinBox
|
||||
: public EditorUIInfo_Double
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_DoubleSpinBox, EditorUIInfo_Double);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_DoubleSpinBox, AZ::SystemAllocator, 0);
|
||||
|
||||
EditorUIInfo_DoubleSpinBox(double minVal = DBL_MIN, double maxVal = DBL_MAX, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo_Double(minVal, maxVal, inFlags)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_DoubleSlider
|
||||
: public EditorUIInfo_Double
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_DoubleSlider, EditorUIInfo_Double);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_DoubleSlider, AZ::SystemAllocator, 0);
|
||||
|
||||
double m_step;
|
||||
|
||||
EditorUIInfo_DoubleSlider(double step = 1.0, double minVal = DBL_MIN, double maxVal = DBL_MAX, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo_Double(minVal, maxVal, inFlags)
|
||||
, m_step(step)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_String
|
||||
: public EditorUIInfo
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_String, EditorUIInfo);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_String, AZ::SystemAllocator, 0);
|
||||
|
||||
int m_maxChars;
|
||||
|
||||
EditorUIInfo_String(int maxchars = -1, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo(inFlags)
|
||||
, m_maxChars(maxchars)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EditorUIInfo_StringLineEdit
|
||||
: public EditorUIInfo_String
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_StringLineEdit, EditorUIInfo_String);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_StringLineEdit, AZ::SystemAllocator, 0);
|
||||
|
||||
EditorUIInfo_StringLineEdit(int maxchars = -1, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo_String(maxchars, inFlags)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
typedef AZStd::function<AZStd::string(int /*Index*/, int /*purpose*/)> DropListInfoCallback;
|
||||
|
||||
class EditorUIInfo_DropdownList
|
||||
: public EditorUIInfo
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_DropdownList, EditorUIInfo);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_DropdownList, AZ::SystemAllocator, 0);
|
||||
EditorUIInfo_DropdownList(DropListInfoCallback info, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo(inFlags)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// this function, if you supply it, will be called by the UI and other system to determine whether or not to show
|
||||
// your property at all. This allows you to make properties which only show up when certain other properties are set.
|
||||
typedef AZStd::function < bool(const AZStd::string& /*property name*/, void* /* propertyOwner */, const EditorDataContext::ToolsComponentInfo* /* component info */) >
|
||||
GroupDisplayBooleanFunction;
|
||||
|
||||
// a group is special in that it has children and uses a function to determine what to write for the group and whether to show the group
|
||||
class EditorUIInfo_Group
|
||||
: public EditorUIInfo
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_Group, EditorUIInfo);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_Group, AZ::SystemAllocator, 0);
|
||||
EditorUIInfo_Group(GroupDisplayBooleanFunction displayBoolFn = 0, AZ::u32 inFlags = 0)
|
||||
: EditorUIInfo(inFlags)
|
||||
, m_displayBoolFn(displayBoolFn)
|
||||
{
|
||||
}
|
||||
GroupDisplayBooleanFunction m_displayBoolFn;
|
||||
};
|
||||
|
||||
class EditorUIInfo_Class
|
||||
: public EditorUIInfo
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EditorUIInfo_Class, EditorUIInfo);
|
||||
AZ_CLASS_ALLOCATOR(EditorUIInfo_Class, AZ::SystemAllocator, 0);
|
||||
|
||||
AZ::Uuid m_classID;
|
||||
|
||||
EditorUIInfo_Class(const AZ::Uuid& classID = AZ::Uuid::CreateNull())
|
||||
: m_classID(classID)
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#endif
|
||||
-1
@@ -6,7 +6,6 @@
|
||||
*
|
||||
*/
|
||||
#include "PropertyIntSliderCtrl.hxx"
|
||||
#include "DHQSlider.hxx"
|
||||
#include "PropertyQTConstants.h"
|
||||
#include <AzQtComponents/Components/Widgets/SpinBox.h>
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzToolsFramework/Debug/TraceContext.h>
|
||||
#include <AzCore/PlatformDef.h>
|
||||
|
||||
// 4251: 'QRawFont::d': class 'QExplicitlySharedDataPointer<QRawFontPrivate>' needs to have dll-interface to be used by clients of class
|
||||
// 'QRawFont' 4800: 'QTextEngine *const ': forcing value to bool 'true' or 'false' (performance warning)
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "AZAutoSizingScrollArea.hxx"
|
||||
|
||||
#include <qscrollbar.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
|
||||
AZAutoSizingScrollArea::AZAutoSizingScrollArea(QWidget* parent)
|
||||
: QScrollArea(parent)
|
||||
{
|
||||
}
|
||||
|
||||
// this code was copied from the regular implementation of the same function in QScrollArea, but converted
|
||||
// the private calls to public calls and removed the cache.
|
||||
QSize AZAutoSizingScrollArea::sizeHint() const
|
||||
{
|
||||
int initialSize = 2 * frameWidth();
|
||||
QSize sizeHint(initialSize, initialSize);
|
||||
|
||||
if (widget())
|
||||
{
|
||||
sizeHint += this->widgetResizable() ? widget()->sizeHint() : widget()->size();
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we don't have a widget, we want to reserve some space visually for ourselves.
|
||||
int fontHeight = fontMetrics().height();
|
||||
sizeHint += QSize(2 * fontHeight, 2 * fontHeight);
|
||||
}
|
||||
|
||||
if (verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOn)
|
||||
{
|
||||
sizeHint.setWidth(sizeHint.width() + verticalScrollBar()->sizeHint().width());
|
||||
}
|
||||
|
||||
if (horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOn)
|
||||
{
|
||||
sizeHint.setHeight(sizeHint.height() + horizontalScrollBar()->sizeHint().height());
|
||||
}
|
||||
|
||||
return sizeHint;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "UI/UICore/moc_AZAutoSizingScrollArea.cpp"
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef AZAUTOSIZINGSCROLLAREA_HXX
|
||||
#define AZAUTOSIZINGSCROLLAREA_HXX
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <AzCore/base.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtWidgets/QScrollArea>
|
||||
#endif
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
// This fixes a bug in QScrollArea which makes it so that you can dynamically add and remove elements from inside it, and the scroll
|
||||
// area will take up as much room as it needs to, to prevent the need for scroll bars. Scroll bars will still appear if there is not enough
|
||||
// room, but the view will scale up to eat all available room before that happens.
|
||||
|
||||
// QScrollArea was supposed to do this, but it appears to cache the size of its embedded widget on startup, and never clears that cache.
|
||||
class AZAutoSizingScrollArea
|
||||
: public QScrollArea
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR(AZAutoSizingScrollArea, AZ::SystemAllocator, 0);
|
||||
|
||||
explicit AZAutoSizingScrollArea(QWidget* parent = 0);
|
||||
|
||||
QSize sizeHint() const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#include <QtCore/QAbstractItemModel>
|
||||
#include "ColorPickerDelegate.hxx"
|
||||
|
||||
#include <AzQtComponents/Components/Widgets/ColorPicker.h>
|
||||
#include <AzQtComponents/Utilities/Conversions.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
ColorPickerDelegate::ColorPickerDelegate(QObject* pParent)
|
||||
: QStyledItemDelegate(pParent)
|
||||
{
|
||||
}
|
||||
|
||||
QWidget* ColorPickerDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
||||
{
|
||||
(void)index;
|
||||
(void)option;
|
||||
AzQtComponents::ColorPicker* ptrDialog = new AzQtComponents::ColorPicker(AzQtComponents::ColorPicker::Configuration::RGB,
|
||||
tr("Select Color"), parent);
|
||||
ptrDialog->setWindowFlags(Qt::Tool);
|
||||
return ptrDialog;
|
||||
}
|
||||
|
||||
void ColorPickerDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const
|
||||
{
|
||||
AzQtComponents::ColorPicker* colorEditor = qobject_cast<AzQtComponents::ColorPicker*>(editor);
|
||||
|
||||
if (!editor)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QVariant colorResult = index.data(COLOR_PICKER_ROLE);
|
||||
if (colorResult == QVariant())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const QColor pickedColor = qvariant_cast<QColor>(colorResult);
|
||||
colorEditor->setCurrentColor(AzQtComponents::fromQColor(pickedColor));
|
||||
}
|
||||
|
||||
void ColorPickerDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const
|
||||
{
|
||||
AzQtComponents::ColorPicker* colorEditor = qobject_cast<AzQtComponents::ColorPicker*>(editor);
|
||||
|
||||
if (!editor)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const QVariant colorVariant = AzQtComponents::toQColor(colorEditor->currentColor());
|
||||
model->setData(index, colorVariant, COLOR_PICKER_ROLE);
|
||||
}
|
||||
|
||||
void ColorPickerDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
||||
{
|
||||
(void)index;
|
||||
QRect pickerpos = option.rect;
|
||||
|
||||
pickerpos.setTopLeft(editor->parentWidget()->mapToGlobal(pickerpos.topLeft()));
|
||||
pickerpos.adjust(64, 0, 0, 0);
|
||||
editor->setGeometry(pickerpos);
|
||||
}
|
||||
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#include "UI/UICore/moc_ColorPickerDelegate.cpp"
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef COLOR_PICKER_DELEGATE_HXX
|
||||
#define COLOR_PICKER_DELEGATE_HXX
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include <QtWidgets/QStyledItemDelegate>
|
||||
#endif
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
/**
|
||||
* A delegate which handles the double clicking to pop open a color picker dialog, as long as the role is COLOR_PICKER_ROLE.
|
||||
* To use it, just add a setData() and a data() function to your model which returns a QColor (or accepts one) whenever the COLOR_PICKER_ROLE is queried.
|
||||
**/
|
||||
class ColorPickerDelegate
|
||||
: public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT;
|
||||
public:
|
||||
static const int COLOR_PICKER_ROLE = Qt::UserRole + 1;
|
||||
|
||||
AZ_CLASS_ALLOCATOR(ColorPickerDelegate, AZ::SystemAllocator, 0);
|
||||
ColorPickerDelegate(QObject* pParent);
|
||||
virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
virtual void setEditorData(QWidget* editor, const QModelIndex& index) const;
|
||||
virtual void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
|
||||
virtual void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
};
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#endif //COLOR_PICKER_DELEGATE_HXX
|
||||
@@ -38,7 +38,6 @@ set(FILES
|
||||
API/EditorLevelNotificationBus.h
|
||||
API/ViewportEditorModeTrackerNotificationBus.h
|
||||
API/ViewportEditorModeTrackerNotificationBus.cpp
|
||||
API/EditorVegetationRequestsBus.h
|
||||
API/EditorPythonConsoleBus.h
|
||||
API/EditorPythonRunnerRequestsBus.h
|
||||
API/EditorPythonScriptNotificationsBus.h
|
||||
@@ -106,9 +105,6 @@ set(FILES
|
||||
Debug/TraceContextSingleStackHandler.cpp
|
||||
Debug/TraceContextMultiStackHandler.h
|
||||
Debug/TraceContextMultiStackHandler.cpp
|
||||
Debug/TraceContextBufferedFormatter.cpp
|
||||
Debug/TraceContextBufferedFormatter.inl
|
||||
Debug/TraceContextBufferedFormatter.h
|
||||
Debug/TraceContextLogFormatter.cpp
|
||||
Debug/TraceContextLogFormatter.h
|
||||
Component/EditorComponentAPIBus.h
|
||||
@@ -360,8 +356,6 @@ set(FILES
|
||||
UI/ComponentPalette/ComponentPaletteWidget.cpp
|
||||
UI/ComponentPalette/ComponentPaletteModel.hxx
|
||||
UI/ComponentPalette/ComponentPaletteModel.cpp
|
||||
UI/ComponentPalette/ComponentPaletteModelFilter.hxx
|
||||
UI/ComponentPalette/ComponentPaletteModelFilter.cpp
|
||||
UI/ComponentPalette/ComponentPaletteUtil.hxx
|
||||
UI/ComponentPalette/ComponentPaletteUtil.cpp
|
||||
UI/Layer/NameConflictWarning.hxx
|
||||
@@ -374,8 +368,6 @@ set(FILES
|
||||
UI/PropertyEditor/QtWidgetLimits.h
|
||||
UI/PropertyEditor/DHQComboBox.hxx
|
||||
UI/PropertyEditor/DHQComboBox.cpp
|
||||
UI/PropertyEditor/DHQSlider.hxx
|
||||
UI/PropertyEditor/DHQSlider.cpp
|
||||
UI/PropertyEditor/EntityIdQLabel.hxx
|
||||
UI/PropertyEditor/EntityIdQLabel.cpp
|
||||
UI/PropertyEditor/EntityIdQLineEdit.h
|
||||
@@ -406,7 +398,6 @@ set(FILES
|
||||
UI/PropertyEditor/PropertyDoubleSliderCtrl.cpp
|
||||
UI/PropertyEditor/PropertyDoubleSpinCtrl.hxx
|
||||
UI/PropertyEditor/PropertyDoubleSpinCtrl.cpp
|
||||
UI/PropertyEditor/PropertyEditor_UITypes.h
|
||||
UI/PropertyEditor/PropertyEditorAPI.h
|
||||
UI/PropertyEditor/PropertyEditorApi.cpp
|
||||
UI/PropertyEditor/PropertyEditorAPI_Internals.h
|
||||
@@ -453,10 +444,6 @@ set(FILES
|
||||
UI/Slice/SliceRelationshipWidget.hxx
|
||||
UI/UICore/AspectRatioAwarePixmapWidget.hxx
|
||||
UI/UICore/AspectRatioAwarePixmapWidget.cpp
|
||||
UI/UICore/AZAutoSizingScrollArea.hxx
|
||||
UI/UICore/AZAutoSizingScrollArea.cpp
|
||||
UI/UICore/ColorPickerDelegate.hxx
|
||||
UI/UICore/ColorPickerDelegate.cpp
|
||||
UI/UICore/ClickableLabel.hxx
|
||||
UI/UICore/ClickableLabel.cpp
|
||||
UI/UICore/IconButton.hxx
|
||||
@@ -484,11 +471,8 @@ set(FILES
|
||||
Commands/EntityStateCommand.h
|
||||
Commands/SelectionCommand.cpp
|
||||
Commands/SelectionCommand.h
|
||||
Commands/EntityTransformCommand.cpp
|
||||
Commands/EntityTransformCommand.h
|
||||
Commands/PreemptiveUndoCache.cpp
|
||||
Commands/PreemptiveUndoCache.h
|
||||
Commands/LegacyCommand.h
|
||||
Commands/BaseSliceCommand.cpp
|
||||
Commands/BaseSliceCommand.h
|
||||
Commands/SliceDetachEntityCommand.cpp
|
||||
@@ -645,8 +629,6 @@ set(FILES
|
||||
AssetBrowser/Previewer/PreviewerFrame.h
|
||||
Archive/ArchiveComponent.h
|
||||
Archive/ArchiveComponent.cpp
|
||||
Archive/NullArchiveComponent.h
|
||||
Archive/NullArchiveComponent.cpp
|
||||
Archive/ArchiveAPI.h
|
||||
UI/PropertyEditor/Model/AssetCompleterModel.h
|
||||
UI/PropertyEditor/Model/AssetCompleterModel.cpp
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
set(FILES
|
||||
UI/LegacyFramework/MainWindowSavedState.h
|
||||
UI/LegacyFramework/MainWindowSavedState.cpp
|
||||
UI/LegacyFramework/UIFramework.hxx
|
||||
UI/LegacyFramework/UIFramework.cpp
|
||||
UI/LegacyFramework/UIFrameworkAPI.h
|
||||
UI/LegacyFramework/UIFrameworkAPI.cpp
|
||||
UI/LegacyFramework/UIFrameworkPreferences.cpp
|
||||
UI/LegacyFramework/Resources/sharedResources.qrc
|
||||
UI/LegacyFramework/Core/EditorContextBus.h
|
||||
UI/LegacyFramework/Core/EditorFrameworkAPI.h
|
||||
UI/LegacyFramework/Core/EditorFrameworkAPI.cpp
|
||||
UI/LegacyFramework/Core/EditorFrameworkApplication.h
|
||||
UI/LegacyFramework/Core/EditorFrameworkApplication.cpp
|
||||
UI/LegacyFramework/Core/IPCComponent.h
|
||||
UI/LegacyFramework/Core/IPCComponent.cpp
|
||||
UI/LegacyFramework/CustomMenus/CustomMenusAPI.h
|
||||
UI/LegacyFramework/CustomMenus/CustomMenusComponent.cpp
|
||||
UI/UICore/OverwritePromptDialog.hxx
|
||||
UI/UICore/OverwritePromptDialog.cpp
|
||||
UI/UICore/OverwritePromptDialog.ui
|
||||
UI/UICore/SaveChangesDialog.hxx
|
||||
UI/UICore/SaveChangesDialog.cpp
|
||||
UI/UICore/SaveChangesDialog.ui
|
||||
ToolsFileUtils/ToolsFileUtils_win.cpp
|
||||
)
|
||||
@@ -12,7 +12,6 @@ set(FILES
|
||||
UI/LegacyFramework/UIFramework.hxx
|
||||
UI/LegacyFramework/UIFramework.cpp
|
||||
UI/LegacyFramework/UIFrameworkAPI.h
|
||||
UI/LegacyFramework/UIFrameworkAPI.cpp
|
||||
UI/LegacyFramework/UIFrameworkPreferences.cpp
|
||||
UI/LegacyFramework/Resources/sharedResources.qrc
|
||||
UI/LegacyFramework/Core/EditorContextBus.h
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
// overrides all new and delete and forwards them to the AZ allocator system
|
||||
// for tracking purposes.
|
||||
|
||||
#include <AzCore/base.h>
|
||||
#include <AzCore/Memory/Memory.h>
|
||||
#include <AzCore/Memory/allocatorbase.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
|
||||
void* operator new(std::size_t size, const AZ::Internal::AllocatorDummy*)
|
||||
{
|
||||
if (!AZ::AllocatorInstance<AZ::SystemAllocator>::IsReady())
|
||||
{
|
||||
AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!");
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
return AZ::AllocatorInstance<AZ::SystemAllocator>::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, "global operator aznew", 0, 0);
|
||||
}
|
||||
void* operator new[](std::size_t size, const AZ::Internal::AllocatorDummy*)
|
||||
{
|
||||
if (!AZ::AllocatorInstance<AZ::SystemAllocator>::IsReady())
|
||||
{
|
||||
AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!");
|
||||
return malloc(size);
|
||||
}
|
||||
return AZ::AllocatorInstance<AZ::SystemAllocator>::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, "global operator aznew[]", 0, 0);
|
||||
}
|
||||
void* operator new(std::size_t size, const char* fileName, int lineNum, const char* name, const AZ::Internal::AllocatorDummy*)
|
||||
{
|
||||
if (!AZ::AllocatorInstance<AZ::SystemAllocator>::IsReady())
|
||||
{
|
||||
AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!");
|
||||
return malloc(size);
|
||||
}
|
||||
return AZ::AllocatorInstance<AZ::SystemAllocator>::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, name ? name : "global operator aznew", fileName, lineNum);
|
||||
}
|
||||
void* operator new[](std::size_t size, const char* fileName, int lineNum, const char* name, const AZ::Internal::AllocatorDummy*)
|
||||
{
|
||||
if (!AZ::AllocatorInstance<AZ::SystemAllocator>::IsReady())
|
||||
{
|
||||
AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!");
|
||||
return malloc(size);
|
||||
}
|
||||
return AZ::AllocatorInstance<AZ::SystemAllocator>::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, name ? name : "global operator aznew[]", fileName, lineNum);
|
||||
}
|
||||
|
||||
void* operator new(std::size_t size)
|
||||
{
|
||||
if (size == 0)
|
||||
{
|
||||
size = 1;
|
||||
}
|
||||
|
||||
if (!AZ::AllocatorInstance<AZ::SystemAllocator>::IsReady())
|
||||
{
|
||||
AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!");
|
||||
return malloc(size);
|
||||
}
|
||||
return AZ::AllocatorInstance<AZ::SystemAllocator>::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, "global operator new", 0, 0);
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
void* operator new[](std::size_t size)
|
||||
//-----------------------------------
|
||||
{
|
||||
if (size == 0)
|
||||
{
|
||||
size = 1;
|
||||
}
|
||||
|
||||
if (!AZ::AllocatorInstance<AZ::SystemAllocator>::IsReady())
|
||||
{
|
||||
AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!");
|
||||
return _aligned_malloc(size, AZCORE_GLOBAL_NEW_ALIGNMENT);
|
||||
}
|
||||
|
||||
return AZ::AllocatorInstance<AZ::SystemAllocator>::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, "global operator new[]", 0, 0);
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
void* operator new(std::size_t size, std::nothrow_t const&)
|
||||
//-----------------------------------
|
||||
{
|
||||
return operator new(size);
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
void* operator new[](std::size_t size, std::nothrow_t const&)
|
||||
//-----------------------------------
|
||||
{
|
||||
return operator new[](size);
|
||||
}
|
||||
|
||||
// these deletes have to be created to match the new()
|
||||
// and will only happen during exception handling when allocation fails.
|
||||
void operator delete(void* ptr, const AZ::Internal::AllocatorDummy*)
|
||||
{
|
||||
if (ptr == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
AZ::AllocatorInstance<AZ::SystemAllocator>::Get().DeAllocate(ptr);
|
||||
}
|
||||
|
||||
void operator delete[](void* ptr, const AZ::Internal::AllocatorDummy*)
|
||||
{
|
||||
if (ptr == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
AZ::AllocatorInstance<AZ::SystemAllocator>::Get().DeAllocate(ptr);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr, const char* fileName, int lineNum, const char* name, const AZ::Internal::AllocatorDummy*)
|
||||
{
|
||||
(void)fileName;
|
||||
(void)lineNum;
|
||||
(void)name;
|
||||
if (ptr == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
AZ::AllocatorInstance<AZ::SystemAllocator>::Get().DeAllocate(ptr);
|
||||
}
|
||||
|
||||
void operator delete[](void* ptr, const char* fileName, int lineNum, const char* name, const AZ::Internal::AllocatorDummy*)
|
||||
{
|
||||
(void)fileName;
|
||||
(void)lineNum;
|
||||
(void)name;
|
||||
if (ptr == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
AZ::AllocatorInstance<AZ::SystemAllocator>::Get().DeAllocate(ptr);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
if (ptr == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AZ::AllocatorInstance<AZ::SystemAllocator>::Get().DeAllocate(ptr);
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
void operator delete[](void* ptr)
|
||||
//-----------------------------------
|
||||
{
|
||||
if (ptr == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
AZ::AllocatorInstance<AZ::SystemAllocator>::Get().DeAllocate(ptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user