C++11-combat: hopefully the last std::to_string to replace.
parent
46d78f57d5
commit
5cb4df80ad
|
@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
// Header files, Assimp.
|
// Header files, Assimp.
|
||||||
#include "SceneCombiner.h"
|
#include "SceneCombiner.h"
|
||||||
#include "StandardShapes.h"
|
#include "StandardShapes.h"
|
||||||
|
#include "StringUtils.h"
|
||||||
|
|
||||||
// Header files, stdlib.
|
// Header files, stdlib.
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -950,7 +951,7 @@ nl_clean_loop:
|
||||||
pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials];
|
pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials];
|
||||||
for(const SPP_Texture& tex_convd: mTexture_Converted)
|
for(const SPP_Texture& tex_convd: mTexture_Converted)
|
||||||
{
|
{
|
||||||
const aiString texture_id(AI_EMBEDDED_TEXNAME_PREFIX + std::to_string(idx));
|
const aiString texture_id(AI_EMBEDDED_TEXNAME_PREFIX + to_string(idx));
|
||||||
const int mode = aiTextureOp_Multiply;
|
const int mode = aiTextureOp_Multiply;
|
||||||
const int repeat = tex_convd.Tiled ? 1 : 0;
|
const int repeat = tex_convd.Tiled ? 1 : 0;
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
#include "SceneCombiner.h"
|
#include "SceneCombiner.h"
|
||||||
#include "DefaultIOSystem.h"
|
#include "DefaultIOSystem.h"
|
||||||
|
#include "StringUtils.h"
|
||||||
#include "XMLTools.h"
|
#include "XMLTools.h"
|
||||||
#include <assimp/IOSystem.hpp>
|
#include <assimp/IOSystem.hpp>
|
||||||
#include <assimp/Exporter.hpp>
|
#include <assimp/Exporter.hpp>
|
||||||
|
@ -637,7 +638,7 @@ void ColladaExporter::WriteMaterials()
|
||||||
aiString name;
|
aiString name;
|
||||||
if( mat->Get( AI_MATKEY_NAME, name) != aiReturn_SUCCESS )
|
if( mat->Get( AI_MATKEY_NAME, name) != aiReturn_SUCCESS )
|
||||||
name = "mat";
|
name = "mat";
|
||||||
materials[a].name = std::string( "m") + std::to_string(a) + name.C_Str();
|
materials[a].name = std::string( "m") + to_string(a) + name.C_Str();
|
||||||
for( std::string::iterator it = materials[a].name.begin(); it != materials[a].name.end(); ++it ) {
|
for( std::string::iterator it = materials[a].name.begin(); it != materials[a].name.end(); ++it ) {
|
||||||
if( !isalnum_C( *it ) ) {
|
if( !isalnum_C( *it ) ) {
|
||||||
*it = '_';
|
*it = '_';
|
||||||
|
@ -813,7 +814,7 @@ void ColladaExporter::WriteGeometry( size_t pIndex)
|
||||||
{
|
{
|
||||||
if( mesh->HasTextureCoords( a) )
|
if( mesh->HasTextureCoords( a) )
|
||||||
{
|
{
|
||||||
WriteFloatArray( idstr + "-tex" + std::to_string(a), mesh->mNumUVComponents[a] == 3 ? FloatType_TexCoord3 : FloatType_TexCoord2,
|
WriteFloatArray( idstr + "-tex" + to_string(a), mesh->mNumUVComponents[a] == 3 ? FloatType_TexCoord3 : FloatType_TexCoord2,
|
||||||
(ai_real*) mesh->mTextureCoords[a], mesh->mNumVertices);
|
(ai_real*) mesh->mTextureCoords[a], mesh->mNumVertices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -822,7 +823,7 @@ void ColladaExporter::WriteGeometry( size_t pIndex)
|
||||||
for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a)
|
for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a)
|
||||||
{
|
{
|
||||||
if( mesh->HasVertexColors( a) )
|
if( mesh->HasVertexColors( a) )
|
||||||
WriteFloatArray( idstr + "-color" + std::to_string(a), FloatType_Color, (ai_real*) mesh->mColors[a], mesh->mNumVertices);
|
WriteFloatArray( idstr + "-color" + to_string(a), FloatType_Color, (ai_real*) mesh->mColors[a], mesh->mNumVertices);
|
||||||
}
|
}
|
||||||
|
|
||||||
// assemble vertex structure
|
// assemble vertex structure
|
||||||
|
|
|
@ -53,6 +53,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
#include "StringUtils.h"
|
||||||
|
|
||||||
struct aiScene;
|
struct aiScene;
|
||||||
struct aiNode;
|
struct aiNode;
|
||||||
|
|
||||||
|
@ -122,7 +124,9 @@ protected:
|
||||||
void PopTag() { ai_assert( startstr.length() > 1); startstr.erase( startstr.length() - 2); }
|
void PopTag() { ai_assert( startstr.length() > 1); startstr.erase( startstr.length() - 2); }
|
||||||
|
|
||||||
/// Creates a mesh ID for the given mesh
|
/// Creates a mesh ID for the given mesh
|
||||||
std::string GetMeshId( size_t pIndex) const { return std::string( "meshId" ) + std::to_string(pIndex); }
|
std::string GetMeshId( size_t pIndex) const {
|
||||||
|
return std::string( "meshId" ) + to_string(pIndex);
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Stringstream to write all output into
|
/// Stringstream to write all output into
|
||||||
|
|
|
@ -300,7 +300,7 @@ void ColladaParser::ReadAnimationClipLibrary()
|
||||||
else if (indexID >= 0)
|
else if (indexID >= 0)
|
||||||
animName = mReader->getAttributeValue(indexID);
|
animName = mReader->getAttributeValue(indexID);
|
||||||
else
|
else
|
||||||
animName = std::string("animation_") + std::to_string(mAnimationClipLibrary.size());
|
animName = std::string("animation_") + to_string(mAnimationClipLibrary.size());
|
||||||
|
|
||||||
std::pair<std::string, std::vector<std::string> > clip;
|
std::pair<std::string, std::vector<std::string> > clip;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue