Ogre: Don't create std::strings in global scope where char pointer will do

pull/1753/head
Turo Lamminen 2018-01-30 20:03:28 +02:00
parent 0c66b3902e
commit cfc9a69512
1 changed files with 47 additions and 47 deletions

View File

@ -231,75 +231,75 @@ std::string &OgreXmlSerializer::SkipCurrentNode()
// Mesh XML constants // Mesh XML constants
// <mesh> // <mesh>
const std::string nnMesh = "mesh"; const char *nnMesh = "mesh";
const std::string nnSharedGeometry = "sharedgeometry"; const char *nnSharedGeometry = "sharedgeometry";
const std::string nnSubMeshes = "submeshes"; const char *nnSubMeshes = "submeshes";
const std::string nnSubMesh = "submesh"; const char *nnSubMesh = "submesh";
const std::string nnSubMeshNames = "submeshnames"; const char *nnSubMeshNames = "submeshnames";
const std::string nnSkeletonLink = "skeletonlink"; const char *nnSkeletonLink = "skeletonlink";
const std::string nnLOD = "levelofdetail"; const char *nnLOD = "levelofdetail";
const std::string nnExtremes = "extremes"; const char *nnExtremes = "extremes";
const std::string nnPoses = "poses"; const char *nnPoses = "poses";
const std::string nnAnimations = "animations"; const char *nnAnimations = "animations";
// <submesh> // <submesh>
const std::string nnFaces = "faces"; const char *nnFaces = "faces";
const std::string nnFace = "face"; const char *nnFace = "face";
const std::string nnGeometry = "geometry"; const char *nnGeometry = "geometry";
const std::string nnTextures = "textures"; const char *nnTextures = "textures";
// <mesh/submesh> // <mesh/submesh>
const std::string nnBoneAssignments = "boneassignments"; const char *nnBoneAssignments = "boneassignments";
// <sharedgeometry/geometry> // <sharedgeometry/geometry>
const std::string nnVertexBuffer = "vertexbuffer"; const char *nnVertexBuffer = "vertexbuffer";
// <vertexbuffer> // <vertexbuffer>
const std::string nnVertex = "vertex"; const char *nnVertex = "vertex";
const std::string nnPosition = "position"; const char *nnPosition = "position";
const std::string nnNormal = "normal"; const char *nnNormal = "normal";
const std::string nnTangent = "tangent"; const char *nnTangent = "tangent";
const std::string nnBinormal = "binormal"; const char *nnBinormal = "binormal";
const std::string nnTexCoord = "texcoord"; const char *nnTexCoord = "texcoord";
const std::string nnColorDiffuse = "colour_diffuse"; const char *nnColorDiffuse = "colour_diffuse";
const std::string nnColorSpecular = "colour_specular"; const char *nnColorSpecular = "colour_specular";
// <boneassignments> // <boneassignments>
const std::string nnVertexBoneAssignment = "vertexboneassignment"; const char *nnVertexBoneAssignment = "vertexboneassignment";
// Skeleton XML constants // Skeleton XML constants
// <skeleton> // <skeleton>
const std::string nnSkeleton = "skeleton"; const char *nnSkeleton = "skeleton";
const std::string nnBones = "bones"; const char *nnBones = "bones";
const std::string nnBoneHierarchy = "bonehierarchy"; const char *nnBoneHierarchy = "bonehierarchy";
const std::string nnAnimationLinks = "animationlinks"; const char *nnAnimationLinks = "animationlinks";
// <bones> // <bones>
const std::string nnBone = "bone"; const char *nnBone = "bone";
const std::string nnRotation = "rotation"; const char *nnRotation = "rotation";
const std::string nnAxis = "axis"; const char *nnAxis = "axis";
const std::string nnScale = "scale"; const char *nnScale = "scale";
// <bonehierarchy> // <bonehierarchy>
const std::string nnBoneParent = "boneparent"; const char *nnBoneParent = "boneparent";
// <animations> // <animations>
const std::string nnAnimation = "animation"; const char *nnAnimation = "animation";
const std::string nnTracks = "tracks"; const char *nnTracks = "tracks";
// <tracks> // <tracks>
const std::string nnTrack = "track"; const char *nnTrack = "track";
const std::string nnKeyFrames = "keyframes"; const char *nnKeyFrames = "keyframes";
const std::string nnKeyFrame = "keyframe"; const char *nnKeyFrame = "keyframe";
const std::string nnTranslate = "translate"; const char *nnTranslate = "translate";
const std::string nnRotate = "rotate"; const char *nnRotate = "rotate";
// Common XML constants // Common XML constants
const std::string anX = "x"; const char *anX = "x";
const std::string anY = "y"; const char *anY = "y";
const std::string anZ = "z"; const char *anZ = "z";
// Mesh // Mesh
@ -968,11 +968,11 @@ void OgreXmlSerializer::ReadBones(Skeleton *skeleton)
} }
else else
{ {
if (HasAttribute(anX.c_str())) if (HasAttribute(anX))
bone->scale.x = ReadAttribute<float>(anX); bone->scale.x = ReadAttribute<float>(anX);
if (HasAttribute(anY.c_str())) if (HasAttribute(anY))
bone->scale.y = ReadAttribute<float>(anY); bone->scale.y = ReadAttribute<float>(anY);
if (HasAttribute(anZ.c_str())) if (HasAttribute(anZ))
bone->scale.z = ReadAttribute<float>(anZ); bone->scale.z = ReadAttribute<float>(anZ);
} }
} }