From 81085508ecdfe17fd926973194ce31cd939e65f7 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Thu, 5 May 2022 20:20:44 +0200 Subject: [PATCH] Minor fixes --- include/Nazara/Utility/IndexBuffer.hpp | 4 ++-- src/Nazara/Audio/DummyAudioSource.cpp | 2 +- src/Nazara/Shader/ShaderLangParser.cpp | 4 ++-- src/Nazara/Utility/IndexBuffer.cpp | 2 +- src/Nazara/Utility/VertexDeclaration.cpp | 1 + 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/Nazara/Utility/IndexBuffer.hpp b/include/Nazara/Utility/IndexBuffer.hpp index 0715a34d7..a9c95f6b9 100644 --- a/include/Nazara/Utility/IndexBuffer.hpp +++ b/include/Nazara/Utility/IndexBuffer.hpp @@ -23,7 +23,7 @@ namespace Nz IndexBuffer(IndexBuffer&&) noexcept = default; ~IndexBuffer() = default; - unsigned int ComputeCacheMissCount(); + UInt64 ComputeCacheMissCount(); bool Fill(const void* data, UInt64 startIndex, UInt64 length); bool FillRaw(const void* data, UInt64 offset, UInt64 size); @@ -52,7 +52,7 @@ namespace Nz private: std::shared_ptr m_buffer; IndexType m_indexType; - UInt32 m_indexCount; + UInt64 m_indexCount; UInt64 m_endOffset; UInt64 m_startOffset; }; diff --git a/src/Nazara/Audio/DummyAudioSource.cpp b/src/Nazara/Audio/DummyAudioSource.cpp index ea8fcd4cc..e3578fcb1 100644 --- a/src/Nazara/Audio/DummyAudioSource.cpp +++ b/src/Nazara/Audio/DummyAudioSource.cpp @@ -159,7 +159,7 @@ namespace Nz std::size_t processedBufferIndex = 0; for (; processedBufferIndex < m_queuedBuffers.size(); ++processedBufferIndex) { - UInt32 bufferFrameCount = m_queuedBuffers[processedBufferIndex]->GetSampleCount() / GetChannelCount(m_queuedBuffers[processedBufferIndex]->GetAudioFormat()); + UInt32 bufferFrameCount = SafeCast(m_queuedBuffers[processedBufferIndex]->GetSampleCount() / GetChannelCount(m_queuedBuffers[processedBufferIndex]->GetAudioFormat())); if (offset < bufferFrameCount) break; diff --git a/src/Nazara/Shader/ShaderLangParser.cpp b/src/Nazara/Shader/ShaderLangParser.cpp index f34a82838..db6a170cd 100644 --- a/src/Nazara/Shader/ShaderLangParser.cpp +++ b/src/Nazara/Shader/ShaderLangParser.cpp @@ -78,7 +78,7 @@ namespace Nz::ShaderLang if (!m_context->module) { const Token& nextToken = Peek(); - throw ParserUnexpectedTokenError{ nextToken.location }; + throw ParserUnexpectedTokenError{ nextToken.location, nextToken.type }; } if (!statement) @@ -1110,7 +1110,7 @@ namespace Nz::ShaderLang case TokenType::PlusAssign: assignType = ShaderAst::AssignType::CompoundAdd; break; default: - throw ParserUnexpectedTokenError{ token.location }; + throw ParserUnexpectedTokenError{ token.location, token.type }; } Consume(); diff --git a/src/Nazara/Utility/IndexBuffer.cpp b/src/Nazara/Utility/IndexBuffer.cpp index f4b79f41f..014c9723a 100644 --- a/src/Nazara/Utility/IndexBuffer.cpp +++ b/src/Nazara/Utility/IndexBuffer.cpp @@ -50,7 +50,7 @@ namespace Nz m_buffer = bufferFactory(BufferType::Index, m_endOffset, usage, initialData); } - unsigned int IndexBuffer::ComputeCacheMissCount() + UInt64 IndexBuffer::ComputeCacheMissCount() { IndexMapper mapper(*this); diff --git a/src/Nazara/Utility/VertexDeclaration.cpp b/src/Nazara/Utility/VertexDeclaration.cpp index 013e5700f..d2fd0ca21 100644 --- a/src/Nazara/Utility/VertexDeclaration.cpp +++ b/src/Nazara/Utility/VertexDeclaration.cpp @@ -73,6 +73,7 @@ namespace Nz { switch (type) { + case ComponentType::Color: case ComponentType::Double1: case ComponentType::Double2: case ComponentType::Double3: