More VS fixes

Former-commit-id: 356effb816b9527ff9e89ee3b99074c468455b08
This commit is contained in:
Lynix 2015-06-13 19:42:07 +02:00
parent 009d860d6c
commit 251e21f006
35 changed files with 121 additions and 79 deletions

2
.gitignore vendored
View File

@ -28,6 +28,8 @@ build/scripts/features/index.html
*.sln
*.vcxprojResolveAssemblyReference.cache
*.exp
*.nativecodeanalysis.all.xml
*.nativecodeanalysis.xml
# Compiled Object files
*.slo

View File

@ -67,3 +67,4 @@ configuration { "linux or bsd or macosx", "gmake" }
configuration "vs*"
defines "_CRT_SECURE_NO_WARNINGS"
defines "_SCL_SECURE_NO_WARNINGS"

View File

@ -11,7 +11,7 @@
#include <Nazara/Core/String.hpp>
#include <Nazara/Math/Vector3.hpp>
class NzColor
class NAZARA_API NzColor
{
public:
NzColor();
@ -47,15 +47,15 @@ class NzColor
nzUInt8 r, g, b, a;
static NAZARA_API const NzColor Black;
static NAZARA_API const NzColor Blue;
static NAZARA_API const NzColor Cyan;
static NAZARA_API const NzColor Green;
static NAZARA_API const NzColor Magenta;
static NAZARA_API const NzColor Orange;
static NAZARA_API const NzColor Red;
static NAZARA_API const NzColor Yellow;
static NAZARA_API const NzColor White;
static const NzColor Black;
static const NzColor Blue;
static const NzColor Cyan;
static const NzColor Green;
static const NzColor Magenta;
static const NzColor Orange;
static const NzColor Red;
static const NzColor Yellow;
static const NzColor White;
private:
static float Hue2RGB(float v1, float v2, float vH);

View File

@ -2,6 +2,7 @@
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <iterator>
#include <Nazara/Core/Debug.hpp>
template<typename T>
@ -244,4 +245,17 @@ bool NzSparsePtr<T>::operator>=(const NzSparsePtr& ptr) const
return m_ptr >= ptr.m_ptr;
}
namespace std
{
template<typename T>
struct iterator_traits<NzSparsePtr<T>>
{
using difference_type = ptrdiff_t;
using iterator_category = random_access_iterator_tag;
using reference = const T&;
using pointer = const T*;
using value_type = T;
};
}
#include <Nazara/Core/DebugOff.hpp>

View File

@ -11,6 +11,7 @@
#include <Nazara/Graphics/DeferredRenderPass.hpp>
#include <Nazara/Renderer/RenderStates.hpp>
#include <Nazara/Renderer/Shader.hpp>
#include <unordered_map>
class NAZARA_API NzDeferredGeometryPass : public NzDeferredRenderPass
{

View File

@ -35,7 +35,7 @@ class NAZARA_API NzForwardRenderTechnique : public NzAbstractRenderTechnique
private:
struct ShaderUniforms;
bool ChooseLights(const NzSpheref& object, bool includeDirectionalLights = true) const;
void ChooseLights(const NzSpheref& object, bool includeDirectionalLights = true) const;
void DrawBasicSprites(const NzSceneData& sceneData) const;
void DrawBillboards(const NzSceneData& sceneData) const;
void DrawOpaqueModels(const NzSceneData& sceneData) const;

View File

@ -11,6 +11,7 @@
#include <Nazara/Graphics/Material.hpp>
#include <Nazara/Graphics/SceneNode.hpp>
#include <Nazara/Utility/VertexStruct.hpp>
#include <array>
class NAZARA_API NzSprite : public NzSceneNode
{
@ -55,7 +56,7 @@ class NAZARA_API NzSprite : public NzSceneNode
NzMaterialRef m_material;
NzRectf m_textureCoords;
NzVector2f m_size;
mutable NzVertexStruct_XYZ_Color_UV m_vertices[4];
mutable std::array<NzVertexStruct_XYZ_Color_UV, 4> m_vertices;
mutable bool m_verticesUpdated;
};

View File

@ -96,7 +96,7 @@ class NAZARA_API NzLuaInstance : NzNonCopyable
bool IsOfType(int index, const NzString& tname) const;
bool IsValid(int index) const;
unsigned int Length(int index) const;
long long Length(int index) const;
void MoveTo(NzLuaInstance* instance, int n);

View File

@ -70,8 +70,8 @@ class NAZARA_API NzRenderTexture : public NzRenderTarget, NzNonCopyable
private:
void OnContextDestroy(const NzContext* context);
void OnRenderBufferDestroy(const NzRenderBuffer* renderBuffer, int attachmentIndex);
void OnTextureDestroy(const NzTexture* texture, int attachmentIndex);
void OnRenderBufferDestroy(const NzRenderBuffer* renderBuffer, unsigned int attachmentIndex);
void OnTextureDestroy(const NzTexture* texture, unsigned int attachmentIndex);
void UpdateDrawBuffers() const;
void UpdateSize() const;
void UpdateTargets() const;

View File

@ -3,6 +3,7 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/IndexMapper.hpp>
#include <iterator>
#include <Nazara/Utility/Debug.hpp>
inline NzIndexIterator::NzIndexIterator() :
@ -155,4 +156,17 @@ inline NzIndexIterator::Reference::operator nzUInt32() const
return m_mapper->Get(m_index);
}
namespace std
{
template<>
struct iterator_traits<NzIndexIterator>
{
using difference_type = ptrdiff_t;
using iterator_category = random_access_iterator_tag;
using reference = const NzIndexIterator::Reference&;
using pointer = const NzIndexIterator::Reference*;
using value_type = NzIndexIterator::Reference;
};
}
#include <Nazara/Core/DebugOff.hpp>

View File

@ -7,6 +7,7 @@
#ifndef NAZARA_DYNLIBIMPL_HPP
#define NAZARA_DYNLIBIMPL_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/DynLib.hpp>
#include <Nazara/Core/NonCopyable.hpp>
#include <windows.h>

View File

@ -7,6 +7,7 @@
#ifndef NAZARA_MUTEXIMPL_HPP
#define NAZARA_MUTEXIMPL_HPP
#include <Nazara/Prerequesites.hpp>
#include <windows.h>
class NzMutexImpl

View File

@ -7,6 +7,7 @@
#ifndef NAZARA_WINDOWS_TIME_HPP
#define NAZARA_WINDOWS_TIME_HPP
#include <Nazara/Prerequesites.hpp>
#include <ctime>
#include <windows.h>

View File

@ -163,8 +163,8 @@ void NzCamera::SetTarget(const NzRenderTarget* renderTarget)
if (m_target)
{
m_targetReleaseSlot.Connect(m_target->OnRenderTargetRelease, this, OnRenderTargetRelease);
m_targetResizeSlot.Connect(m_target->OnRenderTargetSizeChange, this, OnRenderTargetSizeChange);
m_targetReleaseSlot.Connect(m_target->OnRenderTargetRelease, this, &NzCamera::OnRenderTargetRelease);
m_targetResizeSlot.Connect(m_target->OnRenderTargetSizeChange, this, &NzCamera::OnRenderTargetSizeChange);
}
else
{

View File

@ -241,8 +241,8 @@ const NzDeferredGeometryPass::ShaderUniforms* NzDeferredGeometryPass::GetShaderU
if (it == m_shaderUniforms.end())
{
ShaderUniforms uniforms;
uniforms.shaderReleaseSlot.Connect(shader->OnShaderRelease, this, OnShaderInvalidated);
uniforms.shaderUniformInvalidatedSlot.Connect(shader->OnShaderUniformInvalidated, this, OnShaderInvalidated);
uniforms.shaderReleaseSlot.Connect(shader->OnShaderRelease, this, &NzDeferredGeometryPass::OnShaderInvalidated);
uniforms.shaderUniformInvalidatedSlot.Connect(shader->OnShaderUniformInvalidated, this, &NzDeferredGeometryPass::OnShaderInvalidated);
uniforms.eyePosition = shader->GetUniformLocation("EyePosition");
uniforms.sceneAmbient = shader->GetUniformLocation("SceneAmbient");

View File

@ -76,7 +76,7 @@ void NzDeferredRenderQueue::AddMesh(const NzMaterial* material, const NzMeshData
if (it == opaqueModels.end())
{
BatchedModelEntry entry;
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, OnMaterialInvalidation);
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &NzDeferredRenderQueue::OnMaterialInvalidation);
it = opaqueModels.insert(std::make_pair(material, std::move(entry))).first;
}
@ -91,9 +91,9 @@ void NzDeferredRenderQueue::AddMesh(const NzMaterial* material, const NzMeshData
{
MeshInstanceEntry instanceEntry;
if (meshData.indexBuffer)
instanceEntry.indexBufferReleaseSlot.Connect(meshData.indexBuffer->OnIndexBufferRelease, this, OnIndexBufferInvalidation);
instanceEntry.indexBufferReleaseSlot.Connect(meshData.indexBuffer->OnIndexBufferRelease, this, &NzDeferredRenderQueue::OnIndexBufferInvalidation);
instanceEntry.vertexBufferReleaseSlot.Connect(meshData.vertexBuffer->OnVertexBufferRelease, this, OnVertexBufferInvalidation);
instanceEntry.vertexBufferReleaseSlot.Connect(meshData.vertexBuffer->OnVertexBufferRelease, this, &NzDeferredRenderQueue::OnVertexBufferInvalidation);
it2 = meshMap.insert(std::make_pair(meshData, std::move(instanceEntry))).first;
}

View File

@ -132,7 +132,7 @@ m_GBufferSize(0U)
{
NzErrorFlags errFlags(nzErrorFlag_ThrowExceptionDisabled);
NazaraError("Failed to add geometry and/or phong lighting pass");
NazaraError("Failed to add geometry and/or phong lighting pass: " + NzString(e.what()));
throw;
}
@ -143,7 +143,7 @@ m_GBufferSize(0U)
}
catch (const std::exception& e)
{
NazaraWarning("Failed to add FXAA pass");
NazaraWarning("Failed to add FXAA pass: " + NzString(e.what()));
}
try
@ -153,7 +153,7 @@ m_GBufferSize(0U)
}
catch (const std::exception& e)
{
NazaraWarning("Failed to add bloom pass");
NazaraWarning("Failed to add bloom pass: " + NzString(e.what()));
}
try
@ -165,7 +165,7 @@ m_GBufferSize(0U)
}
catch (const std::exception& e)
{
NazaraWarning("Failed to add DOF pass");
NazaraWarning("Failed to add DOF pass: " + NzString(e.what()));
}
try
@ -177,7 +177,7 @@ m_GBufferSize(0U)
}
catch (const std::exception& e)
{
NazaraWarning("Failed to add fog pass");
NazaraWarning("Failed to add fog pass: " + NzString(e.what()));
}
try
@ -187,7 +187,7 @@ m_GBufferSize(0U)
}
catch (const std::exception& e)
{
NazaraWarning("Failed to add forward pass");
NazaraWarning("Failed to add forward pass: " + NzString(e.what()));
}
try
@ -197,7 +197,7 @@ m_GBufferSize(0U)
}
catch (const std::exception& e)
{
NazaraWarning("Failed to add SSAO pass");
NazaraWarning("Failed to add SSAO pass: " + NzString(e.what()));
}
}
@ -420,7 +420,7 @@ bool NzDeferredRenderTechnique::Resize(const NzVector2ui& dimensions) const
}
catch (const std::exception& e)
{
NazaraError("Failed to create work RTT/G-Buffer");
NazaraError("Failed to create work RTT/G-Buffer: " + NzString(e.what()));
return false;
}
}

View File

@ -7,12 +7,12 @@
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Graphics/Material.hpp>
#include <Nazara/Graphics/Model.hpp>
#include <Nazara/Graphics/Formats/MTLParser.hpp>
#include <Nazara/Graphics/Formats/OBJParser.hpp>
#include <Nazara/Utility/BufferMapper.hpp>
#include <Nazara/Utility/IndexMapper.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Utility/StaticMesh.hpp>
#include <Nazara/Utility/Formats/MTLParser.hpp>
#include <Nazara/Utility/Formats/OBJParser.hpp>
#include <limits>
#include <memory>
#include <unordered_map>
@ -121,6 +121,8 @@ namespace
model->SetMaterial(meshes[i].material, it->second);
}
return true;
}
bool Load(NzModel* model, NzInputStream& stream, const NzModelParameters& parameters)

View File

@ -17,7 +17,7 @@ void NzForwardRenderQueue::AddBillboard(const NzMaterial* material, const NzVect
if (it == billboards.end())
{
BatchedBillboardEntry entry;
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, OnMaterialInvalidation);
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &NzForwardRenderQueue::OnMaterialInvalidation);
it = billboards.insert(std::make_pair(material, std::move(entry))).first;
}
@ -45,7 +45,7 @@ void NzForwardRenderQueue::AddBillboards(const NzMaterial* material, unsigned in
if (it == billboards.end())
{
BatchedBillboardEntry entry;
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, OnMaterialInvalidation);
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &NzForwardRenderQueue::OnMaterialInvalidation);
it = billboards.insert(std::make_pair(material, std::move(entry))).first;
}
@ -86,7 +86,7 @@ void NzForwardRenderQueue::AddBillboards(const NzMaterial* material, unsigned in
if (it == billboards.end())
{
BatchedBillboardEntry entry;
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, OnMaterialInvalidation);
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &NzForwardRenderQueue::OnMaterialInvalidation);
it = billboards.insert(std::make_pair(material, std::move(entry))).first;
}
@ -125,7 +125,7 @@ void NzForwardRenderQueue::AddBillboards(const NzMaterial* material, unsigned in
if (it == billboards.end())
{
BatchedBillboardEntry entry;
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, OnMaterialInvalidation);
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &NzForwardRenderQueue::OnMaterialInvalidation);
it = billboards.insert(std::make_pair(material, std::move(entry))).first;
}
@ -170,7 +170,7 @@ void NzForwardRenderQueue::AddBillboards(const NzMaterial* material, unsigned in
if (it == billboards.end())
{
BatchedBillboardEntry entry;
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, OnMaterialInvalidation);
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &NzForwardRenderQueue::OnMaterialInvalidation);
it = billboards.insert(std::make_pair(material, std::move(entry))).first;
}
@ -213,7 +213,7 @@ void NzForwardRenderQueue::AddBillboards(const NzMaterial* material, unsigned in
if (it == billboards.end())
{
BatchedBillboardEntry entry;
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, OnMaterialInvalidation);
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &NzForwardRenderQueue::OnMaterialInvalidation);
it = billboards.insert(std::make_pair(material, std::move(entry))).first;
}
@ -254,7 +254,7 @@ void NzForwardRenderQueue::AddBillboards(const NzMaterial* material, unsigned in
if (it == billboards.end())
{
BatchedBillboardEntry entry;
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, OnMaterialInvalidation);
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &NzForwardRenderQueue::OnMaterialInvalidation);
it = billboards.insert(std::make_pair(material, std::move(entry))).first;
}
@ -293,7 +293,7 @@ void NzForwardRenderQueue::AddBillboards(const NzMaterial* material, unsigned in
if (it == billboards.end())
{
BatchedBillboardEntry entry;
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, OnMaterialInvalidation);
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &NzForwardRenderQueue::OnMaterialInvalidation);
it = billboards.insert(std::make_pair(material, std::move(entry))).first;
}
@ -338,7 +338,7 @@ void NzForwardRenderQueue::AddBillboards(const NzMaterial* material, unsigned in
if (it == billboards.end())
{
BatchedBillboardEntry entry;
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, OnMaterialInvalidation);
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &NzForwardRenderQueue::OnMaterialInvalidation);
it = billboards.insert(std::make_pair(material, std::move(entry))).first;
}
@ -399,7 +399,7 @@ void NzForwardRenderQueue::AddMesh(const NzMaterial* material, const NzMeshData&
if (it == opaqueModels.end())
{
BatchedModelEntry entry;
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, OnMaterialInvalidation);
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &NzForwardRenderQueue::OnMaterialInvalidation);
it = opaqueModels.insert(std::make_pair(material, std::move(entry))).first;
}
@ -416,9 +416,9 @@ void NzForwardRenderQueue::AddMesh(const NzMaterial* material, const NzMeshData&
instanceEntry.squaredBoundingSphere = meshAABB.GetSquaredBoundingSphere();
if (meshData.indexBuffer)
instanceEntry.indexBufferReleaseSlot.Connect(meshData.indexBuffer->OnIndexBufferRelease, this, OnIndexBufferInvalidation);
instanceEntry.indexBufferReleaseSlot.Connect(meshData.indexBuffer->OnIndexBufferRelease, this, &NzForwardRenderQueue::OnIndexBufferInvalidation);
instanceEntry.vertexBufferReleaseSlot.Connect(meshData.vertexBuffer->OnVertexBufferRelease, this, OnVertexBufferInvalidation);
instanceEntry.vertexBufferReleaseSlot.Connect(meshData.vertexBuffer->OnVertexBufferRelease, this, &NzForwardRenderQueue::OnVertexBufferInvalidation);
it2 = meshMap.insert(std::make_pair(meshData, std::move(instanceEntry))).first;
}
@ -438,7 +438,7 @@ void NzForwardRenderQueue::AddSprites(const NzMaterial* material, const NzVertex
if (matIt == basicSprites.end())
{
BatchedBasicSpriteEntry entry;
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, OnMaterialInvalidation);
entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &NzForwardRenderQueue::OnMaterialInvalidation);
matIt = basicSprites.insert(std::make_pair(material, std::move(entry))).first;
}
@ -453,7 +453,7 @@ void NzForwardRenderQueue::AddSprites(const NzMaterial* material, const NzVertex
{
BatchedSpriteEntry overlayEntry;
if (overlay)
overlayEntry.textureReleaseSlot.Connect(overlay->OnTextureRelease, this, OnTextureInvalidation);
overlayEntry.textureReleaseSlot.Connect(overlay->OnTextureRelease, this, &NzForwardRenderQueue::OnTextureInvalidation);
overlayIt = overlayMap.insert(std::make_pair(overlay, std::move(overlayEntry))).first;
}

View File

@ -163,7 +163,7 @@ void NzForwardRenderTechnique::Uninitialize()
s_quadVertexBuffer.Reset();
}
bool NzForwardRenderTechnique::ChooseLights(const NzSpheref& object, bool includeDirectionalLights) const
void NzForwardRenderTechnique::ChooseLights(const NzSpheref& object, bool includeDirectionalLights) const
{
m_lights.clear();
@ -740,8 +740,8 @@ const NzForwardRenderTechnique::ShaderUniforms* NzForwardRenderTechnique::GetSha
if (it == m_shaderUniforms.end())
{
ShaderUniforms uniforms;
uniforms.shaderReleaseSlot.Connect(shader->OnShaderRelease, this, OnShaderInvalidated);
uniforms.shaderUniformInvalidatedSlot.Connect(shader->OnShaderUniformInvalidated, this, OnShaderInvalidated);
uniforms.shaderReleaseSlot.Connect(shader->OnShaderRelease, this, &NzForwardRenderTechnique::OnShaderInvalidated);
uniforms.shaderUniformInvalidatedSlot.Connect(shader->OnShaderUniformInvalidated, this, &NzForwardRenderTechnique::OnShaderInvalidated);
uniforms.eyePosition = shader->GetUniformLocation("EyePosition");
uniforms.sceneAmbient = shader->GetUniformLocation("SceneAmbient");

View File

@ -145,7 +145,7 @@ void NzLight::MakeBoundingVolume() const
case nzLightType_Point:
{
NzVector3f radius(m_radius * M_SQRT3);
NzVector3f radius(m_radius * float(M_SQRT3));
m_boundingVolume.Set(-radius, radius);
break;
}

View File

@ -45,7 +45,7 @@ void NzSprite::AddToRenderQueue(NzAbstractRenderQueue* renderQueue) const
if (!m_verticesUpdated)
UpdateVertices();
renderQueue->AddSprites(m_material, m_vertices, 1);
renderQueue->AddSprites(m_material, m_vertices.data(), 1);
}
NzSprite* NzSprite::Clone() const

View File

@ -32,9 +32,9 @@ m_scale(sprite.m_scale)
const NzAbstractAtlas* atlas = it->first;
AtlasSlots& slots = m_atlases[atlas];
slots.clearSlot.Connect(atlas->OnAtlasCleared, this, OnAtlasInvalidated);
slots.layerChangeSlot.Connect(atlas->OnAtlasLayerChange, this, OnAtlasLayerChange);
slots.releaseSlot.Connect(atlas->OnAtlasRelease, this, OnAtlasInvalidated);
slots.clearSlot.Connect(atlas->OnAtlasCleared, this, &NzTextSprite::OnAtlasInvalidated);
slots.layerChangeSlot.Connect(atlas->OnAtlasLayerChange, this, &NzTextSprite::OnAtlasLayerChange);
slots.releaseSlot.Connect(atlas->OnAtlasRelease, this, &NzTextSprite::OnAtlasInvalidated);
}
}
@ -156,9 +156,9 @@ void NzTextSprite::Update(const NzAbstractTextDrawer& drawer)
{
AtlasSlots& slots = m_atlases[atlas];
slots.clearSlot.Connect(atlas->OnAtlasCleared, this, OnAtlasInvalidated);
slots.layerChangeSlot.Connect(atlas->OnAtlasLayerChange, this, OnAtlasLayerChange);
slots.releaseSlot.Connect(atlas->OnAtlasRelease, this, OnAtlasInvalidated);
slots.clearSlot.Connect(atlas->OnAtlasCleared, this, &NzTextSprite::OnAtlasInvalidated);
slots.layerChangeSlot.Connect(atlas->OnAtlasLayerChange, this, &NzTextSprite::OnAtlasLayerChange);
slots.releaseSlot.Connect(atlas->OnAtlasRelease, this, &NzTextSprite::OnAtlasInvalidated);
}
}
@ -262,9 +262,9 @@ NzTextSprite& NzTextSprite::operator=(const NzTextSprite& text)
const NzAbstractAtlas* atlas = it->first;
AtlasSlots& slots = m_atlases[atlas];
slots.clearSlot.Connect(atlas->OnAtlasCleared, this, OnAtlasInvalidated);
slots.layerChangeSlot.Connect(atlas->OnAtlasLayerChange, this, OnAtlasLayerChange);
slots.releaseSlot.Connect(atlas->OnAtlasRelease, this, OnAtlasInvalidated);
slots.clearSlot.Connect(atlas->OnAtlasCleared, this, &NzTextSprite::OnAtlasInvalidated);
slots.layerChangeSlot.Connect(atlas->OnAtlasLayerChange, this, &NzTextSprite::OnAtlasLayerChange);
slots.releaseSlot.Connect(atlas->OnAtlasRelease, this, &NzTextSprite::OnAtlasInvalidated);
}
InvalidateBoundingVolume();

View File

@ -218,8 +218,8 @@ void NzView::SetTarget(const NzRenderTarget* renderTarget)
m_target = renderTarget;
if (m_target)
{
m_targetReleaseSlot.Connect(m_target->OnRenderTargetRelease, this, OnRenderTargetRelease);
m_targetResizeSlot.Connect(m_target->OnRenderTargetSizeChange, this, OnRenderTargetSizeChange);
m_targetReleaseSlot.Connect(m_target->OnRenderTargetRelease, this, &NzView::OnRenderTargetRelease);
m_targetResizeSlot.Connect(m_target->OnRenderTargetSizeChange, this, &NzView::OnRenderTargetSizeChange);
}
else
{

View File

@ -589,7 +589,7 @@ bool NzLuaInstance::IsValid(int index) const
return lua_isnoneornil(m_state, index) == 0;
}
unsigned int NzLuaInstance::Length(int index) const
long long NzLuaInstance::Length(int index) const
{
return luaL_len(m_state, index);
}

View File

@ -151,7 +151,7 @@ bool NzRenderTexture::AttachBuffer(nzAttachmentPoint attachmentPoint, nzUInt8 in
Attachment& attachment = m_impl->attachments[attachIndex];
attachment.attachmentPoint = attachmentPoint;
attachment.buffer = buffer;
attachment.renderBufferDestroySlot.Connect(buffer->OnRenderBufferDestroy, std::bind(OnRenderBufferDestroy, this, std::placeholders::_1, attachIndex));
attachment.renderBufferDestroySlot.Connect(buffer->OnRenderBufferDestroy, std::bind(&NzRenderTexture::OnRenderBufferDestroy, this, std::placeholders::_1, attachIndex));
attachment.isBuffer = true;
attachment.isUsed = true;
attachment.height = buffer->GetHeight();
@ -292,7 +292,7 @@ bool NzRenderTexture::AttachTexture(nzAttachmentPoint attachmentPoint, nzUInt8 i
attachment.isUsed = true;
attachment.height = texture->GetHeight();
attachment.texture = texture;
attachment.textureDestroySlot.Connect(texture->OnTextureDestroy, std::bind(OnTextureDestroy, this, std::placeholders::_1, attachIndex));
attachment.textureDestroySlot.Connect(texture->OnTextureDestroy, std::bind(&NzRenderTexture::OnTextureDestroy, this, std::placeholders::_1, attachIndex));
attachment.width = texture->GetWidth();
m_impl->checked = false;
@ -339,7 +339,7 @@ bool NzRenderTexture::Create(bool lock)
m_impl = impl.release();
m_impl->context = NzContext::GetCurrent();
m_impl->contextDestroySlot.Connect(m_impl->context->OnContextDestroy, this, OnContextDestroy);
m_impl->contextDestroySlot.Connect(m_impl->context->OnContextDestroy, this, &NzRenderTexture::OnContextDestroy);
if (lock)
{
@ -882,7 +882,7 @@ void NzRenderTexture::OnContextDestroy(const NzContext* context)
Destroy();
}
void NzRenderTexture::OnRenderBufferDestroy(const NzRenderBuffer* renderBuffer, int attachmentIndex)
void NzRenderTexture::OnRenderBufferDestroy(const NzRenderBuffer* renderBuffer, unsigned int attachmentIndex)
{
NazaraAssert(m_impl, "Invalid internal state");
NazaraAssert(attachmentIndex < m_impl->attachments.size(), "Invalid attachment index");
@ -898,7 +898,7 @@ void NzRenderTexture::OnRenderBufferDestroy(const NzRenderBuffer* renderBuffer,
m_impl->targetsUpdated = false;
}
void NzRenderTexture::OnTextureDestroy(const NzTexture* texture, int attachmentIndex)
void NzRenderTexture::OnTextureDestroy(const NzTexture* texture, unsigned int attachmentIndex)
{
NazaraAssert(m_impl, "Invalid internal state");
NazaraAssert(attachmentIndex < m_impl->attachments.size(), "Invalid attachment index");

View File

@ -1676,7 +1676,7 @@ bool NzRenderer::EnsureStateUpdate()
if (update)
{
// Pour éviter la duplication de code, on va utiliser une astuce via une boucle for
for (unsigned int i = 0; i < (s_instancing ? 2 : 1); ++i)
for (unsigned int i = 0; i < (s_instancing ? 2U : 1U); ++i)
{
// Selon l'itération nous choisissons un buffer différent
const NzVertexBuffer* vertexBuffer = (i == 0) ? s_vertexBuffer : &s_instanceBuffer;

View File

@ -7,6 +7,7 @@
#ifndef NAZARA_CONTEXTIMPL_HPP
#define NAZARA_CONTEXTIMPL_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Renderer/ContextParameters.hpp>
#include <windows.h>

View File

@ -302,9 +302,9 @@ void NzFont::SetAtlas(const std::shared_ptr<NzAbstractAtlas>& atlas)
m_atlas = atlas;
if (m_atlas)
{
m_atlasClearedSlot.Connect(m_atlas->OnAtlasCleared, this, OnAtlasCleared);
m_atlasLayerChangeSlot.Connect(m_atlas->OnAtlasLayerChange, this, OnAtlasLayerChange);
m_atlasReleaseSlot.Connect(m_atlas->OnAtlasRelease, this, OnAtlasRelease);
m_atlasClearedSlot.Connect(m_atlas->OnAtlasCleared, this, &NzFont::OnAtlasCleared);
m_atlasLayerChangeSlot.Connect(m_atlas->OnAtlasLayerChange, this, &NzFont::OnAtlasLayerChange);
m_atlasReleaseSlot.Connect(m_atlas->OnAtlasRelease, this, &NzFont::OnAtlasRelease);
}
else
{

View File

@ -303,7 +303,7 @@ namespace
m_stream.descriptor.pointer = &stream;
m_stream.read = FT_StreamRead;
m_stream.pos = 0;
m_stream.size = stream.GetSize();
m_stream.size = unsigned long(stream.GetSize());
m_args.driver = 0;
m_args.flags = FT_OPEN_STREAM;

View File

@ -644,7 +644,7 @@ unsigned int NzImage::GetHeight(nzUInt8 level) const
nzUInt8 NzImage::GetLevelCount() const
{
return m_sharedImage->levels.size();
return nzUInt8(m_sharedImage->levels.size());
}
nzUInt8 NzImage::GetMaxLevel() const
@ -1087,7 +1087,7 @@ void NzImage::SetLevelCount(nzUInt8 levelCount)
EnsureOwnership();
nzUInt8 oldLevelCount = m_sharedImage->levels.size();
nzUInt8 oldLevelCount = nzUInt8(m_sharedImage->levels.size());
nzUInt8 maxLevelCount = std::max(levelCount, oldLevelCount);
m_sharedImage->levels.resize(levelCount);

View File

@ -114,10 +114,10 @@ void NzSimpleTextDrawer::SetFont(NzFont* font)
m_font = font;
if (m_font)
{
m_atlasChangedSlot.Connect(m_font->OnFontAtlasChanged, this, OnFontInvalidated);
m_atlasLayerChangedSlot.Connect(m_font->OnFontAtlasLayerChanged, this, OnFontInvalidated);
m_fontReleaseSlot.Connect(m_font->OnFontRelease, this, OnFontRelease);
m_glyphCacheClearedSlot.Connect(m_font->OnFontAtlasChanged, this, OnFontInvalidated);
m_atlasChangedSlot.Connect(m_font->OnFontAtlasChanged, this, &NzSimpleTextDrawer::OnFontInvalidated);
m_atlasLayerChangedSlot.Connect(m_font->OnFontAtlasLayerChanged, this, &NzSimpleTextDrawer::OnFontInvalidated);
m_fontReleaseSlot.Connect(m_font->OnFontRelease, this, &NzSimpleTextDrawer::OnFontRelease);
m_glyphCacheClearedSlot.Connect(m_font->OnFontAtlasChanged, this, &NzSimpleTextDrawer::OnFontInvalidated);
}
else
{

View File

@ -7,6 +7,7 @@
#ifndef NAZARA_CURSORIMPL_HPP
#define NAZARA_CURSORIMPL_HPP
#include <Nazara/Prerequesites.hpp>
#include <windows.h>
class NzImage;

View File

@ -7,6 +7,7 @@
#ifndef NAZARA_ICONIMPL_HPP
#define NAZARA_ICONIMPL_HPP
#include <Nazara/Prerequesites.hpp>
#include <windows.h>
class NzImage;

View File

@ -9,6 +9,7 @@
#ifndef NAZARA_WINDOWIMPL_HPP
#define NAZARA_WINDOWIMPL_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/NonCopyable.hpp>
#include <Nazara/Core/String.hpp>
#include <Nazara/Core/Thread.hpp>