Added validation step, added helper macro AI_BUILD_KEY to the material system.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@59 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2008-06-15 10:27:08 +00:00
parent d6fc5de7d5
commit 758e092449
25 changed files with 1287 additions and 182 deletions

View File

@@ -47,83 +47,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp
{
// ---------------------------------------------------------------------------
/** \brief Helper function to do platform independent string comparison.
*
* This is required since stricmp() is not consistently available on
* all platforms. Some platforms use the '_' prefix, others don't even
* have such a function. Yes, this is called an ISO standard.
*
* \param s1 First input string
* \param s2 Second input string
*/
// ---------------------------------------------------------------------------
inline int ASSIMP_stricmp(const char *s1, const char *s2)
{
#if (defined _MSC_VER)
return _stricmp(s1,s2);
#else
const char *a1, *a2;
a1 = s1;
a2 = s2;
while (true)
{
char c1 = (char)tolower(*a1);
char c2 = (char)tolower(*a2);
if ((0 == c1) && (0 == c2)) return 0;
if (c1 < c2) return-1;
if (c1 > c2) return 1;
++a1;
++a2;
}
#endif
}
// ---------------------------------------------------------------------------
/** \brief Helper function to do platform independent string comparison.
*
* This is required since strincmp() is not consistently available on
* all platforms. Some platforms use the '_' prefix, others don't even
* have such a function. Yes, this is called an ISO standard.
*
* \param s1 First input string
* \param s2 Second input string
* \param n Macimum number of characters to compare
*/
// ---------------------------------------------------------------------------
inline int ASSIMP_strincmp(const char *s1, const char *s2, unsigned int n)
{
#if (defined _MSC_VER)
return _strnicmp(s1,s2,n);
#else
const char *a1, *a2;
a1 = s1;
a2 = s2;
unsigned int p = 0;
while (true)
{
if (p >= n)return 0;
char c1 = (char)tolower(*a1);
char c2 = (char)tolower(*a2);
if ((0 == c1) && (0 == c2)) return 0;
if (c1 < c2) return-1;
if (c1 > c2) return 1;
++a1;
++a2;
++p;
}
#endif
}
// ---------------------------------------------------------------------------
/** Internal material helper class. Can be used to fill an aiMaterial
structure easily. */