diff --git a/components/nif/data.cpp b/components/nif/data.cpp index 3a06e4006..fc0631b84 100644 --- a/components/nif/data.cpp +++ b/components/nif/data.cpp @@ -71,7 +71,7 @@ void NiTriShapeData::read(NIFStream *nif) // We have three times as many vertices as triangles, so this // is always equal to tris*3. int cnt = nif->getInt(); - nif->getShorts(triangles, cnt); + nif->getUShorts(triangles, cnt); // Read the match list, which lists the vertices that are equal to // vertices. We don't actually need need this for anything, so diff --git a/components/nif/data.hpp b/components/nif/data.hpp index 1b4d02f26..63dc42ade 100644 --- a/components/nif/data.hpp +++ b/components/nif/data.hpp @@ -48,7 +48,7 @@ class NiTriShapeData : public ShapeData { public: // Triangles, three vertex indices per triangle - std::vector triangles; + std::vector triangles; void read(NIFStream *nif); }; @@ -144,7 +144,7 @@ class NiSkinData : public Record public: struct VertWeight { - short vertex; + unsigned short vertex; float weight; }; diff --git a/components/nif/nifstream.cpp b/components/nif/nifstream.cpp index 628541933..d0fc9bab0 100644 --- a/components/nif/nifstream.cpp +++ b/components/nif/nifstream.cpp @@ -103,11 +103,11 @@ std::string NIFStream::getVersionString() return result; } -void NIFStream::getShorts(std::vector &vec, size_t size) +void NIFStream::getUShorts(std::vector &vec, size_t size) { vec.resize(size); for(size_t i = 0;i < vec.size();i++) - vec[i] = getShort(); + vec[i] = getUShort(); } void NIFStream::getFloats(std::vector &vec, size_t size) { diff --git a/components/nif/nifstream.hpp b/components/nif/nifstream.hpp index b732c83af..45733f48f 100644 --- a/components/nif/nifstream.hpp +++ b/components/nif/nifstream.hpp @@ -59,7 +59,7 @@ public: ///This is special since the version string doesn't start with a number, and ends with "\n" std::string getVersionString(); - void getShorts(std::vector &vec, size_t size); + void getUShorts(std::vector &vec, size_t size); void getFloats(std::vector &vec, size_t size); void getVector2s(std::vector &vec, size_t size); void getVector3s(std::vector &vec, size_t size); diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index b28412cb6..f7f6af0ae 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -1146,7 +1146,7 @@ namespace NifOsg //influence.mWeights.reserve(weights.size()); for(size_t j = 0;j < weights.size();j++) { - std::pair indexWeight = std::make_pair(weights[j].vertex, weights[j].weight); + std::pair indexWeight = std::make_pair(weights[j].vertex, weights[j].weight); influence.mWeights.insert(indexWeight); } influence.mInvBindMatrix = toMatrix(data->bones[i].trafo); diff --git a/components/sceneutil/riggeometry.cpp b/components/sceneutil/riggeometry.cpp index 00f80c829..4d4ea22d2 100644 --- a/components/sceneutil/riggeometry.cpp +++ b/components/sceneutil/riggeometry.cpp @@ -172,9 +172,9 @@ void RigGeometry::update(osg::NodeVisitor* nv) osg::Matrixf finalMatrix = bi.mInvBindMatrix * bone->mMatrixInSkeletonSpace * geomToSkel; - for (std::map::const_iterator weightIt = bi.mWeights.begin(); weightIt != bi.mWeights.end(); ++weightIt) + for (std::map::const_iterator weightIt = bi.mWeights.begin(); weightIt != bi.mWeights.end(); ++weightIt) { - short vertex = weightIt->first; + unsigned short vertex = weightIt->first; float weight = weightIt->second; osg::Vec3f a = (*positionSrc)[vertex]; diff --git a/components/sceneutil/riggeometry.hpp b/components/sceneutil/riggeometry.hpp index 70f2c6e7d..c77ff7c72 100644 --- a/components/sceneutil/riggeometry.hpp +++ b/components/sceneutil/riggeometry.hpp @@ -25,7 +25,7 @@ namespace SceneUtil { osg::Matrixf mInvBindMatrix; // - std::map mWeights; + std::map mWeights; }; struct InfluenceMap : public osg::Referenced