From 2924395a85ef43d558f9e71edc13ce6f10eb72cc Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 1 Sep 2010 13:44:01 +0200 Subject: [PATCH] Fixed: 3dsmax plugins compilation (64 bits and STLport) --- .../3d/ligo/plugin_max/ligoscape_utility.h | 1 + .../tools/3d/ligo/plugin_max/max_to_ligo.cpp | 2 + code/nel/tools/3d/ligo/plugin_max/script.cpp | 2 + .../3d/plugin_max/nel_3dsmax_shared/StdAfx.h | 1 + .../nel_3dsmax_shared/nel_3dsmax_shared.cpp | 2 +- .../3d/plugin_max/nel_export/nel_export.cpp | 4 +- .../nel_export/nel_export_node_properties.cpp | 122 +++++++++--------- .../3d/plugin_max/nel_export/progress.cpp | 8 +- .../tools/3d/plugin_max/nel_export/std_afx.h | 1 + .../tools/3d/plugin_max/nel_mesh_lib/StdAfx.h | 1 + .../plugin_max/nel_patch_converter/PO2RPO.h | 1 + .../nel_patch_converter.cpp | 2 +- .../plugin_max/nel_patch_converter/script.cpp | 1 + .../nel_patch_edit/np_edit_patch_mod.cpp | 4 +- .../plugin_max/nel_patch_edit/np_editpops.cpp | 2 +- .../nel_patch_edit/np_epm_selection.cpp | 6 +- .../nel_patch_edit/np_epm_surface.cpp | 22 ++-- .../plugin_max/nel_patch_edit/np_epm_tess.cpp | 8 +- .../3d/plugin_max/nel_patch_edit/np_main.cpp | 12 +- .../3d/plugin_max/nel_patch_edit/np_mods.cpp | 4 +- .../plugin_max/nel_patch_edit/np_rollup.cpp | 12 +- .../3d/plugin_max/nel_patch_edit/stdafx.h | 1 + .../plugin_max/nel_patch_lib/nel_patch_mesh.h | 6 +- .../3d/plugin_max/nel_patch_lib/stdafx.h | 1 + .../plugin_max/nel_patch_paint/DllEntry.cpp | 4 +- .../plugin_max/nel_patch_paint/paint_main.cpp | 2 +- .../plugin_max/nel_patch_paint/paint_pops.cpp | 2 +- .../nel_patch_paint/paint_rollup.cpp | 6 +- .../3d/plugin_max/nel_patch_paint/stdafx.h | 1 + .../vertex_tree_paint.cpp | 14 +- .../nel_vertex_tree_paint/vertex_tree_paint.h | 3 +- .../plugin_max/tile_utility/tile_utility.cpp | 2 +- .../3d/plugin_max/tile_utility/tile_utility.h | 1 + 33 files changed, 138 insertions(+), 123 deletions(-) diff --git a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.h b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.h index b1c9d081e..ab2375eae 100644 --- a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.h +++ b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.h @@ -14,6 +14,7 @@ #ifndef __PLUGIN_MAX__H #define __PLUGIN_MAX__H +#include #include "Max.h" #include #include diff --git a/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp b/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp index 9e143df06..7500b027b 100644 --- a/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp @@ -14,6 +14,8 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include + // From MAXSDK #include diff --git a/code/nel/tools/3d/ligo/plugin_max/script.cpp b/code/nel/tools/3d/ligo/plugin_max/script.cpp index 97b9a97ad..228bf5349 100644 --- a/code/nel/tools/3d/ligo/plugin_max/script.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/script.cpp @@ -16,6 +16,8 @@ #define EXPORT_GET_ALLOCATOR +#include + // Various MAX and MXS includes #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/StdAfx.h b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/StdAfx.h index 0099fe7af..86627aaf7 100644 --- a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/StdAfx.h +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/StdAfx.h @@ -30,6 +30,7 @@ // Insert your headers here #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp index 2c5cedd65..d30a5cadb 100644 --- a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . #include "stdafx.h" -#include "..\nel_patch_lib\rpo.h" +#include "../nel_patch_lib/rpo.h" #include "nel_3dsmax_shared.h" #include "nel/misc/app_context.h" diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp index 04e815eac..7b8d2862e 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp @@ -59,7 +59,7 @@ void *CNelExportClassDesc::Create(BOOL loading) } -int CALLBACK OptionsDialogCallback ( +INT_PTR CALLBACK OptionsDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter @@ -217,7 +217,7 @@ int CALLBACK OptionsDialogCallback ( } extern HINSTANCE hInstance; -static BOOL CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { // Set locale to english setlocale (LC_NUMERIC, "English"); diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_node_properties.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_node_properties.cpp index f56ed592a..d6218fedf 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_node_properties.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_node_properties.cpp @@ -309,22 +309,22 @@ public: HWND SubVPDlg[VP_COUNT]; }; -int CALLBACK MRMDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK AccelDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK InstanceDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK LightmapDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK Lightmap2DialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK VegetableDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK VertexProgramDialogCallBack (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK MiscDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK AnimationDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK MRMDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AccelDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK InstanceDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK LightmapDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK Lightmap2DialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK VegetableDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK VertexProgramDialogCallBack (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK MiscDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AnimationDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); const char *SubText[TAB_COUNT] = {"LOD & MRM", "Accelerator", "Instance", "Lighting", "LMC", "Vegetable", "VertexProgram", "Misc", "Animation"}; const int SubTab[TAB_COUNT] = {IDD_LOD, IDD_ACCEL, IDD_INSTANCE, IDD_LIGHTMAP, IDD_LIGHTMAP2, IDD_VEGETABLE, IDD_VERTEX_PROGRAM, IDD_MISC, IDD_ANIM}; DLGPROC SubProc[TAB_COUNT] = {MRMDialogCallback, AccelDialogCallback, InstanceDialogCallback, LightmapDialogCallback, Lightmap2DialogCallback, VegetableDialogCallback, VertexProgramDialogCallBack, MiscDialogCallback, AnimationDialogCallback}; // VertexPrograms. -int CALLBACK VPWindTreeCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK VPWindTreeCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); const int SubVPTab[VP_COUNT] = {IDD_VP_WINDTREE}; DLGPROC SubVPProc[VP_COUNT] = {VPWindTreeCallback}; @@ -417,7 +417,7 @@ void VegetableStateChanged (HWND hwndDlg) void AccelStateChanged (HWND hwndDlg) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); bool cluster = (currentParam->AcceleratorType&NEL3D_APPDATA_ACCEL_TYPE) == NEL3D_APPDATA_ACCEL_CLUSTER; bool portal = (currentParam->AcceleratorType&NEL3D_APPDATA_ACCEL_TYPE) == NEL3D_APPDATA_ACCEL_PORTAL; @@ -464,22 +464,22 @@ void exploreNode(INode *node) } -int CALLBACK AccelDialogCallback ( +INT_PTR CALLBACK AccelDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Fill the known sound groups by parsing the max node tree. { @@ -635,22 +635,22 @@ int CALLBACK AccelDialogCallback ( // *************************************************************************** -int CALLBACK MRMDialogCallback ( +INT_PTR CALLBACK MRMDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Window text std::string winName=(*(currentParam->ListNode->begin()))->GetName(); @@ -903,22 +903,22 @@ int CALLBACK MRMDialogCallback ( // *************************************************************************** -int CALLBACK InstanceDialogCallback ( +INT_PTR CALLBACK InstanceDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_GROUP_SHAPE), currentParam->InstanceShape.c_str()); SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_NAME), currentParam->InstanceName.c_str()); @@ -1019,22 +1019,22 @@ int CALLBACK InstanceDialogCallback ( // *************************************************************************** -int CALLBACK LightmapDialogCallback ( +INT_PTR CALLBACK LightmapDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_LUMELSIZEMUL), currentParam->LumelSizeMul.c_str()); SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_SOFTSHADOW_RADIUS), currentParam->SoftShadowRadius.c_str()); @@ -1298,14 +1298,14 @@ struct CLMCParamFrom }; // *************************************************************************** -int CALLBACK LMCCopyFromDialogCallback( +INT_PTR CALLBACK LMCCopyFromDialogCallback( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLMCParamFrom *lmcParam=(CLMCParamFrom *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLMCParamFrom *lmcParam=(CLMCParamFrom *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); uint i; switch (uMsg) @@ -1313,8 +1313,8 @@ int CALLBACK LMCCopyFromDialogCallback( case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - lmcParam=(CLMCParamFrom *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + lmcParam=(CLMCParamFrom *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // init the colors nlctassert(CLodDialogBoxParam::NumLightGroup==3); @@ -1519,22 +1519,22 @@ void lmcCopyFrom(CLodDialogBoxParam *currentParam, HWND parentDlg) } // *************************************************************************** -int CALLBACK Lightmap2DialogCallback ( +INT_PTR CALLBACK Lightmap2DialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // retrieve the color choosing Ctrl nlctassert(CLodDialogBoxParam::NumLightGroup==3); @@ -1642,22 +1642,22 @@ int CALLBACK Lightmap2DialogCallback ( // *************************************************************************** -int CALLBACK VegetableDialogCallback ( +INT_PTR CALLBACK VegetableDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SendMessage (GetDlgItem (hwndDlg, IDC_VEGETABLE), BM_SETCHECK, currentParam->Vegetable, 0); @@ -1762,22 +1762,22 @@ int CALLBACK VegetableDialogCallback ( } // *************************************************************************** -int CALLBACK VertexProgramDialogCallBack ( +INT_PTR CALLBACK VertexProgramDialogCallBack ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // test wether v.p are bypassed for that object (this may happen when a v.p is needed by a material of this mesh) if (!currentParam->VertexProgramBypassed) @@ -2028,22 +2028,22 @@ static void updateVPWTStaticForControl(HWND hwndDlg, HWND ctrlWnd, CVPWindTreeAp } -int CALLBACK VPWindTreeCallback ( +INT_PTR CALLBACK VPWindTreeCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Init controls CVPWindTreeAppData &vpwt= currentParam->VertexProgramWindTree; @@ -2266,22 +2266,22 @@ int CALLBACK VPWindTreeCallback ( // *************************************************************************** -int CALLBACK MiscDialogCallback ( +INT_PTR CALLBACK MiscDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SendMessage (GetDlgItem (hwndDlg, IDC_FLOATING_OBJECT), BM_SETCHECK, currentParam->FloatingObject, 0); // Ligoscape @@ -2399,22 +2399,22 @@ int CALLBACK MiscDialogCallback ( // *************************************************************************** -int CALLBACK AnimationDialogCallback ( +INT_PTR CALLBACK AnimationDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SendMessage (GetDlgItem (hwndDlg, IDC_EXPORT_NOTE_TRACK), BM_SETCHECK, currentParam->ExportNoteTrack, 0); SendMessage (GetDlgItem (hwndDlg, IDC_EXPORT_SSS_TRACK), BM_SETCHECK, currentParam->ExportSSSTrack, 0); SendMessage (GetDlgItem (hwndDlg, IDC_EXPORT_ANIMATED_MATERIALS), BM_SETCHECK, currentParam->ExportAnimatedMaterials, 0); @@ -2468,22 +2468,22 @@ int CALLBACK AnimationDialogCallback ( // *************************************************************************** -int CALLBACK LodDialogCallback ( +INT_PTR CALLBACK LodDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Window text std::string winName=(*(currentParam->ListNode->begin()))->GetName(); @@ -2602,7 +2602,7 @@ void CNelExport::OnNodeProperties (const std::set &listNode) { // Get - uint nNumSelNode=listNode.size(); + uint nNumSelNode=(uint)listNode.size(); if (nNumSelNode) { @@ -3220,7 +3220,7 @@ void CNelExport::OnNodeProperties (const std::set &listNode) if (param.ListActived) { // Write size of the list - uint sizeList=std::min (param.ListLodName.size(), (uint)NEL3D_APPDATA_LOD_NAME_COUNT_MAX); + uint sizeList=std::min ((uint)param.ListLodName.size(), (uint)NEL3D_APPDATA_LOD_NAME_COUNT_MAX); CExportNel::setScriptAppData (node, NEL3D_APPDATA_LOD_NAME_COUNT, (int)sizeList); // Write the strings diff --git a/code/nel/tools/3d/plugin_max/nel_export/progress.cpp b/code/nel/tools/3d/plugin_max/nel_export/progress.cpp index 4c1a239ca..7dd24b761 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/progress.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/progress.cpp @@ -26,7 +26,7 @@ using namespace NLMISC; // ----------------------------------------------------------------------------------------------- // Window dialog callback // ----------------------------------------------------------------------------------------------- -int CALLBACK CalculatingDialogCallback ( +INT_PTR CALLBACK CalculatingDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter @@ -34,14 +34,14 @@ int CALLBACK CalculatingDialogCallback ( ) { double TimeCurrent = CTime::ticksToSecond( CTime::getPerformanceTime() ); - CProgressBar *pClass = (CProgressBar*)GetWindowLong (hwndDlg, GWL_USERDATA); + CProgressBar *pClass = (CProgressBar*)GetWindowLongPtr (hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - pClass = (CProgressBar*)GetWindowLong (hwndDlg, GWL_USERDATA); + LONG res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + pClass = (CProgressBar*)GetWindowLongPtr (hwndDlg, GWLP_USERDATA); CenterWindow( hwndDlg, theCNelExport._Ip->GetMAXHWnd() ); ShowWindow( hwndDlg, SW_SHOWNORMAL ); diff --git a/code/nel/tools/3d/plugin_max/nel_export/std_afx.h b/code/nel/tools/3d/plugin_max/nel_export/std_afx.h index dcc52202d..326c0b9c1 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/std_afx.h +++ b/code/nel/tools/3d/plugin_max/nel_export/std_afx.h @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h b/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h index 9a99b5fc1..65b65651e 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h @@ -26,6 +26,7 @@ //#include "nel/misc/types_nl.h" // Max SDK includes //#define NOMINMAX +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/PO2RPO.h b/code/nel/tools/3d/plugin_max/nel_patch_converter/PO2RPO.h index 991ec01ff..51e7255b8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/PO2RPO.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/PO2RPO.h @@ -18,6 +18,7 @@ #ifndef __PMESH2RKLPMESH__H #define __PMESH2RKLPMESH__H +#include #include "Max.h" #include "resource.h" #include "istdplug.h" diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.cpp b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.cpp index 0310ecef7..eee8b1cf8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.cpp @@ -121,7 +121,7 @@ void PO2RPO::ModifyObject(TimeValue t, ModContext &mc, ObjectState * os, INode * // ----------------------------------------------------------------------------------------------------------------------------------------------------------- extern HINSTANCE hInstance; -BOOL CALLBACK DlgProc_Panel(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK DlgProc_Panel(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp b/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp index 731d9aefb..b324c2cc6 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp @@ -21,6 +21,7 @@ #define _CRT_SECURE_NO_DEPRECATE +#include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_edit_patch_mod.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_edit_patch_mod.cpp index cdc3d5ed9..ef7a87642 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_edit_patch_mod.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_edit_patch_mod.cpp @@ -264,7 +264,7 @@ void EditPatchMod::NewSetByOperator(TSTR &newName, Tab < int> &sets, int op) // Named selection set copy/paste methods follow... -static BOOL CALLBACK PickSetNameDlgProc( +static INT_PTR CALLBACK PickSetNameDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static TSTR *name; @@ -328,7 +328,7 @@ BOOL EditPatchMod::GetUniqueSetName(TSTR &name) -static BOOL CALLBACK PickSetDlgProc( +static INT_PTR CALLBACK PickSetDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_editpops.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_editpops.cpp index 89da6fbe1..22a678ec0 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_editpops.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_editpops.cpp @@ -50,7 +50,7 @@ EPTempData::EPTempData(EditPatchMod *m,EditPatchData *pd) mod = m; } -void EPTempData::Invalidate(DWORD part,BOOL patchValid) +void EPTempData::Invalidate(PartID part,BOOL patchValid) { if ( !patchValid ) { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp index 1370a93cf..cee83b2b0 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp @@ -9,9 +9,9 @@ #define PROMPT_TIME 2000 -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); extern void ChangePatchType(PatchMesh *patch, int index, int type); extern BOOL filterVerts; // ------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_surface.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_surface.cpp index 154e5b78c..164748768 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_surface.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_surface.cpp @@ -15,7 +15,7 @@ extern int sbmParams[4]; extern DWORD sbsParams[3]; // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK SelectByMatDlgProc( +INT_PTR CALLBACK SelectByMatDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static int *param; @@ -84,7 +84,7 @@ void SetSmoothButtonState(HWND hWnd, DWORD bits, DWORD invalid, DWORD unused = 0 // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static DWORD *param; switch (msg) @@ -137,9 +137,9 @@ BOOL CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -150,7 +150,7 @@ BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP ep =(EditPatchMod *)lParam; ep->hTilePanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ep->tileNum = SetupIntSpinner(hDlg, IDC_TILE_MAT_SPIN, IDC_TILE_MAT, 0, 65535, 0); ep->tileRot = SetupIntSpinner(hDlg, IDC_TILE_ROT_SPIN, IDC_TILE_ROT, 0, 3, 0); ep->SetTileDlgEnables(); @@ -249,9 +249,9 @@ BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -262,7 +262,7 @@ BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP ep =(EditPatchMod *)lParam; ep->hEdgePanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ep->SetEdgeDlgEnables(); return TRUE; } @@ -324,9 +324,9 @@ BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -339,7 +339,7 @@ BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP for (int i = IDC_SMOOTH_GRP1; i < IDC_SMOOTH_GRP1 + 32; i++) SendMessage(GetDlgItem(hDlg, i), CC_COMMAND, CC_CMD_SET_TYPE, CBT_CHECK); - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ep->matSpin = SetupIntSpinner(hDlg, IDC_MAT_IDSPIN, IDC_MAT_ID, 1, MAX_MATID, 0); ep->tessUSpin = SetupIntSpinner(hDlg, IDC_TESS_U_SPIN, IDC_TESS_U2, 1, 4, RPO_DEFAULT_TESSEL); ep->tessVSpin = SetupIntSpinner(hDlg, IDC_TESS_V_SPIN, IDC_TESS_V2, 1, 4, RPO_DEFAULT_TESSEL); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp index d73ea12ce..ec95d6ce5 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp @@ -10,7 +10,7 @@ #define PROMPT_TIME 2000 extern AdvParams sParams; -BOOL CALLBACK AdvParametersDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AdvParametersDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); // ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -212,7 +212,7 @@ void EditPatchMod::SetTessUI(HWND hDlg, TessApprox *tess) BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -223,7 +223,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep =(EditPatchMod *)lParam; ep->hSurfPanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG)ep); if (!ep->settingViewportTess && ep->settingDisp && ep->GetProdTess().type == TESS_SET) ep->settingDisp = FALSE; TessApprox t; @@ -599,7 +599,7 @@ static ISpinnerControl* psMaxTrisSpin = NULL; // this max matches the MI max. #define MAX_SUBDIV 7 static BOOL initing = FALSE; // this is a hack but CenterWindow causes bad commands -BOOL CALLBACK +INT_PTR CALLBACK AdvParametersDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_main.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_main.cpp index 5cab14922..42389e4d0 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_main.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_main.cpp @@ -9,12 +9,12 @@ #define PROMPT_TIME 2000 -BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); extern void CancelEditPatchModes(IObjParam *ip); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp index 8470f3653..c2696674a 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp @@ -96,12 +96,12 @@ __declspec( dllexport ) ULONG CanAutoDefer() BOOL CALLBACK DefaultSOTProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) { - IObjParam *ip = (IObjParam*)GetWindowLong(hWnd,GWL_USERDATA); + IObjParam *ip = (IObjParam*)GetWindowLongPtr(hWnd,GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: - SetWindowLong(hWnd,GWL_USERDATA,lParam); + SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam); break; case WM_LBUTTONDOWN: diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp index 86a35b083..be29c758c 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp @@ -33,10 +33,10 @@ extern void CancelEditPatchModes(IObjParam *ip); extern void LoadImages(); -BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { static char string[64]; - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); ICustToolbar *iToolbar; if (!ep && message != WM_INITDIALOG) return FALSE; @@ -104,7 +104,7 @@ BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep =(EditPatchMod *)lParam; ep->hSelectPanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); // Set up the editing level selector LoadImages(); iToolbar = GetICustToolbar(GetDlgItem(hDlg, IDC_SELTYPE)); @@ -349,9 +349,9 @@ void EditPatchMod::SetOpsDlgEnables() // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -367,7 +367,7 @@ BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa ep->hOpsPanel = hDlg; for (int i = IDC_SMOOTH_GRP1; i < IDC_SMOOTH_GRP1 + 32; i++) SendMessage(GetDlgItem(hDlg, i), CC_COMMAND, CC_CMD_SET_TYPE, CBT_CHECK); - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ICustButton *but = GetICustButton(GetDlgItem(hDlg, IDC_ATTACH)); but->SetHighlightColor(GREEN_WASH); but->SetType(CBT_CHECK); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/stdafx.h b/code/nel/tools/3d/plugin_max/nel_patch_edit/stdafx.h index 5adc0636d..cb4ae8ecf 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/stdafx.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/stdafx.h @@ -1,4 +1,5 @@ #pragma warning (disable : 4786) +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h b/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h index 508a9b843..12238a87b 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h @@ -521,7 +521,7 @@ public: // Get map hit size uint getMapHitSize () const { - return _Data._MapHitToTileIndex->size (); + return (uint)_Data._MapHitToTileIndex->size (); } // Remap a triangle @@ -534,7 +534,7 @@ public: // Get the patch user info size uint getUIPatchSize () const { - return _Data._UIPatch->size(); + return (uint)_Data._UIPatch->size(); } // Get a patch user info @@ -558,7 +558,7 @@ public: // Get vertex user info size uint getUIVertexSize () const { - return _Data._UIVertex->size(); + return (uint)_Data._UIVertex->size(); } // Get a vertex user info diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h b/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h index f295970f5..8962b86bc 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h @@ -20,6 +20,7 @@ #define _CRT_SECURE_NO_DEPRECATE #pragma warning (disable : 4786) +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp index d7fd70aec..a3578a0bc 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp @@ -112,11 +112,11 @@ __declspec( dllexport ) ULONG CanAutoDefer() BOOL CALLBACK DefaultSOTProc( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) { - IObjParam *ip = (IObjParam*)GetWindowLong(hWnd,GWL_USERDATA); + IObjParam *ip = (IObjParam*)GetWindowLongPtr(hWnd,GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: - SetWindowLong(hWnd,GWL_USERDATA,lParam); + SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam); break; case WM_LBUTTONDOWN: diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_main.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_main.cpp index c03c0994e..46934e653 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_main.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_main.cpp @@ -3,7 +3,7 @@ // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); extern void CancelEditPatchModes(IObjParam *ip); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_pops.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_pops.cpp index e7e6d57dd..9fa7d8953 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_pops.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_pops.cpp @@ -23,7 +23,7 @@ EPTempData::EPTempData(PaintPatchMod *m,PaintPatchData *pd) mod = m; } -void EPTempData::Invalidate(DWORD part,BOOL patchValid) +void EPTempData::Invalidate(PartID part,BOOL patchValid) { if ( !patchValid ) { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp index 6785fdd3d..37b73fdc1 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp @@ -44,9 +44,9 @@ void PaintPatchMod::SetOpsDlgEnables() // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - PaintPatchMod *ep =(PaintPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + PaintPatchMod *ep =(PaintPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -57,7 +57,7 @@ BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa ep =(PaintPatchMod *)lParam; ep->hOpsPanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); CheckDlgButton(hDlg, IDC_INCLUDE_MESHES, ep->includeMeshes); CheckDlgButton(hDlg, IDC_PRELOAD_TILES, ep->preloadTiles); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/stdafx.h b/code/nel/tools/3d/plugin_max/nel_patch_paint/stdafx.h index bb52ca5e3..4e731a3ff 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/stdafx.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/stdafx.h @@ -1,6 +1,7 @@ #pragma warning (disable : 4786) // max.h include uses min/max in 3dsmax 2010 sdk +#include #include "Max.h" #ifdef min # undef min diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.cpp b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.cpp index 0e61183c2..4ab422f9a 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.cpp +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.cpp @@ -49,11 +49,11 @@ class VertexPaintClassDesc:public ClassDesc { static VertexPaintClassDesc VertexPaintDesc; ClassDesc* GetVertexPaintDesc() {return &VertexPaintDesc;} -static BOOL CALLBACK VertexPaintDlgProc( +static INT_PTR CALLBACK VertexPaintDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { int numPoints; - VertexPaint *mod = (VertexPaint*)GetWindowLong(hWnd,GWL_USERDATA); + VertexPaint *mod = (VertexPaint*)GetWindowLongPtr(hWnd,GWLP_USERDATA); if (!mod && msg!=WM_INITDIALOG) return FALSE; int comboResult; @@ -86,7 +86,7 @@ static BOOL CALLBACK VertexPaintDlgProc( case WM_INITDIALOG: LoadImages(); mod = (VertexPaint*)lParam; - SetWindowLong(hWnd,GWL_USERDATA,lParam); + SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam); mod->hParams = hWnd; mod->iPaintButton = GetICustButton(GetDlgItem(hWnd, IDC_PAINT)); mod->iPaintButton->SetType(CBT_CHECK); @@ -217,14 +217,14 @@ LRESULT APIENTRY colorSwatchSubclassWndProc( case WM_LBUTTONUP: case WM_LBUTTONDBLCLK: { HWND hPanel = GetParent(hwnd); - LONG mod = GetWindowLong(hPanel,GWL_USERDATA); + LONG mod = GetWindowLongPtr(hPanel,GWLP_USERDATA); if (mod) { ((VertexPaint*)mod)->PaletteButton(hwnd); } } break; case WM_DESTROY: - SetWindowLong(hwnd, GWL_WNDPROC, (LONG) colorSwatchOriginalWndProc); + SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) colorSwatchOriginalWndProc); // Fallthrough... default: return CallWindowProc(colorSwatchOriginalWndProc, hwnd, uMsg, wParam, lParam); @@ -419,13 +419,13 @@ void VertexPaint::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev ) int i; for (i=0; i #include "Max.h" #include "resource.h" #include "istdplug.h" @@ -101,7 +102,7 @@ public: class VertexPaint : public Modifier { friend class PaintMouseProc; - friend BOOL CALLBACK VertexPaintDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + friend INT_PTR CALLBACK VertexPaintDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); public: static IObjParam* ip; diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp index 5ca8454fa..46c9f35cb 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp @@ -83,7 +83,7 @@ class Tile_utilityClassDesc:public ClassDesc2 static Tile_utilityClassDesc Tile_utilityDesc; ClassDesc2* GetTile_utilityDesc() {return &Tile_utilityDesc;} -static BOOL CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h index 336c7aec2..5962f6809 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h @@ -22,6 +22,7 @@ #define _CRT_SECURE_NO_DEPRECATE +#include #include #include #include