diff --git a/code/nel/tools/3d/object_viewer/CMakeLists.txt b/code/nel/tools/3d/object_viewer/CMakeLists.txt index ae724580b..07ea632e5 100644 --- a/code/nel/tools/3d/object_viewer/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer/CMakeLists.txt @@ -1,12 +1,5 @@ FILE(GLOB SRC *.cpp *.h) -LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/std_afx2.h - ${CMAKE_CURRENT_SOURCE_DIR}/std_afx2.cpp) -ENABLE_LANGUAGE(RC) - -ADD_DEFINITIONS(-D_AFXDLL) -SET(CMAKE_MFC_FLAG 2) - ADD_LIBRARY(object_viewer_dll SHARED ${SRC} object_viewer.rc) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) @@ -22,11 +15,15 @@ NL_DEFAULT_PROPS(object_viewer_dll "NeL, Tools, 3D: Object Viewer DLL") NL_ADD_RUNTIME_FLAGS(object_viewer_dll) NL_ADD_LIB_SUFFIX(object_viewer_dll) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DOBJECT_VIEWER_LIB_EXPORTS) +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${MFC_DEFINITIONS} -DOBJECT_VIEWER_LIB_EXPORTS) + +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(object_viewer_dll ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.h ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.cpp) +ENDIF(WITH_PCH) INSTALL(TARGETS object_viewer_dll LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) INSTALL(FILES object_viewer.cfg DESTINATION bin COMPONENT tools3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS object_viewer_dll RUNTIME DESTINATION maxplugin COMPONENT tools3d) INSTALL(FILES object_viewer.cfg DESTINATION maxplugin COMPONENT tools3d) -ENDIF(WITH_MAXPLUGIN) \ No newline at end of file +ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/tools/3d/object_viewer/animation_set_dlg.cpp b/code/nel/tools/3d/object_viewer/animation_set_dlg.cpp index 8c5e49305..7fde2b040 100644 --- a/code/nel/tools/3d/object_viewer/animation_set_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/animation_set_dlg.cpp @@ -424,7 +424,7 @@ void CAnimationSetDlg::OnListUp() // Backup the string CString text; PlayList.GetText (sel, text); - DWORD data = PlayList.GetItemData (sel); + DWORD_PTR data = PlayList.GetItemData (sel); // Remove the node PlayList.DeleteString (sel); @@ -450,7 +450,7 @@ void CAnimationSetDlg::OnListDown() // Backup the string CString text; PlayList.GetText (sel, text); - DWORD data = PlayList.GetItemData (sel); + DWORD_PTR data = PlayList.GetItemData (sel); // Remove the node PlayList.DeleteString (sel); diff --git a/code/nel/tools/3d/object_viewer/bin_op_dlg.cpp b/code/nel/tools/3d/object_viewer/bin_op_dlg.cpp index c37e40b30..d176eec5e 100644 --- a/code/nel/tools/3d/object_viewer/bin_op_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/bin_op_dlg.cpp @@ -71,7 +71,7 @@ BOOL CBinOpDlg::OnInitDialog() void CBinOpDlg::OnSelchangeBinOp() { UpdateData() ; - newOp(m_BinOp.GetItemData(m_BinOp.GetCurSel())) ; + newOp((uint32)m_BinOp.GetItemData(m_BinOp.GetCurSel())) ; } void CBinOpDlg::OnClose() diff --git a/code/nel/tools/3d/object_viewer/dup_ps.cpp b/code/nel/tools/3d/object_viewer/dup_ps.cpp index 2e6d7a657..9cdea5463 100644 --- a/code/nel/tools/3d/object_viewer/dup_ps.cpp +++ b/code/nel/tools/3d/object_viewer/dup_ps.cpp @@ -50,7 +50,7 @@ static T *DupSerializable(const T *in) throw(NLMISC::EStream) std::copy(ms.buffer(), ms.buffer() + ms.length(), datas.begin()); ms.resetPtrTable(); ms.invert(); - ms.fill(&datas[0], datas.size()); + ms.fill(&datas[0], (uint32)datas.size()); nlassert(ms.isReading()); T *newObj = NULL; TSerializePolicy::serial(newObj, ms); diff --git a/code/nel/tools/3d/object_viewer/edit_morph_mesh_dlg.cpp b/code/nel/tools/3d/object_viewer/edit_morph_mesh_dlg.cpp index 6d232d42b..faba21d4e 100644 --- a/code/nel/tools/3d/object_viewer/edit_morph_mesh_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/edit_morph_mesh_dlg.cpp @@ -130,9 +130,9 @@ void CEditMorphMeshDlg::OnAdd() std::vector shapeNames; shapeNames.resize(_CM->getNumShapes() + 1); _CM->getShapesNames(&shapeNames[0]); - uint index = shapeNames.size() - 1; + uint index = (uint)shapeNames.size() - 1; shapeNames[index] = shapeName; - _CM->setShapes(&shapeNames[0], shapeNames.size()); + _CM->setShapes(&shapeNames[0], (uint)shapeNames.size()); std::vector numVerts; _CM->getShapeNumVerts(numVerts); m_MeshList.AddString(getShapeDescStr(index, numVerts[index]).c_str()); @@ -151,7 +151,7 @@ void CEditMorphMeshDlg::OnRemove() shapeNames.resize(_CM->getNumShapes()); _CM->getShapesNames(&shapeNames[0]); shapeNames.erase(shapeNames.begin() + selItem); - _CM->setShapes(&shapeNames[0], shapeNames.size()); + _CM->setShapes(&shapeNames[0], (uint)shapeNames.size()); if (_CM->getNumShapes() == 2) { GetDlgItem(IDC_REMOVE)->EnableWindow(FALSE); @@ -172,7 +172,7 @@ void CEditMorphMeshDlg::OnInsert() shapeNames.resize(_CM->getNumShapes()); _CM->getShapesNames(&shapeNames[0]); shapeNames.insert(shapeNames.begin() + selItem, shapeName); - _CM->setShapes(&shapeNames[0], shapeNames.size()); + _CM->setShapes(&shapeNames[0], (uint)shapeNames.size()); GetDlgItem(IDC_REMOVE)->EnableWindow(TRUE); touchPSState(); updateMeshList(); @@ -190,7 +190,7 @@ void CEditMorphMeshDlg::OnUp() shapeNames.resize(_CM->getNumShapes()); _CM->getShapesNames(&shapeNames[0]); std::swap(shapeNames[selItem - 1], shapeNames[selItem]); - _CM->setShapes(&shapeNames[0], shapeNames.size()); + _CM->setShapes(&shapeNames[0], (uint)shapeNames.size()); GetDlgItem(IDC_REMOVE)->EnableWindow(TRUE); updateMeshList(); m_MeshList.SetCurSel(selItem - 1); @@ -206,7 +206,7 @@ void CEditMorphMeshDlg::OnDown() shapeNames.resize(_CM->getNumShapes()); _CM->getShapesNames(&shapeNames[0]); std::swap(shapeNames[selItem + 1], shapeNames[selItem]); - _CM->setShapes(&shapeNames[0], shapeNames.size()); + _CM->setShapes(&shapeNames[0], (uint)shapeNames.size()); GetDlgItem(IDC_REMOVE)->EnableWindow(TRUE); updateMeshList(); m_MeshList.SetCurSel(selItem + 1); diff --git a/code/nel/tools/3d/object_viewer/located_properties.cpp b/code/nel/tools/3d/object_viewer/located_properties.cpp index 63b1063ba..12d9062f0 100644 --- a/code/nel/tools/3d/object_viewer/located_properties.cpp +++ b/code/nel/tools/3d/object_viewer/located_properties.cpp @@ -292,7 +292,7 @@ void CLocatedProperties::OnEditTriggerOnDeath() { UpdateData(); CLBExternIDDlg dlg(_Located->getTriggerEmitterID()); - int res = dlg.DoModal(); + INT_PTR res = dlg.DoModal(); if ( res == IDOK ) { if (dlg.getNewID() != _Located->getTriggerEmitterID()) diff --git a/code/nel/tools/3d/object_viewer/scheme_manager.cpp b/code/nel/tools/3d/object_viewer/scheme_manager.cpp index 613f7296e..5d0dc248d 100644 --- a/code/nel/tools/3d/object_viewer/scheme_manager.cpp +++ b/code/nel/tools/3d/object_viewer/scheme_manager.cpp @@ -55,7 +55,7 @@ void CSchemeManager::serial(NLMISC::IStream &f) throw(NLMISC::EStream) f.serialVersion(1); if (!f.isReading()) { - sint32 size = _SchemeMap.size(); + sint32 size = (sint32)_SchemeMap.size(); f.serial(size); for (TSchemeMap::iterator smIt = _SchemeMap.begin(); smIt != _SchemeMap.end(); ++smIt) { diff --git a/code/nel/tools/3d/object_viewer/skeleton_scale_dlg.cpp b/code/nel/tools/3d/object_viewer/skeleton_scale_dlg.cpp index cce034d3c..73310f86a 100644 --- a/code/nel/tools/3d/object_viewer/skeleton_scale_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/skeleton_scale_dlg.cpp @@ -1056,7 +1056,7 @@ void CSkeletonScaleDlg::refreshSaveButton() sint CSkeletonScaleDlg::getBoneForMirror(uint boneId, std::string &mirrorName) { sint side= 0; - sint pos; + std::string::size_type pos; nlassert(_SkeletonModel && boneId<_SkeletonModel->Bones.size()); mirrorName= _SkeletonModel->Bones[boneId].getBoneName(); diff --git a/code/nel/tools/3d/object_viewer/std_afx2.cpp b/code/nel/tools/3d/object_viewer/std_afx2.cpp deleted file mode 100644 index 61b1a989f..000000000 --- a/code/nel/tools/3d/object_viewer/std_afx2.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -#include "std_afx2.h" - diff --git a/code/nel/tools/3d/object_viewer/std_afx2.h b/code/nel/tools/3d/object_viewer/std_afx2.h deleted file mode 100644 index 4e4f942a9..000000000 --- a/code/nel/tools/3d/object_viewer/std_afx2.h +++ /dev/null @@ -1,84 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - -#if !defined(AFX_STDAFX2_H__9B22CB86_1929_11D5_9CD4_0050DAC3A412__INCLUDED_) -#define AFX_STDAFX2_H__9B22CB86_1929_11D5_9CD4_0050DAC3A412__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - -#include // MFC core and standard components -#include // MFC extensions - -#ifndef _AFX_NO_OLE_SUPPORT -#include // MFC OLE classes -#include // MFC OLE dialog classes -#include // MFC Automation classes -#endif // _AFX_NO_OLE_SUPPORT - - -#ifndef _AFX_NO_DB_SUPPORT -#include // MFC ODBC database classes -#endif // _AFX_NO_DB_SUPPORT - -#ifndef _AFX_NO_DAO_SUPPORT -#include // MFC DAO database classes -#endif // _AFX_NO_DAO_SUPPORT - -#include // MFC support for Internet Explorer 4 Common Controls -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - - -//#include "resource.h" - -#include "nel/misc/common.h" -#include "nel/misc/stream.h" -#include "nel/misc/vector.h" -#include "nel/misc/matrix.h" - -#include "3d/particle_system.h" -#include "3d/ps_located.h" -#include "3d/ps_particle.h" -#include "3d/ps_force.h" -#include "3d/ps_emitter.h" -#include "3d/ps_zone.h" - - -#include -#include -#include - -#include "animation_dlg.h" -#include "animation_set_dlg.h" -#include "main_dlg.h" -#include "object_viewer.h" -#include "object_viewer_interface.h" -#include "select_string.h" - - - - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__9B22CB86_1929_11D5_9CD4_0050DAC3A412__INCLUDED_) - diff --git a/code/nel/tools/3d/object_viewer/water_pool_editor.cpp b/code/nel/tools/3d/object_viewer/water_pool_editor.cpp index 72c2f9d5c..7aabf0299 100644 --- a/code/nel/tools/3d/object_viewer/water_pool_editor.cpp +++ b/code/nel/tools/3d/object_viewer/water_pool_editor.cpp @@ -200,7 +200,7 @@ uint32 CWaterPoolEditor::getCurrentPoolID() { UpdateData(); nlassert(m_PoolList.GetCurSel() != LB_ERR); // must always have something selected - return m_PoolList.GetItemData(m_PoolList.GetCurSel()); + return (uint32)m_PoolList.GetItemData(m_PoolList.GetCurSel()); } //=================================================================== diff --git a/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt b/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt index 945c3b906..2d54838a6 100644 --- a/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt @@ -1,7 +1,7 @@ FILE(GLOB SRC *.cpp *.h) ENABLE_LANGUAGE(RC) -ADD_DEFINITIONS(-D_AFXDLL) +ADD_DEFINITIONS(${MFC_DEFINITIONS}) SET(CMAKE_MFC_FLAG 2) ADD_EXECUTABLE(object_viewer WIN32 ${SRC} object_viewer_exe.rc)