From 7ce3f964224f725dfc4dff72c7514920175abb9b Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 22 Nov 2016 12:39:44 +0100 Subject: [PATCH] Changed: Use _T macro and TCHAR to support UNICODE --- .../3d/object_viewer/particle_tree_ctrl.cpp | 4 +- .../plugin_max/nel_mesh_lib/export_script.cpp | 2 +- .../plugin_max/nel_patch_paint/paint_ui.cpp | 2 +- .../plugin_max/tile_utility/tile_utility.cpp | 56 +++++++------- code/nel/tools/3d/tile_edit/Browse.h | 18 ++--- code/nel/tools/3d/tile_edit/View.cpp | 4 +- .../tools/3d/tile_edit/choose_veget_set.cpp | 6 +- .../misc/branch_patcher/branch_patcherDlg.cpp | 2 +- .../leveldesign/georges_dll/dfn_dialog.cpp | 14 ++-- .../georges_dll/file_tree_view.cpp | 2 +- .../world_editor/builder_zone.cpp | 10 +-- .../world_editor/dialog_properties.cpp | 30 ++++---- .../world_editor/world_editor/export_dlg.cpp | 20 ++--- .../world_editor/file_dialog_ex.cpp | 6 +- .../world_editor/find_primitive_dlg.cpp | 2 +- .../world_editor/world_editor/world_editor.h | 2 +- .../plugin.cpp | 2 +- .../graph_plugin.cpp | 10 +-- .../DialogFlags.cpp | 74 +++++++++---------- .../entity_display_info.h | 4 +- .../memory_combo_box.cpp | 8 +- .../memory_combo_box.h | 2 +- .../plugin.cpp | 2 +- .../plugin.h | 2 +- 24 files changed, 142 insertions(+), 142 deletions(-) diff --git a/code/nel/tools/3d/object_viewer/particle_tree_ctrl.cpp b/code/nel/tools/3d/object_viewer/particle_tree_ctrl.cpp index c392b1481..803f7548a 100644 --- a/code/nel/tools/3d/object_viewer/particle_tree_ctrl.cpp +++ b/code/nel/tools/3d/object_viewer/particle_tree_ctrl.cpp @@ -852,8 +852,8 @@ BOOL CParticleTreeCtrl::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHA nt = new CNodeType(nt->Loc, objIndex); _NodeTypes.push_back(nt); // insert the element in the tree - HTREEITEM root = InsertItem(TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM | TVIF_TEXT, "instance", PSIconLocatedInstance, PSIconLocatedInstance, 0, 0, (LPARAM) nt, GetSelectedItem(), TVI_LAST); - SetItemData(root, (DWORD) nt); + HTREEITEM root = InsertItem(TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM | TVIF_TEXT, _T("instance"), PSIconLocatedInstance, PSIconLocatedInstance, 0, 0, (LPARAM) nt, GetSelectedItem(), TVI_LAST); + SetItemData(root, (DWORD_PTR) nt); Invalidate(); } break; diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_script.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_script.cpp index a0971d587..3d99cee91 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_script.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_script.cpp @@ -125,7 +125,7 @@ float CExportNel::getScriptAppData (Animatable *node, uint32 id, float def) // String to int float value = 0.f; - if (toFloatMax((const char*)ap->data, value)) + if (toFloatMax((const TCHAR*)ap->data, value)) return value; else return def; 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 10554f8da..46b1ad1d7 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 @@ -242,7 +242,7 @@ void CTileSetCont::build (CTileBank& bank, uint tileSet) if (!dmwarn) { dmwarn = true; - MessageBox(NULL, "Tile bank not loaded, or bad tile bank. Missing a displacement tile. Use the tile bank utility to load the correct tilebank.", "NeL Patch Paint", MB_OK | MB_ICONWARNING); + MessageBox(NULL, _T("Tile bank not loaded, or bad tile bank. Missing a displacement tile. Use the tile bank utility to load the correct tilebank."), _T("NeL Patch Paint"), MB_OK | MB_ICONWARNING); } continue; // with next displace } 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 7c4605b38..e11605b42 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 @@ -72,7 +72,7 @@ class Tile_utilityClassDesc:public ClassDesc2 { return &theTile_utility; } - const TCHAR * ClassName() {return "NeL Tile Bank";} + 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");} @@ -96,7 +96,7 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, if (hModule) { // Get module file name - char moduldeFileName[512]; + TCHAR moduldeFileName[512]; if (GetModuleFileName (hModule, moduldeFileName, 512)) { // Get version info size @@ -112,41 +112,41 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, { 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]; + _tcprintf (version, "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")); theTile_utility.Init(hWnd); @@ -168,7 +168,7 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, { case IDC_BANK_PATH: { - static char sPath[256]; + static TCHAR sPath[256]; static bool bFirst=false; if (!bFirst) { @@ -178,7 +178,7 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, OPENFILENAME ofn; ofn.lStructSize=sizeof (ofn); ofn.hwndOwner=NULL; - ofn.lpstrFilter="Rykol bank files (*.bank)\0*.bank\0All Files (*.*)\0*.*\0"; + ofn.lpstrFilter = _T("Rykol bank files (*.bank)\0*.bank\0All Files (*.*)\0*.*\0"); ofn.lpstrCustomFilter=NULL; ofn.nMaxCustFilter=0; ofn.nFilterIndex=0; @@ -187,7 +187,7 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, ofn.lpstrFileTitle=NULL; ofn.nMaxFileTitle=NULL; ofn.lpstrInitialDir=NULL; - ofn.lpstrTitle="Choose a bank file"; + ofn.lpstrTitle = _T("Choose a bank file"); ofn.Flags=OFN_ENABLESIZING|OFN_FILEMUSTEXIST; ofn.nFileOffset=0; ofn.nFileExtension=0; @@ -223,7 +223,7 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, case IDC_SETUP: { if (!theTile_utility.SetupMaterial ()) - MessageBox (NULL, "Select some nel patch object..", "Rykol tile", MB_OK|MB_ICONEXCLAMATION); + MessageBox (NULL, _T("Select some nel patch object.."), _T("Rykol tile"), MB_OK|MB_ICONEXCLAMATION); } } } @@ -382,18 +382,18 @@ void Tile_utility::SetupUI () SetWindowText (hwnd, sName); // Static text - char sTmp[256]; - sprintf (sTmp, "%d diffuse tiles.", Bank.getNumBitmap (CTile::diffuse)); + TCHAR sTmp[256]; + _tcprintf (sTmp, "%d diffuse tiles.", Bank.getNumBitmap (CTile::diffuse)); SetWindowText (hwndStatic1, sTmp); - sprintf (sTmp, "%d additive tiles.", Bank.getNumBitmap (CTile::additive)); + _tcprintf (sTmp, "%d additive tiles.", Bank.getNumBitmap (CTile::additive)); SetWindowText (hwndStatic2, sTmp); } else { - SetWindowText (hwnd, "Click to choose a bank.."); - SetWindowText (hwndStatic1, ""); - SetWindowText (hwndStatic2, ""); - SetWindowText (hwndStatic3, ""); + SetWindowText (hwnd, _T("Click to choose a bank..")); + SetWindowText (hwndStatic1, _T("")); + SetWindowText (hwndStatic2, _T("")); + SetWindowText (hwndStatic3, _T("")); } } } @@ -412,7 +412,7 @@ bool Tile_utility::SetupMaterial () const // Multi MultiMtl* multi=NewDefaultMultiMtl(); multi->SetNumSubMtls (Bank.getTileCount()+1); - multi->SetName ("Rykol Bank"); + multi->SetName (_T("Rykol Bank")); // Default mtl Mtl* firstMtl=multi->GetSubMtl (0); @@ -420,7 +420,7 @@ bool Tile_utility::SetupMaterial () const // Mtl param firstMtl->SetDiffuse (Color (0.5f,0.5f,0.5f), t); firstMtl->SetAmbient (Color (0,0,0), t); - firstMtl->SetName ("Rykol Tile Default"); + firstMtl->SetName (_T("Rykol Tile Default")); firstMtl->SetShininess (0.0, t); firstMtl->SetSpecular (Color (0,0,0), t); @@ -439,7 +439,7 @@ bool Tile_utility::SetupMaterial () const // Mtl param mtl->SetDiffuse (Color (1.f,1.f,1.f), t); mtl->SetAmbient (Color (0,0,0), t); - mtl->SetName ("Rykol Tile"); + mtl->SetName (_T("Rykol Tile")); mtl->SetShininess (0.0, t); mtl->SetSpecular (Color (0,0,0), t); diff --git a/code/nel/tools/3d/tile_edit/Browse.h b/code/nel/tools/3d/tile_edit/Browse.h index 3c1ce166c..70fd1c6ac 100644 --- a/code/nel/tools/3d/tile_edit/Browse.h +++ b/code/nel/tools/3d/tile_edit/Browse.h @@ -25,15 +25,15 @@ #include "SelectionTerritoire.h" #include "View.h" -#define REGKEY_TILEDIT "Software\\Nevrax\\Nel\\Tile_Edit" -#define REGKEY_BUTTONZOOM "Zoom button" -#define REGKEY_BUTTONVARIETY "Zoom variety" -#define REGKEY_BUTTONTEXTURE "Texture button" -#define REGKEY_BUTTONSORT "Sort button" -#define REGKEY_BUTTONTEXTINFO "Info button" -#define REGKEY_LISTCOMBOBOX "List type combo box" -#define REGKEY_WNDPL "Window placement" -#define REGKEY_LASTPATH "Last path" +#define REGKEY_TILEDIT _T("Software\\Nevrax\\Nel\\Tile_Edit") +#define REGKEY_BUTTONZOOM _T("Zoom button") +#define REGKEY_BUTTONVARIETY _T("Zoom variety") +#define REGKEY_BUTTONTEXTURE _T("Texture button") +#define REGKEY_BUTTONSORT _T("Sort button") +#define REGKEY_BUTTONTEXTINFO _T("Info button") +#define REGKEY_LISTCOMBOBOX _T("List type combo box") +#define REGKEY_WNDPL _T("Window placement") +#define REGKEY_LASTPATH _T("Last path") #define SCROLL_MAX 50000 diff --git a/code/nel/tools/3d/tile_edit/View.cpp b/code/nel/tools/3d/tile_edit/View.cpp index d6d24d47c..d0eecb229 100644 --- a/code/nel/tools/3d/tile_edit/View.cpp +++ b/code/nel/tools/3d/tile_edit/View.cpp @@ -438,14 +438,14 @@ int TileList::setDisplacement (int tile, const std::string& name) theListDisplacement[tile].loaded=0; if (!_LoadBitmap(tileBank2.getAbsPath() + troncated, &theListDisplacement[tile].BmpInfo, theListDisplacement[tile].Bits, NULL, 0)) - MessageBox (NULL, (tileBank2.getAbsPath() + troncated).c_str(), "Can't load file", MB_OK|MB_ICONEXCLAMATION); + MessageBox (NULL, (tileBank2.getAbsPath() + troncated).c_str(), _T("Can't load file"), MB_OK|MB_ICONEXCLAMATION); else { // Check the size if ((theListDisplacement[tile].BmpInfo.bmiHeader.biWidth!=32)||(-theListDisplacement[tile].BmpInfo.bmiHeader.biHeight!=32)) { // Error message - MessageBox (NULL, "Invalid size: displacement map must be 32x32 8 bits.", troncated.c_str(), + MessageBox (NULL, _T("Invalid size: displacement map must be 32x32 8 bits."), troncated.c_str(), MB_OK|MB_ICONEXCLAMATION); // Free the bitmap diff --git a/code/nel/tools/3d/tile_edit/choose_veget_set.cpp b/code/nel/tools/3d/tile_edit/choose_veget_set.cpp index 7afa0c1e0..a8aa6878c 100644 --- a/code/nel/tools/3d/tile_edit/choose_veget_set.cpp +++ b/code/nel/tools/3d/tile_edit/choose_veget_set.cpp @@ -61,10 +61,10 @@ END_MESSAGE_MAP() void CChooseVegetSet::OnBrowse() { // Select a veget set - static char BASED_CODE szFilter[] = "NeL VegetSet Files (*.vegetset)|*.vegetset|All Files (*.*)|*.*||"; + static TCHAR BASED_CODE szFilter[] = _T("NeL VegetSet Files (*.vegetset)|*.vegetset|All Files (*.*)|*.*||"); // Create a file dialog - CFileDialog dialog ( TRUE, "*.vegetset", "*.vegetset", OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter, (CWnd*)Parent); + CFileDialog dialog ( TRUE, _T("*.vegetset"), _T("*.vegetset"), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter, (CWnd*)Parent); if (dialog.DoModal() == IDOK) { // Get the file name @@ -80,7 +80,7 @@ BOOL CChooseVegetSet::OnInitDialog() if (!FileName.empty()) Name.SetWindowText (utf8ToTStr(FileName)); else - Name.SetWindowText ("Browse..."); + Name.SetWindowText (_T("Browse...")); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE diff --git a/code/nel/tools/misc/branch_patcher/branch_patcherDlg.cpp b/code/nel/tools/misc/branch_patcher/branch_patcherDlg.cpp index b3e65653c..c20a90d53 100644 --- a/code/nel/tools/misc/branch_patcher/branch_patcherDlg.cpp +++ b/code/nel/tools/misc/branch_patcher/branch_patcherDlg.cpp @@ -669,7 +669,7 @@ void CBranch_patcherDlg::OnButtonExtractTokens() m_SrcDirLabel = "Enter Token 1"; m_TargetDirLabel = "Enter Token 2"; m_Filename = "The tokens above were extracted from the directories."; - ((CButton*)GetDlgItem( IDC_ButtonExtractTokens ))->SetWindowText( "Store Tokens" ); + ((CButton*)GetDlgItem( IDC_ButtonExtractTokens ))->SetWindowText( _T("Store Tokens") ); GetDlgItem( IDC_TopText )->ShowWindow( SW_HIDE ); GetDlgItem( IDC_ButtonClearTokens )->EnableWindow( FALSE ); GetDlgItem( IDC_ButtonPatch )->ShowWindow( SW_HIDE ); diff --git a/code/ryzom/tools/leveldesign/georges_dll/dfn_dialog.cpp b/code/ryzom/tools/leveldesign/georges_dll/dfn_dialog.cpp index 38ed1ec9c..301a9d893 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/dfn_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/dfn_dialog.cpp @@ -90,7 +90,7 @@ BOOL CDfnDialog::OnInitDialog() // Create the type combo setStaticSize (currentPos); - LabelParents.Create ("Parents:", WS_VISIBLE, currentPos, this); + LabelParents.Create (_T("Parents:"), WS_VISIBLE, currentPos, this); initWidget (LabelParents); getNextPosLabel (currentPos); @@ -105,7 +105,7 @@ BOOL CDfnDialog::OnInitDialog() // Create the type combo setStaticSize (currentPos); - LabelStruct.Create ("Structure:", WS_VISIBLE, currentPos, this); + LabelStruct.Create (_T("Structure:"), WS_VISIBLE, currentPos, this); initWidget (LabelStruct); getNextPosLabel (currentPos); @@ -210,10 +210,10 @@ void CDfnDialog::getFromDocument (const NLGEORGES::CFormDfn &dfn) Struct.ListCtrl.SetItemText (elm, 4, dfn.getEntry (elm).getFilenameExt ().c_str()); break; case UFormDfn::EntryDfn: - Struct.ListCtrl.SetItemText (elm, 1, dfn.getEntry (elm).getArrayFlag () ? "Dfn array" : "Dfn"); + Struct.ListCtrl.SetItemText (elm, 1, dfn.getEntry (elm).getArrayFlag () ? _T("Dfn array") : _T("Dfn")); break; case UFormDfn::EntryVirtualDfn: - Struct.ListCtrl.SetItemText (elm, 1, "Virtual Dfn"); + Struct.ListCtrl.SetItemText (elm, 1, _T("Virtual Dfn")); break; } Struct.ListCtrl.SetItemText (elm, 2, dfn.getEntry (elm).getFilename ().c_str()); @@ -435,15 +435,15 @@ void CDfnEditListCtrl::onItemChanged (uint item, uint subItem) Dialog->Struct.ListCtrl.SetItemText (item, 2, theApp.DefaultDfn.c_str ()); // Clear default value - Dialog->Struct.ListCtrl.SetItemText (item, 3, ""); + Dialog->Struct.ListCtrl.SetItemText (item, 3, _T("")); } else if (type == "Virtual Dfn") { // Clear the value - Dialog->Struct.ListCtrl.SetItemText (item, 2, ""); + Dialog->Struct.ListCtrl.SetItemText (item, 2, _T("")); // Clear default value - Dialog->Struct.ListCtrl.SetItemText (item, 3, ""); + Dialog->Struct.ListCtrl.SetItemText (item, 3, _T("")); } } } 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 90b742860..43c71f240 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/file_tree_view.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/file_tree_view.cpp @@ -51,7 +51,7 @@ bool CFileTreeCtrl::create( const RECT& rect, CWnd* pParentWnd, UINT nID ) LPCTSTR className = AfxRegisterWndClass( 0 ); // Create this window - if (CWnd::Create (className, "empty", WS_CHILD, rect, pParentWnd, nID )) + if (CWnd::Create (className, _T("empty"), WS_CHILD, rect, pParentWnd, nID )) #if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 80 diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/builder_zone.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/builder_zone.cpp index ffdfe4d60..30b15cf8d 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/builder_zone.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/builder_zone.cpp @@ -609,8 +609,7 @@ bool CBuilderZone::refresh () if ((sZone != STRING_UNUSED)&&(sZone != STRING_OUT_OF_BOUND)) { unload (_ZoneRegionSelected); - MessageBox (NULL, "Cannot add this zone because it overlaps existing ones", - "Error", MB_ICONERROR|MB_OK); + MessageBox (NULL, _T("Cannot add this zone because it overlaps existing ones"), _T("Error"), MB_ICONERROR|MB_OK); return false; } } @@ -1599,17 +1598,18 @@ void CBuilderZone::del (const CVector &worldPos) // --------------------------------------------------------------------------- bool CBuilderZone::initZoneBank (const string &sPathName) { - char sDirBackup[512]; + // TODO: replace by NeL methods + TCHAR sDirBackup[512]; GetCurrentDirectory (512, sDirBackup); SetCurrentDirectory (sPathName.c_str()); WIN32_FIND_DATA findData; HANDLE hFind; - hFind = FindFirstFile ("*.ligozone", &findData); + hFind = FindFirstFile (_T("*.ligozone"), &findData); while (hFind != INVALID_HANDLE_VALUE) { // If the name of the file is not . or .. then its a valid entry in the DataBase - if (!((strcmp (findData.cFileName, ".") == 0) || (strcmp (findData.cFileName, "..") == 0))) + if (!((_tcscmp (findData.cFileName, _T(".")) == 0) || (_tcscmp (findData.cFileName, _T("..")) == 0))) { string error; if (!_ZoneBank.addElement (findData.cFileName, error)) diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/dialog_properties.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/dialog_properties.cpp index 8fa0266e7..bbd84578b 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/dialog_properties.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/dialog_properties.cpp @@ -49,8 +49,8 @@ using namespace NLMISC; #define STRING_SELECT_COMBOBOX_ID 9 -#define DIFFERENT_VALUE_STRING "" -#define DIFFERENT_VALUE_MULTI_STRING "" +#define DIFFERENT_VALUE_STRING _T("") +#define DIFFERENT_VALUE_MULTI_STRING _T("") //CDialogProperties PropertyDialog; std::list PropertiesDialogs; @@ -327,12 +327,12 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter ¶meter, buttonRect.right = buttonRect.left + FILE_BUTTON_WIDTH; // Create an edit box - nlverify (widget.CheckBox.Create ("Select", BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id)); + nlverify (widget.CheckBox.Create (_T("Select"), BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id)); widget.CheckBox.SetFont (GetFont ()); } // Create the label - widget.Static.Create ("", WS_VISIBLE, widgetPos, &m_PropertyCont); + widget.Static.Create (_T(""), WS_VISIBLE, widgetPos, &m_PropertyCont); widget.Static.SetFont (GetFont ()); // Next position @@ -372,11 +372,11 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter ¶meter, // we insert an empty string in case of a default value if (!widget.Parameter.SortEntries) { - widget.ComboBox.InsertString( -1, ""); + widget.ComboBox.InsertString( -1, _T("")); } else { - widget.ComboBox.AddString(""); + widget.ComboBox.AddString(_T("")); } if (ite != widget.Parameter.ComboValues.end ()) { @@ -431,7 +431,7 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter ¶meter, widgetPos.bottom = widgetPos.top + EDIT_HEIGHT; // Create an edit box - nlverify (widget.EditBox.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), "", WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|(enabled?0:ES_READONLY), widgetPos, &m_PropertyCont, id)); + nlverify (widget.EditBox.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), _T(""), WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|(enabled?0:ES_READONLY), widgetPos, &m_PropertyCont, id)); widget.EditBox.SetFont (GetFont ()); if (widget.Parameter.FileExtension != "") { @@ -440,7 +440,7 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter ¶meter, buttonRect.right = buttonRect.left + FILE_BUTTON_WIDTH; // Create an edit box - nlverify (widget.CheckBox.Create ("Open...", BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id)); + nlverify (widget.CheckBox.Create (_T("Open..."), BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id)); widget.CheckBox.SetFont (GetFont ()); } } @@ -452,12 +452,12 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter ¶meter, // Create an edit box if (widget.Parameter.DisplayHS) { - nlverify (widget.MultiLineEditBox.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), "", + nlverify (widget.MultiLineEditBox.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), _T(""), WS_VSCROLL|WS_HSCROLL|ES_MULTILINE|ES_WANTRETURN|WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_AUTOVSCROLL|(enabled?0:ES_READONLY), widgetPos, &m_PropertyCont, id)); } else { - nlverify (widget.MultiLineEditBox.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), "", + nlverify (widget.MultiLineEditBox.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), _T(""), WS_VSCROLL|ES_MULTILINE|ES_WANTRETURN|WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_AUTOVSCROLL|(enabled?0:ES_READONLY), widgetPos, &m_PropertyCont, id)); } @@ -478,7 +478,7 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter ¶meter, RECT buttonRect = widgetPos; // Create an edit box - nlverify (widget.CheckBox.Create ("Edit...", BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id)); + nlverify (widget.CheckBox.Create (_T("Edit..."), BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id)); widget.CheckBox.SetFont (GetFont ()); } } @@ -488,7 +488,7 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter ¶meter, widgetPos.bottom = widgetPos.top + widget.Parameter.WidgetHeight; // Create an edit box - nlverify (widget.ListEditBox.CreateEx (WS_EX_CLIENTEDGE, _T("LISTBOX"), "", WS_VSCROLL|WS_CHILD|WS_VISIBLE|WS_TABSTOP|LBS_NOTIFY|(enabled?0:WS_DISABLED), widgetPos, &m_PropertyCont, id)); + nlverify (widget.ListEditBox.CreateEx (WS_EX_CLIENTEDGE, _T("LISTBOX"), _T(""), WS_VSCROLL|WS_CHILD|WS_VISIBLE|WS_TABSTOP|LBS_NOTIFY|(enabled?0:WS_DISABLED), widgetPos, &m_PropertyCont, id)); // Resize the column RECT listRect; @@ -498,7 +498,7 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter ¶meter, widget.ListEditBox.StringSelectComboBox.ResetContent (); std::map::iterator ite = widget.Parameter.ComboValues.find (doc->getContext ().c_str()); // we insert an empty string in case of a default value - widget.ListEditBox.StringSelectComboBox.InsertString( -1, ""); + widget.ListEditBox.StringSelectComboBox.InsertString( -1, _T("")); if (ite != widget.Parameter.ComboValues.end ()) { vector PathList; @@ -565,7 +565,7 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter ¶meter, // Create an edit box //nlverify (widget.CheckBox.Create ("Open...", BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP, buttonRect, this, id)); - nlverify (widget.CheckBox.Create ("View...", BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id)); + nlverify (widget.CheckBox.Create (_T("View..."), BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id)); widget.CheckBox.SetFont (GetFont ()); } @@ -661,7 +661,7 @@ BOOL CDialogProperties::OnInitDialog() // m_PropertyFrame.ClientToScreen(&contRect); // leave 16 px for the scroll bar contRect.right-=16; - m_PropertyCont.Create("", 0, contRect, &m_PropertyFrame); + m_PropertyCont.Create(_T(""), 0, contRect, &m_PropertyFrame); // m_PropertyCont.SetCursor() m_PropertyCont.ShowWindow(SW_SHOW); diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/export_dlg.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/export_dlg.cpp index b12f145a6..6460dc3f1 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/export_dlg.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/export_dlg.cpp @@ -163,20 +163,20 @@ int CALLBACK expBrowseCallbackProc (HWND hwnd,UINT uMsg,LPARAM lp, LPARAM pData) bool CExportDlg::callChoosePathDlg(CString &dest) const { BROWSEINFO bi; - char str[MAX_PATH]; + TCHAR str[MAX_PATH]; ITEMIDLIST* pidl; - char sTemp[1024]; + TCHAR sTemp[1024]; bi.hwndOwner = this->m_hWnd; bi.pidlRoot = NULL; bi.pidlRoot = NULL; bi.pszDisplayName = sTemp;; - bi.lpszTitle = "Choose the path"; + bi.lpszTitle = _T("Choose the path"); bi.ulFlags = 0; bi.lpfn = expBrowseCallbackProc; - char sDir[512]; - strcpy(sDir, (LPCSTR)RefZoneDir); + TCHAR sDir[512]; + _tcscpy(sDir, (LPCTSTR)RefZoneDir); bi.lParam = (LPARAM)sDir; bi.iImage = 0; @@ -218,7 +218,7 @@ void CExportDlg::OnButtonOutIGdir() // --------------------------------------------------------------------------- void CExportDlg::OnButtonTilebankfile() { - CFileDialogEx dialog (BASE_REGISTRY_KEY, "bank", true, "smallbank", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "SmallBank (*.smallbank)|*.smallbank||", this); + CFileDialogEx dialog (BASE_REGISTRY_KEY, _T("bank"), true, _T("smallbank"), NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, _T("SmallBank (*.smallbank)|*.smallbank||"), this); if (dialog.DoModal() == IDOK) { TileBankFile = dialog.GetPathName (); @@ -229,7 +229,7 @@ void CExportDlg::OnButtonTilebankfile() // --------------------------------------------------------------------------- void CExportDlg::OnButtonColormapfile() { - CFileDialogEx dialog (BASE_REGISTRY_KEY, "image", true, "tga", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "Tga Files (*.tga)|*.tga|All Files (*.*)|*.*||", this); + CFileDialogEx dialog (BASE_REGISTRY_KEY, _T("image"), true, _T("tga"), NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, _T("Tga Files (*.tga)|*.tga|All Files (*.*)|*.*||"), this); if (dialog.DoModal() == IDOK) { ColorMapFile = dialog.GetPathName (); @@ -240,7 +240,7 @@ void CExportDlg::OnButtonColormapfile() // --------------------------------------------------------------------------- void CExportDlg::OnButtonHeightmapfile() { - CFileDialogEx dialog (BASE_REGISTRY_KEY, "image", true, "tga", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "Grayscale Tga (*.tga)|*.tga||", this); + CFileDialogEx dialog (BASE_REGISTRY_KEY, _T("image"), true, _T("tga"), NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, _T("Grayscale Tga (*.tga)|*.tga||"), this); if (dialog.DoModal() == IDOK) { HeightMapFile = dialog.GetPathName (); @@ -251,7 +251,7 @@ void CExportDlg::OnButtonHeightmapfile() // --------------------------------------------------------------------------- void CExportDlg::OnButtonHeightmapfile2() { - CFileDialogEx dialog (BASE_REGISTRY_KEY, "image", true, "tga", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "Grayscale Tga (*.tga)|*.tga||", this); + CFileDialogEx dialog (BASE_REGISTRY_KEY, _T("image"), true, _T("tga"), NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, _T("Grayscale Tga (*.tga)|*.tga||"), this); if (dialog.DoModal() == IDOK) { HeightMapFile2 = dialog.GetPathName (); @@ -299,7 +299,7 @@ void CExportDlg::OnButtonContinentsDir() // --------------------------------------------------------------------------- void CExportDlg::OnButtonContinentFile() { - CFileDialogEx dialog (BASE_REGISTRY_KEY, "continent", true, "continent", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "Continent file (*.continent)|*.continent||", this); + CFileDialogEx dialog (BASE_REGISTRY_KEY, _T("continent"), true, _T("continent"), NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, _T("Continent file (*.continent)|*.continent||"), this); if (dialog.DoModal() == IDOK) { ContinentFile = dialog.GetPathName (); diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/file_dialog_ex.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/file_dialog_ex.cpp index 781e78005..9ee63294a 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/file_dialog_ex.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/file_dialog_ex.cpp @@ -54,7 +54,7 @@ END_MESSAGE_MAP() INT_PTR CFileDialogEx::DoModal () { // Get the path - char path[512]; + TCHAR path[512]; path[0] = 0; HKEY hKey; DWORD type = REG_SZ; @@ -122,7 +122,7 @@ BOOL CFileDialogEx::OnCommand( WPARAM wParam, LPARAM lParam ) ::GetDlgItemText (parent, edt1, s, MAX_PATH); // Replace with the directory name - ::SendMessage (parent, CDM_SETCONTROLTEXT, edt1, (LPARAM)(const char*)text); + ::SendMessage (parent, CDM_SETCONTROLTEXT, edt1, (LPARAM)(LPCTSTR)text); // Click on the OK button ::SendMessage (parent, WM_COMMAND, IDOK, 0); @@ -148,7 +148,7 @@ BOOL CFileDialogEx::OnInitDialog() combo.Attach (::GetDlgItem (*this, IDC_DIRLIST)); // Insert the strings - char text[512]; + TCHAR text[512]; text[0] = 0; HKEY hKey; DWORD type = REG_SZ; diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/find_primitive_dlg.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/find_primitive_dlg.cpp index 87e5d553c..2cea6d8d8 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/find_primitive_dlg.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/find_primitive_dlg.cpp @@ -175,7 +175,7 @@ void CFindPrimitiveDlg::OnFindNext() } else { - MessageBox ("End of the document", "Find a primitive...", MB_OK|MB_ICONEXCLAMATION); + MessageBox (_T("End of the document"), _T("Find a primitive..."), MB_OK|MB_ICONEXCLAMATION); // Init locator _Locator.getRoot (0); diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.h b/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.h index 38a17b6bb..d5e629353 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.h +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.h @@ -36,7 +36,7 @@ #include "nel/ligo/ligo_config.h" // Base registry key -#define BASE_REGISTRY_KEY "Software\\Nevrax\\NeL World Editor" +#define BASE_REGISTRY_KEY _T("Software\\Nevrax\\NeL World Editor") ///////////////////////////////////////////////////////////////////////////// // CWorldEditorApp: diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_fauna_graph_plugin/plugin.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor_fauna_graph_plugin/plugin.cpp index 9d59e797e..532d034d0 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_fauna_graph_plugin/plugin.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_fauna_graph_plugin/plugin.cpp @@ -353,7 +353,7 @@ void CPlugin::postRender(CDisplay &display) // TODO nico This code is duplicated with world_editor_shard_monitor static bool createFailed = false; if (createFailed) return; - HRSRC rsc = FindResource(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_FLAG_ICONS_TGA), "TGA"); + HRSRC rsc = FindResource(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_FLAG_ICONS_TGA), _T("TGA")); if (rsc == NULL) { DWORD lastError = GetLastError(); diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/graph_plugin.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/graph_plugin.cpp index f21400421..06c5d4dd8 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/graph_plugin.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/graph_plugin.cpp @@ -186,7 +186,7 @@ void CGraphPlugin::refreshPrimitives() //currently using output.png as the input file... if(!createBitmap(tmpPath)) - AfxMessageBox("BEWARE: the image couldn't be loaded."); + AfxMessageBox(_T("BEWARE: the image couldn't be loaded.")); } while (missionTreeRoot->getParent()!=NULL) @@ -268,7 +268,7 @@ void CGraphPlugin::refreshMachine() //currently using output.png as the input file... if(!createBitmap(tmpPath)) - AfxMessageBox("BEWARE: the image couldn't be loaded."); + AfxMessageBox(_T("BEWARE: the image couldn't be loaded.")); } while (missionTreeRoot->getParent()!=NULL) @@ -312,8 +312,8 @@ void CGraphPlugin::refreshMachine() //currently using output.png as the input file... if(!createBitmap(tmpPath)) - AfxMessageBox("BEWARE: the image couldn't be loaded."); - } + AfxMessageBox(_T("BEWARE: the image couldn't be loaded.")); + } while (missionTreeRoot->getParent()!=NULL) { @@ -323,7 +323,7 @@ void CGraphPlugin::refreshMachine() } else { - AfxMessageBox("The selected node could not be processed."); + AfxMessageBox(_T("The selected node could not be processed.")); } } diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/DialogFlags.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/DialogFlags.cpp index 7fc7ddf65..223860403 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/DialogFlags.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/DialogFlags.cpp @@ -73,18 +73,18 @@ CDialogFlags::CDialogFlags(CWnd* pParent /*=NULL*/) { CEntityDisplayInfo di[] = { - CEntityDisplayInfo(RYZOMID::building, "Building", NLMISC::CRGBA(192, 0, 0)), - CEntityDisplayInfo(RYZOMID::creature, "Creature", NLMISC::CRGBA(255, 127, 0), 2, 0), - CEntityDisplayInfo(RYZOMID::deposit, "Deposit", NLMISC::CRGBA(0, 255, 0)), - CEntityDisplayInfo(RYZOMID::flora, "Flora", NLMISC::CRGBA(255, 127, 0)), - CEntityDisplayInfo(RYZOMID::forageSource, "Forage Source", NLMISC::CRGBA(0, 255, 0)), - CEntityDisplayInfo(RYZOMID::mount, "Mount", NLMISC::CRGBA(127, 63, 0), 3, 0), - CEntityDisplayInfo(RYZOMID::npc, "NPC", NLMISC::CRGBA(255, 0, 0), 1, 0), - CEntityDisplayInfo(RYZOMID::object, "Object", NLMISC::CRGBA(192, 255, 255)), - CEntityDisplayInfo(RYZOMID::pack_animal, "Pack Animal", NLMISC::CRGBA(127, 63, 0), 3, 0), - CEntityDisplayInfo(RYZOMID::player, "Player", NLMISC::CRGBA(127, 127, 255), 0, 0), - CEntityDisplayInfo(RYZOMID::fx_entity, "FX Entity", NLMISC::CRGBA(0, 255, 0)), - CEntityDisplayInfo(RYZOMID::unknown, "Unknown", NLMISC::CRGBA(127, 127, 127)), + CEntityDisplayInfo(RYZOMID::building, _T("Building"), NLMISC::CRGBA(192, 0, 0)), + CEntityDisplayInfo(RYZOMID::creature, _T("Creature"), NLMISC::CRGBA(255, 127, 0), 2, 0), + CEntityDisplayInfo(RYZOMID::deposit, _T("Deposit"), NLMISC::CRGBA(0, 255, 0)), + CEntityDisplayInfo(RYZOMID::flora, _T("Flora"), NLMISC::CRGBA(255, 127, 0)), + CEntityDisplayInfo(RYZOMID::forageSource, _T("Forage Source"), NLMISC::CRGBA(0, 255, 0)), + CEntityDisplayInfo(RYZOMID::mount, _T("Mount"), NLMISC::CRGBA(127, 63, 0), 3, 0), + CEntityDisplayInfo(RYZOMID::npc, _T("NPC"), NLMISC::CRGBA(255, 0, 0), 1, 0), + CEntityDisplayInfo(RYZOMID::object, _T("Object"), NLMISC::CRGBA(192, 255, 255)), + CEntityDisplayInfo(RYZOMID::pack_animal, _T("Pack Animal"), NLMISC::CRGBA(127, 63, 0), 3, 0), + CEntityDisplayInfo(RYZOMID::player, _T("Player"), NLMISC::CRGBA(127, 127, 255), 0, 0), + CEntityDisplayInfo(RYZOMID::fx_entity, _T("FX Entity"), NLMISC::CRGBA(0, 255, 0)), + CEntityDisplayInfo(RYZOMID::unknown, _T("Unknown"), NLMISC::CRGBA(127, 127, 127)), }; initDisplayInfo(di, sizeofarray(di), _EntityDisplayInfo[EntityType]); } @@ -92,10 +92,10 @@ CDialogFlags::CDialogFlags(CWnd* pParent /*=NULL*/) { CEntityDisplayInfo di[] = { - CEntityDisplayInfo(0, "Dead", NLMISC::CRGBA(255, 0, 0)), - CEntityDisplayInfo(1, "Weak", NLMISC::CRGBA(255, 255, 0)), - CEntityDisplayInfo(2, "Full shape", NLMISC::CRGBA(0, 255, 0)), - CEntityDisplayInfo(3, "No Hit Points", NLMISC::CRGBA(127, 127, 127)), + CEntityDisplayInfo(0, _T("Dead"), NLMISC::CRGBA(255, 0, 0)), + CEntityDisplayInfo(1, _T("Weak"), NLMISC::CRGBA(255, 255, 0)), + CEntityDisplayInfo(2, _T("Full shape"), NLMISC::CRGBA(0, 255, 0)), + CEntityDisplayInfo(3, _T("No Hit Points"), NLMISC::CRGBA(127, 127, 127)), }; initDisplayInfo(di, sizeofarray(di), _EntityDisplayInfo[EntityHitPoints]); } @@ -103,9 +103,9 @@ CDialogFlags::CDialogFlags(CWnd* pParent /*=NULL*/) { CEntityDisplayInfo di[] = { - CEntityDisplayInfo(0, "Dead", NLMISC::CRGBA(255, 0, 0)), - CEntityDisplayInfo(1, "Alive", NLMISC::CRGBA(0, 0, 255)), - CEntityDisplayInfo(2, "No Hit Points", NLMISC::CRGBA(127, 127, 127)), + CEntityDisplayInfo(0, _T("Dead"), NLMISC::CRGBA(255, 0, 0)), + CEntityDisplayInfo(1, _T("Alive"), NLMISC::CRGBA(0, 0, 255)), + CEntityDisplayInfo(2, _T("No Hit Points"), NLMISC::CRGBA(127, 127, 127)), }; initDisplayInfo(di, sizeofarray(di), _EntityDisplayInfo[EntityAlive]); } @@ -113,19 +113,19 @@ CDialogFlags::CDialogFlags(CWnd* pParent /*=NULL*/) { CEntityDisplayInfo di[] = { - CEntityDisplayInfo(MBEHAV::UNKNOWN_MODE, "Unknown", NLMISC::CRGBA(127, 127, 127)), - CEntityDisplayInfo(MBEHAV::NORMAL, "Normal", NLMISC::CRGBA(255, 255, 255)), - CEntityDisplayInfo(MBEHAV::COMBAT_FLOAT, "Combat float", NLMISC::CRGBA(255, 0, 0), 0, 1), - CEntityDisplayInfo(MBEHAV::COMBAT, "Combat", NLMISC::CRGBA(255, 0, 0), 0, 1), - CEntityDisplayInfo(MBEHAV::SWIM, "Swim", NLMISC::CRGBA(0, 0, 255)), - CEntityDisplayInfo(MBEHAV::SIT, "Sit", NLMISC::CRGBA(0, 255, 255)), - CEntityDisplayInfo(MBEHAV::MOUNT_NORMAL, "Mount Normal", NLMISC::CRGBA(192, 128, 0)), - CEntityDisplayInfo(MBEHAV::MOUNT_SWIM, "Mount Swim", NLMISC::CRGBA(0, 0, 255)), - CEntityDisplayInfo(MBEHAV::EAT, "Eat", NLMISC::CRGBA(0, 255, 0)), - CEntityDisplayInfo(MBEHAV::ALERT, "Alert", NLMISC::CRGBA(255, 127, 0)), - CEntityDisplayInfo(MBEHAV::HUNGRY, "Hungry", NLMISC::CRGBA(255, 255, 0)), - CEntityDisplayInfo(MBEHAV::DEATH, "Death", NLMISC::CRGBA(0, 0, 0)), - CEntityDisplayInfo(MBEHAV::SWIM_DEATH, "SwimDeath", NLMISC::CRGBA(0, 0, 0)) + CEntityDisplayInfo(MBEHAV::UNKNOWN_MODE, _T("Unknown"), NLMISC::CRGBA(127, 127, 127)), + CEntityDisplayInfo(MBEHAV::NORMAL, _T("Normal"), NLMISC::CRGBA(255, 255, 255)), + CEntityDisplayInfo(MBEHAV::COMBAT_FLOAT, _T("Combat float"), NLMISC::CRGBA(255, 0, 0), 0, 1), + CEntityDisplayInfo(MBEHAV::COMBAT, _T("Combat"), NLMISC::CRGBA(255, 0, 0), 0, 1), + CEntityDisplayInfo(MBEHAV::SWIM, _T("Swim"), NLMISC::CRGBA(0, 0, 255)), + CEntityDisplayInfo(MBEHAV::SIT, _T("Sit"), NLMISC::CRGBA(0, 255, 255)), + CEntityDisplayInfo(MBEHAV::MOUNT_NORMAL, _T("Mount Normal"), NLMISC::CRGBA(192, 128, 0)), + CEntityDisplayInfo(MBEHAV::MOUNT_SWIM, _T("Mount Swim"), NLMISC::CRGBA(0, 0, 255)), + CEntityDisplayInfo(MBEHAV::EAT, _T("Eat"), NLMISC::CRGBA(0, 255, 0)), + CEntityDisplayInfo(MBEHAV::ALERT, _T("Alert"), NLMISC::CRGBA(255, 127, 0)), + CEntityDisplayInfo(MBEHAV::HUNGRY, _T("Hungry"), NLMISC::CRGBA(255, 255, 0)), + CEntityDisplayInfo(MBEHAV::DEATH, _T("Death"), NLMISC::CRGBA(0, 0, 0)), + CEntityDisplayInfo(MBEHAV::SWIM_DEATH, _T("SwimDeath"), NLMISC::CRGBA(0, 0, 0)) }; initDisplayInfo(di, sizeofarray(di), _EntityDisplayInfo[EntityMode]); } @@ -213,7 +213,7 @@ BOOL CDialogFlags::OnInitDialog() { CDialog::OnInitDialog(); - HRSRC rsc = FindResource(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ENTITY_ICONS_TGA), "TGA"); + HRSRC rsc = FindResource(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ENTITY_ICONS_TGA), _T("TGA")); if (rsc != NULL) { NLMISC::CBitmap bm; @@ -247,7 +247,7 @@ BOOL CDialogFlags::OnInitDialog() ::CRect shardListRect; GetDlgItem(IDC_SHARD_LIST_PLACEMENT)->GetWindowRect(shardListRect); ScreenToClient(&shardListRect); - ShardCtrl.create(WS_CHILD|WS_TABSTOP, shardListRect, this, 0, REGKEY_BASE_PATH "\\shard_list", 10); + ShardCtrl.create(WS_CHILD|WS_TABSTOP, shardListRect, this, 0, REGKEY_BASE_PATH _T("\\shard_list"), 10); ShardCtrl.ShowWindow (SW_SHOW); CFont* font = GetFont (); ShardCtrl.SetFont(font); @@ -295,7 +295,7 @@ void CDialogFlags::setCurrentEntityDisplayMode(TEntityDisplayMode edm) -#define REGKEY_ENTITY_DISPLAY_INFO REGKEY_BASE_PATH "\\entity_display_info\\" +#define REGKEY_ENTITY_DISPLAY_INFO REGKEY_BASE_PATH _T("\\entity_display_info\\") //****************************************************************************************************** void CDialogFlags::loadEntityDisplayInfoToRegistry(TEntityDisplayInfoVect &infos, const std::string ®Id) @@ -306,13 +306,13 @@ void CDialogFlags::loadEntityDisplayInfoToRegistry(TEntityDisplayInfoVect &infos DWORD index = 0; for(;;) { - char valueStr[256] = { 0 }; + TCHAR valueStr[256] = { 0 }; BYTE dataStr[256] = { 0 }; DWORD valueSize = sizeofarray(valueStr); DWORD dataSize = sizeofarray(dataStr); LONG result = RegEnumValue(hKey, index, valueStr, &valueSize, NULL, NULL, dataStr, &dataSize); if (result != ERROR_SUCCESS) break; - uint value = (uint) atoi(valueStr); + uint value = (uint) _ttoi(valueStr); for(uint k = 0; k < infos.size(); ++k) { if (infos[k].Value == value) diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/entity_display_info.h b/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/entity_display_info.h index 8c3afda74..b3d3e2fc2 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/entity_display_info.h +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/entity_display_info.h @@ -46,12 +46,12 @@ class CEntityDisplayInfo { public: uint Value; - const char *Name; + const TCHAR *Name; CEntityIcon Icon; NLMISC::CRGBA Color; bool Visible; CEntityDisplayInfo() {} - CEntityDisplayInfo(uint value, const char *name, NLMISC::CRGBA color, sint iconX = -1, sint iconY = -1) + CEntityDisplayInfo(uint value, const TCHAR *name, NLMISC::CRGBA color, sint iconX = -1, sint iconY = -1) : Value(value), Name(name), Color(color), Visible(true), Icon(iconX, iconY) {} }; diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/memory_combo_box.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/memory_combo_box.cpp index a6d4a909d..5788c2d72 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/memory_combo_box.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/memory_combo_box.cpp @@ -43,7 +43,7 @@ CMemoryComboBox::~CMemoryComboBox() // *************************************************************************** -void CMemoryComboBox::create (DWORD style, const RECT &rect, CWnd *parent, UINT nId, const char *registerAdress, int memoryCount) +void CMemoryComboBox::create (DWORD style, const RECT &rect, CWnd *parent, UINT nId, const TCHAR *registerAdress, int memoryCount) { // Register a window Id = nId; @@ -52,7 +52,7 @@ void CMemoryComboBox::create (DWORD style, const RECT &rect, CWnd *parent, UINT LPCTSTR clas = AfxRegisterWndClass (0); if (clas) { - if (Create (clas, "MemoryComboBox", style, rect, parent, nId)) + if (Create (clas, _T("MemoryComboBox"), style, rect, parent, nId)) { // Create the combo box RECT comboRect; @@ -582,12 +582,12 @@ LRESULT CMemoryComboBox::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) int curSel = _ComboBox.GetCurSel (); if ((curSel == -1) || ((uint)curSel