Utility: First code cleaning pass
Former-commit-id: 5e8a6fe1d39919f583d6ec52c3a6441ea16db0d1 [formerly 6013fccf81504ad739456c6bf2a0f32f51cd0976] [formerly 6eca34e7eb539427281a09520652f6b63a09d2ef [formerly 42f25260bb808235785af682cc8227be5ced64dd]] Former-commit-id: 82fd5b55a89ae15950b1bae4164fc93f4761edf9 [formerly 7be9e16acf53f75829a6ef00cea4aca8032820de] Former-commit-id: f96d5a14ced9e7aa0a16c63c0a9c467d752ecf05
This commit is contained in:
@@ -58,9 +58,9 @@ namespace Nz
|
||||
return m_joints.data();
|
||||
}
|
||||
|
||||
std::size_t MD5MeshParser::GetJointCount() const
|
||||
UInt32 MD5MeshParser::GetJointCount() const
|
||||
{
|
||||
return m_joints.size();
|
||||
return static_cast<UInt32>(m_joints.size());
|
||||
}
|
||||
|
||||
const MD5MeshParser::Mesh* MD5MeshParser::GetMeshes() const
|
||||
@@ -68,9 +68,9 @@ namespace Nz
|
||||
return m_meshes.data();
|
||||
}
|
||||
|
||||
std::size_t MD5MeshParser::GetMeshCount() const
|
||||
UInt32 MD5MeshParser::GetMeshCount() const
|
||||
{
|
||||
return m_meshes.size();
|
||||
return static_cast<UInt32>(m_meshes.size());
|
||||
}
|
||||
|
||||
bool MD5MeshParser::Parse()
|
||||
@@ -211,19 +211,19 @@ namespace Nz
|
||||
|
||||
bool MD5MeshParser::ParseJoints()
|
||||
{
|
||||
unsigned int jointCount = m_joints.size();
|
||||
std::size_t jointCount = m_joints.size();
|
||||
if (jointCount == 0)
|
||||
{
|
||||
Error("Joint count is invalid or missing");
|
||||
return false;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < jointCount; ++i)
|
||||
for (std::size_t i = 0; i < jointCount; ++i)
|
||||
{
|
||||
if (!Advance())
|
||||
return false;
|
||||
|
||||
unsigned int pos = m_currentLine.Find(' ');
|
||||
std::size_t pos = m_currentLine.Find(' ');
|
||||
if (pos == String::npos)
|
||||
{
|
||||
UnrecognizedLine(true);
|
||||
@@ -248,10 +248,10 @@ namespace Nz
|
||||
m_joints[i].name = name;
|
||||
m_joints[i].name.Trim('"');
|
||||
|
||||
int parent = m_joints[i].parent;
|
||||
Int32 parent = m_joints[i].parent;
|
||||
if (parent >= 0)
|
||||
{
|
||||
if (static_cast<unsigned int>(parent) >= jointCount)
|
||||
if (static_cast<std::size_t>(parent) >= jointCount)
|
||||
{
|
||||
Error("Joint's parent is out of bounds (" + String::Number(parent) + " >= " + String::Number(jointCount) + ')');
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user