General
- Added format auto-detection to most loaders - Simplified BaseImporter::CanRead() with some utility methods - improved fast_atof -> no overruns anymore. Fuck you, irrlicht. - added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too. - vc8/vc9: revision number is now written to DLL version header - mkutil: some batch scripts to simplify tagging & building of release versions - some API cleanup - fixing some doxygen markup (+now explicit use of @file <filename>) - Icon for assimp_view and assimp_cmd 3DS - Normal vectors are not anymore inverted in some cases - Improved pivot handling - Improved handling of x-flipped meshes Collada - fixed a minor bug (visual_scene element) LWS - WIP implementation. No animations yet, some bugs and crashes. - Animation system remains disabled, WIP code - many test files for LWS, but most of them test the anim support, which is, read above, currently disabled. STL - fixing a log warning which appears for every model - added binary&ascii test spider, exported from truespace MD3 - Cleaning up output tags for automatically joined player models. IRR - Fixing coordinate system issues. - Instance handling improved. - Some of the reported crashes not yet fixed. PretransformVertices - Numerous performance improvements. - Added config option to preserve the hierarchy during the step. RemoveRedundantMaterials - Added config option to specify a list of materials which are kept in every case. UNREAL - Added support for the old unreal data format (*.a,*.d,*.uc) - tested only with exports from Milkshape - more Unreal stuff to come soon git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
@@ -1571,7 +1571,69 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg,
|
||||
DragQueryFile(hDrop,0,szFile,sizeof(szFile));
|
||||
|
||||
const char* sz = strrchr(szFile,'.');
|
||||
if (sz && 0 != aiIsExtensionSupported(sz))
|
||||
if (!sz)
|
||||
sz = szFile;
|
||||
|
||||
if (CDisplay::VIEWMODE_TEXTURE == CDisplay::Instance().GetViewMode())
|
||||
{
|
||||
// replace the selected texture with the new one ...
|
||||
CDisplay::Instance().ReplaceCurrentTexture(szFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
// check whether it is a typical texture file format ...
|
||||
++sz;
|
||||
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);
|
||||
}
|
||||
else if (0 == Assimp::ASSIMP_stricmp(sz,"dds"))
|
||||
{
|
||||
// DDS files could contain skyboxes, but they could also
|
||||
// contain normal 2D textures. The easiest way to find this
|
||||
// out is to open the file and check the header ...
|
||||
FILE* pFile = fopen(szFile,"rb");
|
||||
if (!pFile)
|
||||
return TRUE;
|
||||
|
||||
// header of a dds file (begin)
|
||||
/*
|
||||
DWORD dwMagic
|
||||
DWORD dwSize
|
||||
DWORD dwFlags
|
||||
DWORD dwHeight
|
||||
DWORD dwWidth
|
||||
DWORD dwPitchOrLinearSize
|
||||
DWORD dwDepth
|
||||
DWORD dwMipMapCount -> total with this: 32
|
||||
DWORD dwReserved1[11] -> total with this: 76
|
||||
DDPIXELFORMAT ddpfPixelFormat -> total with this: 108
|
||||
DWORD dwCaps1; -> total with this: 112
|
||||
DWORD dwCaps2; ---< here we are!
|
||||
*/
|
||||
DWORD dwCaps = 0;
|
||||
fseek(pFile,112,SEEK_SET);
|
||||
fread(&dwCaps,4,1,pFile);
|
||||
|
||||
if (dwCaps & 0x00000400L /* DDSCAPS2_CUBEMAP_POSITIVEX */)
|
||||
{
|
||||
CLogDisplay::Instance().AddEntry(
|
||||
"[INFO] Assuming this dds file is a skybox ...",
|
||||
D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0));
|
||||
|
||||
CBackgroundPainter::Instance().SetCubeMapBG(szFile);
|
||||
}
|
||||
else CBackgroundPainter::Instance().SetTextureBG(szFile);
|
||||
fclose(pFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(g_szFileName,szFile);
|
||||
|
||||
@@ -1580,75 +1642,8 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg,
|
||||
UpdateHistory();
|
||||
SaveHistory();
|
||||
}
|
||||
else if (CDisplay::VIEWMODE_TEXTURE == CDisplay::Instance().GetViewMode())
|
||||
{
|
||||
// replace the selected texture with the new one ...
|
||||
CDisplay::Instance().ReplaceCurrentTexture(szFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sz) goto __DRUNKEN_ALIEN_FROM_MARS;
|
||||
|
||||
// check whether it is a typical texture file format ...
|
||||
++sz;
|
||||
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);
|
||||
}
|
||||
else if (0 == Assimp::ASSIMP_stricmp(sz,"dds"))
|
||||
{
|
||||
// DDS files could contain skyboxes, but they could also
|
||||
// contain normal 2D textures. The easiest way to find this
|
||||
// out is to open the file and check the header ...
|
||||
FILE* pFile = fopen(szFile,"rb");
|
||||
if (!pFile)goto __DRUNKEN_ALIEN_FROM_MARS;
|
||||
|
||||
// header of a dds file (begin)
|
||||
/*
|
||||
DWORD dwMagic
|
||||
DWORD dwSize
|
||||
DWORD dwFlags
|
||||
DWORD dwHeight
|
||||
DWORD dwWidth
|
||||
DWORD dwPitchOrLinearSize
|
||||
DWORD dwDepth
|
||||
DWORD dwMipMapCount -> total with this: 32
|
||||
DWORD dwReserved1[11] -> total with this: 76
|
||||
DDPIXELFORMAT ddpfPixelFormat -> total with this: 108
|
||||
DWORD dwCaps1; -> total with this: 112
|
||||
DWORD dwCaps2; ---< here we are!
|
||||
*/
|
||||
DWORD dwCaps = 0;
|
||||
fseek(pFile,112,SEEK_SET);
|
||||
fread(&dwCaps,4,1,pFile);
|
||||
|
||||
if (dwCaps & 0x00000400L /* DDSCAPS2_CUBEMAP_POSITIVEX */)
|
||||
{
|
||||
CLogDisplay::Instance().AddEntry(
|
||||
"[INFO] Assuming this dds file is a skybox ...",
|
||||
D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0));
|
||||
|
||||
CBackgroundPainter::Instance().SetCubeMapBG(szFile);
|
||||
}
|
||||
else CBackgroundPainter::Instance().SetTextureBG(szFile);
|
||||
fclose(pFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
__DRUNKEN_ALIEN_FROM_MARS:
|
||||
CLogDisplay::Instance().AddEntry(
|
||||
"[ERROR] File extension is not supported. E.T. can read this.",
|
||||
D3DCOLOR_ARGB(0xFF,0xFF,0,0));
|
||||
}
|
||||
}
|
||||
DragFinish(hDrop);
|
||||
}
|
||||
DragFinish(hDrop);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user