Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
const char* key = "1";
int test = Ogre::StringConverter::parseInt(key); // test equals '1'
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
parseInt is used over 100 times in ogre, to convert meshes from xml, load materials, etc. So not being able to handle "1" would be rather surprising.
Try breakpointing inside of getValueAsInt and check the actual contents of key. Make sure there's no extra symbols in there.
Locale can affect things, for example some countries use commas instead of periods for fractions (not going to affect ints though, just an example). atoi is an old c function while parseInt uses c++ string streams which have locale support.
Kojack wrote:Locale can affect things, for example some countries use commas instead of periods for fractions (not going to affect ints though, just an example).
Note: Locale support was only added in 1.9 IIRC and is disabled by default for backward compatibility.
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...