Commit missing files

This commit is contained in:
Jérôme Leclercq 2021-05-24 21:07:17 +02:00
parent ba7c56ddfa
commit 7140e322c1
11 changed files with 39 additions and 28 deletions

View File

@ -104,8 +104,7 @@ namespace Nz
class GearConstraint2D;
using GearConstraint2DHandle = ObjectHandle<GearConstraint2D>;
using GearConstraint2DRef = ObjectRef<GearConstraint2D>;
class NAZARA_PHYSICS2D_API GearConstraint2D : public Constraint2D
{
public:
@ -117,8 +116,6 @@ namespace Nz
void SetPhase(float phase);
void SetRatio(float ratio);
template<typename... Args> static GearConstraint2DRef New(Args&&... args);
};
class MotorConstraint2D;

View File

@ -18,7 +18,7 @@ namespace Nz
struct VertexBufferData
{
std::size_t binding;
VertexDeclarationConstRef declaration;
std::shared_ptr<const VertexDeclaration> declaration;
};
std::shared_ptr<RenderPipelineLayout> pipelineLayout;

View File

@ -19,10 +19,10 @@ namespace Nz
struct RenderStates
{
FaceFilling faceFilling = FaceFilling_Fill;
FaceSide cullingSide = FaceSide_Back;
RendererComparison depthCompare = RendererComparison_Less;
PrimitiveMode primitiveMode = PrimitiveMode_TriangleList;
FaceFilling faceFilling = FaceFilling::Fill;
FaceSide cullingSide = FaceSide::Back;
RendererComparison depthCompare = RendererComparison::Less;
PrimitiveMode primitiveMode = PrimitiveMode::TriangleList;
struct
{
@ -36,10 +36,10 @@ namespace Nz
struct
{
RendererComparison compare = RendererComparison_Always;
StencilOperation depthFail = StencilOperation_Keep;
StencilOperation fail = StencilOperation_Keep;
StencilOperation pass = StencilOperation_Keep;
RendererComparison compare = RendererComparison::Always;
StencilOperation depthFail = StencilOperation::Keep;
StencilOperation fail = StencilOperation::Keep;
StencilOperation pass = StencilOperation::Keep;
UInt32 compareMask = 0xFFFFFFFF;
UInt32 reference = 0;
UInt32 writeMask = 0xFFFFFFFF;

View File

@ -15,7 +15,7 @@ namespace Nz
{
struct RenderWindowParameters
{
std::vector<PixelFormat> depthFormats = {Nz::PixelFormat_Depth32, Nz::PixelFormat_Depth24}; //< By order of preference
std::vector<PixelFormat> depthFormats = {Nz::PixelFormat::Depth32, Nz::PixelFormat::Depth24}; //< By order of preference
bool verticalSync = false;
};
}

View File

@ -17,12 +17,12 @@ namespace Nz
struct TextureSamplerInfo
{
float anisotropyLevel = 0.f;
SamplerFilter magFilter = SamplerFilter_Linear;
SamplerFilter minFilter = SamplerFilter_Linear;
SamplerMipmapMode mipmapMode = SamplerMipmapMode_Linear;
SamplerWrap wrapModeU = SamplerWrap_Clamp;
SamplerWrap wrapModeV = SamplerWrap_Clamp;
SamplerWrap wrapModeW = SamplerWrap_Clamp;
SamplerFilter magFilter = SamplerFilter::Linear;
SamplerFilter minFilter = SamplerFilter::Linear;
SamplerMipmapMode mipmapMode = SamplerMipmapMode::Linear;
SamplerWrap wrapModeU = SamplerWrap::Clamp;
SamplerWrap wrapModeV = SamplerWrap::Clamp;
SamplerWrap wrapModeW = SamplerWrap::Clamp;
inline bool operator==(const TextureSamplerInfo& samplerInfo) const;
inline bool operator!=(const TextureSamplerInfo& samplerInfo) const;

View File

@ -10,6 +10,7 @@
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Core/Color.hpp>
#include <Nazara/Core/ObjectLibrary.hpp>
#include <Nazara/Core/MovablePtr.hpp>
#include <Nazara/Core/Resource.hpp>
#include <Nazara/Core/ResourceLoader.hpp>
#include <Nazara/Core/ResourceManager.hpp>
@ -49,8 +50,9 @@ namespace Nz
Image();
Image(ImageType type, PixelFormat format, unsigned int width, unsigned int height, unsigned int depth = 1, UInt8 levelCount = 1);
Image(const Image& image);
Image(SharedImage* sharedImage);
Image(const Image& image);
inline Image(Image&& image) noexcept;
~Image();
bool Convert(PixelFormat format);
@ -104,6 +106,7 @@ namespace Nz
bool Update(const UInt8* pixels, const Rectui& rect, unsigned int z = 0, unsigned int srcWidth = 0, unsigned int srcHeight = 0, UInt8 level = 0) override;
Image& operator=(const Image& image);
inline Image& operator=(Image&& image) noexcept;
static void Copy(UInt8* destination, const UInt8* source, PixelFormat format, unsigned int width, unsigned int height, unsigned int depth = 1, unsigned int dstWidth = 0, unsigned int dstHeight = 0, unsigned int srcWidth = 0, unsigned int srcHeight = 0);
static UInt8 GetMaxLevel(unsigned int width, unsigned int height, unsigned int depth = 1);

View File

@ -8,6 +8,17 @@
namespace Nz
{
inline Image::Image(Image&& image) noexcept :
m_sharedImage(std::exchange(image.m_sharedImage, &emptyImage))
{
}
inline Image& Image::operator=(Image&& image) noexcept
{
std::swap(m_sharedImage, image.m_sharedImage);
return *this;
}
}
#include <Nazara/Utility/DebugOff.hpp>

View File

@ -44,14 +44,14 @@ namespace Nz
DataStorage RenderBuffer::GetStorage() const
{
return DataStorage::DataStorage_Hardware;
return DataStorage::Hardware;
}
void* RenderBuffer::Map(BufferAccess access, UInt64 offset, UInt64 size)
{
if (void* ptr = m_softwareBuffer.Map(access, offset, size))
{
if (access != BufferAccess_ReadOnly)
if (access != BufferAccess::ReadOnly)
{
for (auto& bufferPair : m_hardwareBuffers)
bufferPair.second.synchronized = false;

View File

@ -123,13 +123,13 @@ namespace Nz
NazaraDebug("Using " + m_rendererImpl->QueryAPIString() + " as renderer");
Buffer::SetBufferFactory(DataStorage_Hardware, [](Buffer* parent, BufferType type) -> AbstractBuffer* { return new RenderBuffer(parent, type); });
Buffer::SetBufferFactory(DataStorage::Hardware, [](Buffer* parent, BufferType type) -> std::unique_ptr<AbstractBuffer> { return std::make_unique<RenderBuffer>(parent, type); });
}
Renderer::~Renderer()
{
// Uninitialize module here
Buffer::SetBufferFactory(DataStorage_Hardware, nullptr);
Buffer::SetBufferFactory(DataStorage::Hardware, nullptr);
m_rendererImpl.reset();
}

View File

@ -9,8 +9,8 @@ SCENARIO("SoundBuffer", "[AUDIO][SOUNDBUFFER]")
{
WHEN("We load our sound")
{
Nz::std::shared_ptr<SoundBuffer> soundBuffer = Nz::SoundBuffer::LoadFromFile(GetResourceDir() / "Engine/Audio/Cat.flac");
REQUIRE(soundBuffer.IsValid());
std::shared_ptr<Nz::SoundBuffer> soundBuffer = Nz::SoundBuffer::LoadFromFile(GetResourceDir() / "Engine/Audio/Cat.flac");
REQUIRE(soundBuffer);
THEN("We can ask the informations of the file")
{

View File

@ -158,7 +158,7 @@ Ndk::EntityHandle CreateBaseEntity(Ndk::World& world, const Nz::Vector2f& positi
Ndk::EntityHandle entity = world.CreateEntity();
Ndk::NodeComponent& nodeComponent = entity->AddComponent<Ndk::NodeComponent>();
nodeComponent.SetPosition(position);
Nz::BoxCollider2DRef collisionBox = Nz::BoxCollider2D::New(AABB);
std::shared_ptr<Nz::BoxCollider2D> collisionBox = std::make_shared<Nz::BoxCollider2D>(AABB);
entity->AddComponent<Ndk::CollisionComponent2D>(collisionBox);
return entity;
}