cfg: Allow LoadInt to parse hex strings

This commit is contained in:
Jan Holthuis 2015-08-16 21:05:47 +02:00
parent 60e094dbb9
commit 87f7ca0bb4
1 changed files with 8 additions and 1 deletions

View File

@ -320,8 +320,15 @@ s32 ConfigFile::LoadInt(const wchar * Section, const wchar * Key,s32 Default)
wchar temp_o[30];
sprintf(temp_d,"%d",Default);
this->LoadStr(Section,Key,temp_o,temp_d);
if (strstr(temp_o, "0x") != NULL)
{
return strtol(temp_o, NULL, 16);
}
else
{
return atoi(temp_o);
}
}
ConfigFile cfgdb;