More red code (#732)
Remove: - Code/CryEngine/CryCommon/Platform - Some unused Code/CryEngine/CryCommon/Mock files - Code/Tools/CryXML and almost all of Code/Tools/CryCommonTools - Code/Tools/TestBed/ResourceCompilerImage - Tools/DeepBandwidthToExcel - Various .p4ignore files
This commit is contained in:
@@ -9,23 +9,15 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME})
|
||||
ly_get_pal_tool_dirs(pal_tool_dirs ${CMAKE_CURRENT_LIST_DIR}/Platform)
|
||||
|
||||
ly_add_target(
|
||||
NAME CryCommon STATIC
|
||||
NAMESPACE Legacy
|
||||
FILES_CMAKE
|
||||
crycommon_files.cmake
|
||||
${pal_dir}/crycommon_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
|
||||
PLATFORM_INCLUDE_FILES
|
||||
${pal_dir}/crycommon_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PUBLIC
|
||||
. # Lots of code without CryCommon/
|
||||
.. # Dangerous since exports CryEngine's path (client code can do CrySystem/ without depending on that target)
|
||||
${pal_dir}
|
||||
${pal_tool_dirs}
|
||||
BUILD_DEPENDENCIES
|
||||
PUBLIC
|
||||
AZ::AzCore
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#include <CryMemoryManager.h>
|
||||
|
||||
class MemoryManagerMock
|
||||
: public IMemoryManager
|
||||
{
|
||||
public:
|
||||
MOCK_METHOD1(GetProcessMemInfo,
|
||||
bool(SProcessMemInfo& minfo));
|
||||
MOCK_METHOD3(TraceDefineHeap,
|
||||
HeapHandle(const char* heapName, size_t size, const void* pBase));
|
||||
MOCK_METHOD6(TraceHeapAlloc,
|
||||
void(HeapHandle heap, void* mem, size_t size, size_t blockSize, const char* sUsage, const char* sNameHint));
|
||||
MOCK_METHOD3(TraceHeapFree,
|
||||
void(HeapHandle heap, void* mem, size_t blockSize));
|
||||
MOCK_METHOD1(TraceHeapSetColor,
|
||||
void(uint32 color));
|
||||
MOCK_METHOD0(TraceHeapGetColor,
|
||||
uint32());
|
||||
MOCK_METHOD1(TraceHeapSetLabel,
|
||||
void(const char* sLabel));
|
||||
MOCK_METHOD1(CreateCustomMemoryHeapInstance,
|
||||
ICustomMemoryHeap* const (EAllocPolicy const eAllocPolicy));
|
||||
MOCK_METHOD3(CreateGeneralExpandingMemoryHeap,
|
||||
IGeneralMemoryHeap* (size_t upperLimit, size_t reserveSize, const char* sUsage));
|
||||
MOCK_METHOD3(CreateGeneralMemoryHeap,
|
||||
IGeneralMemoryHeap* (void* base, size_t sz, const char* sUsage));
|
||||
MOCK_METHOD2(ReserveAddressRange,
|
||||
IMemoryAddressRange* (size_t capacity, const char* sName));
|
||||
MOCK_METHOD2(CreatePageMappingHeap,
|
||||
IPageMappingHeap* (size_t addressSpace, const char* sName));
|
||||
};
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
struct NetworkMock : public INetwork
|
||||
{
|
||||
NetworkMock() : m_gridMate(nullptr)
|
||||
{
|
||||
}
|
||||
GridMate::IGridMate* m_gridMate;
|
||||
|
||||
void Release() override {}
|
||||
void GetMemoryStatistics([[maybe_unused]] ICrySizer* pSizer) override {}
|
||||
void GetBandwidthStatistics([[maybe_unused]] SBandwidthStats* const pStats) override {}
|
||||
void GetPerformanceStatistics([[maybe_unused]] SNetworkPerformance* pSizer) override {}
|
||||
void GetProfilingStatistics([[maybe_unused]] SNetworkProfilingStats* const pStats) override {}
|
||||
void SyncWithGame([[maybe_unused]] ENetworkGameSync syncType) override {}
|
||||
const char* GetHostName() override { return "testhostname"; }
|
||||
GridMate::IGridMate* GetGridMate() override
|
||||
{
|
||||
return m_gridMate;
|
||||
}
|
||||
ChannelId GetChannelIdForSessionMember([[maybe_unused]] GridMate::GridMember* member) const override { return ChannelId(); }
|
||||
ChannelId GetServerChannelId() const override { return ChannelId(); }
|
||||
ChannelId GetLocalChannelId() const override { return ChannelId(); }
|
||||
CTimeValue GetSessionTime() override { return CTimeValue(); }
|
||||
void ChangedAspects([[maybe_unused]] EntityId id, [[maybe_unused]] NetworkAspectType aspectBits) override {}
|
||||
void SetDelegatableAspectMask([[maybe_unused]] NetworkAspectType aspectBits) override {}
|
||||
void SetObjectDelegatedAspectMask([[maybe_unused]] EntityId entityId, [[maybe_unused]] NetworkAspectType aspects, [[maybe_unused]] bool set) override {}
|
||||
void DelegateAuthorityToClient([[maybe_unused]] EntityId entityId, [[maybe_unused]] ChannelId clientChannelId) override {}
|
||||
void InvokeActorRMI([[maybe_unused]] EntityId entityId, [[maybe_unused]] uint8 actorExtensionId, [[maybe_unused]] ChannelId targetChannelFilter, [[maybe_unused]] IActorRMIRep& rep) override {}
|
||||
void InvokeScriptRMI([[maybe_unused]] ISerializable* serializable, [[maybe_unused]] bool isServerRMI, [[maybe_unused]] ChannelId toChannelId = kInvalidChannelId, [[maybe_unused]] ChannelId avoidChannelId = kInvalidChannelId) override {}
|
||||
void RegisterActorRMI([[maybe_unused]] IActorRMIRep* rep) override {}
|
||||
void UnregisterActorRMI([[maybe_unused]] IActorRMIRep* rep) override {}
|
||||
EntityId LocalEntityIdToServerEntityId([[maybe_unused]] EntityId localId) const override { return EntityId(); }
|
||||
EntityId ServerEntityIdToLocalEntityId([[maybe_unused]] EntityId serverId, [[maybe_unused]] bool allowForcedEstablishment = false) const override { return EntityId(); }
|
||||
};
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzTest/AzTest.h>
|
||||
|
||||
#include <CGFContent.h>
|
||||
|
||||
class MockIAssetWriter
|
||||
: public IAssetWriter
|
||||
{
|
||||
public:
|
||||
~MockIAssetWriter() override = default;
|
||||
MOCK_METHOD1(WriteCGF,
|
||||
bool(CContentCGF* content));
|
||||
MOCK_METHOD2(WriteCHR,
|
||||
bool(CContentCGF* content, IConvertContext* convertContext));
|
||||
MOCK_METHOD3(WriteSKIN,
|
||||
bool(CContentCGF* content, IConvertContext* convertContext, bool exportMorphTargets));
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../../WinBase.cpp
|
||||
)
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../../WinBase.cpp
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../../WinBase.cpp
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../../WinBase.cpp
|
||||
)
|
||||
@@ -1,102 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <AzCore/Math/Aabb.h>
|
||||
|
||||
namespace Terrain
|
||||
{
|
||||
class Viewport2D
|
||||
{
|
||||
public:
|
||||
int m_topLeftX = 0;
|
||||
int m_topLeftY = 0;
|
||||
int m_width = 0;
|
||||
int m_height = 0;
|
||||
|
||||
Viewport2D() = default;
|
||||
Viewport2D(const Viewport2D&) = default;
|
||||
Viewport2D& operator=(const Viewport2D&) = default;
|
||||
|
||||
Viewport2D(int topLeftX, int topLeftY, int width, int height)
|
||||
: m_topLeftX(topLeftX)
|
||||
, m_topLeftY(topLeftY)
|
||||
, m_width(width)
|
||||
, m_height(height)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// External height map data requests
|
||||
class HeightmapDataRequestInfo
|
||||
{
|
||||
public:
|
||||
HeightmapDataRequestInfo() = default;
|
||||
HeightmapDataRequestInfo(const HeightmapDataRequestInfo& rhs) = default;
|
||||
HeightmapDataRequestInfo& operator=(const HeightmapDataRequestInfo& rhs) = default;
|
||||
|
||||
HeightmapDataRequestInfo(int viewportTopLeftX, int viewportTopLeftY, int viewportWidth, int viewportHeight, float metersPerPixel, AZ::Vector2 worldMin, AZ::Vector2 worldMax)
|
||||
: m_viewport(viewportTopLeftX, viewportTopLeftY, viewportWidth, viewportHeight)
|
||||
, m_metersPerPixel(metersPerPixel)
|
||||
, m_worldMin(worldMin)
|
||||
, m_worldMax(worldMax)
|
||||
{
|
||||
}
|
||||
|
||||
float GetMetersPerPixel() const
|
||||
{
|
||||
return m_metersPerPixel;
|
||||
}
|
||||
|
||||
AZ::Vector2 GetWorldMin() const
|
||||
{
|
||||
return m_worldMin;
|
||||
}
|
||||
|
||||
AZ::Vector2 GetWorldMax() const
|
||||
{
|
||||
return m_worldMax;
|
||||
}
|
||||
|
||||
AZ::Vector2 GetWorldWidth() const
|
||||
{
|
||||
return (m_worldMax - m_worldMin);
|
||||
}
|
||||
|
||||
Viewport2D GetViewport() const
|
||||
{
|
||||
return m_viewport;
|
||||
}
|
||||
|
||||
private:
|
||||
Viewport2D m_viewport;
|
||||
AZ::Vector2 m_worldMin = AZ::Vector2(0.0f, 0.0f);
|
||||
AZ::Vector2 m_worldMax = AZ::Vector2(0.0f, 0.0f);
|
||||
float m_metersPerPixel = 1.0f;
|
||||
};
|
||||
|
||||
class HeightmapDataNotifications
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// EBusTraits overrides
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual void OnTerrainHeightDataChanged(const AZ::Aabb& dirtyRegion) = 0;
|
||||
};
|
||||
using HeightmapDataNotificationBus = AZ::EBus<HeightmapDataNotifications>;
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <AzCore/std/string/string_view.h>
|
||||
|
||||
class CShader;
|
||||
|
||||
namespace Terrain
|
||||
{
|
||||
class TerrainDataRequests
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// EBusTraits overrides
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
using MutexType = AZStd::recursive_mutex;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual float GetHeightSynchronous(float x, float y) = 0;
|
||||
virtual AZ::Vector3 GetNormalSynchronous(float x, float y) = 0;
|
||||
|
||||
virtual CShader* GetTerrainHeightGeneratorShader() const = 0;
|
||||
virtual CShader* GetTerrainMaterialCompositingShader() const = 0;
|
||||
};
|
||||
using TerrainDataRequestBus = AZ::EBus<TerrainDataRequests>;
|
||||
|
||||
class TerrainShaderRequests
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// EBusTraits overrides
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
using MutexType = AZStd::recursive_mutex;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual void RefreshShader(const AZStd::string_view name, CShader* shader) = 0;
|
||||
virtual void ReleaseShader(CShader* shader) const = 0;
|
||||
};
|
||||
using TerrainShaderRequestBus = AZ::EBus<TerrainShaderRequests>;
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Math/Vector2.h>
|
||||
#include <AzCore/std/functional.h>
|
||||
#include <AzCore/std/smart_ptr/shared_ptr.h>
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
|
||||
#include "HeightmapDataBus.h"
|
||||
|
||||
class CShader;
|
||||
|
||||
namespace Terrain
|
||||
{
|
||||
// This interface defines how the renderer can access the terrain system to set up state and gather information before rendering height maps
|
||||
class TerrainProviderRequests
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// EBusTraits overrides
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
//! allows multiple threads to call
|
||||
using MutexType = AZStd::recursive_mutex;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// world properties
|
||||
virtual AZ::Vector3 GetWorldSize() = 0;
|
||||
virtual AZ::Vector3 GetRegionSize() = 0;
|
||||
virtual AZ::Vector3 GetWorldOrigin() = 0;
|
||||
virtual AZ::Vector2 GetHeightRange() = 0;
|
||||
|
||||
// utility
|
||||
virtual void GetRegionIndex(const AZ::Vector2& worldMin, const AZ::Vector2& worldMax, int& regionIndexX, int& regionIndexY) = 0;
|
||||
|
||||
virtual float GetHeightAtIndexedPosition([[maybe_unused]] int ix, [[maybe_unused]] int iy) { return 64.0f; }
|
||||
virtual float GetHeightAtWorldPosition([[maybe_unused]] float fx, [[maybe_unused]] float fy) { return 64.0f; }
|
||||
virtual unsigned char GetSurfaceTypeAtIndexedPosition([[maybe_unused]] int ix, [[maybe_unused]] int iy) { return 0; }
|
||||
};
|
||||
using TerrainProviderRequestBus = AZ::EBus<TerrainProviderRequests>;
|
||||
|
||||
// This class exists for the terrain system to inject data into the renderer for generating the GPU-side terrain height map
|
||||
struct CRETerrainContext
|
||||
{
|
||||
// Tract map
|
||||
virtual void OnTractVersionUpdate() = 0;
|
||||
|
||||
CShader* m_currentShader = nullptr;
|
||||
};
|
||||
|
||||
class TerrainProviderNotifications
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// EBusTraits overrides
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
//! allows multiple threads to call
|
||||
using MutexType = AZStd::recursive_mutex;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// interface to be implemented by the game, invoked by the terrain render element
|
||||
|
||||
// pull settings from the world cache, so the next accessors are accurate
|
||||
virtual void SynchronizeSettings(CRETerrainContext* context) = 0;
|
||||
};
|
||||
using TerrainProviderNotificationBus = AZ::EBus<TerrainProviderNotifications>;
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
|
||||
namespace Terrain
|
||||
{
|
||||
class TerrainRendererRequests
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// EBusTraits overrides
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! allows multiple threads to call
|
||||
using MutexType = AZStd::recursive_mutex;
|
||||
|
||||
// Query state of the terrain renderer
|
||||
// Returns true once the terrain renderer has fulfilled most data requests and is ready for rendering
|
||||
virtual bool IsReady() = 0;
|
||||
};
|
||||
using TerrainRendererRequestBus = AZ::EBus<TerrainRendererRequests>;
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <AzCore/std/containers/fixed_vector.h>
|
||||
|
||||
struct IMaterial;
|
||||
class ITexture;
|
||||
|
||||
namespace Terrain
|
||||
{
|
||||
struct MacroMaterial
|
||||
{
|
||||
// Textures
|
||||
_smart_ptr<ITexture> m_macroColorMap = nullptr;
|
||||
_smart_ptr<ITexture> m_macroGlossMap = nullptr;
|
||||
_smart_ptr<ITexture> m_macroNormalMap = nullptr;
|
||||
|
||||
// Material Params
|
||||
AZ::Color m_macroColorMapColor;
|
||||
float m_macroGlossMapScale = 1.0f;
|
||||
float m_macroNormalMapScale = 1.0f;
|
||||
float m_macroSpecReflectance = 0.03f;
|
||||
|
||||
void Clear()
|
||||
{
|
||||
m_macroColorMap = nullptr;
|
||||
m_macroGlossMap = nullptr;
|
||||
m_macroNormalMap = nullptr;
|
||||
|
||||
m_macroColorMapColor = AZ::Color(1.0f);
|
||||
m_macroGlossMapScale = 1.0f;
|
||||
m_macroNormalMapScale = 1.0f;
|
||||
m_macroSpecReflectance = 0.03f;
|
||||
}
|
||||
};
|
||||
|
||||
struct TerrainMaterialLayer
|
||||
{
|
||||
_smart_ptr<IMaterial> m_material = nullptr;
|
||||
_smart_ptr<ITexture> m_splatTexture = nullptr;
|
||||
|
||||
TerrainMaterialLayer(_smart_ptr<IMaterial> material, _smart_ptr<ITexture> splatTexture)
|
||||
: m_material(material)
|
||||
, m_splatTexture(splatTexture)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
struct RegionMaterials
|
||||
{
|
||||
MacroMaterial m_macroMaterial;
|
||||
|
||||
AZStd::vector<TerrainMaterialLayer> m_materialLayers;
|
||||
_smart_ptr<IMaterial> m_defaultMaterial = nullptr;
|
||||
|
||||
RegionMaterials& operator=(const RegionMaterials& rhs) = default;
|
||||
|
||||
void Clear()
|
||||
{
|
||||
m_materialLayers.clear();
|
||||
m_defaultMaterial = nullptr;
|
||||
m_macroMaterial.Clear();
|
||||
}
|
||||
};
|
||||
|
||||
const AZ::u32 kMaxRegionsPerTerrainMaterialRequest = 16;
|
||||
typedef AZStd::pair<int, int> RegionIndex;
|
||||
typedef AZStd::fixed_vector<RegionIndex, kMaxRegionsPerTerrainMaterialRequest> RegionIndexVector;
|
||||
typedef AZStd::fixed_vector<RegionMaterials, kMaxRegionsPerTerrainMaterialRequest> RegionMaterialVector;
|
||||
|
||||
enum class RequestResult
|
||||
{
|
||||
NoAssetsForRegion,
|
||||
Loading,
|
||||
Success
|
||||
};
|
||||
|
||||
class WorldMaterialRequests
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// EBusTraits overrides
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! allows multiple threads to call
|
||||
using MutexType = AZStd::recursive_mutex;
|
||||
|
||||
virtual void LoadWorld(const AZStd::string& worldName, int regionSize) = 0;
|
||||
|
||||
virtual RequestResult RequestRegionMaterials(const RegionIndexVector& regions, RegionMaterialVector& outRegionMaterials) = 0;
|
||||
|
||||
// Parameters:
|
||||
// int tileX, tileY : Region tile indices
|
||||
// Returns:
|
||||
// bool : If true, region material data is loaded and exists. outMacroMaterial will be modified with the respective macro material data
|
||||
// If false, no region material data has been loaded or exists for the given tile (may still have invalid material layers).
|
||||
virtual RequestResult GetMacroMaterial(int tileX, int tileY, MacroMaterial& outMacroMaterial) = 0;
|
||||
|
||||
virtual void GetTerrainPOMParameters(float& pomHeightBias, float& pomDisplacement, float& selfShadowStrength) = 0;
|
||||
|
||||
//Get the surface type at a given position. If not loaded yet, returns "loadingMaterial".
|
||||
virtual AZStd::string_view GetSurfaceTypeAtPosition(AZ::Vector2 position) = 0;
|
||||
};
|
||||
using WorldMaterialRequestBus = AZ::EBus<WorldMaterialRequests>;
|
||||
} // namespace Terrain
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
// Description : Linux/Mac port support for Win32API calls
|
||||
#if !defined(WIN32)
|
||||
|
||||
#include "platform.h" // Note: This should be first to get consistent debugging definitions
|
||||
|
||||
@@ -1667,3 +1668,5 @@ __finddata64_t::~__finddata64_t()
|
||||
}
|
||||
}
|
||||
#endif //defined(APPLE) || defined(LINUX)
|
||||
|
||||
#endif // !defined(WIN32)
|
||||
|
||||
@@ -249,7 +249,6 @@ set(FILES
|
||||
platform_impl.cpp
|
||||
Win32specific.h
|
||||
Win64specific.h
|
||||
stl/STLAlignedAlloc.h
|
||||
LyShine/IDraw2d.h
|
||||
LyShine/ILyShine.h
|
||||
LyShine/ISprite.h
|
||||
@@ -341,11 +340,7 @@ set(FILES
|
||||
Maestro/Types/AssetBlendKey.h
|
||||
Maestro/Types/AssetBlends.h
|
||||
Maestro/Types/SequenceType.h
|
||||
Terrain/Bus/WorldMaterialRequestsBus.h
|
||||
Terrain/Bus/TerrainBus.h
|
||||
Terrain/Bus/TerrainRendererBus.h
|
||||
Terrain/Bus/HeightmapDataBus.h
|
||||
Terrain/Bus/TerrainProviderBus.h
|
||||
StaticInstance.h
|
||||
Pak/CryPakUtils.h
|
||||
WinBase.cpp
|
||||
)
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@@ -14,12 +14,10 @@ set(FILES
|
||||
Mocks/IConsoleMock.h
|
||||
Mocks/ICryPakMock.h
|
||||
Mocks/ILogMock.h
|
||||
Mocks/IMemoryManagerMock.h
|
||||
Mocks/ISystemMock.h
|
||||
Mocks/ITimerMock.h
|
||||
Mocks/ICVarMock.h
|
||||
Mocks/IRendererMock.h
|
||||
Mocks/ITextureMock.h
|
||||
Mocks/IRemoteConsoleMock.h
|
||||
Mocks/MockCGFContent.h
|
||||
)
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
// Description : Implements an aligned allocator for STL
|
||||
// based on the Mallocator (http://blogs.msdn.com/b/vcblog/archive/2008/08/28/the-mallocator.aspx)
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h> // Required for size_t and ptrdiff_t and NULL
|
||||
|
||||
#include <AzCore/Memory/AllocatorBase.h>
|
||||
|
||||
namespace stl
|
||||
{
|
||||
template <size_t Alignment>
|
||||
class AlignedAllocator
|
||||
: public AZ::SimpleSchemaAllocator<AZ::ChildAllocatorSchema<AZ::LegacyAllocator>>
|
||||
{
|
||||
public:
|
||||
AZ_TYPE_INFO(AlignedAllocator, "{DF152D8A-36ED-4A2A-9FA6-734F212716C6}");
|
||||
using Base = AZ::SimpleSchemaAllocator<AZ::ChildAllocatorSchema<AZ::LegacyAllocator>>;
|
||||
using Descriptor = Base::Descriptor;
|
||||
using Schema = AZ::ChildAllocatorSchema<AZ::LegacyAllocator>;
|
||||
|
||||
AlignedAllocator()
|
||||
: Base("AlignedAllocator", "Legacy Cry Aligned Allocator")
|
||||
{
|
||||
}
|
||||
|
||||
pointer_type Allocate(size_type byteSize, size_type /*alignment*/, int flags /* = 0 */, const char* name /* = 0 */, const char* fileName /* = 0 */, int lineNum /* = 0 */, unsigned int suppressStackRecord /* = 0 */) override
|
||||
{
|
||||
return Base::Allocate(byteSize, Alignment, flags, name, fileName, lineNum, suppressStackRecord);
|
||||
}
|
||||
|
||||
void DeAllocate(pointer_type ptr, size_type byteSize, [[maybe_unused]] size_type alignment) override
|
||||
{
|
||||
return Base::DeAllocate(ptr, byteSize, Alignment);
|
||||
}
|
||||
|
||||
pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type /*newAlignment*/) override
|
||||
{
|
||||
return Base::ReAllocate(ptr, newSize, Alignment);
|
||||
}
|
||||
};
|
||||
|
||||
template <size_t Alignment>
|
||||
using aligned_alloc = AZ::AZStdAlloc<AlignedAllocator<Alignment>>;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Defines aligned vector type
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
template <typename T, int AlignSize>
|
||||
class aligned_vector
|
||||
: public AZStd::vector<T, aligned_alloc<AlignSize> >
|
||||
{
|
||||
public:
|
||||
typedef aligned_alloc<AlignSize> MyAlloc;
|
||||
typedef AZStd::vector<T, MyAlloc> MySuperClass;
|
||||
typedef aligned_vector<T, AlignSize> MySelf;
|
||||
typedef size_t size_type;
|
||||
|
||||
aligned_vector() {}
|
||||
explicit aligned_vector(const MyAlloc& _Al)
|
||||
: MySuperClass(_Al) {}
|
||||
explicit aligned_vector(size_type _Count)
|
||||
: MySuperClass(_Count) {};
|
||||
aligned_vector(size_type _Count, const T& _Val)
|
||||
: MySuperClass(_Count, _Val) {}
|
||||
aligned_vector(size_type _Count, const T& _Val, const MyAlloc& _Al)
|
||||
: MySuperClass(_Count, _Val) {}
|
||||
aligned_vector(const MySelf& _Right)
|
||||
: MySuperClass(_Right) {};
|
||||
|
||||
|
||||
template<class _Iter>
|
||||
aligned_vector(_Iter _First, _Iter _Last)
|
||||
: MySuperClass(_First, _Last) {};
|
||||
|
||||
template<class _Iter>
|
||||
aligned_vector(_Iter _First, _Iter _Last, const MyAlloc& _Al)
|
||||
: MySuperClass(_First, _Last, _Al) {};
|
||||
};
|
||||
|
||||
template <class Vec>
|
||||
inline size_t size_of_aligned_vector(const Vec& c)
|
||||
{
|
||||
if (!c.empty())
|
||||
{
|
||||
// Not really correct as not taking alignment into the account
|
||||
return c.capacity() * sizeof(typename Vec::value_type);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} // namespace stl
|
||||
|
||||
// Specialize for the AlignedAllocator to provide one per module that does not use the
|
||||
// environment for its storage. Since this allocator just uses LegacyAllocator
|
||||
// to do the real work, it's fine if there is one of these per cry module
|
||||
namespace AZ
|
||||
{
|
||||
template <size_t Alignment>
|
||||
class AllocatorInstance<stl::AlignedAllocator<Alignment>> : public Internal::AllocatorInstanceBase<stl::AlignedAllocator<Alignment>, AllocatorStorage::ModuleStoragePolicy<stl::AlignedAllocator<Alignment>>>
|
||||
{
|
||||
};
|
||||
}
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "CrySystem_precompiled.h"
|
||||
#include <AzTest/AzTest.h>
|
||||
#include <AzCore/Memory/AllocatorScope.h>
|
||||
#include <CryCommon/stl/STLAlignedAlloc.h>
|
||||
|
||||
TEST(StringTests, CUT_Strings)
|
||||
{
|
||||
@@ -424,21 +423,6 @@ TEST_F(CryPrimitives, CUT_FixedString)
|
||||
EXPECT_EQ("0123", str5);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Unit Testing of aligned_vector
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
TEST_F(CryPrimitives, CUT_AlignedVector)
|
||||
{
|
||||
stl::aligned_vector<int, 16> vec;
|
||||
|
||||
vec.push_back(1);
|
||||
vec.push_back(2);
|
||||
vec.push_back(3);
|
||||
|
||||
EXPECT_TRUE(vec.size() == 3);
|
||||
EXPECT_TRUE(((INT_PTR)(&vec[0]) % 16) == 0);
|
||||
}
|
||||
|
||||
TEST_F(CryPrimitives, CUT_DynArray)
|
||||
{
|
||||
LegacyDynArray<int> a;
|
||||
|
||||
Reference in New Issue
Block a user