From d568a0eedd5ed3335cdcec85f6705f020503c663 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 29 Nov 2016 20:24:58 +0100 Subject: [PATCH 01/50] Changed: Use _T macro, TCHAR, tStrToUtf8/utf8ToTStr, etc... to support UNICODE --HG-- branch : develop --- .../tools/3d/object_viewer/about_dialog.cpp | 12 +- code/nel/tools/3d/object_viewer/edit_ex.cpp | 6 +- .../tools/3d/object_viewer/editable_range.h | 2 +- .../3d/object_viewer/global_wind_dlg.cpp | 4 +- .../3d/plugin_max/nel_export/nel_export.h | 30 +-- .../nel_export/nel_export_collision.cpp | 8 +- .../nel_export/nel_export_export.cpp | 16 +- .../nel_export/nel_export_node_properties.cpp | 250 +++++++++--------- .../nel_export/nel_export_scene.cpp | 2 +- .../nel_export/nel_export_script.cpp | 44 +-- .../plugin_max/nel_export/nel_export_swt.cpp | 8 +- .../plugin_max/nel_export/nel_export_view.cpp | 12 +- .../plugin_max/nel_export/nel_export_zone.cpp | 2 +- .../3d/plugin_max/nel_export/progress.cpp | 10 +- .../plugin_max/nel_mesh_lib/export_misc.cpp | 23 +- .../3d/plugin_max/nel_mesh_lib/export_nel.h | 2 + .../nel_patch_converter.cpp | 30 +-- .../plugin_max/nel_patch_converter/script.cpp | 6 +- .../tools/3d/plugin_max/nel_patch_edit/np.cpp | 4 +- .../nel_patch_edit/np_edit_patch_mod.cpp | 4 +- .../nel_patch_edit/np_epm_add_patches.cpp | 4 +- .../nel_patch_edit/np_epm_attach.cpp | 2 +- .../plugin_max/nel_patch_edit/np_epm_del.cpp | 6 +- .../nel_patch_edit/np_epm_detach.cpp | 2 +- .../nel_patch_edit/np_epm_material.cpp | 8 +- .../nel_patch_edit/np_epm_remember.cpp | 4 +- .../nel_patch_edit/np_epm_selection.cpp | 14 +- .../3d/plugin_max/nel_patch_edit/np_mods.cpp | 2 +- .../plugin_max/nel_patch_edit/np_rollup.cpp | 28 +- .../nel_patch_lib/nel_patch_mesh.cpp | 14 +- .../3d/plugin_max/nel_patch_paint/paint.cpp | 64 +++-- .../plugin_max/nel_patch_paint/paint_ui.cpp | 12 +- .../nel_patch_paint/paint_vcolor.cpp | 9 +- .../plugin_max/nel_patch_paint/paint_vcolor.h | 2 +- .../plugin_max/tile_utility/tile_utility.cpp | 6 +- code/nel/tools/3d/tile_edit/Browse.cpp | 31 +-- code/nel/tools/3d/tile_edit/View.cpp | 27 +- .../misc/log_analyser/PlugInSelector.cpp | 8 +- .../tools/misc/log_analyser/ViewDialog.cpp | 2 +- .../leveldesign/georges_dll/base_dialog.cpp | 4 +- .../leveldesign/georges_dll/color_wnd.cpp | 14 +- .../leveldesign/georges_dll/dfn_dialog.cpp | 24 +- .../georges_dll/edit_list_ctrl.cpp | 18 +- .../leveldesign/georges_dll/edit_list_ctrl.h | 2 +- .../leveldesign/georges_dll/georges_edit.h | 2 +- .../georges_dll/georges_edit_doc.cpp | 2 +- .../georges_dll/memory_combo_box.cpp | 35 +-- .../georges_dll/memory_combo_box.h | 4 +- .../memory_combo_box.cpp | 4 +- .../memory_combo_box.h | 4 +- 50 files changed, 413 insertions(+), 420 deletions(-) diff --git a/code/nel/tools/3d/object_viewer/about_dialog.cpp b/code/nel/tools/3d/object_viewer/about_dialog.cpp index a2ea72e10..37259225c 100644 --- a/code/nel/tools/3d/object_viewer/about_dialog.cpp +++ b/code/nel/tools/3d/object_viewer/about_dialog.cpp @@ -70,17 +70,17 @@ BOOL CAboutDialog::OnInitDialog() { uint *versionTab; uint versionSize; - if (VerQueryValue (pInfo, "\\", (void**)&versionTab, &versionSize)) + if (VerQueryValue (pInfo, _T("\\"), (void**)&versionTab, &versionSize)) { // Get the pointer on the structure VS_FIXEDFILEINFO *info=(VS_FIXEDFILEINFO*)versionTab; // Setup version number - char version[512]; - sprintf (version, "Version %d.%d.%d.%d", - info->dwFileVersionMS>>16, - info->dwFileVersionMS&0xffff, - info->dwFileVersionLS>>16, + TCHAR version[512]; + _stprintf (version, _T("Version %d.%d.%d.%d"), + info->dwFileVersionMS>>16, + info->dwFileVersionMS&0xffff, + info->dwFileVersionLS>>16, info->dwFileVersionLS&0xffff); GetDlgItem (IDC_VERSION)->SetWindowText (version); } diff --git a/code/nel/tools/3d/object_viewer/edit_ex.cpp b/code/nel/tools/3d/object_viewer/edit_ex.cpp index a48b4642f..97df943f2 100644 --- a/code/nel/tools/3d/object_viewer/edit_ex.cpp +++ b/code/nel/tools/3d/object_viewer/edit_ex.cpp @@ -83,7 +83,7 @@ void CEditEx::setSInt(sint value) { nlassert(_Type == SIntType); TCHAR buf[16]; - _tcprintf(buf, "%d", (int) value); + _stprintf(buf, _T("%d"), (int) value); setString(buf); } @@ -91,7 +91,7 @@ void CEditEx::setUInt(uint value) { nlassert(_Type == UIntType); TCHAR buf[16]; - _tcprintf(buf, "%d", (int) value); + _stprintf(buf, _T("%d"), (int) value); setString(buf); } @@ -99,7 +99,7 @@ void CEditEx::setFloat(float value) { nlassert(_Type == FloatType); TCHAR buf[16]; - _tcprintf(buf, "%g", (double) value); + _stprintf(buf, _T("%g"), (double) value); setString(buf); } diff --git a/code/nel/tools/3d/object_viewer/editable_range.h b/code/nel/tools/3d/object_viewer/editable_range.h index 65c633352..5a4b6263c 100644 --- a/code/nel/tools/3d/object_viewer/editable_range.h +++ b/code/nel/tools/3d/object_viewer/editable_range.h @@ -346,7 +346,7 @@ inline const TCHAR *CEditableRangeT::string2value(const CString &value, sint32 tmp; if (NLMISC::fromString(tStrToUtf8(value), tmp)) { - if (strchr((LPCTSTR) value, '-')) + if (value.Find(_T("-")) > -1) { return _T("negative values not allowed"); } diff --git a/code/nel/tools/3d/object_viewer/global_wind_dlg.cpp b/code/nel/tools/3d/object_viewer/global_wind_dlg.cpp index 95f54acb7..ef55408e1 100644 --- a/code/nel/tools/3d/object_viewer/global_wind_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/global_wind_dlg.cpp @@ -65,7 +65,7 @@ void CGlobalWindDlg::updateView() // update Power. a= _ObjViewer->getGlobalWindPower(); - _tcprintf(str, "%.2f", a); + _stprintf(str, _T("%.2f"), a); StaticPower.SetWindowText(str); NLMISC::clamp(a, 0.f, 1.f); SliderPower.SetPos((sint)(a*NL_GLOBAL_WIND_SLIDER_RANGE)); @@ -117,7 +117,7 @@ void CGlobalWindDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) a= (float)nPos / NL_GLOBAL_WIND_SLIDER_RANGE; _ObjViewer->setGlobalWindPower(a); - _tcprintf(str, "%.2f", a); + _stprintf(str, _T("%.2f"), a); StaticPower.SetWindowText(str); } else diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.h b/code/nel/tools/3d/plugin_max/nel_export/nel_export.h index f6f0b145a..4941f2596 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.h +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.h @@ -59,21 +59,21 @@ public: bool freeExported(void); void getSelectedNode (std::vector& vectNode); - bool exportZone (const char *sName, INode& node, TimeValue time); - bool exportMesh (const char *sPath, INode& node, TimeValue time); - bool exportAnim (const char *sPath, std::vector& vectNode, TimeValue time, bool scene); - bool exportSWT (const char *sPath, std::vector& vectNode); + bool exportZone (const std::string &sName, INode& node, TimeValue time); + bool exportMesh (const std::string &sPath, INode& node, TimeValue time); + bool exportAnim (const std::string &sPath, std::vector& vectNode, TimeValue time, bool scene); + bool exportSWT (const std::string &sPath, std::vector& vectNode); bool exportInstanceGroup (std::string filename, std::vector& vectNode); - bool exportSkeleton (const char *sPath, INode* pNode, TimeValue time); + bool exportSkeleton (const std::string &sPath, INode* pNode, TimeValue time); - bool exportCollision (const char *sPath, std::vector &nodes, TimeValue time); + bool exportCollision (const std::string &sPath, std::vector &nodes, TimeValue time); - bool exportPACSPrimitives (const char *sPath, std::vector &nodes, TimeValue time); + bool exportPACSPrimitives (const std::string &sPath, std::vector &nodes, TimeValue time); - bool exportVegetable (const char *sPath, INode& node, TimeValue time); + bool exportVegetable (const std::string &sPath, INode& node, TimeValue time); - bool exportLodCharacter (const char *sPath, INode& node, TimeValue time); + bool exportLodCharacter (const std::string &sPath, INode& node, TimeValue time); void viewMesh (TimeValue time); @@ -81,16 +81,8 @@ public: static void deleteLM(INode& ZeNode); // the export scene struct MUST be initialized before calling this fn void OnNodeProperties (const std::set &listNode); - ULONG ExtractFileName(char* Path, char* Name); - ULONG ExtractPath(char* FullPath, char* Path); - ULONG SelectFileForLoad(HWND Parent, char* Title, const char* Mask, char* FileName); - ULONG SelectFileForSave(HWND Parent, char* Title, const char* Mask, char* FileName); - ULONG SelectDir(HWND Parent, char* Title, char* Path); - static ULONG FileExists(const char* FileName); - ULONG GetFileSize(char* FileName); - ULONG ProcessDir(char* Dir, const char* Mask, unsigned long flag, ULONG Fnct(char* FileName) ); - ULONG CleanFileName(char* FileName); - ULONG CreateBAKFile(char* FileName); + ULONG SelectFileForSave(HWND Parent, TCHAR* Title, const TCHAR* Mask, std::string &FileName); + ULONG SelectDir(HWND Parent, TCHAR* Title, std::string &Path); // The nel export objtect CExportNel *_ExportNel; diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_collision.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_collision.cpp index 8ff853031..dd48e4487 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_collision.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_collision.cpp @@ -30,7 +30,7 @@ using namespace NLPACS; // -------------------------------------------------- -bool CNelExport::exportCollision (const char *sPath, std::vector &nodes, TimeValue time) +bool CNelExport::exportCollision (const std::string &sPath, std::vector &nodes, TimeValue time) { // get list of CMB froms nodes. std::vector > meshBuildList; @@ -148,7 +148,7 @@ bool CNelExport::exportCollision (const char *sPath, INode& node, Interface& _Ip */ // -------------------------------------------------- -bool CNelExport::exportPACSPrimitives (const char *sPath, std::vector &nodes, TimeValue time) +bool CNelExport::exportPACSPrimitives (const std::string &sPath, std::vector &nodes, TimeValue time) { // Build the primitive block NLPACS::CPrimitiveBlock primitiveBlock; @@ -172,12 +172,12 @@ bool CNelExport::exportPACSPrimitives (const char *sPath, std::vector & } else { - nlwarning ("Can't init XML stream with file %s", sPath); + nlwarning ("Can't init XML stream with file %s", sPath.c_str()); } } else { - nlwarning ("Can't open the file %s for writing", sPath); + nlwarning ("Can't open the file %s for writing", sPath.c_str()); } } return false; diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp index 4beaeb108..a5490dc2a 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp @@ -32,7 +32,7 @@ using namespace NLMISC; // -------------------------------------------------- -bool CNelExport::exportMesh (const char *sPath, INode& node, TimeValue time) +bool CNelExport::exportMesh (const std::string &sPath, INode& node, TimeValue time) { // Result to return bool bRet = false; @@ -213,7 +213,7 @@ bool CNelExport::exportMesh (const char *sPath, INode& node, TimeValue time) // -------------------------------------------------- -bool CNelExport::exportVegetable (const char *sPath, INode& node, TimeValue time) +bool CNelExport::exportVegetable (const std::string &sPath, INode& node, TimeValue time) { bool bRet=false; @@ -246,7 +246,7 @@ bool CNelExport::exportVegetable (const char *sPath, INode& node, TimeValue time // -------------------------------------------------- -bool CNelExport::exportAnim (const char *sPath, std::vector& vectNode, TimeValue time, bool scene) +bool CNelExport::exportAnim (const std::string &sPath, std::vector& vectNode, TimeValue time, bool scene) { // Result to return bool bRet=false; @@ -343,7 +343,7 @@ bool CNelExport::exportAnim (const char *sPath, std::vector& vectNode, T catch (const Exception& e) { if (_ErrorInDialog) - MessageBox (NULL, e.what(), "NeL export", MB_OK|MB_ICONEXCLAMATION); + MessageBox (NULL, utf8ToTStr(e.what()), _T("NeL export"), MB_OK|MB_ICONEXCLAMATION); else nlwarning ("ERROR : %s", e.what ()); } @@ -351,9 +351,9 @@ bool CNelExport::exportAnim (const char *sPath, std::vector& vectNode, T else { if (_ErrorInDialog) - MessageBox (NULL, "Can't open the file for writing.", "NeL export", MB_OK|MB_ICONEXCLAMATION); + MessageBox (NULL, _T("Can't open the file for writing."), _T("NeL export"), MB_OK|MB_ICONEXCLAMATION); else - nlwarning ("ERROR : Can't open the file (%s) for writing", tempFileName); + nlwarning ("ERROR : Can't open the file (%s) for writing", tempFileName.c_str()); if (_TerminateOnFileOpenIssues) nelExportTerminateProcess(); } @@ -383,7 +383,7 @@ bool CNelExport::exportAnim (const char *sPath, std::vector& vectNode, T // -------------------------------------------------- -bool CNelExport::exportSkeleton (const char *sPath, INode* pNode, TimeValue time) +bool CNelExport::exportSkeleton (const std::string &sPath, INode* pNode, TimeValue time) { // Result to return bool bRet=false; @@ -422,7 +422,7 @@ bool CNelExport::exportSkeleton (const char *sPath, INode* pNode, TimeValue time // -------------------------------------------------- -bool CNelExport::exportLodCharacter (const char *sPath, INode& node, TimeValue time) +bool CNelExport::exportLodCharacter (const std::string &sPath, INode& node, TimeValue time) { // Result to return bool bRet=false; 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 a6d68c4f5..e1eec815f 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 @@ -31,50 +31,50 @@ using namespace NLMISC; // Which dialog tab is the VerytexProgram one? #define TAB_VP_ID 5 -char *_EnvironmentNames[] = +TCHAR *_EnvironmentNames[] = { - "", - "no fx", - "GENERIC", - "PADDEDCELL", - "ROOM", - "BATHROOM", - "LIVINGROOM", - "STONEROOM", - "AUDITORIUM", - "CONCERTHALL", - "CAVE", - "ARENA", - "HANGAR", - "CARPETEDHALLWAY", - "HALLWAY", - "STONECORRIDOR", - "ALLEY", - "FOREST", - "CITY", - "MOUNTAINS", - "QUARRY", - "PLAIN", - "PARKINGLOT", - "SEWERPIPE", - "UNDERWATER", - "DRUGGED", - "DIZZY", - "PSYCHOTIC", + _T(""), + _T("no fx"), + _T("GENERIC"), + _T("PADDEDCELL"), + _T("ROOM"), + _T("BATHROOM"), + _T("LIVINGROOM"), + _T("STONEROOM"), + _T("AUDITORIUM"), + _T("CONCERTHALL"), + _T("CAVE"), + _T("ARENA"), + _T("HANGAR"), + _T("CARPETEDHALLWAY"), + _T("HALLWAY"), + _T("STONECORRIDOR"), + _T("ALLEY"), + _T("FOREST"), + _T("CITY"), + _T("MOUNTAINS"), + _T("QUARRY"), + _T("PLAIN"), + _T("PARKINGLOT"), + _T("SEWERPIPE"), + _T("UNDERWATER"), + _T("DRUGGED"), + _T("DIZZY"), + _T("PSYCHOTIC"), NULL }; -char *_MaterialNames[] = +TCHAR *_MaterialNames[] = { - "", - "no occlusion", - "SINGLEWINDOW", - "DOUBLEWINDOW", - "THINDOOR", - "THICKDOOR", - "WOODWALL", - "BRICKWALL", - "STONEWALL", - "CURTAIN", + _T(""), + _T("no occlusion"), + _T("SINGLEWINDOW"), + _T("DOUBLEWINDOW"), + _T("THINDOOR"), + _T("THICKDOOR"), + _T("WOODWALL"), + _T("BRICKWALL"), + _T("STONEWALL"), + _T("CURTAIN"), NULL }; @@ -319,7 +319,7 @@ INT_PTR CALLBACK VertexProgramDialogCallBack (HWND hwndDlg, UINT uMsg, WPARAM wP 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 TCHAR *SubText[TAB_COUNT] = { _T("LOD & MRM"), _T("Accelerator"), _T("Instance"), _T("Lighting"), _T("LMC"), _T("Vegetable"), _T("VertexProgram"), _T("Misc"), _T("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}; @@ -581,16 +581,16 @@ INT_PTR CALLBACK AccelDialogCallback ( currentParam->AudibleFromFather=SendMessage (GetDlgItem (hwndDlg, IDC_AUDIBLE_FROM_FATHER), BM_GETCHECK, 0, 0); // get the strings params - char tmp[256]; - SendMessage (GetDlgItem(hwndDlg, IDC_OCC_MODEL), WM_GETTEXT, 256, (LONG)tmp); - currentParam->OcclusionModel = tmp; - SendMessage (GetDlgItem(hwndDlg, IDC_OPEN_OCC_MODEL), WM_GETTEXT, 256, (LONG)tmp); - currentParam->OpenOcclusionModel = tmp; - SendMessage (GetDlgItem(hwndDlg, IDC_SOUND_GROUP), WM_GETTEXT, 256, (LONG)tmp); - currentParam->SoundGroup = tmp; - _KnownSoundGroups.insert(tmp); - SendMessage (GetDlgItem(hwndDlg, IDC_ENV_FX), WM_GETTEXT, 256, (LONG)tmp); - currentParam->EnvironmentFX = tmp; + TCHAR tmp[256]; + SendMessage (GetDlgItem(hwndDlg, IDC_OCC_MODEL), WM_GETTEXT, 256, (LPARAM)tmp); + currentParam->OcclusionModel = tStrToUtf8(tmp); + SendMessage (GetDlgItem(hwndDlg, IDC_OPEN_OCC_MODEL), WM_GETTEXT, 256, (LPARAM)tmp); + currentParam->OpenOcclusionModel = tStrToUtf8(tmp); + SendMessage (GetDlgItem(hwndDlg, IDC_SOUND_GROUP), WM_GETTEXT, 256, (LPARAM)tmp); + currentParam->SoundGroup = tStrToUtf8(tmp); + _KnownSoundGroups.insert(currentParam->SoundGroup); + SendMessage (GetDlgItem(hwndDlg, IDC_ENV_FX), WM_GETTEXT, 256, (LPARAM)tmp); + currentParam->EnvironmentFX = tStrToUtf8(tmp); // Quit EndDialog(hwndDlg, IDOK); @@ -653,9 +653,9 @@ INT_PTR CALLBACK MRMDialogCallback ( currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Window text - std::string winName=(*(currentParam->ListNode->begin()))->GetName(); + std::string winName= tStrToUtf8((*(currentParam->ListNode->begin()))->GetName()); winName="Node properties ("+winName+((currentParam->ListNode->size()>1)?" ...)":")"); - SetWindowText (hwndDlg, winName.c_str()); + SetWindowText (hwndDlg, utf8ToTStr(winName)); // Set default state SendMessage (GetDlgItem (hwndDlg, IDC_BLEND_IN), BM_SETCHECK, currentParam->BlendIn, 0); @@ -669,8 +669,8 @@ INT_PTR CALLBACK MRMDialogCallback ( EnableWindow (GetDlgItem (hwndDlg, IDC_UP), currentParam->ListActived); EnableWindow (GetDlgItem (hwndDlg, IDC_DOWN), currentParam->ListActived); - SetWindowText (GetDlgItem (hwndDlg, IDC_DIST_MAX), currentParam->DistMax.c_str()); - SetWindowText (GetDlgItem (hwndDlg, IDC_BLEND_LENGTH), currentParam->BlendLength.c_str()); + SetWindowText (GetDlgItem (hwndDlg, IDC_DIST_MAX), utf8ToTStr(currentParam->DistMax)); + SetWindowText (GetDlgItem (hwndDlg, IDC_BLEND_LENGTH), utf8ToTStr(currentParam->BlendLength)); SendMessage (GetDlgItem (hwndDlg, IDC_ACTIVE_MRM), BM_SETCHECK, currentParam->MRM, 0); CoarseStateChanged (hwndDlg); @@ -678,12 +678,12 @@ INT_PTR CALLBACK MRMDialogCallback ( if (currentParam->SkinReduction!=-1) CheckRadioButton (hwndDlg, IDC_SKIN_REDUCTION_MIN, IDC_SKIN_REDUCTION_BEST, IDC_SKIN_REDUCTION_MIN+currentParam->SkinReduction); - SetWindowText (GetDlgItem (hwndDlg, IDC_NB_LOD), currentParam->NbLod.c_str()); - SetWindowText (GetDlgItem (hwndDlg, IDC_DIVISOR), currentParam->Divisor.c_str()); - SetWindowText (GetDlgItem (hwndDlg, IDC_DIST_FINEST), currentParam->DistanceFinest.c_str()); - SetWindowText (GetDlgItem (hwndDlg, IDC_DIST_MIDDLE), currentParam->DistanceMiddle.c_str()); - SetWindowText (GetDlgItem (hwndDlg, IDC_DIST_COARSEST), currentParam->DistanceCoarsest.c_str()); - SetWindowText (GetDlgItem (hwndDlg, IDC_BONE_LOD_DISTANCE), currentParam->BoneLodDistance.c_str()); + SetWindowText (GetDlgItem (hwndDlg, IDC_NB_LOD), utf8ToTStr(currentParam->NbLod)); + SetWindowText (GetDlgItem (hwndDlg, IDC_DIVISOR), utf8ToTStr(currentParam->Divisor)); + SetWindowText (GetDlgItem (hwndDlg, IDC_DIST_FINEST), utf8ToTStr(currentParam->DistanceFinest)); + SetWindowText (GetDlgItem (hwndDlg, IDC_DIST_MIDDLE), utf8ToTStr(currentParam->DistanceMiddle)); + SetWindowText (GetDlgItem (hwndDlg, IDC_DIST_COARSEST), utf8ToTStr(currentParam->DistanceCoarsest)); + SetWindowText (GetDlgItem (hwndDlg, IDC_BONE_LOD_DISTANCE), utf8ToTStr(currentParam->BoneLodDistance)); // Iterate list HWND hwndList=GetDlgItem (hwndDlg, IDC_LIST1); @@ -717,11 +717,11 @@ INT_PTR CALLBACK MRMDialogCallback ( currentParam->CoarseMesh=SendMessage (GetDlgItem (hwndDlg, IDC_COARSE_MESH), BM_GETCHECK, 0, 0); currentParam->DynamicMesh=SendMessage (GetDlgItem (hwndDlg, IDC_DYNAMIC_MESH), BM_GETCHECK, 0, 0); - char tmp[512]; + TCHAR tmp[512]; GetWindowText (GetDlgItem (hwndDlg, IDC_DIST_MAX), tmp, 512); - currentParam->DistMax=tmp; + currentParam->DistMax = tStrToUtf8(tmp); GetWindowText (GetDlgItem (hwndDlg, IDC_BLEND_LENGTH), tmp, 512); - currentParam->BlendLength=tmp; + currentParam->BlendLength = tStrToUtf8(tmp); currentParam->MRM=SendMessage (GetDlgItem (hwndDlg, IDC_ACTIVE_MRM), BM_GETCHECK, 0, 0); @@ -734,17 +734,17 @@ INT_PTR CALLBACK MRMDialogCallback ( currentParam->SkinReduction=2; GetWindowText (GetDlgItem (hwndDlg, IDC_NB_LOD), tmp, 512); - currentParam->NbLod=tmp; + currentParam->NbLod = tStrToUtf8(tmp); GetWindowText (GetDlgItem (hwndDlg, IDC_DIVISOR), tmp, 512); - currentParam->Divisor=tmp; + currentParam->Divisor = tStrToUtf8(tmp); GetWindowText (GetDlgItem (hwndDlg, IDC_DIST_FINEST), tmp, 512); - currentParam->DistanceFinest=tmp; + currentParam->DistanceFinest = tStrToUtf8(tmp); GetWindowText (GetDlgItem (hwndDlg, IDC_DIST_MIDDLE), tmp, 512); - currentParam->DistanceMiddle=tmp; + currentParam->DistanceMiddle = tStrToUtf8(tmp); GetWindowText (GetDlgItem (hwndDlg, IDC_DIST_COARSEST), tmp, 512); - currentParam->DistanceCoarsest=tmp; + currentParam->DistanceCoarsest = tStrToUtf8(tmp); GetWindowText (GetDlgItem (hwndDlg, IDC_BONE_LOD_DISTANCE), tmp, 512); - currentParam->BoneLodDistance=tmp; + currentParam->BoneLodDistance = tStrToUtf8(tmp); // Iterate list HWND hwndList=GetDlgItem (hwndDlg, IDC_LIST1); @@ -758,7 +758,7 @@ INT_PTR CALLBACK MRMDialogCallback ( SendMessage (hwndList, LB_GETTEXT, item, (LPARAM) tmp); // Push it back - currentParam->ListLodName.push_back (tmp); + currentParam->ListLodName.push_back (tStrToUtf8(tmp)); } // default LodCharacter @@ -875,7 +875,7 @@ INT_PTR CALLBACK MRMDialogCallback ( if (wID!=LB_ERR) { // Get the node name - char name[512]; + TCHAR name[512]; SendMessage (GetDlgItem (hwndDlg, IDC_LIST1), LB_GETTEXT, wID, (LPARAM) (LPCTSTR) name); // Find the node @@ -920,8 +920,8 @@ INT_PTR CALLBACK InstanceDialogCallback ( 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()); + SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_GROUP_SHAPE), utf8ToTStr(currentParam->InstanceShape)); + SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_NAME), utf8ToTStr(currentParam->InstanceName)); SendMessage (GetDlgItem (hwndDlg, IDC_DONT_ADD_TO_SCENE), BM_SETCHECK, currentParam->DontAddToScene, 0); @@ -930,7 +930,7 @@ INT_PTR CALLBACK InstanceDialogCallback ( SendMessage (GetDlgItem (hwndDlg, IDC_CHECK_COLLISION), BM_SETCHECK, currentParam->Collision, 0); SendMessage (GetDlgItem (hwndDlg, IDC_CHECK_COLLISION_EXTERIOR), BM_SETCHECK, currentParam->CollisionExterior, 0); - SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_GROUP_NAME), currentParam->InstanceGroupName.c_str()); + SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_GROUP_NAME), utf8ToTStr(currentParam->InstanceGroupName)); bool colOk = currentParam->CollisionMeshGeneration>=0 && currentParam->CollisionMeshGeneration<4; CheckRadioButton (hwndDlg, IDC_CAMERA_COL_RADIO1, IDC_CAMERA_COL_RADIO4, colOk?(IDC_CAMERA_COL_RADIO1+(currentParam->CollisionMeshGeneration)):0); @@ -950,16 +950,16 @@ INT_PTR CALLBACK InstanceDialogCallback ( break; case IDOK: { - char tmp[512]; + TCHAR tmp[512]; GetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_GROUP_SHAPE), tmp, 512); - currentParam->InstanceShape=tmp; + currentParam->InstanceShape = tStrToUtf8(tmp); GetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_NAME), tmp, 512); - currentParam->InstanceName=tmp; + currentParam->InstanceName = tStrToUtf8(tmp); currentParam->DontAddToScene=SendMessage (GetDlgItem (hwndDlg, IDC_DONT_ADD_TO_SCENE), BM_GETCHECK, 0, 0); GetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_GROUP_NAME), tmp, 512); - currentParam->InstanceGroupName=tmp; + currentParam->InstanceGroupName = tStrToUtf8(tmp); currentParam->DontExport=SendMessage (GetDlgItem (hwndDlg, IDC_DONT_EXPORT), BM_GETCHECK, 0, 0); @@ -1036,9 +1036,9 @@ INT_PTR CALLBACK LightmapDialogCallback ( 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()); - SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_SOFTSHADOW_CONELENGTH), currentParam->SoftShadowConeLength.c_str()); + SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_LUMELSIZEMUL), utf8ToTStr(currentParam->LumelSizeMul)); + SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_SOFTSHADOW_RADIUS), utf8ToTStr(currentParam->SoftShadowRadius)); + SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_SOFTSHADOW_CONELENGTH), utf8ToTStr(currentParam->SoftShadowConeLength)); // Lighting SendMessage (GetDlgItem (hwndDlg, IDC_EXPORT_REALTIME_LIGHT), BM_SETCHECK, currentParam->ExportRealTimeLight, 0); @@ -1048,7 +1048,7 @@ INT_PTR CALLBACK LightmapDialogCallback ( SendMessage (GetDlgItem (hwndDlg, IDC_USE_LIGHT_LOCAL_ATTENUATION), BM_SETCHECK, currentParam->UseLightingLocalAttenuation, 0); SendMessage (GetDlgItem (hwndDlg, IDC_LIGHT_DONT_CAST_SHADOW_INTERIOR), BM_SETCHECK, currentParam->LightDontCastShadowInterior, 0); SendMessage (GetDlgItem (hwndDlg, IDC_LIGHT_DONT_CAST_SHADOW_EXTERIOR), BM_SETCHECK, currentParam->LightDontCastShadowExterior, 0); - SetWindowText (GetDlgItem (hwndDlg, IDC_EXPORT_LIGHTMAP_NAME), currentParam->ExportLightMapName.c_str()); + SetWindowText (GetDlgItem (hwndDlg, IDC_EXPORT_LIGHTMAP_NAME), utf8ToTStr(currentParam->ExportLightMapName)); SendMessage (GetDlgItem (hwndDlg, IDC_REALTIME_LIGHT_AMBIENT_ADD_SUN), BM_SETCHECK, currentParam->RealTimeAmbientLightAddSun, 0); // Set enable disable @@ -1065,7 +1065,7 @@ INT_PTR CALLBACK LightmapDialogCallback ( switch (LOWORD(wParam)) { case IDC_RESET_NAME: - SetWindowText (GetDlgItem (hwndDlg, IDC_EXPORT_LIGHTMAP_NAME), "GlobalLight"); + SetWindowText (GetDlgItem (hwndDlg, IDC_EXPORT_LIGHTMAP_NAME), _T("GlobalLight")); break; case IDCANCEL: EndDialog(hwndDlg, IDCANCEL); @@ -1073,13 +1073,13 @@ INT_PTR CALLBACK LightmapDialogCallback ( case IDOK: { // Set default state - char tmp[512]; + TCHAR tmp[512]; GetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_LUMELSIZEMUL), tmp, 512); - currentParam->LumelSizeMul = tmp; + currentParam->LumelSizeMul = tStrToUtf8(tmp); GetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_SOFTSHADOW_RADIUS), tmp, 512); - currentParam->SoftShadowRadius = tmp; + currentParam->SoftShadowRadius = tStrToUtf8(tmp); GetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_SOFTSHADOW_CONELENGTH), tmp, 512); - currentParam->SoftShadowConeLength = tmp; + currentParam->SoftShadowConeLength = tStrToUtf8(tmp); // RealTime light currentParam->ExportRealTimeLight = SendMessage (GetDlgItem (hwndDlg, IDC_EXPORT_REALTIME_LIGHT), BM_GETCHECK, 0, 0); @@ -1090,7 +1090,7 @@ INT_PTR CALLBACK LightmapDialogCallback ( currentParam->LightDontCastShadowExterior = SendMessage (GetDlgItem (hwndDlg, IDC_LIGHT_DONT_CAST_SHADOW_EXTERIOR), BM_GETCHECK, 0, 0); currentParam->ExportLightMapAnimated = SendMessage (GetDlgItem (hwndDlg, IDC_EXPORT_LIGHTMAP_ANIMATED), BM_GETCHECK, 0, 0); GetWindowText (GetDlgItem (hwndDlg, IDC_EXPORT_LIGHTMAP_NAME), tmp, 512); - currentParam->ExportLightMapName = tmp; + currentParam->ExportLightMapName = tStrToUtf8(tmp); currentParam->RealTimeAmbientLightAddSun= SendMessage (GetDlgItem (hwndDlg, IDC_REALTIME_LIGHT_AMBIENT_ADD_SUN), BM_GETCHECK, 0, 0); // Get the acceleration type @@ -1132,7 +1132,7 @@ INT_PTR CALLBACK LightmapDialogCallback ( if (wID!=LB_ERR) { // Get the node name - char name[512]; + TCHAR name[512]; SendMessage (GetDlgItem (hwndDlg, IDC_LIST1), LB_GETTEXT, wID, (LPARAM) (LPCTSTR) name); // Find the node @@ -1432,7 +1432,7 @@ INT_PTR CALLBACK LMCCopyFromDialogCallback( lmcParam->SelectionDone= true; // Get the node name - char name[512]; + TCHAR name[512]; SendMessage (GetDlgItem (hwndDlg, IDC_LMC_COPY_LIST), LB_GETTEXT, wID, (LPARAM) (LPCTSTR) name); // Find the node @@ -1679,7 +1679,7 @@ INT_PTR CALLBACK VegetableDialogCallback ( CheckRadioButton(hwndDlg, IDC_CENTER_NULL, IDC_CENTER_Z, IDC_CENTER_NULL+currentParam->VegetableBendCenter); - SetWindowText (GetDlgItem (hwndDlg, IDC_VEGETABLE_BEND_FACTOR), currentParam->VegetableBendFactor.c_str()); + SetWindowText (GetDlgItem (hwndDlg, IDC_VEGETABLE_BEND_FACTOR), utf8ToTStr(currentParam->VegetableBendFactor)); VegetableStateChanged (hwndDlg); } @@ -1732,9 +1732,9 @@ INT_PTR CALLBACK VegetableDialogCallback ( else currentParam->VegetableBendCenter = -1; - char tmp[512]; + TCHAR tmp[512]; GetWindowText (GetDlgItem (hwndDlg, IDC_VEGETABLE_BEND_FACTOR), tmp, 512); - currentParam->VegetableBendFactor = tmp; + currentParam->VegetableBendFactor = tStrToUtf8(tmp); } break; case IDC_VEGETABLE: @@ -1930,7 +1930,7 @@ static int VPWTBiasStaticId[CVPWindTreeAppData::HrcDepth]= void updateVPWTStatic(HWND hwndDlg, uint type, uint depth, const CVPWindTreeAppData &vpwt) { int sliderValue; - char stmp[256]; + TCHAR stmp[256]; float nticks= CVPWindTreeAppData::NumTicks; float scale; @@ -1953,29 +1953,29 @@ void updateVPWTStatic(HWND hwndDlg, uint type, uint depth, const CVPWindTreeAppD { case 0: sliderValue= SendDlgItemMessage(hwndDlg, VPWTFreqSliderId[depth], TBM_GETPOS, 0, 0); - _stprintf(stmp, "%.2f", scale * float(sliderValue)/nticks); + _stprintf(stmp, _T("%.2f"), scale * float(sliderValue)/nticks); SetWindowText( GetDlgItem(hwndDlg, VPWTFreqStaticId[depth]), stmp ); break; case 1: sliderValue= SendDlgItemMessage(hwndDlg, VPWTFreqWDSliderId[depth], TBM_GETPOS, 0, 0); - _stprintf(stmp, "%.2f", scale * float(sliderValue)/nticks); + _stprintf(stmp, _T("%.2f"), scale * float(sliderValue)/nticks); SetWindowText( GetDlgItem(hwndDlg, VPWTFreqWDStaticId[depth]), stmp ); break; case 2: sliderValue= SendDlgItemMessage(hwndDlg, VPWTDistXYSliderId[depth], TBM_GETPOS, 0, 0); - _stprintf(stmp, "%.2f", scale * float(sliderValue)/nticks); + _stprintf(stmp, _T("%.2f"), scale * float(sliderValue)/nticks); SetWindowText( GetDlgItem(hwndDlg, VPWTDistXYStaticId[depth]), stmp ); break; case 3: sliderValue= SendDlgItemMessage(hwndDlg, VPWTDistZSliderId[depth], TBM_GETPOS, 0, 0); - _stprintf(stmp, "%.2f", scale * float(sliderValue)/nticks); + _stprintf(stmp, _T("%.2f"), scale * float(sliderValue)/nticks); SetWindowText( GetDlgItem(hwndDlg, VPWTDistZStaticId[depth]), stmp ); break; case 4: sliderValue= SendDlgItemMessage(hwndDlg, VPWTBiasSliderId[depth], TBM_GETPOS, 0, 0); // expand to -2 to 2. float biasVal= 4 * float(sliderValue)/nticks - 2; - _stprintf(stmp, "%.2f", biasVal); + _stprintf(stmp, _T("%.2f"), biasVal); SetWindowText( GetDlgItem(hwndDlg, VPWTBiasStaticId[depth]), stmp ); break; } @@ -1987,14 +1987,14 @@ static void concatEdit2Lines(HWND edit) const uint lineLen= 1000; uint n; // retrieve the 2 lines. - char tmp0[2*lineLen]; - char tmp1[lineLen]; + TCHAR tmp0[2*lineLen]; + TCHAR tmp1[lineLen]; *(WORD*)tmp0= lineLen; *(WORD*)tmp1= lineLen; - n= SendMessage(edit, EM_GETLINE, 0, (LONG)tmp0); tmp0[n]= 0; - n= SendMessage(edit, EM_GETLINE, 1, (LONG)tmp1); tmp1[n]= 0; + n= SendMessage(edit, EM_GETLINE, 0, (LPARAM)tmp0); tmp0[n]= 0; + n= SendMessage(edit, EM_GETLINE, 1, (LPARAM)tmp1); tmp1[n]= 0; // concat and update the CEdit. - SetWindowText(edit, strcat(tmp0, tmp1)); + SetWindowText(edit, _tcscat(tmp0, tmp1)); } @@ -2055,10 +2055,10 @@ INT_PTR CALLBACK VPWindTreeCallback ( // Init Global. editBox - char stmp[256]; - _stprintf(stmp, "%.2f", vpwt.FreqScale); + TCHAR stmp[256]; + _stprintf(stmp, _T("%.2f"), vpwt.FreqScale); SetWindowText( GetDlgItem(hwndDlg, IDC_EDIT_VPWT_FREQ_SCALE), stmp ); - _stprintf(stmp, "%.2f", vpwt.DistScale); + _stprintf(stmp, _T("%.2f"), vpwt.DistScale); SetWindowText( GetDlgItem(hwndDlg, IDC_EDIT_VPWT_DIST_SCALE), stmp ); SendDlgItemMessage(hwndDlg, IDC_CHECK_VP_SPECLIGHT, BM_SETCHECK, vpwt.SpecularLighting, 0); @@ -2102,7 +2102,7 @@ INT_PTR CALLBACK VPWindTreeCallback ( { CVPWindTreeAppData &vpwt= currentParam->VertexProgramWindTree; int nticks= CVPWindTreeAppData::NumTicks; - char stmp[256]; + TCHAR stmp[256]; float val; if( HIWORD(wParam) == BN_CLICKED ) @@ -2195,7 +2195,7 @@ INT_PTR CALLBACK VPWindTreeCallback ( } } // Update Scale Edit text. - _stprintf(stmp, "%.2f", vpwt.FreqScale); + _stprintf(stmp, _T("%.2f"), vpwt.FreqScale); SetWindowText( GetDlgItem(hwndDlg, IDC_EDIT_VPWT_FREQ_SCALE), stmp ); } break; @@ -2216,7 +2216,7 @@ INT_PTR CALLBACK VPWindTreeCallback ( } } // Update Scale Edit text. - _stprintf(stmp, "%.2f", vpwt.DistScale); + _stprintf(stmp, _T("%.2f"), vpwt.DistScale); SetWindowText( GetDlgItem(hwndDlg, IDC_EDIT_VPWT_DIST_SCALE), stmp ); } break; @@ -2290,34 +2290,34 @@ INT_PTR CALLBACK MiscDialogCallback ( // Ligoscape SendMessage (GetDlgItem (hwndDlg, IDC_LIGO_SYMMETRY), BM_SETCHECK, currentParam->LigoSymmetry, 0); - SetWindowText (GetDlgItem (hwndDlg, IDC_LIGO_ROTATE), currentParam->LigoRotate.c_str()); + SetWindowText (GetDlgItem (hwndDlg, IDC_LIGO_ROTATE), utf8ToTStr(currentParam->LigoRotate)); // SWT SendMessage (GetDlgItem (hwndDlg, IDC_SWT), BM_SETCHECK, currentParam->SWT, 0); - SetWindowText (GetDlgItem (hwndDlg, IDC_SWT_WEIGHT), currentParam->SWTWeight.c_str()); + SetWindowText (GetDlgItem (hwndDlg, IDC_SWT_WEIGHT), utf8ToTStr(currentParam->SWTWeight)); // Radial normals for (uint smoothGroup=0; smoothGroupRadialNormals[smoothGroup].c_str()); + SetWindowText (GetDlgItem (hwndDlg, IDC_RADIAL_NORMAL_29+smoothGroup), utf8ToTStr(currentParam->RadialNormals[smoothGroup])); // Mesh interfaces - SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INTERFACE_FILE), currentParam->InterfaceFileName.c_str()); + SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INTERFACE_FILE), utf8ToTStr(currentParam->InterfaceFileName)); SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INTERFACE_THRESHOLD), - currentParam->InterfaceThreshold != -1.f ? toStringMax(currentParam->InterfaceThreshold).c_str() - : "" + currentParam->InterfaceThreshold != -1.f ? utf8ToTStr(toStringMax(currentParam->InterfaceThreshold)) + : _T("") ); SendMessage(GetDlgItem(hwndDlg, IDC_GET_INTERFACE_NORMAL_FROM_SCENE_OBJECTS), BM_SETCHECK, currentParam->GetInterfaceNormalsFromSceneObjects, 0); // Skeleton Scale SendMessage( GetDlgItem(hwndDlg, IDC_EXPORT_BONE_SCALE), BM_SETCHECK, currentParam->ExportBoneScale, 0); - SetWindowText (GetDlgItem (hwndDlg, IDC_EXPORT_BONE_SCALE_NAME_EXT), currentParam->ExportBoneScaleNameExt.c_str()); + SetWindowText (GetDlgItem (hwndDlg, IDC_EXPORT_BONE_SCALE_NAME_EXT), utf8ToTStr(currentParam->ExportBoneScaleNameExt)); // Remanence SendMessage (GetDlgItem (hwndDlg, IDC_USE_REMANENCE), BM_SETCHECK, currentParam->UseRemanence, 0); SendMessage (GetDlgItem (hwndDlg, IDC_REMANENCE_SHIFTING_TEXTURE), BM_SETCHECK, currentParam->RemanenceShiftingTexture, 0); - SetWindowText (GetDlgItem (hwndDlg, IDC_REMANENCE_SLICE_NUMBER), currentParam->RemanenceSliceNumber != - 1 ? toStringMax(currentParam->RemanenceSliceNumber).c_str() : ""); - SetWindowText (GetDlgItem (hwndDlg, IDC_REMANENCE_SAMPLING_PERIOD), currentParam->RemanenceSamplingPeriod != -1 ? toStringMax(currentParam->RemanenceSamplingPeriod).c_str() : ""); - SetWindowText (GetDlgItem (hwndDlg, IDC_REMANENCE_ROLLUP_RATIO), currentParam->RemanenceRollupRatio != -1 ? toStringMax(currentParam->RemanenceRollupRatio).c_str() : ""); + SetWindowText (GetDlgItem (hwndDlg, IDC_REMANENCE_SLICE_NUMBER), currentParam->RemanenceSliceNumber != - 1 ? utf8ToTStr(toStringMax(currentParam->RemanenceSliceNumber)) : _T("")); + SetWindowText (GetDlgItem (hwndDlg, IDC_REMANENCE_SAMPLING_PERIOD), currentParam->RemanenceSamplingPeriod != -1 ? utf8ToTStr(toStringMax(currentParam->RemanenceSamplingPeriod)) : _T("")); + SetWindowText (GetDlgItem (hwndDlg, IDC_REMANENCE_ROLLUP_RATIO), currentParam->RemanenceRollupRatio != -1 ? utf8ToTStr(toStringMax(currentParam->RemanenceRollupRatio)) : _T("")); } break; @@ -2357,7 +2357,7 @@ INT_PTR CALLBACK MiscDialogCallback ( GetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INTERFACE_FILE), tmp, 512); currentParam->InterfaceFileName = tStrToUtf8(tmp); GetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INTERFACE_THRESHOLD), tmp, 512); - if (strlen(tmp) != 0) + if (_tcslen(tmp) != 0) currentParam->InterfaceThreshold = toFloatMax(tmp); currentParam->GetInterfaceNormalsFromSceneObjects = SendMessage (GetDlgItem (hwndDlg, IDC_GET_INTERFACE_NORMAL_FROM_SCENE_OBJECTS), BM_GETCHECK, 0, 0); @@ -2492,9 +2492,9 @@ INT_PTR CALLBACK LodDialogCallback ( currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Window text - std::string winName=(*(currentParam->ListNode->begin()))->GetName(); + std::string winName = tStrToUtf8((*(currentParam->ListNode->begin()))->GetName()); winName="Node properties ("+winName+((currentParam->ListNode->size()>1)?" ...)":")"); - SetWindowText (hwndDlg, winName.c_str()); + SetWindowText (hwndDlg, utf8ToTStr(winName)); // Move dialog RECT windowRect, desktopRect; @@ -2522,7 +2522,7 @@ INT_PTR CALLBACK LodDialogCallback ( // Insert a tab TCITEM tabItem; tabItem.mask = TCIF_TEXT; - tabItem.pszText = (char*)SubText[tab]; + tabItem.pszText = (LPTSTR)SubText[tab]; SendMessage (GetDlgItem (hwndDlg, IDC_TAB), TCM_INSERTITEM, SendMessage (GetDlgItem (hwndDlg, IDC_TAB), TCM_GETITEMCOUNT, 0, 0), (LPARAM)&tabItem); // Create the dialog diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_scene.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_scene.cpp index af1047d0c..b50903324 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_scene.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_scene.cpp @@ -59,7 +59,7 @@ bool CNelExport::exportInstanceGroup(string filename, vector& vectNode) catch (const Exception &c) { // Cannot save the file - MessageBox (NULL, c.what(), "NeL export", MB_OK|MB_ICONEXCLAMATION); + MessageBox (NULL, utf8ToTStr(c.what()), _T("NeL export"), MB_OK|MB_ICONEXCLAMATION); return false; } } diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp index 71892b417..4c8ffd299 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp @@ -91,7 +91,7 @@ Value* export_shape_cf (Value** arg_list, int count) theCNelExport.init (false, false, ip, true); // Export path - const char* sPath=arg_list[1]->to_string(); + std::string sPath = tStrToUtf8(arg_list[1]->to_string()); // Ok ? Boolean *ret=&false_value; @@ -154,12 +154,12 @@ Value* export_shape_ex_cf (Value** arg_list, int count) nlassert(node->GetName()); // Export path - std::string sPath=arg_list[1]->to_string(); + std::string sPath = tStrToUtf8(arg_list[1]->to_string()); // Ex argu theExportSceneStruct.bShadow = arg_list[2]->to_bool()!=FALSE; theExportSceneStruct.bExportLighting = arg_list[3]->to_bool()!=FALSE; - theExportSceneStruct.sExportLighting = arg_list[4]->to_string(); + theExportSceneStruct.sExportLighting = tStrToUtf8(arg_list[4]->to_string()); theExportSceneStruct.nExportLighting = arg_list[5]->to_int(); theExportSceneStruct.rLumelSize = arg_list[6]->to_float(); theExportSceneStruct.nOverSampling = arg_list[7]->to_int(); @@ -220,7 +220,7 @@ Value* export_skeleton_cf (Value** arg_list, int count) nlassert (node); // Export path - const char* sPath=arg_list[1]->to_string(); + std::string sPath = tStrToUtf8(arg_list[1]->to_string()); // Ok ? Boolean *ret=&false_value; @@ -260,7 +260,7 @@ Value* export_animation_cf (Value** arg_list, int count) theCNelExport.init (false, false, ip, true); // Export path - const char* sPath=arg_list[1]->to_string(); + std::string sPath = tStrToUtf8(arg_list[1]->to_string()); // Get time TimeValue time=MAXScript_interface->GetTime(); @@ -352,7 +352,7 @@ Value* export_ig_cf (Value** arg_list, int count) vect.push_back (array->get (i+1)->to_node()); // Export path - const char* sPath=arg_list[1]->to_string(); + std::string sPath = tStrToUtf8(arg_list[1]->to_string()); // Export if (theCNelExport.exportInstanceGroup (sPath, vect)) @@ -411,7 +411,7 @@ Value* export_skeleton_weight_cf (Value** arg_list, int count) vect.push_back (array->get (i+1)->to_node()); // Export path - const char* sPath=arg_list[1]->to_string(); + std::string sPath = tStrToUtf8(arg_list[1]->to_string()); // Export if (theCNelExport.exportSWT (sPath, vect)) @@ -471,11 +471,11 @@ Value* test_file_date_cf (Value** arg_list, int count) theCNelExport.init (false, false, ip, true); // The 2 filenames - string file0 = arg_list[0]->to_string(); - string file1 = arg_list[1]->to_string(); + string file0 = tStrToUtf8(arg_list[0]->to_string()); + string file1 = tStrToUtf8(arg_list[1]->to_string()); // Open it - FILE *file=fopen (file0.c_str(), "r"); + FILE *file=nlfopen (file0.c_str(), "r"); if (file == NULL) return &true_value; @@ -486,10 +486,10 @@ Value* test_file_date_cf (Value** arg_list, int count) Value *ret = &undefined; // Create first file - HANDLE h0 = CreateFile (file0.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE h0 = CreateFile (utf8ToTStr(file0), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (h0!=INVALID_HANDLE_VALUE) { - HANDLE h1 = CreateFile (file1.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE h1 = CreateFile (utf8ToTStr(file1), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (h1!=INVALID_HANDLE_VALUE) { // Get file time @@ -536,7 +536,7 @@ Value* export_vegetable_cf (Value** arg_list, int count) nlassert (node); // Export path - const char* sPath=arg_list[1]->to_string(); + std::string sPath = tStrToUtf8(arg_list[1]->to_string()); // Message in dialog bool dialogMessage = arg_list[2]->to_bool() != FALSE; @@ -615,7 +615,7 @@ Value* export_collision_cf (Value** arg_list, int count) theCNelExport.init (false, false, ip, true); // Export path - string sPath = arg_list[1]->to_string(); + string sPath = tStrToUtf8(arg_list[1]->to_string()); // Get time TimeValue time = MAXScript_interface->GetTime(); @@ -674,7 +674,7 @@ Value* export_pacs_primitives_cf (Value** arg_list, int count) theCNelExport.init (false, false, ip, true); // Export path - string sPath = arg_list[1]->to_string(); + string sPath = tStrToUtf8(arg_list[1]->to_string()); // Get time TimeValue time = MAXScript_interface->GetTime(); @@ -733,7 +733,7 @@ Value* export_lod_character_cf (Value** arg_list, int count) nlassert (node); // Export path - const char* sPath=arg_list[1]->to_string(); + std::string sPath = tStrToUtf8(arg_list[1]->to_string()); // Message in dialog bool dialogMessage = arg_list[2]->to_bool() != FALSE; @@ -879,11 +879,11 @@ Value* get_file_modification_date_cf (Value** arg_list, int count) type_check (arg_list[0], String, message); // get the node - string sPath = arg_list[0]->to_string(); + string sPath = tStrToUtf8(arg_list[0]->to_string()); // get vertices indices string result; - HANDLE file = CreateFile (sPath.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE file = CreateFile (utf8ToTStr(sPath), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (file) { FILETIME lastWriteTime; @@ -899,7 +899,7 @@ Value* get_file_modification_date_cf (Value** arg_list, int count) if (result.empty()) return &undefined; else - return new String((char*)result.c_str()); + return new String(utf8ToTStr(result)); } // *************************************************************************** @@ -918,12 +918,12 @@ Value* set_file_modification_date_cf (Value** arg_list, int count) type_check (arg_list[1], String, message); // get the node - string sPath = arg_list[0]->to_string(); - string sDate = arg_list[1]->to_string(); + string sPath = tStrToUtf8(arg_list[0]->to_string()); + string sDate = tStrToUtf8(arg_list[1]->to_string()); // get vertices indices string result; - HANDLE file = CreateFile (sPath.c_str(), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE file = CreateFile (utf8ToTStr(sPath), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (file) { FILETIME lastWriteTime; diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_swt.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_swt.cpp index d1c47c00e..997b935a9 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_swt.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_swt.cpp @@ -27,7 +27,7 @@ using namespace NL3D; using namespace NLMISC; -bool CNelExport::exportSWT(const char *sPath, std::vector& vectNode) +bool CNelExport::exportSWT(const std::string &sPath, std::vector& vectNode) { float rPosValue; float rRotValue; @@ -55,15 +55,15 @@ bool CNelExport::exportSWT(const char *sPath, std::vector& vectNode) // Store them in the temporary list aSWNodes.resize(nNumNode+3); - aSWNodes[nNumNode].Name = pNode->GetName(); + aSWNodes[nNumNode].Name = tStrToUtf8(pNode->GetName()); aSWNodes[nNumNode].Name += std::string (".")+ITransformable::getRotQuatValueName(); aSWNodes[nNumNode].Weight = rRotValue; ++nNumNode; - aSWNodes[nNumNode].Name = pNode->GetName(); + aSWNodes[nNumNode].Name = tStrToUtf8(pNode->GetName()); aSWNodes[nNumNode].Name += std::string (".")+ITransformable::getPosValueName (); aSWNodes[nNumNode].Weight = rPosValue; ++nNumNode; - aSWNodes[nNumNode].Name = pNode->GetName(); + aSWNodes[nNumNode].Name = tStrToUtf8(pNode->GetName()); aSWNodes[nNumNode].Name += std::string (".")+ITransformable::getScaleValueName(); aSWNodes[nNumNode].Weight = rScaleValue; ++nNumNode; diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp index bff98becc..ba4fe5769 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_view.cpp @@ -102,14 +102,14 @@ void regsiterOVPath () //#ifdef NL_DEBUG_FAST // HMODULE hModule = GetModuleHandle("object_viewer_dll_df.dll"); #if defined (NL_DEBUG) - HMODULE hModule = GetModuleHandle("object_viewer_dll_d.dll"); + HMODULE hModule = GetModuleHandle(_T("object_viewer_dll_d.dll")); //#elif defined (NL_RELEASE_DEBUG) // HMODULE hModule = GetModuleHandle("object_viewer_dll_rd.dll"); #else HMODULE hModule = GetModuleHandle("object_viewer_dll_r.dll"); #endif - if (!hModule) { ::MessageBox(NULL, "'hModule' failed at '" __FUNCTION__ "' in file '" __FILE__ " on line " NL_MACRO_TO_STR(__LINE__), "NeL Export", MB_OK | MB_ICONERROR); return; } - char sModulePath[256]; + if (!hModule) { ::MessageBox(NULL, _T("'hModule' failed at '") __FUNCTION__ _T("' in file '") __FILE__ _T(" on line ") NL_MACRO_TO_STR(__LINE__), _T("NeL Export"), MB_OK | MB_ICONERROR); return; } + TCHAR sModulePath[256]; int res = GetModuleFileName(hModule, sModulePath, 256); if (!res) { ::MessageBox(NULL, _T("'res' failed at '") __FUNCTION__ _T("' in file '") __FILE__ _T(" on line ") NL_MACRO_TO_STR(__LINE__), _T("NeL Export"), MB_OK | MB_ICONERROR); return; } @@ -174,7 +174,7 @@ void CNelExport::viewMesh (TimeValue time) // Check wether there's not an instance currently running if (view->isInstanceRunning()) { - ::MessageBox(NULL, "An instance of the viewer is currently running, please close it :)", "NeL Export", MB_OK|MB_ICONEXCLAMATION); + ::MessageBox(NULL, _T("An instance of the viewer is currently running, please close it :)"), _T("NeL Export"), MB_OK|MB_ICONEXCLAMATION); return; } @@ -191,7 +191,7 @@ void CNelExport::viewMesh (TimeValue time) // Init it if (!view->initUI()) { - ::MessageBox(NULL, "Failed to initialize object viewer ui, this may be a driver init issue, check your log.log files", "NeL Export", MB_OK|MB_ICONEXCLAMATION); + ::MessageBox(NULL, _T("Failed to initialize object viewer ui, this may be a driver init issue, check your log.log files"), _T("NeL Export"), MB_OK|MB_ICONEXCLAMATION); IObjectViewer::releaseInterface(view); return; } @@ -300,7 +300,7 @@ void CNelExport::viewMesh (TimeValue time) _ExportNel->buildSkeletonShape (*skelShape, *skeletonRoot, &(iteSkeleton->second), mapId, time); // Add the shape in the view - uint instance = view->addSkel (skelShape, skeletonRoot->GetName()); + uint instance = view->addSkel (skelShape, tStrToUtf8(skeletonRoot->GetName())); // Add tracks CAnimation *anim=new CAnimation; diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_zone.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_zone.cpp index e74e39dd0..334b56aff 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_zone.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_zone.cpp @@ -25,7 +25,7 @@ using namespace NLMISC; // -------------------------------------------------- -bool CNelExport::exportZone (const char *sPath, INode& node, TimeValue time) +bool CNelExport::exportZone (const std::string &sPath, INode& node, TimeValue time) { // Result to return bool bRet=false; 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 3f6a2e824..e104dc64e 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/progress.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/progress.cpp @@ -52,24 +52,24 @@ INT_PTR CALLBACK CalculatingDialogCallback ( case WM_PAINT: { - char temp[256]; + TCHAR temp[256]; SendMessage( GetDlgItem( hwndDlg, IDC_PROGRESS1 ), PBM_SETPOS, (int)(pClass->rRatioCalculated*100), 0 ); if( pClass->rRatioCalculated > 0.0 ) { double TimeLeft = (TimeCurrent - pClass->rTimeBegin) * (1.0-pClass->rRatioCalculated); - sprintf( temp, "Time remaining : %02d h %02d m %02d s", ((uint32)TimeLeft)/3600, + _stprintf( temp, _T("Time remaining : %02d h %02d m %02d s"), ((uint32)TimeLeft)/3600, (((uint32)TimeLeft)/60)%60, (((uint32)TimeLeft))%60 ); if (pClass->bCancelCalculation) - strcpy (temp, "INTERRUPTED - Finishing current object..."); - SendMessage (GetDlgItem (hwndDlg, IDC_STATICTIMELEFT), WM_SETTEXT, 0, (long)temp); + _tcscpy (temp, _T("INTERRUPTED - Finishing current object...")); + SendMessage (GetDlgItem (hwndDlg, IDC_STATICTIMELEFT), WM_SETTEXT, 0, (LPARAM)temp); SendMessage (GetDlgItem (hwndDlg, IDC_BUTTONCANCEL), WM_PAINT, 0, 0); } string all; for (uint32 i = 0; i < 14; ++i) all += pClass->sInfoProgress[i] + "\n"; - SendMessage (GetDlgItem (hwndDlg, IDC_STATICINFO), WM_SETTEXT, 0, (long)all.c_str()); + SendMessage (GetDlgItem (hwndDlg, IDC_STATICINFO), WM_SETTEXT, 0, (LPARAM)utf8ToTStr(all)); } break; diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp index 51b8aa367..ef63a7d20 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp @@ -775,17 +775,17 @@ void CExportNel::outputErrorMessage(const std::string &message) // -------------------------------------------------- -void CExportNel::outputWarningMessage (const char *message) +void CExportNel::outputWarningMessage (const std::string &message) { if (_ErrorInDialog) { - MessageBox (_Ip->GetMAXHWnd(), message, _ErrorTitle.c_str(), MB_OK|MB_ICONEXCLAMATION); + MessageBox (_Ip->GetMAXHWnd(), utf8ToTStr(message), utf8ToTStr(_ErrorTitle), MB_OK|MB_ICONEXCLAMATION); } mprintf (message); mprintf ("\n"); nlwarning ("Warning in max file %s : ", _Ip->GetCurFilePath()); - nlwarning (message); + nlwarning (message.c_str()); } // -------------------------------------------------- @@ -819,7 +819,7 @@ void CExportNel::addChildLodNode (std::set &lodListToExclude, INode *cur if (lodName != "") { // Get the lod by name - INode *lodNode = _Ip->GetINodeByName (lodName.c_str()); + INode *lodNode = _Ip->GetINodeByName (utf8ToTStr(lodName)); if (lodNode) { // Insert it in the set @@ -850,7 +850,7 @@ void CExportNel::addParentLodNode (INode &child, std::set &lodListToExcl if (lodName != "") { // Get the lod by name - INode *lodNode = _Ip->GetINodeByName (lodName.c_str()); + INode *lodNode = _Ip->GetINodeByName (utf8ToTStr(lodName)); if (lodNode == &child) { // Insert it in the set @@ -1111,12 +1111,23 @@ static void restoreDecimalSeparator() float toFloatMax(const TCHAR *src) { float result = 0.f; - if (toFloatMax(src, result)) return result; + if (toFloatMax(tStrToUtf8(src), result)) return result; return 0.f; } +float toFloatMax(const std::string &src) +{ + float result = 0.f; + if (toFloatMax(src, result)) return result; + return 0.f; +} bool toFloatMax(const TCHAR *src, float &dest) +{ + return toFloatMax(tStrToUtf8(src), dest); +} + +bool toFloatMax(const std::string &src, float &dest) { setDecimalSeparatorAsPoint(); std::string str(src); diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h index d9d8b6189..178190f13 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h @@ -1092,8 +1092,10 @@ private: /** replacment for sprintf scanf (because of localisation in max) */ +float toFloatMax(const std::string &src); float toFloatMax(const TCHAR *src); // Same as to float max, but returns true if succeed +bool toFloatMax(const std::string &src, float &dest); bool toFloatMax(const TCHAR *src, float &dest); std::string toStringMax(float value); std::string toStringMax(int value); 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 61b8de8e8..12a168f04 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 @@ -133,7 +133,7 @@ INT_PTR CALLBACK DlgProc_Panel(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP if (hModule) { // Get module file name - char moduldeFileName[512]; + TCHAR moduldeFileName[512]; if (GetModuleFileName (hModule, moduldeFileName, 512)) { // Get version info size @@ -141,49 +141,49 @@ INT_PTR CALLBACK DlgProc_Panel(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP uint versionInfoSize=GetFileVersionInfoSize (moduldeFileName, &doomy); if (versionInfoSize) { - // Alloc the buffer - char *buffer=new char[versionInfoSize]; + // Alloc the buffer (size in bytes) + uint8_t *buffer = new uint8_t[versionInfoSize]; // Find the verion resource if (GetFileVersionInfo(moduldeFileName, 0, versionInfoSize, buffer)) { uint *versionTab; uint versionSize; - if (VerQueryValue (buffer, "\\", (void**)&versionTab, &versionSize)) + if (VerQueryValue (buffer, _T("\\"), (void**)&versionTab, &versionSize)) { // Get the pointer on the structure VS_FIXEDFILEINFO *info=(VS_FIXEDFILEINFO*)versionTab; if (info) { // Setup version number - char version[512]; - sprintf (version, "Version %d.%d.%d.%d", - info->dwFileVersionMS>>16, - info->dwFileVersionMS&0xffff, - info->dwFileVersionLS>>16, + TCHAR version[512]; + _stprintf (version, _T("Version %d.%d.%d.%d"), + info->dwFileVersionMS>>16, + info->dwFileVersionMS&0xffff, + info->dwFileVersionLS>>16, info->dwFileVersionLS&0xffff); SetWindowText (GetDlgItem (hWnd, IDC_VERSION), version); } else - SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "VS_FIXEDFILEINFO * is NULL"); + SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("VS_FIXEDFILEINFO * is NULL")); } else - SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "VerQueryValue failed"); + SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("VerQueryValue failed")); } else - SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "GetFileVersionInfo failed"); + SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("GetFileVersionInfo failed")); // Free the buffer delete [] buffer; } else - SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "GetFileVersionInfoSize failed"); + SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("GetFileVersionInfoSize failed")); } else - SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "GetModuleFileName failed"); + SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("GetModuleFileName failed")); } else - SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "hInstance NULL"); + SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("hInstance NULL")); } // ----- 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 5f492473c..cb667bced 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 @@ -215,7 +215,7 @@ export_zone_cf (Value** arg_list, int count) if (tri->rpatch->exportZone (node, &tri->patch, zone, zoneSymmetry, nZone, 160, 1, false)) { // Export path - const char* sPath=arg_list[1]->to_string(); + const std::string sPath = tStrToUtf8(arg_list[1]->to_string()); COFile file; if (file.open (sPath)) @@ -245,7 +245,7 @@ Value* import_zone_cf (Value** arg_list, int count) Interface *ip = MAXScript_interface; // Get the filename - string filename = arg_list[0]->to_string(); + string filename = tStrToUtf8(arg_list[0]->to_string()); // Get the flip bool dialog = arg_list[1]->to_bool ()!=FALSE; @@ -1705,7 +1705,7 @@ Value* set_tile_bank_cf (Value** arg_list, int count) type_check(arg_list[0], String, "NelSetTileBank [tile bank pathname]"); // ok ? - const char *pathname = arg_list[0]->to_string(); + const std::string pathname = tStrToUtf8(arg_list[0]->to_string()); // Get tile number SetBankPathName (pathname); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np.cpp index 133d0b4d6..b44376b53 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np.cpp @@ -642,7 +642,7 @@ void EditPatchMod::DoVertWeld() { hadSel = TRUE; if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "DoVertWeld")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("DoVertWeld"))); // Call the patch weld function if (patch->Weld(weldThreshold)) { @@ -716,7 +716,7 @@ void EditPatchMod::DoVertReset () { hadSel = TRUE; if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "DoVertReset")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("DoVertReset"))); // Call the patch weld function ResetVert (patch); patchData->UpdateChanges(patch, rpatch); 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 55825158b..1e3ba59de 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 @@ -688,7 +688,7 @@ if (!TestAFlag(A_HELD)) patchData->vdelta.SetSize(*patch, FALSE); if (theHold.Holding()) { - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "XFormHandles")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("XFormHandles"))); } patchData->vdelta.Zero(); // Reset all deltas patchData->ClearHandleFlag(); @@ -946,7 +946,7 @@ for (int i = 0; i < mcList.Count(); i++) if (theHold.Holding()) { // Hulud: here, i pass a NULL pointer because rpatch are not modified by xform - theHold.Put(new PatchRestore(patchData, this, patch, NULL, "XFormVerts")); + theHold.Put(new PatchRestore(patchData, this, patch, NULL, _T("XFormVerts"))); } patchData->vdelta.Zero(); // Reset all deltas patchData->ClearHandleFlag(); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_add_patches.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_add_patches.cpp index 49e2cb005..8ef6fde75 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_add_patches.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_add_patches.cpp @@ -24,7 +24,7 @@ static void AddPatches(int type, PatchMesh *patch, RPatchMesh *rpatch, BOOL post int edges = patch->getNumEdges(); if (type==PATCH_TRI) - MessageBox (NULL, "Rykol tools", "C'est pas cool les tripatches...", MB_OK|MB_ICONEXCLAMATION); + MessageBox (NULL, _T("Rykol tools"), _T("C'est pas cool les tripatches..."), MB_OK|MB_ICONEXCLAMATION); // Add a patch of the desired type to each selected edge that doesn't have two patches atatched! for (int i = 0; i < edges; ++i) @@ -393,7 +393,7 @@ void EditPatchMod::DoPatchAdd(int type) { altered = holdNeeded = 1; if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "DoPatchAdd")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("DoPatchAdd"))); // Call the patch add function AddPatches(type, patch, rpatch, TRUE); patchData->UpdateChanges(patch, rpatch); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_attach.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_attach.cpp index d2843df1c..0067a7175 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_attach.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_attach.cpp @@ -284,7 +284,7 @@ int EditPatchMod::DoAttach(INode *node, PatchMesh *attPatch, RPatchMesh *rattPat // Start a restore object... if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "DoAttach")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("DoAttach"))); // Do the attach patch->Attach(attPatch, mat2Offset); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_del.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_del.cpp index f196105ed..f2597fc58 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_del.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_del.cpp @@ -110,7 +110,7 @@ void EditPatchMod::DoPatchDelete() { altered = holdNeeded = 1; if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "DoPatchDelete")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("DoPatchDelete"))); // Call the patch delete function DeleteSelPatches(patch, rpatch); patchData->UpdateChanges(patch, rpatch); @@ -211,7 +211,7 @@ void EditPatchMod::DoVertDelete() { altered = holdNeeded = 1; if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "DoVertDelete")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("DoVertDelete"))); // Call the vertex delete function DeleteSelVerts(patch, rpatch); patchData->UpdateChanges(patch, rpatch); @@ -279,7 +279,7 @@ void EditPatchMod::DoEdgeDelete() { altered = holdNeeded = 1; if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "DoEdgeDelete")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("DoEdgeDelete"))); int edges = patch->getNumEdges(); int patches = patch->getNumPatches(); int verts = patch->getNumVerts(); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_detach.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_detach.cpp index eaf0c7369..370027a46 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_detach.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_detach.cpp @@ -133,7 +133,7 @@ void EditPatchMod::DoPatchDetach(int copy, int reorient) // Save the unmodified info. if (theHold.Holding()) { - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "DoPatchDetach")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("DoPatchDetach"))); } PatchMesh wpatch = *patch; RPatchMesh wrpatch = *rpatch; diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_material.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_material.cpp index 6adcde3cd..ace6d41cc 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_material.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_material.cpp @@ -89,7 +89,7 @@ void EditPatchMod::SetSelMatIndex(int index) // Start a restore object... if (theHold.Holding()) { - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "SetSelMatIndex")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("SetSelMatIndex"))); } for (int j = 0; j < patch->getNumPatches(); j++) @@ -254,7 +254,7 @@ void EditPatchMod::SetSelTess(int nU, int nV) // Start a restore object... if (theHold.Holding()) { - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "SetSelTess")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("SetSelTess"))); } for (int j = 0; j < patch->getNumPatches(); j++) @@ -391,7 +391,7 @@ void EditPatchMod::setSmoothFlags (bool smooth) // Start a restore object... if (theHold.Holding()) { - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "SetSmoothFlags")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("SetSmoothFlags"))); } // For each edges @@ -539,7 +539,7 @@ void EditPatchMod::BalanceSelPatch () // Start a restore object... if (theHold.Holding()) { - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "SetSelTess")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("SetSelTess"))); } std::set visitedU; diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_remember.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_remember.cpp index 3ab9a629b..0fc1fabba 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_remember.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_remember.cpp @@ -149,7 +149,7 @@ void EditPatchMod::ChangeRememberedPatch(int type) theHold.Begin(); if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "ChangeRememberedPatch")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("ChangeRememberedPatch"))); // Call the patch type change function ChangePatchType(patch, rememberedIndex, type); patchData->UpdateChanges(patch, rpatch, FALSE); @@ -299,7 +299,7 @@ void EditPatchMod::ChangeRememberedVert(int type) theHold.Begin(); if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "ChangeRememberedVert")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("ChangeRememberedVert"))); // Call the vertex type change function patch->ChangeVertType(rememberedIndex, type); patchData->UpdateChanges(patch, rpatch, FALSE); 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 0b15b63e7..84951e2e9 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 @@ -262,7 +262,7 @@ void EditPatchMod::SelectSubPatch(int index) patchData->BeginEdit(t); if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "SelectSubComponent")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("SelectSubComponent"))); patch->patchSel.Set(index); @@ -311,7 +311,7 @@ void EditPatchMod::SelectSubPatch(int index) patchData->BeginEdit(t); if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "SelectSubComponent")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("SelectSubComponent"))); switch (selLevel) { @@ -636,7 +636,7 @@ void EditPatchMod::ClearSelection(int selLevel) patchData->BeginEdit(ip->GetTime()); if (theHold.Holding()) { - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "ClearSelection")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("ClearSelection"))); } switch (selLevel) @@ -744,7 +744,7 @@ void EditPatchMod::SelectAll(int selLevel) patchData->BeginEdit(ip->GetTime()); if (theHold.Holding()) { - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "SelectAll")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("SelectAll"))); } switch (selLevel) @@ -813,7 +813,7 @@ void EditPatchMod::InvertSelection(int selLevel) patchData->BeginEdit(ip->GetTime()); if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "InvertSelection")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("InvertSelection"))); switch (selLevel) { @@ -1004,7 +1004,7 @@ void EditPatchMod::ChangeSelPatches(int type) { altered = holdNeeded = TRUE; if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "ChangeSelPatches")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("ChangeSelPatches"))); // Call the vertex type change function ChangePatchType(patch, -1, type); patchData->UpdateChanges(patch, rpatch, FALSE); @@ -1077,7 +1077,7 @@ void EditPatchMod::ChangeSelVerts(int type) { altered = holdNeeded = TRUE; if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "ChangeSelVerts")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("ChangeSelVerts"))); // Call the vertex type change function patch->ChangeVertType(-1, type); patchData->UpdateChanges(patch, rpatch, FALSE); 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 0d16dd149..bb134c871 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 @@ -70,7 +70,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) //------------------------------------------------------ __declspec( dllexport ) const TCHAR *LibDescription() { - return "NeL Patch Edit"; + return _T("NeL Patch Edit"); } /// MUST CHANGE THIS NUMBER WHEN ADD NEW CLASS 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 649b3b051..ede7215f9 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 @@ -35,7 +35,7 @@ extern void LoadImages(); INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - static char string[64]; + static TCHAR string[64]; EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); ICustToolbar *iToolbar; if (!ep && message != WM_INITDIALOG) @@ -50,7 +50,7 @@ INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPAR if (hModule) { // Get module file name - char moduldeFileName[512]; + TCHAR moduldeFileName[512]; if (GetModuleFileName (hModule, moduldeFileName, 512)) { // Get version info size @@ -59,22 +59,22 @@ INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPAR if (versionInfoSize) { // Alloc the buffer - char *buffer=new char[versionInfoSize]; + TCHAR *buffer = new TCHAR[versionInfoSize]; // Find the verion resource if (GetFileVersionInfo(moduldeFileName, 0, versionInfoSize, buffer)) { uint *versionTab; uint versionSize; - if (VerQueryValue (buffer, "\\", (void**)&versionTab, &versionSize)) + if (VerQueryValue (buffer, _T("\\"), (void**)&versionTab, &versionSize)) { // Get the pointer on the structure VS_FIXEDFILEINFO *info=(VS_FIXEDFILEINFO*)versionTab; if (info) { // Setup version number - char version[512]; - sprintf (version, "Version %d.%d.%d.%d", + TCHAR version[512]; + _stprintf(version, _T("Version %d.%d.%d.%d"), info->dwFileVersionMS>>16, info->dwFileVersionMS&0xffff, info->dwFileVersionLS>>16, @@ -82,25 +82,25 @@ INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPAR SetWindowText (GetDlgItem (hDlg, IDC_VERSION), version); } else - SetWindowText (GetDlgItem (hDlg, IDC_VERSION), "VS_FIXEDFILEINFO * is NULL"); + SetWindowText (GetDlgItem (hDlg, IDC_VERSION), _T("VS_FIXEDFILEINFO * is NULL")); } else - SetWindowText (GetDlgItem (hDlg, IDC_VERSION), "VerQueryValue failed"); + SetWindowText (GetDlgItem (hDlg, IDC_VERSION), _T("VerQueryValue failed")); } else - SetWindowText (GetDlgItem (hDlg, IDC_VERSION), "GetFileVersionInfo failed"); + SetWindowText (GetDlgItem (hDlg, IDC_VERSION), _T("GetFileVersionInfo failed")); // Free the buffer delete [] buffer; } else - SetWindowText (GetDlgItem (hDlg, IDC_VERSION), "GetFileVersionInfoSize failed"); + SetWindowText (GetDlgItem (hDlg, IDC_VERSION), _T("GetFileVersionInfoSize failed")); } else - SetWindowText (GetDlgItem (hDlg, IDC_VERSION), "GetModuleFileName failed"); + SetWindowText (GetDlgItem (hDlg, IDC_VERSION), _T("GetModuleFileName failed")); } else - SetWindowText (GetDlgItem (hDlg, IDC_VERSION), "GetModuleHandle failed"); + SetWindowText (GetDlgItem (hDlg, IDC_VERSION), _T("GetModuleHandle failed")); ep =(EditPatchMod *)lParam; ep->hSelectPanel = hDlg; @@ -122,7 +122,7 @@ INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPAR CheckDlgButton(hDlg, IDC_LOCK_HANDLES, lockedHandles); ep->SetSelDlgEnables(); - sprintf(string,"%s - %s",__DATE__,__TIME__); + _stprintf(string, _T("%s - %s"), _T(__DATE__), _T(__TIME__)); SetDlgItemText(hDlg,ID_VERSION,string); return TRUE; } @@ -224,7 +224,7 @@ INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPAR lpttt->lpszText = GetString(IDS_TH_PATCH); break; case EP_TILE: - lpttt->lpszText = "Tile"; + lpttt->lpszText = _T("Tile"); break; } } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.cpp b/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.cpp index a0697ac79..5dd6cd5a7 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.cpp @@ -53,7 +53,7 @@ float bindWhere[BIND_COUNT]= #define RK_APPDATA_TILEFILE 0 #define RK_APPDATA_LAND 1 -#define REGKEY_TILEDIT "Software\\Nevrax\\Ryzom\\Tile_Edit" +#define REGKEY_TILEDIT _T("Software\\Nevrax\\Ryzom\\Tile_Edit") //#define CHECK_VALIDITY // check validity @@ -103,11 +103,11 @@ std::string GetBankPathName () HKEY hKey; if (RegOpenKeyEx(HKEY_CURRENT_USER, REGKEY_TILEDIT, 0, KEY_READ, &hKey)==ERROR_SUCCESS) { - char path[256]; - DWORD len=256; + TCHAR path[256]; + DWORD len=256 * sizeof(TCHAR); DWORD type; - if (RegQueryValueEx(hKey, "Bank Path", 0, &type, (LPBYTE)path, &len)==ERROR_SUCCESS) - return std::string (path); + if (RegQueryValueEx(hKey, _T("Bank Path"), 0, &type, (LPBYTE)path, &len)==ERROR_SUCCESS) + return tStrToUtf8(path); RegCloseKey (hKey); } return ""; @@ -121,7 +121,7 @@ int GetBankTileSetSet () int tileSetSet; DWORD len=256; DWORD type; - if (RegQueryValueEx(hKey, "Tileset Set", 0, &type, (LPBYTE)&tileSetSet, &len)==ERROR_SUCCESS) + if (RegQueryValueEx(hKey, _T("Tileset Set"), 0, &type, (LPBYTE)&tileSetSet, &len)==ERROR_SUCCESS) return tileSetSet; RegCloseKey (hKey); } @@ -143,7 +143,7 @@ void SetBankTileSetSet (int tileSetSet) HKEY hKey; if (RegCreateKey(HKEY_CURRENT_USER, REGKEY_TILEDIT, &hKey)==ERROR_SUCCESS) { - RegSetValueEx(hKey, "Tileset Set", 0, REG_DWORD, (LPBYTE)&tileSetSet, 4); + RegSetValueEx(hKey, _T("Tileset Set"), 0, REG_DWORD, (LPBYTE)&tileSetSet, 4); RegCloseKey (hKey); } } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp index 9f5c7b4cb..de24e77de 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp @@ -47,7 +47,7 @@ using namespace NLLIGO; #define DEPTH_SEARCH_MAX 8 -#define REGKEY_EDIT_PATCH "Software\\Nevrax\\Ryzom\\edit_patch" +#define REGKEY_EDIT_PATCH _T("Software\\Nevrax\\Ryzom\\edit_patch") // Bank bitmaps CBankCont* bankCont; @@ -77,8 +77,7 @@ void WarningInvalidTileSet () if (!bWarningInvalidTileSet) { bWarningInvalidTileSet=true; - MessageBox (NULL, "The tile bank is not compatible with your zone.\nPlease use the good bank or erase and repaint the zone.", - "Tile paint", MB_OK|MB_ICONEXCLAMATION); + MessageBox (NULL, _T("The tile bank is not compatible with your zone.\nPlease use the good bank or erase and repaint the zone."), _T("Tile paint"), MB_OK|MB_ICONEXCLAMATION); } } @@ -105,13 +104,13 @@ void enterPainter (CTileBank& banktoLoad) { DWORD len=4; DWORD type; - RegQueryValueEx (hKey, "Background", 0, &type, (LPBYTE)&backGround, &len); - RegQueryValueEx (hKey, "Color1", 0, &type, (LPBYTE)&color1, &len); - RegQueryValueEx (hKey, "Color2", 0, &type, (LPBYTE)&color2, &len); - RegQueryValueEx (hKey, "Opa1", 0, &type, (LPBYTE)&opa1, &len); - RegQueryValueEx (hKey, "Opa2", 0, &type, (LPBYTE)&opa2, &len); - RegQueryValueEx (hKey, "Hard1", 0, &type, (LPBYTE)&hard1, &len); - RegQueryValueEx (hKey, "Hard2", 0, &type, (LPBYTE)&hard2, &len); + RegQueryValueEx (hKey, _T("Background"), 0, &type, (LPBYTE)&backGround, &len); + RegQueryValueEx (hKey, _T("Color1"), 0, &type, (LPBYTE)&color1, &len); + RegQueryValueEx (hKey, _T("Color2"), 0, &type, (LPBYTE)&color2, &len); + RegQueryValueEx (hKey, _T("Opa1"), 0, &type, (LPBYTE)&opa1, &len); + RegQueryValueEx (hKey, _T("Opa2"), 0, &type, (LPBYTE)&opa2, &len); + RegQueryValueEx (hKey, _T("Hard1"), 0, &type, (LPBYTE)&hard1, &len); + RegQueryValueEx (hKey, _T("Hard2"), 0, &type, (LPBYTE)&hard2, &len); RegCloseKey (hKey); } } @@ -126,13 +125,13 @@ void exitPainter () HKEY hKey; if (RegCreateKey(HKEY_CURRENT_USER, REGKEY_EDIT_PATCH, &hKey)==ERROR_SUCCESS) { - RegSetValueEx(hKey, "Background", 0, REG_DWORD, (LPBYTE)&backGround, 4); - RegSetValueEx(hKey, "Color1", 0, REG_DWORD, (LPBYTE)&color1, 4); - RegSetValueEx(hKey, "Color2", 0, REG_DWORD, (LPBYTE)&color2, 4); - RegSetValueEx(hKey, "Opa1", 0, REG_DWORD, (LPBYTE)&opa1, 4); - RegSetValueEx(hKey, "Opa2", 0, REG_DWORD, (LPBYTE)&opa2, 4); - RegSetValueEx(hKey, "Hard1", 0, REG_DWORD, (LPBYTE)&hard1, 4); - RegSetValueEx(hKey, "Hard2", 0, REG_DWORD, (LPBYTE)&hard2, 4); + RegSetValueEx(hKey, _T("Background"), 0, REG_DWORD, (LPBYTE)&backGround, 4); + RegSetValueEx(hKey, _T("Color1"), 0, REG_DWORD, (LPBYTE)&color1, 4); + RegSetValueEx(hKey, _T("Color2"), 0, REG_DWORD, (LPBYTE)&color2, 4); + RegSetValueEx(hKey, _T("Opa1"), 0, REG_DWORD, (LPBYTE)&opa1, 4); + RegSetValueEx(hKey, _T("Opa2"), 0, REG_DWORD, (LPBYTE)&opa2, 4); + RegSetValueEx(hKey, _T("Hard1"), 0, REG_DWORD, (LPBYTE)&hard1, 4); + RegSetValueEx(hKey, _T("Hard2"), 0, REG_DWORD, (LPBYTE)&hard2, 4); RegCloseKey (hKey); } } @@ -2816,12 +2815,12 @@ void mainproc(CScene& scene, CEventListenerAsync& AsyncListener, CEvent3dMouseLi if (AsyncListener.isKeyPushed ((TKey)PainterKeys[SelectColorBrush])) { // Create a dialog filter - static char szFilter[] = - "Targa Files (*.tga)\0*.tga\0" - "All Files (*.*)\0*.*\0\0"; + static TCHAR szFilter[] = + _T("Targa Files (*.tga)\0*.tga\0") + _T("All Files (*.*)\0*.*\0\0"); // Filename buffer - char buffer[65535]; + TCHAR buffer[65535]; buffer[0]=0; // Fill the (big) struct @@ -2834,13 +2833,13 @@ void mainproc(CScene& scene, CEventListenerAsync& AsyncListener, CEvent3dMouseLi openFile.lpstrFile = buffer; openFile.nMaxFile = 65535; openFile.Flags = OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_ENABLESIZING|OFN_EXPLORER; - openFile.lpstrDefExt = "*.tga"; + openFile.lpstrDefExt = _T("*.tga"); // Open the dialog if (GetOpenFileName(&openFile)) { // Load the file - paintColor.loadBrush (buffer); + paintColor.loadBrush (tStrToUtf8(buffer)); paintColor.setBrushMode (true); } } @@ -3721,7 +3720,7 @@ void EPM_PaintCMode::DoPaint () { std::string error = NLMISC::toString("Invalid edge '%i' with value '%i' in patch '%i' in PatchMesh", p, mYedge, e); nlwarning(error.c_str()); - MessageBox(NULL, error.c_str(), "NeL Patch Painter", MB_OK | MB_ICONSTOP); + MessageBox(NULL, utf8ToTStr(error), _T("NeL Patch Painter"), MB_OK | MB_ICONSTOP); return; } #if (MAX_RELEASE < 4000) @@ -3884,8 +3883,8 @@ void EPM_PaintCMode::DoPaint () } if (patchVoisin.patch!=-1) { - std::string first = vectMesh[i].Node->GetName(); - std::string second = vectMesh[patchVoisin.Mesh].Node->GetName(); + std::string first = tStrToUtf8(vectMesh[i].Node->GetName()); + std::string second = tStrToUtf8(vectMesh[patchVoisin.Mesh].Node->GetName()); int rot = (2-((vectMesh[i].Symmetry)?(2-e):e)+((vectMesh[patchVoisin.Mesh].Symmetry)?(2-edgeVoisin):edgeVoisin))&3; int nU = 1 << rpatch->getUIPatch (p).NbTilesU; int nV = 1 << rpatch->getUIPatch (p).NbTilesV; @@ -4076,9 +4075,7 @@ bool loadLigoConfigFile (CLigoConfig& config, Interface& it) catch (const Exception& e) { // Print an error message - char msg[512]; - smprintf (msg, 512, "Error loading the config file ligoscape.cfg: %s", e.what()); - nlwarning (msg); + nlwarning("Error loading the config file ligoscape.cfg: %s", e.what()); } } } @@ -4259,9 +4256,8 @@ DWORD WINAPI myThread (LPVOID vData) } else { - char message[512]; - smprintf (message, 512, "Can't build the zone named %s", pData->VectMesh[i].Node->GetName()); - MessageBox (pData->eproc->ip->GetMAXHWnd(), message, "NeL Painter", MB_OK|MB_ICONEXCLAMATION); + std::string message = toString("Can't build the zone named %s", tStrToUtf8(pData->VectMesh[i].Node->GetName()).c_str()); + MessageBox (pData->eproc->ip->GetMAXHWnd(), utf8ToTStr(message), _T("NeL Painter"), MB_OK|MB_ICONEXCLAMATION); } } @@ -4363,14 +4359,14 @@ DWORD WINAPI myThread (LPVOID vData) } catch (EDru& druExcept) { - MessageBox (NULL, druExcept.what(), "NeL driver utility", MB_OK|MB_ICONEXCLAMATION); + MessageBox (NULL, utf8ToTStr(druExcept.what()), _T("NeL driver utility"), MB_OK|MB_ICONEXCLAMATION); } delete pData; } catch (const Exception& e) { - MessageBox (NULL, e.what(), "NeL Painter", MB_OK|MB_ICONEXCLAMATION); + MessageBox (NULL, utf8ToTStr(e.what()), _T("NeL Painter"), MB_OK|MB_ICONEXCLAMATION); } return 0; diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.cpp index 7f6fec25c..59b7897db 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.cpp @@ -7,7 +7,7 @@ #include "nel/3d/texture_mem.h" #include "nel/misc/config_file.h" -#define REGKEY_EDIT_PATCH "Software\\Nevrax\\Ryzom\\edit_patch" +#define REGKEY_EDIT_PATCH _T("Software\\Nevrax\\Ryzom\\edit_patch") /*-------------------------------------------------------------------*/ @@ -318,9 +318,8 @@ void getColors (COLORREF *array) { DWORD len=4; DWORD type; - char regName[100]; - smprintf (regName, 100, "Color%d", i); - RegQueryValueEx (hKey, regName, 0, &type, (LPBYTE)(array+i), &len); + std::string regName = toString("Color%u", i); + RegQueryValueEx (hKey, utf8ToTStr(regName), 0, &type, (LPBYTE)(array+i), &len); } RegCloseKey (hKey); } @@ -337,9 +336,8 @@ void setColors (const COLORREF *array) for (uint i=0; i<16; i++) { DWORD len=4; - char regName[100]; - smprintf (regName, 100, "Color%d", i); - RegSetValueEx (hKey, regName, 0, REG_DWORD, (LPBYTE)(array+i), 4); + std::string regName = toString("Color%u", i); + RegSetValueEx (hKey, utf8ToTStr(regName), 0, REG_DWORD, (LPBYTE)(array+i), 4); } RegCloseKey (hKey); } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_vcolor.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_vcolor.cpp index e29b00999..7d0a4a3df 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_vcolor.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_vcolor.cpp @@ -378,7 +378,7 @@ void CPaintColor::setVertexColor (int mesh, int patch, int s, int t, const CRGBA /*-------------------------------------------------------------------*/ -bool CPaintColor::loadBrush (const char *brushFileName) +bool CPaintColor::loadBrush (const std::string &brushFileName) { // Open the file try @@ -401,9 +401,8 @@ bool CPaintColor::loadBrush (const char *brushFileName) else { // Error message - char msg[512]; - smprintf (msg, 512, "Can't open the file %s.", brushFileName); - MessageBox ((HWND)CNELU::Driver->getDisplay(), msg, "NeL Painter", MB_OK|MB_ICONEXCLAMATION); + std::string msg = toString("Can't open the file %s.", brushFileName.c_str()); + MessageBox ((HWND)CNELU::Driver->getDisplay(), utf8ToTStr(msg), _T("NeL Painter"), MB_OK|MB_ICONEXCLAMATION); // Return false return false; @@ -412,7 +411,7 @@ bool CPaintColor::loadBrush (const char *brushFileName) catch (const Exception &e) { // Error message - MessageBox ((HWND)CNELU::Driver->getDisplay(), e.what(), "NeL Painter", MB_OK|MB_ICONEXCLAMATION); + MessageBox ((HWND)CNELU::Driver->getDisplay(), utf8ToTStr(e.what()), _T("NeL Painter"), MB_OK|MB_ICONEXCLAMATION); // Return false return false; diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_vcolor.h b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_vcolor.h index 594d0f5bb..204b36d47 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_vcolor.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_vcolor.h @@ -81,7 +81,7 @@ public: } // Load a brush - bool loadBrush (const char *brushFileName); + bool loadBrush (const std::string &brushFileName); private: 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 37dca5ac9..88d3ef41d 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 @@ -120,7 +120,7 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, { // Setup version number TCHAR version[512]; - _tcprintf (version, "Version %d.%d.%d.%d", + _stprintf (version, _T("Version %d.%d.%d.%d"), info->dwFileVersionMS>>16, info->dwFileVersionMS&0xffff, info->dwFileVersionLS>>16, @@ -378,9 +378,9 @@ void Tile_utility::SetupUI () // Static text TCHAR sTmp[256]; - _tcprintf (sTmp, "%d diffuse tiles.", Bank.getNumBitmap (CTile::diffuse)); + _stprintf (sTmp, _T("%d diffuse tiles."), Bank.getNumBitmap (CTile::diffuse)); SetWindowText (hwndStatic1, sTmp); - _tcprintf (sTmp, "%d additive tiles.", Bank.getNumBitmap (CTile::additive)); + _stprintf (sTmp, _T("%d additive tiles."), Bank.getNumBitmap (CTile::additive)); SetWindowText (hwndStatic2, sTmp); } else diff --git a/code/nel/tools/3d/tile_edit/Browse.cpp b/code/nel/tools/3d/tile_edit/Browse.cpp index aaaa17a58..9572ce0a4 100644 --- a/code/nel/tools/3d/tile_edit/Browse.cpp +++ b/code/nel/tools/3d/tile_edit/Browse.cpp @@ -778,7 +778,7 @@ void Browse::OnCancel() // TODO: Add your control notification handler code here if (thread_actif) return; - if (::MessageBox (NULL, "Are you sure you want to cancel?", "Cancel", MB_OK|MB_ICONQUESTION|MB_YESNO)==IDYES) + if (::MessageBox (NULL, _T("Are you sure you want to cancel?"), _T("Cancel"), MB_OK|MB_ICONQUESTION|MB_YESNO)==IDYES) { this->SendMessage(WM_CLOSE); CDialog::OnCancel(); @@ -884,8 +884,7 @@ void Browse::OnChangeVariety() void Browse::OnBatchLoad () { - CFileDialog sFile (true, NULL, NULL, OFN_ENABLESIZING, - "PNG Bitmap (*.png)|*.png|Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||",NULL); + CFileDialog sFile (true, NULL, NULL, OFN_ENABLESIZING, _T("PNG Bitmap (*.png)|*.png|Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||"), NULL); if (sFile.DoModal()==IDOK) { @@ -904,7 +903,8 @@ void Browse::OnBatchLoad () sNumber[1]=0; bool rotate=false; - if (::MessageBox (NULL, "Do you want to use rotation to reuse alpha tiles ?", "Import rotated tiles", MB_OK|MB_ICONQUESTION|MB_YESNO)==IDYES) + + if (::MessageBox (NULL, _T("Do you want to use rotation to reuse alpha tiles ?"), _T("Import rotated tiles"), MB_OK|MB_ICONQUESTION|MB_YESNO)==IDYES) rotate=true; for (int i=0; isetBorder (m_ctrl.Texture==1?CTile::diffuse:CTile::additive, border); // Message - MessageBox ("The border has been changed.", "Import border", MB_OK|MB_ICONINFORMATION); + MessageBox (_T("The border has been changed."), _T("Import border"), MB_OK|MB_ICONINFORMATION); } } diff --git a/code/nel/tools/3d/tile_edit/View.cpp b/code/nel/tools/3d/tile_edit/View.cpp index db4c52828..9a0907aa3 100644 --- a/code/nel/tools/3d/tile_edit/View.cpp +++ b/code/nel/tools/3d/tile_edit/View.cpp @@ -466,7 +466,7 @@ int TileList::setDisplacement (int tile, const std::string& name) // Error: bitmap not in the absolute path.. char msg[512]; sprintf (msg, "The bitmap %s is not in the absolute path %s.", name.c_str(), tileBank2.getAbsPath ().c_str()); - MessageBox (NULL, msg, "Load error", MB_OK|MB_ICONEXCLAMATION); + MessageBox (NULL, msg, _T("Load error"), MB_OK|MB_ICONEXCLAMATION); } return 1; @@ -536,7 +536,7 @@ int TileList::setTileTransitionAlpha (int tile, const std::string& name, int rot // Error: bitmap not in the absolute path.. char msg[512]; sprintf (msg, "The bitmap %s is not in the absolute path %s.", name.c_str(), tileBank2.getAbsPath ().c_str()); - MessageBox (NULL, msg, "Load error", MB_OK|MB_ICONEXCLAMATION); + MessageBox (NULL, msg, _T("Load error"), MB_OK|MB_ICONEXCLAMATION); } return 1; @@ -753,7 +753,7 @@ void CTView::Init(int _land, int n) pImList = new CImageList; pImList->Create(sizetile_x,sizetile_y,ILC_COLOR24,0,1); pImList->Add(bmp,(CBitmap*)NULL); - char *defautpath = ((SelectionTerritoire*)GetParent()->GetParent())->DefautPath.GetBuffer(256); + TCHAR *defautpath = ((SelectionTerritoire*)GetParent()->GetParent())->DefautPath.GetBuffer(256); count_=1; } @@ -1123,8 +1123,8 @@ void CTView::OnDropFiles(HDROP hDropInfo) if (!lockInsertion) { Browse *parent = (Browse*)this->GetParent(); - char FileName[256]; - int count=DragQueryFile(hDropInfo,0xffffffff,FileName,256); //count = files number in drop queue + TCHAR FileName[256]; + int count=DragQueryFile(hDropInfo, 0xffffffff, FileName, 256); //count = files number in drop queue POINT pos; @@ -1138,7 +1138,7 @@ void CTView::OnDropFiles(HDROP hDropInfo) case 0: { int index=InfoList.addTile128 (); - if (InfoList.setTile128 (index, FileName, Texture==1?CTile::diffuse:(Texture==2?CTile::additive:CTile::alpha))) + if (InfoList.setTile128 (index, tStrToUtf8(FileName), Texture==1?CTile::diffuse:(Texture==2?CTile::additive:CTile::alpha))) { tilelist::iterator it = InfoList.GetLast(parent->m_128x128); it--; @@ -1152,7 +1152,7 @@ void CTView::OnDropFiles(HDROP hDropInfo) case 1: { int index=InfoList.addTile256 (); - if (InfoList.setTile256 (index, FileName, Texture==1?CTile::diffuse:(Texture==2?CTile::additive:CTile::alpha))) + if (InfoList.setTile256 (index, tStrToUtf8(FileName), Texture==1?CTile::diffuse:(Texture==2?CTile::additive:CTile::alpha))) { tilelist::iterator it = InfoList.GetLast(parent->m_128x128); it--; @@ -1527,9 +1527,8 @@ LRESULT CTView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) else if ((id==ID_MENU_ADD)||(id==ID_MENU_REPLACE)) { _chdir (LastPath.c_str()); - CFileDialog load(true, NULL, LastPath.c_str(), OFN_ENABLESIZING | OFN_ALLOWMULTISELECT, - "PNG Bitmap (*.png)|*.png|Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||",NULL); - load.m_ofn.lpstrFile = new char[10000]; // buffer contains filenames list + CFileDialog load(true, NULL, utf8ToTStr(LastPath), OFN_ENABLESIZING | OFN_ALLOWMULTISELECT, _T("PNG Bitmap (*.png)|*.png|Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||"), NULL); + load.m_ofn.lpstrFile = new TCHAR[10000]; // buffer contains filenames list load.m_ofn.lpstrFile[0] = 0; // with 10 KB we should be large enough... // if all files are exceeding 10000 characters, insert would be skipped @@ -1684,10 +1683,10 @@ void CTView::OnRButtonDown(UINT nFlags, CPoint point) if (!ViewTileMode) { - popup.AppendMenu(parent->m_128x128<2 ? MF_STRING : MF_STRING | MF_GRAYED, ID_MENU_ADD,"Add..."); - popup.AppendMenu(c>0 ? MF_STRING : MF_STRING | MF_GRAYED, ID_MENU_REPLACE, "Replace..."); - popup.AppendMenu(c>0 ? MF_STRING : MF_STRING | MF_GRAYED, ID_MENU_SUPR_BITMAP, "Del bitmap"); - popup.AppendMenu((c>0 && parent->m_128x128<2) ? MF_STRING : MF_STRING | MF_GRAYED, ID_MENU_SUPR_TILE, "Del tile"); + popup.AppendMenu(parent->m_128x128<2 ? MF_STRING : MF_STRING | MF_GRAYED, ID_MENU_ADD, _T("Add...")); + popup.AppendMenu(c>0 ? MF_STRING : MF_STRING | MF_GRAYED, ID_MENU_REPLACE, _T("Replace...")); + popup.AppendMenu(c>0 ? MF_STRING : MF_STRING | MF_GRAYED, ID_MENU_SUPR_BITMAP, _T("Del bitmap")); + popup.AppendMenu((c>0 && parent->m_128x128<2) ? MF_STRING : MF_STRING | MF_GRAYED, ID_MENU_SUPR_TILE, _T("Del tile")); } else { diff --git a/code/nel/tools/misc/log_analyser/PlugInSelector.cpp b/code/nel/tools/misc/log_analyser/PlugInSelector.cpp index 594942ddb..f62c0b5b1 100644 --- a/code/nel/tools/misc/log_analyser/PlugInSelector.cpp +++ b/code/nel/tools/misc/log_analyser/PlugInSelector.cpp @@ -131,10 +131,10 @@ void CPlugInSelector::OnSelchangeList1() if ( ! LibInst ) { CString s; - char msg [300]; + TCHAR msg [300]; FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), msg, 299, NULL ); - s.Format( "Can't load %s: %s", dllName, msg ); + s.Format(_T("Can't load %s: %s"), dllName, msg ); AfxMessageBox( s ); AnalyseFunc = NULL; return; @@ -144,7 +144,7 @@ void CPlugInSelector::OnSelchangeList1() TInfoFunc infoFunc = (TInfoFunc)GetProcAddress( LibInst, "getInfoString" ); if ( ! infoFunc ) { - AfxMessageBox( "Can't find function getInfoString in dll" ); + AfxMessageBox( _T("Can't find function getInfoString in dll") ); return; } GetDlgItem( IDC_GROUP_INFO )->SetWindowText( getFilename( string(dllName)).c_str() ); @@ -154,7 +154,7 @@ void CPlugInSelector::OnSelchangeList1() AnalyseFunc = (TAnalyseFunc)GetProcAddress( LibInst, "doAnalyse" ); if ( ! AnalyseFunc ) { - AfxMessageBox( "Can't find function doAnalyse in dll" ); + AfxMessageBox( _T("Can't find function doAnalyse in dll") ); return; } diff --git a/code/nel/tools/misc/log_analyser/ViewDialog.cpp b/code/nel/tools/misc/log_analyser/ViewDialog.cpp index c750cbd83..0e524ff31 100644 --- a/code/nel/tools/misc/log_analyser/ViewDialog.cpp +++ b/code/nel/tools/misc/log_analyser/ViewDialog.cpp @@ -483,7 +483,7 @@ void CViewDialog::loadFileOrSeries( const vector& bookmarksAbsoluteLines ) if ( LogSessionStartDate.IsEmpty() ) actualFilenames += ":\r\n"; else - actualFilenames += " for Session of " + LogSessionStartDate + ":\r\n"; + actualFilenames += " for Session of " + tStrToUtf8(LogSessionStartDate) + ":\r\n"; bool corruptionDetectionEnabled = (((CButton*)(((CLog_analyserDlg*)GetParent())->GetDlgItem( IDC_DetectCorruptedLines )))->GetCheck() == 1); HasCorruptedLines = false; vector corruptedLines; diff --git a/code/ryzom/tools/leveldesign/georges_dll/base_dialog.cpp b/code/ryzom/tools/leveldesign/georges_dll/base_dialog.cpp index 7d1f58e55..a2cf3c559 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/base_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/base_dialog.cpp @@ -254,10 +254,10 @@ void CBaseDialog::onOpenSelected() void CBaseDialog::registerLastControl () { RECT rect = {0, 0, 0, 0}; - DummyStatic0.Create ("Coucou", WS_CHILD|WS_VISIBLE|WS_TABSTOP, rect, this, 30); + DummyStatic0.Create (_T("Coucou"), WS_CHILD|WS_VISIBLE|WS_TABSTOP, rect, this, 30); DummyStatic0.Dlg = this; DummyStatic0.Index = 0; - DummyStatic1.Create ("Coucou", WS_CHILD|WS_VISIBLE|WS_TABSTOP, rect, this, 31); + DummyStatic1.Create (_T("Coucou"), WS_CHILD|WS_VISIBLE|WS_TABSTOP, rect, this, 31); DummyStatic1.Dlg = this; DummyStatic1.Index = 1; } diff --git a/code/ryzom/tools/leveldesign/georges_dll/color_wnd.cpp b/code/ryzom/tools/leveldesign/georges_dll/color_wnd.cpp index 9be44082e..3d401d9be 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/color_wnd.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/color_wnd.cpp @@ -78,7 +78,7 @@ void CColorWnd::create (DWORD wStyle, RECT &pos, CWnd *parent, uint dialogIndex) LPCTSTR className = AfxRegisterWndClass(CS_DBLCLKS); // Create this window - if (CWnd::Create (className, "empty", wStyle, pos, parent, dialogIndex)) + if (CWnd::Create (className, _T("empty"), wStyle, pos, parent, dialogIndex)) { } } @@ -118,8 +118,8 @@ void CColorWnd::setColor (const NLMISC::CRGBA &color) { Color = color; - char buffer[256]; - sprintf(buffer, "%d,%d,%d", Color.R, Color.G, Color.B); + CString buffer; + buffer.Format(_T("%d,%d,%d"), (int)Color.R, (int)Color.G, (int)Color.B); SetWindowText(buffer); Invalidate (); @@ -160,8 +160,8 @@ void CColorWnd::colorChanged () updateEdit(); Invalidate (); - char buffer[256]; - sprintf(buffer, "%d,%d,%d", Color.R, Color.G, Color.B); + CString buffer; + buffer.Format(_T("%d,%d,%d"), (int)Color.R, (int)Color.G, (int)Color.B); SetWindowText(buffer); CWnd *wnd = GetParent (); @@ -174,7 +174,7 @@ void CColorWnd::colorChanged () void CColorWnd::updateEdit() { - char buffer[256]; - sprintf(buffer, "%d,%d,%d", Color.R, Color.G, Color.B); + CString buffer; + buffer.Format(_T("%d,%d,%d"), (int)Color.R, (int)Color.G, (int)Color.B); pEdit->SetWindowText(buffer); } \ No newline at end of file diff --git a/code/ryzom/tools/leveldesign/georges_dll/dfn_dialog.cpp b/code/ryzom/tools/leveldesign/georges_dll/dfn_dialog.cpp index 3c12eb254..22c556faa 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/dfn_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/dfn_dialog.cpp @@ -96,7 +96,7 @@ BOOL CDfnDialog::OnInitDialog() setListSize (currentPos, SmallWidget, ParentHeight); Parents.create (WS_TABSTOP, currentPos, this, LtParents); - Parents.insertColumn (0, "Parent Dfn"); + Parents.insertColumn (0, _T("Parent Dfn")); Parents.Dialog = this; Parents.recalcColumn (); initWidget (Parents); @@ -111,11 +111,11 @@ BOOL CDfnDialog::OnInitDialog() setListSize (currentPos, Width, DfnHeight); Struct.create (WS_TABSTOP, currentPos, this, LtStruct); - Struct.insertColumn (0, "Name"); - Struct.insertColumn (1, "Type"); - Struct.insertColumn (2, "Value"); - Struct.insertColumn (3, "Default"); - Struct.insertColumn (4, "FilenameExt"); + Struct.insertColumn (0, _T("Name")); + Struct.insertColumn (1, _T("Type")); + Struct.insertColumn (2, _T("Value")); + Struct.insertColumn (3, _T("Default")); + Struct.insertColumn (4, _T("FilenameExt")); Struct.Dialog = this; Struct.recalcColumn (); initWidget (Struct); @@ -342,7 +342,7 @@ void CDfnEditListCtrl::getMemComboBoxProp (uint item, uint subItem, std::string if (subItem == 0) { browse = false; - regAdr = GEORGES_EDIT_BASE_REG_KEY"\\Label MemCombo"; + regAdr = tStrToUtf8(GEORGES_EDIT_BASE_REG_KEY _T("\\Label MemCombo")); } else if (subItem == 2) { @@ -351,19 +351,19 @@ void CDfnEditListCtrl::getMemComboBoxProp (uint item, uint subItem, std::string // Get type string string type = tStrToUtf8(ListCtrl.GetItemText (item, 1)); if ((type == "Type") || (type == "Type array")) - regAdr = GEORGES_EDIT_BASE_REG_KEY"\\Type MemCombo"; + regAdr = tStrToUtf8(GEORGES_EDIT_BASE_REG_KEY _T("\\Type MemCombo")); else if ((type == "Dfn") || (type == "Dfn array")) - regAdr = GEORGES_EDIT_BASE_REG_KEY"\\Dfn MemCombo"; + regAdr = tStrToUtf8(GEORGES_EDIT_BASE_REG_KEY _T("\\Dfn MemCombo")); } else if (subItem == 3) { browse = false; - regAdr = GEORGES_EDIT_BASE_REG_KEY"\\Default MemCombo"; + regAdr = tStrToUtf8(GEORGES_EDIT_BASE_REG_KEY _T("\\Default MemCombo")); } else if (subItem == 3) { browse = false; - regAdr = GEORGES_EDIT_BASE_REG_KEY"\\FilenameExt MemCombo"; + regAdr = tStrToUtf8(GEORGES_EDIT_BASE_REG_KEY _T("\\FilenameExt MemCombo")); } } @@ -609,7 +609,7 @@ CEditListCtrl::TItemEdit CDfnParentEditListCtrl::getItemEditMode (uint item, uin void CDfnParentEditListCtrl::getMemComboBoxProp (uint item, uint subItem, std::string ®Adr, bool &browse) { browse = true; - regAdr = GEORGES_EDIT_BASE_REG_KEY"\\Dfn MemCombo"; + regAdr = tStrToUtf8(GEORGES_EDIT_BASE_REG_KEY _T("\\Dfn MemCombo")); } // *************************************************************************** diff --git a/code/ryzom/tools/leveldesign/georges_dll/edit_list_ctrl.cpp b/code/ryzom/tools/leveldesign/georges_dll/edit_list_ctrl.cpp index aac663c1f..c3a722c6d 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/edit_list_ctrl.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/edit_list_ctrl.cpp @@ -45,7 +45,7 @@ bool CEditListCtrl::create (DWORD wStyle, RECT &rect, CWnd *parent, uint dialog_ LPCTSTR className = AfxRegisterWndClass( 0 ); // Create this window - if (CWnd::Create (className, "empty", WS_CHILD|wStyle, rect, parent, dialog_index)) + if (CWnd::Create (className, _T("empty"), WS_CHILD|wStyle, rect, parent, dialog_index)) { RECT subRect; subRect.left = 0; @@ -122,11 +122,11 @@ BOOL CEditListCtrl::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) // Insert an item at the end string text; getNewItemText (ListCtrl.GetItemCount (), 0, text); - ListCtrl.InsertItem (ListCtrl.GetItemCount (), text.c_str ()); + ListCtrl.InsertItem (ListCtrl.GetItemCount (), utf8ToTStr(text)); for (uint i=1; i0) { _ComboBox.GetLBText( i, value); - if (value == (const char*)str) + if (value == str) break; } } @@ -443,7 +443,7 @@ void CMemoryComboBox::refreshStrings () int count = Commands.size(); for (i=0; i Date: Tue, 29 Nov 2016 20:26:34 +0100 Subject: [PATCH 02/50] Changed: Use wide characters version of ShellExecute --HG-- branch : develop --- code/nel/src/gui/lua_ihm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/gui/lua_ihm.cpp b/code/nel/src/gui/lua_ihm.cpp index d55bda42d..b5950ab2e 100644 --- a/code/nel/src/gui/lua_ihm.cpp +++ b/code/nel/src/gui/lua_ihm.cpp @@ -107,11 +107,11 @@ namespace NLGUI { return NLMISC::CPath::lookup(fileName, false); } - static void shellExecute(const char *operation, const char *fileName, const char *parameters) + static void shellExecute(const std::string &operation, const std::string &fileName, const std::string ¶meters) { #if !FINAL_VERSION #ifdef NL_OS_WINDOWS - ShellExecute(NULL, operation, fileName, parameters, NULL, SW_SHOWDEFAULT); + ShellExecuteW(NULL, utf8ToWide(operation), utf8ToWide(fileName), utf8ToWide(parameters), NULL, SW_SHOWDEFAULT); #endif #endif } From 9f90b30699bd02d2609918e196603329cd9173cb Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 29 Nov 2016 20:28:19 +0100 Subject: [PATCH 03/50] Fixed: GCC warning "variable might be clobbered by longjmp" --HG-- branch : develop --- code/nel/src/misc/bitmap_png.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/code/nel/src/misc/bitmap_png.cpp b/code/nel/src/misc/bitmap_png.cpp index 459437f5c..251fd5495 100644 --- a/code/nel/src/misc/bitmap_png.cpp +++ b/code/nel/src/misc/bitmap_png.cpp @@ -91,7 +91,7 @@ uint8 CBitmap::readPNG( NLMISC::IStream &f ) // free all of the memory associated with the png_ptr and info_ptr png_destroy_read_struct(&png_ptr, &info_ptr, NULL); // if we get here, we had a problem reading the file - nlwarning("failed to setjump"); + nlwarning("Error while reading PNG"); return 0; } @@ -241,6 +241,21 @@ uint8 CBitmap::readPNG( NLMISC::IStream &f ) return imageDepth; } +// small helper to avoid local variables +static bool writePNGSetJmp(png_struct *png_ptr) +{ + if (setjmp(png_jmpbuf(png_ptr))) + { + // free all of the memory associated with the png_ptr + png_destroy_write_struct(&png_ptr, (png_info**)NULL); + // if we get here, we had a problem writing the file + nlwarning("Error while writing PNG"); + return false; + } + + return true; +} + /*-------------------------------------------------------------------*\ writePNG \*-------------------------------------------------------------------*/ @@ -274,12 +289,7 @@ bool CBitmap::writePNG( NLMISC::IStream &f, uint32 d) return false; } - if (setjmp(png_jmpbuf(png_ptr))) - { - png_destroy_write_struct( &png_ptr, (png_info**)NULL ); - nlwarning("couldn't set setjmp"); - return false; - } + if (!writePNGSetJmp(png_ptr)) return false; // set the write function png_set_write_fn(png_ptr, (void*)&f, writePNGData, NULL); From e941cff0ff6e44ef227f55663a4166c273585048 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 29 Nov 2016 20:32:33 +0100 Subject: [PATCH 04/50] Fixed: Strict aliasing warnings --HG-- branch : develop --- .../interface_expr_user_fct_game.cpp | 13 ++++-- .../ryzom/common/src/game_share/inventories.h | 11 +++-- .../src/game_share/persistent_data_inline.h | 40 +++++++++++-------- 3 files changed, 42 insertions(+), 22 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp b/code/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp index 5fe4cc569..ac75afc82 100644 --- a/code/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp +++ b/code/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp @@ -146,12 +146,19 @@ static DECLARE_INTERFACE_USER_FCT(getCompassText) return false; } + // helper + union C64BitsParts + { + sint64 i64; + double d; + }; + //get the direction // sint64 in the databae. - sint64 angleInt= args[0].getInteger(); + C64BitsParts angle; + angle.i64 = args[0].getInteger(); // cast as double now. - double angle= (double&)angleInt; - sint direction =(sint) floor( 0.5 + ( 8.0 * (angle + NLMISC::Pi)/(NLMISC::Pi) ) ); + sint direction =(sint) floor( 0.5 + ( 8.0 * (angle.d + NLMISC::Pi)/(NLMISC::Pi) ) ); direction = ((direction%16)+16)%16; static const string txts[]= { diff --git a/code/ryzom/common/src/game_share/inventories.h b/code/ryzom/common/src/game_share/inventories.h index 3d2bbae90..ef093bd2b 100644 --- a/code/ryzom/common/src/game_share/inventories.h +++ b/code/ryzom/common/src/game_share/inventories.h @@ -412,13 +412,18 @@ private: struct COneProp { - TItemPropId ItemPropId; + union + { + TItemPropId ItemPropId; + uint32 ItemPropIdUint32; + }; + sint32 ItemPropValue; void serial( NLMISC::CBitMemStream& bms ) { - bms.serial( (uint32&)ItemPropId, NbBitsForItemPropId ); - bms.serial( (uint32&)ItemPropValue, CItemSlot::DataBitSize[ItemPropId] ); + bms.serial((uint32&)ItemPropIdUint32, NbBitsForItemPropId); + bms.serial((uint32&)ItemPropValue, CItemSlot::DataBitSize[ItemPropId]); } }; diff --git a/code/ryzom/common/src/game_share/persistent_data_inline.h b/code/ryzom/common/src/game_share/persistent_data_inline.h index a2d575eef..9c7b46522 100644 --- a/code/ryzom/common/src/game_share/persistent_data_inline.h +++ b/code/ryzom/common/src/game_share/persistent_data_inline.h @@ -18,6 +18,20 @@ // inlines CPersistentDataRecord //----------------------------------------------------------------------------- +union C64BitParts +{ + struct + { + uint32 i32_1; + uint32 i32_2; + }; + + sint64 s64; + uint64 u64; + double d; + float f; +}; + inline void CPersistentDataRecord::addString(const std::string& name,uint16 &result) { // check whether the value of 'result' is already correct @@ -96,11 +110,8 @@ inline void CPersistentDataRecord::push(TToken token,sint32 val) inline void CPersistentDataRecord::push(TToken token,sint64 val) { // create a union for splitting the i64 value into 2 32bit parts and map the union onto the input value - struct C64BitParts - { - uint32 i32_1; - uint32 i32_2; - } &valueInBits= *(C64BitParts*)&val; + C64BitParts valueInBits; + valueInBits.s64 = val; // make sure the token is valid #ifdef NL_DEBUG @@ -153,11 +164,8 @@ inline void CPersistentDataRecord::push(TToken token,uint32 val) inline void CPersistentDataRecord::push(TToken token,uint64 val) { // create a union for splitting the i64 value into 2 32bit parts and map the union onto the input value - struct C64BitParts - { - uint32 i32_1; - uint32 i32_2; - } &valueInBits= *(C64BitParts*)&val; + C64BitParts valueInBits; + valueInBits.u64 = val; // make sure the token is valid #ifdef NL_DEBUG @@ -173,6 +181,9 @@ inline void CPersistentDataRecord::push(TToken token,uint64 val) inline void CPersistentDataRecord::push(TToken token,float val) { + C64BitParts valueInBits; + valueInBits.f = val; + // make sure the token is valid #ifdef NL_DEBUG BOMB_IF( ((token<<3)>>3)!= token, "Invalid token - Insufficient numeric precision", return); @@ -180,17 +191,14 @@ inline void CPersistentDataRecord::push(TToken token,float val) // store the token and value to the relavent data buffers _TokenTable.push_back((token<<3)+CArg::FLOAT_TOKEN); - _ArgTable.push_back(*(sint32*)&val); + _ArgTable.push_back(valueInBits.i32_1); } inline void CPersistentDataRecord::push(TToken token,double val) { // create a union for splitting the i64 value into 2 32bit parts and map the union onto the input value - struct C64BitParts - { - uint32 i32_1; - uint32 i32_2; - } &valueInBits= *(C64BitParts*)&val; + C64BitParts valueInBits; + valueInBits.d = val; // make sure the token is valid #ifdef NL_DEBUG From c13b007090c99fe6500eba2ceac1d88b81c25fb9 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 29 Nov 2016 20:34:35 +0100 Subject: [PATCH 05/50] Changed: Moved Ligo headers to include --HG-- branch : develop --- code/nel/{src => include/nel}/ligo/ligo_error.h | 0 code/nel/{src => include/nel}/ligo/zone_template.h | 0 code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp | 5 +++-- code/nel/tools/3d/ligo/plugin_max/script.cpp | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) rename code/nel/{src => include/nel}/ligo/ligo_error.h (100%) rename code/nel/{src => include/nel}/ligo/zone_template.h (100%) diff --git a/code/nel/src/ligo/ligo_error.h b/code/nel/include/nel/ligo/ligo_error.h similarity index 100% rename from code/nel/src/ligo/ligo_error.h rename to code/nel/include/nel/ligo/ligo_error.h diff --git a/code/nel/src/ligo/zone_template.h b/code/nel/include/nel/ligo/zone_template.h similarity index 100% rename from code/nel/src/ligo/zone_template.h rename to code/nel/include/nel/ligo/zone_template.h 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 052eb04a0..1abe022f8 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 @@ -33,9 +33,10 @@ #include "nel/misc/stream.h" // From ligo library -#include "nel/../../src/ligo/zone_template.h" +#include "nel/ligo/zone_template.h" #include "nel/ligo/ligo_config.h" -#include "nel/../../src/ligo/ligo_error.h" +#include "nel/ligo/ligo_error.h" +#include "nel/misc/path.h" using namespace std; using namespace NLMISC; diff --git a/code/nel/tools/3d/ligo/plugin_max/script.cpp b/code/nel/tools/3d/ligo/plugin_max/script.cpp index b494f69ff..077aa4054 100644 --- a/code/nel/tools/3d/ligo/plugin_max/script.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/script.cpp @@ -80,9 +80,9 @@ namespace std #include "nel/misc/config_file.h" // From ligo library -#include "nel/../../src/ligo/zone_template.h" +#include "nel/ligo/zone_template.h" #include "nel/ligo/ligo_config.h" -#include "nel/../../src/ligo/ligo_error.h" +#include "nel/ligo/ligo_error.h" #include "nel/../../src/ligo/ligo_material.h" #include "nel/../../src/ligo/transition.h" #include "nel/ligo/zone_bank.h" From 25a4d6bbed8473140cf6f774b2668fe0557f51b8 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 29 Nov 2016 20:43:55 +0100 Subject: [PATCH 06/50] Changed: Replace all path native functions by NeL methods --HG-- branch : develop --- .../tools/3d/ligo/plugin_max/max_to_ligo.cpp | 7 +- code/nel/tools/3d/ligo/plugin_max/script.cpp | 9 ++- .../tools/3d/object_viewer/object_viewer.cpp | 13 ++-- .../nel_export/nel_export_export.cpp | 65 +++++++------------ .../tools/3d/plugin_max/nel_export/std_afx.h | 1 + code/nel/tools/3d/tile_edit/Browse.cpp | 12 ++-- .../3d/tile_edit_qt/tile_browser_dlg.cpp | 5 +- .../zone_dependencies/zone_dependencies.cpp | 2 +- .../tools/georges/georges2csv/georges2csv.cpp | 2 +- .../georges_dll/georges_edit_doc.cpp | 2 +- .../tools/leveldesign/georges_dll/stdafx.h | 1 + .../tools/leveldesign/prim_export/main.cpp | 2 +- .../tools/stats_scan/character_scan_job.cpp | 4 +- 13 files changed, 50 insertions(+), 75 deletions(-) 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 1abe022f8..44b43beed 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 @@ -132,15 +132,12 @@ bool CMaxToLigo::loadLigoConfigFile (CLigoConfig& config, Interface& it, bool di if (res) { // Path - TCHAR sDrive[256]; - TCHAR sDir[256]; - _tsplitpath (sModulePath, sDrive, sDir, NULL, NULL); - _tmakepath (sModulePath, sDrive, sDir, _T("ligoscape"), _T(".cfg")); + std::string path = NLMISC::CFile::getPath(tStrToUtf8(sModulePath) + "ligoscape.cfg"); try { // Load the config file - config.readConfigFile (tStrToUtf8(sModulePath), false); + config.readConfigFile (path, false); // ok return true; diff --git a/code/nel/tools/3d/ligo/plugin_max/script.cpp b/code/nel/tools/3d/ligo/plugin_max/script.cpp index 077aa4054..effc3a2a2 100644 --- a/code/nel/tools/3d/ligo/plugin_max/script.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/script.cpp @@ -262,8 +262,8 @@ Value* export_material_cf (Value** arg_list, int count) // Remove the files if (!ok) { - remove (fileName); - remove (path); + CFile::deleteFile(fileName); + CFile::deleteFile(path); } } } @@ -549,7 +549,7 @@ Value* export_transition_cf (Value** arg_list, int count) for (uint file=0; fileenableUsedTextureMemorySum (); - char sModulePath[256]; // load the scheme bank if one is present CIFile iF; ::_makepath (sModulePath, SDrive, SDir, "default", ".scb"); @@ -831,8 +829,9 @@ bool CObjectViewer::initUI (HWND parent) iF.close(); // try to load a default config file for the viewer (for anitmation and particle edition setup) - ::_makepath (sModulePath, SDrive, SDir, "default", ".ovcgf"); - if (iF.open (sModulePath)) + path = SPath + "default.ovcgf"; + + if (iF.open (path)) { try { diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp index a5490dc2a..a41c3134c 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp @@ -36,17 +36,13 @@ bool CNelExport::exportMesh (const std::string &sPath, INode& node, TimeValue ti { // Result to return bool bRet = false; - TCHAR tempFileName[MAX_PATH] = { 0 }; - TCHAR tempPathBuffer[MAX_PATH] = { 0 }; + std::string tempFileName; + std::string tempPathBuffer; try { - DWORD dwRetVal = GetTempPath(MAX_PATH, tempPathBuffer); - if (dwRetVal > MAX_PATH || (dwRetVal == 0)) - nlerror("GetTempPath failed"); - UINT uRetVal = GetTempFileName(tempPathBuffer, _T("_nel_export_mesh_"), 0, tempFileName); - if (uRetVal == 0) - nlerror("GetTempFileName failed"); + tempPathBuffer = NLMISC::CPath::getTemporaryDirectory(); + NLMISC::CFile::getTemporaryOutputFilename(tempPathBuffer + "_nel_export_mesh_", tempFileName); // Eval the object a time ObjectState os = node.EvalWorldState(time); @@ -99,7 +95,7 @@ bool CNelExport::exportMesh (const std::string &sPath, INode& node, TimeValue ti { // Open a file COFile file; - if (file.open(tStrToUtf8(tempFileName))) + if (file.open(tempFileName)) { try { @@ -126,12 +122,13 @@ bool CNelExport::exportMesh (const std::string &sPath, INode& node, TimeValue ti { } - remove(tempFileName); + + CFile::deleteFile(tempFileName); } } else { - nlwarning("Failed to create file %s", tempFileName); + nlwarning("Failed to create file %s", tempFileName.c_str()); if (_TerminateOnFileOpenIssues) nelExportTerminateProcess(); } @@ -148,7 +145,7 @@ bool CNelExport::exportMesh (const std::string &sPath, INode& node, TimeValue ti catch (...) { nlwarning("Failed to delete pShape pointer! Something might be wrong."); - remove(tempFileName); + CFile::deleteFile(tempFileName); bRet = false; } @@ -173,7 +170,7 @@ bool CNelExport::exportMesh (const std::string &sPath, INode& node, TimeValue ti } else { - nlwarning("Failed to open file: %s", tempFileName); + nlwarning("Failed to open file: %s", tempFileName.c_str()); if (_TerminateOnFileOpenIssues) nelExportTerminateProcess(); } @@ -181,7 +178,7 @@ bool CNelExport::exportMesh (const std::string &sPath, INode& node, TimeValue ti catch (...) { nlwarning("Failed to verify shape. Must crash now."); - remove(tempFileName); + CFile::deleteFile(tempFileName); bRet = false; } @@ -196,16 +193,9 @@ bool CNelExport::exportMesh (const std::string &sPath, INode& node, TimeValue ti if (bRet) { - try - { - remove(sPath); - } - catch (...) - { - - } + CFile::deleteFile(sPath); CFile::moveFile(sPath, tempFileName); - nlinfo("MOVE %s -> %s", tempFileName, sPath); + nlinfo("MOVE %s -> %s", tempFileName.c_str(), sPath.c_str()); } return bRet; @@ -250,17 +240,13 @@ bool CNelExport::exportAnim (const std::string &sPath, std::vector& vect { // Result to return bool bRet=false; - char tempFileName[MAX_PATH] = { 0 }; - char tempPathBuffer[MAX_PATH] = { 0 }; + std::string tempFileName; + std::string tempPathBuffer; try { - DWORD dwRetVal = GetTempPathA(MAX_PATH, tempPathBuffer); - if (dwRetVal > MAX_PATH || (dwRetVal == 0)) - nlerror("GetTempPath failed"); - UINT uRetVal = GetTempFileNameA(tempPathBuffer, TEXT("_nel_export_mesh_"), 0, tempFileName); - if (uRetVal == 0) - nlerror("GetTempFileName failed"); + tempPathBuffer = NLMISC::CPath::getTemporaryDirectory(); + NLMISC::CFile::getTemporaryOutputFilename(tempPathBuffer + "_nel_export_mesh_", tempFileName); // Create an animation file CAnimation animFile; @@ -269,7 +255,7 @@ bool CNelExport::exportAnim (const std::string &sPath, std::vector& vect for (uint n=0; n& vect } else { - nlwarning("Failed to open file: %s", tempFileName); + nlwarning("Failed to open file: %s", tempFileName.c_str()); bRet = false; if (_TerminateOnFileOpenIssues) nelExportTerminateProcess(); @@ -336,7 +322,7 @@ bool CNelExport::exportAnim (const std::string &sPath, std::vector& vect catch (...) { nlwarning("Failed to verify shape. Must crash now."); - remove(tempFileName); + CFile::deleteFile(tempFileName); bRet = false; } } @@ -367,16 +353,9 @@ bool CNelExport::exportAnim (const std::string &sPath, std::vector& vect if (bRet) { - try - { - remove(sPath); - } - catch (...) - { - - } + CFile::deleteFile(sPath); CFile::moveFile(sPath, tempFileName); - nlinfo("MOVE %s -> %s", tempFileName, sPath); + nlinfo("MOVE %s -> %s", tempFileName.c_str(), sPath.c_str()); } return bRet; } 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 9b4b18357..ba7b4b4c0 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 @@ -71,5 +71,6 @@ namespace std #endif #include "nel/misc/bsphere.h" +#include "nel/misc/path.h" #endif diff --git a/code/nel/tools/3d/tile_edit/Browse.cpp b/code/nel/tools/3d/tile_edit/Browse.cpp index 9572ce0a4..89e45c62d 100644 --- a/code/nel/tools/3d/tile_edit/Browse.cpp +++ b/code/nel/tools/3d/tile_edit/Browse.cpp @@ -895,12 +895,12 @@ void Browse::OnBatchLoad () std::string ext = NLMISC::CFile::getExtension(fullPath); // look for some numbers.. - char *sNumber=sName+strlen(sName)-1; - while ((sNumber>sName)&&(*sNumber>='0')&&(*sNumber<='9')) + std::string::size_type pos = filename.find_last_not_of("0123456789"); + + if (pos != std::string::npos) { - sNumber--; + filename = filename.substr(0, pos + 1); } - sNumber[1]=0; bool rotate=false; @@ -1396,7 +1396,7 @@ void Browse::OnExportBorder() try { COFile file; - if (file.open ((const char*)pathName)) + if (file.open (tStrToUtf8(pathName))) { // Export bitmap.writeTGA (file, 32); @@ -1439,7 +1439,7 @@ void Browse::OnImportBorder() try { CIFile file; - if (file.open ((const char*)pathName)) + if (file.open (tStrToUtf8(pathName))) { // Export bitmap.load (file); diff --git a/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp b/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp index 2d1ca4cbe..a6ca57fd3 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp +++ b/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp @@ -434,7 +434,7 @@ void CTile_browser_dlg::on_batchLoadPushButton_clicked() QString batchNumber = transitionNumber.rightJustified(2, '0'); QString nextBaseName = baseName + batchNumber; QString nextFileName = QDir::toNativeSeparators(fi.absolutePath()) + QDir::separator() + nextBaseName + QString(".") + fi.suffix(); - FILE *pFile=fopen (nextFileName.toUtf8().constData(), "rb"); + FILE *pFile = nlfopen (nextFileName.toUtf8().constData(), "rb"); // Close the file and add the tile if opened if (pFile) @@ -471,8 +471,7 @@ void CTile_browser_dlg::on_batchLoadPushButton_clicked() // char sName2[256]; // char sFinal[256]; // sprintf (sName2, "%s%02d", sName, (int)transition); - // _makepath (sFinal, sDrive, sPath, sName2, sExt); - // FILE *pFile=fopen (sFinal, "rb"); + // FILE *pFile = nlfopen (sFinal, "rb"); // // Close the file and add the tile if opened // if (pFile) diff --git a/code/nel/tools/3d/zone_dependencies/zone_dependencies.cpp b/code/nel/tools/3d/zone_dependencies/zone_dependencies.cpp index b109c2db2..846902cde 100644 --- a/code/nel/tools/3d/zone_dependencies/zone_dependencies.cpp +++ b/code/nel/tools/3d/zone_dependencies/zone_dependencies.cpp @@ -522,7 +522,7 @@ int main (int argc, char* argv[]) // Write the dependencies file FILE *outputFile; - if ((outputFile=fopen (toLower (outputFileName).c_str(), "w"))) + if ((outputFile = nlfopen (toLower (outputFileName), "w"))) { // Add a dependency entry fprintf (outputFile, "dependencies =\n{\n"); diff --git a/code/nel/tools/georges/georges2csv/georges2csv.cpp b/code/nel/tools/georges/georges2csv/georges2csv.cpp index 29fb393c9..131e5961c 100644 --- a/code/nel/tools/georges/georges2csv/georges2csv.cpp +++ b/code/nel/tools/georges/georges2csv/georges2csv.cpp @@ -179,7 +179,7 @@ void setOutputFile(const CSString &filename) { if (Outf!=NULL) fclose(Outf); - Outf=fopen(filename.c_str(), "wt"); + Outf = nlfopen(filename.c_str(), "wt"); if (Outf == NULL) { fprintf(stderr, "Can't open output file '%s' ! aborting.", filename.c_str()); diff --git a/code/ryzom/tools/leveldesign/georges_dll/georges_edit_doc.cpp b/code/ryzom/tools/leveldesign/georges_dll/georges_edit_doc.cpp index 213ea3171..ec5a64010 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/georges_edit_doc.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/georges_edit_doc.cpp @@ -548,7 +548,7 @@ BOOL CGeorgesEditDoc::OnOpenDocument(LPCTSTR lpszPathName) if (!extLower.empty ()) { - string dfnName = extLower.substr (1, string::npos) + ".dfn"; + string dfnName = extLower + ".dfn"; // Check if the file is handled if (theApp.getFormDocTemplate (dfnName.c_str ()) == NULL) diff --git a/code/ryzom/tools/leveldesign/georges_dll/stdafx.h b/code/ryzom/tools/leveldesign/georges_dll/stdafx.h index 3ed671a13..91a0d1f9a 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/stdafx.h +++ b/code/ryzom/tools/leveldesign/georges_dll/stdafx.h @@ -48,6 +48,7 @@ #include "nel/misc/types_nl.h" #include "nel/misc/debug.h" #include "nel/misc/common.h" +#include "nel/misc/path.h" // Include from libxml2 #include diff --git a/code/ryzom/tools/leveldesign/prim_export/main.cpp b/code/ryzom/tools/leveldesign/prim_export/main.cpp index f9c33d953..be875b350 100644 --- a/code/ryzom/tools/leveldesign/prim_export/main.cpp +++ b/code/ryzom/tools/leveldesign/prim_export/main.cpp @@ -1115,7 +1115,7 @@ int main (int argc, char**argv) outString ("REMOVE " + CFile::getFilename (igFilename) + " \n"); // Remove it - if (remove (igFilename.c_str ()) != 0) + if (!CFile::deleteFile(igFilename)) { // Error in the log nlwarning ("Error : Can't remove the file (%s)", igFilename.c_str ()); diff --git a/code/ryzom/tools/stats_scan/character_scan_job.cpp b/code/ryzom/tools/stats_scan/character_scan_job.cpp index 4ee45f037..47593ba81 100644 --- a/code/ryzom/tools/stats_scan/character_scan_job.cpp +++ b/code/ryzom/tools/stats_scan/character_scan_job.cpp @@ -52,7 +52,7 @@ CCharacterScanJob::CCharacterScanJob() // open the output file for the character table std::string filename= "char_tbl.csv"; - _CharTblFile=fopen(filename.c_str(),"wb"); + _CharTblFile = nlfopen(filename, "wb"); if (_CharTblFile==NULL) { nlwarning("Failed to open output file: %s",filename.c_str()); @@ -73,7 +73,7 @@ CCharacterScanJob::~CCharacterScanJob() { // create the output file name and open the file for writing std::string filename="char_stats_"+(*it).first+".csv"; - FILE* f=fopen(filename.c_str(),"wb"); + FILE* f = nlfopen(filename, "wb"); if (f==NULL) { nlwarning("Failed to open output file: %s",filename.c_str()); From fa8c29b60b4499e0a32ba5405b0ec4770583ee7a Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 29 Nov 2016 20:46:49 +0100 Subject: [PATCH 07/50] Changed: Constification of catches --HG-- branch : develop --- code/nel/tools/3d/ligo/plugin_max/script.cpp | 2 +- code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp | 2 +- code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/nel/tools/3d/ligo/plugin_max/script.cpp b/code/nel/tools/3d/ligo/plugin_max/script.cpp index effc3a2a2..36d5ff109 100644 --- a/code/nel/tools/3d/ligo/plugin_max/script.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/script.cpp @@ -250,7 +250,7 @@ Value* export_material_cf (Value** arg_list, int count) ok = false; } } - catch (Exception &e) + catch (const Exception &e) { // Error message char tmp[512]; diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp index 21d63b626..863b1b89b 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp @@ -2128,7 +2128,7 @@ void appendLightmapLog (COFile &outputLog, const char *lightmapName, const vecto outputLog.serialBuffer ((uint8*)text.c_str(), text.size()); } - catch (exception &e) + catch (const exception &e) { nlwarning ("Error writing the file : %s", e.what()); } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp index 5d9caef86..2fb18cd9f 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp @@ -458,7 +458,7 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector& vectNode, v delete ss.getShapePointer(); ss.setShapePointer(NULL); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { nlwarning(e.what()); } From 5988d7ea820038d59d5f5b200fa4535d66a1d437 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 29 Nov 2016 20:47:33 +0100 Subject: [PATCH 08/50] Changed: Support PNG for Snapshot Tool --HG-- branch : develop --- .../3d/object_viewer/snapshot_tool_dlg.cpp | 34 +++++++++++++------ .../3d/object_viewer/snapshot_tool_dlg.h | 7 ++-- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp b/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp index 8cbb869de..89830cd5b 100644 --- a/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp @@ -224,15 +224,6 @@ void CSnapshotToolDlg::toRegistry() RegSetValueEx(hKey, _T("Filters"), 0, REG_SZ, (BYTE*) (LPCTSTR) filters, filters.GetLength() + 1); DWORD recurseSubFolder = m_RecurseSubFolder; DWORD dumpTextureSets = m_DumpTextureSets; - DWORD views [] = - { - m_ViewBack, - m_ViewBottom, - m_ViewFront, - m_ViewLeft, - m_ViewRight, - m_ViewTop - }; DWORD width = (DWORD) m_OutputWidth; DWORD height = (DWORD) m_OutputHeight; DWORD format = m_Format; @@ -710,7 +701,25 @@ void CSnapshotToolDlg::OnTimer(UINT_PTR nIDEvent) { outputFilename += "_" + viewToString(viewIndex); } - outputFilename += (m_Format == OutputFormat_Tga ? ".tga" : ".jpg"); + + std::string ext; + switch (m_Format) + { + case OutputFormat_Tga: + ext = "tga"; + break; + case OutputFormat_Png: + ext = "png"; + break; + case OutputFormat_Jpg: + ext = "jpg"; + break; + default: + nlerror("Unsupported format %d", m_Format); + break; + } + outputFilename += "." + ext; + switch(m_OutputPathOption) { case OutputPath_Custom: // custom output path @@ -724,10 +733,15 @@ void CSnapshotToolDlg::OnTimer(UINT_PTR nIDEvent) break; } COFile output(outputFilename); + if (m_Format == OutputFormat_Tga) { snapshot.writeTGA(output); } + else if (m_Format == OutputFormat_Png) + { + snapshot.writePNG(output); + } else { snapshot.writeJPG(output); diff --git a/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.h b/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.h index 72df1dea5..a9b1d476a 100644 --- a/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.h +++ b/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.h @@ -42,20 +42,21 @@ public: enum { - OutputFormat_Tga = 0, + OutputFormat_Tga, + OutputFormat_Png, OutputFormat_Jpg }; enum { - OutputPath_Custom = 0, + OutputPath_Custom, OutputPath_SameAsInput, OutputPath_CurrShapeDirectory, }; enum { - SnapshotAngle_Front = 0, + SnapshotAngle_Front, SnapshotAngle_Right, SnapshotAngle_Left, SnapshotAngle_Top, From 1e97c4f6f134121dc97eda9c6020d85b830a6f7d Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 29 Nov 2016 20:51:53 +0100 Subject: [PATCH 09/50] Changed: Use _T macro, TCHAR, tStrToUtf8/utf8ToTStr, etc... to support UNICODE --HG-- branch : develop --- .../3d/plugin_max/nel_export/nel_export.cpp | 205 ++++++++---------- .../plugin_max/nel_patch_edit/np_gui_bind.cpp | 11 +- 2 files changed, 101 insertions(+), 115 deletions(-) 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 71bc61d0e..74c6566f7 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 @@ -42,15 +42,15 @@ CExportNelOptions theExportSceneStruct; CNelExportClassDesc CNelExportDesc; ClassDesc2* GetCNelExportDesc() {return &CNelExportDesc;} -static const char *zoneFilter="NeL zone file (*.zone)\0*.zone\0All files (*.*)\0*.*\0"; -static const char *meshFilter="NeL shape file (*.shape)\0*.shape\0All files (*.*)\0*.*\0"; -static const char *collisionFilter="NeL collision file (*.cmb)\0*.cmb\0All files (*.*)\0*.*\0"; -static const char *animModelFilter="NeL model animation file (*.anim)\0*.anim\0All files (*.*)\0*.*\0"; -static const char *SWTFilter="NeL Skeleton Weight Template file (*.swt)\0*.swt\0All files (*.*)\0*.*\0"; -static const char *InstanceGroupFilter="NeL Instance Group file (*.ig)\0*.ig\0All files (*.*)\0*.*\0"; -static const char *skeletonFilter="NeL Skeleton file (*.skel)\0*.skel\0All files (*.*)\0*.*\0"; -static const char *vegetableFilter="NeL Vegetable file (*.veget)\0*.veget\0All files (*.*)\0*.*\0"; -static const char *lodCharacterFilter="NeL LodCharacter file (*.clod)\0*.clod\0All files (*.*)\0*.*\0"; +static const TCHAR *zoneFilter = _T("NeL zone file (*.zone)\0*.zone\0All files (*.*)\0*.*\0"); +static const TCHAR *meshFilter = _T("NeL shape file (*.shape)\0*.shape\0All files (*.*)\0*.*\0"); +static const TCHAR *collisionFilter = _T("NeL collision file (*.cmb)\0*.cmb\0All files (*.*)\0*.*\0"); +static const TCHAR *animModelFilter = _T("NeL model animation file (*.anim)\0*.anim\0All files (*.*)\0*.*\0"); +static const TCHAR *SWTFilter = _T("NeL Skeleton Weight Template file (*.swt)\0*.swt\0All files (*.*)\0*.*\0"); +static const TCHAR *InstanceGroupFilter = _T("NeL Instance Group file (*.ig)\0*.ig\0All files (*.*)\0*.*\0"); +static const TCHAR *skeletonFilter = _T("NeL Skeleton file (*.skel)\0*.skel\0All files (*.*)\0*.*\0"); +static const TCHAR *vegetableFilter = _T("NeL Vegetable file (*.veget)\0*.veget\0All files (*.*)\0*.*\0"); +static const TCHAR *lodCharacterFilter = _T("NeL LodCharacter file (*.clod)\0*.clod\0All files (*.*)\0*.*\0"); void *CNelExportClassDesc::Create(BOOL loading) @@ -70,7 +70,6 @@ INT_PTR CALLBACK OptionsDialogCallback ( { case WM_INITDIALOG: { - char tmp[1024]; CenterWindow( hwndDlg, theCNelExport._Ip->GetMAXHWnd() ); ShowWindow( hwndDlg, TRUE ); // Initialize from theExportSceneStruct @@ -90,13 +89,16 @@ INT_PTR CALLBACK OptionsDialogCallback ( SendMessage( GetDlgItem(hwndDlg,IDC_SHADOW), BM_SETCHECK, BST_CHECKED, 0 ); else SendMessage( GetDlgItem(hwndDlg,IDC_SHADOW), BM_SETCHECK, BST_UNCHECKED, 0 ); - SendMessage( GetDlgItem(hwndDlg,IDC_EDITEXPORTLIGHTING), WM_SETTEXT, 0, (long)theExportSceneStruct.sExportLighting.c_str() ); + + SendMessage( GetDlgItem(hwndDlg,IDC_EDITEXPORTLIGHTING), WM_SETTEXT, 0, (LPARAM)utf8ToTStr(theExportSceneStruct.sExportLighting)); + if( theExportSceneStruct.nExportLighting == 0 ) SendMessage( GetDlgItem(hwndDlg,IDC_RADIONORMALEXPORTLIGHTING), BM_SETCHECK, BST_CHECKED, 0 ); if( theExportSceneStruct.nExportLighting == 1 ) SendMessage( GetDlgItem(hwndDlg,IDC_RADIORADIOSITYEXPORTLIGHTING), BM_SETCHECK, BST_CHECKED, 0 ); - sprintf( tmp, "%f", theExportSceneStruct.rLumelSize ); - SendMessage( GetDlgItem(hwndDlg,IDC_EDITLUMELSIZE), WM_SETTEXT, 0, (long)tmp ); + + SendMessage( GetDlgItem(hwndDlg,IDC_EDITLUMELSIZE), WM_SETTEXT, 0, (LPARAM)utf8ToTStr(toString(theExportSceneStruct.rLumelSize))); + if( theExportSceneStruct.nOverSampling == 1 ) SendMessage( GetDlgItem(hwndDlg,IDC_RADIOSS1), BM_SETCHECK, BST_CHECKED, 0 ); if( theExportSceneStruct.nOverSampling == 2 ) @@ -120,10 +122,9 @@ INT_PTR CALLBACK OptionsDialogCallback ( SendMessage( GetDlgItem(hwndDlg,IDC_TEST_SURFACE_LIGHT), BM_SETCHECK, BST_CHECKED, 0 ); else SendMessage( GetDlgItem(hwndDlg,IDC_TEST_SURFACE_LIGHT), BM_SETCHECK, BST_UNCHECKED, 0 ); - sprintf( tmp, "%f", theExportSceneStruct.SurfaceLightingCellSize ); - SendMessage( GetDlgItem(hwndDlg,IDC_EDITCELLSIZE), WM_SETTEXT, 0, (long)tmp ); - sprintf( tmp, "%f", theExportSceneStruct.SurfaceLightingDeltaZ ); - SendMessage( GetDlgItem(hwndDlg,IDC_EDITCELLDELTAZ), WM_SETTEXT, 0, (long)tmp ); + + SendMessage( GetDlgItem(hwndDlg,IDC_EDITCELLSIZE), WM_SETTEXT, 0, (LPARAM)utf8ToTStr(toString(theExportSceneStruct.SurfaceLightingCellSize))); + SendMessage( GetDlgItem(hwndDlg,IDC_EDITCELLDELTAZ), WM_SETTEXT, 0, (LPARAM)utf8ToTStr(toString(theExportSceneStruct.SurfaceLightingDeltaZ))); } break; @@ -134,12 +135,11 @@ INT_PTR CALLBACK OptionsDialogCallback ( { case IDC_BUTTONEXPORTLIGHTING: { - char sTemp[1024]; - strcpy(sTemp,theExportSceneStruct.sExportLighting.c_str()); - if( theCNelExport.SelectDir(hwndDlg, "LightMaps Directory", sTemp ) ) + std::string sTemp = theExportSceneStruct.sExportLighting; + if( theCNelExport.SelectDir(hwndDlg, _T("LightMaps Directory"), sTemp ) ) { theExportSceneStruct.sExportLighting = sTemp; - SendMessage( GetDlgItem(hwndDlg,IDC_EDITEXPORTLIGHTING), WM_SETTEXT, 0, (long)theExportSceneStruct.sExportLighting.c_str() ); + SendMessage( GetDlgItem(hwndDlg, IDC_EDITEXPORTLIGHTING), WM_SETTEXT, 0, (LPARAM)utf8ToTStr(theExportSceneStruct.sExportLighting) ); } } break; @@ -148,7 +148,6 @@ INT_PTR CALLBACK OptionsDialogCallback ( break; case IDOK: { - char tmp[1024]; // The result goes in theExportSceneStruct if( SendMessage( GetDlgItem(hwndDlg,IDC_EXCLUDE), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.bExcludeNonSelected = true; @@ -166,14 +165,18 @@ INT_PTR CALLBACK OptionsDialogCallback ( theExportSceneStruct.OutputLightmapLog = true; else theExportSceneStruct.OutputLightmapLog = false; - SendMessage( GetDlgItem(hwndDlg,IDC_EDITEXPORTLIGHTING), WM_GETTEXT, 1024, (long)tmp ); - theExportSceneStruct.sExportLighting = tmp; + + TCHAR tmp[1024]; + SendMessage( GetDlgItem(hwndDlg,IDC_EDITEXPORTLIGHTING), WM_GETTEXT, 1024, (LPARAM)tmp ); + theExportSceneStruct.sExportLighting = tStrToUtf8(tmp); + if( SendMessage( GetDlgItem(hwndDlg,IDC_RADIONORMALEXPORTLIGHTING), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.nExportLighting = 0; if( SendMessage( GetDlgItem(hwndDlg,IDC_RADIORADIOSITYEXPORTLIGHTING), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.nExportLighting = 1; - SendMessage( GetDlgItem(hwndDlg,IDC_EDITLUMELSIZE), WM_GETTEXT, 1024, (long)tmp ); - NLMISC::fromString(tmp, theExportSceneStruct.rLumelSize); + + SendMessage( GetDlgItem(hwndDlg,IDC_EDITLUMELSIZE), WM_GETTEXT, 1024, (LPARAM)tmp ); + NLMISC::fromString(tStrToUtf8(tmp), theExportSceneStruct.rLumelSize); if( SendMessage( GetDlgItem(hwndDlg,IDC_RADIOSS1), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.nOverSampling = 1; @@ -191,10 +194,12 @@ INT_PTR CALLBACK OptionsDialogCallback ( // SurfaceLighting theExportSceneStruct.bTestSurfaceLighting= (SendMessage( GetDlgItem(hwndDlg,IDC_TEST_SURFACE_LIGHT), BM_GETCHECK, 0, 0 ) == BST_CHECKED); - SendMessage( GetDlgItem(hwndDlg,IDC_EDITCELLSIZE), WM_GETTEXT, 1024, (long)tmp ); - NLMISC::fromString(tmp, theExportSceneStruct.SurfaceLightingCellSize); - SendMessage( GetDlgItem(hwndDlg,IDC_EDITCELLDELTAZ), WM_GETTEXT, 1024, (long)tmp ); - NLMISC::fromString(tmp, theExportSceneStruct.SurfaceLightingDeltaZ); + + SendMessage( GetDlgItem(hwndDlg,IDC_EDITCELLSIZE), WM_GETTEXT, 1024, (LPARAM)tmp ); + NLMISC::fromString(tStrToUtf8(tmp), theExportSceneStruct.SurfaceLightingCellSize); + + SendMessage( GetDlgItem(hwndDlg,IDC_EDITCELLDELTAZ), WM_GETTEXT, 1024, (LPARAM)tmp ); + NLMISC::fromString(tStrToUtf8(tmp), theExportSceneStruct.SurfaceLightingDeltaZ); // End the dialog EndDialog(hwndDlg, TRUE); @@ -234,7 +239,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP if (hModule) { // Get module file name - char moduldeFileName[512]; + TCHAR moduldeFileName[512]; if (GetModuleFileName (hModule, moduldeFileName, 512)) { // Get version info size @@ -250,41 +255,41 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP { uint *versionTab; uint versionSize; - if (VerQueryValue (buffer, "\\", (void**)&versionTab, &versionSize)) + if (VerQueryValue (buffer, _T("\\"), (void**)&versionTab, &versionSize)) { // Get the pointer on the structure VS_FIXEDFILEINFO *info=(VS_FIXEDFILEINFO*)versionTab; if (info) { // Setup version number - char version[512]; - sprintf (version, "Version %d.%d.%d.%d", - info->dwFileVersionMS>>16, - info->dwFileVersionMS&0xffff, - info->dwFileVersionLS>>16, + TCHAR version[512]; + _stprintf(version, _T("Version %d.%d.%d.%d"), + info->dwFileVersionMS>>16, + info->dwFileVersionMS&0xffff, + info->dwFileVersionLS>>16, info->dwFileVersionLS&0xffff); SetWindowText (GetDlgItem (hWnd, IDC_VERSION), version); } else - SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "VS_FIXEDFILEINFO * is NULL"); + SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("VS_FIXEDFILEINFO * is NULL")); } else - SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "VerQueryValue failed"); + SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("VerQueryValue failed")); } else - SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "GetFileVersionInfo failed"); + SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("GetFileVersionInfo failed")); // Free the buffer delete [] buffer; } else - SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "GetFileVersionInfoSize failed"); + SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("GetFileVersionInfoSize failed")); } else - SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "GetModuleFileName failed"); + SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("GetModuleFileName failed")); } else - SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "hInstance NULL"); + SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("hInstance NULL")); } break; @@ -324,15 +329,14 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP nlwarning("pNode->GetName()"); // Name of the node - char sNodeMsg[256]; - nlwarning (sNodeMsg, "Save %s model...", tStrToUtf8(pNode->GetName()).c_str()); + TCHAR sNodeMsg[256]; + _stprintf(sNodeMsg, _T("Save %s model..."), pNode->GetName()); // It is a zone ? if (RPO::isZone (*pNode, time)) { // Save path - char sSavePath[256]; - strcpy (sSavePath, tStrToUtf8(pNode->GetName()).c_str()); + std::string sSavePath = tStrToUtf8(pNode->GetName()); // Choose a file to export if (!CExportNel::getScriptAppData (pNode, NEL3D_APPDATA_DONTEXPORT, 0)) @@ -342,7 +346,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP if (!theCNelExport.exportZone (sSavePath, *pNode, time)) { // Error message - std::string sErrorMsg = toString("Error exporting the zone %s in the file\n%s", tStrToUtf8(pNode->GetName()).c_str(), sSavePath); + std::string sErrorMsg = toString("Error exporting the zone %s in the file\n%s", tStrToUtf8(pNode->GetName()).c_str(), sSavePath.c_str()); MessageBox (hWnd, utf8ToTStr(sErrorMsg), L"NeL export", MB_OK|MB_ICONEXCLAMATION); } } @@ -354,15 +358,14 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP // Choose a file to export if (!CExportNel::getScriptAppData (pNode, NEL3D_APPDATA_DONTEXPORT, 0)) - if (theCNelExport.SelectFileForSave(hWnd, sNodeMsg, vegetableFilter, sSavePath.c_str())) + if (theCNelExport.SelectFileForSave(hWnd, sNodeMsg, vegetableFilter, sSavePath)) { // Export the mesh if (!theCNelExport.exportVegetable (sSavePath.c_str(), *pNode, time)) { // Error message - char sErrorMsg[512]; - sprintf (sErrorMsg, "Error exporting the vegetable %s in the file\n%s", pNode->GetName(), sSavePath); - MessageBox (hWnd, sErrorMsg, _T("NeL export"), MB_OK|MB_ICONEXCLAMATION); + std::string sErrorMsg = toString("Error exporting the vegetable %s in the file\n%s", tStrToUtf8(pNode->GetName()).c_str(), sSavePath.c_str()); + MessageBox (hWnd, utf8ToTStr(sErrorMsg), _T("NeL export"), MB_OK|MB_ICONEXCLAMATION); } } } @@ -370,8 +373,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP else if (CExportNel::isLodCharacter (*pNode, time)) { // Save path - char sSavePath[256]; - strcpy (sSavePath, pNode->GetName()); + std::string sSavePath = tStrToUtf8(pNode->GetName()); // Choose a file to export if (!CExportNel::getScriptAppData (pNode, NEL3D_APPDATA_DONTEXPORT, 0)) @@ -381,9 +383,8 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP if (!theCNelExport.exportLodCharacter (sSavePath, *pNode, time)) { // Error message - char sErrorMsg[512]; - sprintf (sErrorMsg, "Error exporting the lod character %s in the file\n%s", pNode->GetName(), sSavePath); - MessageBox (hWnd, sErrorMsg, "NeL export", MB_OK|MB_ICONEXCLAMATION); + std::string sErrorMsg = toString("Error exporting the lod character %s in the file\n%s", tStrToUtf8(pNode->GetName()).c_str(), sSavePath.c_str()); + MessageBox (hWnd, utf8ToTStr(sErrorMsg), _T("NeL export"), MB_OK|MB_ICONEXCLAMATION); } } } @@ -391,8 +392,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP else if (CExportNel::isMesh (*pNode, time)) { // Save path - char sSavePath[256]; - strcpy (sSavePath, pNode->GetName()); + std::string sSavePath = tStrToUtf8(pNode->GetName()); // Choose a file to export if (!CExportNel::getScriptAppData (pNode, NEL3D_APPDATA_DONTEXPORT, 0)) @@ -406,9 +406,8 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP if (!theCNelExport.exportMesh (sSavePath, *pNode, time)) { // Error message - char sErrorMsg[512]; - sprintf (sErrorMsg, "Error exporting the mesh %s in the file\n%s", pNode->GetName(), sSavePath); - MessageBox (hWnd, sErrorMsg, "NeL export", MB_OK|MB_ICONEXCLAMATION); + std::string sErrorMsg = toString("Error exporting the mesh %s in the file\n%s", tStrToUtf8(pNode->GetName()).c_str(), sSavePath.c_str()); + MessageBox (hWnd, utf8ToTStr(sErrorMsg), _T("NeL export"), MB_OK|MB_ICONEXCLAMATION); } // Delete the skeleton pointer if (pSkinShape) @@ -444,24 +443,20 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP nlassert (vectNode.size()!=0); // Name of the node - char sNodeMsg[256]; - sprintf (sNodeMsg, "Save animations..."); // Save path - char sSavePath[256]; - strcpy (sSavePath, (*vectNode.begin())->GetName()); + std::string sSavePath = tStrToUtf8((*vectNode.begin())->GetName()); // Choose a file to export - if (theCNelExport.SelectFileForSave (hWnd, sNodeMsg, (LOWORD(wParam)==ID_SAVE_MODEL_ANIM)?animModelFilter:animModelFilter, + if (theCNelExport.SelectFileForSave (hWnd, _T("Save animations..."), (LOWORD(wParam)==ID_SAVE_MODEL_ANIM)?animModelFilter:animModelFilter, sSavePath)) { // Export the zone if (!theCNelExport.exportAnim (sSavePath, vectNode, time, LOWORD(wParam)==ID_SAVE_SCENE_ANIM)) { // Error message - char sErrorMsg[512]; - sprintf (sErrorMsg, "Error exporting animation %s in the file\n%s", (*vectNode.begin())->GetName(), sSavePath); - MessageBox (hWnd, sErrorMsg, "NeL export", MB_OK|MB_ICONEXCLAMATION); + std::string sErrorMsg = toString("Error exporting animation %s in the file\n%s", tStrToUtf8((*vectNode.begin())->GetName()).c_str(), sSavePath.c_str()); + MessageBox(hWnd, utf8ToTStr(sErrorMsg), _T("NeL export"), MB_OK | MB_ICONEXCLAMATION); } } } @@ -503,23 +498,20 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP } // Name of the node - char sNodeMsg[256]; - sprintf (sNodeMsg, "Save collision mesh build..."); // Save path - char sSavePath[256]; - strcpy (sSavePath, ""); + std::string sSavePath; // Choose a file to export // ULONG SelectDir(HWND Parent, char* Title, char* Path); // if (theCNelExport.SelectFileForSave(hWnd, sNodeMsg, collisionFilter, sSavePath)) - if (theCNelExport.SelectDir(hWnd, sNodeMsg, sSavePath)) + if (theCNelExport.SelectDir(hWnd, _T("Save collision mesh build..."), sSavePath)) { // Export the mesh if (!theCNelExport.exportCollision (sSavePath, nodes, time)) { // Error message - MessageBox (hWnd, "Error during export collision", "NeL export", MB_OK|MB_ICONEXCLAMATION); + MessageBox (hWnd, _T("Error during export collision"), _T("NeL export"), MB_OK|MB_ICONEXCLAMATION); } } @@ -555,22 +547,17 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP theCNelExport.getSelectedNode (vectNode); nlassert (vectNode.size()!=0); - char sDialogMsg[256]; - sprintf (sDialogMsg, "Save SWT..."); - // Save path - char sSavePath[256]; - strcpy (sSavePath, (*vectNode.begin())->GetName()); + std::string sSavePath = tStrToUtf8((*vectNode.begin())->GetName()); - if (theCNelExport.SelectFileForSave (hWnd, sDialogMsg, SWTFilter, sSavePath)) + if (theCNelExport.SelectFileForSave (hWnd, _T("Save SWT..."), SWTFilter, sSavePath)) { // Export the swt if (!theCNelExport.exportSWT (sSavePath, vectNode)) { // Error message - char sErrorMsg[512]; - sprintf (sErrorMsg, "Error exporting SWT %s in the file\n%s", (*vectNode.begin())->GetName(), sSavePath); - MessageBox (hWnd, sErrorMsg, "NeL export", MB_OK|MB_ICONEXCLAMATION); + std::string sErrorMsg = toString("Error exporting SWT %s in the file\n%s", tStrToUtf8((*vectNode.begin())->GetName()).c_str(), sSavePath.c_str()); + MessageBox(hWnd, utf8ToTStr(sErrorMsg), _T("NeL export"), MB_OK | MB_ICONEXCLAMATION); } } } @@ -582,10 +569,8 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP // Init the exporter nlassert (theIP); theCNelExport.init (false, true, theIP, true); - - char sConfigFileName[512]; - strcpy( sConfigFileName, theCNelExport._Ip->GetDir(APP_PLUGCFG_DIR) ); - strcat( sConfigFileName, "\\NelExportScene.cfg" ); + + std::string sConfigFileName = tStrToUtf8(theCNelExport._Ip->GetDir(APP_PLUGCFG_DIR)) + "\\NelExportScene.cfg"; // Do a modal dialog box to choose the scene export options if( DialogBox( hInstance, @@ -644,18 +629,16 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP theCNelExport.getSelectedNode (vectNode); nlassert (vectNode.size()!=0); - char sSavePath[256]; - strcpy (sSavePath, (*vectNode.begin())->GetName()); + std::string sSavePath = tStrToUtf8((*vectNode.begin())->GetName()); - if (theCNelExport.SelectFileForSave (hWnd, "Save Instance group", InstanceGroupFilter, sSavePath)) + if (theCNelExport.SelectFileForSave (hWnd, _T("Save Instance group"), InstanceGroupFilter, sSavePath)) { // Export the instance group if (!theCNelExport.exportInstanceGroup( sSavePath, vectNode)) { // Error message - char sErrorMsg[512]; - sprintf (sErrorMsg, "Error exporting instance group %s", sSavePath); - MessageBox (hWnd, sErrorMsg, "NeL export", MB_OK|MB_ICONEXCLAMATION); + std::string sErrorMsg = toString("Error exporting instance group %s", sSavePath.c_str()); + MessageBox(hWnd, utf8ToTStr(sErrorMsg), _T("NeL export"), MB_OK | MB_ICONEXCLAMATION); } } } @@ -672,7 +655,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP if (nNumSelNode!=1) { // Select only the root of the skeleton - MessageBox (hWnd, "Select the root node of the skeleton.", "NeL export", MB_OK|MB_ICONEXCLAMATION); + MessageBox (hWnd, _T("Select the root node of the skeleton."), _T("NeL export"), MB_OK|MB_ICONEXCLAMATION); } else { @@ -680,19 +663,17 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP INode* pNode=theCNelExport._Ip->GetSelNode (0); // Save path - char sSavePath[256]; - strcpy (sSavePath, "*.skel"); + std::string sSavePath = "*.skel"; // Select the file - if (theCNelExport.SelectFileForSave (hWnd, "Save skeleton...", skeletonFilter, sSavePath)) + if (theCNelExport.SelectFileForSave (hWnd, _T("Save skeleton..."), skeletonFilter, sSavePath)) { // Export the zone if (!theCNelExport.exportSkeleton (sSavePath, pNode, theCNelExport._Ip->GetTime())) { // Error message - char sErrorMsg[512]; - sprintf (sErrorMsg, "Error exporting skeleton %s in the file\n%s", pNode->GetName(), sSavePath); - MessageBox (hWnd, sErrorMsg, "NeL export", MB_OK|MB_ICONEXCLAMATION); + std::string sErrorMsg = toString("Error exporting skeleton %s in the file\n%s", tStrToUtf8(pNode->GetName()).c_str(), sSavePath.c_str()); + MessageBox(hWnd, utf8ToTStr(sErrorMsg), _T("NeL export"), MB_OK | MB_ICONEXCLAMATION); } } } @@ -716,7 +697,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP theCNelExport.getSelectedNode (vectNode); if (vectNode.size() == 0) { - ::MessageBox(hWnd, "No nodes selected", "Error", MB_OK|MB_ICONEXCLAMATION); + ::MessageBox(hWnd, _T("No nodes selected"), _T("Error"), MB_OK|MB_ICONEXCLAMATION); return ret; } @@ -729,16 +710,16 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP nlassert(theCNelExport._ExportNel); if (!theCNelExport._ExportNel->selectInterfaceVertices(**it, time)) { - ::MessageBox(NULL, "Unable to bind interface of mesh %s", (*it)->GetName(), MB_OK | MB_ICONEXCLAMATION); + ::MessageBox(NULL, _T("Unable to bind interface of mesh %s"), (*it)->GetName(), MB_OK | MB_ICONEXCLAMATION); break; } } theIP->RedrawViews(time); } catch(const std::exception &e) - { - ::MessageBox(hWnd, e.what(), "Error", MB_OK | MB_ICONEXCLAMATION); - } + { + ::MessageBox(hWnd, utf8ToTStr(e.what()), _T("Error"), MB_OK | MB_ICONEXCLAMATION); + } } } break; @@ -826,11 +807,10 @@ void CNelExport::getSelectedNode (std::vector& vectNode) void CNelExport::initOptions() { // Initialization of theExportSceneStruct - char sConfigFileName[512]; - strcpy( sConfigFileName, theCNelExport._Ip->GetDir(APP_PLUGCFG_DIR) ); - strcat( sConfigFileName, "\\NelExportScene.cfg" ); + std::string sConfigFileName = tStrToUtf8(theCNelExport._Ip->GetDir(APP_PLUGCFG_DIR)) + "\\NelExportScene.cfg"; + // MessageBox (hWnd, sConfigFileName, "sConfigFileName", MB_OK|MB_ICONEXCLAMATION); - if( theCNelExport.FileExists(sConfigFileName) ) + if( CFile::fileExists(sConfigFileName) ) { // Serial the configuration try { @@ -843,8 +823,7 @@ void CNelExport::initOptions() } catch(...) { - MessageBox( theCNelExport._Ip->GetMAXHWnd(), "NelExportScene.cfg corrupted or old version", - "Error", MB_OK|MB_ICONEXCLAMATION ); + MessageBox( theCNelExport._Ip->GetMAXHWnd(), _T("NelExportScene.cfg corrupted or old version"), _T("Error"), MB_OK|MB_ICONEXCLAMATION ); } } } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_gui_bind.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_gui_bind.cpp index 4b3d4b6b4..af533c4c8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_gui_bind.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_gui_bind.cpp @@ -165,7 +165,11 @@ int EPM_BindMouseProc::proc( int flags, IPoint2 m) { - ViewExp *vpt = ip->GetViewport(hwnd); +#if MAX_VERSION_MAJOR >= 19 + ViewExp *vpt = &ip->GetViewExp(hwnd); +#else + ViewExp *vpt = ip->GetViewport(hwnd); +#endif int res = TRUE; static PatchMesh *shape1 = NULL; static int poly1, vert1, seg1; @@ -302,8 +306,11 @@ int EPM_BindMouseProc::proc( break; } - if (vpt) +#if MAX_VERSION_MAJOR < 19 + if (vpt) ip->ReleaseViewport(vpt); +#endif + return res; } From 58ec64e38050f5980e14b651cfb6b7cf99370198 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 2 Dec 2016 15:57:25 +0100 Subject: [PATCH 10/50] Fixed: Use UNICODE versions of Win32 API --HG-- branch : develop --- code/nel/src/misc/common.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 5954ac9c9..9f9241b82 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -1416,17 +1416,17 @@ NLMISC_CATEGORISED_COMMAND(nel, killProgram, "kill a program given the pid", "

Date: Fri, 2 Dec 2016 15:58:59 +0100 Subject: [PATCH 11/50] Changed: Use std::string instead of const char* for openURL and openDoc --HG-- branch : develop --- code/nel/include/nel/misc/common.h | 4 ++-- code/nel/src/misc/common.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/nel/include/nel/misc/common.h b/code/nel/include/nel/misc/common.h index f1c090c2b..c7c1369c5 100644 --- a/code/nel/include/nel/misc/common.h +++ b/code/nel/include/nel/misc/common.h @@ -690,10 +690,10 @@ inline int nlisprint(int c) #endif // Open an url in a browser -bool openURL (const char *url); +bool openURL (const std::string &url); // Open a document -bool openDoc (const char *document); +bool openDoc (const std::string &document); // AntiBug method that return an epsilon if x==0, else x inline float favoid0(float x) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 9f9241b82..6453d836d 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -1434,7 +1434,7 @@ LONG GetRegKey(HKEY key, LPCWSTR subkey, LPWSTR retdata) } #endif // NL_OS_WINDOWS -static bool openDocWithExtension (const char *document, const char *ext) +static bool openDocWithExtension (const std::string &document, const std::string &ext) { #ifdef NL_OS_WINDOWS // First try ShellExecute() @@ -1552,18 +1552,18 @@ static bool openDocWithExtension (const char *document, const char *ext) return false; } -bool openURL (const char *url) +bool openURL(const std::string &url) { return openDocWithExtension(url, "htm"); } -bool openDoc (const char *document) +bool openDoc(const std::string &document) { // get extension from document fullpath string ext = CFile::getExtension(document); // try to open document - return openDocWithExtension(document, ext.c_str()); + return openDocWithExtension(document, ext); } } // NLMISC From b1d39b07dea91c957d17ec9520c779ebb5be9886 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 2 Dec 2016 15:59:45 +0100 Subject: [PATCH 12/50] Changed: Use CreateProcess instead of WinExec (deprecated) to launch an executable --HG-- branch : develop --- code/nel/src/misc/common.cpp | 43 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 6453d836d..d08e38488 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -1450,37 +1450,40 @@ static bool openDocWithExtension (const std::string &document, const std::string { lstrcatW(key, L"\\shell\\open\\command"); + // get the command used to open a file with this extension if (GetRegKey(HKEY_CLASSES_ROOT, key, key) == ERROR_SUCCESS) { - char *pos = strstr(key, "\"%1\""); + std::string program = wideToUtf8(key); - if (pos == NULL) + // empty program + if (program.empty()) return false; + + if (program[0] == '"') { - // No quotes found - // Check for %1, without quotes - pos = strstr(key, "%1"); - - if (pos == NULL) - { - // No parameter at all... - pos = key+lstrlenA(key)-1; - } - else + // program is quoted + std::string::size_type pos = program.find('"', 1); + + if (pos != std::string::npos) { - // Remove the parameter - *pos = '\0'; + // take part before next quote + program = program.substr(1, pos - 1); } } else { - // Remove the parameter - *pos = '\0'; + // program has a parameter + std::string::size_type pos = program.find(' ', 1); + + if (pos != std::string::npos) + { + // take part before first space + program = program.substr(0, pos); + } } - lstrcatA(pos, " "); - lstrcatA(pos, document); - int res = WinExec(key, SW_SHOWDEFAULT); - return (res>31); + // create process + PROCESS_INFORMATION pi; + return createProcess(program, document, false, pi); } } } From dd6cc92035ce59aa85cba163581773c895ad0df2 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 2 Dec 2016 16:00:22 +0100 Subject: [PATCH 13/50] Fixed: We need to pass the executable full path as first argument to CreateProcess --HG-- branch : develop --- code/nel/src/misc/common.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index d08e38488..f455f121f 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -761,7 +761,8 @@ static bool createProcess(const std::string &programName, const std::string &arg sProgramName = new wchar_t[MAX_PATH]; wcscpy(sProgramName, (wchar_t*)ucProgramName.c_str()); - args = arguments; + // important! we need to specify the executable full path as first argument + args = toString("\"%s\" ", programName.c_str()) + arguments; } BOOL res = CreateProcessW(sProgramName, utf8ToWide(args), NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE | CREATE_NO_WINDOW, NULL, NULL, &si, &pi); From 894151dba864f0f673eab6fe488b1f77f31c38b9 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 2 Dec 2016 16:01:43 +0100 Subject: [PATCH 14/50] Changed: Constification of addSlashR and removeSlashR --HG-- branch : develop --- code/nel/include/nel/misc/string_common.h | 4 ++-- code/nel/src/misc/string_common.cpp | 6 +++--- code/nel/src/net/email.cpp | 11 ++--------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/code/nel/include/nel/misc/string_common.h b/code/nel/include/nel/misc/string_common.h index b8a12ad77..2839c2bfc 100644 --- a/code/nel/include/nel/misc/string_common.h +++ b/code/nel/include/nel/misc/string_common.h @@ -28,8 +28,8 @@ namespace NLMISC { // get a string and add \r before \n if necessary -std::string addSlashR (std::string str); -std::string removeSlashR (std::string str); +std::string addSlashR (const std::string &str); +std::string removeSlashR (const std::string &str); /** * \def MaxCStringSize diff --git a/code/nel/src/misc/string_common.cpp b/code/nel/src/misc/string_common.cpp index dd8d1fe96..9c9085e4e 100644 --- a/code/nel/src/misc/string_common.cpp +++ b/code/nel/src/misc/string_common.cpp @@ -27,7 +27,7 @@ using namespace std; namespace NLMISC { -string addSlashR (string str) +string addSlashR (const string &str) { string formatedStr; // replace \n with \r\n @@ -42,10 +42,10 @@ string addSlashR (string str) return formatedStr; } -string removeSlashR (string str) +string removeSlashR (const string &str) { string formatedStr; - // replace \n with \r\n + // remove \r for (uint i = 0; i < str.size(); i++) { if (str[i] != '\r') diff --git a/code/nel/src/net/email.cpp b/code/nel/src/net/email.cpp index 9ac22c886..f402edd65 100644 --- a/code/nel/src/net/email.cpp +++ b/code/nel/src/net/email.cpp @@ -196,15 +196,8 @@ bool sendEmail (const string &smtpServer, const string &from, const string &to, // we must skip the first line formatedBody = "\r\n"; - // replace \n with \r\n - for (i = 0; i < body.size(); i++) - { - if (body[i] == '\n' && i > 0 && body[i-1] != '\r') - { - formatedBody += '\r'; - } - formatedBody += body[i]; - } + // replace \n by \r\n + formatedBody += addSlashR(body); // add attachment if any if (!attachedFile.empty()) From 7af3a4c68c0a475b5f8dfa96658cb52a7f3386ea Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 2 Dec 2016 16:24:31 +0100 Subject: [PATCH 15/50] Changed: Use _T macro, TCHAR, tStrToUtf8/utf8ToTStr, etc... to support UNICODE --HG-- branch : develop --- .../tools/3d/object_viewer/multi_tex_dlg.cpp | 18 ++++++------ .../tools/3d/object_viewer/object_viewer.cpp | 4 +-- .../3d/object_viewer/particle_system_edit.cpp | 8 +++--- .../nel_patch_edit/np_epm_subdivide.cpp | 6 ++-- .../3d/tile_edit/SelectionTerritoire.cpp | 12 ++++---- .../georges_dll/edit_list_ctrl.cpp | 15 ++++++---- .../georges_dll/file_browser_dialog.cpp | 12 ++++---- .../georges_dll/file_tree_view.cpp | 6 ++-- .../leveldesign/georges_dll/form_dialog.cpp | 14 +++++----- .../leveldesign/georges_dll/georges_edit.cpp | 28 +++++++++---------- .../leveldesign/georges_dll/georges_edit.h | 2 +- .../georges_dll/georges_edit_view.cpp | 2 +- 12 files changed, 65 insertions(+), 62 deletions(-) diff --git a/code/nel/tools/3d/object_viewer/multi_tex_dlg.cpp b/code/nel/tools/3d/object_viewer/multi_tex_dlg.cpp index 58776b931..58d67bd0b 100644 --- a/code/nel/tools/3d/object_viewer/multi_tex_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/multi_tex_dlg.cpp @@ -214,10 +214,10 @@ void CMultiTexDlg::writeValues(bool alternate) GetDlgItem(IDC_U_SPEED_2)->GetWindowText(u2, 10); GetDlgItem(IDC_V_SPEED_2)->GetWindowText(v2, 10); - if (_tcscanf(u1, "%f", &vs1.x) == 1 && - _tcscanf(v1, "%f", &vs1.y) == 1 && - _tcscanf(u2, "%f", &vs2.x) == 1 && - _tcscanf(v2, "%f", &vs2.y) == 1) + if (_stscanf(u1, _T("%f"), &vs1.x) == 1 && + _stscanf(v1, _T("%f"), &vs1.y) == 1 && + _stscanf(u2, _T("%f"), &vs2.x) == 1 && + _stscanf(v2, _T("%f"), &vs2.y) == 1) { _MTP->setScrollSpeed(0, vs1); _MTP->setScrollSpeed(1, vs2); @@ -236,10 +236,10 @@ void CMultiTexDlg::writeValues(bool alternate) GetDlgItem(IDC_V_SPEED_1_ALTERNATE)->GetWindowText(v1, 10); GetDlgItem(IDC_U_SPEED_2_ALTERNATE)->GetWindowText(u2, 10); GetDlgItem(IDC_V_SPEED_2_ALTERNATE)->GetWindowText(v2, 10); - if (_tcscanf(u1, "%f", &vs1.x) == 1 && - _tcscanf(v1, "%f", &vs1.y) == 1 && - _tcscanf(u2, "%f", &vs2.x) == 1 && - _tcscanf(v2, "%f", &vs2.y) == 1) + if (_stscanf(u1, _T("%f"), &vs1.x) == 1 && + _stscanf(v1, _T("%f"), &vs1.y) == 1 && + _stscanf(u2, _T("%f"), &vs2.x) == 1 && + _stscanf(v2, _T("%f"), &vs2.y) == 1) { _MTP->setAlternateScrollSpeed(0, vs1); _MTP->setAlternateScrollSpeed(1, vs2); @@ -251,7 +251,7 @@ void CMultiTexDlg::writeValues(bool alternate) TCHAR bumpFactorTxt[10]; float bumpFactor; GetDlgItem(IDC_BUMP_FACTOR)->GetWindowText(bumpFactorTxt, 10); - if (_tcscanf(bumpFactorTxt, "%f", &bumpFactor) == 1) + if (_stscanf(bumpFactorTxt, _T("%f"), &bumpFactor) == 1) { _MTP->setBumpFactor(bumpFactor); updateModifiedFlag(); diff --git a/code/nel/tools/3d/object_viewer/object_viewer.cpp b/code/nel/tools/3d/object_viewer/object_viewer.cpp index 923e04a64..f76ecb4e1 100644 --- a/code/nel/tools/3d/object_viewer/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer/object_viewer.cpp @@ -813,8 +813,8 @@ bool CObjectViewer::initUI (HWND parent) // load the scheme bank if one is present CIFile iF; - ::_makepath (sModulePath, SDrive, SDir, "default", ".scb"); - if (iF.open(sModulePath)) + std::string path = SPath + "default.scb"; + if (iF.open(path)) { try { diff --git a/code/nel/tools/3d/object_viewer/particle_system_edit.cpp b/code/nel/tools/3d/object_viewer/particle_system_edit.cpp index 6d833acdf..7aa989d8b 100644 --- a/code/nel/tools/3d/object_viewer/particle_system_edit.cpp +++ b/code/nel/tools/3d/object_viewer/particle_system_edit.cpp @@ -403,9 +403,9 @@ void CParticleSystemEdit::updateBBoxFromText() m_BBoxYCtrl.GetWindowText(inY, 128); m_BBoxZCtrl.GetWindowText(inZ, 128); - if (_tcscanf(inX, "%f", &h.x) == 1 - && _tcscanf(inY, "%f", &h.y) == 1 - && _tcscanf(inZ, "%f", &h.z) == 1 + if (_stscanf(inX, _T("%f"), &h.x) == 1 + && _stscanf(inY, _T("%f"), &h.y) == 1 + && _stscanf(inZ, _T("%f"), &h.z) == 1 ) { NLMISC::CAABBox b; @@ -466,7 +466,7 @@ void CParticleSystemEdit::OnChangeApplyAfterDelay() GetDlgItem(IDC_APPLY_AFTER_DELAY)->GetWindowText(in, 128); float value; - if (_tcscanf(in, "%f", &value) == 1) + if (_stscanf(in, _T("%f"), &value) == 1) { if (_Node->getPSPointer()->getDelayBeforeDeathConditionTest() != value) { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_subdivide.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_subdivide.cpp index b67153e07..644b508a8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_subdivide.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_subdivide.cpp @@ -1237,7 +1237,7 @@ void EditPatchMod::DoEdgeSubdivide() { altered = holdNeeded = 1; if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "DoEdgeSubdivide")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("DoEdgeSubdivide"))); // Call the patch add function SubdividePatch(SUBDIV_EDGES, propagate, patch, rpatch); patchData->UpdateChanges(patch, rpatch); @@ -1304,7 +1304,7 @@ void EditPatchMod::DoPatchSubdivide() { altered = holdNeeded = 1; if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "DoPatchSubdivide")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("DoPatchSubdivide"))); // Call the patch add function SubdividePatch(SUBDIV_PATCHES, propagate, patch, rpatch); patchData->UpdateChanges(patch, rpatch); @@ -1441,7 +1441,7 @@ void EditPatchMod::DoPatchTurn(bool ccw) { altered = holdNeeded = 1; if (theHold.Holding()) - theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "DoTurnPatch")); + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, _T("DoTurnPatch"))); // Call the patch add function TurnPatch (patch, rpatch, ccw); diff --git a/code/nel/tools/3d/tile_edit/SelectionTerritoire.cpp b/code/nel/tools/3d/tile_edit/SelectionTerritoire.cpp index eb7738411..15b9a5b7d 100644 --- a/code/nel/tools/3d/tile_edit/SelectionTerritoire.cpp +++ b/code/nel/tools/3d/tile_edit/SelectionTerritoire.cpp @@ -361,11 +361,11 @@ void SelectionTerritoire::OnSelect() { POSITION p = sFile.GetStartPosition(); CString str = sFile.GetNextPathName(p); - char *temp = str.GetBuffer(256); - if (temp) + std::string temp = tStrToUtf8(str); + if (!temp.empty()) { CIFile stream; - if (stream.open ((const char*)str)) + if (stream.open (temp)) { list->ResetContent (); list2->ResetContent (); @@ -377,13 +377,13 @@ void SelectionTerritoire::OnSelect() for (i=0; iAddString(tileBank.getLand(i)->getName().c_str()); + list->AddString(utf8ToTStr(tileBank.getLand(i)->getName())); } for (i=0; iAddString(tileBank.getTileSet(i)->getName().c_str()); + list2->AddString(utf8ToTStr(tileBank.getTileSet(i)->getName())); } MainFileName = CString(utf8ToTStr(NLMISC::CFile::getFilename(temp))); @@ -400,7 +400,7 @@ void SelectionTerritoire::OnSelect() button->EnableWindow(true); // Change the bouton text path - GetDlgItem (IDC_PATH)->SetWindowText (tileBank.getAbsPath().c_str()); + GetDlgItem (IDC_PATH)->SetWindowText (utf8ToTStr(tileBank.getAbsPath())); } } diff --git a/code/ryzom/tools/leveldesign/georges_dll/edit_list_ctrl.cpp b/code/ryzom/tools/leveldesign/georges_dll/edit_list_ctrl.cpp index c3a722c6d..4efdf0c16 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/edit_list_ctrl.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/edit_list_ctrl.cpp @@ -151,22 +151,22 @@ BOOL CEditListCtrl::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) item = ListCtrl.GetNextSelectedItem(pos); string text; getNewItemText (item, 0, text); - ListCtrl.InsertItem (item, text.c_str ()); + ListCtrl.InsertItem (item, utf8ToTStr(text)); for (uint i=1; igetBrowseInfo (Ctrl->Item, Ctrl->SubItem, defExt, defFilename, defDir, filter); - CFileDialog dlgFile (TRUE, defExt.c_str (), defFilename.c_str (), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, filter.c_str (), theApp.m_pMainWnd); - dlgFile.m_ofn.lpstrInitialDir = defDir.c_str (); + TCHAR buffer[MAX_PATH]; + _tcscpy(buffer, utf8ToTStr(defDir)); + + CFileDialog dlgFile (TRUE, utf8ToTStr(defExt), utf8ToTStr(defFilename), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, utf8ToTStr(filter), theApp.m_pMainWnd); + dlgFile.m_ofn.lpstrInitialDir = buffer; Ctrl->OnBrowse = true; if (dlgFile.DoModal () == IDOK) { diff --git a/code/ryzom/tools/leveldesign/georges_dll/file_browser_dialog.cpp b/code/ryzom/tools/leveldesign/georges_dll/file_browser_dialog.cpp index f63e967ee..98cb78b83 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/file_browser_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/file_browser_dialog.cpp @@ -79,8 +79,8 @@ BOOL CFileBrowserDialog::OnInitDialog() int tabCount = 0; if (theApp.Superuser) { - TabFile->InsertItem (0, "Type"); - TabFile->InsertItem (1, "Dfn"); + TabFile->InsertItem (0, _T("Type")); + TabFile->InsertItem (1, _T("Dfn")); tabCount += 2; TreeCtrlType.create( sz, TabFile, 0); @@ -96,7 +96,7 @@ BOOL CFileBrowserDialog::OnInitDialog() TreeCtrlDfn.setNotifyWindow (m_hWnd, 1); } - TabFile->InsertItem (tabCount, "Form"); + TabFile->InsertItem (tabCount, _T("Form")); TabFile->SetCurSel (tabCount); TreeCtrlForm.create( sz, TabFile, 2); @@ -279,7 +279,7 @@ void CFileBrowserDialog::openDocument () string pathName = CPath::lookup (filename.c_str (), false, false); if (pathName.empty ()) pathName = filename; - theApp.OpenDocumentFile (pathName.c_str()); + theApp.OpenDocumentFile (utf8ToTStr(pathName)); } } else if (IsWindow (TreeCtrlType) && TreeCtrlDfn.IsWindowVisible ()) @@ -289,7 +289,7 @@ void CFileBrowserDialog::openDocument () string pathName = CPath::lookup (filename.c_str (), false, false); if (pathName.empty ()) pathName = filename; - theApp.OpenDocumentFile (pathName.c_str()); + theApp.OpenDocumentFile (utf8ToTStr(pathName)); } } else if (TreeCtrlForm.IsWindowVisible ()) @@ -299,7 +299,7 @@ void CFileBrowserDialog::openDocument () string pathName = CPath::lookup (filename.c_str (), false, false); if (pathName.empty ()) pathName = filename; - theApp.OpenDocumentFile (pathName.c_str()); + theApp.OpenDocumentFile (utf8ToTStr(pathName)); } } } diff --git a/code/ryzom/tools/leveldesign/georges_dll/file_tree_view.cpp b/code/ryzom/tools/leveldesign/georges_dll/file_tree_view.cpp index fac4cb052..3a0616fe1 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/file_tree_view.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/file_tree_view.cpp @@ -441,11 +441,11 @@ bool CFileTreeCtrl::enumObjects(HTREEITEM hParentItem,IShellFolder* pParentFolde pParentFolder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidl, &pItemInfo->dwFlags); // Convert display name in file system path - char name[MAX_PATH]; + TCHAR name[MAX_PATH]; nlverify ( SHGetPathFromIDList ( pidl, name ) ); // Save it - pItemInfo->displayName = name; + pItemInfo->displayName = tStrToUtf8(name); // Is a folder ? bool folder = (pItemInfo->dwFlags&SFGAO_FOLDER) !=0; @@ -720,7 +720,7 @@ bool CFileTreeCtrl::getCurrentFilename (std::string &result) if (curSel) { CString str = _TreeCtrl.GetItemText (curSel); - result = str; + result = tStrToUtf8(str); return true; } return false; diff --git a/code/ryzom/tools/leveldesign/georges_dll/form_dialog.cpp b/code/ryzom/tools/leveldesign/georges_dll/form_dialog.cpp index 76421972b..25d10f9d2 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/form_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/form_dialog.cpp @@ -770,7 +770,7 @@ BOOL CFormDialog::OnCommand(WPARAM wParam, LPARAM lParam) colorEdit->Edit.GetWindowText (str); sint r, g, b; - if (sscanf (str, "%d,%d,%d", &r, &g, &b) == 3) + if (_stscanf (str, _T("%d,%d,%d"), &r, &g, &b) == 3) { clamp (r, 0, 255); clamp (g, 0, 255); @@ -1352,18 +1352,18 @@ void IFormWidget::updateLabel () if (node->getForm () == doc->getFormPtr ()) { // The node exist - Label.SetWindowText (SavedLabel.c_str()); + Label.SetWindowText (utf8ToTStr(SavedLabel)); } else { // The node exist in the parent form - Label.SetWindowText ((SavedLabel+" (in parent form)").c_str()); + Label.SetWindowText (utf8ToTStr(SavedLabel + " (in parent form)")); } } else { // The node is empty - Label.SetWindowText ((SavedLabel+" (undefined)").c_str()); + Label.SetWindowText (utf8ToTStr(SavedLabel + " (undefined)")); } } @@ -1509,10 +1509,10 @@ void IFormWidget::onOpenSelected () string str; getValue (str); - std::string str2=CPath::lookup (str.c_str (), false, false); + std::string str2 = CPath::lookup (str, false, false); if (str2.empty()) - str2 = str.c_str (); - theApp.OpenDocumentFile (str2.c_str ()); + str2 = str; + theApp.OpenDocumentFile (utf8ToTStr(str2)); } // *************************************************************************** diff --git a/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp b/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp index d11e33a5a..1860096aa 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp @@ -74,10 +74,10 @@ CGeorgesEditApp::CGeorgesEditApp() : MemStream (false, false, 1024*1024) ExeStandalone = false; StartExpanded = true; - FormClipBoardFormatStruct = RegisterClipboardFormat ("GeorgesFormStruct"); - FormClipBoardFormatVirtualStruct = RegisterClipboardFormat ("GeorgesFormVirtualStruct"); - FormClipBoardFormatArray = RegisterClipboardFormat ("GeorgesFormArray"); - FormClipBoardFormatType = RegisterClipboardFormat ("GeorgesFormType"); + FormClipBoardFormatStruct = RegisterClipboardFormat (_T("GeorgesFormStruct")); + FormClipBoardFormatVirtualStruct = RegisterClipboardFormat (_T("GeorgesFormVirtualStruct")); + FormClipBoardFormatArray = RegisterClipboardFormat (_T("GeorgesFormArray")); + FormClipBoardFormatType = RegisterClipboardFormat (_T("GeorgesFormType")); nlassert (FormClipBoardFormatStruct); nlassert (FormClipBoardFormatVirtualStruct); nlassert (FormClipBoardFormatArray); @@ -159,7 +159,7 @@ BOOL CGeorgesEditApp::initInstance (int nCmdShow, bool exeStandalone, int x, int if (!isInitialized && exeStandalone) { m_nCmdShow = nCmdShow; - ExePath = GetCommandLine (); + ExePath = tStrToUtf8(GetCommandLine ()); if (ExePath.size()>0) { if (ExePath[0] == '\"') @@ -673,11 +673,11 @@ bool CGeorgesEditApp::getColor (NLMISC::CRGBA &color) // Get custom colors COLORREF arrayColor[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; HKEY hKey; - if (RegOpenKeyEx(HKEY_CURRENT_USER, GEORGES_EDIT_BASE_REG_KEY"\\Custom Colors", 0, KEY_READ, &hKey)==ERROR_SUCCESS) + if (RegOpenKeyEx(HKEY_CURRENT_USER, _T(GEORGES_EDIT_BASE_REG_KEY "\\Custom Colors"), 0, KEY_READ, &hKey)==ERROR_SUCCESS) { DWORD len=sizeof(arrayColor); DWORD type; - RegQueryValueEx (hKey, "", 0, &type, (LPBYTE)(arrayColor), &len); + RegQueryValueEx (hKey, _T(""), 0, &type, (LPBYTE)(arrayColor), &len); RegCloseKey (hKey); } @@ -698,9 +698,9 @@ bool CGeorgesEditApp::getColor (NLMISC::CRGBA &color) // Save the custom colors HKEY hKey; - if (RegCreateKey(HKEY_CURRENT_USER, GEORGES_EDIT_BASE_REG_KEY"\\Custom Colors", &hKey)==ERROR_SUCCESS) + if (RegCreateKey(HKEY_CURRENT_USER, _T(GEORGES_EDIT_BASE_REG_KEY "\\Custom Colors"), &hKey)==ERROR_SUCCESS) { - RegSetValueEx (hKey, "", 0, REG_BINARY, (LPBYTE)(arrayColor), sizeof(arrayColor)); + RegSetValueEx (hKey, _T(""), 0, REG_BINARY, (LPBYTE)(arrayColor), sizeof(arrayColor)); RegCloseKey (hKey); } return true; @@ -711,9 +711,9 @@ bool CGeorgesEditApp::getColor (NLMISC::CRGBA &color) bool CGeorgesEditApp::yesNo (const char* message) { if (m_pMainWnd) - return m_pMainWnd->MessageBox (message, "Georges Edit", MB_YESNO|MB_ICONQUESTION) != IDNO; + return m_pMainWnd->MessageBox (message, _T("Georges Edit"), MB_YESNO|MB_ICONQUESTION) != IDNO; else - return MessageBox (NULL, message, "Georges Edit", MB_YESNO|MB_ICONQUESTION) != IDNO; + return MessageBox (NULL, message, _T("Georges Edit"), MB_YESNO|MB_ICONQUESTION) != IDNO; } void CGeorgesEditApp::loadPlugins () @@ -722,7 +722,7 @@ void CGeorgesEditApp::loadPlugins () for (i=0; igetChild (i); int image = child->getItemImage (doc); - TabCtrl.InsertItem (i, child->getName ().c_str(), image); + TabCtrl.InsertItem (i, utf8ToTStr(child->getName()), image); // This is the selection ? if (subObject == child) From ffa5203a795ad90c74319e5a8f5c285b94565ff1 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 2 Dec 2016 16:30:10 +0100 Subject: [PATCH 16/50] Changed: Minor changes --HG-- branch : develop --- code/nel/src/ligo/ligo_error.cpp | 2 +- .../tools/3d/object_viewer/about_dialog.cpp | 6 +- .../tools/3d/object_viewer/object_viewer.cpp | 2 +- .../3d/plugin_max/nel_export/nel_export.cpp | 91 +++++++++++-------- .../nel_patch_edit/np_edit_patch_mod.cpp | 3 +- .../nel_patch_edit/np_epm_selection.cpp | 9 +- .../3d/plugin_max/nel_patch_edit/np_main.cpp | 3 +- 7 files changed, 65 insertions(+), 51 deletions(-) diff --git a/code/nel/src/ligo/ligo_error.cpp b/code/nel/src/ligo/ligo_error.cpp index fdca7a2c2..30315b3e6 100644 --- a/code/nel/src/ligo/ligo_error.cpp +++ b/code/nel/src/ligo/ligo_error.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . #include "stdligo.h" -#include "ligo_error.h" +#include "nel/ligo/ligo_error.h" namespace NLLIGO { diff --git a/code/nel/tools/3d/object_viewer/about_dialog.cpp b/code/nel/tools/3d/object_viewer/about_dialog.cpp index 37259225c..4ebb0a676 100644 --- a/code/nel/tools/3d/object_viewer/about_dialog.cpp +++ b/code/nel/tools/3d/object_viewer/about_dialog.cpp @@ -48,10 +48,10 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CAboutDialog message handlers -BOOL CAboutDialog::OnInitDialog() +BOOL CAboutDialog::OnInitDialog() { CDialog::OnInitDialog(); - + // Get the module path HMODULE hModule = AfxGetInstanceHandle(); nlassert(hModule); // shouldn't be null now anymore in any case @@ -73,7 +73,7 @@ BOOL CAboutDialog::OnInitDialog() if (VerQueryValue (pInfo, _T("\\"), (void**)&versionTab, &versionSize)) { // Get the pointer on the structure - VS_FIXEDFILEINFO *info=(VS_FIXEDFILEINFO*)versionTab; + VS_FIXEDFILEINFO *info = (VS_FIXEDFILEINFO*)versionTab; // Setup version number TCHAR version[512]; diff --git a/code/nel/tools/3d/object_viewer/object_viewer.cpp b/code/nel/tools/3d/object_viewer/object_viewer.cpp index f76ecb4e1..00d530dd6 100644 --- a/code/nel/tools/3d/object_viewer/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer/object_viewer.cpp @@ -1885,7 +1885,7 @@ bool CObjectViewer::loadInstanceGroup(const std::string &igFilename) if (file.open (igFilename)) { // Shape pointer - NL3D::CInstanceGroup *ig= new NL3D::CInstanceGroup; + NL3D::CInstanceGroup *ig = new NL3D::CInstanceGroup; try { 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 74c6566f7..ee0b05c21 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 @@ -26,7 +26,7 @@ #include "nel_export_scene.h" - + using namespace NL3D; using namespace NLMISC; @@ -66,25 +66,29 @@ INT_PTR CALLBACK OptionsDialogCallback ( LPARAM lParam // second message parameter ) { - switch (uMsg) + switch (uMsg) { case WM_INITDIALOG: { CenterWindow( hwndDlg, theCNelExport._Ip->GetMAXHWnd() ); ShowWindow( hwndDlg, TRUE ); + // Initialize from theExportSceneStruct if( theExportSceneStruct.bExcludeNonSelected ) SendMessage( GetDlgItem(hwndDlg,IDC_EXCLUDE), BM_SETCHECK, BST_CHECKED, 0 ); else SendMessage( GetDlgItem(hwndDlg,IDC_EXCLUDE), BM_SETCHECK, BST_UNCHECKED, 0 ); + if( theExportSceneStruct.bExportLighting ) SendMessage( GetDlgItem(hwndDlg,IDC_CHECKEXPORTLIGHTING), BM_SETCHECK, BST_CHECKED, 0 ); else SendMessage( GetDlgItem(hwndDlg,IDC_CHECKEXPORTLIGHTING), BM_SETCHECK, BST_UNCHECKED, 0 ); + if( theExportSceneStruct.OutputLightmapLog ) SendMessage( GetDlgItem(hwndDlg,IDC_CHECKOUTPUTLIGHTMAPLOG), BM_SETCHECK, BST_CHECKED, 0 ); else SendMessage( GetDlgItem(hwndDlg,IDC_CHECKOUTPUTLIGHTMAPLOG), BM_SETCHECK, BST_UNCHECKED, 0 ); + if( theExportSceneStruct.bShadow) SendMessage( GetDlgItem(hwndDlg,IDC_SHADOW), BM_SETCHECK, BST_CHECKED, 0 ); else @@ -94,6 +98,7 @@ INT_PTR CALLBACK OptionsDialogCallback ( if( theExportSceneStruct.nExportLighting == 0 ) SendMessage( GetDlgItem(hwndDlg,IDC_RADIONORMALEXPORTLIGHTING), BM_SETCHECK, BST_CHECKED, 0 ); + if( theExportSceneStruct.nExportLighting == 1 ) SendMessage( GetDlgItem(hwndDlg,IDC_RADIORADIOSITYEXPORTLIGHTING), BM_SETCHECK, BST_CHECKED, 0 ); @@ -101,17 +106,21 @@ INT_PTR CALLBACK OptionsDialogCallback ( if( theExportSceneStruct.nOverSampling == 1 ) SendMessage( GetDlgItem(hwndDlg,IDC_RADIOSS1), BM_SETCHECK, BST_CHECKED, 0 ); + if( theExportSceneStruct.nOverSampling == 2 ) SendMessage( GetDlgItem(hwndDlg,IDC_RADIOSS2), BM_SETCHECK, BST_CHECKED, 0 ); + if( theExportSceneStruct.nOverSampling == 4 ) SendMessage( GetDlgItem(hwndDlg,IDC_RADIOSS3), BM_SETCHECK, BST_CHECKED, 0 ); + if( theExportSceneStruct.nOverSampling == 8 ) SendMessage( GetDlgItem(hwndDlg,IDC_RADIOSS4), BM_SETCHECK, BST_CHECKED, 0 ); + if( theExportSceneStruct.bShowLumel ) SendMessage( GetDlgItem(hwndDlg,IDC_SHOWLUMEL), BM_SETCHECK, BST_CHECKED, 0 ); else SendMessage( GetDlgItem(hwndDlg,IDC_SHOWLUMEL), BM_SETCHECK, BST_UNCHECKED, 0 ); - + if( theExportSceneStruct.bExportBgColor ) SendMessage( GetDlgItem(hwndDlg,IDC_EXPORT_BG_COLOR), BM_SETCHECK, BST_CHECKED, 0 ); else @@ -131,7 +140,7 @@ INT_PTR CALLBACK OptionsDialogCallback ( case WM_COMMAND: if( HIWORD(wParam) == BN_CLICKED ) - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { case IDC_BUTTONEXPORTLIGHTING: { @@ -153,14 +162,17 @@ INT_PTR CALLBACK OptionsDialogCallback ( theExportSceneStruct.bExcludeNonSelected = true; else theExportSceneStruct.bExcludeNonSelected = false; + if( SendMessage( GetDlgItem(hwndDlg,IDC_SHADOW), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.bShadow = true; else theExportSceneStruct.bShadow = false; + if( SendMessage( GetDlgItem(hwndDlg,IDC_CHECKEXPORTLIGHTING), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.bExportLighting = true; else theExportSceneStruct.bExportLighting = false; + if( SendMessage( GetDlgItem(hwndDlg,IDC_CHECKOUTPUTLIGHTMAPLOG), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.OutputLightmapLog = true; else @@ -172,6 +184,7 @@ INT_PTR CALLBACK OptionsDialogCallback ( if( SendMessage( GetDlgItem(hwndDlg,IDC_RADIONORMALEXPORTLIGHTING), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.nExportLighting = 0; + if( SendMessage( GetDlgItem(hwndDlg,IDC_RADIORADIOSITYEXPORTLIGHTING), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.nExportLighting = 1; @@ -180,16 +193,21 @@ INT_PTR CALLBACK OptionsDialogCallback ( if( SendMessage( GetDlgItem(hwndDlg,IDC_RADIOSS1), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.nOverSampling = 1; + if( SendMessage( GetDlgItem(hwndDlg,IDC_RADIOSS2), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.nOverSampling = 2; + if( SendMessage( GetDlgItem(hwndDlg,IDC_RADIOSS3), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.nOverSampling = 4; + if( SendMessage( GetDlgItem(hwndDlg,IDC_RADIOSS4), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.nOverSampling = 8; + if( SendMessage( GetDlgItem(hwndDlg,IDC_SHOWLUMEL), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.bShowLumel = true; else theExportSceneStruct.bShowLumel = false; + theExportSceneStruct.bExportBgColor = ( SendMessage( GetDlgItem(hwndDlg,IDC_EXPORT_BG_COLOR), BM_GETCHECK, 0, 0 ) == BST_CHECKED ); // SurfaceLighting @@ -212,9 +230,9 @@ INT_PTR CALLBACK OptionsDialogCallback ( EndDialog(hwndDlg,1); break; - case WM_DESTROY: + case WM_DESTROY: break; - + default: return FALSE; } @@ -228,7 +246,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP setlocale (LC_NUMERIC, "English"); BOOL ret = TRUE; - switch (msg) + switch (msg) { case WM_INITDIALOG: { @@ -312,7 +330,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP // Get time TimeValue time=theCNelExport._Ip->GetTime(); - + // Get node count int nNumSelNode=theCNelExport._Ip->GetSelNodeCount(); @@ -430,7 +448,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP // Get time TimeValue time=theCNelExport._Ip->GetTime(); - + // Get node count uint nNumSelNode=theCNelExport._Ip->GetSelNodeCount(); @@ -465,7 +483,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP // --- case ID_SAVECOLLISION: { - + // Init the exporter nlassert (theIP); @@ -473,7 +491,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP // Get time TimeValue time=theCNelExport._Ip->GetTime(); - + // Get node count int nNumSelNode=theCNelExport._Ip->GetSelNodeCount(); @@ -537,12 +555,12 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP // Init the exporter nlassert (theIP); theCNelExport.init (false, true, theIP, true); - + uint nNumSelNode = theCNelExport._Ip->GetSelNodeCount(); // Save all selected objects if (nNumSelNode) - { + { std::vector vectNode; theCNelExport.getSelectedNode (vectNode); nlassert (vectNode.size()!=0); @@ -583,7 +601,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP COFile outputFile; if( outputFile.open(sConfigFileName) ) theExportSceneStruct.serial( outputFile ); - } + } // EXPORT THE SCENE // theCNelExport.exportScene( vectNode ); } @@ -595,7 +613,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP // Init the exporter nlassert (theIP); theCNelExport.init (false, true, theIP, true); - + // Build a seleted set std::set listNode; @@ -618,13 +636,13 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP // Init the exporter nlassert (theIP); theCNelExport.init (false, true, theIP, true); - + uint nNumSelNode = theCNelExport._Ip->GetSelNodeCount(); // done in dllentry registerSerial3d(); - // All the selected nodes are considered as a scene + // All the selected nodes are considered as a scene if( nNumSelNode > 0 ) - { + { std::vector vectNode; theCNelExport.getSelectedNode (vectNode); nlassert (vectNode.size()!=0); @@ -650,7 +668,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP // Init the exporter nlassert (theIP); theCNelExport.init (false, true, theIP, true); - + uint nNumSelNode = theCNelExport._Ip->GetSelNodeCount(); if (nNumSelNode!=1) { @@ -679,13 +697,13 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP } } break; - case ID_TEST_INTERFACE_MESH: - { - nlassert (theIP); + case ID_TEST_INTERFACE_MESH: + { + nlassert (theIP); theCNelExport.init (false, true, theIP, true); // Get time TimeValue time = theCNelExport._Ip->GetTime(); - + // Get node count uint nNumSelNode=theCNelExport._Ip->GetSelNodeCount(); @@ -701,9 +719,9 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP return ret; } - // create a mem displayer, that will receive errors + // create a mem displayer, that will receive errors try - { + { // test all nodes for(std::vector::iterator it = vectNode.begin(); it != vectNode.end(); ++it) { @@ -712,8 +730,8 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP { ::MessageBox(NULL, _T("Unable to bind interface of mesh %s"), (*it)->GetName(), MB_OK | MB_ICONEXCLAMATION); break; - } - } + } + } theIP->RedrawViews(time); } catch(const std::exception &e) @@ -722,14 +740,14 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP } } } - break; + break; } - + break; case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MOUSEMOVE: - theCNelExport._Ip->RollupMouseMessage(hWnd,msg,wParam,lParam); + theCNelExport._Ip->RollupMouseMessage(hWnd,msg,wParam,lParam); break; default: @@ -747,7 +765,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP //--- CNelExport ------------------------------------------------------- CNelExport::CNelExport() : _ErrorInDialog(true), _TerminateOnFileOpenIssues(false) { - _Ip = NULL; + _Ip = NULL; theHPanel = NULL; } @@ -756,7 +774,7 @@ CNelExport::~CNelExport() } -void CNelExport::BeginEditParams(Interface *_Ip,IUtil *iu) +void CNelExport::BeginEditParams(Interface *_Ip,IUtil *iu) { theIP = _Ip; if (_ExportNel) @@ -768,8 +786,8 @@ void CNelExport::BeginEditParams(Interface *_Ip,IUtil *iu) theHBar = GetDlgItem(theHPanel,ID_BAR); SendMessage(theHBar,PBM_SETPOS,0,0); } - -void CNelExport::EndEditParams(Interface *_Ip,IUtil *iu) + +void CNelExport::EndEditParams(Interface *_Ip,IUtil *iu) { this->_Ip = NULL; if (_ExportNel) @@ -813,7 +831,8 @@ void CNelExport::initOptions() if( CFile::fileExists(sConfigFileName) ) { // Serial the configuration - try { + try + { CIFile inputFile; if( inputFile.open(sConfigFileName) ) { @@ -838,7 +857,7 @@ void CNelExport::init (bool view, bool errorInDialog, Interface *ip, bool loadSt // Create a new nelexport _Ip = ip; - + // Load the options if (loadStruct) theCNelExport.initOptions(); 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 1e3ba59de..4306cfd0b 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 @@ -338,8 +338,7 @@ static INT_PTR CALLBACK PickSetDlgProc( Tab &names = *((Tab < TSTR*>*)lParam); for (int i = 0; i < names.Count(); i++) { - int pos = SendDlgItemMessage(hWnd, IDC_NS_LIST, LB_ADDSTRING, 0, - (LPARAM)(TCHAR*)*names[i]); + int pos = SendDlgItemMessage(hWnd, IDC_NS_LIST, LB_ADDSTRING, 0, (LPARAM)(TCHAR*)*names[i]->ToMCHAR()); SendDlgItemMessage(hWnd, IDC_NS_LIST, LB_SETITEMDATA, pos, i); } break; 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 84951e2e9..03409c374 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 @@ -71,18 +71,15 @@ void EditPatchMod::RefreshSelType() */ if (selLevel == EP_PATCH) { - hSurfPanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_SURF), - PatchSurfDlgProc, GetString(IDS_TH_SURFACEPROPERTIES), (LPARAM) this, rsSurf ? 0 : APPENDROLL_CLOSED); + hSurfPanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_SURF), PatchSurfDlgProc, GetString(IDS_TH_SURFACEPROPERTIES), (LPARAM) this, rsSurf ? 0 : APPENDROLL_CLOSED); } if (selLevel == EP_TILE) { - hTilePanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_TILE), - PatchTileDlgProc, "Tile Properties", (LPARAM) this, rsTile ? 0 : APPENDROLL_CLOSED); + hTilePanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_TILE), PatchTileDlgProc, _M("Tile Properties"), (LPARAM) this, rsTile ? 0 : APPENDROLL_CLOSED); } if (selLevel == EP_EDGE) { - hEdgePanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_EDGE), - PatchEdgeDlgProc, "Edge Properties", (LPARAM) this, rsEdge ? 0 : APPENDROLL_CLOSED); + hEdgePanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_EDGE), PatchEdgeDlgProc, _M("Edge Properties"), (LPARAM) this, rsEdge ? 0 : APPENDROLL_CLOSED); } SetSurfDlgEnables(); SetTileDlgEnables(); 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 2a36cf070..a6f90a89c 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 @@ -160,8 +160,7 @@ void EditPatchMod::BeginEditParams(IObjParam *ip, ULONG flags, Animatable *prev) */ if (selLevel == EP_PATCH) { - hSurfPanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_SURF), - PatchSurfDlgProc, GetString(IDS_TH_SURFACEPROPERTIES), (LPARAM) this, rsSurf ? 0 : APPENDROLL_CLOSED); + hSurfPanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_SURF), PatchSurfDlgProc, GetString(IDS_TH_SURFACEPROPERTIES), (LPARAM) this, rsSurf ? 0 : APPENDROLL_CLOSED); } else hSurfPanel = NULL; From d9ab55640c7648b3912878c11dc8b8dae10d4dad Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 2 Dec 2016 17:20:25 +0100 Subject: [PATCH 17/50] Changed: Use MCHAR and _M macros for 3dsmax SDK strings --HG-- branch : develop --- .../3d/plugin_max/nel_export/nel_export.h | 6 +- .../nel_export/nel_export_node_properties.cpp | 8 +- .../nel_export/nel_export_script.cpp | 46 +++---- .../plugin_max/nel_mesh_lib/export_misc.cpp | 4 +- .../plugin_max/nel_patch_converter/PO2RPO.h | 8 +- .../plugin_max/nel_patch_converter/script.cpp | 115 +++++++++--------- .../3d/plugin_max/nel_patch_edit/editpat.h | 6 +- .../tools/3d/plugin_max/nel_patch_edit/np.cpp | 6 +- .../nel_patch_edit/np_epm_material.cpp | 6 +- .../3d/plugin_max/nel_patch_edit/np_main.cpp | 8 +- .../tools/3d/plugin_max/nel_patch_lib/rpo.cpp | 8 +- .../tools/3d/plugin_max/nel_patch_lib/rpo.h | 4 +- .../nel_patch_paint/nel_patch_paint.h | 6 +- .../3d/plugin_max/nel_patch_paint/paint.cpp | 2 +- .../plugin_max/nel_patch_paint/paint_main.cpp | 3 +- .../vertex_tree_paint.cpp | 4 +- .../nel_vertex_tree_paint/vertex_tree_paint.h | 2 +- .../3d/plugin_max/tile_utility/rgbadd.cpp | 4 +- .../plugin_max/tile_utility/tile_utility.cpp | 4 +- 19 files changed, 125 insertions(+), 125 deletions(-) diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.h b/code/nel/tools/3d/plugin_max/nel_export/nel_export.h index 4941f2596..eabc05a09 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.h +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.h @@ -105,11 +105,11 @@ class CNelExportClassDesc:public ClassDesc2 public: int IsPublic() {return 1;} void * Create(BOOL loading = FALSE); - const TCHAR * ClassName() {return _T("NeL Export");} + const MCHAR * ClassName() {return _M("NeL Export");} SClass_ID SuperClassID() {return UTILITY_CLASS_ID;} Class_ID ClassID() {return CNELEXPORT_CLASS_ID;} - const TCHAR* Category() {return _T("NeL Tools");} - const TCHAR* InternalName() { return _T("NeL export and view"); } // returns fixed parsable name (scripter-visible name) + const MCHAR* Category() {return _M("NeL Tools");} + const MCHAR* InternalName() { return _M("NeL export and view"); } // returns fixed parsable name (scripter-visible name) HINSTANCE HInstance() { return hInstance; } // returns owning module handle }; 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 e1eec815f..49e0ce97e 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 @@ -90,13 +90,13 @@ class addSubLodNodeHitCallBack : public HitByNameDlgCallback public: INodeTab NodeTab; private: - virtual TCHAR *dialogTitle() + virtual const MCHAR *dialogTitle() { - return "Select sub lod objects to add"; + return _M("Select sub lod objects to add"); } - virtual TCHAR *buttonText() + virtual const MCHAR *buttonText() { - return "Add"; + return _M("Add"); } virtual BOOL singleSelect() { diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp index 4c8ffd299..dfdbdec08 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp @@ -63,11 +63,11 @@ def_visible_primitive ( set_file_modification_date, "NeLSetFileModificationDate def_visible_primitive ( force_quit_on_msg_displayer, "NelForceQuitOnMsgDisplayer"); def_visible_primitive ( force_quit_right_now, "NelForceQuitRightNow"); -char *sExportShapeErrorMsg = "NeLExportShape [Object] [Filename.shape]"; -char *sExportShapeExErrorMsg = "NeLExportShapeEx [Object] [Filename.shape] [bShadow] [bExportLighting] [sLightmapPath] [nLightingLimit] [fLumelSize] [nOverSampling] [bExcludeNonSelected] [bShowLumel]"; -char *sExportAnimationErrorMsg = "NelExportAnimation [node array] [Filename.anim] [bool_scene_animation]"; -char *sExportCollisionErrorMsg = "NelExportCollision [node array] [output directory]"; -char *sExportPACSPrimitivesErrorMsg = "NelExportPACSPrimitves [node array] [output filename]"; +MCHAR *sExportShapeErrorMsg = _M("NeLExportShape [Object] [Filename.shape]"); +MCHAR *sExportShapeExErrorMsg = _M("NeLExportShapeEx [Object] [Filename.shape] [bShadow] [bExportLighting] [sLightmapPath] [nLightingLimit] [fLumelSize] [nOverSampling] [bExcludeNonSelected] [bShowLumel]"); +MCHAR *sExportAnimationErrorMsg = _M("NelExportAnimation [node array] [Filename.anim] [bool_scene_animation]"); +MCHAR *sExportCollisionErrorMsg = _M("NelExportCollision [node array] [output directory]"); +MCHAR *sExportPACSPrimitivesErrorMsg = _M("NelExportPACSPrimitves [node array] [output filename]"); extern CExportNelOptions theExportSceneStruct; @@ -207,8 +207,8 @@ Value* export_skeleton_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check (arg_list[0], MAXNode, "NelExportSkeleton [root node] [Filename]"); - type_check (arg_list[1], String, "NelExportSkeleton [root node] [Filename]"); + type_check (arg_list[0], MAXNode, _M("NelExportSkeleton [root node] [Filename]")); + type_check (arg_list[1], String, _M("NelExportSkeleton [root node] [Filename]")); // Get a good interface pointer Interface *ip = MAXScript_interface; @@ -298,7 +298,7 @@ Value* export_animation_cf (Value** arg_list, int count) else { // Error message - mprintf ("Error exporting animation %s in the file\n%s\n", (*vectNode.begin())->GetName(), sPath); + mprintf (_M("Error exporting animation %s in the file\n%s\n"), (*vectNode.begin())->GetName(), utf8ToTStr(sPath)); } } } @@ -321,8 +321,8 @@ Value* export_ig_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check (arg_list[0], Array, "NelExportInstanceGroup [Object array] [Filename]"); - type_check (arg_list[1], String, "NelExportInstanceGroup [Object array] [Filename]"); + type_check (arg_list[0], Array, _M("NelExportInstanceGroup [Object array] [Filename]")); + type_check (arg_list[1], String, _M("NelExportInstanceGroup [Object array] [Filename]")); // Get a good interface pointer Interface *ip = MAXScript_interface; @@ -342,7 +342,7 @@ Value* export_ig_cf (Value** arg_list, int count) // Check each value in the array uint i; for (i=0; i<(uint)array->size; i++) - type_check (array->get (i+1), MAXNode, "NelExportInstanceGroup [Object array] [Filename]"); + type_check (array->get (i+1), MAXNode, _M("NelExportInstanceGroup [Object array] [Filename]")); // Create a STL array if (array->size) @@ -380,8 +380,8 @@ Value* export_skeleton_weight_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check (arg_list[0], Array, "NelExportSkeletonWeight [Object array] [Filename]"); - type_check (arg_list[1], String, "NelExportSkeletonWeight [Object array] [Filename]"); + type_check (arg_list[0], Array, _M("NelExportSkeletonWeight [Object array] [Filename]")); + type_check (arg_list[1], String, _M("NelExportSkeletonWeight [Object array] [Filename]")); // Get a good interface pointer Interface *ip = MAXScript_interface; @@ -401,7 +401,7 @@ Value* export_skeleton_weight_cf (Value** arg_list, int count) // Check each value in the array uint i; for (i=0; i<(uint)array->size; i++) - type_check (array->get (i+1), MAXNode, "NelExportSkeletonWeight [Object array] [Filename]"); + type_check (array->get (i+1), MAXNode, _M("NelExportSkeletonWeight [Object array] [Filename]")); // Create a STL array if (array->size) @@ -462,8 +462,8 @@ Value* test_file_date_cf (Value** arg_list, int count) // Make sure we have the correct number of arguments (2) check_arg_count(view_shape, 2, count); - type_check (arg_list[0], String, "NeLTestFileDate [DestFilename] [SrcFilename]"); - type_check (arg_list[1], String, "NeLTestFileDate [DestFilename] [SrcFilename]"); + type_check (arg_list[0], String, _M("NeLTestFileDate [DestFilename] [SrcFilename]")); + type_check (arg_list[1], String, _M("NeLTestFileDate [DestFilename] [SrcFilename]")); // Get a good interface pointer Interface *ip = MAXScript_interface; @@ -526,7 +526,7 @@ Value* export_vegetable_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - char *message = "NelExportVegetable [node] [filename] [dialog error]"; + MCHAR *message = _M("NelExportVegetable [node] [filename] [dialog error]"); type_check (arg_list[0], MAXNode, message); type_check (arg_list[1], String, message); type_check (arg_list[2], Boolean, message); @@ -723,7 +723,7 @@ Value* export_lod_character_cf (Value** arg_list, int count) check_arg_count(export_lod_character, 3, count); // Check to see if the arguments match up to what we expect - char *message = "NelExportLodCharacter [node] [filename] [dialog error]"; + MCHAR *message = _M("NelExportLodCharacter [node] [filename] [dialog error]"); type_check (arg_list[0], MAXNode, message); type_check (arg_list[1], String, message); type_check (arg_list[2], Boolean, message); @@ -771,7 +771,7 @@ Value* node_properties_cf (Value** arg_list, int count) check_arg_count(export_lod_character, 2, count); // Check to see if the arguments match up to what we expect - char *message = "NelNodeProperties [node_array] [dialog error]"; + MCHAR *message = _M("NelNodeProperties [node_array] [dialog error]"); //type_check (arg_list[0], MAXNode, message); type_check (arg_list[0], Array, message); @@ -787,7 +787,7 @@ Value* node_properties_cf (Value** arg_list, int count) uint i; for (i=0; i<(uint)array->size; i++) { - type_check (array->get (i+1), MAXNode, "NelNodeProperties [node_array] [dialog error]"); + type_check (array->get (i+1), MAXNode, _M("NelNodeProperties [node_array] [dialog error]")); // Add to the array of nodes nodes.insert (array->get (i+1)->to_node()); @@ -830,7 +830,7 @@ Value* mirror_physique_cf (Value** arg_list, int count) check_arg_count(NelMirrorPhysique , 3, count); // Check to see if the arguments match up to what we expect - char *message = "NelMirrorPhysique [node] [vert_list_in] [threshold]"; + MCHAR *message = _M("NelMirrorPhysique [node] [vert_list_in] [threshold]"); //type_check type_check (arg_list[0], MAXNode, message); @@ -873,7 +873,7 @@ Value* get_file_modification_date_cf (Value** arg_list, int count) check_arg_count(NeLGetFileModificationDate , 1, count); // Check to see if the arguments match up to what we expect - char *message = "date NeLGetFileModificationDate [filename] - If an error occurred, returns undefined."; + MCHAR *message = _M("date NeLGetFileModificationDate [filename] - If an error occurred, returns undefined."); //type_check type_check (arg_list[0], String, message); @@ -911,7 +911,7 @@ Value* set_file_modification_date_cf (Value** arg_list, int count) check_arg_count(NeLSetFileModificationDate , 2, count); // Check to see if the arguments match up to what we expect - char *message = "bool NeLSetFileModificationDate [filename] [date] - If an error occurred, returns false."; + MCHAR *message = _M("bool NeLSetFileModificationDate [filename] [date] - If an error occurred, returns false."); //type_check type_check (arg_list[0], String, message); diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp index ef63a7d20..a7631c05a 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp @@ -781,8 +781,8 @@ void CExportNel::outputWarningMessage (const std::string &message) { MessageBox (_Ip->GetMAXHWnd(), utf8ToTStr(message), utf8ToTStr(_ErrorTitle), MB_OK|MB_ICONEXCLAMATION); } - mprintf (message); - mprintf ("\n"); + mprintf (utf8ToTStr(message)); + mprintf (_M("\n")); nlwarning ("Warning in max file %s : ", _Ip->GetCurFilePath()); nlwarning (message.c_str()); 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 5ca665591..3d308c47c 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 @@ -50,7 +50,7 @@ class PO2RPO : public Modifier { HWND hRollup; // From Animatable - MCHAR *GetObjectName() { return GetString(IDS_CLASS_NAME); } + const MCHAR *GetObjectName() { return GetString(IDS_CLASS_NAME); } //From Modifier //TODO: Add the channels that the modifier needs to perform its modification @@ -115,11 +115,11 @@ class PO2RPOClassDesc:public ClassDesc2 { return new PO2RPO(); } - const TCHAR * ClassName() {return "NeL Convert";} + const MCHAR * ClassName() {return _M("NeL Convert");} SClass_ID SuperClassID() {return OSM_CLASS_ID;} Class_ID ClassID() {return PO2RPO_CLASS_ID;} - const TCHAR* Category() {return "NeL Tools";} - const TCHAR* InternalName() { return _T("PatchObjectToNelPatchObject"); } // returns fixed parsable name (scripter-visible name) + const MCHAR* Category() {return _M("NeL Tools");} + const MCHAR* InternalName() { return _M("PatchObjectToNelPatchObject"); } // returns fixed parsable name (scripter-visible name) HINSTANCE HInstance() { return hInstance; } // returns owning module handle }; 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 cb667bced..7ce6c3068 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 @@ -157,7 +157,7 @@ def_visible_primitive( set_vertex_pos, "SetRykolVertexPos"); def_visible_primitive( get_vector_pos, "GetRykolVectorPos"); def_visible_primitive( set_vector_pos, "SetRykolVectorPos");*/ -void errorMessage (const char *msg, const char *title, Interface& it, bool dialog) +void errorMessage (const MCHAR *msg, const TCHAR *title, Interface& it, bool dialog) { // Text or dialog ? if (dialog) @@ -168,7 +168,8 @@ void errorMessage (const char *msg, const char *title, Interface& it, bool dialo else { // Text message - mprintf ((string(msg) + "\n").c_str()); + mprintf(msg); + mprintf(_M("\n")); } } @@ -180,7 +181,7 @@ export_zone_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "ExportRykolZone [Object]"); + type_check(arg_list[0], MAXNode, _M("ExportRykolZone [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -237,7 +238,7 @@ Value* import_zone_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - char *help = "NeLImportZone filename dialogError"; + MCHAR *help = _M("NeLImportZone filename dialogError"); type_check (arg_list[0], String, help); type_check (arg_list[1], Boolean, help); @@ -287,13 +288,15 @@ Value* import_zone_cf (Value** arg_list, int count) catch (const Exception& e) { // Error message - errorMessage (("Error when loading file "+filename+": "+e.what()).c_str(), "NeL import zone", *ip, dialog); + std::string msg = toString("Error when loading file %s: %s", filename.c_str(), e.what()); + errorMessage (utf8ToTStr(msg), _T("NeL import zone"), *ip, dialog); } } else { // Error message - errorMessage (("Can't open the file "+filename+" for reading.").c_str(), "NeL import zone", *ip, dialog); + std::string msg = toString("Can't open the file %s for reading.", filename.c_str()); + errorMessage (utf8ToTStr(msg), _T("NeL import zone"), *ip, dialog); } return ret; @@ -307,7 +310,7 @@ get_selected_tile_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "GetRykolSeltile [Object]"); + type_check(arg_list[0], MAXNode, _M("GetRykolSeltile [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -354,7 +357,7 @@ get_selected_patch_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "GetRykolSelPatch [Object]"); + type_check(arg_list[0], MAXNode, _M("GetRykolSelPatch [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -401,7 +404,7 @@ get_selected_vertex_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "GetRykolSelVertex [Object]"); + type_check(arg_list[0], MAXNode, _M("GetRykolSelVertex [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -448,7 +451,7 @@ set_tile_mode_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "SetRykolTileMode [Object]"); + type_check(arg_list[0], MAXNode, _M("SetRykolTileMode [Object]")); // Get a good interface pointer Interface *ip = MAXScript_interface; @@ -498,7 +501,7 @@ set_compute_interior_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "RykolComputeInterior [Object]"); + type_check(arg_list[0], MAXNode, _M("RykolComputeInterior [Object]")); // Get a good interface pointer Interface *ip = MAXScript_interface; @@ -546,7 +549,7 @@ set_interior_mode_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "SetRykolInteriorMode [Object]"); + type_check(arg_list[0], MAXNode, _M("SetRykolInteriorMode [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -598,7 +601,7 @@ set_vertex_count_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "GetRykolVertexCount [Object]"); + type_check(arg_list[0], MAXNode, _M("GetRykolVertexCount [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -638,7 +641,7 @@ set_vector_count_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "GetRykolVectorCount [Object]"); + type_check(arg_list[0], MAXNode, _M("GetRykolVectorCount [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -678,7 +681,7 @@ set_vertex_pos_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "SetRykolVertexPos [Object]"); + type_check(arg_list[0], MAXNode, _M("SetRykolVertexPos [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -728,7 +731,7 @@ set_vector_pos_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "SetRykolVectorPos [Object]"); + type_check(arg_list[0], MAXNode, _M("SetRykolVectorPos [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -778,7 +781,7 @@ get_vertex_pos_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "GetRykolVertexPos [Object]"); + type_check(arg_list[0], MAXNode, _M("GetRykolVertexPos [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -822,7 +825,7 @@ get_vector_pos_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "GetRykolVectorPos [Object]"); + type_check(arg_list[0], MAXNode, _M("GetRykolVectorPos [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -867,7 +870,7 @@ get_edge_vect1_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "GetRykolEdgesVect1 [Object]"); + type_check(arg_list[0], MAXNode, _M("GetRykolEdgesVect1 [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -911,7 +914,7 @@ get_edge_vect2_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "GetRykolEdgesVect2 [Object]"); + type_check(arg_list[0], MAXNode, _M("GetRykolEdgesVect2 [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -955,7 +958,7 @@ get_edge_vert1_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "GetRykolEdgesVert1 [Object]"); + type_check(arg_list[0], MAXNode, _M("GetRykolEdgesVert1 [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -1000,7 +1003,7 @@ get_edge_vert2_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "GetRykolEdgesVert2 [Object]"); + type_check(arg_list[0], MAXNode, _M("GetRykolEdgesVert2 [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -1044,7 +1047,7 @@ get_sel_edge_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "SetRykolSelEdges [Object]"); + type_check(arg_list[0], MAXNode, _M("SetRykolSelEdges [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -1092,7 +1095,7 @@ set_steps_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "SetRykolPatchSteps [Object]"); + type_check(arg_list[0], MAXNode, _M("SetRykolPatchSteps [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -1155,7 +1158,7 @@ set_tile_steps_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "SetRykoltileSteps [Object]"); + type_check(arg_list[0], MAXNode, _M("SetRykoltileSteps [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -1208,7 +1211,7 @@ get_tile_count_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "GetRykolTileCount [Zone] [PatchNumber]"); + type_check(arg_list[0], MAXNode, _M("GetRykolTileCount [Zone] [PatchNumber]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -1265,7 +1268,7 @@ Value* get_patch_vertex_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - char *message="NeLGetPatchVertex [NeLPatchMesh] [PatchId] [VertexId]"; + const MCHAR *message= _M("NeLGetPatchVertex [NeLPatchMesh] [PatchId] [VertexId]"); type_check(arg_list[0], MAXNode, message); type_check(arg_list[1], Integer, message); type_check(arg_list[2], Integer, message); @@ -1336,7 +1339,7 @@ get_patch_count_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "GetRykolPatchCount [Object]"); + type_check(arg_list[0], MAXNode, _M("GetRykolPatchCount [Object]")); //type_check(arg_list[1], Integer, "SetRykolPatchSteps [Object]"); // Get a good interface pointer @@ -1389,10 +1392,10 @@ get_tile_tile_number_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber] [Layer]"); - type_check(arg_list[1], Integer, "NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber] [Layer]"); - type_check(arg_list[2], Integer, "NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber] [Layer]"); - type_check(arg_list[3], Integer, "NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber] [Layer]"); + type_check(arg_list[0], MAXNode, _M("NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber] [Layer]")); + type_check(arg_list[1], Integer, _M("NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber] [Layer]")); + type_check(arg_list[2], Integer, _M("NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber] [Layer]")); + type_check(arg_list[3], Integer, _M("NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber] [Layer]")); // Get a good interface pointer Interface *ip = MAXScript_interface; @@ -1411,7 +1414,7 @@ get_tile_tile_number_cf(Value** arg_list, int count) uint layer=arg_list[3]->to_int()-1; if (layer>=3) { - mprintf ("Error: layer must be 1, 2, or 3\n"); + mprintf (_M("Error: layer must be 1, 2, or 3\n")); } else { @@ -1427,7 +1430,7 @@ get_tile_tile_number_cf(Value** arg_list, int count) uint nPatch=arg_list[1]->to_int()-1; if (nPatch>=tri->rpatch->getUIPatchSize()) { - mprintf ("Error: patch index is invalid.\n"); + mprintf (_M("Error: patch index is invalid.\n")); } else { @@ -1439,7 +1442,7 @@ get_tile_tile_number_cf(Value** arg_list, int count) uint tile=arg_list[2]->to_int()-1; if (tile>=nPatchCount) { - mprintf ("Error: tile index is invalid.\n"); + mprintf (_M("Error: tile index is invalid.\n")); } else { @@ -1475,9 +1478,9 @@ get_tile_noise_number_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber]"); - type_check(arg_list[1], Integer, "NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber]"); - type_check(arg_list[2], Integer, "NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber]"); + type_check(arg_list[0], MAXNode, _M("NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber]")); + type_check(arg_list[1], Integer, _M("NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber]")); + type_check(arg_list[2], Integer, _M("NelGetTileTileNumber [Zone] [PatchNumber] [TileNumber]")); // Get a good interface pointer Interface *ip = MAXScript_interface; @@ -1504,7 +1507,7 @@ get_tile_noise_number_cf(Value** arg_list, int count) uint nPatch=arg_list[1]->to_int()-1; if (nPatch>=tri->rpatch->getUIPatchSize()) { - mprintf ("Error: patch index is invalid.\n"); + mprintf (_M("Error: patch index is invalid.\n")); } else { @@ -1516,7 +1519,7 @@ get_tile_noise_number_cf(Value** arg_list, int count) uint tile=arg_list[2]->to_int()-1; if (tile>=nPatchCount) { - mprintf ("Error: patch index is invalid.\n"); + mprintf (_M("Error: patch index is invalid.\n")); } else { @@ -1544,10 +1547,10 @@ set_tile_noise_number_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "NelGetTileNoiseNumber [Zone] [PatchNumber] [TileNumber] [noise]"); - type_check(arg_list[1], Integer, "NelGetTileNoiseNumber [Zone] [PatchNumber] [TileNumber] [noise]"); - type_check(arg_list[2], Integer, "NelGetTileNoiseNumber [Zone] [PatchNumber] [TileNumber] [noise]"); - type_check(arg_list[3], Integer, "NelGetTileNoiseNumber [Zone] [PatchNumber] [TileNumber] [noise]"); + type_check(arg_list[0], MAXNode, _M("NelGetTileNoiseNumber [Zone] [PatchNumber] [TileNumber] [noise]")); + type_check(arg_list[1], Integer, _M("NelGetTileNoiseNumber [Zone] [PatchNumber] [TileNumber] [noise]")); + type_check(arg_list[2], Integer, _M("NelGetTileNoiseNumber [Zone] [PatchNumber] [TileNumber] [noise]")); + type_check(arg_list[3], Integer, _M("NelGetTileNoiseNumber [Zone] [PatchNumber] [TileNumber] [noise]")); // Get a good interface pointer Interface *ip = MAXScript_interface; @@ -1566,7 +1569,7 @@ set_tile_noise_number_cf(Value** arg_list, int count) uint noise=arg_list[3]->to_int()-1; if (noise>=16) { - mprintf ("Error: noise value must be 1~16\n"); + mprintf (_M("Error: noise value must be 1~16\n")); } else { @@ -1582,7 +1585,7 @@ set_tile_noise_number_cf(Value** arg_list, int count) uint nPatch=arg_list[1]->to_int()-1; if (nPatch>=tri->rpatch->getUIPatchSize()) { - mprintf ("Error: patch index is invalid.\n"); + mprintf (_M("Error: patch index is invalid.\n")); } else { @@ -1594,7 +1597,7 @@ set_tile_noise_number_cf(Value** arg_list, int count) uint tile=arg_list[2]->to_int()-1; if (tile>=nPatchCount) { - mprintf ("Error: patch index is invalid.\n"); + mprintf (_M("Error: patch index is invalid.\n")); } else { @@ -1646,13 +1649,13 @@ load_bank_cf(Value** arg_list, int count) } else { - mprintf ("Error: can't open bank file %s\n", bankName.c_str()); + mprintf (_M("Error: can't open bank file %s\n"), bankName.c_str()); } } catch (const Exception& e) { // Error message - mprintf ("Error: %s\n", e.what()); + mprintf (_M("Error: %s\n"), e.what()); } } @@ -1668,7 +1671,7 @@ get_tile_set_cf(Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], Integer, "NelGetTileSet [tileId]"); + type_check(arg_list[0], Integer, _M("NelGetTileSet [tileId]")); // ok ? int nRet=-1; @@ -1677,7 +1680,7 @@ get_tile_set_cf(Value** arg_list, int count) uint tile=arg_list[0]->to_int()-1; if (tile>=(uint)scriptedBank.getTileCount()) { - mprintf ("Error: tile number is wrong. (1 ~ %d)\n", scriptedBank.getTileCount()); + mprintf (_M("Error: tile number is wrong. (1 ~ %d)\n"), scriptedBank.getTileCount()); } else { @@ -1702,7 +1705,7 @@ Value* set_tile_bank_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], String, "NelSetTileBank [tile bank pathname]"); + type_check(arg_list[0], String, _M("NelSetTileBank [tile bank pathname]")); // ok ? const std::string pathname = tStrToUtf8(arg_list[0]->to_string()); @@ -1947,8 +1950,8 @@ attach_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "NeLAttachPatchMesh [RykolPatchMeshSrc] [RykolPatchMeshDest]"); - type_check(arg_list[1], MAXNode, "NeLAttachPatchMesh [RykolPatchMeshSrc] [RykolPatchMeshDest]"); + type_check(arg_list[0], MAXNode, _M("NeLAttachPatchMesh [RykolPatchMeshSrc] [RykolPatchMeshDest]")); + type_check(arg_list[1], MAXNode, _M("NeLAttachPatchMesh [RykolPatchMeshSrc] [RykolPatchMeshDest]")); // Get a good interface pointer Interface *ip = MAXScript_interface; @@ -2005,8 +2008,8 @@ weld_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "NeLWeldPatchMesh [RykolPatchMeshSrc] [threshold]"); - type_check(arg_list[1], Float, "NeLWeldPatchMesh [RykolPatchMeshSrc] [threshold]"); + type_check(arg_list[0], MAXNode, _M("NeLWeldPatchMesh [RykolPatchMeshSrc] [threshold]")); + type_check(arg_list[1], Float, _M("NeLWeldPatchMesh [RykolPatchMeshSrc] [threshold]")); // Get a good interface pointer Interface *ip = MAXScript_interface; diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/editpat.h b/code/nel/tools/3d/plugin_max/nel_patch_edit/editpat.h index ec8947571..78e5ad0db 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/editpat.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/editpat.h @@ -752,7 +752,7 @@ class EditPatchMod : public Modifier, IPatchOps, IPatchSelect, ISubMtlAPI, Attac void BeginEditParams( IObjParam *ip, ULONG flags, Animatable *prev ); void EndEditParams( IObjParam *ip, ULONG flags, Animatable *next ); RefTargetHandle Clone(RemapDir& remap = DefaultRemapDir()); - TCHAR *GetObjectName() { return GetString(IDS_TH_EDITPATCH); } + const MCHAR *GetObjectName() { return GetString(IDS_TH_EDITPATCH); } void ActivateSubobjSel(int level, XFormModes& modes ); int NeedUseSubselButton() { return 0; } void SelectSubPatch(int index); @@ -929,10 +929,10 @@ class EditPatchClassDesc:public ClassDesc { { return new EditPatchMod; } - const TCHAR * ClassName() { return "NeL Edit"; } + const MCHAR * ClassName() { return _M("NeL Edit"); } SClass_ID SuperClassID() { return OSM_CLASS_ID; } Class_ID ClassID() { return Class_ID(0x4dd14a3c, 0x4ac23c0c); } - const TCHAR* Category() { return "NeL Tools";} + const MCHAR* Category() { return _M("NeL Tools");} void ResetClassParams(BOOL fileReset); }; diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np.cpp index b44376b53..980bb64d8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np.cpp @@ -890,9 +890,9 @@ Value *turn_patch_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - type_check(arg_list[0], MAXNode, "RykolTurnPatch [Node] [Modifier] [Patch]"); - type_check(arg_list[1], MAXModifier, "RykolTurnPatch [Node] [Modifier] [Patch]"); - type_check(arg_list[2], Integer, "RykolTurnPatch [Node] [Modifier] [Patch]"); + type_check(arg_list[0], MAXNode, _M("RykolTurnPatch [Node] [Modifier] [Patch]")); + type_check(arg_list[1], MAXModifier, _M("RykolTurnPatch [Node] [Modifier] [Patch]")); + type_check(arg_list[2], Integer, _M("RykolTurnPatch [Node] [Modifier] [Patch]")); // Get a good interface pointer Interface *ip = MAXScript_interface; diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_material.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_material.cpp index ace6d41cc..bc36eae43 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_material.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_material.cpp @@ -276,7 +276,7 @@ void EditPatchMod::SetSelTess(int nU, int nV) } if (holdNeeded) - theHold.Accept("Tile count in U and V change"); + theHold.Accept(_M("Tile count in U and V change")); else { ip->DisplayTempPrompt(GetString(IDS_TH_NOPATCHESSEL), PROMPT_TIME); @@ -453,7 +453,7 @@ void EditPatchMod::setSmoothFlags (bool smooth) } if (holdNeeded) - theHold.Accept("Tile count in U and V change"); + theHold.Accept(_M("Tile count in U and V change")); else { ip->DisplayTempPrompt(GetString(IDS_TH_NOPATCHESSEL), PROMPT_TIME); @@ -589,7 +589,7 @@ void EditPatchMod::BalanceSelPatch () } if (holdNeeded) - theHold.Accept("Balance tile"); + theHold.Accept(_M("Balance tile")); else { ip->DisplayTempPrompt(GetString(IDS_TH_NOPATCHESSEL), PROMPT_TIME); 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 a6f90a89c..bbe8e95a9 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 @@ -167,16 +167,14 @@ void EditPatchMod::BeginEditParams(IObjParam *ip, ULONG flags, Animatable *prev) if (selLevel == EP_TILE) { - hTilePanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_TILE), - PatchTileDlgProc, "Tile Properties", (LPARAM) this, rsTile ? 0 : APPENDROLL_CLOSED); + hTilePanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_TILE), PatchTileDlgProc, _M("Tile Properties"), (LPARAM) this, rsTile ? 0 : APPENDROLL_CLOSED); } else hTilePanel = NULL; if (selLevel == EP_EDGE) { - hEdgePanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_EDGE), - PatchEdgeDlgProc, "Edge Properties", (LPARAM) this, rsEdge ? 0 : APPENDROLL_CLOSED); + hEdgePanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_EDGE), PatchEdgeDlgProc, _M("Edge Properties"), (LPARAM) this, rsEdge ? 0 : APPENDROLL_CLOSED); } else hEdgePanel = NULL; @@ -328,7 +326,7 @@ ISubObjType *EditPatchMod::GetSubObjType(int i) SOT_Vertex.SetName(GetString(IDS_TH_VERTEX)); SOT_Edge.SetName(GetString(IDS_TH_EDGE)); SOT_Patch.SetName(GetString(IDS_TH_PATCH)); - SOT_Tile.SetName("Tile"); + SOT_Tile.SetName(_M("Tile")); // SOT_Element.SetName(GetString(IDS_TH_ELEMENT)); // SOT_Handle.SetName(GetString(IDS_TH_HANDLE)); } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo.cpp b/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo.cpp index 3acaf28bb..dada38542 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo.cpp @@ -43,9 +43,9 @@ class RPOClassDesc:public ClassDesc { return new RPO; } - const TCHAR * ClassName() + const MCHAR * ClassName() { - return _T("RklPatch"); + return _M("RklPatch"); } SClass_ID SuperClassID() { @@ -55,9 +55,9 @@ class RPOClassDesc:public ClassDesc { return RYKOLPATCHOBJ_CLASS_ID; } - const TCHAR* Category() + const MCHAR* Category() { - return _T("Rykol Tools"); + return _M("Rykol Tools"); } }; diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo.h b/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo.h index 4464ce10f..0faa95aa6 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo.h @@ -83,14 +83,14 @@ class RPO : public PatchObject int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt); void Snap(TimeValue t, INode* inode, SnapInfo *snap, IPoint2 *p, ViewExp *vpt); //TODO: Return the name that will appear in the history browser (modifier stack) - const MCHAR *GetObjectName() { return _T("Rykol Patch Object");} + const MCHAR *GetObjectName() { return _M("Rykol Patch Object");} void GetWorldBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box ); void GetLocalBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box ); void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm, BOOL useSel ); //TODO: Return the default name of the node when it is created. - void InitNodeName(TSTR& s) { s.FromUTF8("Rykol Patch Object"); } + void InitNodeName(TSTR& s) { s = _M("Rykol Patch Object"); } // From Object BOOL HasUVW(); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h index 20009d0c7..fdc49c2e2 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h @@ -482,7 +482,7 @@ class PaintPatchMod : public Modifier void BeginEditParams( IObjParam *ip, ULONG flags, Animatable *prev ); void EndEditParams( IObjParam *ip, ULONG flags, Animatable *next ); RefTargetHandle Clone(RemapDir& remap = DefaultRemapDir()); - TCHAR *GetObjectName() { return "NeL Patch Painter"; } + const MCHAR *GetObjectName() { return _M("NeL Patch Painter"); } void RescaleWorldUnits(float f); @@ -500,10 +500,10 @@ class EditPatchClassDesc:public ClassDesc { { return new PaintPatchMod; } - const TCHAR * ClassName() { return "NeL Painter"; } + const MCHAR * ClassName() { return _M("NeL Painter"); } SClass_ID SuperClassID() { return OSM_CLASS_ID; } Class_ID ClassID() { return Class_ID(0xc49560f, 0x3c3d68e7); } - const TCHAR* Category() { return "NeL Tools";} + const MCHAR* Category() { return _M("NeL Tools");} void ResetClassParams(BOOL fileReset); }; diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp index de24e77de..b5894e9a8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp @@ -4034,7 +4034,7 @@ void EPM_PaintCMode::DoPaint () patchData->SetFlag(EPD_BEENDONE, TRUE); } - theHold.Accept("Patch change"); + theHold.Accept(_M("Patch change")); nodes.DisposeTemporary(); pobj->ClearPatchDataFlag(mcList, EPD_BEENDONE); 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 a4c22cbaf..a05fc67b7 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 @@ -47,8 +47,7 @@ void PaintPatchMod::BeginEditParams(IObjParam *ip, ULONG flags, Animatable *prev CreatePatchDataTempData(); - hOpsPanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_OPS), - PatchOpsDlgProc, "Geometry", (LPARAM) this, rsOps ? 0 : APPENDROLL_CLOSED); + hOpsPanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_OPS), PatchOpsDlgProc, _M("Geometry"), (LPARAM) this, rsOps ? 0 : APPENDROLL_CLOSED); // Create sub object editing modes. paintMode = new EPM_PaintCMode(this, ip); 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 045d8489d..3d58b8027 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 @@ -41,10 +41,10 @@ class VertexPaintClassDesc :public ClassDesc public: int IsPublic() { return 1; } void * Create(BOOL loading = FALSE) { return new VertexPaint(); } - const TCHAR * ClassName() { return GetString(IDS_CLASS_NAME); } + const MCHAR * ClassName() { return GetString(IDS_CLASS_NAME); } SClass_ID SuperClassID() { return OSM_CLASS_ID; } Class_ID ClassID() { return VERTEX_TREE_PAINT_CLASS_ID; } - const TCHAR* Category() { return GetString(IDS_CATEGORY); } + const MCHAR* Category() { return GetString(IDS_CATEGORY); } void ResetClassParams(BOOL fileReset) {} }; diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.h b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.h index 510828754..2921235c2 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.h +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.h @@ -131,7 +131,7 @@ public: void GetClassName(TSTR& s) { s= TSTR(GetString(IDS_CLASS_NAME)); } virtual Class_ID ClassID() { return VERTEX_TREE_PAINT_CLASS_ID;} RefTargetHandle Clone(RemapDir& remap = DefaultRemapDir()); - TCHAR *GetObjectName() { return GetString(IDS_CLASS_NAME); } + const MCHAR *GetObjectName() { return GetString(IDS_CLASS_NAME); } IOResult Load(ILoad *iload); IOResult Save(ISave *isave); IOResult LoadLocalData(ILoad *iload, LocalModData **pld); diff --git a/code/nel/tools/3d/plugin_max/tile_utility/rgbadd.cpp b/code/nel/tools/3d/plugin_max/tile_utility/rgbadd.cpp index a024c962c..68aa70b61 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/rgbadd.cpp +++ b/code/nel/tools/3d/plugin_max/tile_utility/rgbadd.cpp @@ -107,10 +107,10 @@ class RGBAddClassDesc:public ClassDesc2 { const TCHAR * ClassName() { return GetString(IDS_DS_RGBMULT_CDESC); } // mjm - 2.3.99 SClass_ID SuperClassID() { return TEXMAP_CLASS_ID; } Class_ID ClassID() { return RGBAddClassID; } - const TCHAR* Category() { return TEXMAP_CAT_COMP; } + const MCHAR* Category() { return TEXMAP_CAT_COMP; } // JBW: new descriptor data accessors added. Note that the // internal name is hardwired since it must not be localized. - const TCHAR* InternalName() { return _T("RGBAdd"); } // returns fixed parsable name (scripter-visible name) + const MCHAR* InternalName() { return _M("RGBAdd"); } // returns fixed parsable name (scripter-visible name) HINSTANCE HInstance() { return hInstance; } // returns owning module handle }; 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 88d3ef41d..c77a027a9 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 @@ -75,8 +75,8 @@ class Tile_utilityClassDesc:public ClassDesc2 const TCHAR * ClassName() {return _T("NeL Tile Bank");} SClass_ID SuperClassID() {return UTILITY_CLASS_ID;} Class_ID ClassID() {return TILE_UTILITY_CLASS_ID;} - const TCHAR* Category() {return _T("NeL Tools");} - const TCHAR* InternalName() { return _T("NeL tile bank utility"); } // returns fixed parsable name (scripter-visible name) + const MCHAR* Category() {return _M("NeL Tools");} + const MCHAR* InternalName() { return _M("NeL tile bank utility"); } // returns fixed parsable name (scripter-visible name) HINSTANCE HInstance() { return hInstance; } // returns owning module handle }; From f3564ed86e791fb69c9181896de8895596f344cc Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 3 Dec 2016 18:14:31 +0100 Subject: [PATCH 18/50] Fixed: Compilation with GCC 6 --HG-- branch : develop --- code/nel/include/nel/3d/gpu_program_params.h | 5 +++-- code/nel/include/nel/misc/debug.h | 4 ++-- code/nel/include/nel/net/service.h | 4 ++-- code/nel/src/3d/gpu_program_params.cpp | 5 ++--- code/ryzom/common/src/game_share/persistent_data_template.h | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/nel/include/nel/3d/gpu_program_params.h b/code/nel/include/nel/3d/gpu_program_params.h index ce6b8b2f0..4615c58d9 100644 --- a/code/nel/include/nel/3d/gpu_program_params.h +++ b/code/nel/include/nel/3d/gpu_program_params.h @@ -27,7 +27,8 @@ #ifndef NL3D_GPU_PROGRAM_PARAMS_H #define NL3D_GPU_PROGRAM_PARAMS_H -#include + +#include "nel/misc/types_nl.h" // STL includes #include @@ -167,7 +168,7 @@ private: std::map m_MapName; // map from name to offset size_t m_First; size_t m_Last; - static const size_t s_End = -1; + static const size_t s_End; }; /* class CGPUProgramParams */ diff --git a/code/nel/include/nel/misc/debug.h b/code/nel/include/nel/misc/debug.h index 54e22880d..d01c85f1c 100644 --- a/code/nel/include/nel/misc/debug.h +++ b/code/nel/include/nel/misc/debug.h @@ -151,8 +151,8 @@ void setCrashAlreadyReported(bool state); * Note 2 : To show a warning under GCC, use #warning "Your warning here", * see nel/net/net_manager.h for an example on how to use these correctly. */ -#define NL_LOC_MSG __FILE__"("NL_MACRO_TO_STR(__LINE__)") : Message: " -#define NL_LOC_WRN __FILE__"("NL_MACRO_TO_STR(__LINE__)") : Warning Msg: " +#define NL_LOC_MSG __FILE__ "(" NL_MACRO_TO_STR(__LINE__) ") : Message: " +#define NL_LOC_WRN __FILE__ "(" NL_MACRO_TO_STR(__LINE__) ") : Warning Msg: " /** diff --git a/code/nel/include/nel/net/service.h b/code/nel/include/nel/net/service.h index 8c7a52c63..02967d317 100644 --- a/code/nel/include/nel/net/service.h +++ b/code/nel/include/nel/net/service.h @@ -124,7 +124,7 @@ int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL scn->setArgs (lpCmdLine); \ createDebug(NULL,!scn->haveLongArg("nolog"));\ scn->setCallbackArray (__ServiceCallbackArray, sizeof(__ServiceCallbackArray)/sizeof(__ServiceCallbackArray[0])); \ - sint retval = scn->main (__ServiceShortName, __ServiceLongName, __ServicePort, __ConfigDir, __LogDir, __DATE__" "__TIME__); \ + sint retval = scn->main (__ServiceShortName, __ServiceLongName, __ServicePort, __ConfigDir, __LogDir, __DATE__ " " __TIME__); \ delete scn; \ return retval; \ } @@ -139,7 +139,7 @@ int main(int argc, const char **argv) \ scn->setArgs (argc, argv); \ createDebug(NULL,!scn->haveLongArg("nolog"));\ scn->setCallbackArray (__ServiceCallbackArray, sizeof(__ServiceCallbackArray)/sizeof(__ServiceCallbackArray[0])); \ - sint retval = scn->main (__ServiceShortName, __ServiceLongName, __ServicePort, __ConfigDir, __LogDir, __DATE__" "__TIME__); \ + sint retval = scn->main (__ServiceShortName, __ServiceLongName, __ServicePort, __ConfigDir, __LogDir, __DATE__ " " __TIME__); \ delete scn; \ return retval; \ } diff --git a/code/nel/src/3d/gpu_program_params.cpp b/code/nel/src/3d/gpu_program_params.cpp index 9e84865be..f46ba8713 100644 --- a/code/nel/src/3d/gpu_program_params.cpp +++ b/code/nel/src/3d/gpu_program_params.cpp @@ -26,7 +26,6 @@ */ #include "std3d.h" -#include "nel/misc/types_nl.h" #include "nel/3d/gpu_program_params.h" // STL includes @@ -44,14 +43,14 @@ using namespace std; namespace NL3D { +const size_t CGPUProgramParams::s_End = -1; + CGPUProgramParams::CGPUProgramParams() : m_First(s_End), m_Last(s_End) { - } CGPUProgramParams::~CGPUProgramParams() { - } void CGPUProgramParams::copy(CGPUProgramParams *params) diff --git a/code/ryzom/common/src/game_share/persistent_data_template.h b/code/ryzom/common/src/game_share/persistent_data_template.h index ce5cd485c..2587c3864 100644 --- a/code/ryzom/common/src/game_share/persistent_data_template.h +++ b/code/ryzom/common/src/game_share/persistent_data_template.h @@ -359,7 +359,7 @@ void PERSISTENT_CLASS::store(CPersistentDataRecord &pdr _PERSISTENT_STORE_ARGS) // this class has been configured to use a specific token family. This means that it is not possible // to store the class to a pdr that is not using the same token family. BOMB_IF(pdr.getTokenFamily()!=NL_MACRO_TO_STR(PERSISTENT_TOKEN_FAMILY), - NL_MACRO_TO_STR(PERSISTENT_CLASS)"::store() requires token family '"NL_MACRO_TO_STR(PERSISTENT_TOKEN_FAMILY)"'" + NL_MACRO_TO_STR(PERSISTENT_CLASS) "::store() requires token family '" NL_MACRO_TO_STR(PERSISTENT_TOKEN_FAMILY) "'" " but pdr is using token family '"+pdr.getTokenFamily()+"'", return); #endif From 730fee8538dd054236d6efbeb526ac5711f0089a Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 3 Dec 2016 18:14:58 +0100 Subject: [PATCH 19/50] Fixed: Compilation --HG-- branch : develop --- code/nel/src/ligo/ligo_material.cpp | 2 +- code/nel/src/ligo/ligo_material.h | 2 +- code/nel/src/ligo/transition.cpp | 5 +++-- code/nel/src/ligo/zone_edge.cpp | 2 +- code/nel/src/ligo/zone_template.cpp | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/code/nel/src/ligo/ligo_material.cpp b/code/nel/src/ligo/ligo_material.cpp index c5e7541a3..d62f73be9 100644 --- a/code/nel/src/ligo/ligo_material.cpp +++ b/code/nel/src/ligo/ligo_material.cpp @@ -18,7 +18,7 @@ #include "ligo_material.h" // Ligo include -#include "ligo_error.h" +#include "nel/ligo/ligo_error.h" //using namespace NL3D; diff --git a/code/nel/src/ligo/ligo_material.h b/code/nel/src/ligo/ligo_material.h index 16b236cb7..986a020f1 100644 --- a/code/nel/src/ligo/ligo_material.h +++ b/code/nel/src/ligo/ligo_material.h @@ -18,7 +18,7 @@ #define NL_MATERIAL_LIGO_H #include "nel/misc/types_nl.h" -#include "zone_template.h" +#include "nel/ligo/zone_template.h" // NeL include //#include "3d/zone.h" diff --git a/code/nel/src/ligo/transition.cpp b/code/nel/src/ligo/transition.cpp index ee6921c78..47e204677 100644 --- a/code/nel/src/ligo/transition.cpp +++ b/code/nel/src/ligo/transition.cpp @@ -18,8 +18,9 @@ #include "transition.h" // Ligo include -#include "zone_template.h" -#include "ligo_error.h" +#include "nel/ligo/zone_template.h" +#include "nel/ligo/ligo_error.h" + #include "ligo_material.h" namespace NLLIGO diff --git a/code/nel/src/ligo/zone_edge.cpp b/code/nel/src/ligo/zone_edge.cpp index 8bd2c7fa2..7b4a75d47 100644 --- a/code/nel/src/ligo/zone_edge.cpp +++ b/code/nel/src/ligo/zone_edge.cpp @@ -18,7 +18,7 @@ // Ligo include #include "zone_edge.h" #include "nel/ligo/ligo_config.h" -#include "ligo_error.h" +#include "nel/ligo/ligo_error.h" // NeL include #include "nel/misc/matrix.h" diff --git a/code/nel/src/ligo/zone_template.cpp b/code/nel/src/ligo/zone_template.cpp index 9f51c3c8e..e21cde438 100644 --- a/code/nel/src/ligo/zone_template.cpp +++ b/code/nel/src/ligo/zone_template.cpp @@ -15,8 +15,8 @@ // along with this program. If not, see . #include "stdligo.h" -#include "zone_template.h" -#include "ligo_error.h" +#include "nel/ligo/zone_template.h" +#include "nel/ligo/ligo_error.h" #include "nel/ligo/ligo_config.h" #include "nel/misc/stream.h" From 71c963af36d0f328f55976f13d87068294d8abb1 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 13:24:04 +0100 Subject: [PATCH 20/50] Added: Snap project for Ryzom Installer --HG-- branch : develop --- dist/snap/setup/gui/ryzom.desktop | 11 ++++++ dist/snap/setup/gui/ryzom.png | Bin 0 -> 38172 bytes dist/snap/snapcraft.yaml | 55 ++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 dist/snap/setup/gui/ryzom.desktop create mode 100644 dist/snap/setup/gui/ryzom.png create mode 100644 dist/snap/snapcraft.yaml diff --git a/dist/snap/setup/gui/ryzom.desktop b/dist/snap/setup/gui/ryzom.desktop new file mode 100644 index 000000000..039a43d76 --- /dev/null +++ b/dist/snap/setup/gui/ryzom.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=Ryzom +Type=Application +GenericName=ryzom +Exec=ryzom.ryzom +Icon=${SNAP}/meta/gui/ryzom.png +Terminal=false +Hidden=false +Keywords=ryzom,mmorpg,game +Categories=Game;RolePlaying; diff --git a/dist/snap/setup/gui/ryzom.png b/dist/snap/setup/gui/ryzom.png new file mode 100644 index 0000000000000000000000000000000000000000..a51ce87ab3cd4848380314bdb549c1ddc538263f GIT binary patch literal 38172 zcmV)TK(W7xP)004R>004l5008;`004mK004C`008P>0026e000+ooVrmw00006 zVoOIv0RI600RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_000McNliru-wPKG2qhfh zDJTE{fB;EEK~#9!-2Hj5tVw#_hy60Yy}sJ()Ty(dyKjAao$l$`Ff*6|2+#u(q#2?` z(h-tn$zgeADC8yV2${BQh4qJRDQt&qD`bT%F=Ux0MUeyvVj%{zV5X;My8CwD{oH%c zzSXI{>f67}^dGlp0D`0lQXm03BTiJ+S5Ur{c-+c4UHwFKUx2!b3?FcN(C4>uY9&=TP91N`p*{nJ13 zeN3S{tpkvZS;Cgb)&pg%E+1*0PkMYYfsD6Kky} zWm(R((wR~!(@JI9m{JI|W!c8EEp1u0wrtDTmTjbE86hxQ8}pKAFS%HC?LX+B^zYmL z&=KHw0WW^neStt2V=SY!ZM1QXF|L6?2m)h_RHaI_)`ihpDWwz$O9(7JRr<0hvMevk zvMjX_f|ujfU<{%x3V{%AtzKR8E0xzR+rBMcnuZ0&42&^DW6TIxXsxGZSx)jSkIJGf zq$Raw*-BcLwjD=1o~v!wF-U<@+Gu6afM-F~`NKnoKQsjR2LLY&280lRFj_lC>(Cfe zH^x*9G=va6V~o&RM`ck?%2H(loU$x3X<317*$ru14WmsNFBW_8BAVt|mPhkNUKFJ+ zi$Z^DFQnF5sIs)nvh>!sHgEWWe;2`$?KplV3~kqQ6@sZiL{eHp2$2J0W5j-*oqrLt^GIi9cGATZK#Orea)3XM_*+Y)To{@{u52Tp*zG-&jXJ?c+=t50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v&d%z?JLy$hu^+?wV9VaRaN+(|F*ePv-)+#8Y zP)dR*71Z4tvAyoBcnEikeURV--UsEKSKc}0z17~e+Pg-F(5es`VVmsQHoXfifo+Cv zTdc7nggGz`+n~-B+hERuA8Y(iSML6Wuk}Cc`YQq8_4UVqAZ!Cwk%%N)KY>0XBeu)L z1Z09R4#)@?1n5KPfpi080TPfXh-gGq02Q{c@}s!*R^^?5lMsS{NC>YjgqQ8@w%ScA zP(!E)ln~0hg3Jxu+Ppd2Qmq-=ef*re0ge1*-QJfSyuWm<|LF(*SAP8wAi&llY^?&s zh@=9YJ0J$YV7pv!cgp}62B8o1Kr&!^+GBg0yIb+PYoctEiok1ec)-h6=$5UfzZQA{ zYzV9&tOG281tBchzF)C5@dZED_OIH{|CI{<%MbeBnd@hO@cQ-j@}SrXFapw_0-|?! z4}kvmmM+lQewKtS4DsE+|1kuw@32iW-W{!OxJzw^a3}cfy(Wb1>-OHT75HmS|FY2k zofQ1*>;DJ0B`E=(lV=D3001R)MObuXVRU6WV{&C-bY%cCFflbPF)=MNH&ih>Ix;yr zF*7SLF*-0XQLTSa0000bbVXQnWMOn=I&E)cX=Zr$G&(RiIx{yb YFflqXFtRBcga7~l07*qoM6N<$f`hW9N&o-= literal 0 HcmV?d00001 diff --git a/dist/snap/snapcraft.yaml b/dist/snap/snapcraft.yaml new file mode 100644 index 000000000..0a8f5486d --- /dev/null +++ b/dist/snap/snapcraft.yaml @@ -0,0 +1,55 @@ +name: ryzom +version: "3.0.2" +summary: Ryzom science-fantasy MMORPG +description: | + Ryzom is a science-fantasy MMORPG. +grade: devel # stable +confinement: strict + +apps: + ryzom: + command: desktop-launch $SNAP/bin/ryzom_installer_qt + plugs: + - home + - unity7 + - x11 + - opengl + +parts: + ryzom: + source: https://bitbucket.org/ryzom/ryzomcore + source-type: hg + source-branch: compatibility-develop + source-subdir: code + plugin: cmake + configflags: + - -DCMAKE_BUILD_TYPE=Release + - -DWITH_3D=OFF + - -DWITH_GUI=OFF + - -DWITH_NET=OFF + - -DWITH_PACS=OFF + - -DWITH_GEORGES=OFF + - -DWITH_LIGO=OFF + - -DWITH_LOGIC=OFF + - -DWITH_SOUND=OFF + - -DWITH_RYZOM_SERVER=OFF + - -DWITH_RYZOM_TOOLS=OFF + - -DWITH_RYZOM_CLIENT=OFF + - -DWITH_RYZOM_INSTALLER=ON + - -DWITH_NEL_TESTS=OFF + - -DWITH_NEL_TOOLS=OFF + - -DWITH_NEL_SAMPLES=OFF + - -DWITH_QT5=ON + - -DWITH_STATIC=ON + - -DWITH_INSTALL_LIBRARIES=OFF + - -DRYZOM_GAMES_PREFIX=bin + build-packages: + - zlib1g-dev + - libpng-dev + - libjpeg8-dev + - qttools5-dev-tools + stage-packages: + - libqt5widgets5 + + after: [desktop-qt5] + From b7e3e4b4f0d1b9b64909657d4edbc701bd823947 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 15:14:10 +0100 Subject: [PATCH 21/50] Changed: Memory leaks detection --HG-- branch : develop --- code/nel/src/3d/driver/opengl/driver_opengl.cpp | 3 +++ .../driver/opengl/driver_opengl_extension.cpp | 3 +++ .../3d/driver/opengl/driver_opengl_inputs.cpp | 4 ++++ .../3d/driver/opengl/driver_opengl_light.cpp | 4 ++++ .../3d/driver/opengl/driver_opengl_material.cpp | 4 ++++ .../3d/driver/opengl/driver_opengl_matrix.cpp | 4 ++++ .../opengl/driver_opengl_pixel_program.cpp | 4 ++++ .../3d/driver/opengl/driver_opengl_states.cpp | 4 ++++ .../3d/driver/opengl/driver_opengl_texture.cpp | 3 +++ .../3d/driver/opengl/driver_opengl_uniform.cpp | 4 ++++ .../3d/driver/opengl/driver_opengl_vertex.cpp | 3 +++ .../opengl/driver_opengl_vertex_buffer_hard.cpp | 4 ++++ .../opengl/driver_opengl_vertex_program.cpp | 4 ++++ .../3d/driver/opengl/driver_opengl_window.cpp | 4 ++++ code/nel/src/3d/driver/opengl/stdopengl.h | 9 ++++++++- .../src/3d/driver/opengl/unix_event_emitter.cpp | 3 +++ code/nel/src/3d/quad_grid_clip_cluster.cpp | 3 +++ code/nel/src/3d/quad_grid_clip_manager.cpp | 3 +++ code/nel/src/3d/std3d.h | 17 ++++++++++++----- code/nel/src/3d/target_anim_ctrl.cpp | 4 ++++ code/nel/src/3d/track_sampled_quat.cpp | 3 +++ code/nel/src/3d/vegetable_manager.cpp | 3 +++ code/nel/src/3d/water_env_map.cpp | 4 ++++ code/nel/src/3d/water_pool_manager.cpp | 3 +++ code/nel/src/gui/action_handler.cpp | 4 ++++ code/nel/src/gui/ctrl_base.cpp | 4 ++++ code/nel/src/gui/ctrl_base_button.cpp | 4 ++++ code/nel/src/gui/ctrl_button.cpp | 4 ++++ code/nel/src/gui/ctrl_col_pick.cpp | 4 ++++ code/nel/src/gui/ctrl_draggable.cpp | 4 ++++ code/nel/src/gui/ctrl_polygon.cpp | 4 ++++ code/nel/src/gui/ctrl_quad.cpp | 4 ++++ code/nel/src/gui/ctrl_scroll.cpp | 4 ++++ code/nel/src/gui/ctrl_scroll_base.cpp | 4 ++++ code/nel/src/gui/ctrl_sheet_selection.cpp | 4 ++++ code/nel/src/gui/ctrl_text_button.cpp | 3 +++ code/nel/src/gui/ctrl_tooltip.cpp | 4 ++++ code/nel/src/gui/db_manager.cpp | 4 ++++ code/nel/src/gui/dbgroup_combo_box.cpp | 4 ++++ code/nel/src/gui/dbgroup_select_number.cpp | 4 ++++ code/nel/src/gui/dbview_bar.cpp | 4 ++++ code/nel/src/gui/dbview_bar3.cpp | 4 ++++ code/nel/src/gui/dbview_digit.cpp | 4 ++++ code/nel/src/gui/dbview_number.cpp | 3 +++ code/nel/src/gui/dbview_quantity.cpp | 3 +++ code/nel/src/gui/event_descriptor.cpp | 4 ++++ code/nel/src/gui/event_listener.cpp | 4 ++++ code/nel/src/gui/group_container.cpp | 4 ++++ code/nel/src/gui/group_container_base.cpp | 4 ++++ code/nel/src/gui/group_editbox.cpp | 3 +++ code/nel/src/gui/group_editbox_base.cpp | 4 ++++ code/nel/src/gui/group_editbox_decor.cpp | 4 ++++ code/nel/src/gui/group_frame.cpp | 4 ++++ code/nel/src/gui/group_header.cpp | 4 ++++ code/nel/src/gui/group_html.cpp | 3 +++ code/nel/src/gui/group_html_parser.cpp | 4 ++++ code/nel/src/gui/group_list.cpp | 4 ++++ code/nel/src/gui/group_menu.cpp | 3 +++ code/nel/src/gui/group_modal.cpp | 4 ++++ code/nel/src/gui/group_paragraph.cpp | 4 ++++ code/nel/src/gui/group_scrolltext.cpp | 4 ++++ code/nel/src/gui/group_submenu_base.cpp | 4 ++++ code/nel/src/gui/group_tab.cpp | 4 ++++ code/nel/src/gui/group_table.cpp | 4 ++++ code/nel/src/gui/group_tree.cpp | 4 ++++ code/nel/src/gui/group_wheel.cpp | 3 +++ code/nel/src/gui/input_handler.cpp | 4 ++++ code/nel/src/gui/interface_anim.cpp | 4 ++++ code/nel/src/gui/interface_element.cpp | 4 ++++ code/nel/src/gui/interface_expr.cpp | 4 ++++ code/nel/src/gui/interface_expr_node.cpp | 4 ++++ code/nel/src/gui/interface_expr_user_fct.cpp | 4 ++++ code/nel/src/gui/interface_factory.cpp | 4 ++++ code/nel/src/gui/interface_group.cpp | 4 ++++ code/nel/src/gui/interface_link.cpp | 4 ++++ code/nel/src/gui/interface_options.cpp | 4 ++++ code/nel/src/gui/interface_parser.cpp | 5 +++++ code/nel/src/gui/interface_property.cpp | 4 ++++ code/nel/src/gui/libwww.cpp | 4 ++++ code/nel/src/gui/libwww_types.cpp | 4 ++++ code/nel/src/gui/link_hack.cpp | 4 ++++ code/nel/src/gui/lua_helper.cpp | 4 ++++ code/nel/src/gui/lua_ihm.cpp | 4 ++++ code/nel/src/gui/lua_manager.cpp | 4 ++++ code/nel/src/gui/lua_object.cpp | 4 ++++ code/nel/src/gui/parser.cpp | 4 ++++ code/nel/src/gui/proc.cpp | 4 ++++ code/nel/src/gui/reflect.cpp | 4 ++++ code/nel/src/gui/reflect_register.cpp | 4 ++++ code/nel/src/gui/root_group.cpp | 4 ++++ code/nel/src/gui/stdpch.h | 7 +++++++ code/nel/src/gui/string_case.cpp | 4 ++++ code/nel/src/gui/url_parser.cpp | 3 +++ code/nel/src/gui/view_base.cpp | 4 ++++ code/nel/src/gui/view_bitmap.cpp | 3 +++ code/nel/src/gui/view_bitmap_combo.cpp | 4 ++++ code/nel/src/gui/view_link.cpp | 4 ++++ code/nel/src/gui/view_pointer.cpp | 4 ++++ code/nel/src/gui/view_pointer_base.cpp | 4 ++++ code/nel/src/gui/view_polygon.cpp | 4 ++++ code/nel/src/gui/view_quad.cpp | 4 ++++ code/nel/src/gui/view_renderer.cpp | 4 ++++ code/nel/src/gui/view_text.cpp | 4 ++++ code/nel/src/gui/view_text_formated.cpp | 4 ++++ code/nel/src/gui/view_text_id.cpp | 4 ++++ code/nel/src/gui/view_text_id_formated.cpp | 4 ++++ code/nel/src/gui/widget_manager.cpp | 4 ++++ code/nel/src/misc/bitmap_gif.cpp | 4 ++++ code/nel/src/misc/cdb.cpp | 4 ++++ code/nel/src/misc/cdb_bank_handler.cpp | 4 ++++ code/nel/src/misc/cdb_branch.cpp | 3 +++ .../src/misc/cdb_branch_observing_handler.cpp | 4 ++++ code/nel/src/misc/cdb_check_sum.cpp | 3 +++ code/nel/src/misc/cdb_leaf.cpp | 4 ++++ code/nel/src/misc/cdb_manager.cpp | 4 ++++ code/nel/src/misc/check_fpu.cpp | 3 +++ code/nel/src/misc/config_file/cf_gramatical.cpp | 4 ++++ code/nel/src/misc/config_file/cf_lexical.cpp | 6 +++++- code/nel/src/misc/stdmisc.h | 7 +++++++ code/nel/src/misc/words_dictionary.cpp | 6 +++--- code/nel/src/misc/xml_auto_ptr.cpp | 4 ++++ code/nel/src/sound/driver/openal/stdopenal.h | 13 ++++++++++++- 122 files changed, 493 insertions(+), 11 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index 3f2dca9b6..80b424cba 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -36,6 +36,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp index 9d9143515..91a2fcab3 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp @@ -61,6 +61,9 @@ void (*nglGetProcAddress(const char *procName))() } #endif // NL_OS_WINDOWS +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif // *************************************************************************** // The exported function names diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp index 46804cce1..0d27166fc 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp @@ -33,6 +33,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { #ifdef NL_STATIC diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_light.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_light.cpp index 7b52e3225..a9b62b6b6 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_light.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_light.cpp @@ -19,6 +19,10 @@ #include "driver_opengl.h" #include "nel/3d/light.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { #ifdef NL_STATIC diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp index e5375a49c..bf9845103 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp @@ -21,6 +21,10 @@ #include "nel/3d/texture_bump.h" #include "nel/3d/material.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { #ifdef NL_STATIC diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp index 41575024c..392aa3f5d 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp @@ -17,6 +17,10 @@ #include "stdopengl.h" #include "driver_opengl.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { #ifdef NL_STATIC diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_pixel_program.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_pixel_program.cpp index dd66328e9..67af0df64 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_pixel_program.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_pixel_program.cpp @@ -38,6 +38,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp index 8ec7a6bc8..5fd9e6416 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp @@ -22,6 +22,10 @@ // define it For Debug purpose only. Normal use is to hide this line //#define NL3D_GLSTATE_DISABLE_CACHE +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { #ifdef NL_STATIC diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp index a46f7ef12..95eaf8465 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp @@ -28,6 +28,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif //#define NEL_DUMP_UPLOAD_TIME diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_uniform.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_uniform.cpp index f981ae3ba..bd945c1a1 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_uniform.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_uniform.cpp @@ -21,6 +21,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { #ifdef NL_STATIC diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp index 39f71d77a..bb0cf0c9f 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp @@ -26,6 +26,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp index 25c7da614..6684ad100 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp @@ -24,6 +24,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { #ifdef NL_STATIC diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp index c2e37ac89..e9ac4814a 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp @@ -28,6 +28,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + //#define DEBUG_SETUP_EXT_VERTEX_SHADER namespace NL3D { diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index 4469550b3..9fe51ea1d 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -44,6 +44,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { #ifdef NL_STATIC diff --git a/code/nel/src/3d/driver/opengl/stdopengl.h b/code/nel/src/3d/driver/opengl/stdopengl.h index 3066a778a..28ed25fc9 100644 --- a/code/nel/src/3d/driver/opengl/stdopengl.h +++ b/code/nel/src/3d/driver/opengl/stdopengl.h @@ -17,7 +17,12 @@ #ifndef STDOPENGL_H #define STDOPENGL_H -#include "nel/misc/types_nl.h" +#if defined(_MSC_VER) && defined(_DEBUG) + #define _CRTDBG_MAP_ALLOC + #include + #include + #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif #include #include @@ -35,6 +40,8 @@ #include #include +#include "nel/misc/types_nl.h" + #ifdef NL_OS_WINDOWS # define WIN32_LEAN_AND_MEAN # ifndef NL_COMP_MINGW diff --git a/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp b/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp index b55ad5865..898c9f001 100644 --- a/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp +++ b/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp @@ -26,6 +26,9 @@ #include #include "nel/misc/debug.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif typedef bool (*x11Proc)(NL3D::IDriver *drv, XEvent *e); diff --git a/code/nel/src/3d/quad_grid_clip_cluster.cpp b/code/nel/src/3d/quad_grid_clip_cluster.cpp index a6ab799c8..dd52ed111 100644 --- a/code/nel/src/3d/quad_grid_clip_cluster.cpp +++ b/code/nel/src/3d/quad_grid_clip_cluster.cpp @@ -25,6 +25,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/quad_grid_clip_manager.cpp b/code/nel/src/3d/quad_grid_clip_manager.cpp index 02c4fed62..0fe69e46e 100644 --- a/code/nel/src/3d/quad_grid_clip_manager.cpp +++ b/code/nel/src/3d/quad_grid_clip_manager.cpp @@ -28,6 +28,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/std3d.h b/code/nel/src/3d/std3d.h index e81f1ead4..d41f281ec 100644 --- a/code/nel/src/3d/std3d.h +++ b/code/nel/src/3d/std3d.h @@ -14,7 +14,15 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "nel/misc/types_nl.h" +#ifndef NL_STD3D_H +#define NL_STD3D_H + +#if defined(_MSC_VER) && defined(_DEBUG) + #define _CRTDBG_MAP_ALLOC + #include + #include + #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif #include #include @@ -36,6 +44,8 @@ #include #include +#include "nel/misc/types_nl.h" + #include "nel/misc/rgba.h" #include "nel/misc/debug.h" @@ -45,7 +55,4 @@ #include "nel/misc/matrix.h" #include "nel/misc/time_nl.h" -#include "nel/3d/debug_vb.h" -#include "nel/3d/transform.h" -#include "nel/3d/quad_grid.h" - +#endif diff --git a/code/nel/src/3d/target_anim_ctrl.cpp b/code/nel/src/3d/target_anim_ctrl.cpp index ea1eeeca0..8145fdb93 100644 --- a/code/nel/src/3d/target_anim_ctrl.cpp +++ b/code/nel/src/3d/target_anim_ctrl.cpp @@ -24,6 +24,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/track_sampled_quat.cpp b/code/nel/src/3d/track_sampled_quat.cpp index 1ef4e35b8..d49d63aa7 100644 --- a/code/nel/src/3d/track_sampled_quat.cpp +++ b/code/nel/src/3d/track_sampled_quat.cpp @@ -24,6 +24,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/vegetable_manager.cpp b/code/nel/src/3d/vegetable_manager.cpp index e479a5e62..084942fea 100644 --- a/code/nel/src/3d/vegetable_manager.cpp +++ b/code/nel/src/3d/vegetable_manager.cpp @@ -35,6 +35,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/water_env_map.cpp b/code/nel/src/3d/water_env_map.cpp index a1b954764..9592f2948 100644 --- a/code/nel/src/3d/water_env_map.cpp +++ b/code/nel/src/3d/water_env_map.cpp @@ -24,6 +24,10 @@ #include "nel/misc/common.h" #include "nel/3d/viewport.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/water_pool_manager.cpp b/code/nel/src/3d/water_pool_manager.cpp index c377ff1f3..8ca8e2bfc 100644 --- a/code/nel/src/3d/water_pool_manager.cpp +++ b/code/nel/src/3d/water_pool_manager.cpp @@ -23,6 +23,9 @@ #include "nel/3d/water_height_map.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/gui/action_handler.cpp b/code/nel/src/gui/action_handler.cpp index d7214ef06..bbe7948cd 100644 --- a/code/nel/src/gui/action_handler.cpp +++ b/code/nel/src/gui/action_handler.cpp @@ -27,6 +27,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/ctrl_base.cpp b/code/nel/src/gui/ctrl_base.cpp index 475761e89..9fdeff8c2 100644 --- a/code/nel/src/gui/ctrl_base.cpp +++ b/code/nel/src/gui/ctrl_base.cpp @@ -27,6 +27,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { std::map< std::string, std::map< std::string, std::string > > CCtrlBase::AHCache; diff --git a/code/nel/src/gui/ctrl_base_button.cpp b/code/nel/src/gui/ctrl_base_button.cpp index 673ea906d..d60824295 100644 --- a/code/nel/src/gui/ctrl_base_button.cpp +++ b/code/nel/src/gui/ctrl_base_button.cpp @@ -27,6 +27,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace { const uint KEY_REPEAT_MIN = 100; diff --git a/code/nel/src/gui/ctrl_button.cpp b/code/nel/src/gui/ctrl_button.cpp index d689dd71c..02fd4b7d4 100644 --- a/code/nel/src/gui/ctrl_button.cpp +++ b/code/nel/src/gui/ctrl_button.cpp @@ -26,6 +26,10 @@ using namespace std; using namespace NLMISC; using namespace NL3D; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CCtrlButton, std::string, "button"); namespace NLGUI diff --git a/code/nel/src/gui/ctrl_col_pick.cpp b/code/nel/src/gui/ctrl_col_pick.cpp index 2d62b6e74..4079388c2 100644 --- a/code/nel/src/gui/ctrl_col_pick.cpp +++ b/code/nel/src/gui/ctrl_col_pick.cpp @@ -27,6 +27,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CCtrlColPick, std::string, "colpick"); namespace NLGUI diff --git a/code/nel/src/gui/ctrl_draggable.cpp b/code/nel/src/gui/ctrl_draggable.cpp index 39872ab18..781585083 100644 --- a/code/nel/src/gui/ctrl_draggable.cpp +++ b/code/nel/src/gui/ctrl_draggable.cpp @@ -18,6 +18,10 @@ #include "stdpch.h" #include "nel/gui/ctrl_draggable.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/ctrl_polygon.cpp b/code/nel/src/gui/ctrl_polygon.cpp index 86059087d..c7ce984d2 100644 --- a/code/nel/src/gui/ctrl_polygon.cpp +++ b/code/nel/src/gui/ctrl_polygon.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/ctrl_quad.cpp b/code/nel/src/gui/ctrl_quad.cpp index 47346692c..22f4d4ae6 100644 --- a/code/nel/src/gui/ctrl_quad.cpp +++ b/code/nel/src/gui/ctrl_quad.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/ctrl_scroll.cpp b/code/nel/src/gui/ctrl_scroll.cpp index ad2ca14f5..9c9585fcc 100644 --- a/code/nel/src/gui/ctrl_scroll.cpp +++ b/code/nel/src/gui/ctrl_scroll.cpp @@ -28,6 +28,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CCtrlScroll, std::string, "scroll"); namespace NLGUI diff --git a/code/nel/src/gui/ctrl_scroll_base.cpp b/code/nel/src/gui/ctrl_scroll_base.cpp index f95cac5d7..2813b997a 100644 --- a/code/nel/src/gui/ctrl_scroll_base.cpp +++ b/code/nel/src/gui/ctrl_scroll_base.cpp @@ -18,6 +18,10 @@ #include "stdpch.h" #include "nel/gui/ctrl_scroll_base.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/ctrl_sheet_selection.cpp b/code/nel/src/gui/ctrl_sheet_selection.cpp index bdbe0e73d..d0202547f 100644 --- a/code/nel/src/gui/ctrl_sheet_selection.cpp +++ b/code/nel/src/gui/ctrl_sheet_selection.cpp @@ -23,6 +23,10 @@ #include "nel/gui/ctrl_sheet_selection.h" #include "nel/gui/view_renderer.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/ctrl_text_button.cpp b/code/nel/src/gui/ctrl_text_button.cpp index c292d5473..81dfcc953 100644 --- a/code/nel/src/gui/ctrl_text_button.cpp +++ b/code/nel/src/gui/ctrl_text_button.cpp @@ -30,6 +30,9 @@ using namespace std; using namespace NLMISC; using namespace NL3D; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif NLMISC_REGISTER_OBJECT(CViewBase, CCtrlTextButton, std::string, "text_button"); diff --git a/code/nel/src/gui/ctrl_tooltip.cpp b/code/nel/src/gui/ctrl_tooltip.cpp index 8a0427751..da42084ac 100644 --- a/code/nel/src/gui/ctrl_tooltip.cpp +++ b/code/nel/src/gui/ctrl_tooltip.cpp @@ -23,6 +23,10 @@ using namespace std; using namespace NLMISC; using namespace NL3D; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CCtrlToolTip, std::string, "tooltip"); REGISTER_UI_CLASS(CCtrlToolTip) diff --git a/code/nel/src/gui/db_manager.cpp b/code/nel/src/gui/db_manager.cpp index a169adf8d..7896cbde3 100644 --- a/code/nel/src/gui/db_manager.cpp +++ b/code/nel/src/gui/db_manager.cpp @@ -18,6 +18,10 @@ #include "stdpch.h" #include "nel/gui/db_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { CDBManager* CDBManager::instance = NULL; diff --git a/code/nel/src/gui/dbgroup_combo_box.cpp b/code/nel/src/gui/dbgroup_combo_box.cpp index 184829e4c..2afd8c570 100644 --- a/code/nel/src/gui/dbgroup_combo_box.cpp +++ b/code/nel/src/gui/dbgroup_combo_box.cpp @@ -28,6 +28,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { NLMISC_REGISTER_OBJECT(CViewBase, CDBGroupComboBox, std::string, "combo_box"); diff --git a/code/nel/src/gui/dbgroup_select_number.cpp b/code/nel/src/gui/dbgroup_select_number.cpp index b3dc2e8f1..22afa4d0e 100644 --- a/code/nel/src/gui/dbgroup_select_number.cpp +++ b/code/nel/src/gui/dbgroup_select_number.cpp @@ -27,6 +27,10 @@ using namespace std; using namespace NL3D; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { NLMISC_REGISTER_OBJECT(CViewBase, CDBGroupSelectNumber, std::string, "select_number"); diff --git a/code/nel/src/gui/dbview_bar.cpp b/code/nel/src/gui/dbview_bar.cpp index f4befb389..e2256444f 100644 --- a/code/nel/src/gui/dbview_bar.cpp +++ b/code/nel/src/gui/dbview_bar.cpp @@ -26,6 +26,10 @@ using namespace std; using namespace NL3D; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CDBViewBar, std::string, "bar"); namespace NLGUI diff --git a/code/nel/src/gui/dbview_bar3.cpp b/code/nel/src/gui/dbview_bar3.cpp index 32d3e9eaf..187a52f99 100644 --- a/code/nel/src/gui/dbview_bar3.cpp +++ b/code/nel/src/gui/dbview_bar3.cpp @@ -26,6 +26,10 @@ using namespace std; using namespace NL3D; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { NLMISC_REGISTER_OBJECT(CViewBase, CDBViewBar3, std::string, "bar3"); diff --git a/code/nel/src/gui/dbview_digit.cpp b/code/nel/src/gui/dbview_digit.cpp index 318327a77..81063d519 100644 --- a/code/nel/src/gui/dbview_digit.cpp +++ b/code/nel/src/gui/dbview_digit.cpp @@ -24,6 +24,10 @@ using namespace std; using namespace NL3D; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CDBViewDigit, std::string, "digit"); namespace NLGUI diff --git a/code/nel/src/gui/dbview_number.cpp b/code/nel/src/gui/dbview_number.cpp index e844bf4c0..36f5523f2 100644 --- a/code/nel/src/gui/dbview_number.cpp +++ b/code/nel/src/gui/dbview_number.cpp @@ -24,6 +24,9 @@ using namespace std; using namespace NL3D; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif NLMISC_REGISTER_OBJECT(CViewBase, CDBViewNumber, std::string, "text_number"); diff --git a/code/nel/src/gui/dbview_quantity.cpp b/code/nel/src/gui/dbview_quantity.cpp index 12dfce4b8..4685fc23d 100644 --- a/code/nel/src/gui/dbview_quantity.cpp +++ b/code/nel/src/gui/dbview_quantity.cpp @@ -24,6 +24,9 @@ using namespace std; using namespace NL3D; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif NLMISC_REGISTER_OBJECT(CViewBase, CDBViewQuantity, std::string, "text_quantity"); diff --git a/code/nel/src/gui/event_descriptor.cpp b/code/nel/src/gui/event_descriptor.cpp index fd1856ed3..356e75aec 100644 --- a/code/nel/src/gui/event_descriptor.cpp +++ b/code/nel/src/gui/event_descriptor.cpp @@ -19,6 +19,10 @@ #include "nel/misc/events.h" #include "nel/gui/event_descriptor.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/event_listener.cpp b/code/nel/src/gui/event_listener.cpp index 4f4d7a17d..b1e53c374 100644 --- a/code/nel/src/gui/event_listener.cpp +++ b/code/nel/src/gui/event_listener.cpp @@ -21,6 +21,10 @@ #include "nel/gui/interface_group.h" #include "nel/gui/widget_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { CEventListener::CEventListener() diff --git a/code/nel/src/gui/group_container.cpp b/code/nel/src/gui/group_container.cpp index 818c71278..1922db221 100644 --- a/code/nel/src/gui/group_container.cpp +++ b/code/nel/src/gui/group_container.cpp @@ -39,6 +39,10 @@ using namespace std; using namespace NL3D; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace { const sint SIZE_W_LEFT = 16; diff --git a/code/nel/src/gui/group_container_base.cpp b/code/nel/src/gui/group_container_base.cpp index 974964955..c031cec7e 100644 --- a/code/nel/src/gui/group_container_base.cpp +++ b/code/nel/src/gui/group_container_base.cpp @@ -18,6 +18,10 @@ #include "stdpch.h" #include "nel/gui/group_container_base.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/group_editbox.cpp b/code/nel/src/gui/group_editbox.cpp index 4ac977803..f0a41c8a0 100644 --- a/code/nel/src/gui/group_editbox.cpp +++ b/code/nel/src/gui/group_editbox.cpp @@ -33,6 +33,9 @@ using namespace std; using namespace NLMISC; using namespace NL3D; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NLGUI { diff --git a/code/nel/src/gui/group_editbox_base.cpp b/code/nel/src/gui/group_editbox_base.cpp index 133af0b83..d3c001c34 100644 --- a/code/nel/src/gui/group_editbox_base.cpp +++ b/code/nel/src/gui/group_editbox_base.cpp @@ -18,6 +18,10 @@ #include "stdpch.h" #include "nel/gui/group_editbox_base.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/group_editbox_decor.cpp b/code/nel/src/gui/group_editbox_decor.cpp index 07e07ddf3..6d1e500ae 100644 --- a/code/nel/src/gui/group_editbox_decor.cpp +++ b/code/nel/src/gui/group_editbox_decor.cpp @@ -20,6 +20,10 @@ #include "nel/gui/view_bitmap.h" #include "nel/gui/view_text.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { class EBDPrivate diff --git a/code/nel/src/gui/group_frame.cpp b/code/nel/src/gui/group_frame.cpp index d0a652092..54412f229 100644 --- a/code/nel/src/gui/group_frame.cpp +++ b/code/nel/src/gui/group_frame.cpp @@ -26,6 +26,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/group_header.cpp b/code/nel/src/gui/group_header.cpp index 908aa183e..dbc990447 100644 --- a/code/nel/src/gui/group_header.cpp +++ b/code/nel/src/gui/group_header.cpp @@ -24,6 +24,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index eee811d02..a67c8b8e8 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -49,6 +49,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif // Default maximum time the request is allowed to take #define DEFAULT_RYZOM_CONNECTION_TIMEOUT (300.0) diff --git a/code/nel/src/gui/group_html_parser.cpp b/code/nel/src/gui/group_html_parser.cpp index 5f6873477..b2a61c4f9 100644 --- a/code/nel/src/gui/group_html_parser.cpp +++ b/code/nel/src/gui/group_html_parser.cpp @@ -28,6 +28,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { // *************************************************************************** diff --git a/code/nel/src/gui/group_list.cpp b/code/nel/src/gui/group_list.cpp index 8869c4498..c0502577b 100644 --- a/code/nel/src/gui/group_list.cpp +++ b/code/nel/src/gui/group_list.cpp @@ -30,6 +30,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CGroupList, std::string, "list"); namespace NLGUI diff --git a/code/nel/src/gui/group_menu.cpp b/code/nel/src/gui/group_menu.cpp index 80117e5bd..3b0e4549d 100644 --- a/code/nel/src/gui/group_menu.cpp +++ b/code/nel/src/gui/group_menu.cpp @@ -32,6 +32,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace { diff --git a/code/nel/src/gui/group_modal.cpp b/code/nel/src/gui/group_modal.cpp index fb4c6d129..95ca783eb 100644 --- a/code/nel/src/gui/group_modal.cpp +++ b/code/nel/src/gui/group_modal.cpp @@ -24,6 +24,10 @@ using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/group_paragraph.cpp b/code/nel/src/gui/group_paragraph.cpp index 6261656aa..7eaf11841 100644 --- a/code/nel/src/gui/group_paragraph.cpp +++ b/code/nel/src/gui/group_paragraph.cpp @@ -31,6 +31,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CCtrlLink, std::string, "button_link"); namespace NLGUI diff --git a/code/nel/src/gui/group_scrolltext.cpp b/code/nel/src/gui/group_scrolltext.cpp index c82bd40bf..aff59e5c2 100644 --- a/code/nel/src/gui/group_scrolltext.cpp +++ b/code/nel/src/gui/group_scrolltext.cpp @@ -25,6 +25,10 @@ #include "nel/misc/i18n.h" #include "nel/gui/widget_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CGroupScrollText, std::string, "scroll_text"); namespace NLGUI diff --git a/code/nel/src/gui/group_submenu_base.cpp b/code/nel/src/gui/group_submenu_base.cpp index 1c98fe643..8b26a7d85 100644 --- a/code/nel/src/gui/group_submenu_base.cpp +++ b/code/nel/src/gui/group_submenu_base.cpp @@ -18,6 +18,10 @@ #include "stdpch.h" #include "nel/gui/group_submenu_base.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/group_tab.cpp b/code/nel/src/gui/group_tab.cpp index 69ccce046..d79efdad3 100644 --- a/code/nel/src/gui/group_tab.cpp +++ b/code/nel/src/gui/group_tab.cpp @@ -26,6 +26,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CGroupTab, std::string, "tab"); namespace NLGUI diff --git a/code/nel/src/gui/group_table.cpp b/code/nel/src/gui/group_table.cpp index a82ad5617..e194a70a4 100644 --- a/code/nel/src/gui/group_table.cpp +++ b/code/nel/src/gui/group_table.cpp @@ -29,6 +29,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/group_tree.cpp b/code/nel/src/gui/group_tree.cpp index b8e2ae1f4..c65ceba17 100644 --- a/code/nel/src/gui/group_tree.cpp +++ b/code/nel/src/gui/group_tree.cpp @@ -33,6 +33,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/group_wheel.cpp b/code/nel/src/gui/group_wheel.cpp index e242a98e7..a8d57c089 100644 --- a/code/nel/src/gui/group_wheel.cpp +++ b/code/nel/src/gui/group_wheel.cpp @@ -18,6 +18,9 @@ #include "stdpch.h" #include "nel/gui/group_wheel.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif NLMISC_REGISTER_OBJECT(CViewBase, CInterfaceGroupWheel, std::string, "group_wheel"); diff --git a/code/nel/src/gui/input_handler.cpp b/code/nel/src/gui/input_handler.cpp index 920636079..9e4864caa 100644 --- a/code/nel/src/gui/input_handler.cpp +++ b/code/nel/src/gui/input_handler.cpp @@ -17,6 +17,10 @@ #include "stdpch.h" #include "nel/gui/input_handler.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { CInputHandler::CInputHandler() diff --git a/code/nel/src/gui/interface_anim.cpp b/code/nel/src/gui/interface_anim.cpp index 4b230bb25..2fb190e85 100644 --- a/code/nel/src/gui/interface_anim.cpp +++ b/code/nel/src/gui/interface_anim.cpp @@ -27,6 +27,10 @@ using namespace std; using namespace NL3D; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/interface_element.cpp b/code/nel/src/gui/interface_element.cpp index 66eee038e..e33d1dbd8 100644 --- a/code/nel/src/gui/interface_element.cpp +++ b/code/nel/src/gui/interface_element.cpp @@ -31,6 +31,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { bool CInterfaceElement::editorMode = false; diff --git a/code/nel/src/gui/interface_expr.cpp b/code/nel/src/gui/interface_expr.cpp index cbf3cace3..9d13286a9 100644 --- a/code/nel/src/gui/interface_expr.cpp +++ b/code/nel/src/gui/interface_expr.cpp @@ -25,6 +25,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/interface_expr_node.cpp b/code/nel/src/gui/interface_expr_node.cpp index 895cb169e..2a32c09db 100644 --- a/code/nel/src/gui/interface_expr_node.cpp +++ b/code/nel/src/gui/interface_expr_node.cpp @@ -24,6 +24,10 @@ using NLMISC::ICDBNode; using NLMISC::CCDBNodeBranch; using NLMISC::CCDBNodeLeaf; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/interface_expr_user_fct.cpp b/code/nel/src/gui/interface_expr_user_fct.cpp index b60f0b01c..07e329feb 100644 --- a/code/nel/src/gui/interface_expr_user_fct.cpp +++ b/code/nel/src/gui/interface_expr_user_fct.cpp @@ -25,6 +25,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/interface_factory.cpp b/code/nel/src/gui/interface_factory.cpp index ec914baa6..7f0fe76ee 100644 --- a/code/nel/src/gui/interface_factory.cpp +++ b/code/nel/src/gui/interface_factory.cpp @@ -18,6 +18,10 @@ #include "nel/gui/view_base.h" #include "nel/misc/factory.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { CViewBase* CInterfaceFactory::createClass( const std::string &name ) diff --git a/code/nel/src/gui/interface_group.cpp b/code/nel/src/gui/interface_group.cpp index 623dfe5bd..c0e7f6f17 100644 --- a/code/nel/src/gui/interface_group.cpp +++ b/code/nel/src/gui/interface_group.cpp @@ -32,6 +32,10 @@ using namespace std; using namespace NL3D; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + #define IG_UNIQUE_ID(this) ((void*)&((this)->_GroupSizeRef)) // NB nico : use some pointer *inside* CInterfaceGroup as a unique id for lua registry (any field but // the first), instead of using 'this'. 'this' is already used by // CLuaIHM::pushReflectableOnStack as unique id to CInterfaceElement's ref pointers diff --git a/code/nel/src/gui/interface_link.cpp b/code/nel/src/gui/interface_link.cpp index 282199ee7..612fa908e 100644 --- a/code/nel/src/gui/interface_link.cpp +++ b/code/nel/src/gui/interface_link.cpp @@ -33,6 +33,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/interface_options.cpp b/code/nel/src/gui/interface_options.cpp index 1daef83cb..9a71e3709 100644 --- a/code/nel/src/gui/interface_options.cpp +++ b/code/nel/src/gui/interface_options.cpp @@ -26,6 +26,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/interface_parser.cpp b/code/nel/src/gui/interface_parser.cpp index 4362b5c12..e038cb73e 100644 --- a/code/nel/src/gui/interface_parser.cpp +++ b/code/nel/src/gui/interface_parser.cpp @@ -42,6 +42,11 @@ #ifdef LUA_NEVRAX_VERSION #include "lua_ide_dll_nevrax/include/lua_ide_dll/ide_interface.h" // external debugger #endif + +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + const uint32 UI_CACHE_SERIAL_CHECK = NELID("IUG_"); using namespace NLMISC; diff --git a/code/nel/src/gui/interface_property.cpp b/code/nel/src/gui/interface_property.cpp index 8715b0f2f..ab375ae5e 100644 --- a/code/nel/src/gui/interface_property.cpp +++ b/code/nel/src/gui/interface_property.cpp @@ -24,6 +24,10 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { // helper to convert double <> sint64 diff --git a/code/nel/src/gui/libwww.cpp b/code/nel/src/gui/libwww.cpp index 53cc9e403..919d50562 100644 --- a/code/nel/src/gui/libwww.cpp +++ b/code/nel/src/gui/libwww.cpp @@ -21,6 +21,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/libwww_types.cpp b/code/nel/src/gui/libwww_types.cpp index 31e05f456..6eace3aa1 100644 --- a/code/nel/src/gui/libwww_types.cpp +++ b/code/nel/src/gui/libwww_types.cpp @@ -31,6 +31,10 @@ #include "nel/gui/libwww_types.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/link_hack.cpp b/code/nel/src/gui/link_hack.cpp index 3ecc6fb0a..9ae97910d 100644 --- a/code/nel/src/gui/link_hack.cpp +++ b/code/nel/src/gui/link_hack.cpp @@ -22,6 +22,10 @@ #include "nel/gui/view_pointer.h" #include "nel/gui/group_editbox_decor.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { void ifexprufct_forcelink(); diff --git a/code/nel/src/gui/lua_helper.cpp b/code/nel/src/gui/lua_helper.cpp index 0e2b9ba71..4e776e0b9 100644 --- a/code/nel/src/gui/lua_helper.cpp +++ b/code/nel/src/gui/lua_helper.cpp @@ -49,6 +49,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/lua_ihm.cpp b/code/nel/src/gui/lua_ihm.cpp index b5950ab2e..b748f3646 100644 --- a/code/nel/src/gui/lua_ihm.cpp +++ b/code/nel/src/gui/lua_ihm.cpp @@ -92,6 +92,10 @@ Compilation is VERY SLOW using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + // declare ostream << operator for ucstring -> registration of ucstring iin luabind will build a 'tostring' function from it std::ostream &operator<<(std::ostream &str, const ucstring &value) { diff --git a/code/nel/src/gui/lua_manager.cpp b/code/nel/src/gui/lua_manager.cpp index 2b354b0e4..d3f5dd81e 100644 --- a/code/nel/src/gui/lua_manager.cpp +++ b/code/nel/src/gui/lua_manager.cpp @@ -19,6 +19,10 @@ #include "nel/gui/lua_manager.h" #include "nel/gui/lua_helper.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/lua_object.cpp b/code/nel/src/gui/lua_object.cpp index 57581d6ec..c957c3f2c 100644 --- a/code/nel/src/gui/lua_object.cpp +++ b/code/nel/src/gui/lua_object.cpp @@ -20,6 +20,10 @@ #include "nel/gui/lua_ihm.h" #include "nel/gui/lua_helper.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/parser.cpp b/code/nel/src/gui/parser.cpp index eae7d3667..0d521b726 100644 --- a/code/nel/src/gui/parser.cpp +++ b/code/nel/src/gui/parser.cpp @@ -21,6 +21,10 @@ #include "nel/gui/interface_group.h" #include "nel/gui/interface_parser.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { IParser::IParser() diff --git a/code/nel/src/gui/proc.cpp b/code/nel/src/gui/proc.cpp index df9d6b8e9..2974a861e 100644 --- a/code/nel/src/gui/proc.cpp +++ b/code/nel/src/gui/proc.cpp @@ -22,6 +22,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/reflect.cpp b/code/nel/src/gui/reflect.cpp index 961c855e6..7ef321b6e 100644 --- a/code/nel/src/gui/reflect.cpp +++ b/code/nel/src/gui/reflect.cpp @@ -18,6 +18,10 @@ #include "stdpch.h" #include "nel/gui/reflect.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { // Yoyo: Act like a singleton, else registerClass may crash. diff --git a/code/nel/src/gui/reflect_register.cpp b/code/nel/src/gui/reflect_register.cpp index f7f47b1f9..86abc0cd5 100644 --- a/code/nel/src/gui/reflect_register.cpp +++ b/code/nel/src/gui/reflect_register.cpp @@ -49,6 +49,10 @@ #include "nel/gui/group_html.h" #include "nel/gui/group_header.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { void CReflectableRegister::registerClasses() diff --git a/code/nel/src/gui/root_group.cpp b/code/nel/src/gui/root_group.cpp index bffdd5579..449e18b05 100644 --- a/code/nel/src/gui/root_group.cpp +++ b/code/nel/src/gui/root_group.cpp @@ -18,6 +18,10 @@ #include "nel/gui/root_group.h" #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/stdpch.h b/code/nel/src/gui/stdpch.h index 51f1b1657..e0be5837e 100644 --- a/code/nel/src/gui/stdpch.h +++ b/code/nel/src/gui/stdpch.h @@ -17,6 +17,13 @@ #ifndef NELGUI_H #define NELGUI_H +#if defined(_MSC_VER) && defined(_DEBUG) + #define _CRTDBG_MAP_ALLOC + #include + #include + #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif + #include #include diff --git a/code/nel/src/gui/string_case.cpp b/code/nel/src/gui/string_case.cpp index b678d35c9..06936b393 100644 --- a/code/nel/src/gui/string_case.cpp +++ b/code/nel/src/gui/string_case.cpp @@ -17,6 +17,10 @@ #include "stdpch.h" #include "nel/gui/string_case.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { inline bool isSeparator (ucchar c) diff --git a/code/nel/src/gui/url_parser.cpp b/code/nel/src/gui/url_parser.cpp index 5db7f6d72..7c8e70e90 100644 --- a/code/nel/src/gui/url_parser.cpp +++ b/code/nel/src/gui/url_parser.cpp @@ -19,6 +19,9 @@ using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NLGUI { diff --git a/code/nel/src/gui/view_base.cpp b/code/nel/src/gui/view_base.cpp index 2b09061a9..6b0201858 100644 --- a/code/nel/src/gui/view_base.cpp +++ b/code/nel/src/gui/view_base.cpp @@ -20,6 +20,10 @@ #include "nel/gui/interface_group.h" #include "nel/gui/widget_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/view_bitmap.cpp b/code/nel/src/gui/view_bitmap.cpp index 21c0c2cd4..75a84dc77 100644 --- a/code/nel/src/gui/view_bitmap.cpp +++ b/code/nel/src/gui/view_bitmap.cpp @@ -26,6 +26,9 @@ using namespace std; using namespace NLMISC; using namespace NL3D; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif NLMISC_REGISTER_OBJECT(CViewBase, CViewBitmap, std::string, "bitmap"); REGISTER_UI_CLASS(CViewBitmap) diff --git a/code/nel/src/gui/view_bitmap_combo.cpp b/code/nel/src/gui/view_bitmap_combo.cpp index 3fc54c89a..7ffe644b6 100644 --- a/code/nel/src/gui/view_bitmap_combo.cpp +++ b/code/nel/src/gui/view_bitmap_combo.cpp @@ -25,6 +25,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/view_link.cpp b/code/nel/src/gui/view_link.cpp index 1db08f583..7de4e3a01 100644 --- a/code/nel/src/gui/view_link.cpp +++ b/code/nel/src/gui/view_link.cpp @@ -24,6 +24,10 @@ using namespace std; using namespace NLMISC; using namespace NL3D; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/view_pointer.cpp b/code/nel/src/gui/view_pointer.cpp index da8d730fc..aa5dff6d2 100644 --- a/code/nel/src/gui/view_pointer.cpp +++ b/code/nel/src/gui/view_pointer.cpp @@ -27,6 +27,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CViewPointer, std::string, "generic_pointer"); namespace NLGUI diff --git a/code/nel/src/gui/view_pointer_base.cpp b/code/nel/src/gui/view_pointer_base.cpp index e29af7858..f0cf3b6bb 100644 --- a/code/nel/src/gui/view_pointer_base.cpp +++ b/code/nel/src/gui/view_pointer_base.cpp @@ -18,6 +18,10 @@ #include "stdpch.h" #include "nel/gui/view_pointer_base.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/view_polygon.cpp b/code/nel/src/gui/view_polygon.cpp index baacf94a0..f3fd8efa2 100644 --- a/code/nel/src/gui/view_polygon.cpp +++ b/code/nel/src/gui/view_polygon.cpp @@ -23,6 +23,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/view_quad.cpp b/code/nel/src/gui/view_quad.cpp index 426a19f08..2724fe3b3 100644 --- a/code/nel/src/gui/view_quad.cpp +++ b/code/nel/src/gui/view_quad.cpp @@ -22,6 +22,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/view_renderer.cpp b/code/nel/src/gui/view_renderer.cpp index 4c5d7c501..58aceb185 100644 --- a/code/nel/src/gui/view_renderer.cpp +++ b/code/nel/src/gui/view_renderer.cpp @@ -26,6 +26,10 @@ using namespace NLMISC; using namespace std; using namespace NL3D; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index a2975fc1a..06f46bf0c 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -32,6 +32,10 @@ using namespace std; using namespace NLMISC; using namespace NL3D; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + typedef std::string::size_type TCharPos; // index of a chracter in a string REGISTER_UI_CLASS(CViewText) diff --git a/code/nel/src/gui/view_text_formated.cpp b/code/nel/src/gui/view_text_formated.cpp index f0bda2add..56a0b2e74 100644 --- a/code/nel/src/gui/view_text_formated.cpp +++ b/code/nel/src/gui/view_text_formated.cpp @@ -20,6 +20,10 @@ #include "nel/misc/xml_auto_ptr.h" #include "nel/misc/i18n.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CViewTextFormated, std::string, "text_formated"); namespace NLGUI diff --git a/code/nel/src/gui/view_text_id.cpp b/code/nel/src/gui/view_text_id.cpp index 23b939f91..b7e276a10 100644 --- a/code/nel/src/gui/view_text_id.cpp +++ b/code/nel/src/gui/view_text_id.cpp @@ -24,6 +24,10 @@ using namespace std; using NLMISC::CCDBNodeLeaf; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CViewTextID, std::string, "text_id"); namespace NLGUI diff --git a/code/nel/src/gui/view_text_id_formated.cpp b/code/nel/src/gui/view_text_id_formated.cpp index 1c91b3c0a..848bea21b 100644 --- a/code/nel/src/gui/view_text_id_formated.cpp +++ b/code/nel/src/gui/view_text_id_formated.cpp @@ -21,6 +21,10 @@ #include "nel/misc/xml_auto_ptr.h" #include "nel/misc/i18n.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + NLMISC_REGISTER_OBJECT(CViewBase, CViewTextIDFormated, std::string, "text_id_formated"); namespace NLGUI diff --git a/code/nel/src/gui/widget_manager.cpp b/code/nel/src/gui/widget_manager.cpp index d3888b68c..5ef9ee622 100644 --- a/code/nel/src/gui/widget_manager.cpp +++ b/code/nel/src/gui/widget_manager.cpp @@ -37,6 +37,10 @@ #include "nel/misc/events.h" #include "nel/gui/root_group.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLGUI { void LinkHack(); diff --git a/code/nel/src/misc/bitmap_gif.cpp b/code/nel/src/misc/bitmap_gif.cpp index 4ae9dd0cf..9904d8312 100644 --- a/code/nel/src/misc/bitmap_gif.cpp +++ b/code/nel/src/misc/bitmap_gif.cpp @@ -23,6 +23,10 @@ using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLMISC { diff --git a/code/nel/src/misc/cdb.cpp b/code/nel/src/misc/cdb.cpp index 0a38dc71d..60f6801bd 100644 --- a/code/nel/src/misc/cdb.cpp +++ b/code/nel/src/misc/cdb.cpp @@ -28,6 +28,10 @@ //////////////// using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLMISC{ CStringMapper *ICDBNode::_DBSM = NULL; diff --git a/code/nel/src/misc/cdb_bank_handler.cpp b/code/nel/src/misc/cdb_bank_handler.cpp index 58843455d..78102498f 100644 --- a/code/nel/src/misc/cdb_bank_handler.cpp +++ b/code/nel/src/misc/cdb_bank_handler.cpp @@ -17,6 +17,10 @@ #include "stdmisc.h" #include "nel/misc/cdb_bank_handler.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLMISC{ CCDBBankHandler::CCDBBankHandler(uint maxbanks) : _CDBBankToUnifiedIndexMapping( maxbanks, std::vector< uint >() ), diff --git a/code/nel/src/misc/cdb_branch.cpp b/code/nel/src/misc/cdb_branch.cpp index 55b36a645..92631280c 100644 --- a/code/nel/src/misc/cdb_branch.cpp +++ b/code/nel/src/misc/cdb_branch.cpp @@ -56,6 +56,9 @@ using namespace std; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NLMISC{ diff --git a/code/nel/src/misc/cdb_branch_observing_handler.cpp b/code/nel/src/misc/cdb_branch_observing_handler.cpp index 8e6335533..b64862a18 100644 --- a/code/nel/src/misc/cdb_branch_observing_handler.cpp +++ b/code/nel/src/misc/cdb_branch_observing_handler.cpp @@ -17,6 +17,10 @@ #include "stdmisc.h" #include "nel/misc/cdb_branch_observing_handler.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLMISC{ CCDBBranchObservingHandler::CCDBBranchObservingHandler() { diff --git a/code/nel/src/misc/cdb_check_sum.cpp b/code/nel/src/misc/cdb_check_sum.cpp index d3619299d..7ec6614b2 100644 --- a/code/nel/src/misc/cdb_check_sum.cpp +++ b/code/nel/src/misc/cdb_check_sum.cpp @@ -17,6 +17,9 @@ #include "stdmisc.h" #include "nel/misc/cdb_check_sum.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NLMISC{ diff --git a/code/nel/src/misc/cdb_leaf.cpp b/code/nel/src/misc/cdb_leaf.cpp index f74fb2d3d..c996b78f3 100644 --- a/code/nel/src/misc/cdb_leaf.cpp +++ b/code/nel/src/misc/cdb_leaf.cpp @@ -35,6 +35,10 @@ //////////////// using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLMISC{ diff --git a/code/nel/src/misc/cdb_manager.cpp b/code/nel/src/misc/cdb_manager.cpp index db743416d..1b19f4141 100644 --- a/code/nel/src/misc/cdb_manager.cpp +++ b/code/nel/src/misc/cdb_manager.cpp @@ -17,6 +17,10 @@ #include "stdmisc.h" #include "nel/misc/cdb_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NLMISC{ CCDBManager::CCDBManager( const char *rootNodeName, uint maxBanks ) : bankHandler( maxBanks ) diff --git a/code/nel/src/misc/check_fpu.cpp b/code/nel/src/misc/check_fpu.cpp index 0f2359eeb..0ceb3af2b 100644 --- a/code/nel/src/misc/check_fpu.cpp +++ b/code/nel/src/misc/check_fpu.cpp @@ -24,6 +24,9 @@ #pragma optimize("", off ) +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NLMISC { diff --git a/code/nel/src/misc/config_file/cf_gramatical.cpp b/code/nel/src/misc/config_file/cf_gramatical.cpp index 1d8c568b7..d386b72ad 100644 --- a/code/nel/src/misc/config_file/cf_gramatical.cpp +++ b/code/nel/src/misc/config_file/cf_gramatical.cpp @@ -50,6 +50,10 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + /* Constantes */ #define YYPARSE_PARAM pvararray diff --git a/code/nel/src/misc/config_file/cf_lexical.cpp b/code/nel/src/misc/config_file/cf_lexical.cpp index 8c39112a6..d132f4df8 100644 --- a/code/nel/src/misc/config_file/cf_lexical.cpp +++ b/code/nel/src/misc/config_file/cf_lexical.cpp @@ -1938,6 +1938,10 @@ char *yytext; using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + /* Constantes */ // WARNING!!!! DEBUG_PRINTF are commented using // so IT MUST HAVE NO INSTRUCTION AFTER A DEBUG_PRINTF OR THEY LL BE COMMENTED @@ -3217,7 +3221,7 @@ static void *yy_flex_alloc( size ) yy_size_t size; #endif { - return (void *) malloc( size ); + return (void *) malloc( size ); // TODO: delete } #ifdef YY_USE_PROTOS diff --git a/code/nel/src/misc/stdmisc.h b/code/nel/src/misc/stdmisc.h index 3ed96f900..d7a623465 100644 --- a/code/nel/src/misc/stdmisc.h +++ b/code/nel/src/misc/stdmisc.h @@ -17,6 +17,13 @@ #ifndef NL_STDMISC_H #define NL_STDMISC_H +#if defined(_MSC_VER) && defined(_DEBUG) + #define _CRTDBG_MAP_ALLOC + #include + #include + #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif + #include #include #include diff --git a/code/nel/src/misc/words_dictionary.cpp b/code/nel/src/misc/words_dictionary.cpp index 4d5057dd7..f0e7751ea 100644 --- a/code/nel/src/misc/words_dictionary.cpp +++ b/code/nel/src/misc/words_dictionary.cpp @@ -23,12 +23,12 @@ using namespace std; -const string DefaultColTitle = "name"; - #ifdef DEBUG_NEW - #define new DEBUG_NEW +#define new DEBUG_NEW #endif +const string DefaultColTitle = "name"; + namespace NLMISC { NL_INSTANCE_COUNTER_IMPL(CWordsDictionary); diff --git a/code/nel/src/misc/xml_auto_ptr.cpp b/code/nel/src/misc/xml_auto_ptr.cpp index fbf681e1c..2315cd52b 100644 --- a/code/nel/src/misc/xml_auto_ptr.cpp +++ b/code/nel/src/misc/xml_auto_ptr.cpp @@ -21,6 +21,10 @@ #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + //======================================= void CXMLAutoPtr::destroy() { diff --git a/code/nel/src/sound/driver/openal/stdopenal.h b/code/nel/src/sound/driver/openal/stdopenal.h index 37b7e5e2f..f689a1e53 100644 --- a/code/nel/src/sound/driver/openal/stdopenal.h +++ b/code/nel/src/sound/driver/openal/stdopenal.h @@ -14,7 +14,15 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "nel/misc/types_nl.h" +#ifndef STDOPENAL_H +#define STDOPENAL_H + +#if defined(_MSC_VER) && defined(_DEBUG) + #define _CRTDBG_MAP_ALLOC + #include + #include + #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif #include #include @@ -35,6 +43,8 @@ #include #include +#include "nel/misc/types_nl.h" + #ifdef NL_OS_MAC # include # include @@ -59,4 +69,5 @@ #include "nel/sound/driver/listener.h" #include "nel/sound/driver/effect.h" +#endif /* end of file */ From fd6a4d9f757a92142a6557c62f9f9a971f4a835d Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 15:50:28 +0100 Subject: [PATCH 22/50] Fixed: Compilation --HG-- branch : develop --- code/nel/include/nel/3d/animatable.h | 2 ++ code/nel/include/nel/3d/animated_lightmap.h | 4 +++ .../include/nel/3d/async_file_manager_3d.h | 4 +-- .../include/nel/3d/async_texture_manager.h | 2 +- code/nel/include/nel/3d/camera_col.h | 19 +++++++------- code/nel/include/nel/3d/cloud_scape_user.h | 1 + code/nel/include/nel/3d/fasthls_modifier.h | 4 +-- .../include/nel/3d/ig_surface_light_build.h | 7 ++--- code/nel/include/nel/3d/matrix_3x4.h | 14 +++++----- code/nel/include/nel/3d/meshvp_wind_tree.h | 2 +- .../include/nel/3d/particle_system_manager.h | 2 +- code/nel/include/nel/3d/ray_mesh.h | 2 +- code/nel/include/nel/3d/render_trav.h | 2 ++ code/nel/include/nel/3d/seg_remanence_shape.h | 2 +- code/nel/include/nel/3d/shadow_map.h | 18 ++++++------- code/nel/include/nel/3d/shadow_map_manager.h | 3 ++- code/nel/include/nel/3d/shadow_skin.h | 8 +++--- code/nel/include/nel/3d/stereo_hmd.h | 2 +- code/nel/include/nel/3d/target_anim_ctrl.h | 26 +++++++++---------- code/nel/include/nel/3d/texture_emboss.h | 14 +++++----- code/nel/include/nel/3d/u_transform.h | 1 + code/nel/include/nel/3d/vegetable_light_ex.h | 2 +- code/nel/include/nel/3d/water_env_map.h | 1 + code/nel/src/3d/coarse_mesh_build.cpp | 1 + code/nel/src/3d/coarse_mesh_manager.cpp | 2 ++ code/nel/src/3d/computed_string.cpp | 1 + code/nel/src/3d/driver_user.cpp | 2 ++ code/nel/src/3d/flare_model.cpp | 3 ++- code/nel/src/3d/patch_render.cpp | 3 +++ code/nel/src/3d/play_list_user.cpp | 3 ++- code/nel/src/3d/ps_dot.cpp | 2 ++ code/nel/src/3d/ps_face.cpp | 3 ++- code/nel/src/3d/ps_face_look_at.cpp | 2 ++ code/nel/src/3d/ps_fan_light.cpp | 1 + code/nel/src/3d/ps_mesh.cpp | 5 ++-- code/nel/src/3d/ps_ribbon_base.cpp | 2 ++ code/nel/src/3d/ps_ribbon_look_at.cpp | 1 + code/nel/src/3d/ps_shockwave.cpp | 1 + code/nel/src/3d/ps_sound.cpp | 2 ++ code/nel/src/3d/ray_mesh.cpp | 2 ++ code/nel/src/3d/texture_emboss.cpp | 2 ++ code/nel/src/3d/vegetablevb_allocator.cpp | 1 + 42 files changed, 111 insertions(+), 70 deletions(-) diff --git a/code/nel/include/nel/3d/animatable.h b/code/nel/include/nel/3d/animatable.h index 09297ab2b..6e4a7b39f 100644 --- a/code/nel/include/nel/3d/animatable.h +++ b/code/nel/include/nel/3d/animatable.h @@ -19,6 +19,8 @@ #include "nel/misc/types_nl.h" #include "nel/misc/bit_set.h" +#include "nel/misc/smart_ptr.h" + #include #include #include diff --git a/code/nel/include/nel/3d/animated_lightmap.h b/code/nel/include/nel/3d/animated_lightmap.h index 51f1c909e..b8b887d7a 100644 --- a/code/nel/include/nel/3d/animated_lightmap.h +++ b/code/nel/include/nel/3d/animated_lightmap.h @@ -21,13 +21,17 @@ #include "nel/misc/types_nl.h" #include "nel/misc/smart_ptr.h" #include "nel/3d/animatable.h" + #include "nel/3d/track.h" + #include namespace NL3D { +class CScene; + // *************************************************************************** /** * An animated lightmap diff --git a/code/nel/include/nel/3d/async_file_manager_3d.h b/code/nel/include/nel/3d/async_file_manager_3d.h index dede1b419..4e86f10b1 100644 --- a/code/nel/include/nel/3d/async_file_manager_3d.h +++ b/code/nel/include/nel/3d/async_file_manager_3d.h @@ -88,7 +88,7 @@ private: public: std::string MeshName; public: - CMeshLoad (const std::string &meshName, IShape **ppShp, IDriver *pDriver, const CVector &position, uint selectedTexture); + CMeshLoad (const std::string &meshName, IShape **ppShp, IDriver *pDriver, const NLMISC::CVector &position, uint selectedTexture); void run (void); void getName (std::string &result) const; }; @@ -122,7 +122,7 @@ private: CTextureFile *TextureFile; bool *Signal; public: - CTextureLoad(CTextureFile *textureFile, bool *psgn, const CVector &position) + CTextureLoad(CTextureFile *textureFile, bool *psgn, const NLMISC::CVector &position) : TextureFile(textureFile), Signal(psgn) { Position = position; diff --git a/code/nel/include/nel/3d/async_texture_manager.h b/code/nel/include/nel/3d/async_texture_manager.h index 8a848cb52..af27c3fde 100644 --- a/code/nel/include/nel/3d/async_texture_manager.h +++ b/code/nel/include/nel/3d/async_texture_manager.h @@ -152,7 +152,7 @@ private: struct CTextureLodToSort { CTextureLod *Lod; - CVector Position; + NLMISC::CVector Position; bool operator<(const CTextureLodToSort &other) const { return Lod->WeightWeight; diff --git a/code/nel/include/nel/3d/camera_col.h b/code/nel/include/nel/3d/camera_col.h index 9151b0a22..6b5a30517 100644 --- a/code/nel/include/nel/3d/camera_col.h +++ b/code/nel/include/nel/3d/camera_col.h @@ -20,6 +20,7 @@ #include "nel/misc/types_nl.h" #include "nel/misc/vector.h" #include "nel/misc/plane.h" +#include "nel/misc/aabbox.h" namespace NL3D { @@ -39,16 +40,16 @@ public: /** build the camera collision as a cone or a cylinder */ - void build(const CVector &start, const CVector &end, float radius, bool cone); + void build(const NLMISC::CVector &start, const NLMISC::CVector &end, float radius, bool cone); /** build the camera collision as a simple ray */ - void buildRay(const CVector &start, const CVector &end); + void buildRay(const NLMISC::CVector &start, const NLMISC::CVector &end); /** compute the intersection of the Camera Volume against the triangle, and minimize * minDist (actual square of distance) with min sqr distance of the poly. */ - void minimizeDistanceAgainstTri(const CVector &p0, const CVector &p1, const CVector &p2, float &sqrMinDist); + void minimizeDistanceAgainstTri(const NLMISC::CVector &p0, const NLMISC::CVector &p1, const NLMISC::CVector &p2, float &sqrMinDist); /** Compute into this the camera collision 'other' mul by 'matrix' * NB: for cone Radius, suppose uniform scale, else will have strange result (a uniform scale is deduced) @@ -69,9 +70,9 @@ private: enum {MaxNPlanes=6}; // The start of the camera raycast - CVector _Start; + NLMISC::CVector _Start; // The end of the camera raycast - CVector _End; + NLMISC::CVector _End; // The radius (at end only if cone) float _Radius; // cone or cylinder? @@ -83,8 +84,8 @@ private: NLMISC::CAABBox _BBox; // Temp Data for minimizeDistanceAgainstTri - CVector _ArrayIn[3+MaxNPlanes]; - CVector _ArrayOut[3+MaxNPlanes]; + NLMISC::CVector _ArrayIn[3+MaxNPlanes]; + NLMISC::CVector _ArrayOut[3+MaxNPlanes]; // The pyramid representing the camera collision volume. Nb: local to start for precision problems NLMISC::CPlane _Pyramid[MaxNPlanes]; @@ -97,10 +98,10 @@ private: float _MaxRadiusProj; float _OODeltaRadiusProj; float _RayLen; - CVector _RayNorm; + NLMISC::CVector _RayNorm; // simpler method for simple ray - void intersectRay(const CVector &p0, const CVector &p1, const CVector &p2, float &sqrMinDist); + void intersectRay(const NLMISC::CVector &p0, const NLMISC::CVector &p1, const NLMISC::CVector &p2, float &sqrMinDist); }; diff --git a/code/nel/include/nel/3d/cloud_scape_user.h b/code/nel/include/nel/3d/cloud_scape_user.h index 15c926927..9e2a88376 100644 --- a/code/nel/include/nel/3d/cloud_scape_user.h +++ b/code/nel/include/nel/3d/cloud_scape_user.h @@ -22,6 +22,7 @@ namespace NL3D class UDriver; class UCamera; class CCloudScape; +class CScene; /// implementation of UWaterInstance methods class CCloudScapeUser : public UCloudScape diff --git a/code/nel/include/nel/3d/fasthls_modifier.h b/code/nel/include/nel/3d/fasthls_modifier.h index b5ec7ad82..de8f22a3d 100644 --- a/code/nel/include/nel/3d/fasthls_modifier.h +++ b/code/nel/include/nel/3d/fasthls_modifier.h @@ -48,7 +48,7 @@ public: static void releaseInstance(); /// convert a HLS (0..255) to a RGBA. - CRGBA convert(uint H, uint L, uint S); + NLMISC::CRGBA convert(uint H, uint L, uint S); /// convert a RGBA bitmap into another RGBA, with HLS decal (0..255, -255..+255, -255..+255). void convertRGBABitmap(NLMISC::CBitmap &dst, const NLMISC::CBitmap &src, uint8 dh, sint dl, sint ds); @@ -75,7 +75,7 @@ private: uint8 H,L,S,A; }; - CRGBA _HueTable[HueTableSize]; + NLMISC::CRGBA _HueTable[HueTableSize]; CHLSA _Color16ToHLS[65536]; /// Constructor diff --git a/code/nel/include/nel/3d/ig_surface_light_build.h b/code/nel/include/nel/3d/ig_surface_light_build.h index e6b37b25c..77046dabb 100644 --- a/code/nel/include/nel/3d/ig_surface_light_build.h +++ b/code/nel/include/nel/3d/ig_surface_light_build.h @@ -26,6 +26,7 @@ namespace NL3D { + class CInstanceGroup; // *************************************************************************** /** @@ -106,14 +107,14 @@ public: public: /// Debug: build a colored Grid mesh of SunContribution. - void buildSunDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const CVector &deltaPos=CVector::Null); + void buildSunDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const NLMISC::CVector &deltaPos= NLMISC::CVector::Null); /// Debug: build a colored Grid mesh of PointLight. R= pointLight1 id. G= PointLight2 id. B= The multiplier used to show Ids. - void buildPLDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const CVector &deltaPos, const CInstanceGroup &igOut); + void buildPLDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const NLMISC::CVector &deltaPos, const CInstanceGroup &igOut); private: void addDebugMeshFaces(CMesh::CMeshBuild &meshBuild, CSurface &surface, uint vId0, - const std::vector &colors); + const std::vector &colors); }; diff --git a/code/nel/include/nel/3d/matrix_3x4.h b/code/nel/include/nel/3d/matrix_3x4.h index 45901c20e..7b8d6dcf6 100644 --- a/code/nel/include/nel/3d/matrix_3x4.h +++ b/code/nel/include/nel/3d/matrix_3x4.h @@ -47,7 +47,7 @@ public: float a31, a32, a33, a34; // Copy from a matrix. - void set(const CMatrix &mat) + void set(const NLMISC::CMatrix &mat) { const float *m =mat.get(); a11= m[0]; a12= m[4]; a13= m[8] ; a14= m[12]; @@ -57,14 +57,14 @@ public: // mulSetvector. NB: in should be different as v!! (else don't work). - void mulSetVector(const CVector &in, CVector &out) + void mulSetVector(const NLMISC::CVector &in, NLMISC::CVector &out) { out.x= (a11*in.x + a12*in.y + a13*in.z); out.y= (a21*in.x + a22*in.y + a23*in.z); out.z= (a31*in.x + a32*in.y + a33*in.z); } // mulSetpoint. NB: in should be different as v!! (else don't work). - void mulSetPoint(const CVector &in, CVector &out) + void mulSetPoint(const NLMISC::CVector &in, NLMISC::CVector &out) { out.x= (a11*in.x + a12*in.y + a13*in.z + a14); out.y= (a21*in.x + a22*in.y + a23*in.z + a24); @@ -73,14 +73,14 @@ public: // mulSetvector. NB: in should be different as v!! (else don't work). - void mulSetVector(const CVector &in, float scale, CVector &out) + void mulSetVector(const NLMISC::CVector &in, float scale, NLMISC::CVector &out) { out.x= (a11*in.x + a12*in.y + a13*in.z) * scale; out.y= (a21*in.x + a22*in.y + a23*in.z) * scale; out.z= (a31*in.x + a32*in.y + a33*in.z) * scale; } // mulSetpoint. NB: in should be different as v!! (else don't work). - void mulSetPoint(const CVector &in, float scale, CVector &out) + void mulSetPoint(const NLMISC::CVector &in, float scale, NLMISC::CVector &out) { out.x= (a11*in.x + a12*in.y + a13*in.z + a14) * scale; out.y= (a21*in.x + a22*in.y + a23*in.z + a24) * scale; @@ -89,14 +89,14 @@ public: // mulAddvector. NB: in should be different as v!! (else don't work). - void mulAddVector(const CVector &in, float scale, CVector &out) + void mulAddVector(const NLMISC::CVector &in, float scale, NLMISC::CVector &out) { out.x+= (a11*in.x + a12*in.y + a13*in.z) * scale; out.y+= (a21*in.x + a22*in.y + a23*in.z) * scale; out.z+= (a31*in.x + a32*in.y + a33*in.z) * scale; } // mulAddpoint. NB: in should be different as v!! (else don't work). - void mulAddPoint(const CVector &in, float scale, CVector &out) + void mulAddPoint(const NLMISC::CVector &in, float scale, NLMISC::CVector &out) { out.x+= (a11*in.x + a12*in.y + a13*in.z + a14) * scale; out.y+= (a21*in.x + a22*in.y + a23*in.z + a24) * scale; diff --git a/code/nel/include/nel/3d/meshvp_wind_tree.h b/code/nel/include/nel/3d/meshvp_wind_tree.h index e2c790d6d..d8e7598b7 100644 --- a/code/nel/include/nel/3d/meshvp_wind_tree.h +++ b/code/nel/include/nel/3d/meshvp_wind_tree.h @@ -124,7 +124,7 @@ private: double _LastSceneTime; // maximum amplitude vector for each level. Stored in mesh because same for all instances. - CVector _MaxDeltaPos[HrcDepth]; + NLMISC::CVector _MaxDeltaPos[HrcDepth]; float _MaxVertexMove; // MBR Cache diff --git a/code/nel/include/nel/3d/particle_system_manager.h b/code/nel/include/nel/3d/particle_system_manager.h index f48b17f1b..1e02963bb 100644 --- a/code/nel/include/nel/3d/particle_system_manager.h +++ b/code/nel/include/nel/3d/particle_system_manager.h @@ -87,7 +87,7 @@ private: { public: CParticleSystemModel *Model; - CMatrix OldAncestorMatOrRelPos; // last matrix of ancestor skeleton or relative matrix of ps to its ancestor (see flag below) + NLMISC::CMatrix OldAncestorMatOrRelPos; // last matrix of ancestor skeleton or relative matrix of ps to its ancestor (see flag below) bool IsRelMatrix; // gives usage of the field OldAncestorMatOrRelPos bool HasAncestorSkeleton; // has the system an ancestor skeleton ? public: diff --git a/code/nel/include/nel/3d/ray_mesh.h b/code/nel/include/nel/3d/ray_mesh.h index 80671a49c..70a25c2be 100644 --- a/code/nel/include/nel/3d/ray_mesh.h +++ b/code/nel/include/nel/3d/ray_mesh.h @@ -53,7 +53,7 @@ public: public: // Simple Definition of a mesh used to test against Ray - std::vector Vertices; + std::vector Vertices; std::vector Triangles; /// Empty? diff --git a/code/nel/include/nel/3d/render_trav.h b/code/nel/include/nel/3d/render_trav.h index 6e41d8282..41570c2ca 100644 --- a/code/nel/include/nel/3d/render_trav.h +++ b/code/nel/include/nel/3d/render_trav.h @@ -28,6 +28,8 @@ #include "nel/3d/shadow_map_manager.h" #include "nel/3d/u_scene.h" #include "nel/3d/vertex_program.h" +#include "nel/3d/transform.h" + #include diff --git a/code/nel/include/nel/3d/seg_remanence_shape.h b/code/nel/include/nel/3d/seg_remanence_shape.h index 6a1f2cb5e..80d54b6ca 100644 --- a/code/nel/include/nel/3d/seg_remanence_shape.h +++ b/code/nel/include/nel/3d/seg_remanence_shape.h @@ -22,7 +22,7 @@ #include "nel/misc/smart_ptr.h" #include "nel/misc/vector.h" #include "nel/misc/aabbox.h" - +#include "nel/misc/class_id.h" #include "nel/3d/texture.h" #include "nel/3d/shape.h" diff --git a/code/nel/include/nel/3d/shadow_map.h b/code/nel/include/nel/3d/shadow_map.h index aa4921594..84cc32af1 100644 --- a/code/nel/include/nel/3d/shadow_map.h +++ b/code/nel/include/nel/3d/shadow_map.h @@ -51,7 +51,7 @@ public: * The usage of this matrix is for UV projection: XYZ= WorldProjectionMatrix * UVW. * NB: Vj (ie for W) is mapped such that Vp means NearClip of the shadow and Vp+Vj means FarClip of the shadow */ - CMatrix LocalProjectionMatrix; + NLMISC::CMatrix LocalProjectionMatrix; /** Computed at shadow casting time. They are clipping planes used to clip receivers (mirror of the OBB). * Receivers may use them to clip sub received parts (as they which) @@ -63,7 +63,7 @@ public: /** Computed at shadow casting time. This is the LocalPos Bouding Box containing the shadow (AxisAligned). * \see generateClipInfoFromMatrix() */ - CAABBox LocalBoundingBox; + NLMISC::CAABBox LocalBoundingBox; // Filled by ShadowMapManager. This is the Last Frame Id we had update the texture. @@ -114,13 +114,13 @@ public: * driver->setupModelMatrix(localPosMatrix); * Then render his mesh. */ - void buildCasterCameraMatrix(const CVector &lightDir, const CMatrix &localPosMatrix, const CAABBox &bbShape, CMatrix &cameraMatrix); + void buildCasterCameraMatrix(const NLMISC::CVector &lightDir, const NLMISC::CMatrix &localPosMatrix, const NLMISC::CAABBox &bbShape, NLMISC::CMatrix &cameraMatrix); /** From the Camera matrix computed with buildCasterCameraMatrix, compute the LocalProjectionMatrix, which modify the * J axis according to backPoint and Shadow Depth. * NB: automatically calls the buildClipInfoFromMatrix() method */ - void buildProjectionInfos(const CMatrix &cameraMatrix, const CVector &backPoint, float shadowMaxDepth); + void buildProjectionInfos(const NLMISC::CMatrix &cameraMatrix, const NLMISC::CVector &backPoint, float shadowMaxDepth); /** The ShadowMap Caster can call this method after setting LocalProjectionMatrix. It computes auto the * LocalClipPlanes and LocalBoundingBox from it. NB: don't use it if you use buildProjectionInfos(). @@ -158,13 +158,13 @@ class CShadowMapProjector { public: CShadowMapProjector(); - void setWorldSpaceTextMat(const CMatrix &ws); - void applyToMaterial(const CMatrix &receiverWorldMatrix, CMaterial &material); + void setWorldSpaceTextMat(const NLMISC::CMatrix &ws); + void applyToMaterial(const NLMISC::CMatrix &receiverWorldMatrix, CMaterial &material); private: - CMatrix _WsTextMat; - CMatrix _XYZToUWVMatrix; - CMatrix _XYZToWUVMatrix; + NLMISC::CMatrix _WsTextMat; + NLMISC::CMatrix _XYZToUWVMatrix; + NLMISC::CMatrix _XYZToWUVMatrix; }; diff --git a/code/nel/include/nel/3d/shadow_map_manager.h b/code/nel/include/nel/3d/shadow_map_manager.h index d52c0fb03..8f8267492 100644 --- a/code/nel/include/nel/3d/shadow_map_manager.h +++ b/code/nel/include/nel/3d/shadow_map_manager.h @@ -29,7 +29,8 @@ namespace NL3D { -class CTransform; +class CTransform; +class CScene; // *************************************************************************** diff --git a/code/nel/include/nel/3d/shadow_skin.h b/code/nel/include/nel/3d/shadow_skin.h index 2b63a635d..7560e0c50 100644 --- a/code/nel/include/nel/3d/shadow_skin.h +++ b/code/nel/include/nel/3d/shadow_skin.h @@ -33,9 +33,9 @@ namespace NL3D class CShadowVertex { public: - CVector Vertex; - uint32 MatrixId; - void serial(NLMISC::IStream &f) + NLMISC::CVector Vertex; + uint32 MatrixId; + void serial(NLMISC::IStream &f) { (void)f.serialVersion(0); @@ -82,7 +82,7 @@ public: * if don't intersect, dist2D="nearest distance to the ray", and distZ=0 * \param computeDist2D if false and don't intersect, then return dist2D=FLT_MAX, and distZ=0 */ - bool getRayIntersection(const CMatrix &toRaySpace, class CSkeletonModel &skeleton, + bool getRayIntersection(const NLMISC::CMatrix &toRaySpace, class CSkeletonModel &skeleton, const std::vector &matrixInfluences, float &dist2D, float &distZ, bool computeDist2D); private: diff --git a/code/nel/include/nel/3d/stereo_hmd.h b/code/nel/include/nel/3d/stereo_hmd.h index 3276e78fe..69f8e60dd 100644 --- a/code/nel/include/nel/3d/stereo_hmd.h +++ b/code/nel/include/nel/3d/stereo_hmd.h @@ -54,7 +54,7 @@ public: virtual NLMISC::CQuat getOrientation() const = 0; /// Set the GUI reference - virtual void setInterfaceMatrix(const NL3D::CMatrix &matrix) = 0; + virtual void setInterfaceMatrix(const NLMISC::CMatrix &matrix) = 0; /// Get GUI center (1 = width, 1 = height, 0 = center) virtual void getInterface2DShift(uint cid, float &x, float &y, float distance) const = 0; diff --git a/code/nel/include/nel/3d/target_anim_ctrl.h b/code/nel/include/nel/3d/target_anim_ctrl.h index b2edf9f84..19aae3c20 100644 --- a/code/nel/include/nel/3d/target_anim_ctrl.h +++ b/code/nel/include/nel/3d/target_anim_ctrl.h @@ -44,16 +44,16 @@ public: public: /// Target controled or direction controled. Default to DirectionMode - TMode Mode; + TMode Mode; /// \name Target and Direction specific // @{ /// For TargetMode, the world Position of the target. - CVector WorldTarget; + NLMISC::CVector WorldTarget; /// For TargetMode only, the Pos of eyes relative to the bone controlled. Default to (0,0,0) - CVector EyePos; + NLMISC::CVector EyePos; /// For DirectionMode, the WorldRotation to apply to the bone. NB: modified in execute() if TargetMode - CQuat CurrentWorldDirection; + NLMISC::CQuat CurrentWorldDirection; // @} /// \name Common @@ -61,13 +61,13 @@ public: /** This enable or disable the ctrl. When disabled or enabled, the ctrl ensure * that the movement does not "pop", respecting MaxAngularVelocity. Default to true. */ - bool Enabled; + bool Enabled; /// This give The World Orientation when the Mesh is in bind Pos (default to "LookBack"). - CQuat DefaultWorldDirection; + NLMISC::CQuat DefaultWorldDirection; /// The Maximum angle of rotation that can be performed between the Default Direction and Current Direction. Default to Pi/3 - float MaxAngle; + float MaxAngle; /// The Maximum Angular Velocity the ctrl can perform. Default to 2*Pi per second. - float MaxAngularVelocity; + float MaxAngularVelocity; // @} @@ -77,19 +77,19 @@ public: virtual ~CTargetAnimCtrl(); /// Called at compute() time. - virtual void execute(CSkeletonModel *model, CBone *bone); + virtual void execute(CSkeletonModel *model, CBone *bone); private: /// The last rotation computed (in LocalSkeleton Space). Used to smooth transition - CQuat _LastLSRotation; + NLMISC::CQuat _LastLSRotation; /// This tells that a Enable/Disable transition is in progress. - bool _LastEnabled; - bool _EnableToDisableTransition; + bool _LastEnabled; + bool _EnableToDisableTransition; - CQuat getCurrentLSRotationFromBone(CSkeletonModel *model, CBone *bone); + NLMISC::CQuat getCurrentLSRotationFromBone(CSkeletonModel *model, CBone *bone); }; diff --git a/code/nel/include/nel/3d/texture_emboss.h b/code/nel/include/nel/3d/texture_emboss.h index a4c469a5c..cdab6d648 100644 --- a/code/nel/include/nel/3d/texture_emboss.h +++ b/code/nel/include/nel/3d/texture_emboss.h @@ -54,16 +54,16 @@ public: bool isSharingEnabled() const { return !_DisableSharing; } // set the ambiant/ diffuse color to be added to the embossed texture - void setAmbient(CRGBA ambient) { _Ambient = ambient; touch(); } - void setDiffuse(CRGBA diffuse) { _Diffuse = diffuse; touch(); } + void setAmbient(NLMISC::CRGBA ambient) { _Ambient = ambient; touch(); } + void setDiffuse(NLMISC::CRGBA diffuse) { _Diffuse = diffuse; touch(); } // Set the direction of light (usually should be normalized). The bitmap is in the x,y plane void setLightDir(const NLMISC::CVector &lightDir) { _LightDir = lightDir; touch(); } // set a factor for the slope void setSlopeFactor(float factor) { _SlopeFactor = factor; touch(); } // - CRGBA getAmbient() const { return _Ambient; } - CRGBA getDiffuse() const { return _Diffuse; } - const CVector &getLightDir() const { return _LightDir; } + NLMISC::CRGBA getAmbient() const { return _Ambient; } + NLMISC::CRGBA getDiffuse() const { return _Diffuse; } + const NLMISC::CVector &getLightDir() const { return _LightDir; } float getSlopeFactor() const { return _SlopeFactor; } @@ -75,8 +75,8 @@ protected: // inherited from ITexture. Generate this bumpmap pixels virtual void doGenerate(bool async = false); NLMISC::CSmartPtr _HeightMap; - CRGBA _Ambient; - CRGBA _Diffuse; + NLMISC::CRGBA _Ambient; + NLMISC::CRGBA _Diffuse; NLMISC::CVector _LightDir; bool _DisableSharing; float _SlopeFactor; diff --git a/code/nel/include/nel/3d/u_transform.h b/code/nel/include/nel/3d/u_transform.h index 556be7908..66315fa40 100644 --- a/code/nel/include/nel/3d/u_transform.h +++ b/code/nel/include/nel/3d/u_transform.h @@ -32,6 +32,7 @@ using NLMISC::CQuat; class ILogicInfo; class CCluster; +class ITransformable; // *************************************************************************** /** diff --git a/code/nel/include/nel/3d/vegetable_light_ex.h b/code/nel/include/nel/3d/vegetable_light_ex.h index a513dbeab..d9c1f2f0b 100644 --- a/code/nel/include/nel/3d/vegetable_light_ex.h +++ b/code/nel/include/nel/3d/vegetable_light_ex.h @@ -48,7 +48,7 @@ public: /// PointLights. Used at CVegetableManager::updateLighting() to get current colors of pointLights. CPointLightNamed *PointLight[MaxNumLight]; /// Direction of the light. the direction to the instance should be precomputed. - CVector Direction[MaxNumLight]; + NLMISC::CVector Direction[MaxNumLight]; /// Factor to be multiplied by color of the light. Actually it is the attenuation factor. uint PointLightFactor[MaxNumLight]; diff --git a/code/nel/include/nel/3d/water_env_map.h b/code/nel/include/nel/3d/water_env_map.h index 50fca18ec..2282610d7 100644 --- a/code/nel/include/nel/3d/water_env_map.h +++ b/code/nel/include/nel/3d/water_env_map.h @@ -21,6 +21,7 @@ // #include "nel/3d/texture_cube.h" #include "nel/3d/texture_blank.h" +#include "nel/3d/animation_time.h" namespace NL3D diff --git a/code/nel/src/3d/coarse_mesh_build.cpp b/code/nel/src/3d/coarse_mesh_build.cpp index 8a712a57f..fec5f0b3f 100644 --- a/code/nel/src/3d/coarse_mesh_build.cpp +++ b/code/nel/src/3d/coarse_mesh_build.cpp @@ -19,6 +19,7 @@ #include "nel/3d/coarse_mesh_build.h" #include "nel/3d/mesh.h" +#include "nel/3d/debug_vb.h" using namespace NLMISC; diff --git a/code/nel/src/3d/coarse_mesh_manager.cpp b/code/nel/src/3d/coarse_mesh_manager.cpp index f45ca7675..6ba8b3ec6 100644 --- a/code/nel/src/3d/coarse_mesh_manager.cpp +++ b/code/nel/src/3d/coarse_mesh_manager.cpp @@ -21,6 +21,8 @@ #include "nel/3d/texture_file.h" #include "nel/misc/hierarchical_timer.h" #include "nel/3d/clip_trav.h" +#include "nel/3d/debug_vb.h" + #include "nel/misc/fast_mem.h" diff --git a/code/nel/src/3d/computed_string.cpp b/code/nel/src/3d/computed_string.cpp index 1a9fefba5..6bc1be856 100644 --- a/code/nel/src/3d/computed_string.cpp +++ b/code/nel/src/3d/computed_string.cpp @@ -22,6 +22,7 @@ #include "nel/3d/material.h" #include "nel/3d/frustum.h" #include "nel/3d/viewport.h" +#include "nel/3d/debug_vb.h" #include "nel/misc/smart_ptr.h" #include "nel/misc/debug.h" diff --git a/code/nel/src/3d/driver_user.cpp b/code/nel/src/3d/driver_user.cpp index 812bb52a9..b236223b7 100644 --- a/code/nel/src/3d/driver_user.cpp +++ b/code/nel/src/3d/driver_user.cpp @@ -33,6 +33,8 @@ #include "nel/3d/water_env_map_user.h" #include "nel/3d/water_pool_manager.h" #include "nel/3d/u_camera.h" +#include "nel/3d/debug_vb.h" + #include "nel/misc/hierarchical_timer.h" #include "nel/misc/event_emitter.h" diff --git a/code/nel/src/3d/flare_model.cpp b/code/nel/src/3d/flare_model.cpp index f964a9102..c48e754cf 100644 --- a/code/nel/src/3d/flare_model.cpp +++ b/code/nel/src/3d/flare_model.cpp @@ -26,8 +26,9 @@ #include "nel/3d/occlusion_query.h" #include "nel/3d/mesh.h" #include "nel/3d/viewport.h" -#include "nel/misc/common.h" +#include "nel/3d/debug_vb.h" +#include "nel/misc/common.h" namespace NL3D { diff --git a/code/nel/src/3d/patch_render.cpp b/code/nel/src/3d/patch_render.cpp index ee916a3fe..59978a94d 100644 --- a/code/nel/src/3d/patch_render.cpp +++ b/code/nel/src/3d/patch_render.cpp @@ -24,8 +24,11 @@ #include "nel/3d/landscape.h" #include "nel/3d/landscape_profile.h" #include "nel/3d/patchdlm_context.h" +#include "nel/3d/debug_vb.h" + #include "nel/misc/vector.h" #include "nel/misc/common.h" + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/play_list_user.cpp b/code/nel/src/3d/play_list_user.cpp index 0a80a1076..9f9d0c688 100644 --- a/code/nel/src/3d/play_list_user.cpp +++ b/code/nel/src/3d/play_list_user.cpp @@ -19,8 +19,9 @@ #include "nel/3d/play_list_user.h" #include "nel/3d/animation_set_user.h" #include "nel/3d/u_transform.h" -#include "nel/misc/hierarchical_timer.h" +#include "nel/3d/transform.h" +#include "nel/misc/hierarchical_timer.h" #include "nel/misc/debug.h" using namespace NLMISC; diff --git a/code/nel/src/3d/ps_dot.cpp b/code/nel/src/3d/ps_dot.cpp index 516cac8f1..3711ff50e 100644 --- a/code/nel/src/3d/ps_dot.cpp +++ b/code/nel/src/3d/ps_dot.cpp @@ -21,6 +21,8 @@ #include "nel/3d/ps_iterator.h" #include "nel/3d/driver.h" #include "nel/3d/particle_system.h" +#include "nel/3d/debug_vb.h" + #include "nel/misc/fast_mem.h" namespace NL3D diff --git a/code/nel/src/3d/ps_face.cpp b/code/nel/src/3d/ps_face.cpp index e87459acf..818522897 100644 --- a/code/nel/src/3d/ps_face.cpp +++ b/code/nel/src/3d/ps_face.cpp @@ -21,8 +21,9 @@ #include "nel/3d/driver.h" #include "nel/3d/ps_iterator.h" #include "nel/3d/particle_system.h" -#include "nel/misc/quat.h" +#include "nel/3d/debug_vb.h" +#include "nel/misc/quat.h" namespace NL3D diff --git a/code/nel/src/3d/ps_face_look_at.cpp b/code/nel/src/3d/ps_face_look_at.cpp index 5b06f6eb5..32cd7c248 100644 --- a/code/nel/src/3d/ps_face_look_at.cpp +++ b/code/nel/src/3d/ps_face_look_at.cpp @@ -21,6 +21,8 @@ #include "nel/3d/driver.h" #include "nel/3d/ps_iterator.h" #include "nel/3d/particle_system.h" +#include "nel/3d/debug_vb.h" + #include "nel/misc/fast_floor.h" diff --git a/code/nel/src/3d/ps_fan_light.cpp b/code/nel/src/3d/ps_fan_light.cpp index 055826749..7f4f789a0 100644 --- a/code/nel/src/3d/ps_fan_light.cpp +++ b/code/nel/src/3d/ps_fan_light.cpp @@ -22,6 +22,7 @@ #include "nel/3d/ps_iterator.h" #include "nel/3d/particle_system.h" #include "nel/3d/driver.h" +#include "nel/3d/debug_vb.h" diff --git a/code/nel/src/3d/ps_mesh.cpp b/code/nel/src/3d/ps_mesh.cpp index 5b61168e5..25a4d8034 100644 --- a/code/nel/src/3d/ps_mesh.cpp +++ b/code/nel/src/3d/ps_mesh.cpp @@ -29,12 +29,11 @@ #include "nel/3d/particle_system_shape.h" #include "nel/3d/particle_system_model.h" #include "nel/3d/ps_iterator.h" +#include "nel/3d/debug_vb.h" + #include "nel/misc/stream.h" #include "nel/misc/path.h" - - - namespace NL3D { diff --git a/code/nel/src/3d/ps_ribbon_base.cpp b/code/nel/src/3d/ps_ribbon_base.cpp index 8f2a64932..8f602b931 100644 --- a/code/nel/src/3d/ps_ribbon_base.cpp +++ b/code/nel/src/3d/ps_ribbon_base.cpp @@ -20,6 +20,8 @@ #include "nel/3d/ps_ribbon_base.h" #include "nel/3d/particle_system.h" +using namespace NLMISC; + namespace NL3D { diff --git a/code/nel/src/3d/ps_ribbon_look_at.cpp b/code/nel/src/3d/ps_ribbon_look_at.cpp index 966e5a5b1..7fece0e3d 100644 --- a/code/nel/src/3d/ps_ribbon_look_at.cpp +++ b/code/nel/src/3d/ps_ribbon_look_at.cpp @@ -20,6 +20,7 @@ #include "nel/3d/particle_system.h" #include "nel/3d/ps_macro.h" #include "nel/3d/driver.h" +#include "nel/3d/debug_vb.h" namespace NL3D { diff --git a/code/nel/src/3d/ps_shockwave.cpp b/code/nel/src/3d/ps_shockwave.cpp index 20069e175..44f91d208 100644 --- a/code/nel/src/3d/ps_shockwave.cpp +++ b/code/nel/src/3d/ps_shockwave.cpp @@ -22,6 +22,7 @@ #include "nel/3d/texture_grouped.h" #include "nel/3d/ps_iterator.h" #include "nel/3d/particle_system.h" +#include "nel/3d/debug_vb.h" namespace NL3D diff --git a/code/nel/src/3d/ps_sound.cpp b/code/nel/src/3d/ps_sound.cpp index a5ae6ad26..a1705d907 100644 --- a/code/nel/src/3d/ps_sound.cpp +++ b/code/nel/src/3d/ps_sound.cpp @@ -21,6 +21,8 @@ #include "nel/3d/u_ps_sound_interface.h" #include "nel/3d/ps_attrib_maker.h" +using namespace NLMISC; + namespace NL3D { diff --git a/code/nel/src/3d/ray_mesh.cpp b/code/nel/src/3d/ray_mesh.cpp index b315979b1..ca6b9b09d 100644 --- a/code/nel/src/3d/ray_mesh.cpp +++ b/code/nel/src/3d/ray_mesh.cpp @@ -19,6 +19,8 @@ #include "nel/3d/ray_mesh.h" #include "nel/misc/vector_2f.h" #include "nel/misc/fast_mem.h" +#include "nel/misc/plane.h" + #include "nel/3d/matrix_3x4.h" using namespace NLMISC; diff --git a/code/nel/src/3d/texture_emboss.cpp b/code/nel/src/3d/texture_emboss.cpp index 414f93093..55d5d85a9 100644 --- a/code/nel/src/3d/texture_emboss.cpp +++ b/code/nel/src/3d/texture_emboss.cpp @@ -17,6 +17,8 @@ #include "std3d.h" #include "nel/3d/texture_emboss.h" +using namespace NLMISC; + namespace NL3D { // *********************************************************************************************************** diff --git a/code/nel/src/3d/vegetablevb_allocator.cpp b/code/nel/src/3d/vegetablevb_allocator.cpp index f5c833d8a..fa5aea364 100644 --- a/code/nel/src/3d/vegetablevb_allocator.cpp +++ b/code/nel/src/3d/vegetablevb_allocator.cpp @@ -19,6 +19,7 @@ #include "nel/3d/vegetablevb_allocator.h" #include "nel/3d/vegetable_def.h" +#include "nel/3d/debug_vb.h" using namespace std; From 13154bd79d519a5f6260263aff46fecc78aa118d Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 15:55:00 +0100 Subject: [PATCH 23/50] Fixed: Replace free methods by freeBlock to avoid clash with free macros --HG-- branch : develop --- code/nel/include/nel/3d/quad_grid.h | 2 +- code/nel/include/nel/3d/tile_bank.h | 2 +- code/nel/include/nel/3d/vertex_buffer_heap.h | 2 +- code/nel/include/nel/misc/block_memory.h | 2 +- .../include/nel/misc/contiguous_block_allocator.h | 2 +- code/nel/include/nel/misc/fixed_size_allocator.h | 2 +- code/nel/include/nel/misc/heap_memory.h | 2 +- code/nel/include/nel/misc/object_arena_allocator.h | 2 +- code/nel/include/nel/misc/pool_memory.h | 2 +- .../src/3d/driver/opengl/driver_opengl_vertex.cpp | 4 ++-- .../opengl/driver_opengl_vertex_buffer_hard.cpp | 12 ++++++------ .../driver/opengl/driver_opengl_vertex_buffer_hard.h | 10 +++++----- code/nel/src/3d/landscape.cpp | 12 ++++++------ code/nel/src/3d/tile_bank.cpp | 2 +- code/nel/src/3d/vegetable_manager.cpp | 6 +++--- code/nel/src/3d/visual_collision_manager.cpp | 4 ++-- code/nel/src/misc/contiguous_block_allocator.cpp | 2 +- code/nel/src/misc/fixed_size_allocator.cpp | 2 +- code/nel/src/misc/heap_memory.cpp | 2 +- code/nel/src/misc/object_arena_allocator.cpp | 4 ++-- code/nel/src/pacs/move_container.cpp | 4 ++-- 21 files changed, 41 insertions(+), 41 deletions(-) diff --git a/code/nel/include/nel/3d/quad_grid.h b/code/nel/include/nel/3d/quad_grid.h index 12160b540..b03164520 100644 --- a/code/nel/include/nel/3d/quad_grid.h +++ b/code/nel/include/nel/3d/quad_grid.h @@ -654,7 +654,7 @@ template typename CQuadGrid::CIterator CQuadGrid::erase(typename if(!ptr->Selected) next= NULL; // delete the object. - _NodeBlockMemory.free(ptr); + _NodeBlockMemory.freeBlock(ptr); return CIterator((CNode*)next); diff --git a/code/nel/include/nel/3d/tile_bank.h b/code/nel/include/nel/3d/tile_bank.h index ec96afb64..1205c5940 100644 --- a/code/nel/include/nel/3d/tile_bank.h +++ b/code/nel/include/nel/3d/tile_bank.h @@ -140,7 +140,7 @@ public: private: void clearTile (CTile::TBitmap type); - void free () + void freeBlock () { nlassert ((_Flags&=NL3D_CTILE_FREE_FLAG)==0); _Flags|=NL3D_CTILE_FREE_FLAG; diff --git a/code/nel/include/nel/3d/vertex_buffer_heap.h b/code/nel/include/nel/3d/vertex_buffer_heap.h index c87426f7b..009d72489 100644 --- a/code/nel/include/nel/3d/vertex_buffer_heap.h +++ b/code/nel/include/nel/3d/vertex_buffer_heap.h @@ -69,7 +69,7 @@ public: bool allocate(uint numVertices, uint &indexStart); /// free a subset of the VB. nlstop if subset not found... - void free(uint indexStart); + void freeBlock(uint indexStart); // @} diff --git a/code/nel/include/nel/misc/block_memory.h b/code/nel/include/nel/misc/block_memory.h index 65fb36c46..912f92d1c 100644 --- a/code/nel/include/nel/misc/block_memory.h +++ b/code/nel/include/nel/misc/block_memory.h @@ -132,7 +132,7 @@ public: } /// delete an element allocated with this manager. dtor is called. NULL is tested. - void free(T* ptr) + void freeBlock(T* ptr) { if(!ptr) return; diff --git a/code/nel/include/nel/misc/contiguous_block_allocator.h b/code/nel/include/nel/misc/contiguous_block_allocator.h index 7a15d296d..43d6fac09 100644 --- a/code/nel/include/nel/misc/contiguous_block_allocator.h +++ b/code/nel/include/nel/misc/contiguous_block_allocator.h @@ -55,7 +55,7 @@ public: // allocated a block of n bytes void *alloc(uint numBytes); // deallocate a block - void free(void *block, uint numBytes); + void freeBlock(void *block, uint numBytes); // compute the total number of bytes allocated since init // NB : freed block are not subtracted from that total !! uint getNumAllocatedBytes() const { return _NumAllocatedBytes; } diff --git a/code/nel/include/nel/misc/fixed_size_allocator.h b/code/nel/include/nel/misc/fixed_size_allocator.h index 079c54bc0..ffc975250 100644 --- a/code/nel/include/nel/misc/fixed_size_allocator.h +++ b/code/nel/include/nel/misc/fixed_size_allocator.h @@ -45,7 +45,7 @@ public: /// alloc a block void *alloc(); /// destroy and dealloc a block - void free(void *block); + void freeBlock(void *block); // uint getNumBytesPerBlock() const { return _NumBytesPerBlock; } uint getNumBlockPerChunk() const { return _NumBlockPerChunk; } diff --git a/code/nel/include/nel/misc/heap_memory.h b/code/nel/include/nel/misc/heap_memory.h index cd1a4ab2b..0aeb3aec5 100644 --- a/code/nel/include/nel/misc/heap_memory.h +++ b/code/nel/include/nel/misc/heap_memory.h @@ -65,7 +65,7 @@ public: */ void *allocate(uint size); /// free a block allocated with alloate(). no-op if NULL. nlstop() if don't find this block. - void free(void *ptr); + void freeBlock(void *ptr); // ********************* diff --git a/code/nel/include/nel/misc/object_arena_allocator.h b/code/nel/include/nel/misc/object_arena_allocator.h index 6d318aca8..26b5daa50 100644 --- a/code/nel/include/nel/misc/object_arena_allocator.h +++ b/code/nel/include/nel/misc/object_arena_allocator.h @@ -49,7 +49,7 @@ public: */ void *alloc(uint size); // free an object that has previously been allocated with alloc. size should be remembered by the caller. - void free(void *); + void freeBlock(void *); // get the number of allocated objects uint getNumAllocatedBlocks() const; # ifdef NL_DEBUG diff --git a/code/nel/include/nel/misc/pool_memory.h b/code/nel/include/nel/misc/pool_memory.h index def4125dc..1bd3dbda9 100644 --- a/code/nel/include/nel/misc/pool_memory.h +++ b/code/nel/include/nel/misc/pool_memory.h @@ -90,7 +90,7 @@ public: /* * Free all the elements allocated since last free(). Memory is kept for next allocations. */ - void free () + void freeBlock () { typename std::list< std::vector >::iterator ite=_BlockList.begin(); while (ite!=_BlockList.end()) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp index bb0cf0c9f..ecadaaac2 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp @@ -1713,9 +1713,9 @@ void CDriverGL::resetVertexArrayRange() // After, Clear the 2 vertexArrayRange, if any. if(_AGPVertexArrayRange) - _AGPVertexArrayRange->free(); + _AGPVertexArrayRange->freeBlock(); if(_VRAMVertexArrayRange) - _VRAMVertexArrayRange->free(); + _VRAMVertexArrayRange->freeBlock(); } diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp index 6684ad100..b625af7f2 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp @@ -167,7 +167,7 @@ uint CVertexArrayRangeNVidia::sizeAllocated() const // *************************************************************************** -void CVertexArrayRangeNVidia::free() +void CVertexArrayRangeNVidia::freeBlock() { H_AUTO_OGL(CVertexArrayRangeNVidia_free) // release the ptr. @@ -244,7 +244,7 @@ void *CVertexArrayRangeNVidia::allocateVB(uint32 size) void CVertexArrayRangeNVidia::freeVB(void *ptr) { H_AUTO_OGL(CVertexArrayRangeNVidia_freeVB) - _HeapMemory.free(ptr); + _HeapMemory.freeBlock(ptr); } @@ -545,7 +545,7 @@ uint CVertexArrayRangeATI::sizeAllocated() const return _VertexArraySize; } // *************************************************************************** -void CVertexArrayRangeATI::free() +void CVertexArrayRangeATI::freeBlock() { H_AUTO_OGL(CVertexArrayRangeATI_free) // release the ptr. @@ -623,7 +623,7 @@ void *CVertexArrayRangeATI::allocateVB(uint32 size) void CVertexArrayRangeATI::freeVB(void *ptr) { H_AUTO_OGL(CVertexArrayRangeATI_freeVB) - _HeapMemory.free(ptr); + _HeapMemory.freeBlock(ptr); } @@ -853,7 +853,7 @@ bool CVertexArrayRangeMapObjectATI::allocate(uint32 size, CVertexBuffer::TPrefer } // *************************************************************************** -void CVertexArrayRangeMapObjectATI::free() +void CVertexArrayRangeMapObjectATI::freeBlock() { H_AUTO_OGL(CVertexArrayRangeMapObjectATI_free) _SizeAllocated = 0; @@ -1205,7 +1205,7 @@ bool CVertexArrayRangeARB::allocate(uint32 size, CVertexBuffer::TPreferredMemory } // *************************************************************************** -void CVertexArrayRangeARB::free() +void CVertexArrayRangeARB::freeBlock() { H_AUTO_OGL(CVertexArrayRangeARB_free) _SizeAllocated = 0; diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.h b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.h index 1ec64ccf2..302ff0de8 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.h @@ -57,7 +57,7 @@ public: /// allocate a vertex array space. false if error. client must free before re-allocate. virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType)= 0; /// free this space. - virtual void free()= 0; + virtual void freeBlock()= 0; /// create a IVertexBufferHardGL virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb) =0; /// return the size allocated. 0 if not allocated or failure @@ -141,7 +141,7 @@ public: /// allocate a vertex array sapce. false if error. must free before re-allocate. virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType); /// free this space. - virtual void free(); + virtual void freeBlock(); /// create a IVertexBufferHardGL virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb); /// return the size allocated. 0 if not allocated or failure @@ -258,7 +258,7 @@ public: /// allocate a vertex array sapce. false if error. must free before re-allocate. virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType); /// free this space. - virtual void free(); + virtual void freeBlock(); /// create a IVertexBufferHardGL virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb); /// return the size allocated. 0 if not allocated or failure @@ -367,7 +367,7 @@ public: */ virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType); /// free this space. - virtual void free(); + virtual void freeBlock(); /// create a IVertexBufferHardGL virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb); /// return the size allocated. 0 if not allocated or failure @@ -480,7 +480,7 @@ public: */ virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType); /// free this space. - virtual void free(); + virtual void freeBlock(); /// create a IVertexBufferHardGL virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb); /// return the size allocated. 0 if not allocated or failure diff --git a/code/nel/src/3d/landscape.cpp b/code/nel/src/3d/landscape.cpp index e3658dd88..b54bffa28 100644 --- a/code/nel/src/3d/landscape.cpp +++ b/code/nel/src/3d/landscape.cpp @@ -3216,37 +3216,37 @@ void CLandscape::deleteTessFace(CTessFace *f) // for refine() mgt, must remove from refine priority list, or from the temp rootTessFaceToUpdate list. f->unlinkInPList(); - TessFaceAllocator.free(f); + TessFaceAllocator.freeBlock(f); } // *************************************************************************** void CLandscape::deleteTessVertex(CTessVertex *v) { - TessVertexAllocator.free(v); + TessVertexAllocator.freeBlock(v); } // *************************************************************************** void CLandscape::deleteTessNearVertex(CTessNearVertex *v) { - TessNearVertexAllocator.free(v); + TessNearVertexAllocator.freeBlock(v); } // *************************************************************************** void CLandscape::deleteTessFarVertex(CTessFarVertex *v) { - TessFarVertexAllocator.free(v); + TessFarVertexAllocator.freeBlock(v); } // *************************************************************************** void CLandscape::deleteTileMaterial(CTileMaterial *tm) { - TileMaterialAllocator.free(tm); + TileMaterialAllocator.freeBlock(tm); } // *************************************************************************** void CLandscape::deleteTileFace(CTileFace *tf) { - TileFaceAllocator.free(tf); + TileFaceAllocator.freeBlock(tf); } diff --git a/code/nel/src/3d/tile_bank.cpp b/code/nel/src/3d/tile_bank.cpp index 5cacae18e..23075448e 100644 --- a/code/nel/src/3d/tile_bank.cpp +++ b/code/nel/src/3d/tile_bank.cpp @@ -243,7 +243,7 @@ void CTileBank::freeTile (int tileIndex) nlassert (tileIndex<(sint)_TileVector.size()); // Free - _TileVector[tileIndex].free(); + _TileVector[tileIndex].freeBlock(); // Resize tile table int i; diff --git a/code/nel/src/3d/vegetable_manager.cpp b/code/nel/src/3d/vegetable_manager.cpp index 084942fea..8946bc67b 100644 --- a/code/nel/src/3d/vegetable_manager.cpp +++ b/code/nel/src/3d/vegetable_manager.cpp @@ -750,7 +750,7 @@ void CVegetableManager::deleteClipBlock(CVegetableClipBlock *clipBlock) _EmptyClipBlockList.remove(clipBlock); // delete - _ClipBlockMemory.free(clipBlock); + _ClipBlockMemory.freeBlock(clipBlock); } @@ -785,7 +785,7 @@ void CVegetableManager::deleteSortBlock(CVegetableSortBlock *sortBlock) sortBlock->_Owner->_SortBlockList.remove(sortBlock); // delete - _SortBlockMemory.free(sortBlock); + _SortBlockMemory.freeBlock(sortBlock); } @@ -881,7 +881,7 @@ void CVegetableManager::deleteIg(CVegetableInstanceGroup *ig) // unlink from sortBlock, and delete. sortBlock->_InstanceGroupList.remove(ig); - _InstanceGroupMemory.free(ig); + _InstanceGroupMemory.freeBlock(ig); // decRef the clipBlock diff --git a/code/nel/src/3d/visual_collision_manager.cpp b/code/nel/src/3d/visual_collision_manager.cpp index cafc9948e..c5c45578f 100644 --- a/code/nel/src/3d/visual_collision_manager.cpp +++ b/code/nel/src/3d/visual_collision_manager.cpp @@ -98,7 +98,7 @@ CVisualTileDescNode *CVisualCollisionManager::newVisualTileDescNode() // *************************************************************************** void CVisualCollisionManager::deleteVisualTileDescNode(CVisualTileDescNode *ptr) { - _TileDescNodeAllocator.free(ptr); + _TileDescNodeAllocator.freeBlock(ptr); } // *************************************************************************** @@ -110,7 +110,7 @@ CPatchQuadBlock *CVisualCollisionManager::newPatchQuadBlock() // *************************************************************************** void CVisualCollisionManager::deletePatchQuadBlock(CPatchQuadBlock *ptr) { - _PatchQuadBlockAllocator.free(ptr); + _PatchQuadBlockAllocator.freeBlock(ptr); } diff --git a/code/nel/src/misc/contiguous_block_allocator.cpp b/code/nel/src/misc/contiguous_block_allocator.cpp index 6db4b0d63..b99c6b090 100644 --- a/code/nel/src/misc/contiguous_block_allocator.cpp +++ b/code/nel/src/misc/contiguous_block_allocator.cpp @@ -90,7 +90,7 @@ void *CContiguousBlockAllocator::alloc(uint numBytes) } // ********************************************************************************************************* -void CContiguousBlockAllocator::free(void *block, uint numBytes) +void CContiguousBlockAllocator::freeBlock(void *block, uint numBytes) { if (!block) return; #ifdef NL_DEBUG diff --git a/code/nel/src/misc/fixed_size_allocator.cpp b/code/nel/src/misc/fixed_size_allocator.cpp index 30693ddfd..6ec664db4 100644 --- a/code/nel/src/misc/fixed_size_allocator.cpp +++ b/code/nel/src/misc/fixed_size_allocator.cpp @@ -73,7 +73,7 @@ void *CFixedSizeAllocator::alloc() #define aligned_offsetof(s, m) ((offsetof(s, m) + (NL_DEFAULT_MEMORY_ALIGNMENT - 1)) & ~(NL_DEFAULT_MEMORY_ALIGNMENT - 1)) // ***************************************************************************************************************** -void CFixedSizeAllocator::free(void *block) +void CFixedSizeAllocator::freeBlock(void *block) { if (!block) return; /// get the node from the object diff --git a/code/nel/src/misc/heap_memory.cpp b/code/nel/src/misc/heap_memory.cpp index 0c3918ba0..89ce75e50 100644 --- a/code/nel/src/misc/heap_memory.cpp +++ b/code/nel/src/misc/heap_memory.cpp @@ -165,7 +165,7 @@ void *CHeapMemory::allocate(uint size) } // *************************************************************************** -void CHeapMemory::free(void *ptr) +void CHeapMemory::freeBlock(void *ptr) { if(ptr==NULL) return; diff --git a/code/nel/src/misc/object_arena_allocator.cpp b/code/nel/src/misc/object_arena_allocator.cpp index 5fba66005..e27a066ec 100644 --- a/code/nel/src/misc/object_arena_allocator.cpp +++ b/code/nel/src/misc/object_arena_allocator.cpp @@ -97,7 +97,7 @@ void *CObjectArenaAllocator::alloc(uint size) } // ***************************************************************************************************************** -void CObjectArenaAllocator::free(void *block) +void CObjectArenaAllocator::freeBlock(void *block) { if (!block) return; uint8 *realBlock = (uint8 *) block - NL_DEFAULT_MEMORY_ALIGNMENT; // sizeof(uint); // a uint is used at start of block to give its size @@ -114,7 +114,7 @@ void CObjectArenaAllocator::free(void *block) } uint entry = ((size + (_Granularity - 1)) / _Granularity); nlassert(entry < _ObjectSizeToAllocator.size()); - _ObjectSizeToAllocator[entry]->free(realBlock); + _ObjectSizeToAllocator[entry]->freeBlock(realBlock); #ifdef NL_DEBUG std::map::iterator it = _MemBlockToAllocID.find(realBlock); nlassert(it != _MemBlockToAllocID.end()); diff --git a/code/nel/src/pacs/move_container.cpp b/code/nel/src/pacs/move_container.cpp index 7eeca8f08..c302b53ab 100644 --- a/code/nel/src/pacs/move_container.cpp +++ b/code/nel/src/pacs/move_container.cpp @@ -1304,8 +1304,8 @@ void CMoveContainer::freeAllOTInfo () { H_AUTO (NLPACS_Free_All_OT_Info); - _AllocOTDynamicInfo.free (); - _AllocOTStaticInfo.free (); + _AllocOTDynamicInfo.freeBlock (); + _AllocOTStaticInfo.freeBlock (); } // *************************************************************************** From 8cc3963dddb85d4623722eb99d9c8eea35c407d6 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 16:52:50 +0100 Subject: [PATCH 24/50] Fixed: Respect coding standard for "parser" variable and delete it in destructor (fix a memory leak) --HG-- branch : develop --- code/nel/include/nel/gui/widget_manager.h | 4 ++-- code/nel/src/gui/widget_manager.cpp | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/code/nel/include/nel/gui/widget_manager.h b/code/nel/include/nel/gui/widget_manager.h index 2f9220cda..4d96be1b5 100644 --- a/code/nel/include/nel/gui/widget_manager.h +++ b/code/nel/include/nel/gui/widget_manager.h @@ -502,7 +502,7 @@ namespace NLGUI const CEventDescriptorKey& getLastKeyEvent() const{ return lastKeyEvent; } - IParser* getParser() const{ return parser; } + IParser* getParser() const{ return _Parser; } /// Retrieves the Id of the currently selected widgets void getEditorSelection( std::vector< std::string > &selection ); @@ -536,7 +536,7 @@ namespace NLGUI CWidgetManager(); ~CWidgetManager(); - IParser *parser; + IParser *_Parser; static CWidgetManager *instance; std::vector< SMasterGroup > _MasterGroups; diff --git a/code/nel/src/gui/widget_manager.cpp b/code/nel/src/gui/widget_manager.cpp index 5ef9ee622..73c7098fe 100644 --- a/code/nel/src/gui/widget_manager.cpp +++ b/code/nel/src/gui/widget_manager.cpp @@ -466,7 +466,7 @@ namespace NLGUI // ------------------------------------------------------------------------------------------------ CInterfaceElement* CWidgetManager::getElementFromDefine( const std::string &defineId ) { - return getElementFromId( parser->getDefine( defineId ) ); + return getElementFromId( _Parser->getDefine( defineId ) ); } // ------------------------------------------------------------------------------------------------ @@ -2113,8 +2113,6 @@ namespace NLGUI bool handled = false; - CViewPointer *_Pointer = static_cast< CViewPointer* >( getPointer() ); - if( evnt.getType() == CEventDescriptor::system ) { handleSystemEvent( evnt ); @@ -3276,7 +3274,7 @@ namespace NLGUI // ------------------------------------------------------------------------------------------------ void CWidgetManager::startAnim( const std::string &animId ) { - CInterfaceAnim *pIT = parser->getAnim( animId ); + CInterfaceAnim *pIT = _Parser->getAnim( animId ); if( pIT == NULL ) return; @@ -3302,7 +3300,7 @@ namespace NLGUI // ------------------------------------------------------------------------------------------------ void CWidgetManager::stopAnim( const std::string &animId ) { - CInterfaceAnim *pIT = parser->getAnim( animId ); + CInterfaceAnim *pIT = _Parser->getAnim( animId ); for( uint i = 0; i < activeAnims.size(); ++i ) if( activeAnims[ i ] == pIT ) @@ -3325,7 +3323,7 @@ namespace NLGUI void CWidgetManager::runProcedure( const std::string &procName, CCtrlBase *pCaller, const std::vector< std::string> ¶mList ) { - CProcedure *procp = parser->getProc( procName ); + CProcedure *procp = _Parser->getProc( procName ); if( procp == NULL ) return; @@ -3361,7 +3359,7 @@ namespace NLGUI void CWidgetManager::setProcedureAction( const std::string &procName, uint actionIndex, const std::string &ah, const std::string ¶ms ) { - CProcedure *procp = parser->getProc( procName ); + CProcedure *procp = _Parser->getProc( procName ); if( procp == NULL ) return; @@ -3701,7 +3699,7 @@ namespace NLGUI CReflectableRegister::registerClasses(); - parser = IParser::createParser(); + _Parser = IParser::createParser(); _Pointer = NULL; curContextHelp = NULL; @@ -3743,6 +3741,9 @@ namespace NLGUI delete _MasterGroups[i].Group; } + delete _Parser; + _Parser = NULL; + _Pointer = NULL; curContextHelp = NULL; From 91d6734e2a3d6169e716a8ffb7b63a39ba87854d Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 16:54:57 +0100 Subject: [PATCH 25/50] Fixed: Memory leaks in CBigFile --HG-- branch : develop --- code/nel/include/nel/misc/big_file.h | 4 +++- code/nel/src/misc/big_file.cpp | 25 +++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/code/nel/include/nel/misc/big_file.h b/code/nel/include/nel/misc/big_file.h index 14851d69e..95fc09b41 100644 --- a/code/nel/include/nel/misc/big_file.h +++ b/code/nel/include/nel/misc/big_file.h @@ -112,7 +112,8 @@ public: // A BNP structure struct BNP { - BNP() : FileNames(NULL), ThreadFileId(0), CacheFileOnOpen(false), AlwaysOpened(false), InternalUse(false), OffsetFromBeginning(0) { } + BNP(); + ~BNP(); // FileName of the BNP. important to open it in getFile() (for other threads or if not always opened). std::string BigFileName; @@ -163,6 +164,7 @@ private: { public: CThreadFileArray(); + ~CThreadFileArray(); // Allocate a FileId for a BNP. uint32 allocate(); diff --git a/code/nel/src/misc/big_file.cpp b/code/nel/src/misc/big_file.cpp index a458b602d..fc247b07b 100644 --- a/code/nel/src/misc/big_file.cpp +++ b/code/nel/src/misc/big_file.cpp @@ -45,8 +45,16 @@ void CBigFile::releaseInstance() // *************************************************************************** CBigFile::CThreadFileArray::CThreadFileArray() { - _CurrentId= 0; + _CurrentId = 0; } + +// *************************************************************************** +CBigFile::CThreadFileArray::~CThreadFileArray() +{ + vector *ptr = (vector*)_TDS.getPointer(); + if (ptr) delete ptr; +} + // *************************************************************************** uint32 CBigFile::CThreadFileArray::allocate() { @@ -186,11 +194,24 @@ void CBigFile::remove (const std::string &sBigFileName) fclose (handle.File); handle.File= NULL; } - delete [] rbnp.FileNames; + _BNPs.erase (it); } } +CBigFile::BNP::BNP() : FileNames(NULL), ThreadFileId(0), CacheFileOnOpen(false), AlwaysOpened(false), InternalUse(false), OffsetFromBeginning(0) +{ +} + +CBigFile::BNP::~BNP() +{ + if (FileNames) + { + delete[] FileNames; + FileNames = NULL; + } +} + //// *************************************************************************** bool CBigFile::BNP::readHeader() { From dbcc8d46f5f2d713b55bdb41e229d23018a3289a Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 16:55:52 +0100 Subject: [PATCH 26/50] Fixed: Use macros instead of functions for memory align wrappers (easier to find memory leaks) --HG-- branch : develop --- code/nel/include/nel/misc/types_nl.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/nel/include/nel/misc/types_nl.h b/code/nel/include/nel/misc/types_nl.h index 5f25387f5..4f9302260 100644 --- a/code/nel/include/nel/misc/types_nl.h +++ b/code/nel/include/nel/misc/types_nl.h @@ -386,17 +386,17 @@ typedef unsigned int uint; // at least 32bits (depend of processor) #include #include #include -inline void *aligned_malloc(size_t size, size_t alignment) { return _aligned_malloc(size, alignment); } -inline void aligned_free(void *ptr) { _aligned_free(ptr); } +#define aligned_malloc(size, alignment) _aligned_malloc(size, alignment) +#define aligned_free(ptr) _aligned_free(ptr) #elif defined(NL_OS_MAC) #include // under Mac OS X, malloc is already aligned for SSE and Altivec (16 bytes alignment) -inline void *aligned_malloc(size_t size, size_t /* alignment */) { return malloc(size); } -inline void aligned_free(void *ptr) { free(ptr); } +#define aligned_malloc(size, alignment) malloc(size) +#define aligned_free(ptr) free(ptr) #else #include -inline void *aligned_malloc(size_t size, size_t alignment) { return memalign(alignment, size); } -inline void aligned_free(void *ptr) { free(ptr); } +#define aligned_malloc(size, alignment) memalign(alignment, size) +#define aligned_free(ptr) free(ptr) #endif /* NL_COMP_ */ From 44c15f946ccb59b970c583f4d2a1972aa8b8b83a Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 16:56:32 +0100 Subject: [PATCH 27/50] Fixed: Define new operators when memory leaks detectin is enabled --HG-- branch : develop --- code/nel/include/nel/misc/object_arena_allocator.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/nel/include/nel/misc/object_arena_allocator.h b/code/nel/include/nel/misc/object_arena_allocator.h index 26b5daa50..929721a64 100644 --- a/code/nel/include/nel/misc/object_arena_allocator.h +++ b/code/nel/include/nel/misc/object_arena_allocator.h @@ -82,7 +82,9 @@ private: // NL_USES_DEFAULT_ARENA_OBJECT_ALLOCATOR // for fast alloc # define NL_USES_DEFAULT_ARENA_OBJECT_ALLOCATOR \ void *operator new(size_t size) { return NLMISC::CObjectArenaAllocator::getDefaultAllocator().alloc((uint) size); }\ - void operator delete(void *block) { NLMISC::CObjectArenaAllocator::getDefaultAllocator().free(block); } + void *operator new(size_t size, int _BlockUse, char const* _FileName, int _LineNumber) { return NLMISC::CObjectArenaAllocator::getDefaultAllocator().alloc((uint) size); }\ + void operator delete(void *block) { NLMISC::CObjectArenaAllocator::getDefaultAllocator().freeBlock(block); }\ + void operator delete(void *block, int _BlockUse, char const* _FileName, int _LineNumber) { NLMISC::CObjectArenaAllocator::getDefaultAllocator().freeBlock(block); } } From b6662b9e0ba677f83c601771226c01d93bbf3527 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:00:20 +0100 Subject: [PATCH 28/50] Changed: Memory leaks detection --HG-- branch : develop --- code/nel/src/3d/animation.cpp | 3 ++ code/nel/src/3d/animation_optimizer.cpp | 3 ++ code/nel/src/3d/cloud.cpp | 4 +++ code/nel/src/3d/driver/direct3d/stddirect3d.h | 35 ++++++++++++------- .../nel/src/sound/driver/xaudio2/stdxaudio2.h | 9 ++++- code/ryzom/client/src/client.cpp | 4 +++ 6 files changed, 45 insertions(+), 13 deletions(-) diff --git a/code/nel/src/3d/animation.cpp b/code/nel/src/3d/animation.cpp index a604d2bde..b33f337d2 100644 --- a/code/nel/src/3d/animation.cpp +++ b/code/nel/src/3d/animation.cpp @@ -30,6 +30,9 @@ using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/animation_optimizer.cpp b/code/nel/src/3d/animation_optimizer.cpp index 726086f8b..9205fde39 100644 --- a/code/nel/src/3d/animation_optimizer.cpp +++ b/code/nel/src/3d/animation_optimizer.cpp @@ -29,6 +29,9 @@ using namespace NLMISC; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace NL3D { diff --git a/code/nel/src/3d/cloud.cpp b/code/nel/src/3d/cloud.cpp index eb53589ce..bfd83ba80 100644 --- a/code/nel/src/3d/cloud.cpp +++ b/code/nel/src/3d/cloud.cpp @@ -25,6 +25,10 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace NL3D { diff --git a/code/nel/src/3d/driver/direct3d/stddirect3d.h b/code/nel/src/3d/driver/direct3d/stddirect3d.h index c7b6f7f3e..366627b44 100644 --- a/code/nel/src/3d/driver/direct3d/stddirect3d.h +++ b/code/nel/src/3d/driver/direct3d/stddirect3d.h @@ -14,15 +14,14 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -// Default NeL includes -#include "nel/misc/types_nl.h" +#ifndef STDDIRECT3D_H +#define STDDIRECT3D_H -#ifdef NL_OS_WINDOWS -# define WIN32_LEAN_AND_MEAN -# ifndef NL_COMP_MINGW -# define NOMINMAX -# endif -# include +#if defined(_MSC_VER) && defined(_DEBUG) + #define _CRTDBG_MAP_ALLOC + #include + #include + #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) #endif // System includes @@ -42,16 +41,14 @@ #include #include +// Default NeL includes +#include "nel/misc/types_nl.h" #ifdef NL_DEBUG // add Direct3D debug infos #define D3D_DEBUG_INFO #endif -// Directx includes -#include -#include - // NeL includes #include "nel/misc/common.h" #include "nel/misc/debug.h" @@ -59,3 +56,17 @@ #include "nel/misc/mem_stream.h" #include "nel/misc/time_nl.h" #include "nel/misc/command.h" + +#ifdef NL_OS_WINDOWS +# define WIN32_LEAN_AND_MEAN +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif +# include +#endif + +// Directx includes +#include +#include + +#endif diff --git a/code/nel/src/sound/driver/xaudio2/stdxaudio2.h b/code/nel/src/sound/driver/xaudio2/stdxaudio2.h index 76b2a13d8..f6e55d0aa 100644 --- a/code/nel/src/sound/driver/xaudio2/stdxaudio2.h +++ b/code/nel/src/sound/driver/xaudio2/stdxaudio2.h @@ -17,7 +17,12 @@ #ifndef NLSOUND_STDPCH_XAUDIO2_H #define NLSOUND_STDPCH_XAUDIO2_H -#include "nel/misc/types_nl.h" +#if defined(_MSC_VER) && defined(_DEBUG) + #define _CRTDBG_MAP_ALLOC + #include + #include + #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif // STL includes #include @@ -27,6 +32,8 @@ #include #include +#include "nel/misc/types_nl.h" + // 3rd Party Includes #include #define XAUDIO2_HELPER_FUNCTIONS diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index f2eaf64c0..f262a74af 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -143,6 +143,10 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, LPSTR cm int main(int argc, char **argv) #endif { +#if defined(_MSC_VER) && defined(_DEBUG) + _CrtSetDbgFlag (_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); +#endif + // init the Nel context CApplicationContext *appContext = new CApplicationContext; From 0ecac0249c3f2ba49f3aee0e4f797b1f036c1481 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:01:38 +0100 Subject: [PATCH 29/50] Removed: Empty sources --HG-- branch : develop --- code/nel/include/nel/misc/win_tray.h | 15 ------- code/nel/src/misc/CMakeLists.txt | 15 ++++--- code/nel/src/misc/event_emitter.cpp | 29 -------------- code/nel/src/misc/fast_id_map.cpp | 48 ----------------------- code/nel/src/misc/geom_ext.cpp | 36 ----------------- code/nel/src/misc/object_vector.cpp | 32 --------------- code/nel/src/misc/quad.cpp | 35 ----------------- code/nel/src/misc/stl_block_allocator.cpp | 32 --------------- code/nel/src/misc/stl_block_list.cpp | 31 --------------- code/nel/src/misc/string_id_array.cpp | 34 ---------------- code/nel/src/misc/uv.cpp | 36 ----------------- code/nel/src/misc/value_smoother.cpp | 22 ----------- code/nel/src/misc/vector_2d.cpp | 36 ----------------- code/nel/src/misc/vector_h.cpp | 35 ----------------- code/nel/src/misc/win_tray.cpp | 17 -------- 15 files changed, 7 insertions(+), 446 deletions(-) delete mode 100644 code/nel/include/nel/misc/win_tray.h delete mode 100644 code/nel/src/misc/event_emitter.cpp delete mode 100644 code/nel/src/misc/fast_id_map.cpp delete mode 100644 code/nel/src/misc/geom_ext.cpp delete mode 100644 code/nel/src/misc/object_vector.cpp delete mode 100644 code/nel/src/misc/quad.cpp delete mode 100644 code/nel/src/misc/stl_block_allocator.cpp delete mode 100644 code/nel/src/misc/stl_block_list.cpp delete mode 100644 code/nel/src/misc/string_id_array.cpp delete mode 100644 code/nel/src/misc/uv.cpp delete mode 100644 code/nel/src/misc/value_smoother.cpp delete mode 100644 code/nel/src/misc/vector_2d.cpp delete mode 100644 code/nel/src/misc/vector_h.cpp delete mode 100644 code/nel/src/misc/win_tray.cpp diff --git a/code/nel/include/nel/misc/win_tray.h b/code/nel/include/nel/misc/win_tray.h deleted file mode 100644 index 42b6d78e6..000000000 --- a/code/nel/include/nel/misc/win_tray.h +++ /dev/null @@ -1,15 +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 . diff --git a/code/nel/src/misc/CMakeLists.txt b/code/nel/src/misc/CMakeLists.txt index 029d24323..98b471e44 100644 --- a/code/nel/src/misc/CMakeLists.txt +++ b/code/nel/src/misc/CMakeLists.txt @@ -42,18 +42,18 @@ FILE(GLOB NLMISC_MATH plane.cpp ../../include/nel/misc/plane.h ../../include/nel/misc/plane_inline.h polygon.cpp ../../include/nel/misc/polygon.h - quad.cpp ../../include/nel/misc/quad.h + ../../include/nel/misc/quad.h quat.cpp ../../include/nel/misc/quat.h rect.cpp ../../include/nel/misc/rect.h rgba.cpp ../../include/nel/misc/rgba.h triangle.cpp ../../include/nel/misc/triangle.h - uv.cpp ../../include/nel/misc/uv.h + ../../include/nel/misc/uv.h vector*.cpp ../../include/nel/misc/vector*.h aabbox.cpp ../../include/nel/misc/aabbox.h algo.cpp ../../include/nel/misc/algo.h bsphere.cpp ../../include/nel/misc/bsphere.h fast_floor.cpp ../../include/nel/misc/fast_floor.h - geom_ext.cpp ../../include/nel/misc/geom_ext.h + ../../include/nel/misc/geom_ext.h line.cpp ../../include/nel/misc/line.h matrix.cpp ../../include/nel/misc/matrix.h ) @@ -70,7 +70,6 @@ FILE(GLOB NLMISC_PLATFORM inter_window_msg_queue.cpp ../../include/nel/misc/inter_window_msg_queue.h system_*.cpp ../../include/nel/misc/system_*.h win32_util.cpp ../../include/nel/misc/win32_util.h - win_tray.cpp ../../include/nel/misc/win_tray.h ) FILE(GLOB NLMISC_GENERIC @@ -80,7 +79,7 @@ FILE(GLOB NLMISC_GENERIC ../../include/nel/misc/callback.h *_allocator.cpp ../../include/nel/misc/*_allocator.h ../../include/nel/misc/enum_bitset.h - fast_id_map.cpp ../../include/nel/misc/fast_id_map.h + ../../include/nel/misc/fast_id_map.h hierarchical_timer.cpp ../../include/nel/misc/hierarchical_timer.h ../../include/nel/misc/historic.h ../../include/nel/misc/mutable_container.h @@ -92,11 +91,11 @@ FILE(GLOB NLMISC_GENERIC bit_set.cpp ../../include/nel/misc/bit_set.h stop_watch.cpp ../../include/nel/misc/stop_watch.h ../../include/nel/misc/twin_map.h - object_vector.cpp ../../include/nel/misc/object_vector.h + ../../include/nel/misc/object_vector.h ../../include/nel/misc/singleton.h speaker_listener.cpp ../../include/nel/misc/speaker_listener.h ../../include/nel/misc/static_map.h - stl_block_list.cpp ../../include/nel/misc/stl_block_list.h + ../../include/nel/misc/stl_block_list.h ) FILE(GLOB NLMISC_UTILITY @@ -118,7 +117,7 @@ FILE(GLOB NLMISC_UTILITY progress_callback.cpp ../../include/nel/misc/progress_callback.h sheet_id.cpp ../../include/nel/misc/sheet_id.h variable.cpp ../../include/nel/misc/variable.h - value_smoother.cpp ../../include/nel/misc/value_smoother.h + ../../include/nel/misc/value_smoother.h ) FILE(GLOB NLMISC_STRING diff --git a/code/nel/src/misc/event_emitter.cpp b/code/nel/src/misc/event_emitter.cpp deleted file mode 100644 index 0cf3aad72..000000000 --- a/code/nel/src/misc/event_emitter.cpp +++ /dev/null @@ -1,29 +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 "stdmisc.h" - -// remove stupid VC6 warnings -void foo_event_emitter_cpp() {} - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC { - - -} // NLMISC diff --git a/code/nel/src/misc/fast_id_map.cpp b/code/nel/src/misc/fast_id_map.cpp deleted file mode 100644 index 5ba919b09..000000000 --- a/code/nel/src/misc/fast_id_map.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/** - * \file fast_id_map.cpp - * \brief CFastIdMap - * \date 2012-04-10 19:28GMT - * \author Jan Boon (Kaetemi) - * CFastIdMap - */ - -/* - * Copyright (C) 2012 by authors - * - * This file is part of RYZOM CORE. - * RYZOM CORE 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. - * - * RYZOM CORE 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 RYZOM CORE. If not, see - * . - */ - -#include -#include - -// STL includes - -// NeL includes -// #include - -// Project includes - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC { - -void dummytoavoidthecompilerwarningfastidmap() { } - -} /* namespace NLMISC */ - -/* end of file */ diff --git a/code/nel/src/misc/geom_ext.cpp b/code/nel/src/misc/geom_ext.cpp deleted file mode 100644 index 32dba1d60..000000000 --- a/code/nel/src/misc/geom_ext.cpp +++ /dev/null @@ -1,36 +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 "stdmisc.h" - -#include "nel/misc/geom_ext.h" - - -// leave not static else this workaround don't work -void dummyToAvoidStupidCompilerWarning_misc_geom_ext_cpp() -{ -} - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC -{ - - - -} // NLMISC diff --git a/code/nel/src/misc/object_vector.cpp b/code/nel/src/misc/object_vector.cpp deleted file mode 100644 index 7a863342b..000000000 --- a/code/nel/src/misc/object_vector.cpp +++ /dev/null @@ -1,32 +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 "stdmisc.h" - -#include "nel/misc/object_vector.h" - -// leave not static else this workaround don't work -void dummyToAvoidStupidCompilerWarning_misc_object_vector_cpp() -{ -} - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC { - -} // NLMISC diff --git a/code/nel/src/misc/quad.cpp b/code/nel/src/misc/quad.cpp deleted file mode 100644 index 8fced3318..000000000 --- a/code/nel/src/misc/quad.cpp +++ /dev/null @@ -1,35 +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 "stdmisc.h" - -#include "nel/misc/quad.h" - - -// leave not static else this workaround don't work -void dummyToAvoidStupidCompilerWarning_misc_quad_cpp() -{ -} - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC { - - - -} // NLMISC diff --git a/code/nel/src/misc/stl_block_allocator.cpp b/code/nel/src/misc/stl_block_allocator.cpp deleted file mode 100644 index f57d0c238..000000000 --- a/code/nel/src/misc/stl_block_allocator.cpp +++ /dev/null @@ -1,32 +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 "stdmisc.h" - -#include "nel/misc/stl_block_allocator.h" - -// remove stupid VC6 warnings -void foo_stl_block_allocator_cpp() {} - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC { - - - -} // NLMISC diff --git a/code/nel/src/misc/stl_block_list.cpp b/code/nel/src/misc/stl_block_list.cpp deleted file mode 100644 index 628b79371..000000000 --- a/code/nel/src/misc/stl_block_list.cpp +++ /dev/null @@ -1,31 +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 "stdmisc.h" - -#include "nel/misc/stl_block_list.h" - -// remove stupid VC6 warnings -void foo_stl_block_list_cpp() {} - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC { - - -} // NLMISC diff --git a/code/nel/src/misc/string_id_array.cpp b/code/nel/src/misc/string_id_array.cpp deleted file mode 100644 index b9489e3f9..000000000 --- a/code/nel/src/misc/string_id_array.cpp +++ /dev/null @@ -1,34 +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 "stdmisc.h" - -#include "nel/misc/string_id_array.h" - - -// leave not static else this workaround don't work -void dummyToAvoidStupidCompilerWarning_misc_string_id_array_cpp() -{ -} - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC { - - -} // NLMISC diff --git a/code/nel/src/misc/uv.cpp b/code/nel/src/misc/uv.cpp deleted file mode 100644 index 9926efcc7..000000000 --- a/code/nel/src/misc/uv.cpp +++ /dev/null @@ -1,36 +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 "stdmisc.h" - -#include "nel/misc/uv.h" - - -// leave not static else this workaround don't work -void dummyToAvoidStupidCompilerWarning_misc_uv_cpp() -{ -} - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC -{ - - - -} // NLMISC diff --git a/code/nel/src/misc/value_smoother.cpp b/code/nel/src/misc/value_smoother.cpp deleted file mode 100644 index 12de7842b..000000000 --- a/code/nel/src/misc/value_smoother.cpp +++ /dev/null @@ -1,22 +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 "stdmisc.h" - -#include "nel/misc/value_smoother.h" - -// remove stupid VC6 warnings -void foo_value_smoother_cpp() {} diff --git a/code/nel/src/misc/vector_2d.cpp b/code/nel/src/misc/vector_2d.cpp deleted file mode 100644 index 939e41239..000000000 --- a/code/nel/src/misc/vector_2d.cpp +++ /dev/null @@ -1,36 +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 "stdmisc.h" - -#include "nel/misc/vector_2d.h" - - -// leave not static else this workaround don't work -void dummyToAvoidStupidCompilerWarning_misc_vector_2d_cpp() -{ -} - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC -{ - - - -} // NLMISC diff --git a/code/nel/src/misc/vector_h.cpp b/code/nel/src/misc/vector_h.cpp deleted file mode 100644 index 67eb41f6b..000000000 --- a/code/nel/src/misc/vector_h.cpp +++ /dev/null @@ -1,35 +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 "stdmisc.h" - -#include "nel/misc/vector_h.h" - - -// leave not static else this workaround don't work -void dummyToAvoidStupidCompilerWarning_misc_vector_h_cpp() -{ -} - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC { - - - -} // NLMISC diff --git a/code/nel/src/misc/win_tray.cpp b/code/nel/src/misc/win_tray.cpp deleted file mode 100644 index 73e837813..000000000 --- a/code/nel/src/misc/win_tray.cpp +++ /dev/null @@ -1,17 +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 "stdmisc.h" From 1d7b3f470c6784bb9b7dae487bbdd6d53e72ac18 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:03:15 +0100 Subject: [PATCH 30/50] Changed: Include PCH --HG-- branch : develop --- code/nel/src/gui/libwww_types.cpp | 1 + code/nel/src/gui/root_group.cpp | 2 +- code/nel/src/gui/url_parser.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/nel/src/gui/libwww_types.cpp b/code/nel/src/gui/libwww_types.cpp index 6eace3aa1..9731e9aca 100644 --- a/code/nel/src/gui/libwww_types.cpp +++ b/code/nel/src/gui/libwww_types.cpp @@ -29,6 +29,7 @@ ****************************************************************************/ +#include "stdpch.h" #include "nel/gui/libwww_types.h" #ifdef DEBUG_NEW diff --git a/code/nel/src/gui/root_group.cpp b/code/nel/src/gui/root_group.cpp index 449e18b05..756fb1096 100644 --- a/code/nel/src/gui/root_group.cpp +++ b/code/nel/src/gui/root_group.cpp @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . - +#include "stdpch.h" #include "nel/gui/root_group.h" #include diff --git a/code/nel/src/gui/url_parser.cpp b/code/nel/src/gui/url_parser.cpp index 7c8e70e90..68f624743 100644 --- a/code/nel/src/gui/url_parser.cpp +++ b/code/nel/src/gui/url_parser.cpp @@ -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 "stdpch.h" #include "nel/misc/common.h" #include "nel/gui/url_parser.h" From aef84bea6db05eb2349f17fb0813f4bf598db647 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:04:05 +0100 Subject: [PATCH 31/50] Fixed: Compilation restore new to use new placement --HG-- branch : develop --- code/nel/src/gui/lua_ihm.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/code/nel/src/gui/lua_ihm.cpp b/code/nel/src/gui/lua_ihm.cpp index b748f3646..0951d973c 100644 --- a/code/nel/src/gui/lua_ihm.cpp +++ b/code/nel/src/gui/lua_ihm.cpp @@ -1705,8 +1705,20 @@ namespace NLGUI void *ptr= ls.newUserData(sizeof(CReflectableLuaRef)); nlassert(ptr); //ls.dumpStack(); - // initialize it, and copy the given element + +// disable memory leaks detection for placement new +#ifdef new + #undef new +#endif + + // initialize it, and copy the given element new (ptr) CReflectableLuaRef(pRPT); + +// reenable memory leaks detection for placement new +#ifdef DEBUG_NEW + #define new DEBUG_NEW +#endif + // Assign to this user data the __ui_metatable //ls.dumpStack(); ls.push(IHM_LUA_METATABLE); // userdata "__ui_metatable" From 7203a23706ab0f5cc7c2ba06fb603acde8dcdfee Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:04:38 +0100 Subject: [PATCH 32/50] Fixed: Warning with VC++ 2015 --HG-- branch : develop --- code/nel/src/misc/debug.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/nel/src/misc/debug.cpp b/code/nel/src/misc/debug.cpp index 01fe6257a..ce764d0b5 100644 --- a/code/nel/src/misc/debug.cpp +++ b/code/nel/src/misc/debug.cpp @@ -23,7 +23,9 @@ # include # include # pragma comment(lib, "imagehlp.lib") -# define getcwd(_a, _b) (_getcwd(_a,_b)) +# ifndef getcwd +# define getcwd(_a, _b) (_getcwd(_a,_b)) +# endif # ifdef NL_OS_WIN64 # define DWORD_TYPE DWORD64 # else From 00ab10019247dc2d1dbe03f5bb05356919f514f0 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:04:55 +0100 Subject: [PATCH 33/50] Changed: Use NULL instead of 0 --HG-- branch : develop --- code/nel/src/misc/debug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/misc/debug.cpp b/code/nel/src/misc/debug.cpp index ce764d0b5..020416b01 100644 --- a/code/nel/src/misc/debug.cpp +++ b/code/nel/src/misc/debug.cpp @@ -180,7 +180,7 @@ void nlFatalError (const char *format, ...) char *str; NLMISC_CONVERT_VARGS (str, format, 256/*NLMISC::MaxCStringSize*/); - INelContext::getInstance().setDebugNeedAssert( NLMISC::DefaultMsgBoxDisplayer==0 ); + INelContext::getInstance().setDebugNeedAssert( NLMISC::DefaultMsgBoxDisplayer == NULL ); NLMISC::ErrorLog->displayNL (str); @@ -199,7 +199,7 @@ void nlError (const char *format, ...) char *str; NLMISC_CONVERT_VARGS (str, format, 256/*NLMISC::MaxCStringSize*/); - INelContext::getInstance().setDebugNeedAssert( NLMISC::DefaultMsgBoxDisplayer==0 ); + INelContext::getInstance().setDebugNeedAssert( NLMISC::DefaultMsgBoxDisplayer == NULL ); NLMISC::ErrorLog->displayNL (str); From 18dfbcd5a77384ff8445a3fe4772f3844e82575b Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:05:17 +0100 Subject: [PATCH 34/50] Changed: Only delete _ProcessName if not NULL --HG-- branch : develop --- code/nel/src/misc/log.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/nel/src/misc/log.cpp b/code/nel/src/misc/log.cpp index 4efae637a..277048c3b 100644 --- a/code/nel/src/misc/log.cpp +++ b/code/nel/src/misc/log.cpp @@ -615,8 +615,12 @@ void CLog::releaseProcessName() { INelContext::getInstance().releaseSingletonPointer("NLMISC::CLog::_ProcessName", _ProcessName); } - delete _ProcessName; - _ProcessName = NULL; + + if (_ProcessName) + { + delete _ProcessName; + _ProcessName = NULL; + } } } // NLMISC From d62c17986dcde003abb0ed3efc68eddb20dca991 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:05:36 +0100 Subject: [PATCH 35/50] Changed: Remove empty function --HG-- branch : develop --- code/nel/src/misc/smart_ptr.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/code/nel/src/misc/smart_ptr.cpp b/code/nel/src/misc/smart_ptr.cpp index e5c31fcd7..73c3c0799 100644 --- a/code/nel/src/misc/smart_ptr.cpp +++ b/code/nel/src/misc/smart_ptr.cpp @@ -29,12 +29,5 @@ namespace NLMISC //CPtrInfo() {Ptr=NULL; RefCount=0x7FFFFFFF; IsNullPtrInfo=true;} CRefCount::CPtrInfoBase CRefCount::NullPtrInfo= {NULL, 0x7FFFFFFF, true}; - -// must not be static -void dummy_to_avoid_stupid_4768_smart_ptr_cpp() -{ -} - - } From e69858491c4f0be4dd3bf3d4d3d8f26409e8a721 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:10:10 +0100 Subject: [PATCH 36/50] Fixed: Don't truncate 64 bits pointers --HG-- branch : develop --- .../nel_export/nel_export_node_properties.cpp | 20 +++++++++---------- .../3d/plugin_max/nel_export/progress.cpp | 2 +- .../nel_mesh_lib/export_skinning.cpp | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) 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 49e0ce97e..59d149128 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 @@ -508,37 +508,37 @@ INT_PTR CALLBACK AccelDialogCallback ( { for (uint i=0; _MaterialNames[i] != 0; ++i) { - SendMessage (GetDlgItem (hwndDlg, IDC_OCC_MODEL), CB_ADDSTRING, 0, (LONG)(_MaterialNames[i])); - SendMessage (GetDlgItem (hwndDlg, IDC_OPEN_OCC_MODEL), CB_ADDSTRING, 0, (LONG)(_MaterialNames[i])); + SendMessage (GetDlgItem (hwndDlg, IDC_OCC_MODEL), CB_ADDSTRING, 0, (LPARAM)(_MaterialNames[i])); + SendMessage (GetDlgItem (hwndDlg, IDC_OPEN_OCC_MODEL), CB_ADDSTRING, 0, (LPARAM)(_MaterialNames[i])); } } { for (uint i =0; _EnvironmentNames[i] != 0; ++i) { - SendMessage (GetDlgItem (hwndDlg, IDC_ENV_FX), CB_ADDSTRING, 0, (LONG)(_EnvironmentNames[i])); + SendMessage (GetDlgItem (hwndDlg, IDC_ENV_FX), CB_ADDSTRING, 0, (LPARAM)(_EnvironmentNames[i])); } } { std::set::iterator first(_KnownSoundGroups.begin()), last(_KnownSoundGroups.end()); for (; first != last; ++first) { - SendMessage (GetDlgItem (hwndDlg, IDC_SOUND_GROUP), CB_ADDSTRING, 0, (LONG)(first->c_str())); + SendMessage (GetDlgItem (hwndDlg, IDC_SOUND_GROUP), CB_ADDSTRING, 0, (LPARAM)(first->c_str())); } } // set the combo and edit box - if (SendMessage (GetDlgItem (hwndDlg, IDC_OCC_MODEL), CB_SELECTSTRING, -1, (LONG)(currentParam->OcclusionModel.c_str())) == CB_ERR) + if (SendMessage (GetDlgItem (hwndDlg, IDC_OCC_MODEL), CB_SELECTSTRING, -1, (LPARAM)(currentParam->OcclusionModel.c_str())) == CB_ERR) { // nlassert(false); } - if (SendMessage (GetDlgItem (hwndDlg, IDC_OPEN_OCC_MODEL), CB_SELECTSTRING, -1, (LONG)(currentParam->OpenOcclusionModel.c_str())) == CB_ERR) + if (SendMessage (GetDlgItem (hwndDlg, IDC_OPEN_OCC_MODEL), CB_SELECTSTRING, -1, (LPARAM)(currentParam->OpenOcclusionModel.c_str())) == CB_ERR) { // nlassert(false); } - if (SendMessage (GetDlgItem (hwndDlg, IDC_ENV_FX), CB_SELECTSTRING, -1, (LONG)(currentParam->EnvironmentFX.c_str())) == CB_ERR) + if (SendMessage (GetDlgItem (hwndDlg, IDC_ENV_FX), CB_SELECTSTRING, -1, (LPARAM)(currentParam->EnvironmentFX.c_str())) == CB_ERR) { // nlassert(false); } - if (SendMessage (GetDlgItem (hwndDlg, IDC_SOUND_GROUP), CB_SELECTSTRING, -1, (LONG)(currentParam->SoundGroup.c_str())) == CB_ERR) + if (SendMessage (GetDlgItem (hwndDlg, IDC_SOUND_GROUP), CB_SELECTSTRING, -1, (LPARAM)(currentParam->SoundGroup.c_str())) == CB_ERR) { // nlassert(false); } @@ -1497,7 +1497,7 @@ void lmcCopyFrom(CLodDialogBoxParam *currentParam, HWND parentDlg) // **** launch the choosing dialog paramLMCFrom.reset(); - if (DialogBoxParam (hInstance, MAKEINTRESOURCE(IDD_LMC_CHOOSE_FROM), parentDlg, LMCCopyFromDialogCallback, (long)¶mLMCFrom)==IDOK + if (DialogBoxParam (hInstance, MAKEINTRESOURCE(IDD_LMC_CHOOSE_FROM), parentDlg, LMCCopyFromDialogCallback, (LPARAM)¶mLMCFrom)==IDOK && paramLMCFrom.SelectionDone) { // **** Apply to the current setup @@ -3050,7 +3050,7 @@ void CNelExport::OnNodeProperties (const std::set &listNode) ite++; } - if (DialogBoxParam (hInstance, MAKEINTRESOURCE(IDD_NODE_PROPERTIES), _Ip->GetMAXHWnd(), LodDialogCallback, (long)¶m)==IDOK) + if (DialogBoxParam (hInstance, MAKEINTRESOURCE(IDD_NODE_PROPERTIES), _Ip->GetMAXHWnd(), LodDialogCallback, (LPARAM)¶m)==IDOK) { // Next node ite=listNode.begin(); 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 e104dc64e..8a8973154 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/progress.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/progress.cpp @@ -119,7 +119,7 @@ void CProgressBar::initProgressBar( sint32 nNbMesh, Interface &ip) MAKEINTRESOURCE(IDD_CALCULATING), NULL,//ip.GetMAXHWnd(), CalculatingDialogCallback, - (long)this ); + (LPARAM)this ); } // ----------------------------------------------------------------------------------------------- diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp index ec1bb1f92..cf084901d 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp @@ -1171,8 +1171,8 @@ void CExportNel::addSkeletonBindPos (INode& skinedNode, mapBoneBindPos& boneBind if (res != MATRIX_RETURNED) { - nlwarning("res != MATRIX_RETURNED; res = %i; boneIndex = %i / %i", res, boneIndex, count); - nlwarning("bone = %i", (uint32)(void *)bone); + nlwarning("res != MATRIX_RETURNED; res = %d; boneIndex = %u / %u", res, boneIndex, count); + nlwarning("bone = %p", bone); std::string boneName = getName (*bone); nlwarning("boneName = %s", boneName.c_str()); nlassert(false); From bf7b51ca6cd992eac6c159d49b0c9b140bf8735f Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:11:12 +0100 Subject: [PATCH 37/50] Fixed: Only 1 parameter for forceMissionProgress --HG-- branch : develop --- .../entities_game_service/mission_manager/missions_commands.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp index e97043a9d..b612f7a59 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp @@ -49,7 +49,7 @@ using namespace std; NLMISC_COMMAND( forceMissionProgress,"debug command used to trigger debug commands","" ) { - if (args.empty() || args.size() > 3) + if (args.size() != 1) return false; CEntityId id; id.fromString( args[0].c_str() ); From ec6ffe547ca533262bb6d7b749d3b6fcec554ae7 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:11:23 +0100 Subject: [PATCH 38/50] Fixed: Typo --HG-- branch : develop --- .../entities_game_service/mission_manager/missions_commands.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp index b612f7a59..29cd11892 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp @@ -530,7 +530,7 @@ NLMISC_COMMAND(removeMission,"Remove mission of character"," ") { From 1a338b3462572ce7b87b937303c4b8eec28a9b3f Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:12:39 +0100 Subject: [PATCH 39/50] Fixed: getMission returns a mission instead of NULL --HG-- branch : develop --- .../player_manager/admin_properties.cpp | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/code/ryzom/server/src/entities_game_service/player_manager/admin_properties.cpp b/code/ryzom/server/src/entities_game_service/player_manager/admin_properties.cpp index 9f7589408..b455ec368 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/admin_properties.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/admin_properties.cpp @@ -78,26 +78,27 @@ void CAdminProperties::updateCSRJournal( CCharacter * user, CMission * mission,u ///TODO NICO test no list } -CMission * CAdminProperties::getMission( uint indexInJournal ) const +CMission* CAdminProperties::getMission(uint indexInJournal) const { - /// todo mission - /* - if ( !_Data ) return NULL; - CCharacter * user = PlayerManager.getChar( _Data->MissionUser ); - if ( !user ) + if (!_Data) return NULL; + + CCharacter *user = PlayerManager.getChar(_Data->MissionUser); + if (!user) return NULL; - - CMission * mission = NULL; - if ( indexInJournal < user->getMissions().size() ) - return (CMission*) user->getMissions()[indexInJournal]; - indexInJournal-= MaxSoloMissionCount; + CMission *mission = NULL; + if (indexInJournal < user->getMissions().size()) + return (CMission*)user->getMissions()[indexInJournal]; + +/* + indexInJournal -= MaxSoloMissionCount; CTeam * team = TeamManager.getTeam( user->getTeamId() ); - if (team ) + if (team) { if ( indexInJournal < team->getMissions().size() ) return (CMission*) team->getMissions()[indexInJournal]; - } + } + indexInJournal-= ( MaxGroupMissionCount); CGuild * guild = user->getGuild(); if (guild ) @@ -105,6 +106,6 @@ CMission * CAdminProperties::getMission( uint indexInJournal ) const if ( indexInJournal < guild->getMissions().size() ) return(CMission*) guild->getMissions()[indexInJournal]; } - */ +*/ return NULL; } From f17bd720b11499a4426c4832c7bc3587b41df734 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:12:58 +0100 Subject: [PATCH 40/50] Fixed: Warnings with GGC 6 --HG-- branch : develop --- code/ryzom/common/src/game_share/utils.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/ryzom/common/src/game_share/utils.h b/code/ryzom/common/src/game_share/utils.h index 96099a466..c4c0fe26f 100644 --- a/code/ryzom/common/src/game_share/utils.h +++ b/code/ryzom/common/src/game_share/utils.h @@ -320,7 +320,7 @@ inline ucstring capitalize(const ucstring & s) public:\ virtual void displayEntry(NLMISC::CLog& log) const\ {\ - log.displayNL(">>"__FILE__":%d",__LINE__);\ + log.displayNL(">>" __FILE__ ":%d", __LINE__);\ }\ }\ __callStackEntry##__LINE__; @@ -331,7 +331,7 @@ inline ucstring capitalize(const ucstring & s) public:\ virtual void displayEntry(NLMISC::CLog& log) const\ {\ - log.displayNL(">>"__FILE__":%d: %s",__LINE__,msg);\ + log.displayNL(">>" __FILE__ ":%d: %s", __LINE__,msg);\ }\ }\ __callStackEntry##__LINE__; @@ -345,7 +345,7 @@ inline ucstring capitalize(const ucstring & s) }\ virtual void displayEntry(NLMISC::CLog& log) const\ {\ - log.displayNL(">>"__FILE__":%d: %s=[%s]",__LINE__,#var,NLMISC::toString(_Val).c_str());\ + log.displayNL(">>" __FILE__ ":%d: %s=[%s]", __LINE__, #var, NLMISC::toString(_Val).c_str());\ }\ const type _Val;\ }\ @@ -360,7 +360,7 @@ inline ucstring capitalize(const ucstring & s) }\ virtual void displayEntry(NLMISC::CLog& log) const\ {\ - log.displayNL(">>"__FILE__":%d: %s=>[%s]",__LINE__,#var,NLMISC::toString(_Var).c_str());\ + log.displayNL(">>" __FILE__ ":%d: %s=>[%s]", __LINE__, #var, NLMISC::toString(_Var).c_str());\ }\ const type& _Var;\ }\ From c3a6610f364eb9dd3cd6e5cf9d2680f74abac5c2 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:14:47 +0100 Subject: [PATCH 41/50] Changed: Don't need to use CSString --HG-- branch : develop --- .../game_share/server_animation_module.cpp | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/code/ryzom/common/src/game_share/server_animation_module.cpp b/code/ryzom/common/src/game_share/server_animation_module.cpp index fbeb5516f..f16d7c9d8 100644 --- a/code/ryzom/common/src/game_share/server_animation_module.cpp +++ b/code/ryzom/common/src/game_share/server_animation_module.cpp @@ -1002,30 +1002,38 @@ IPrimitive* CServerAnimationModule::getAction(CObject* action, const std::string if(param.splitLines(result) ) { - if (result.size() == 0) - { - nlwarning("ERROR: npc_say but no parameters !!! %d in session ", scenarioId.asInt()); - } + std::vector res; - if(result.size()>=1) + if (result.empty()) { - NLMISC::CSString name(result[0]); - if(name.find(":",0)!=string::npos) - { - result[0] = prefix+result[0]; - } + nlwarning("ERROR: npc_say but no parameters !!! %u in session ", scenarioId.asInt()); } - - if(result.size()>=2) - result[1] = "DSS_"+toString(scenarioId)+" "+result[1].c_str(); - if(result.size()>=3) + else { - for(uint32 i=2;i= 1) { - result[i] = prefix + result[i]; + std::string name(result[0]); + + if (name.find(":", 0) != string::npos) + { + res[0] = prefix + name; + } + + if (result.size() >= 2) + { + res[1] = toString("DSS_%u %s", scenarioId.asInt(), result[1].c_str()); + + for (uint32 i = 2, len = result.size(); iaddPropertyByName("parameters", new CPropertyStringArray( (std::vector &)result )); + + pAction->addPropertyByName("parameters", new CPropertyStringArray(res)); } } From 17847efa51476cffbd3616baa1b9e9465c828ee3 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:15:43 +0100 Subject: [PATCH 42/50] Fixed: Delete created thread (fix a memory leak) --HG-- branch : develop --- code/ryzom/client/src/session_browser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/ryzom/client/src/session_browser.cpp b/code/ryzom/client/src/session_browser.cpp index 4cae87fee..46ef37a0a 100644 --- a/code/ryzom/client/src/session_browser.cpp +++ b/code/ryzom/client/src/session_browser.cpp @@ -119,6 +119,7 @@ CSessionBrowser::~CSessionBrowser() _CommThread->wait(); // ok, we can leave + delete _CommThread; } /** Set auth info */ From 491b6a2b5904f59a07a765655974f9b8e3cc9075 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:17:06 +0100 Subject: [PATCH 43/50] Fixed: Delete CViewRenderer instance (fix a memory leak) --HG-- branch : develop --- code/ryzom/client/src/release.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/ryzom/client/src/release.cpp b/code/ryzom/client/src/release.cpp index dd1986174..53c0dfaca 100644 --- a/code/ryzom/client/src/release.cpp +++ b/code/ryzom/client/src/release.cpp @@ -663,6 +663,7 @@ void release() CLuaManager::releaseInstance(); NLGUI::CDBManager::release(); CWidgetManager::release(); + CViewRenderer::release(); #if FINAL_VERSION // openURL ("http://www.ryzomcore.org/exit/"); From 0449bee4a86e6f62ce2e9ae8343208dd265da94a Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:17:25 +0100 Subject: [PATCH 44/50] Changed: Replace 0 by NULL --HG-- branch : develop --- code/ryzom/client/src/release.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/client/src/release.cpp b/code/ryzom/client/src/release.cpp index 53c0dfaca..543230609 100644 --- a/code/ryzom/client/src/release.cpp +++ b/code/ryzom/client/src/release.cpp @@ -603,7 +603,7 @@ void release() // Delete the driver. delete Driver; - Driver = 0; + Driver = NULL; } NetMngr.getConnection().close(); From 35f1fa0609e779570d21697ffb66538aab966d6f Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:19:37 +0100 Subject: [PATCH 45/50] Changed: Renamed thread to Thread and assign InstallThread and DownloadThread --HG-- branch : develop --- code/ryzom/client/src/login_patch.cpp | 67 ++++++++++++++------------- code/ryzom/client/src/login_patch.h | 5 +- 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 4636da11f..659844a57 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -143,7 +143,8 @@ CPatchManager::CPatchManager() : State("t_state"), DataScanState("t_data_scan_st CheckThread = NULL; InstallThread = NULL; ScanDataThread = NULL; - thread = NULL; + DownloadThread = NULL; + Thread = NULL; LogSeparator = "\n"; ValidDescFile = false; @@ -364,7 +365,7 @@ void CPatchManager::startCheckThread(bool includeBackgroundPatch) nlwarning ("check thread is already running"); return; } - if (thread != NULL) + if (Thread != NULL) { nlwarning ("a thread is already running"); return; @@ -375,9 +376,9 @@ void CPatchManager::startCheckThread(bool includeBackgroundPatch) CheckThread = new CCheckThread(includeBackgroundPatch); nlassert (CheckThread != NULL); - thread = IThread::create (CheckThread); - nlassert (thread != NULL); - thread->start (); + Thread = IThread::create (CheckThread); + nlassert (Thread != NULL); + Thread->start (); } // **************************************************************************** @@ -402,11 +403,11 @@ bool CPatchManager::isCheckThreadEnded(bool &ok) // **************************************************************************** void CPatchManager::stopCheckThread() { - if(CheckThread && thread) + if(CheckThread && Thread) { - thread->wait(); - delete thread; - thread = NULL; + Thread->wait(); + delete Thread; + Thread = NULL; delete CheckThread; CheckThread = NULL; } @@ -534,7 +535,7 @@ void CPatchManager::startPatchThread(const vector &CategoriesSelected, b nlwarning ("check thread is already running"); return; } - if (thread != NULL) + if (Thread != NULL) { nlwarning ("a thread is already running"); return; @@ -622,9 +623,9 @@ void CPatchManager::startPatchThread(const vector &CategoriesSelected, b } // Launch the thread - thread = IThread::create (PatchThread); - nlassert (thread != NULL); - thread->start (); + Thread = IThread::create (PatchThread); + nlassert (Thread != NULL); + Thread->start (); } // **************************************************************************** @@ -685,11 +686,11 @@ bool CPatchManager::getThreadState (ucstring &stateOut, vector &stateL // **************************************************************************** void CPatchManager::stopPatchThread() { - if(PatchThread && thread) + if(PatchThread && Thread) { - thread->wait(); - delete thread; - thread = NULL; + Thread->wait(); + delete Thread; + Thread = NULL; delete PatchThread; PatchThread = NULL; } @@ -1944,7 +1945,7 @@ void CPatchManager::startScanDataThread() nlwarning ("scan data thread is already running"); return; } - if (thread != NULL) + if (Thread != NULL) { nlwarning ("a thread is already running"); return; @@ -1962,9 +1963,9 @@ void CPatchManager::startScanDataThread() ScanDataThread = new CScanDataThread(); nlassert (ScanDataThread != NULL); - thread = IThread::create (ScanDataThread); - nlassert (thread != NULL); - thread->start (); + Thread = IThread::create (ScanDataThread); + nlassert (Thread != NULL); + Thread->start (); } // **************************************************************************** @@ -1989,11 +1990,11 @@ bool CPatchManager::isScanDataThreadEnded(bool &ok) // **************************************************************************** void CPatchManager::stopScanDataThread() { - if(ScanDataThread && thread) + if(ScanDataThread && Thread) { - thread->wait(); - delete thread; - thread = NULL; + Thread->wait(); + delete Thread; + Thread = NULL; delete ScanDataThread; ScanDataThread = NULL; } @@ -3044,18 +3045,18 @@ IAsyncDownloader* CPatchManager::getAsyncDownloader() const // **************************************************************************** void CPatchManager::startInstallThread(const std::vector& entries) { - CInstallThread* installThread = new CInstallThread(entries); - thread = IThread::create (installThread); - nlassert (thread != NULL); - thread->start (); + InstallThread = new CInstallThread(entries); + Thread = IThread::create (InstallThread); + nlassert (Thread != NULL); + Thread->start (); } void CPatchManager::startDownloadThread(const std::vector& entries) { - CDownloadThread* downloadThread = new CDownloadThread(entries); - thread = IThread::create (downloadThread); - nlassert (thread != NULL); - thread->start (); + DownloadThread = new CDownloadThread(entries); + Thread = IThread::create (DownloadThread); + nlassert (Thread != NULL); + Thread->start (); } diff --git a/code/ryzom/client/src/login_patch.h b/code/ryzom/client/src/login_patch.h index 1de6f03f0..0daf83b46 100644 --- a/code/ryzom/client/src/login_patch.h +++ b/code/ryzom/client/src/login_patch.h @@ -238,7 +238,7 @@ public: CProductDescriptionForClient &getDescFile() { return DescFile; } - NLMISC::IThread *getCurrThread() const { return thread; } + NLMISC::IThread *getCurrThread() const { return Thread; } // set an external state listener (enable to log) infos void setStateListener(IPatchManagerStateListener* stateListener); @@ -410,7 +410,8 @@ private: CCheckThread *CheckThread; CScanDataThread *ScanDataThread; CInstallThread *InstallThread; - NLMISC::IThread *thread; + CDownloadThread *DownloadThread; + NLMISC::IThread *Thread; // State struct CState From b8658f65f1127de9a1bae47baaa4f302863f9206 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:22:49 +0100 Subject: [PATCH 46/50] Changed: Don't need to use const char* --HG-- branch : develop --- code/ryzom/client/src/interface_v3/macrocmd_key.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/macrocmd_key.cpp b/code/ryzom/client/src/interface_v3/macrocmd_key.cpp index 9e7c42888..e639338df 100644 --- a/code/ryzom/client/src/interface_v3/macrocmd_key.cpp +++ b/code/ryzom/client/src/interface_v3/macrocmd_key.cpp @@ -1303,12 +1303,12 @@ public: if (pMCM->EditCmd->CurrentEditCmdNb != -1) // Edit mode ? { pMCM->CurrentEditMacro.delCommand(pMCM->EditCmd->CurrentEditCmdNb); - pMCM->CurrentEditMacro.addCommand (pMCM->EditCmd->CurrentEditCmdLine.ActionName.Name.c_str(),pMCM->EditCmd->CurrentEditCmdLine.ActionName.Argu.c_str(), + pMCM->CurrentEditMacro.addCommand (pMCM->EditCmd->CurrentEditCmdLine.ActionName.Name, pMCM->EditCmd->CurrentEditCmdLine.ActionName.Argu, pMCM->EditCmd->CurrentEditCmdNb); } else { - pMCM->CurrentEditMacro.addCommand(pMCM->EditCmd->CurrentEditCmdLine.ActionName.Name.c_str(),pMCM->EditCmd->CurrentEditCmdLine.ActionName.Argu.c_str()); + pMCM->CurrentEditMacro.addCommand(pMCM->EditCmd->CurrentEditCmdLine.ActionName.Name, pMCM->EditCmd->CurrentEditCmdLine.ActionName.Argu); } CAHManager::getInstance()->runActionHandler("new_macro_open", pCaller); pMCM->EditCmd->deactivate(); From b4de1326d15584a8f92c5cf842358b68f763cff8 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:23:28 +0100 Subject: [PATCH 47/50] Fixed: Fix memory leaks about logs, displayers, etc... --HG-- branch : develop --- code/ryzom/client/src/client.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index f262a74af..00ec3ced7 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -393,6 +393,10 @@ int main(int argc, char **argv) quitCrashReport (); #endif // FINAL_VERSION + // delete all logs and displayers when we're not using logs macros anymore + destroyDebug(); + CLog::releaseProcessName(); + // delete the Nel context delete appContext; From 664f494b0724bb177e2bc6ecde4f3ce23ba7906b Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:24:00 +0100 Subject: [PATCH 48/50] Changed: nlwarning already put a \n --HG-- branch : develop --- code/nel/tools/3d/zone_lighter/zone_lighter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/tools/3d/zone_lighter/zone_lighter.cpp b/code/nel/tools/3d/zone_lighter/zone_lighter.cpp index b3c6807c1..c8cf250b3 100644 --- a/code/nel/tools/3d/zone_lighter/zone_lighter.cpp +++ b/code/nel/tools/3d/zone_lighter/zone_lighter.cpp @@ -160,7 +160,7 @@ static void loadIGFromVillage(const NLGEORGES::UFormElm *villageItem, const std: } catch(const NLMISC::Exception &) { - nlwarning ("Error while loading instance group %s\n", igName.c_str()); + nlwarning ("Error while loading instance group %s", igName.c_str()); continue; } inputFile.close(); From b3da4247d48412a24ebdbedaba772a769b206261 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:25:27 +0100 Subject: [PATCH 49/50] Fixed: Latest 3dsmax SDK versions are using p_end instead of end --HG-- branch : develop --- .../nel_patch_converter/nel_patch_converter.cpp | 12 ++++++------ .../tools/3d/plugin_max/tile_utility/rgbadd.cpp | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) 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 12a168f04..16cf88967 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 @@ -40,12 +40,12 @@ static ParamBlockDesc2 po2rpo_param_blk ( po2rpo_params, _T("params"), 0, &PO2R //rollout IDD_PANEL, IDS_PARAMS, 0, 0, NULL, // params - pb_spin, _T("spin"), TYPE_FLOAT, P_ANIMATABLE, IDS_SPIN, - p_default, 0.1f, - p_range, 0.0f,1000.0f, - p_ui, TYPE_SPINNER, EDITTYPE_FLOAT, IDC_EDIT, IDC_SPIN, 0.01f, - end, - end + pb_spin, _T("spin"), TYPE_FLOAT, P_ANIMATABLE, IDS_SPIN, + p_default, 0.1f, + p_range, 0.0f,1000.0f, + p_ui, TYPE_SPINNER, EDITTYPE_FLOAT, IDC_EDIT, IDC_SPIN, 0.01f, + p_end, + p_end ); IObjParam *PO2RPO::ip = NULL; diff --git a/code/nel/tools/3d/plugin_max/tile_utility/rgbadd.cpp b/code/nel/tools/3d/plugin_max/tile_utility/rgbadd.cpp index 68aa70b61..363b54e1c 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/rgbadd.cpp +++ b/code/nel/tools/3d/plugin_max/tile_utility/rgbadd.cpp @@ -136,36 +136,36 @@ static ParamBlockDesc2 RGBAdd_param_blk ( RGBAdd_params, _T("parameters"), 0, & RGBAdd_color1, _T("color1"), TYPE_RGBA, P_ANIMATABLE, IDS_DS_COLOR1, p_default, Color(0,0,0), p_ui, TYPE_COLORSWATCH, IDC_MULT_COL1, - end, + p_end, RGBAdd_color2, _T("color2"), TYPE_RGBA, P_ANIMATABLE, IDS_DS_COLOR2, p_default, Color(0.5,0.5,0.5), p_ui, TYPE_COLORSWATCH, IDC_MULT_COL2, - end, + p_end, RGBAdd_map1, _T("map1"), TYPE_TEXMAP, P_OWNERS_REF, IDS_JW_MAP1, p_refno, 1, p_subtexno, 0, p_ui, TYPE_TEXMAPBUTTON, IDC_MULT_TEX1, - end, + p_end, RGBAdd_map2, _T("map2"), TYPE_TEXMAP, P_OWNERS_REF, IDS_JW_MAP2, p_refno, 2, p_subtexno, 1, p_ui, TYPE_TEXMAPBUTTON, IDC_MULT_TEX2, - end, + p_end, RGBAdd_map1_on, _T("map1Enabled"), TYPE_BOOL, 0, IDS_JW_MAP1ENABLE, p_default, TRUE, p_ui, TYPE_SINGLECHEKBOX, IDC_MAPON1, - end, + p_end, RGBAdd_map2_on, _T("map2Enabled"), TYPE_BOOL, 0, IDS_JW_MAP2ENABLE, p_default, TRUE, p_ui, TYPE_SINGLECHEKBOX, IDC_MAPON2, - end, + p_end, RGBAdd_type, _T("alphaFrom"), TYPE_INT, 0, IDS_PW_ALPHAFROM, p_default, 2, p_range, 0, 2, p_ui, TYPE_RADIO, 3, IDC_MULT_ALPHA1, IDC_MULT_ALPHA2, IDC_MULT_ALPHA3, - end, + p_end, - end + p_end ); From 36cc1ea2b5897fa0a73d5bf39d238ab6bd95039b Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:27:29 +0100 Subject: [PATCH 50/50] Fixed: Prototype of method NotifyRefChanged changed in latest 3dsmax SDK versions --HG-- branch : develop --- .../tools/3d/plugin_max/nel_patch_converter/PO2RPO.h | 3 +-- .../nel_patch_converter/nel_patch_converter.cpp | 4 ++-- code/nel/tools/3d/plugin_max/nel_patch_edit/editpat.h | 5 ++--- code/nel/tools/3d/plugin_max/nel_patch_lib/rpo.cpp | 4 ++-- .../3d/plugin_max/nel_patch_paint/nel_patch_paint.h | 3 +-- .../nel_vertex_tree_paint/vertex_tree_paint.h | 4 +--- code/nel/tools/3d/plugin_max/tile_utility/rgbadd.cpp | 10 +++++----- 7 files changed, 14 insertions(+), 19 deletions(-) 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 3d308c47c..77c2c03ca 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 @@ -87,8 +87,7 @@ class PO2RPO : public Modifier { void GetClassName(TSTR& s) {s = GetString(IDS_CLASS_NAME);} RefTargetHandle Clone( RemapDir &remap ); - RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, - PartID& partID, RefMessage message); + RefResult NotifyRefChanged(const Interval& changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate); int NumSubs() { return 0; } TSTR SubAnimName(int i) { return GetString(IDS_PARAMS); } 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 16cf88967..ee75bc152 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 @@ -220,8 +220,8 @@ void PO2RPO::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next) // ----------------------------------------------------------------------------------------------------------------------------------------------------------- -//From ReferenceMaker -RefResult PO2RPO::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget,PartID& partID, RefMessage message) +//From ReferenceMaker +RefResult PO2RPO::NotifyRefChanged(const Interval& changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate) { //TODO: Add code to handle the various reference changed messages return REF_SUCCEED; diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/editpat.h b/code/nel/tools/3d/plugin_max/nel_patch_edit/editpat.h index 78e5ad0db..b6fe7adb1 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/editpat.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/editpat.h @@ -574,9 +574,8 @@ class EditPatchMod : public Modifier, IPatchOps, IPatchSelect, ISubMtlAPI, Attac static bool additiveTile; static bool automaticLighting; - RefResult NotifyRefChanged( Interval changeInt,RefTargetHandle hTarget, - PartID& partID, RefMessage message ) { return REF_SUCCEED; } - + RefResult NotifyRefChanged(const Interval& changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate) { return REF_SUCCEED; } + int selLevel; // RB:named sel sets diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo.cpp b/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo.cpp index dada38542..3f2363a16 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/rpo.cpp @@ -304,10 +304,10 @@ void RPO::GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm, BOOL useSel ) // ------------------------------------------------------------------------------------------------------------------------------------------------ //From ReferenceMaker -RefResult RPO::NotifyRefChanged( Interval changeInt, RefTargetHandle hTarget,PartID& partID, RefMessage message ) +RefResult RPO::NotifyRefChanged(const Interval& changeInt, RefTargetHandle hTarget,PartID& partID, RefMessage message, BOOL propagate ) { //TODO: Implement, if the object makes references to other things - //return PatchObject::NotifyRefChanged( changeInt, hTarget, partID, message); + //return PatchObject::NotifyRefChanged( changeInt, hTarget, partID, message, propagate); return(REF_SUCCEED); } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h index fdc49c2e2..d0e16bd11 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h @@ -422,8 +422,7 @@ class PaintPatchMod : public Modifier static bool automaticLighting; static bool lockBorders; - RefResult NotifyRefChanged( Interval changeInt,RefTargetHandle hTarget, - PartID& partID, RefMessage message ) { return REF_SUCCEED; } + RefResult NotifyRefChanged(const Interval& changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate) { return REF_SUCCEED; } bool includeMeshes; bool preloadTiles; diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.h b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.h index 2921235c2..7c751899e 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.h +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.h @@ -161,9 +161,7 @@ public: Animatable* SubAnim(int i); TSTR SubAnimName(int i); - RefResult NotifyRefChanged( Interval changeInt,RefTargetHandle hTarget, - PartID& partID, RefMessage message); - + RefResult NotifyRefChanged(const Interval& changeInt,RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate); CreateMouseCallBack* GetCreateMouseCallBack() {return NULL;} void BeginEditParams(IObjParam *ip, ULONG flags,Animatable *prev); diff --git a/code/nel/tools/3d/plugin_max/tile_utility/rgbadd.cpp b/code/nel/tools/3d/plugin_max/tile_utility/rgbadd.cpp index 363b54e1c..db1f22b39 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/rgbadd.cpp +++ b/code/nel/tools/3d/plugin_max/tile_utility/rgbadd.cpp @@ -85,8 +85,7 @@ class RGBAdd: public Texmap { int RemapRefOnLoad(int iref); RefTargetHandle Clone(RemapDir &remap = DefaultRemapDir()); - RefResult NotifyRefChanged( Interval changeInt, RefTargetHandle hTarget, - PartID& partID, RefMessage message ); + RefResult NotifyRefChanged(const Interval &changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate); // IO IOResult Save(ISave *isave); @@ -365,9 +364,10 @@ TSTR RGBAdd::SubAnimName(int i) { } } -RefResult RGBAdd::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, - PartID& partID, RefMessage message ) { - switch (message) { +RefResult RGBAdd::NotifyRefChanged(const Interval& changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate) +{ + switch (message) + { case REFMSG_CHANGE: ivalid.SetEmpty(); if (hTarget == pblock)