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

@@ -384,7 +384,7 @@ int CDisplay::ReplaceCurrentTexture(const char* szPath)
pcMat->AddProperty(&szOld,szBuffer );
}
else if (szString.length == szOld.length &&
0 == Assimp::ASSIMP_stricmp(szString.data,szOld.data))
0 == ASSIMP_stricmp(szString.data,szOld.data))
{
pcMat->RemoveProperty(szBuffer);
}

View File

@@ -48,29 +48,6 @@ namespace AssimpView {
/*static */ CMaterialManager CMaterialManager::s_cInstance;
//-------------------------------------------------------------------------------
// Compiler idependent stricmp() function.
//
// Used for case insensitive string comparison
//-------------------------------------------------------------------------------
inline int ASSIMP_stricmp(const char *s1, const char *s2)
{
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;
}
}
//-------------------------------------------------------------------------------
// D3DX callback function to fill a texture with a checkers pattern
//

View File

@@ -1589,14 +1589,14 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg,
// check whether it is a typical texture file format ...
++sz;
if (0 == Assimp::ASSIMP_stricmp(sz,"png") ||
0 == Assimp::ASSIMP_stricmp(sz,"bmp") ||
0 == Assimp::ASSIMP_stricmp(sz,"jpg") ||
0 == Assimp::ASSIMP_stricmp(sz,"tga") ||
0 == Assimp::ASSIMP_stricmp(sz,"tif") ||
0 == Assimp::ASSIMP_stricmp(sz,"hdr") ||
0 == Assimp::ASSIMP_stricmp(sz,"ppm") ||
0 == Assimp::ASSIMP_stricmp(sz,"pfm"))
if (0 == ASSIMP_stricmp(sz,"png") ||
0 == ASSIMP_stricmp(sz,"bmp") ||
0 == ASSIMP_stricmp(sz,"jpg") ||
0 == ASSIMP_stricmp(sz,"tga") ||
0 == ASSIMP_stricmp(sz,"tif") ||
0 == ASSIMP_stricmp(sz,"hdr") ||
0 == ASSIMP_stricmp(sz,"ppm") ||
0 == ASSIMP_stricmp(sz,"pfm"))
{
CBackgroundPainter::Instance().SetTextureBG(szFile);
}

View File

@@ -132,7 +132,8 @@ DWORD WINAPI LoadThreadProc(LPVOID lpParameter)
aiProcess_Triangulate | // triangulate n-polygons
aiProcess_GenSmoothNormals | // generate smooth normal vectors if not existing
aiProcess_ConvertToLeftHanded | // convert everything to D3D left handed space
aiProcess_SplitLargeMeshes); // split large, unrenderable meshes into submeshes
aiProcess_SplitLargeMeshes | // split large, unrenderable meshes into submeshes
aiProcess_ValidateDataStructure); // validate the output data structure
// get the end time of zje operation, calculate delta t
double fEnd = (double)timeGetTime();

View File

@@ -46,21 +46,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "resource.h"
// Include ASSIMP headers
#include "aiAnim.h"
#include "aiAssert.h"
#include "aiFileIO.h"
#include "aiMaterial.h"
#include "aiPostProcess.h"
#include "aiMesh.h"
#include "aiScene.h"
#include "aiTypes.h"
#include "IOSystem.h"
#include "IOStream.h"
#include "assimp.h"
#include "assimp.hpp"
#include "LogStream.h"
#include "DefaultLogger.h"
#include "MaterialSystem.h"
#include "MaterialSystem.h" // MaterialHelper clas
#include "StringComparison.h" // ASSIMP_stricmp and ASSIMP_strincmp
// in order for std::min and std::max to behave properly
#ifdef min
@@ -73,6 +71,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// default movement speed
#define MOVE_SPEED 10.0f
using namespace Assimp;
namespace AssimpView {
#include "AssetHelper.h"