Horde3D
http://horde3d.org/forums/

bug in ColladaConv
http://horde3d.org/forums/viewtopic.php?f=3&t=1679
Page 1 of 1

Author:  swx [ 09.06.2012, 14:26 ]
Post subject:  bug in ColladaConv

revision 336 introduced at least one bug:

main.cpp line 172:
Code:
else if( _stricmp( arg.c_str(), "anim" ) == 0 ) assetType = AssetTypes::Animation;


should be:
Code:
else if( _stricmp( argv[i], "anim" ) == 0 ) assetType = AssetTypes::Animation;

Author:  Volker [ 10.06.2012, 21:18 ]
Post subject:  Re: bug in ColladaConv

Thanks fixed it!

Author:  Irdis [ 13.06.2012, 08:28 ]
Post subject:  Re: bug in ColladaConv

Is it really so?
Code:
std::string arg = argv[i];
arg.erase(remove_if(arg.begin(), arg.end(), isspace), arg.end());


if( _stricmp( arg.c_str(), "-type" ) == 0 && argc > i + 1 )
{
   if( _stricmp( argv[++i], "model" ) == 0 ) assetType = AssetTypes::Model;
   else if( _stricmp( argv[i], "anim" ) == 0 ) assetType = AssetTypes::Animation;
   else assetType = AssetTypes::Unknown;
}


Isn't arg.c_str() just cleaned argv[i]? Shouldn't it be
Code:
else if( _stricmp( argv[++i], "anim" ) == 0 ) assetType = AssetTypes::Animation;

like with model?

Author:  Volker [ 13.06.2012, 09:50 ]
Post subject:  Re: bug in ColladaConv

Without watching deeply into the collada converter documentation I thought you specify the type with the argument after -type. So we check the argument after argv[i] (=arg).
The first check argv[++i] increases i already and checks against model, then we check argv[i] again (it has been increased already in the if case) against anim. So I guess swx is right.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/