Fixed some VS warnings

Thanks to Fraggy again !


Former-commit-id: bd0eea66714701b065892d8b69d576e7b3615dd2
This commit is contained in:
Lynix
2013-09-21 00:10:10 +02:00
parent 6440d38c5c
commit 3167531b39
19 changed files with 95 additions and 73 deletions

View File

@@ -306,9 +306,9 @@ void NzCamera::UpdateViewport() const
m_projectionMatrixUpdated = false;
}
m_viewport.x = width * m_targetRegion.x;
m_viewport.y = height * m_targetRegion.y;
m_viewport.width = vWidth;
m_viewport.height = vHeight;
m_viewport.x = static_cast<int>(width * m_targetRegion.x);
m_viewport.y = static_cast<int>(height * m_targetRegion.y);
m_viewport.width = static_cast<int>(vWidth);
m_viewport.height = static_cast<int>(vHeight);
m_viewportUpdated = true;
}

View File

@@ -52,7 +52,7 @@ bool NzMTLParser::Parse()
if (!currentMaterial)
currentMaterial = &m_materials["default"];
currentMaterial->ambient = NzColor(r*255.f, g*255.f, b*255.f);
currentMaterial->ambient = NzColor(static_cast<nzUInt8>(r*255.f), static_cast<nzUInt8>(g*255.f), static_cast<nzUInt8>(b*255.f));
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
else
@@ -67,7 +67,7 @@ bool NzMTLParser::Parse()
if (!currentMaterial)
currentMaterial = &m_materials["default"];
currentMaterial->diffuse = NzColor(r*255.f, g*255.f, b*255.f);
currentMaterial->diffuse = NzColor(static_cast<nzUInt8>(r*255.f), static_cast<nzUInt8>(g*255.f), static_cast<nzUInt8>(b*255.f));
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
else
@@ -82,7 +82,7 @@ bool NzMTLParser::Parse()
if (!currentMaterial)
currentMaterial = &m_materials["default"];
currentMaterial->specular = NzColor(r*255.f, g*255.f, b*255.f);
currentMaterial->specular = NzColor(static_cast<nzUInt8>(r*255.f), static_cast<nzUInt8>(g*255.f), static_cast<nzUInt8>(b*255.f));
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
else

View File

@@ -277,9 +277,9 @@ void NzView::UpdateViewport() const
unsigned int width = m_target->GetWidth();
unsigned int height = std::max(m_target->GetHeight(), 1U);
m_viewport.x = width * m_targetRegion.x;
m_viewport.y = height * m_targetRegion.y;
m_viewport.width = width * m_targetRegion.width;
m_viewport.height = height * m_targetRegion.height;
m_viewport.x = static_cast<int>(width * m_targetRegion.x);
m_viewport.y = static_cast<int>(height * m_targetRegion.y);
m_viewport.width = static_cast<int>(width * m_targetRegion.width);
m_viewport.height = static_cast<int>(height * m_targetRegion.height);
m_viewportUpdated = true;
}