Fix a shitload of warnings in 64 bits mode

Former-commit-id: c7792a7d5b1f85ab934da25324831b9daa3f47ff [formerly 3469974c48432be1f65808bff0ea39d9e22f5b50]
Former-commit-id: 5080815e9e1a3aebe237ff9a291b908ce0292eca
This commit is contained in:
Lynix
2016-06-13 21:09:55 +02:00
parent f36eec7346
commit 819b46f5fc
39 changed files with 191 additions and 188 deletions

View File

@@ -127,7 +127,7 @@ namespace Nz
return m_atlas;
}
unsigned int Font::GetCachedGlyphCount(unsigned int characterSize, UInt32 style) const
std::size_t Font::GetCachedGlyphCount(unsigned int characterSize, UInt32 style) const
{
UInt64 key = ComputeKey(characterSize, style);
auto it = m_glyphes.find(key);
@@ -137,9 +137,9 @@ namespace Nz
return it->second.size();
}
unsigned int Font::GetCachedGlyphCount() const
std::size_t Font::GetCachedGlyphCount() const
{
unsigned int count = 0;
std::size_t count = 0;
for (auto& pair : m_glyphes)
count += pair.second.size();

View File

@@ -37,10 +37,10 @@ namespace Nz
}
const MD5AnimParser::Frame* frames = parser.GetFrames();
unsigned int frameCount = parser.GetFrameCount();
unsigned int frameRate = parser.GetFrameRate();
std::size_t frameCount = parser.GetFrameCount();
std::size_t frameRate = parser.GetFrameRate();
const MD5AnimParser::Joint* joints = parser.GetJoints();
unsigned int jointCount = parser.GetJointCount();
std::size_t jointCount = parser.GetJointCount();
// À ce stade, nous sommes censés avoir assez d'informations pour créer l'animation
animation->CreateSkeletal(frameCount, jointCount);
@@ -59,10 +59,10 @@ namespace Nz
Quaternionf rotationQuat = Quaternionf::RotationBetween(Vector3f::UnitX(), Vector3f::Forward()) *
Quaternionf::RotationBetween(Vector3f::UnitZ(), Vector3f::Up());
for (unsigned int i = 0; i < jointCount; ++i)
for (std::size_t i = 0; i < jointCount; ++i)
{
int parent = joints[i].parent;
for (unsigned int j = 0; j < frameCount; ++j)
for (std::size_t j = 0; j < frameCount; ++j)
{
SequenceJoint& sequenceJoint = sequenceJoints[j*jointCount + i];

View File

@@ -48,7 +48,7 @@ namespace Nz
return Ternary_False;
}
unsigned int MD5AnimParser::GetAnimatedComponentCount() const
std::size_t MD5AnimParser::GetAnimatedComponentCount() const
{
return m_animatedComponents.size();
}
@@ -58,12 +58,12 @@ namespace Nz
return m_frames.data();
}
unsigned int MD5AnimParser::GetFrameCount() const
std::size_t MD5AnimParser::GetFrameCount() const
{
return m_frames.size();
}
unsigned int MD5AnimParser::GetFrameRate() const
std::size_t MD5AnimParser::GetFrameRate() const
{
return m_frameRate;
}
@@ -73,7 +73,7 @@ namespace Nz
return m_joints.data();
}
unsigned int MD5AnimParser::GetJointCount() const
std::size_t MD5AnimParser::GetJointCount() const
{
return m_joints.size();
}

View File

@@ -53,15 +53,15 @@ namespace Nz
const MD5MeshParser::Joint* joints = parser.GetJoints();
const MD5MeshParser::Mesh* meshes = parser.GetMeshes();
unsigned int jointCount = parser.GetJointCount();
unsigned int meshCount = parser.GetMeshCount();
std::size_t jointCount = parser.GetJointCount();
std::size_t meshCount = parser.GetMeshCount();
if (parameters.animated)
{
mesh->CreateSkeletal(jointCount);
Skeleton* skeleton = mesh->GetSkeleton();
for (unsigned int i = 0; i < jointCount; ++i)
for (std::size_t i = 0; i < jointCount; ++i)
{
Joint* joint = skeleton->GetJoint(i);
@@ -82,12 +82,12 @@ namespace Nz
}
mesh->SetMaterialCount(meshCount);
for (unsigned int i = 0; i < meshCount; ++i)
for (std::size_t i = 0; i < meshCount; ++i)
{
const MD5MeshParser::Mesh& md5Mesh = meshes[i];
unsigned int indexCount = md5Mesh.triangles.size()*3;
unsigned int vertexCount = md5Mesh.vertices.size();
std::size_t indexCount = md5Mesh.triangles.size()*3;
std::size_t vertexCount = md5Mesh.vertices.size();
bool largeIndices = (vertexCount > std::numeric_limits<UInt16>::max());
@@ -227,11 +227,11 @@ namespace Nz
}
mesh->SetMaterialCount(meshCount);
for (unsigned int i = 0; i < meshCount; ++i)
for (std::size_t i = 0; i < meshCount; ++i)
{
const MD5MeshParser::Mesh& md5Mesh = meshes[i];
unsigned int indexCount = md5Mesh.triangles.size()*3;
unsigned int vertexCount = md5Mesh.vertices.size();
std::size_t indexCount = md5Mesh.triangles.size()*3;
std::size_t vertexCount = md5Mesh.vertices.size();
// Index buffer
bool largeIndices = (vertexCount > std::numeric_limits<UInt16>::max());

View File

@@ -58,7 +58,7 @@ namespace Nz
return m_joints.data();
}
unsigned int MD5MeshParser::GetJointCount() const
std::size_t MD5MeshParser::GetJointCount() const
{
return m_joints.size();
}
@@ -68,7 +68,7 @@ namespace Nz
return m_meshes.data();
}
unsigned int MD5MeshParser::GetMeshCount() const
std::size_t MD5MeshParser::GetMeshCount() const
{
return m_meshes.size();
}

View File

@@ -70,7 +70,7 @@ namespace Nz
return layer.image.get();
}
unsigned int GuillotineImageAtlas::GetLayerCount() const
std::size_t GuillotineImageAtlas::GetLayerCount() const
{
return m_layers.size();
}

View File

@@ -666,7 +666,7 @@ namespace Nz
return GetMaxLevel(m_sharedImage->type, m_sharedImage->width, m_sharedImage->height, m_sharedImage->depth);
}
unsigned int Image::GetMemoryUsage() const
std::size_t Image::GetMemoryUsage() const
{
unsigned int width = m_sharedImage->width;
unsigned int height = m_sharedImage->height;
@@ -693,7 +693,7 @@ namespace Nz
return size * PixelFormat::GetBytesPerPixel(m_sharedImage->format);
}
unsigned int Image::GetMemoryUsage(UInt8 level) const
std::size_t Image::GetMemoryUsage(UInt8 level) const
{
return PixelFormat::ComputeSize(m_sharedImage->format, GetLevelSize(m_sharedImage->width, level), GetLevelSize(m_sharedImage->height, level), ((m_sharedImage->type == ImageType_Cubemap) ? 6 : GetLevelSize(m_sharedImage->depth, level)));
}

View File

@@ -72,19 +72,19 @@ namespace Nz
return m_font;
}
Font* SimpleTextDrawer::GetFont(unsigned int index) const
Font* SimpleTextDrawer::GetFont(std::size_t index) const
{
NazaraAssert(index == 0, "Font index out of range");
return m_font;
}
unsigned int SimpleTextDrawer::GetFontCount() const
std::size_t SimpleTextDrawer::GetFontCount() const
{
return 1;
}
const AbstractTextDrawer::Glyph& SimpleTextDrawer::GetGlyph(unsigned int index) const
const AbstractTextDrawer::Glyph& SimpleTextDrawer::GetGlyph(std::size_t index) const
{
if (!m_glyphUpdated)
UpdateGlyphs();
@@ -94,7 +94,7 @@ namespace Nz
return m_glyphs[index];
}
unsigned int SimpleTextDrawer::GetGlyphCount() const
std::size_t SimpleTextDrawer::GetGlyphCount() const
{
if (!m_glyphUpdated)
UpdateGlyphs();

View File

@@ -394,7 +394,7 @@ namespace Nz
void WindowImpl::SetMaximumSize(int width, int height)
{
RECT rect = {0, 0, width, height};
AdjustWindowRect(&rect, GetWindowLongPtr(m_handle, GWL_STYLE), false);
AdjustWindowRect(&rect, static_cast<DWORD>(GetWindowLongPtr(m_handle, GWL_STYLE)), false);
if (width != -1)
m_maxSize.x = rect.right-rect.left;
@@ -410,7 +410,7 @@ namespace Nz
void WindowImpl::SetMinimumSize(int width, int height)
{
RECT rect = {0, 0, width, height};
AdjustWindowRect(&rect, GetWindowLongPtr(m_handle, GWL_STYLE), false);
AdjustWindowRect(&rect, static_cast<DWORD>(GetWindowLongPtr(m_handle, GWL_STYLE)), false);
if (width != -1)
m_minSize.x = rect.right-rect.left;
@@ -432,7 +432,7 @@ namespace Nz
{
// SetWindowPos demande la taille totale de la fenêtre
RECT rect = {0, 0, static_cast<LONG>(width), static_cast<LONG>(height)};
AdjustWindowRect(&rect, GetWindowLongPtr(m_handle, GWL_STYLE), false);
AdjustWindowRect(&rect, static_cast<DWORD>(GetWindowLongPtr(m_handle, GWL_STYLE)), false);
SetWindowPos(m_handle, nullptr, 0, 0, rect.right - rect.left, rect.bottom - rect.top, SWP_NOMOVE | SWP_NOZORDER);
}