CodeQuality improvements
Several small code improvements based on a cppcheck resultpull/581/head
parent
36a9f2be1a
commit
b8c12fdc6f
|
@ -757,7 +757,7 @@ void Discreet3DSImporter::GenerateNodeGraph(aiScene* pcOut)
|
||||||
pcNode->mNumMeshes = 1;
|
pcNode->mNumMeshes = 1;
|
||||||
|
|
||||||
// Build a name for the node
|
// Build a name for the node
|
||||||
pcNode->mName.length = sprintf(pcNode->mName.data,"3DSMesh_%i",i);
|
pcNode->mName.length = sprintf(pcNode->mName.data,"3DSMesh_%u",i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build dummy nodes for all cameras
|
// Build dummy nodes for all cameras
|
||||||
|
|
|
@ -143,9 +143,9 @@ void Parser::LogWarning(const char* szWarn)
|
||||||
|
|
||||||
char szTemp[1024];
|
char szTemp[1024];
|
||||||
#if _MSC_VER >= 1400
|
#if _MSC_VER >= 1400
|
||||||
sprintf_s(szTemp,"Line %i: %s",iLineNumber,szWarn);
|
sprintf_s(szTemp,"Line %u: %s",iLineNumber,szWarn);
|
||||||
#else
|
#else
|
||||||
snprintf(szTemp,1024,"Line %i: %s",iLineNumber,szWarn);
|
snprintf(szTemp,1024,"Line %u: %s",iLineNumber,szWarn);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// output the warning to the logger ...
|
// output the warning to the logger ...
|
||||||
|
@ -159,9 +159,9 @@ void Parser::LogInfo(const char* szWarn)
|
||||||
|
|
||||||
char szTemp[1024];
|
char szTemp[1024];
|
||||||
#if _MSC_VER >= 1400
|
#if _MSC_VER >= 1400
|
||||||
sprintf_s(szTemp,"Line %i: %s",iLineNumber,szWarn);
|
sprintf_s(szTemp,"Line %u: %s",iLineNumber,szWarn);
|
||||||
#else
|
#else
|
||||||
snprintf(szTemp,1024,"Line %i: %s",iLineNumber,szWarn);
|
snprintf(szTemp,1024,"Line %u: %s",iLineNumber,szWarn);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// output the information to the logger ...
|
// output the information to the logger ...
|
||||||
|
@ -175,9 +175,9 @@ AI_WONT_RETURN void Parser::LogError(const char* szWarn)
|
||||||
|
|
||||||
char szTemp[1024];
|
char szTemp[1024];
|
||||||
#if _MSC_VER >= 1400
|
#if _MSC_VER >= 1400
|
||||||
sprintf_s(szTemp,"Line %i: %s",iLineNumber,szWarn);
|
sprintf_s(szTemp,"Line %u: %s",iLineNumber,szWarn);
|
||||||
#else
|
#else
|
||||||
snprintf(szTemp,1024,"Line %i: %s",iLineNumber,szWarn);
|
snprintf(szTemp,1024,"Line %u: %s",iLineNumber,szWarn);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// throw an exception
|
// throw an exception
|
||||||
|
|
|
@ -147,7 +147,7 @@ void DeboneProcess::Execute( aiScene* pScene)
|
||||||
|
|
||||||
if(!DefaultLogger::isNullLogger()) {
|
if(!DefaultLogger::isNullLogger()) {
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
::sprintf(buffer,"Removed %i bones. Input bones: %i. Output bones: %i",in-out,in,out);
|
::sprintf(buffer,"Removed %u bones. Input bones: %u. Output bones: %u",in-out,in,out);
|
||||||
DefaultLogger::get()->info(buffer);
|
DefaultLogger::get()->info(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -258,7 +258,7 @@ void DefaultLogger::OnDebug( const char* message )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char msg[MAX_LOG_MESSAGE_LENGTH + 16];
|
char msg[MAX_LOG_MESSAGE_LENGTH + 16];
|
||||||
::sprintf(msg,"Debug, T%i: %s", GetThreadID(), message );
|
::sprintf(msg,"Debug, T%u: %s", GetThreadID(), message );
|
||||||
|
|
||||||
WriteToStreams( msg, Logger::Debugging );
|
WriteToStreams( msg, Logger::Debugging );
|
||||||
}
|
}
|
||||||
|
@ -268,7 +268,7 @@ void DefaultLogger::OnDebug( const char* message )
|
||||||
void DefaultLogger::OnInfo( const char* message )
|
void DefaultLogger::OnInfo( const char* message )
|
||||||
{
|
{
|
||||||
char msg[MAX_LOG_MESSAGE_LENGTH + 16];
|
char msg[MAX_LOG_MESSAGE_LENGTH + 16];
|
||||||
::sprintf(msg,"Info, T%i: %s", GetThreadID(), message );
|
::sprintf(msg,"Info, T%u: %s", GetThreadID(), message );
|
||||||
|
|
||||||
WriteToStreams( msg , Logger::Info );
|
WriteToStreams( msg , Logger::Info );
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ void DefaultLogger::OnInfo( const char* message )
|
||||||
void DefaultLogger::OnWarn( const char* message )
|
void DefaultLogger::OnWarn( const char* message )
|
||||||
{
|
{
|
||||||
char msg[MAX_LOG_MESSAGE_LENGTH + 16];
|
char msg[MAX_LOG_MESSAGE_LENGTH + 16];
|
||||||
::sprintf(msg,"Warn, T%i: %s", GetThreadID(), message );
|
::sprintf(msg,"Warn, T%u: %s", GetThreadID(), message );
|
||||||
|
|
||||||
WriteToStreams( msg, Logger::Warn );
|
WriteToStreams( msg, Logger::Warn );
|
||||||
}
|
}
|
||||||
|
@ -288,7 +288,7 @@ void DefaultLogger::OnWarn( const char* message )
|
||||||
void DefaultLogger::OnError( const char* message )
|
void DefaultLogger::OnError( const char* message )
|
||||||
{
|
{
|
||||||
char msg[MAX_LOG_MESSAGE_LENGTH + 16];
|
char msg[MAX_LOG_MESSAGE_LENGTH + 16];
|
||||||
::sprintf(msg,"Error, T%i: %s", GetThreadID(), message );
|
::sprintf(msg,"Error, T%u: %s", GetThreadID(), message );
|
||||||
|
|
||||||
WriteToStreams( msg, Logger::Err );
|
WriteToStreams( msg, Logger::Err );
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,7 +194,7 @@ void IRRImporter::BuildSkybox(std::vector<aiMesh*>& meshes, std::vector<aiMateri
|
||||||
aiMaterial* out = ( aiMaterial* ) (*(materials.end()-(6-i)));
|
aiMaterial* out = ( aiMaterial* ) (*(materials.end()-(6-i)));
|
||||||
|
|
||||||
aiString s;
|
aiString s;
|
||||||
s.length = ::sprintf( s.data, "SkyboxSide_%i",i );
|
s.length = ::sprintf( s.data, "SkyboxSide_%u",i );
|
||||||
out->AddProperty(&s,AI_MATKEY_NAME);
|
out->AddProperty(&s,AI_MATKEY_NAME);
|
||||||
|
|
||||||
int shading = aiShadingMode_NoShading;
|
int shading = aiShadingMode_NoShading;
|
||||||
|
|
|
@ -209,7 +209,7 @@ void LWOImporter::InternReadFile( const std::string& pFile,
|
||||||
// we need to check now whether the requested layer has been found.
|
// we need to check now whether the requested layer has been found.
|
||||||
if (UINT_MAX != configLayerIndex) {
|
if (UINT_MAX != configLayerIndex) {
|
||||||
unsigned int layerCount = 0;
|
unsigned int layerCount = 0;
|
||||||
for(std::list<LWO::Layer>::iterator itLayers=mLayers->begin(); itLayers!=mLayers->end(); itLayers++)
|
for(std::list<LWO::Layer>::iterator itLayers=mLayers->begin(); itLayers!=mLayers->end(); ++itLayers)
|
||||||
if (!itLayers->skip)
|
if (!itLayers->skip)
|
||||||
layerCount++;
|
layerCount++;
|
||||||
if (layerCount!=2)
|
if (layerCount!=2)
|
||||||
|
|
|
@ -450,7 +450,7 @@ void LWSImporter::BuildGraph(aiNode* nd, LWS::NodeDesc& src, std::vector<Attachm
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add children
|
// Add children
|
||||||
if (src.children.size()) {
|
if (!src.children.empty()) {
|
||||||
nd->mChildren = new aiNode*[src.children.size()];
|
nd->mChildren = new aiNode*[src.children.size()];
|
||||||
for (std::list<LWS::NodeDesc*>::iterator it = src.children.begin(); it != src.children.end(); ++it) {
|
for (std::list<LWS::NodeDesc*>::iterator it = src.children.begin(); it != src.children.end(); ++it) {
|
||||||
aiNode* ndd = nd->mChildren[nd->mNumChildren++] = new aiNode();
|
aiNode* ndd = nd->mChildren[nd->mNumChildren++] = new aiNode();
|
||||||
|
|
|
@ -193,7 +193,7 @@ void LimitBoneWeightsProcess::ProcessMesh( aiMesh* pMesh)
|
||||||
|
|
||||||
if (!DefaultLogger::isNullLogger()) {
|
if (!DefaultLogger::isNullLogger()) {
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
::sprintf(buffer,"Removed %i weights. Input bones: %i. Output bones: %i",removed,old_bones,pMesh->mNumBones);
|
::sprintf(buffer,"Removed %u weights. Input bones: %u. Output bones: %u",removed,old_bones,pMesh->mNumBones);
|
||||||
DefaultLogger::get()->info(buffer);
|
DefaultLogger::get()->info(buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -791,7 +791,7 @@ void MD3Importer::InternReadFile( const std::string& pFile,
|
||||||
|
|
||||||
// Adjust all texture paths in the shader
|
// Adjust all texture paths in the shader
|
||||||
const char* header_name = pcHeader->NAME;
|
const char* header_name = pcHeader->NAME;
|
||||||
if (shaders.blocks.size()) {
|
if (!shaders.blocks.empty()) {
|
||||||
for (std::list< Q3Shader::ShaderDataBlock >::iterator dit = shaders.blocks.begin(); dit != shaders.blocks.end(); ++dit) {
|
for (std::list< Q3Shader::ShaderDataBlock >::iterator dit = shaders.blocks.begin(); dit != shaders.blocks.end(); ++dit) {
|
||||||
ConvertPath((*dit).name.c_str(),header_name,(*dit).name);
|
ConvertPath((*dit).name.c_str(),header_name,(*dit).name);
|
||||||
|
|
||||||
|
@ -881,7 +881,7 @@ void MD3Importer::InternReadFile( const std::string& pFile,
|
||||||
|
|
||||||
// Now search the current shader for a record with this name (
|
// Now search the current shader for a record with this name (
|
||||||
// excluding texture file extension)
|
// excluding texture file extension)
|
||||||
if (shaders.blocks.size()) {
|
if (!shaders.blocks.empty()) {
|
||||||
|
|
||||||
std::string::size_type s = convertedPath.find_last_of('.');
|
std::string::size_type s = convertedPath.find_last_of('.');
|
||||||
if (s == std::string::npos)
|
if (s == std::string::npos)
|
||||||
|
|
|
@ -95,7 +95,7 @@ MD5Parser::MD5Parser(char* _buffer, unsigned int _fileSize )
|
||||||
/*static*/ AI_WONT_RETURN void MD5Parser::ReportError (const char* error, unsigned int line)
|
/*static*/ AI_WONT_RETURN void MD5Parser::ReportError (const char* error, unsigned int line)
|
||||||
{
|
{
|
||||||
char szBuffer[1024];
|
char szBuffer[1024];
|
||||||
::sprintf(szBuffer,"[MD5] Line %i: %s",line,error);
|
::sprintf(szBuffer,"[MD5] Line %u: %s",line,error);
|
||||||
throw DeadlyImportError(szBuffer);
|
throw DeadlyImportError(szBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ MD5Parser::MD5Parser(char* _buffer, unsigned int _fileSize )
|
||||||
/*static*/ void MD5Parser::ReportWarning (const char* warn, unsigned int line)
|
/*static*/ void MD5Parser::ReportWarning (const char* warn, unsigned int line)
|
||||||
{
|
{
|
||||||
char szBuffer[1024];
|
char szBuffer[1024];
|
||||||
::sprintf(szBuffer,"[MD5] Line %i: %s",line,warn);
|
::sprintf(szBuffer,"[MD5] Line %u: %s",line,warn);
|
||||||
DefaultLogger::get()->warn(szBuffer);
|
DefaultLogger::get()->warn(szBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -264,7 +264,7 @@ void MDLImporter::SizeCheck(const void* szPos, const char* szFile, unsigned int
|
||||||
|
|
||||||
char szBuffer[1024];
|
char szBuffer[1024];
|
||||||
::sprintf(szBuffer,"Invalid MDL file. The file is too small "
|
::sprintf(szBuffer,"Invalid MDL file. The file is too small "
|
||||||
"or contains invalid data (File: %s Line: %i)",szFilePtr,iLine);
|
"or contains invalid data (File: %s Line: %u)",szFilePtr,iLine);
|
||||||
|
|
||||||
throw DeadlyImportError(szBuffer);
|
throw DeadlyImportError(szBuffer);
|
||||||
}
|
}
|
||||||
|
@ -1536,7 +1536,7 @@ void MDLImporter::InternReadFile_3DGS_MDL7( )
|
||||||
// setup the name of the node
|
// setup the name of the node
|
||||||
char* const szBuffer = &aszGroupNameBuffer[i*AI_MDL7_MAX_GROUPNAMESIZE];
|
char* const szBuffer = &aszGroupNameBuffer[i*AI_MDL7_MAX_GROUPNAMESIZE];
|
||||||
if ('\0' == *szBuffer)
|
if ('\0' == *szBuffer)
|
||||||
pcNode->mName.length = ::sprintf(szBuffer,"Group_%i",p);
|
pcNode->mName.length = ::sprintf(szBuffer,"Group_%u",p);
|
||||||
else pcNode->mName.length = ::strlen(szBuffer);
|
else pcNode->mName.length = ::strlen(szBuffer);
|
||||||
::strcpy(pcNode->mName.data,szBuffer);
|
::strcpy(pcNode->mName.data,szBuffer);
|
||||||
++p;
|
++p;
|
||||||
|
|
|
@ -531,7 +531,7 @@ void MS3DImporter::InternReadFile( const std::string& pFile,
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate storage for bones
|
// allocate storage for bones
|
||||||
if(mybones.size()) {
|
if(!mybones.empty()) {
|
||||||
std::vector<unsigned int> bmap(joints.size());
|
std::vector<unsigned int> bmap(joints.size());
|
||||||
m->mBones = new aiBone*[mybones.size()]();
|
m->mBones = new aiBone*[mybones.size()]();
|
||||||
for(BoneSet::const_iterator it = mybones.begin(); it != mybones.end(); ++it) {
|
for(BoneSet::const_iterator it = mybones.begin(); it != mybones.end(); ++it) {
|
||||||
|
|
|
@ -1115,7 +1115,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
||||||
aiNode* nd = *ppcChildren = new aiNode();
|
aiNode* nd = *ppcChildren = new aiNode();
|
||||||
nd->mParent = root;
|
nd->mParent = root;
|
||||||
|
|
||||||
nd->mName.length = ::sprintf(nd->mName.data,"<NFF_Light%i>",i);
|
nd->mName.length = ::sprintf(nd->mName.data,"<NFF_Light%u>",i);
|
||||||
|
|
||||||
// allocate the light in the scene data structure
|
// allocate the light in the scene data structure
|
||||||
aiLight* out = pScene->mLights[i] = new aiLight();
|
aiLight* out = pScene->mLights[i] = new aiLight();
|
||||||
|
|
|
@ -288,7 +288,7 @@ int ObjExporter::vecIndexMap::getIndex(const aiVector3D& vec)
|
||||||
void ObjExporter::vecIndexMap::getVectors( std::vector<aiVector3D>& vecs )
|
void ObjExporter::vecIndexMap::getVectors( std::vector<aiVector3D>& vecs )
|
||||||
{
|
{
|
||||||
vecs.resize(vecMap.size());
|
vecs.resize(vecMap.size());
|
||||||
for(vecIndexMap::dataType::iterator it = vecMap.begin(); it != vecMap.end(); it++){
|
for(vecIndexMap::dataType::iterator it = vecMap.begin(); it != vecMap.end(); ++it){
|
||||||
vecs[it->second-1] = it->first;
|
vecs[it->second-1] = it->first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,11 @@ private:
|
||||||
void reportErrorTokenInFace();
|
void reportErrorTokenInFace();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// Copy and assignment constructor should be private
|
||||||
|
// because the class contains pointer to allocated memory
|
||||||
|
ObjFileParser(const ObjFileParser& rhs);
|
||||||
|
ObjFileParser& operator=(const ObjFileParser& rhs);
|
||||||
|
|
||||||
/// Default material name
|
/// Default material name
|
||||||
static const std::string DEFAULT_MATERIAL;
|
static const std::string DEFAULT_MATERIAL;
|
||||||
//! Iterator to current position in buffer
|
//! Iterator to current position in buffer
|
||||||
|
|
|
@ -81,7 +81,7 @@ private:
|
||||||
void AssignMaterials(aiScene *pScene, std::vector<aiMaterial*> &materials);
|
void AssignMaterials(aiScene *pScene, std::vector<aiMaterial*> &materials);
|
||||||
|
|
||||||
/// Reads material
|
/// Reads material
|
||||||
aiMaterial* ReadMaterial(const std::string &pFile, Assimp::IOSystem *pIOHandler, const std::string MaterialName);
|
aiMaterial* ReadMaterial(const std::string &pFile, Assimp::IOSystem *pIOHandler, const std::string &MaterialName);
|
||||||
|
|
||||||
// These functions parse blocks from a material file from @c ss. Starting parsing from "{" and ending it to "}".
|
// These functions parse blocks from a material file from @c ss. Starting parsing from "{" and ending it to "}".
|
||||||
bool ReadTechnique(const std::string &techniqueName, std::stringstream &ss, aiMaterial *material);
|
bool ReadTechnique(const std::string &techniqueName, std::stringstream &ss, aiMaterial *material);
|
||||||
|
|
|
@ -120,7 +120,7 @@ void OgreImporter::AssignMaterials(aiScene *pScene, std::vector<aiMaterial*> &ma
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
aiMaterial* OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSystem *pIOHandler, const std::string materialName)
|
aiMaterial* OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSystem *pIOHandler, const std::string &materialName)
|
||||||
{
|
{
|
||||||
if (materialName.empty()) {
|
if (materialName.empty()) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -300,7 +300,7 @@ void OpenGEXImporter::handleNodes( DDLNode *node, aiScene *pScene ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DDLNode::DllNodeList childs = node->getChildNodeList();
|
DDLNode::DllNodeList childs = node->getChildNodeList();
|
||||||
for( DDLNode::DllNodeList::iterator it = childs.begin(); it != childs.end(); it++ ) {
|
for( DDLNode::DllNodeList::iterator it = childs.begin(); it != childs.end(); ++it ) {
|
||||||
Grammar::TokenType tokenType( Grammar::matchTokenType( ( *it )->getType().c_str() ) );
|
Grammar::TokenType tokenType( Grammar::matchTokenType( ( *it )->getType().c_str() ) );
|
||||||
switch( tokenType ) {
|
switch( tokenType ) {
|
||||||
case Grammar::MetricToken:
|
case Grammar::MetricToken:
|
||||||
|
|
|
@ -225,7 +225,7 @@ void OptimizeGraphProcess::CollectNewChildren(aiNode* nd, std::list<aiNode*>& no
|
||||||
|
|
||||||
delete[] nd->mChildren;
|
delete[] nd->mChildren;
|
||||||
|
|
||||||
if (child_nodes.size())
|
if (!child_nodes.empty())
|
||||||
nd->mChildren = new aiNode*[child_nodes.size()];
|
nd->mChildren = new aiNode*[child_nodes.size()];
|
||||||
else nd->mChildren = NULL;
|
else nd->mChildren = NULL;
|
||||||
}
|
}
|
||||||
|
@ -335,7 +335,7 @@ void OptimizeGraphProcess::Execute( aiScene* pScene)
|
||||||
if ( nodes_in != nodes_out) {
|
if ( nodes_in != nodes_out) {
|
||||||
|
|
||||||
char buf[512];
|
char buf[512];
|
||||||
sprintf(buf,"OptimizeGraphProcess finished; Input nodes: %i, Output nodes: %i",nodes_in,nodes_out);
|
sprintf(buf,"OptimizeGraphProcess finished; Input nodes: %u, Output nodes: %u",nodes_in,nodes_out);
|
||||||
DefaultLogger::get()->info(buf);
|
DefaultLogger::get()->info(buf);
|
||||||
}
|
}
|
||||||
else DefaultLogger::get()->debug("OptimizeGraphProcess finished");
|
else DefaultLogger::get()->debug("OptimizeGraphProcess finished");
|
||||||
|
|
|
@ -150,7 +150,7 @@ void OptimizeMeshesProcess::Execute( aiScene* pScene)
|
||||||
|
|
||||||
if (output.size() != num_old) {
|
if (output.size() != num_old) {
|
||||||
char tmp[512];
|
char tmp[512];
|
||||||
::sprintf(tmp,"OptimizeMeshesProcess finished. Input meshes: %i, Output meshes: %i",num_old,pScene->mNumMeshes);
|
::sprintf(tmp,"OptimizeMeshesProcess finished. Input meshes: %u, Output meshes: %u",num_old,pScene->mNumMeshes);
|
||||||
DefaultLogger::get()->info(tmp);
|
DefaultLogger::get()->info(tmp);
|
||||||
} else {
|
} else {
|
||||||
DefaultLogger::get()->debug( "OptimizeMeshesProcess finished" );
|
DefaultLogger::get()->debug( "OptimizeMeshesProcess finished" );
|
||||||
|
|
|
@ -644,7 +644,7 @@ void PretransformVertices::Execute( aiScene* pScene)
|
||||||
{
|
{
|
||||||
aiNode* pcNode = *nodes = new aiNode();
|
aiNode* pcNode = *nodes = new aiNode();
|
||||||
pcNode->mParent = pScene->mRootNode;
|
pcNode->mParent = pScene->mRootNode;
|
||||||
pcNode->mName.length = ::sprintf(pcNode->mName.data,"mesh_%i",i);
|
pcNode->mName.length = ::sprintf(pcNode->mName.data,"mesh_%u",i);
|
||||||
|
|
||||||
// setup mesh indices
|
// setup mesh indices
|
||||||
pcNode->mNumMeshes = 1;
|
pcNode->mNumMeshes = 1;
|
||||||
|
@ -656,7 +656,7 @@ void PretransformVertices::Execute( aiScene* pScene)
|
||||||
{
|
{
|
||||||
aiNode* pcNode = *nodes = new aiNode();
|
aiNode* pcNode = *nodes = new aiNode();
|
||||||
pcNode->mParent = pScene->mRootNode;
|
pcNode->mParent = pScene->mRootNode;
|
||||||
pcNode->mName.length = ::sprintf(pcNode->mName.data,"light_%i",i);
|
pcNode->mName.length = ::sprintf(pcNode->mName.data,"light_%u",i);
|
||||||
pScene->mLights[i]->mName = pcNode->mName;
|
pScene->mLights[i]->mName = pcNode->mName;
|
||||||
}
|
}
|
||||||
// generate camera nodes
|
// generate camera nodes
|
||||||
|
@ -664,7 +664,7 @@ void PretransformVertices::Execute( aiScene* pScene)
|
||||||
{
|
{
|
||||||
aiNode* pcNode = *nodes = new aiNode();
|
aiNode* pcNode = *nodes = new aiNode();
|
||||||
pcNode->mParent = pScene->mRootNode;
|
pcNode->mParent = pScene->mRootNode;
|
||||||
pcNode->mName.length = ::sprintf(pcNode->mName.data,"cam_%i",i);
|
pcNode->mName.length = ::sprintf(pcNode->mName.data,"cam_%u",i);
|
||||||
pScene->mCameras[i]->mName = pcNode->mName;
|
pScene->mCameras[i]->mName = pcNode->mName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -707,15 +707,15 @@ void PretransformVertices::Execute( aiScene* pScene)
|
||||||
|
|
||||||
DefaultLogger::get()->debug("PretransformVerticesProcess finished");
|
DefaultLogger::get()->debug("PretransformVerticesProcess finished");
|
||||||
|
|
||||||
sprintf(buffer,"Removed %i nodes and %i animation channels (%i output nodes)",
|
sprintf(buffer,"Removed %u nodes and %u animation channels (%u output nodes)",
|
||||||
iOldNodes,iOldAnimationChannels,CountNodes(pScene->mRootNode));
|
iOldNodes,iOldAnimationChannels,CountNodes(pScene->mRootNode));
|
||||||
DefaultLogger::get()->info(buffer);
|
DefaultLogger::get()->info(buffer);
|
||||||
|
|
||||||
sprintf(buffer,"Kept %i lights and %i cameras",
|
sprintf(buffer,"Kept %u lights and %u cameras",
|
||||||
pScene->mNumLights,pScene->mNumCameras);
|
pScene->mNumLights,pScene->mNumCameras);
|
||||||
DefaultLogger::get()->info(buffer);
|
DefaultLogger::get()->info(buffer);
|
||||||
|
|
||||||
sprintf(buffer,"Moved %i meshes to WCS (number of output meshes: %i)",
|
sprintf(buffer,"Moved %u meshes to WCS (number of output meshes: %u)",
|
||||||
iOldMeshes,pScene->mNumMeshes);
|
iOldMeshes,pScene->mNumMeshes);
|
||||||
DefaultLogger::get()->info(buffer);
|
DefaultLogger::get()->info(buffer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,7 +180,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
|
||||||
if (ppcMaterials[idx])
|
if (ppcMaterials[idx])
|
||||||
{
|
{
|
||||||
aiString sz;
|
aiString sz;
|
||||||
sz.length = ::sprintf(sz.data,"JoinedMaterial_#%i",p);
|
sz.length = ::sprintf(sz.data,"JoinedMaterial_#%u",p);
|
||||||
((aiMaterial*)ppcMaterials[idx])->AddProperty(&sz,AI_MATKEY_NAME);
|
((aiMaterial*)ppcMaterials[idx])->AddProperty(&sz,AI_MATKEY_NAME);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -207,7 +207,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char szBuffer[128]; // should be sufficiently large
|
char szBuffer[128]; // should be sufficiently large
|
||||||
::sprintf(szBuffer,"RemoveRedundantMatsProcess finished. Removed %i redundant and %i unused materials.",
|
::sprintf(szBuffer,"RemoveRedundantMatsProcess finished. Removed %u redundant and %u unused materials.",
|
||||||
redundantRemoved,unreferencedRemoved);
|
redundantRemoved,unreferencedRemoved);
|
||||||
DefaultLogger::get()->info(szBuffer);
|
DefaultLogger::get()->info(szBuffer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,7 @@ void SMDImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS
|
||||||
void SMDImporter::LogErrorNoThrow(const char* msg)
|
void SMDImporter::LogErrorNoThrow(const char* msg)
|
||||||
{
|
{
|
||||||
char szTemp[1024];
|
char szTemp[1024];
|
||||||
sprintf(szTemp,"Line %i: %s",iLineNumber,msg);
|
sprintf(szTemp,"Line %u: %s",iLineNumber,msg);
|
||||||
DefaultLogger::get()->error(szTemp);
|
DefaultLogger::get()->error(szTemp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ void SMDImporter::LogWarning(const char* msg)
|
||||||
{
|
{
|
||||||
char szTemp[1024];
|
char szTemp[1024];
|
||||||
ai_assert(strlen(msg) < 1000);
|
ai_assert(strlen(msg) < 1000);
|
||||||
sprintf(szTemp,"Line %i: %s",iLineNumber,msg);
|
sprintf(szTemp,"Line %u: %s",iLineNumber,msg);
|
||||||
DefaultLogger::get()->warn(szTemp);
|
DefaultLogger::get()->warn(szTemp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -647,7 +647,7 @@ void SMDImporter::CreateOutputMaterials()
|
||||||
pScene->mMaterials[iMat] = pcMat;
|
pScene->mMaterials[iMat] = pcMat;
|
||||||
|
|
||||||
aiString szName;
|
aiString szName;
|
||||||
szName.length = (size_t)::sprintf(szName.data,"Texture_%i",iMat);
|
szName.length = (size_t)::sprintf(szName.data,"Texture_%u",iMat);
|
||||||
pcMat->AddProperty(&szName,AI_MATKEY_NAME);
|
pcMat->AddProperty(&szName,AI_MATKEY_NAME);
|
||||||
|
|
||||||
if (aszTextures[iMat].length())
|
if (aszTextures[iMat].length())
|
||||||
|
|
|
@ -251,7 +251,7 @@ void StepExporter::WriteFile()
|
||||||
mOutput << "))" << endstr;
|
mOutput << "))" << endstr;
|
||||||
|
|
||||||
// write all the unique transformed CARTESIAN and VERTEX
|
// write all the unique transformed CARTESIAN and VERTEX
|
||||||
for (MeshesByNodeMap::const_iterator it2 = meshes.begin(); it2 != meshes.end(); it2++)
|
for (MeshesByNodeMap::const_iterator it2 = meshes.begin(); it2 != meshes.end(); ++it2)
|
||||||
{
|
{
|
||||||
const aiNode& node = *(*it2).first;
|
const aiNode& node = *(*it2).first;
|
||||||
unsigned int mesh_idx = (*it2).second;
|
unsigned int mesh_idx = (*it2).second;
|
||||||
|
|
|
@ -377,7 +377,7 @@ void UnrealImporter::InternReadFile( const std::string& pFile,
|
||||||
aiColor3D color(1.f,1.f,1.f);
|
aiColor3D color(1.f,1.f,1.f);
|
||||||
|
|
||||||
aiString s;
|
aiString s;
|
||||||
::sprintf(s.data,"mat%i_tx%i_",i,materials[i].tex);
|
::sprintf(s.data,"mat%u_tx%u_",i,materials[i].tex);
|
||||||
|
|
||||||
// set the two-sided flag
|
// set the two-sided flag
|
||||||
if (materials[i].type == Unreal::MF_NORMAL_TS) {
|
if (materials[i].type == Unreal::MF_NORMAL_TS) {
|
||||||
|
|
Loading…
Reference in New Issue