From 93fd1133ffb3ceee960f4692b59a41bc52021397 Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Wed, 20 Nov 2013 14:40:20 +0100 Subject: [PATCH 01/10] Fixed mingw cross compiler issues. --- CMakeLists.txt | 2 +- include/assimp/types.h | 1 + tools/assimp_view/CMakeLists.txt | 9 ++++++--- tools/assimp_view/HelpDialog.cpp | 2 +- tools/assimp_view/LogWindow.cpp | 2 +- tools/assimp_view/MessageProc.cpp | 2 +- tools/assimp_view/stdafx.h | 4 ++-- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98fb8c62d..b0f6b88af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(LIBASSIMP-DEV_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_M set(CPACK_COMPONENTS_ALL assimp-bin ${LIBASSIMP_COMPONENT} ${LIBASSIMP-DEV_COMPONENT} assimp-dev) set(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names") -if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) +if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW ) add_definitions(-fPIC) # this is a very important switch and some libraries seem now to have it.... # hide all not-exported symbols add_definitions( -fvisibility=hidden -Wall ) diff --git a/include/assimp/types.h b/include/assimp/types.h index 22ca7abdc..604591402 100644 --- a/include/assimp/types.h +++ b/include/assimp/types.h @@ -50,6 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include // Our compile configuration diff --git a/tools/assimp_view/CMakeLists.txt b/tools/assimp_view/CMakeLists.txt index 655a38571..ebca500b3 100644 --- a/tools/assimp_view/CMakeLists.txt +++ b/tools/assimp_view/CMakeLists.txt @@ -43,8 +43,11 @@ ADD_EXECUTABLE( assimp_viewer WIN32 SET_PROPERTY(TARGET assimp_viewer PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX}) -ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS ) -ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) + +IF ( MSVC ) + ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS ) + ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) +ENDIF ( MSVC ) # @@ -54,7 +57,7 @@ ADD_CUSTOM_COMMAND(TARGET assimp_viewer MAIN_DEPENDENCY assimp) # Link the executable to the assimp + dx libs. -TARGET_LINK_LIBRARIES ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32.lib Winmm.lib ) +TARGET_LINK_LIBRARIES ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32.lib winmm.lib ) INSTALL( TARGETS assimp_viewer DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-dev diff --git a/tools/assimp_view/HelpDialog.cpp b/tools/assimp_view/HelpDialog.cpp index a7e700ab8..7e0e5ddfe 100644 --- a/tools/assimp_view/HelpDialog.cpp +++ b/tools/assimp_view/HelpDialog.cpp @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "stdafx.h" #include "assimp_view.h" -#include "RICHEDIT.H" +#include "richedit.h" namespace AssimpView { diff --git a/tools/assimp_view/LogWindow.cpp b/tools/assimp_view/LogWindow.cpp index ad6b235cd..c073028eb 100644 --- a/tools/assimp_view/LogWindow.cpp +++ b/tools/assimp_view/LogWindow.cpp @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "stdafx.h" #include "assimp_view.h" -#include "RichEdit.h" +#include "richedit.h" namespace AssimpView { diff --git a/tools/assimp_view/MessageProc.cpp b/tools/assimp_view/MessageProc.cpp index 44d38568d..54976f2b3 100644 --- a/tools/assimp_view/MessageProc.cpp +++ b/tools/assimp_view/MessageProc.cpp @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "stdafx.h" #include "assimp_view.h" -#include +#include namespace AssimpView { diff --git a/tools/assimp_view/stdafx.h b/tools/assimp_view/stdafx.h index c6d14ceb4..0fda71111 100644 --- a/tools/assimp_view/stdafx.h +++ b/tools/assimp_view/stdafx.h @@ -44,14 +44,14 @@ #include #include -#include +#include // ShellExecute() #include #include // GetOpenFileName() -#include +#include #include #include From 07ab616644710a431d757cf10503466d4ab1df2c Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Sun, 11 Mar 2012 22:08:47 +0100 Subject: [PATCH 02/10] Fixed building simple opengl texture example with mingw. --- samples/SimpleTexturedOpenGL/CMakeLists.txt | 2 -- .../SimpleTexturedOpenGL/src/model_loading.cpp | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/samples/SimpleTexturedOpenGL/CMakeLists.txt b/samples/SimpleTexturedOpenGL/CMakeLists.txt index 33edd38ce..083e22e6e 100644 --- a/samples/SimpleTexturedOpenGL/CMakeLists.txt +++ b/samples/SimpleTexturedOpenGL/CMakeLists.txt @@ -22,8 +22,6 @@ INCLUDE_DIRECTORIES( LINK_DIRECTORIES( ${Assimp_BINARY_DIR} ${Assimp_BINARY_DIR}/lib/ - ${Assimp_SOURCE_DIR}/samples/glut/ - ${Assimp_SOURCE_DIR}/samples/DevIL/lib/ ) ADD_EXECUTABLE( assimp_simpletexturedogl WIN32 diff --git a/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/src/model_loading.cpp b/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/src/model_loading.cpp index 42f468ea1..e0d0a629c 100644 --- a/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/src/model_loading.cpp +++ b/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/src/model_loading.cpp @@ -17,9 +17,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include @@ -30,8 +30,8 @@ // assimp include files. These three are usually needed. #include "assimp/Importer.hpp" //OO version Header! -#include "assimp/PostProcess.h" -#include "assimp/Scene.h" +#include "assimp/postprocess.h" +#include "assimp/scene.h" #include "assimp/DefaultLogger.hpp" #include "assimp/LogStream.hpp" From c1b28ff1ce6164cf7063fdae6b0ef7a54d72cee1 Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Mon, 12 Mar 2012 15:47:48 +0100 Subject: [PATCH 03/10] Removed unreferenced variables. --- .../SimpleTexturedOpenGL/src/model_loading.cpp | 1 - tools/assimp_view/Display.cpp | 4 ---- 2 files changed, 5 deletions(-) diff --git a/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/src/model_loading.cpp b/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/src/model_loading.cpp index e0d0a629c..253387509 100644 --- a/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/src/model_loading.cpp +++ b/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/src/model_loading.cpp @@ -177,7 +177,6 @@ int LoadGLTextures(const aiScene* scene) /* Before calling ilInit() version should be checked. */ if (ilGetInteger(IL_VERSION_NUM) < IL_VERSION) { - ILint test = ilGetInteger(IL_VERSION_NUM); /// wrong DevIL version /// std::string err_msg = "Wrong DevIL version. Old devil.dll in system32/SysWow64?"; char* cErr_msg = (char *) err_msg.c_str(); diff --git a/tools/assimp_view/Display.cpp b/tools/assimp_view/Display.cpp index 98ca794ec..380d7b2fb 100644 --- a/tools/assimp_view/Display.cpp +++ b/tools/assimp_view/Display.cpp @@ -287,10 +287,6 @@ int CDisplay::ReplaceCurrentTexture(const char* szPath) TreeView_SetItem(GetDlgItem(g_hDlg,IDC_TREE1), m_pcCurrentTexture->hTreeItem); - // change this in the old aiMaterial structure, too - aiMaterial* pcMat = (aiMaterial*) - g_pcAsset->pcScene->mMaterials[m_pcCurrentTexture->iMatIndex]; - // update all meshes referencing this material for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes;++i) { From 846a8959f8ecd160b94ad42a02cbda2e2422f80f Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Mon, 12 Mar 2012 15:49:11 +0100 Subject: [PATCH 04/10] Fixed class attribute initialization order. --- tools/assimp_view/AssetHelper.h | 11 ++++++----- tools/assimp_view/Background.h | 6 +++--- tools/assimp_view/Camera.h | 2 +- tools/assimp_view/RenderOptions.h | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tools/assimp_view/AssetHelper.h b/tools/assimp_view/AssetHelper.h index 10ebf9eea..837cf3aab 100644 --- a/tools/assimp_view/AssetHelper.h +++ b/tools/assimp_view/AssetHelper.h @@ -139,19 +139,20 @@ class AssetHelper : piVB (NULL), piIB (NULL), - piEffect (NULL), piVBNormals (NULL), + piEffect (NULL), + bSharedFX (false), piDiffuseTexture (NULL), piSpecularTexture (NULL), piAmbientTexture (NULL), - piNormalTexture (NULL), piEmissiveTexture (NULL), + piNormalTexture (NULL), piOpacityTexture (NULL), piShininessTexture (NULL), piLightmapTexture (NULL), - pvOriginalNormals (NULL), - bSharedFX(false), - twosided (false){} + twosided (false), + pvOriginalNormals (NULL) + {} ~MeshHelper () { diff --git a/tools/assimp_view/Background.h b/tools/assimp_view/Background.h index 54c5de0b3..9908babf3 100644 --- a/tools/assimp_view/Background.h +++ b/tools/assimp_view/Background.h @@ -47,10 +47,10 @@ class CBackgroundPainter { CBackgroundPainter() : - pcTexture(NULL), clrColor(D3DCOLOR_ARGB(0xFF,100,100,100)), - eMode(SIMPLE_COLOR), - piSkyBoxEffect(NULL) + pcTexture(NULL), + piSkyBoxEffect(NULL), + eMode(SIMPLE_COLOR) {} public: diff --git a/tools/assimp_view/Camera.h b/tools/assimp_view/Camera.h index 020b7602f..264ab19cb 100644 --- a/tools/assimp_view/Camera.h +++ b/tools/assimp_view/Camera.h @@ -55,8 +55,8 @@ class Camera : vPos(0.0f,0.0f,-10.0f), - vLookAt(0.0f,0.0f,1.0f), vUp(0.0f,1.0f,0.0f), + vLookAt(0.0f,0.0f,1.0f), vRight(0.0f,1.0f,0.0f) { diff --git a/tools/assimp_view/RenderOptions.h b/tools/assimp_view/RenderOptions.h index 558de66fb..863064d72 100644 --- a/tools/assimp_view/RenderOptions.h +++ b/tools/assimp_view/RenderOptions.h @@ -60,16 +60,16 @@ class RenderOptions bSuperSample (false), bRenderMats (true), bRenderNormals (false), - eDrawMode (NORMAL), b3Lights (false), bLightRotate (false), bRotate (true), bLowQuality (false), bNoSpecular (false), bStereoView (false), + bNoAlphaBlending(false), + eDrawMode (NORMAL), bCulling (false), - bSkeleton (false), - bNoAlphaBlending(false) + bSkeleton (false) {} From c6297ec333e0eb926d6fbcee5d5ca3f2023a715e Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Mon, 12 Mar 2012 15:50:49 +0100 Subject: [PATCH 05/10] Fixed variable assignment values. --- tools/assimp_view/Display.cpp | 4 ++-- tools/assimp_view/MeshRenderer.cpp | 2 +- tools/assimp_view/MessageProc.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/assimp_view/Display.cpp b/tools/assimp_view/Display.cpp index 380d7b2fb..9927fbe58 100644 --- a/tools/assimp_view/Display.cpp +++ b/tools/assimp_view/Display.cpp @@ -1183,7 +1183,7 @@ int CDisplay::HandleTreeViewPopup(WPARAM wParam,LPARAM lParam) { // get the current selected material std::vector apclrOut; - const char* szMatKey; + const char* szMatKey = ""; switch (LOWORD(wParam)) { @@ -1251,7 +1251,7 @@ int CDisplay::HandleTreeViewPopup(WPARAM wParam,LPARAM lParam) clr.lpCustColors = g_aclCustomColors; clr.lpfnHook = NULL; clr.lpTemplateName = NULL; - clr.lCustData = NULL; + clr.lCustData = 0; ChooseColor(&clr); diff --git a/tools/assimp_view/MeshRenderer.cpp b/tools/assimp_view/MeshRenderer.cpp index c835f9b0f..d17bd2f8d 100644 --- a/tools/assimp_view/MeshRenderer.cpp +++ b/tools/assimp_view/MeshRenderer.cpp @@ -61,7 +61,7 @@ int CMeshRenderer::DrawUnsorted(unsigned int iIndex) g_piDevice->SetIndices(g_pcAsset->apcMeshes[iIndex]->piIB); - D3DPRIMITIVETYPE type; + D3DPRIMITIVETYPE type = D3DPT_POINTLIST; switch (g_pcAsset->pcScene->mMeshes[iIndex]->mPrimitiveTypes) { case aiPrimitiveType_POINT: type = D3DPT_POINTLIST;break; diff --git a/tools/assimp_view/MessageProc.cpp b/tools/assimp_view/MessageProc.cpp index 54976f2b3..14bf0a446 100644 --- a/tools/assimp_view/MessageProc.cpp +++ b/tools/assimp_view/MessageProc.cpp @@ -522,7 +522,7 @@ void DisplayColorDialog(D3DCOLOR* pclrResult) clr.lpCustColors = g_aclCustomColors; clr.lpfnHook = NULL; clr.lpTemplateName = NULL; - clr.lCustData = NULL; + clr.lCustData = 0; ChooseColor(&clr); @@ -549,7 +549,7 @@ void DisplayColorDialog(D3DXVECTOR4* pclrResult) clr.lpCustColors = g_aclCustomColors; clr.lpfnHook = NULL; clr.lpTemplateName = NULL; - clr.lCustData = NULL; + clr.lCustData = 0; ChooseColor(&clr); From c3852c474344228ebe1170f8dfe12458b586dca4 Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Wed, 20 Nov 2013 14:42:18 +0100 Subject: [PATCH 06/10] Removed noops and warnings on unused variables. --- tools/assimp_view/HelpDialog.cpp | 3 +-- tools/assimp_view/LogWindow.cpp | 2 +- tools/assimp_view/assimp_view.cpp | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/assimp_view/HelpDialog.cpp b/tools/assimp_view/HelpDialog.cpp index 7e0e5ddfe..3fb09f0c1 100644 --- a/tools/assimp_view/HelpDialog.cpp +++ b/tools/assimp_view/HelpDialog.cpp @@ -53,7 +53,7 @@ namespace AssimpView { INT_PTR CALLBACK HelpDialogProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM lParam) { - lParam; + (void)lParam; switch (uMsg) { case WM_INITDIALOG: @@ -70,7 +70,6 @@ INT_PTR CALLBACK HelpDialogProc(HWND hwndDlg,UINT uMsg, SendDlgItemMessage(hwndDlg,IDC_RICHEDIT21, EM_SETTEXTEX,(WPARAM)&sInfo,( LPARAM) pData); - UnlockResource(hg); FreeResource(hg); return TRUE; } diff --git a/tools/assimp_view/LogWindow.cpp b/tools/assimp_view/LogWindow.cpp index c073028eb..7fd4a6179 100644 --- a/tools/assimp_view/LogWindow.cpp +++ b/tools/assimp_view/LogWindow.cpp @@ -70,7 +70,7 @@ static const char* AI_VIEW_RTF_LOG_HEADER = INT_PTR CALLBACK LogDialogProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM lParam) { - lParam; + (void)lParam; switch (uMsg) { case WM_INITDIALOG: diff --git a/tools/assimp_view/assimp_view.cpp b/tools/assimp_view/assimp_view.cpp index 5af9cf547..27bc8083a 100644 --- a/tools/assimp_view/assimp_view.cpp +++ b/tools/assimp_view/assimp_view.cpp @@ -872,12 +872,10 @@ int CreateHUDTexture() g_pcTexture = NULL; g_szImageMask = NULL; - UnlockResource(hg); FreeResource(hg); return 0; } - UnlockResource(hg); FreeResource(hg); D3DSURFACE_DESC sDesc; @@ -909,12 +907,10 @@ int CreateHUDTexture() D3DCOLOR_ARGB(0xFF,0xFF,0,0)); g_szImageMask = NULL; - UnlockResource(hg); FreeResource(hg); return 0; } - UnlockResource(hg); FreeResource(hg); // lock the texture and copy it to get a pointer From 9e579324d09e519da5639d31545d588b7b127154 Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Mon, 12 Mar 2012 15:53:28 +0100 Subject: [PATCH 07/10] Added conditions for compiler oder build mode dependend code. --- tools/assimp_view/stdafx.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/assimp_view/stdafx.h b/tools/assimp_view/stdafx.h index 0fda71111..f60fe0069 100644 --- a/tools/assimp_view/stdafx.h +++ b/tools/assimp_view/stdafx.h @@ -60,13 +60,15 @@ #include #include +#if defined _MSC_VER // Windows CommonControls 6.0 Manifest Extensions -#if defined _M_IX86 -# pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") -#elif defined _M_IA64 -# pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") -#elif defined _M_X64 -# pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") -#else -# pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") +# if defined _M_IX86 +# pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") +# elif defined _M_IA64 +# pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") +# elif defined _M_X64 +# pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") +# else +# pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") +# endif #endif From 8d0b76a5359f5cc3d3a91b97aadf5d82d79e495e Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Mon, 12 Mar 2012 16:04:08 +0100 Subject: [PATCH 08/10] Added parenthesis for explicit operator evaluation priority. --- tools/assimp_view/Material.cpp | 2 +- tools/assimp_view/MessageProc.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/assimp_view/Material.cpp b/tools/assimp_view/Material.cpp index 3abef7b15..6f9aac341 100644 --- a/tools/assimp_view/Material.cpp +++ b/tools/assimp_view/Material.cpp @@ -299,7 +299,7 @@ int CMaterialManager::FindValidPath(aiString* p_szString) if( !q ) q=strrchr( tmp2,'\\' ); if( q ){ strcpy( q+1,p+1 ); - if(pFile=fopen( tmp2,"r" ) ){ + if((pFile=fopen( tmp2,"r" ))){ fclose( pFile ); strcpy(p_szString->data,tmp2); p_szString->length = strlen(tmp2); diff --git a/tools/assimp_view/MessageProc.cpp b/tools/assimp_view/MessageProc.cpp index 14bf0a446..e4ecd0448 100644 --- a/tools/assimp_view/MessageProc.cpp +++ b/tools/assimp_view/MessageProc.cpp @@ -99,7 +99,7 @@ void MakeFileAssociations() RegSetValueEx(g_hRegistry,"",0,REG_SZ,(const BYTE*)"ASSIMPVIEW_CLASS",(DWORD)strlen("ASSIMPVIEW_CLASS")+1); RegCloseKey(g_hRegistry); } - while (sz = strtok(NULL,";")); + while ((sz = strtok(NULL,";"))); RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\Classes\\ASSIMPVIEW_CLASS",NULL,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); RegCloseKey(g_hRegistry); From c4d797ef58464e9ac994af12b06eda9e5dfc1fc6 Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Mon, 12 Mar 2012 16:04:56 +0100 Subject: [PATCH 09/10] Replaced function parameters with correct literals. --- tools/assimp_view/MessageProc.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/assimp_view/MessageProc.cpp b/tools/assimp_view/MessageProc.cpp index e4ecd0448..26753f846 100644 --- a/tools/assimp_view/MessageProc.cpp +++ b/tools/assimp_view/MessageProc.cpp @@ -95,16 +95,16 @@ void MakeFileAssociations() ai_assert(sz[0] == '*'); sprintf(buf,"Software\\Classes\\%s",sz+1); - RegCreateKeyEx(HKEY_CURRENT_USER,buf,NULL,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); + RegCreateKeyEx(HKEY_CURRENT_USER,buf,0,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); RegSetValueEx(g_hRegistry,"",0,REG_SZ,(const BYTE*)"ASSIMPVIEW_CLASS",(DWORD)strlen("ASSIMPVIEW_CLASS")+1); RegCloseKey(g_hRegistry); } while ((sz = strtok(NULL,";"))); - RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\Classes\\ASSIMPVIEW_CLASS",NULL,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); + RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\Classes\\ASSIMPVIEW_CLASS",0,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); RegCloseKey(g_hRegistry); - RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\Classes\\ASSIMPVIEW_CLASS\\shell\\open\\command",NULL,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); + RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\Classes\\ASSIMPVIEW_CLASS\\shell\\open\\command",0,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); RegSetValueEx(g_hRegistry,"",0,REG_SZ,(const BYTE*)szTemp,(DWORD)strlen(szTemp)+1); RegCloseKey(g_hRegistry); @@ -1120,7 +1120,7 @@ void InitUI() // store the key in a global variable for later use RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\ASSIMP\\Viewer", - NULL,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); + 0,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"LastUIState",NULL,NULL, (BYTE*)&dwValue,&dwTemp)) @@ -2411,7 +2411,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, }; DWORD dwTemp = MAX_PATH; RegCreateKeyEx(HKEY_CURRENT_USER, - "Software\\ASSIMP\\Viewer",NULL,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); + "Software\\ASSIMP\\Viewer",0,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); if(ERROR_SUCCESS == RegQueryValueEx(g_hRegistry,"LastSkyBoxSrc",NULL,NULL, (BYTE*)szFileName,&dwTemp) && '\0' != szFileName[0]) { From 6b5b3c64e65088adfa03185d12a0553fca3688e9 Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Mon, 12 Mar 2012 16:06:00 +0100 Subject: [PATCH 10/10] Removed invalid extern keyword. --- tools/assimp_view/assimp_view.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/assimp_view/assimp_view.cpp b/tools/assimp_view/assimp_view.cpp index 27bc8083a..f3c261e92 100644 --- a/tools/assimp_view/assimp_view.cpp +++ b/tools/assimp_view/assimp_view.cpp @@ -106,7 +106,7 @@ aiVector3D g_vRotateSpeed = aiVector3D(0.5f,0.5f,0.5f); aiVector3D g_avLightDirs[1] = { aiVector3D(-0.5f,0.6f,0.2f) }; -extern D3DCOLOR g_avLightColors[3] = +D3DCOLOR g_avLightColors[3] = { D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0xFF), D3DCOLOR_ARGB(0xFF,0xFF,0x00,0x00),