Minor improvements
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Core/StringExt.hpp>
|
||||
#include <NazaraUtils/CallOnExit.hpp>
|
||||
#include <array>
|
||||
#include <cstring>
|
||||
#include <Nazara/Core/Debug.hpp>
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ namespace Nz
|
||||
{
|
||||
NAZARA_USE_ANONYMOUS_NAMESPACE
|
||||
|
||||
// std::thread::native_handle returns a void* with MSVC instead of a HANDLE
|
||||
return PlatformImpl::GetThreadName(GetHandle(thread));
|
||||
}
|
||||
|
||||
@@ -52,7 +51,6 @@ namespace Nz
|
||||
{
|
||||
NAZARA_USE_ANONYMOUS_NAMESPACE
|
||||
|
||||
// std::thread::native_handle returns a void* with MSVC instead of a HANDLE
|
||||
PlatformImpl::SetThreadName(GetHandle(thread), name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,11 +47,9 @@ namespace Nz
|
||||
elements.emplace_back(registry.AllocateElement<RenderSpriteChain>(GetRenderLayer(), m_material, passFlags, renderPipeline, *elementData.worldInstance, vertexDeclaration, whiteTexture, m_spriteCount, m_vertices.data(), *elementData.scissorBox));
|
||||
}
|
||||
|
||||
const std::shared_ptr<MaterialInstance>& LinearSlicedSprite::GetMaterial(std::size_t i) const
|
||||
const std::shared_ptr<MaterialInstance>& LinearSlicedSprite::GetMaterial(std::size_t materialIndex) const
|
||||
{
|
||||
assert(i == 0);
|
||||
NazaraUnused(i);
|
||||
|
||||
NazaraAssertFmt(materialIndex == 0, "material index out of range ({0} >= 1)", materialIndex);
|
||||
return m_material;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Nz
|
||||
|
||||
const std::shared_ptr<MaterialInstance>& Model::GetMaterial(std::size_t subMeshIndex) const
|
||||
{
|
||||
assert(subMeshIndex < m_submeshes.size());
|
||||
NazaraAssertFmt(subMeshIndex < m_submeshes.size(), "material index out of range ({0} >= {1})", subMeshIndex, m_submeshes.size());
|
||||
const auto& subMeshData = m_submeshes[subMeshIndex];
|
||||
return subMeshData.material;
|
||||
}
|
||||
@@ -91,7 +91,7 @@ namespace Nz
|
||||
|
||||
const std::vector<RenderPipelineInfo::VertexBufferData>& Model::GetVertexBufferData(std::size_t subMeshIndex) const
|
||||
{
|
||||
assert(subMeshIndex < m_submeshes.size());
|
||||
NazaraAssertFmt(subMeshIndex < m_submeshes.size(), "submesh index out of range ({0} >= {1})", subMeshIndex, m_submeshes.size());
|
||||
const auto& subMeshData = m_submeshes[subMeshIndex];
|
||||
return subMeshData.vertexBufferData;
|
||||
}
|
||||
|
||||
@@ -42,11 +42,9 @@ namespace Nz
|
||||
elements.emplace_back(registry.AllocateElement<RenderSpriteChain>(GetRenderLayer(), m_material, passFlags, renderPipeline, *elementData.worldInstance, vertexDeclaration, whiteTexture, m_spriteCount, m_vertices.data(), *elementData.scissorBox));
|
||||
}
|
||||
|
||||
const std::shared_ptr<MaterialInstance>& SlicedSprite::GetMaterial(std::size_t i) const
|
||||
const std::shared_ptr<MaterialInstance>& SlicedSprite::GetMaterial(std::size_t materialIndex) const
|
||||
{
|
||||
assert(i == 0);
|
||||
NazaraUnused(i);
|
||||
|
||||
NazaraAssertFmt(materialIndex == 0, "material index out of range ({0} >= 1)", materialIndex);
|
||||
return m_material;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,14 +25,14 @@ namespace Nz
|
||||
*/
|
||||
Tilemap::Tilemap(const Vector2ui& mapSize, const Vector2f& tileSize, std::size_t materialCount) :
|
||||
m_layers(materialCount),
|
||||
m_tiles(mapSize.x* mapSize.y),
|
||||
m_tiles(mapSize.x * mapSize.y),
|
||||
m_origin(0.f, 0.f),
|
||||
m_tileSize(tileSize),
|
||||
m_mapSize(mapSize),
|
||||
m_isometricModeEnabled(false),
|
||||
m_shouldRebuildVertices(false)
|
||||
{
|
||||
NazaraAssert(m_tiles.size() != 0U, "Invalid map size");
|
||||
NazaraAssert(m_tiles.size() != 0U, "invalid map size");
|
||||
NazaraAssert(m_tileSize.x > 0 && m_tileSize.y > 0, "Invalid tile size");
|
||||
NazaraAssert(m_layers.size() != 0U, "Invalid material count");
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Nz::GL
|
||||
WGLLoader::WGLLoader(const Renderer::Config& config) :
|
||||
m_baseContext(nullptr, *this)
|
||||
{
|
||||
if (!m_opengl32Lib.Load("opengl32" NAZARA_DYNLIB_EXTENSION))
|
||||
if (!m_opengl32Lib.Load("opengl32.dll"))
|
||||
throw std::runtime_error("Failed to load opengl32 library, is OpenGL installed on your system?");
|
||||
|
||||
if (!m_gdi32Lib.Load("gdi32.dll"))
|
||||
|
||||
Reference in New Issue
Block a user