Some more findings.

pull/2316/head
kimkulling 2019-01-31 17:24:08 +01:00
parent de02fb2129
commit 4347ce4311
2 changed files with 21 additions and 43 deletions

View File

@ -3,7 +3,7 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2015, assimp team Copyright (c) 2006-2019, assimp team
All rights reserved. All rights reserved.
@ -89,9 +89,8 @@ extern Assimp::Exporter* globalExporter;
#endif #endif
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
/** Defines common import parameters */ /// Defines common import parameters
struct ImportData struct ImportData {
{
ImportData() ImportData()
: ppFlags (0) : ppFlags (0)
, showLog (false) , showLog (false)
@ -99,11 +98,9 @@ struct ImportData
, log (false) , log (false)
{} {}
/** Postprocessing flags /// Post-processing flags
*/
unsigned int ppFlags; unsigned int ppFlags;
// Log to std::err? // Log to std::err?
bool showLog; bool showLog;

View File

@ -1597,21 +1597,17 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM lParam
case WM_DROPFILES: case WM_DROPFILES:
{ {
HDROP hDrop = (HDROP)wParam; HDROP hDrop = (HDROP)wParam;
char szFile[MAX_PATH]; char szFile[MAX_PATH];
DragQueryFile(hDrop,0,szFile,sizeof(szFile)); DragQueryFile(hDrop,0,szFile,sizeof(szFile));
const char* sz = strrchr(szFile,'.'); const char* sz = strrchr(szFile,'.');
if (!sz) if (!sz) {
sz = szFile; sz = szFile;
}
if (CDisplay::VIEWMODE_TEXTURE == CDisplay::Instance().GetViewMode()) if (CDisplay::VIEWMODE_TEXTURE == CDisplay::Instance().GetViewMode()) {
{
// replace the selected texture with the new one ... // replace the selected texture with the new one ...
CDisplay::Instance().ReplaceCurrentTexture(szFile); CDisplay::Instance().ReplaceCurrentTexture(szFile);
} } else {
else
{
// check whether it is a typical texture file format ... // check whether it is a typical texture file format ...
++sz; ++sz;
if (0 == ASSIMP_stricmp(sz,"png") || if (0 == ASSIMP_stricmp(sz,"png") ||
@ -1653,19 +1649,17 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM lParam
fseek(pFile,112,SEEK_SET); fseek(pFile,112,SEEK_SET);
fread(&dwCaps,4,1,pFile); fread(&dwCaps,4,1,pFile);
if (dwCaps & 0x00000400L /* DDSCAPS2_CUBEMAP_POSITIVEX */) if (dwCaps & 0x00000400L /* DDSCAPS2_CUBEMAP_POSITIVEX */) {
{
CLogDisplay::Instance().AddEntry( CLogDisplay::Instance().AddEntry(
"[INFO] Assuming this dds file is a skybox ...", "[INFO] Assuming this dds file is a skybox ...",
D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0)); D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0));
CBackgroundPainter::Instance().SetCubeMapBG(szFile); CBackgroundPainter::Instance().SetCubeMapBG(szFile);
} else {
CBackgroundPainter::Instance().SetTextureBG(szFile);
} }
else CBackgroundPainter::Instance().SetTextureBG(szFile);
fclose(pFile); fclose(pFile);
} } else {
else
{
strcpy(g_szFileName,szFile); strcpy(g_szFileName,szFile);
DeleteAsset(); DeleteAsset();
@ -1731,44 +1725,31 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM lParam
ChooseBGColor(); ChooseBGColor();
} else if (ID_BACKGROUND_LOADTEXTURE == LOWORD(wParam)) { } else if (ID_BACKGROUND_LOADTEXTURE == LOWORD(wParam)) {
LoadBGTexture(); LoadBGTexture();
} } else if (ID_BACKGROUND_LOADSKYBOX == LOWORD(wParam)) {
else if (ID_BACKGROUND_LOADSKYBOX == LOWORD(wParam))
{
LoadSkybox(); LoadSkybox();
} } else if (ID_VIEWER_SAVESCREENSHOTTOFILE == LOWORD(wParam)) {
else if (ID_VIEWER_SAVESCREENSHOTTOFILE == LOWORD(wParam))
{
SaveScreenshot(); SaveScreenshot();
} } else if (ID_VIEWER_OPEN == LOWORD(wParam)) {
else if (ID_VIEWER_OPEN == LOWORD(wParam))
{
OpenAsset(); OpenAsset();
} } else if (ID_TOOLS_FLIPNORMALS == LOWORD(wParam)) {
else if (ID_TOOLS_FLIPNORMALS == LOWORD(wParam)) if (g_pcAsset && g_pcAsset->pcScene) {
{
if (g_pcAsset && g_pcAsset->pcScene)
{
g_pcAsset->FlipNormals(); g_pcAsset->FlipNormals();
}
} }
}
// this is ugly. anyone willing to rewrite it from scratch using wxwidgets or similar? // this is ugly. anyone willing to rewrite it from scratch using wxwidgets or similar?
else if (ID_VIEWER_PP_JIV == LOWORD(wParam)) { else if (ID_VIEWER_PP_JIV == LOWORD(wParam)) {
ppsteps ^= aiProcess_JoinIdenticalVertices; ppsteps ^= aiProcess_JoinIdenticalVertices;
CheckMenuItem(hMenu,ID_VIEWER_PP_JIV,ppsteps & aiProcess_JoinIdenticalVertices ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hMenu,ID_VIEWER_PP_JIV,ppsteps & aiProcess_JoinIdenticalVertices ? MF_CHECKED : MF_UNCHECKED);
UpdatePPSettings(); UpdatePPSettings();
} } else if (ID_VIEWER_PP_CTS == LOWORD(wParam)) {
else if (ID_VIEWER_PP_CTS == LOWORD(wParam)) {
ppsteps ^= aiProcess_CalcTangentSpace; ppsteps ^= aiProcess_CalcTangentSpace;
CheckMenuItem(hMenu,ID_VIEWER_PP_CTS,ppsteps & aiProcess_CalcTangentSpace ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hMenu,ID_VIEWER_PP_CTS,ppsteps & aiProcess_CalcTangentSpace ? MF_CHECKED : MF_UNCHECKED);
UpdatePPSettings(); UpdatePPSettings();
} } else if (ID_VIEWER_PP_FD == LOWORD(wParam)) {
else if (ID_VIEWER_PP_FD == LOWORD(wParam)) {
ppsteps ^= aiProcess_FindDegenerates; ppsteps ^= aiProcess_FindDegenerates;
CheckMenuItem(hMenu,ID_VIEWER_PP_FD,ppsteps & aiProcess_FindDegenerates ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hMenu,ID_VIEWER_PP_FD,ppsteps & aiProcess_FindDegenerates ? MF_CHECKED : MF_UNCHECKED);
UpdatePPSettings(); UpdatePPSettings();
} } else if (ID_VIEWER_PP_FID == LOWORD(wParam)) {
else if (ID_VIEWER_PP_FID == LOWORD(wParam)) {
ppsteps ^= aiProcess_FindInvalidData; ppsteps ^= aiProcess_FindInvalidData;
CheckMenuItem(hMenu,ID_VIEWER_PP_FID,ppsteps & aiProcess_FindInvalidData ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hMenu,ID_VIEWER_PP_FID,ppsteps & aiProcess_FindInvalidData ? MF_CHECKED : MF_UNCHECKED);
UpdatePPSettings(); UpdatePPSettings();