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

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
{