FIX: IrrMesh lightmap scale factor is imported correctly now.

FIX: aiProcess_TransformUVCoords tried to transform untransformed channels, and 'he' changed their order from time to time.
FIX: Viewer displays lightmap with scaling factor correctly now.
Further work on documentation, material doc is WIP for the moment.
Some improvements to fast_atof.
Updating makeifle.mingw to reflect my new boost location (arg, too lazy to make it better ...). 

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@413 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2009-05-03 21:49:34 +00:00
parent afcfdf27ea
commit 25088fd7da
11 changed files with 511 additions and 653 deletions
+24 -35
View File
@@ -50,42 +50,35 @@ inline void SetGenericProperty(std::map< unsigned int, T >& list,
const char* szName, const T& value, bool* bWasExisting = NULL)
{
ai_assert(NULL != szName);
const uint32_t hash = SuperFastHash(szName);
typedef std::map< unsigned int, T > GenericPropertyMap;
typedef std::pair< unsigned int, T > GenericPair;
uint32_t hash = SuperFastHash(szName);
typename GenericPropertyMap::iterator it = list.find(hash);
if (it == list.end())
{
if (bWasExisting)*bWasExisting = false;
list.insert(GenericPair( hash, value ));
typename std::map<unsigned int, T>::iterator it = list.find(hash);
if (it == list.end()) {
if (bWasExisting)
*bWasExisting = false;
list.insert(std::pair<unsigned int, T>( hash, value ));
return;
}
(*it).second = value;
if (bWasExisting)*bWasExisting = true;
if (bWasExisting)
*bWasExisting = true;
}
// ------------------------------------------------------------------------------------------------
template <class T>
inline const T& GetGenericProperty(const std::map< unsigned int, T >& list,
const char* szName, const T& errorReturn)
{
ai_assert(NULL != szName);
const uint32_t hash = SuperFastHash(szName);
typedef std::map< unsigned int, T > GenericPropertyMap;
typedef std::pair< unsigned int, T > GenericPair;
uint32_t hash = SuperFastHash(szName);
typename GenericPropertyMap::const_iterator it = list.find(hash);
if (it == list.end())return errorReturn;
typename std::map<unsigned int, T>::const_iterator it = list.find(hash);
if (it == list.end())
return errorReturn;
return (*it).second;
}
// ------------------------------------------------------------------------------------------------
// Special version for pointer types - they will be deleted when replaced with another value
// passing NULL removes the whole property
@@ -94,29 +87,25 @@ inline void SetGenericPropertyPtr(std::map< unsigned int, T* >& list,
const char* szName, T* value, bool* bWasExisting = NULL)
{
ai_assert(NULL != szName);
const uint32_t hash = SuperFastHash(szName);
typedef std::map< unsigned int, T* > GenericPropertyMap;
typedef std::pair< unsigned int, T* > GenericPair;
uint32_t hash = SuperFastHash(szName);
typename GenericPropertyMap::iterator it = list.find(hash);
if (it == list.end())
{
if (bWasExisting)*bWasExisting = false;
list.insert(GenericPair( hash, value ));
typename std::map<unsigned int, T*>::iterator it = list.find(hash);
if (it == list.end()) {
if (bWasExisting)
*bWasExisting = false;
list.insert(std::pair<unsigned int,T*>( hash, value ));
return;
}
if ((*it).second != value)
{
if ((*it).second != value) {
delete (*it).second;
(*it).second = value;
}
if (!value)
{
if (!value) {
list.erase(it);
}
if (bWasExisting)*bWasExisting = true;
if (bWasExisting)
*bWasExisting = true;
}