From a0b502c752443ca81e29c1550423b780c1447ea0 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 17 Nov 2016 10:55:21 +0100 Subject: [PATCH] Changed: Use _T macro and TCHAR to support UNICODE --- .../tools/3d/ligo/plugin_max/max_to_ligo.cpp | 10 +- .../3d/object_viewer/animation_set_dlg.cpp | 10 +- .../nel/tools/3d/object_viewer/attrib_dlg.cpp | 6 +- code/nel/tools/3d/object_viewer/bin_op_dlg.h | 2 +- code/nel/tools/3d/object_viewer/edit_ex.cpp | 18 +-- code/nel/tools/3d/object_viewer/edit_ex.h | 2 +- .../3d/object_viewer/edit_morph_mesh_dlg.cpp | 2 +- .../tools/3d/object_viewer/editable_range.cpp | 6 +- .../tools/3d/object_viewer/emitter_dlg.cpp | 6 +- .../3d/object_viewer/global_wind_dlg.cpp | 8 +- .../3d/object_viewer/lb_extern_id_dlg.cpp | 14 +- .../object_viewer/located_bindable_dialog.cpp | 52 ++++---- .../3d/object_viewer/located_target_dlg.cpp | 6 +- .../nel/tools/3d/object_viewer/main_frame.cpp | 124 +++++++++--------- code/nel/tools/3d/object_viewer/mesh_dlg.cpp | 4 +- .../tools/3d/object_viewer/multi_tex_dlg.cpp | 32 ++--- .../tools/3d/object_viewer/object_viewer.cpp | 46 +++---- .../tools/3d/object_viewer/object_viewer.h | 42 +++--- .../tools/3d/object_viewer/particle_dlg.cpp | 4 +- .../3d/object_viewer/particle_system_edit.cpp | 38 +++--- .../3d/object_viewer/particle_tree_ctrl.cpp | 18 +-- .../nel/tools/3d/object_viewer/pick_sound.cpp | 2 +- .../precomputed_rotations_dlg.cpp | 6 +- .../tools/3d/object_viewer/ps_mover_dlg.cpp | 26 ++-- .../tools/3d/object_viewer/range_selector.cpp | 4 +- .../3d/object_viewer/scheme_bank_dlg.cpp | 8 +- .../3d/object_viewer/skeleton_scale_dlg.cpp | 20 +-- .../3d/object_viewer/snapshot_tool_dlg.cpp | 68 +++++----- .../3d/object_viewer/snapshot_tool_dlg.h | 2 +- .../3d/object_viewer/sound_anim_view.cpp | 4 +- .../tools/3d/object_viewer/sound_system.cpp | 4 +- .../start_stop_particle_system.cpp | 4 +- .../3d/object_viewer/texture_anim_dlg.cpp | 4 +- .../3d/object_viewer/value_gradient_dlg.cpp | 6 +- .../3d/object_viewer/vegetable_copy_dlg.cpp | 2 +- .../object_viewer/vegetable_density_page.cpp | 10 +- .../plugin_max/nel_mesh_lib/export_misc.cpp | 4 +- .../3d/plugin_max/nel_mesh_lib/export_nel.h | 4 +- 38 files changed, 318 insertions(+), 310 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 6eb8d1301..46a9a64c3 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 @@ -124,17 +124,17 @@ bool CMaxToLigo::loadLigoConfigFile (CLigoConfig& config, Interface& it, bool di if (hModule) { // Get the path - char sModulePath[256]; + TCHAR sModulePath[256]; int res=GetModuleFileName(hModule, sModulePath, 256); // Success ? if (res) { // Path - char sDrive[256]; - char sDir[256]; - _splitpath (sModulePath, sDrive, sDir, NULL, NULL); - _makepath (sModulePath, sDrive, sDir, "ligoscape", ".cfg"); + TCHAR sDrive[256]; + TCHAR sDir[256]; + _tsplitpath (sModulePath, sDrive, sDir, NULL, NULL); + _tmakepath (sModulePath, sDrive, sDir, _T("ligoscape"), _T(".cfg")); try { diff --git a/code/nel/tools/3d/object_viewer/animation_set_dlg.cpp b/code/nel/tools/3d/object_viewer/animation_set_dlg.cpp index 1553aa882..fc95e2ded 100644 --- a/code/nel/tools/3d/object_viewer/animation_set_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/animation_set_dlg.cpp @@ -132,8 +132,8 @@ void CAnimationSetDlg::OnAddAnimation () while (*c) { // File name - char filename[256]; - char *ptr=filename; + TCHAR filename[256]; + TCHAR *ptr=filename; // Read a file name while (*c) @@ -173,8 +173,8 @@ void CAnimationSetDlg::OnAddSkelWt() if (instance != CB_ERR) { // TODO: Add your control notification handler code here - static char BASED_CODE szFilter[] = "NeL Skeleton Weight Template Files (*.swt)|*.swt|All Files (*.*)|*.*||"; - CFileDialog fileDlg( TRUE, ".swt", "*.swt", OFN_ALLOWMULTISELECT|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter); + static TCHAR BASED_CODE szFilter[] = _T("NeL Skeleton Weight Template Files (*.swt)|*.swt|All Files (*.*)|*.*||"); + CFileDialog fileDlg( TRUE, _T(".swt"), _T("*.swt"), OFN_ALLOWMULTISELECT|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter); if (fileDlg.DoModal()==IDOK) { // Open the file @@ -372,7 +372,7 @@ void CAnimationSetDlg::refresh (BOOL update) for (i=0; iSaved.PlayList.size(); i++) { // Insert an intem - char text[512]; + TCHAR text[512]; PlayList.GetText( i, text); object->Saved.PlayList[i] = text; } diff --git a/code/nel/tools/3d/object_viewer/attrib_dlg.cpp b/code/nel/tools/3d/object_viewer/attrib_dlg.cpp index a70216a43..bfce1dd3a 100644 --- a/code/nel/tools/3d/object_viewer/attrib_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/attrib_dlg.cpp @@ -683,7 +683,7 @@ END_MESSAGE_MAP() { CString out; - out.Format("%g", Scheme->getValue(index) ); + out.Format(_T("%g"), Scheme->getValue(index) ); dc->TextOut(x + 10, y + 4, out); } CEditAttribDlg *newDialog(const std::string &id, IPSWrapperFloat *wrapper) @@ -896,7 +896,7 @@ END_MESSAGE_MAP() { CString out; - out.Format("%d", Scheme->getValue(index) ); + out.Format(_T("%d"), Scheme->getValue(index) ); dc->TextOut(x + 10, y + 4, out); } CEditAttribDlg *newDialog(const std::string &id, IPSWrapperUInt *wrapper) @@ -1085,7 +1085,7 @@ END_MESSAGE_MAP() { CString out; - out.Format("%d", Scheme->getValue(index) ); + out.Format(_T("%d"), Scheme->getValue(index) ); dc->TextOut(x + 10, y + 4, out); } CEditAttribDlg *newDialog(const std::string &id, IPSWrapper *wrapper) diff --git a/code/nel/tools/3d/object_viewer/bin_op_dlg.h b/code/nel/tools/3d/object_viewer/bin_op_dlg.h index a35e8ee6a..c0080c866 100644 --- a/code/nel/tools/3d/object_viewer/bin_op_dlg.h +++ b/code/nel/tools/3d/object_viewer/bin_op_dlg.h @@ -98,7 +98,7 @@ public: } // init the operator list box - static const char *ops[] = { "selectArg1", "selectArg2", "modulate", "add", "subtract" } ; + static const TCHAR *ops[] = { _T("selectArg1"), _T("selectArg2"), _T("modulate"), _T("add"), _T("subtract") }; for (k = 0 ; k < (uint) NL3D::CPSBinOp::last ; ++k) { // SchemeWrapper[k].S reference the atriobute maker being edited diff --git a/code/nel/tools/3d/object_viewer/edit_ex.cpp b/code/nel/tools/3d/object_viewer/edit_ex.cpp index 71d5b8907..2f77f2631 100644 --- a/code/nel/tools/3d/object_viewer/edit_ex.cpp +++ b/code/nel/tools/3d/object_viewer/edit_ex.cpp @@ -74,7 +74,7 @@ float CEditEx::getFloat() const std::string CEditEx::getString() const { - char buf[128]; + TCHAR buf[128]; GetWindowText(buf, sizeof(buf)); return std::string(buf); } @@ -82,28 +82,28 @@ std::string CEditEx::getString() const void CEditEx::setSInt(sint value) { nlassert(_Type == SIntType); - char buf[16]; - sprintf(buf, "%d", (int) value); + TCHAR buf[16]; + _tcprintf(buf, "%d", (int) value); setString(buf); } void CEditEx::setUInt(uint value) { nlassert(_Type == UIntType); - char buf[16]; - sprintf(buf, "%d", (int) value); + TCHAR buf[16]; + _tcprintf(buf, "%d", (int) value); setString(buf); } void CEditEx::setFloat(float value) { nlassert(_Type == FloatType); - char buf[16]; - sprintf(buf, "%g", (double) value); + TCHAR buf[16]; + _tcprintf(buf, "%g", (double) value); setString(buf); } -void CEditEx::setString(const char *value) +void CEditEx::setString(const TCHAR *value) { SetWindowText(value); } @@ -121,7 +121,7 @@ void CEditEx::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) } else { - MessageBox("Invalid value", "Error", MB_OK | MB_ICONEXCLAMATION); + MessageBox(_T("Invalid value"), _T("Error"), MB_OK | MB_ICONEXCLAMATION); } } CEdit::OnKeyDown(nChar, nRepCnt, nFlags); diff --git a/code/nel/tools/3d/object_viewer/edit_ex.h b/code/nel/tools/3d/object_viewer/edit_ex.h index 759b51f51..957960fcc 100644 --- a/code/nel/tools/3d/object_viewer/edit_ex.h +++ b/code/nel/tools/3d/object_viewer/edit_ex.h @@ -57,7 +57,7 @@ public: void setSInt(sint value); void setUInt(uint value); void setFloat(float value); - void setString(const char *value); + void setString(const TCHAR *value); // Overrides diff --git a/code/nel/tools/3d/object_viewer/edit_morph_mesh_dlg.cpp b/code/nel/tools/3d/object_viewer/edit_morph_mesh_dlg.cpp index 091e6413c..a9c461154 100644 --- a/code/nel/tools/3d/object_viewer/edit_morph_mesh_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/edit_morph_mesh_dlg.cpp @@ -81,7 +81,7 @@ void CEditMorphMeshDlg::init(CWnd *pParent) //==================================================================== bool CEditMorphMeshDlg::getShapeNameFromDlg(std::string &name) { - CFileDialog fd(TRUE, ".shape", "*.shape", 0, NULL, this); + CFileDialog fd(TRUE, _T(".shape"), _T("*.shape"), 0, NULL, this); if (fd.DoModal() == IDOK) { // Add to the path diff --git a/code/nel/tools/3d/object_viewer/editable_range.cpp b/code/nel/tools/3d/object_viewer/editable_range.cpp index b86b35a72..525d15ab7 100644 --- a/code/nel/tools/3d/object_viewer/editable_range.cpp +++ b/code/nel/tools/3d/object_viewer/editable_range.cpp @@ -185,12 +185,12 @@ static void concatEdit2Lines(CEdit &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]; n= edit.GetLine(0, tmp0, lineLen); tmp0[n]= 0; n= edit.GetLine(1, tmp1, lineLen); tmp1[n]= 0; // concat and update the CEdit. - edit.SetWindowText(strcat(tmp0, tmp1)); + edit.SetWindowText(_tcscat(tmp0, tmp1)); } diff --git a/code/nel/tools/3d/object_viewer/emitter_dlg.cpp b/code/nel/tools/3d/object_viewer/emitter_dlg.cpp index 175756c6d..5f81a84f0 100644 --- a/code/nel/tools/3d/object_viewer/emitter_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/emitter_dlg.cpp @@ -129,11 +129,11 @@ void CEmitterDlg::OnSelchangeEmittedType() { if (_Emitter->getOwner()->getOwner()->getBehaviourType() == NL3D::CParticleSystem::SpellFX || _Emitter->getOwner()->getOwner()->getBypassMaxNumIntegrationSteps()) { - MessageBox("Can't perform operation : the system is flagged with 'No max nb steps' or uses the preset 'Spell FX', and thus, should have a finite duration. This operation create a loop in the system, and so is forbidden.", "Error", MB_ICONEXCLAMATION); + MessageBox(_T("Can't perform operation : the system is flagged with 'No max nb steps' or uses the preset 'Spell FX', and thus, should have a finite duration. This operation create a loop in the system, and so is forbidden."), _T("Error"), MB_ICONEXCLAMATION); } else { - MessageBox("Loops with emitters are forbidden.", "Error", MB_ICONEXCLAMATION); + MessageBox(_T("Loops with emitters are forbidden."), _T("Error"), MB_ICONEXCLAMATION); } initEmittedType(); } @@ -267,7 +267,7 @@ BOOL CEmitterDlg::OnInitDialog() CStatic *s = new CStatic; pushWnd(s); - s->Create("Radius :", SS_LEFT, CRect(posX, posY + 10 , posX + 70, posY + 32), this); + s->Create(_T("Radius :"), SS_LEFT, CRect(posX, posY + 10 , posX + 70, posY + 32), this); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); 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 505f6c7b8..95f54acb7 100644 --- a/code/nel/tools/3d/object_viewer/global_wind_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/global_wind_dlg.cpp @@ -61,11 +61,11 @@ END_MESSAGE_MAP() void CGlobalWindDlg::updateView() { float a; - char str[256]; + TCHAR str[256]; // update Power. a= _ObjViewer->getGlobalWindPower(); - sprintf(str, "%.2f", a); + _tcprintf(str, "%.2f", a); StaticPower.SetWindowText(str); NLMISC::clamp(a, 0.f, 1.f); SliderPower.SetPos((sint)(a*NL_GLOBAL_WIND_SLIDER_RANGE)); @@ -113,11 +113,11 @@ void CGlobalWindDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) if( sliderCtrl==&SliderPower && nSBCode==SB_THUMBPOSITION || nSBCode==SB_THUMBTRACK) { float a; - char str[256]; + TCHAR str[256]; a= (float)nPos / NL_GLOBAL_WIND_SLIDER_RANGE; _ObjViewer->setGlobalWindPower(a); - sprintf(str, "%.2f", a); + _tcprintf(str, "%.2f", a); StaticPower.SetWindowText(str); } else diff --git a/code/nel/tools/3d/object_viewer/lb_extern_id_dlg.cpp b/code/nel/tools/3d/object_viewer/lb_extern_id_dlg.cpp index 4c49c326f..d5df57f39 100644 --- a/code/nel/tools/3d/object_viewer/lb_extern_id_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/lb_extern_id_dlg.cpp @@ -64,7 +64,7 @@ BOOL CLBExternIDDlg::OnInitDialog() if (_ID) { - char val[5]; + TCHAR val[5]; for (uint k = 0; k < 4; ++k) { #ifdef NL_LITTLE_ENDIAN @@ -102,13 +102,13 @@ void CLBExternIDDlg::OnEnableExternId() if (_ID == 0) { GetDlgItem(IDC_ID_VALUE)->EnableWindow(TRUE); - _ID = StringToID("NONE"); - GetDlgItem(IDC_ID_VALUE)->SetWindowText("NONE"); + _ID = StringToID("NONE"); + GetDlgItem(IDC_ID_VALUE)->SetWindowText(_T("NONE")); } else { GetDlgItem(IDC_ID_VALUE)->EnableWindow(FALSE); - GetDlgItem(IDC_ID_VALUE)->SetWindowText(""); + GetDlgItem(IDC_ID_VALUE)->SetWindowText(_T("")); _ID = 0; } } @@ -116,15 +116,15 @@ void CLBExternIDDlg::OnEnableExternId() void CLBExternIDDlg::OnChangeIdValue() { if (!((CButton *) GetDlgItem(IDC_ENABLE_EXTERN_ID))->GetCheck()) return; - char buf[6]; + TCHAR buf[6]; ::memset(buf, 0, 6); GetDlgItem(IDC_ID_VALUE)->GetWindowText(buf, 6); _ID = StringToID(buf); if (_ID) { GetDlgItem(IDOK)->EnableWindow(TRUE); - GetDlgItem(IDC_ENABLE_EXTERN_ID)->EnableWindow(TRUE); - if (::strlen(buf) > 4) + GetDlgItem(IDC_ENABLE_EXTERN_ID)->EnableWindow(TRUE); + if (::_tcslen(buf) > 4) { buf[4] = '\0'; GetDlgItem(IDC_ID_VALUE)->SetWindowText(buf); diff --git a/code/nel/tools/3d/object_viewer/located_bindable_dialog.cpp b/code/nel/tools/3d/object_viewer/located_bindable_dialog.cpp index 9d4d0a619..04cc31848 100644 --- a/code/nel/tools/3d/object_viewer/located_bindable_dialog.cpp +++ b/code/nel/tools/3d/object_viewer/located_bindable_dialog.cpp @@ -225,8 +225,8 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent) CStatic *s = new CStatic; pushWnd(s); _MotionBlurWnd.push_back(s); - s->Create("Fake motion blur coeff.", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); - s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); + s->Create(_T("Fake motion blur coeff."), SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); + s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); mbc->GetClientRect(&rect); yPos += rect.bottom + 3; @@ -239,7 +239,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent) s = new CStatic; pushWnd(s); _MotionBlurWnd.push_back(s); - s->Create("Fake motion blur threshold.", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); + s->Create(_T("Fake motion blur threshold."), SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); mbc->GetClientRect(&rect); @@ -262,8 +262,8 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent) rc->init(xPos + 140, yPos, this); CStatic *s = new CStatic; pushWnd(s); - s->Create("Radius cut.", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); - s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); + s->Create(_T("Radius cut."), SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); + s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); @@ -279,7 +279,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent) s = new CStatic; pushWnd(s); - s->Create("Nb segs", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); + s->Create(_T("Nb segs"), SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->ShowWindow(SW_SHOW); snbs->GetClientRect(&rect); @@ -293,7 +293,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent) uvd->init(xPos + 140, yPos, this); s = new CStatic; pushWnd(s); - s->Create("Texture U factor :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); + s->Create(_T("Texture U factor :"), SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->ShowWindow(SW_SHOW); uvd->GetClientRect(&rect); yPos += rect.bottom + 3; @@ -312,8 +312,8 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent) nbf->init(xPos + 140, yPos, this); CStatic *s = new CStatic; pushWnd(s); - s->Create("Nb fan lights :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); - s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); + s->Create(_T("Nb fan lights :"), SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); + s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); nbf->GetClientRect(&rect); @@ -327,7 +327,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent) nbf->init(xPos + 140, yPos, this); s = new CStatic; pushWnd(s); - s->Create("Phase smoothnes:", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); + s->Create(_T("Phase smoothnes:"), SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->ShowWindow(SW_SHOW); nbf->GetClientRect(&rect); @@ -340,7 +340,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent) nbfp->init(xPos + 140, yPos, this); s = new CStatic; pushWnd(s); - s->Create("Fan light speed :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); + s->Create(_T("Fan light speed :"), SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->ShowWindow(SW_SHOW); nbf->GetClientRect(&rect); @@ -353,7 +353,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent) nbfp->init(xPos + 140, yPos, this); s = new CStatic; pushWnd(s); - s->Create("Fan light intensity:", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); + s->Create(_T("Fan light intensity:"), SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->ShowWindow(SW_SHOW); nbf->GetClientRect(&rect); @@ -390,10 +390,10 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent) nbs->init(xPos + 140, yPos, this); CStatic *s = new CStatic; pushWnd(s); - s->Create("Nb segs :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); - s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); - s->ShowWindow(SW_SHOW); - + s->Create(_T("Nb segs :"), SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); + s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); + s->ShowWindow(SW_SHOW); + nbs->GetClientRect(&rect); yPos += rect.bottom + 3; @@ -475,8 +475,8 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent) uvd->init(xPos + 140, yPos, this); CStatic *s = new CStatic; pushWnd(s); - s->Create("Texture U factor :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); - s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); + s->Create(_T("Texture U factor :"), SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); + s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); uvd->GetClientRect(&rect); yPos += rect.bottom + 3; @@ -488,7 +488,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent) uvd->init(xPos + 140, yPos, this); s = new CStatic; pushWnd(s); - s->Create("Texture V factor :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); + s->Create(_T("Texture V factor :"), SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); uvd->GetClientRect(&rect); @@ -508,8 +508,8 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent) sd->init(xPos + 140, yPos, this); CStatic *s = new CStatic; pushWnd(s); - s->Create("Seg Duration :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); - s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); + s->Create(_T("Seg Duration :"), SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); + s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); sd->GetClientRect(&rect); yPos += rect.bottom + 3; @@ -749,12 +749,12 @@ static void concatEdit2Lines(CEdit &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]; n= edit.GetLine(0, tmp0, lineLen); tmp0[n]= 0; n= edit.GetLine(1, tmp1, lineLen); tmp1[n]= 0; // concat and update the CEdit. - edit.SetWindowText(strcat(tmp0, tmp1)); + edit.SetWindowText(_tcscat(tmp0, tmp1)); } //*************************************************************************************************************************** @@ -773,8 +773,8 @@ void CLocatedBindableDialog::updateZBias() CString caption; CString mess; caption.LoadString(IDS_CAPTION_ERROR); - mess.LoadString(IDS_BAD_ZBIAS); - m_ZBias.SetWindowText("0.00"); + mess.LoadString(IDS_BAD_ZBIAS); + m_ZBias.SetWindowText(_T("0.00")); MessageBox((LPCTSTR) mess, (LPCTSTR) caption, MB_ICONERROR); NLMISC::safe_cast(_Bindable)->setZBias(0); updateModifiedFlag(); diff --git a/code/nel/tools/3d/object_viewer/located_target_dlg.cpp b/code/nel/tools/3d/object_viewer/located_target_dlg.cpp index 9cb9fced1..1785fe892 100644 --- a/code/nel/tools/3d/object_viewer/located_target_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/located_target_dlg.cpp @@ -227,7 +227,7 @@ BOOL CLocatedTargetDlg::OnInitDialog() rv->init(posX + 140, posY, this); CStatic *s = new CStatic; pushWnd(s); - s->Create("Radial viscosity : ", SS_LEFT, CRect(posX, posY, posX + 139, posY + 32), this); + s->Create(_T("Radial viscosity : "), SS_LEFT, CRect(posX, posY, posX + 139, posY + 32), this); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); @@ -243,7 +243,7 @@ BOOL CLocatedTargetDlg::OnInitDialog() s = new CStatic; pushWnd(s); - s->Create("Tangential Viscosity : ", SS_LEFT, CRect(posX, posY, posX + 139, posY + 32), this); + s->Create(_T("Tangential Viscosity : "), SS_LEFT, CRect(posX, posY, posX + 139, posY + 32), this); s->ShowWindow(SW_SHOW); tv->GetClientRect(&r); @@ -273,7 +273,7 @@ BOOL CLocatedTargetDlg::OnInitDialog() rv->init(posX + 140, posY, this); CStatic *s = new CStatic; pushWnd(s); - s->Create("Parametric factor : ", SS_LEFT, CRect(posX, posY, posX + 139, posY + 40), this); + s->Create(_T("Parametric factor : "), SS_LEFT, CRect(posX, posY, posX + 139, posY + 40), this); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->ShowWindow(SW_SHOW); diff --git a/code/nel/tools/3d/object_viewer/main_frame.cpp b/code/nel/tools/3d/object_viewer/main_frame.cpp index d063e202d..696bcaab3 100644 --- a/code/nel/tools/3d/object_viewer/main_frame.cpp +++ b/code/nel/tools/3d/object_viewer/main_frame.cpp @@ -293,41 +293,41 @@ void CMainFrame::registerValue (bool read) DWORD len=sizeof (BOOL); DWORD type; NLMISC::CRGBA bgCol ; - RegQueryValueEx (hKey, "ViewAnimation", 0, &type, (LPBYTE)&AnimationWindow, &len); + RegQueryValueEx (hKey, _T("ViewAnimation"), 0, &type, (LPBYTE)&AnimationWindow, &len); len=sizeof (BOOL); - RegQueryValueEx (hKey, "ViewAnimationSet", 0, &type, (LPBYTE)&AnimationSetWindow, &len); + RegQueryValueEx (hKey, _T("ViewAnimationSet"), 0, &type, (LPBYTE)&AnimationSetWindow, &len); len=sizeof (BOOL); - RegQueryValueEx (hKey, "ViewSlots", 0, &type, (LPBYTE)&MixerSlotsWindow, &len); + RegQueryValueEx (hKey, _T("ViewSlots"), 0, &type, (LPBYTE)&MixerSlotsWindow, &len); len=sizeof (BOOL); - RegQueryValueEx (hKey, "ViewParticles", 0, &type, (LPBYTE)&ParticlesWindow, &len); + RegQueryValueEx (hKey, _T("ViewParticles"), 0, &type, (LPBYTE)&ParticlesWindow, &len); len=sizeof (BOOL); - RegQueryValueEx (hKey, "ViewDayNight", 0, &type, (LPBYTE)&DayNightWindow, &len); + RegQueryValueEx (hKey, _T("ViewDayNight"), 0, &type, (LPBYTE)&DayNightWindow, &len); len=sizeof (BOOL); - RegQueryValueEx (hKey, "ViewWaterPool", 0, &type, (LPBYTE)&WaterPoolWindow, &len); + RegQueryValueEx (hKey, _T("ViewWaterPool"), 0, &type, (LPBYTE)&WaterPoolWindow, &len); len=sizeof (BOOL); - RegQueryValueEx (hKey, "ViewVegetable", 0, &type, (LPBYTE)&VegetableWindow, &len); + RegQueryValueEx (hKey, _T("ViewVegetable"), 0, &type, (LPBYTE)&VegetableWindow, &len); len=sizeof (BOOL); - RegQueryValueEx (hKey, "ViewGlobalWind", 0, &type, (LPBYTE)&GlobalWindWindow, &len); + RegQueryValueEx (hKey, _T("ViewGlobalWind"), 0, &type, (LPBYTE)&GlobalWindWindow, &len); len=sizeof (BOOL); - RegQueryValueEx (hKey, "ViewSoundAnimWind", 0, &type, (LPBYTE)&GlobalWindWindow, &len); + RegQueryValueEx (hKey, _T("ViewSoundAnimWind"), 0, &type, (LPBYTE)&GlobalWindWindow, &len); len=sizeof (float); - RegQueryValueEx (hKey, "MoveSpeed", 0, &type, (LPBYTE)&MoveSpeed, &len); + RegQueryValueEx (hKey, _T("MoveSpeed"), 0, &type, (LPBYTE)&MoveSpeed, &len); len=sizeof (uint); - RegQueryValueEx (hKey, "ObjectMode", 0, &type, (LPBYTE)&MoveMode, &len); + RegQueryValueEx (hKey, _T("ObjectMode"), 0, &type, (LPBYTE)&MoveMode, &len); len=sizeof(NLMISC::CRGBA) ; - RegQueryValueEx (hKey, "BackGroundColor", 0, &type, (LPBYTE)&BgColor, &len); + RegQueryValueEx (hKey, _T("BackGroundColor"), 0, &type, (LPBYTE)&BgColor, &len); len=sizeof (float); - RegQueryValueEx (hKey, "GlobalWindPower", 0, &type, (LPBYTE)&GlobalWindPower, &len); + RegQueryValueEx (hKey, _T("GlobalWindPower"), 0, &type, (LPBYTE)&GlobalWindPower, &len); len=sizeof (BOOL); - RegQueryValueEx (hKey, "ViewChooseFrameDelay", 0, &type, (LPBYTE)&ChooseFrameDelayWindow, &len); + RegQueryValueEx (hKey, _T("ViewChooseFrameDelay"), 0, &type, (LPBYTE)&ChooseFrameDelayWindow, &len); len=sizeof (BOOL); - RegQueryValueEx (hKey, "ViewChooseBGColor", 0, &type, (LPBYTE)&ChooseBGColorWindow, &len); + RegQueryValueEx (hKey, _T("ViewChooseBGColor"), 0, &type, (LPBYTE)&ChooseBGColorWindow, &len); len=sizeof (BOOL); - RegQueryValueEx (hKey, "ViewChooseSunColor", 0, &type, (LPBYTE)&ChooseSunColorWindow, &len); + RegQueryValueEx (hKey, _T("ViewChooseSunColor"), 0, &type, (LPBYTE)&ChooseSunColorWindow, &len); len=sizeof (BOOL); - RegQueryValueEx (hKey, "ViewSkeletonScaleWindow", 0, &type, (LPBYTE)&SkeletonScaleWindow, &len); + RegQueryValueEx (hKey, _T("ViewSkeletonScaleWindow"), 0, &type, (LPBYTE)&SkeletonScaleWindow, &len); len=sizeof (BOOL); - RegQueryValueEx (hKey, "ViewTuneMRMWindow", 0, &type, (LPBYTE)&TuneMRMWindow, &len); + RegQueryValueEx (hKey, _T("ViewTuneMRMWindow"), 0, &type, (LPBYTE)&TuneMRMWindow, &len); } } else @@ -335,26 +335,26 @@ void CMainFrame::registerValue (bool read) HKEY hKey; if (RegCreateKey(HKEY_CURRENT_USER, REGKEY_OBJ_VIEW_SCENE_DLG, &hKey)==ERROR_SUCCESS) { - RegSetValueEx(hKey, "ViewAnimation", 0, REG_BINARY, (LPBYTE)&AnimationWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewAnimationSet", 0, REG_BINARY, (LPBYTE)&AnimationSetWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewSlots", 0, REG_BINARY, (LPBYTE)&MixerSlotsWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewParticles", 0, REG_BINARY, (LPBYTE)&ParticlesWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewDayNight", 0, REG_BINARY, (LPBYTE)&DayNightWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewWaterPool", 0, REG_BINARY, (LPBYTE)&WaterPoolWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewDayNight", 0, REG_BINARY, (LPBYTE)&DayNightWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewVegetable", 0, REG_BINARY, (LPBYTE)&VegetableWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewGlobalWind", 0, REG_BINARY, (LPBYTE)&GlobalWindWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewSoundAnimWind", 0, REG_BINARY, (LPBYTE)&SoundAnimWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewLightGroupWind", 0, REG_BINARY, (LPBYTE)&LightGroupWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewChooseFrameDelay", 0, REG_BINARY, (LPBYTE)&ChooseFrameDelayWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewChooseBGColor", 0, REG_BINARY, (LPBYTE)&ChooseBGColorWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewChooseSunColor", 0, REG_BINARY, (LPBYTE)&ChooseSunColorWindow, sizeof(bool)); - RegSetValueEx(hKey, "MoveSpeed", 0, REG_BINARY, (LPBYTE)&MoveSpeed, sizeof(float)); - RegSetValueEx(hKey, "ObjectMode", 0, REG_BINARY, (LPBYTE)&MoveMode, sizeof(uint)); - RegSetValueEx(hKey, "BackGroundColor", 0, REG_BINARY, (LPBYTE)&BgColor, sizeof(NLMISC::CRGBA)); - RegSetValueEx(hKey, "GlobalWindPower", 0, REG_BINARY, (LPBYTE)&GlobalWindPower, sizeof(float)); - RegSetValueEx(hKey, "ViewSkeletonScaleWindow", 0, REG_BINARY, (LPBYTE)&SkeletonScaleWindow, sizeof(bool)); - RegSetValueEx(hKey, "ViewTuneMRMWindow", 0, REG_BINARY, (LPBYTE)&TuneMRMWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewAnimation"), 0, REG_BINARY, (LPBYTE)&AnimationWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewAnimationSet"), 0, REG_BINARY, (LPBYTE)&AnimationSetWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewSlots"), 0, REG_BINARY, (LPBYTE)&MixerSlotsWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewParticles"), 0, REG_BINARY, (LPBYTE)&ParticlesWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewDayNight"), 0, REG_BINARY, (LPBYTE)&DayNightWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewWaterPool"), 0, REG_BINARY, (LPBYTE)&WaterPoolWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewDayNight"), 0, REG_BINARY, (LPBYTE)&DayNightWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewVegetable"), 0, REG_BINARY, (LPBYTE)&VegetableWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewGlobalWind"), 0, REG_BINARY, (LPBYTE)&GlobalWindWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewSoundAnimWind"), 0, REG_BINARY, (LPBYTE)&SoundAnimWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewLightGroupWind"), 0, REG_BINARY, (LPBYTE)&LightGroupWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewChooseFrameDelay"), 0, REG_BINARY, (LPBYTE)&ChooseFrameDelayWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewChooseBGColor"), 0, REG_BINARY, (LPBYTE)&ChooseBGColorWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewChooseSunColor"), 0, REG_BINARY, (LPBYTE)&ChooseSunColorWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("MoveSpeed"), 0, REG_BINARY, (LPBYTE)&MoveSpeed, sizeof(float)); + RegSetValueEx(hKey, _T("ObjectMode"), 0, REG_BINARY, (LPBYTE)&MoveMode, sizeof(uint)); + RegSetValueEx(hKey, _T("BackGroundColor"), 0, REG_BINARY, (LPBYTE)&BgColor, sizeof(NLMISC::CRGBA)); + RegSetValueEx(hKey, _T("GlobalWindPower"), 0, REG_BINARY, (LPBYTE)&GlobalWindPower, sizeof(float)); + RegSetValueEx(hKey, _T("ViewSkeletonScaleWindow"), 0, REG_BINARY, (LPBYTE)&SkeletonScaleWindow, sizeof(bool)); + RegSetValueEx(hKey, _T("ViewTuneMRMWindow"), 0, REG_BINARY, (LPBYTE)&TuneMRMWindow, sizeof(bool)); } } } @@ -568,8 +568,8 @@ void CMainFrame::OnFileLoadconfig() update (); // Create a dialog - static char BASED_CODE szFilter[] = "NeL Object viewer config (*.ovcgf)|*.ovcgf|All Files (*.*)|*.*||"; - CFileDialog fileDlg( TRUE, ".ovcgf", "*.ovcgf", OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter); + static TCHAR BASED_CODE szFilter[] = _T("NeL Object viewer config (*.ovcgf)|*.ovcgf|All Files (*.*)|*.*||"); + CFileDialog fileDlg( TRUE, _T(".ovcgf"), _T("*.ovcgf"), OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter); if (fileDlg.DoModal()==IDOK) { // Open the file @@ -598,9 +598,9 @@ void CMainFrame::OnFileLoadconfig() else { // Create a message - char msg[512]; - _snprintf (msg, 512, "Can't open the file %s for reading.", (const char*)fileDlg.GetPathName()); - MessageBox (msg, "NeL object viewer", MB_OK|MB_ICONEXCLAMATION); + CString msg; + msg.Format(_T("Can't open the file %s for reading."), (LPCTSTR)fileDlg.GetPathName()); + MessageBox (msg, _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION); } } } @@ -613,15 +613,15 @@ void CMainFrame::OnFileOpen() update (); // Create a dialog - static char BASED_CODE szFilter[] = - "All NeL Files (*.shape;*.ps;*.ig)\0*.shape;*.ps;*.ig\0" - "NeL Shape Files (*.shape)\0*.shape\0" - "NeL Particule System Files (*.ps)\0*.ps\0" - "NeL Instance Group Files (*.ig)\0*.ig\0" - "All Files (*.*)\0*.*\0\0"; + static TCHAR BASED_CODE szFilter[] = + _T("All NeL Files (*.shape;*.ps;*.ig)\0*.shape;*.ps;*.ig\0") + _T("NeL Shape Files (*.shape)\0*.shape\0") + _T("NeL Particule System Files (*.ps)\0*.ps\0") + _T("NeL Instance Group Files (*.ig)\0*.ig\0") + _T("All Files (*.*)\0*.*\0\0"); // Filename buffer - char buffer[65535]; + TCHAR buffer[65535]; buffer[0]=0; OPENFILENAME openFile; @@ -633,7 +633,7 @@ void CMainFrame::OnFileOpen() openFile.lpstrFile = buffer; openFile.nMaxFile = 65535; openFile.Flags = OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_ALLOWMULTISELECT|OFN_ENABLESIZING|OFN_EXPLORER; - openFile.lpstrDefExt = "*.shape;*.ig;*.ps"; + openFile.lpstrDefExt = _T("*.shape;*.ig;*.ps"); if (GetOpenFileName(&openFile)) @@ -642,7 +642,7 @@ void CMainFrame::OnFileOpen() std::vector meshFilename; // Filename pointer - char *c=buffer; + TCHAR *c=buffer; // Read the path CString path = buffer; @@ -682,7 +682,7 @@ void CMainFrame::OnFileOpen() CString name = path + filename; // file is an ig ? - if (name.Find(".ig") != -1) + if (name.Find(_T(".ig")) != -1) { // Load the instance group if (ObjView->loadInstanceGroup (name)) @@ -705,8 +705,8 @@ void CMainFrame::OnFileOpen() if ( !meshFilename.empty() ) { // Create a dialog for the skel - static char BASED_CODE szFilter2[] = "NeL Skeleton Files (*.skel)|*.skel|All Files (*.*)|*.*||"; - CFileDialog fileDlg2 ( TRUE, ".skel", "*.skel", OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter2); + static TCHAR BASED_CODE szFilter2[] = _T("NeL Skeleton Files (*.skel)|*.skel|All Files (*.*)|*.*||"); + CFileDialog fileDlg2 ( TRUE, _T(".skel"), _T("*.skel"), OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter2); if (fileDlg2.DoModal()==IDOK) { // Load the shape with a skeleton @@ -741,8 +741,8 @@ void CMainFrame::OnFileSaveconfig() update (); // Create a dialog - static char BASED_CODE szFilter[] = "NeL Object viewer config (*.ovcgf)|*.ovcgf|All Files (*.*)|*.*||"; - CFileDialog fileDlg( FALSE, ".ovcgf", "*.ovcgf", OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter); + static TCHAR BASED_CODE szFilter[] = _T("NeL Object viewer config (*.ovcgf)|*.ovcgf|All Files (*.*)|*.*||"); + CFileDialog fileDlg( FALSE, _T(".ovcgf"), _T("*.ovcgf"), OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter); if (fileDlg.DoModal()==IDOK) { ObjView->ParticleWorkspaceFilename = ""; @@ -770,9 +770,9 @@ void CMainFrame::OnFileSaveconfig() else { // Create a message - char msg[512]; - _snprintf (msg, 512, "Can't open the file %s for writing", (const char*)fileDlg.GetPathName()); - MessageBox (msg, "NeL object viewer", MB_OK|MB_ICONEXCLAMATION); + CString msg; + msg.Format(_T("Can't open the file %s for writing"), (LPCTSTR)fileDlg.GetPathName()); + MessageBox (msg, _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION); } } } @@ -1154,7 +1154,7 @@ void CMainFrame::OnHelpAboutobjectviewer() ///=========================================================================================== void CMainFrame::OnRemoveAllInstancesFromScene() { - if (MessageBox("Delete all instances from scene ?", "Object Viewer", MB_YESNO) == IDYES) + if (MessageBox(_T("Delete all instances from scene ?"), _T("Object Viewer"), MB_YESNO) == IDYES) { ObjView->removeAllInstancesFromScene(); @@ -1445,7 +1445,7 @@ void CMainFrame::OnUpdateSceneCamera(CCmdUI* pCmdUI) } else { - pCmdUI->SetText ("No camera"); + pCmdUI->SetText (_T("No camera")); } } diff --git a/code/nel/tools/3d/object_viewer/mesh_dlg.cpp b/code/nel/tools/3d/object_viewer/mesh_dlg.cpp index f0d62bd41..39bb75624 100644 --- a/code/nel/tools/3d/object_viewer/mesh_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/mesh_dlg.cpp @@ -90,7 +90,7 @@ void CMeshDlg::touchPSState() void CMeshDlg::OnBrowseShape() { - CFileDialog fd(TRUE, ".shape", "*.shape", 0, NULL, this); + CFileDialog fd(TRUE, _T(".shape"), _T("*.shape"), 0, NULL, this); if (fd.DoModal() == IDOK) { // Add to the path @@ -238,7 +238,7 @@ BOOL CMeshDlg::EnableWindow( BOOL bEnable) ///================================================================== void CMeshDlg::updateMeshErrorString() { - GetDlgItem(IDC_MESH_ERROR)->SetWindowText(""); + GetDlgItem(IDC_MESH_ERROR)->SetWindowText(_T("")); NL3D::CPSConstraintMesh *cm = dynamic_cast(_ShapeParticle); if (!cm) return; std::vector numVerts; 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 d2d08e2cc..118a2572b 100644 --- a/code/nel/tools/3d/object_viewer/multi_tex_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/multi_tex_dlg.cpp @@ -181,10 +181,10 @@ void CMultiTexDlg::readValues(bool alternate) } else { - GetDlgItem(IDC_U_SPEED_1_ALTERNATE)->SetWindowText(""); - GetDlgItem(IDC_V_SPEED_1_ALTERNATE)->SetWindowText(""); - GetDlgItem(IDC_U_SPEED_2_ALTERNATE)->SetWindowText(""); - GetDlgItem(IDC_V_SPEED_2_ALTERNATE)->SetWindowText(""); + GetDlgItem(IDC_U_SPEED_1_ALTERNATE)->SetWindowText(_T("")); + GetDlgItem(IDC_V_SPEED_1_ALTERNATE)->SetWindowText(_T("")); + GetDlgItem(IDC_U_SPEED_2_ALTERNATE)->SetWindowText(_T("")); + GetDlgItem(IDC_V_SPEED_2_ALTERNATE)->SetWindowText(_T("")); } } sprintf(buf, "%.3f", _MTP->getBumpFactor()); GetDlgItem(IDC_BUMP_FACTOR)->SetWindowText(buf); @@ -204,7 +204,7 @@ void CMultiTexDlg::updateBumpFactorEnabled() //====================================================== void CMultiTexDlg::writeValues(bool alternate) { - char u1[10], u2[10], v1[10], v2[10]; + TCHAR u1[10], u2[10], v1[10], v2[10]; NLMISC::CVector2f vs1, vs2; @@ -215,10 +215,10 @@ void CMultiTexDlg::writeValues(bool alternate) GetDlgItem(IDC_U_SPEED_2)->GetWindowText(u2, 10); GetDlgItem(IDC_V_SPEED_2)->GetWindowText(v2, 10); - if (sscanf(u1, "%f", &vs1.x) == 1 && - sscanf(v1, "%f", &vs1.y) == 1 && - sscanf(u2, "%f", &vs2.x) == 1 && - sscanf(v2, "%f", &vs2.y) == 1) + 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) { _MTP->setScrollSpeed(0, vs1); _MTP->setScrollSpeed(1, vs2); @@ -226,7 +226,7 @@ void CMultiTexDlg::writeValues(bool alternate) } else { - MessageBox("Invalid value(s)", "Error", MB_OK | MB_ICONEXCLAMATION); + MessageBox(_T("Invalid value(s)"), _T("Error"), MB_OK | MB_ICONEXCLAMATION); } } else @@ -237,10 +237,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 (sscanf(u1, "%f", &vs1.x) == 1 && - sscanf(v1, "%f", &vs1.y) == 1 && - sscanf(u2, "%f", &vs2.x) == 1 && - sscanf(v2, "%f", &vs2.y) == 1) + 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) { _MTP->setAlternateScrollSpeed(0, vs1); _MTP->setAlternateScrollSpeed(1, vs2); @@ -249,10 +249,10 @@ void CMultiTexDlg::writeValues(bool alternate) } } - char bumpFactorTxt[10]; + TCHAR bumpFactorTxt[10]; float bumpFactor; GetDlgItem(IDC_BUMP_FACTOR)->GetWindowText(bumpFactorTxt, 10); - if (sscanf(bumpFactorTxt, "%f", &bumpFactor) == 1) + if (_tcscanf(bumpFactorTxt, "%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 c6f163146..2cdba880c 100644 --- a/code/nel/tools/3d/object_viewer/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer/object_viewer.cpp @@ -281,7 +281,7 @@ std::string CObjectViewer::getModulePath() const HMODULE hModule = AfxGetInstanceHandle(); nlassert(hModule); // shouldn't be null now anymore in any case nlassert(hModule != GetModuleHandle(NULL)); // if this is dll, the module handle can't be same as exe - char sModulePath[256]; + TCHAR sModulePath[256]; int res = GetModuleFileName(hModule, sModulePath, 256); nlassert(res); nldebug("Object viewer module path is '%s'", sModulePath); _splitpath (sModulePath, SDrive, SDir, NULL, NULL); @@ -654,7 +654,7 @@ bool CObjectViewer::initUI (HWND parent) // Create the window _MainFrame->CFrameWnd::Create (AfxRegisterWndClass(0, 0, NULL, hIcon), - "NeL object viewer", 0x00cfc000, /*WS_OVERLAPPEDWINDOW,*/ CFrameWnd::rectDefault, parentWndPtr, + _T("NeL object viewer"), 0x00cfc000, /*WS_OVERLAPPEDWINDOW,*/ CFrameWnd::rectDefault, parentWndPtr, MAKEINTRESOURCE(IDR_OBJECT_VIEWER_MENU), 0x00000300 /*WS_EX_ACCEPTFILES*/ /*|WS_EX_CLIENTEDGE*/); // Detach the hwnd @@ -1316,13 +1316,13 @@ void CObjectViewer::go () { if(_VegetableLandscape != NULL) { - char vegetMsgBar[1024]; - sprintf (vegetMsgBar, "%d", _VegetableLandscape->Landscape.getNumVegetableFaceRendered()); + CString vegetMsgBar; + vegetMsgBar.Format(_T("%u"), _VegetableLandscape->Landscape.getNumVegetableFaceRendered()); _VegetableDlg->StaticPolyCount.SetWindowText(vegetMsgBar); } else { - _VegetableDlg->StaticPolyCount.SetWindowText("0"); + _VegetableDlg->StaticPolyCount.SetWindowText(_T("0")); } } @@ -1564,23 +1564,23 @@ void CObjectViewer::releaseUI () // *************************************************************************** -void setRegisterWindowState (const CWnd *pWnd, const char* keyName) +void setRegisterWindowState (const CWnd *pWnd, const TCHAR* keyName) { HKEY hKey; if (RegCreateKey(HKEY_CURRENT_USER, keyName, &hKey)==ERROR_SUCCESS) { RECT rect; pWnd->GetWindowRect (&rect); - RegSetValueEx(hKey, "Left", 0, REG_DWORD, (LPBYTE)&rect.left, 4); - RegSetValueEx(hKey, "Right", 0, REG_DWORD, (LPBYTE)&rect.right, 4); - RegSetValueEx(hKey, "Top", 0, REG_DWORD, (LPBYTE)&rect.top, 4); - RegSetValueEx(hKey, "Bottom", 0, REG_DWORD, (LPBYTE)&rect.bottom, 4); + RegSetValueEx(hKey, _T("Left"), 0, REG_DWORD, (LPBYTE)&rect.left, 4); + RegSetValueEx(hKey, _T("Right"), 0, REG_DWORD, (LPBYTE)&rect.right, 4); + RegSetValueEx(hKey, _T("Top"), 0, REG_DWORD, (LPBYTE)&rect.top, 4); + RegSetValueEx(hKey, _T("Bottom"), 0, REG_DWORD, (LPBYTE)&rect.bottom, 4); } } // *************************************************************************** -void getRegisterWindowState (CWnd *pWnd, const char* keyName, bool resize) +void getRegisterWindowState (CWnd *pWnd, const TCHAR* keyName, bool resize) { HKEY hKey; if (RegOpenKeyEx(HKEY_CURRENT_USER, keyName, 0, KEY_READ, &hKey)==ERROR_SUCCESS) @@ -1588,10 +1588,10 @@ void getRegisterWindowState (CWnd *pWnd, const char* keyName, bool resize) DWORD len=4; DWORD type; RECT rect; - RegQueryValueEx (hKey, "Left", 0, &type, (LPBYTE)&rect.left, &len); - RegQueryValueEx (hKey, "Right", 0, &type, (LPBYTE)&rect.right, &len); - RegQueryValueEx (hKey, "Top", 0, &type, (LPBYTE)&rect.top, &len); - RegQueryValueEx (hKey, "Bottom", 0, &type, (LPBYTE)&rect.bottom, &len); + RegQueryValueEx (hKey, _T("Left"), 0, &type, (LPBYTE)&rect.left, &len); + RegQueryValueEx (hKey, _T("Right"), 0, &type, (LPBYTE)&rect.right, &len); + RegQueryValueEx (hKey, _T("Top"), 0, &type, (LPBYTE)&rect.top, &len); + RegQueryValueEx (hKey, _T("Bottom"), 0, &type, (LPBYTE)&rect.bottom, &len); // Set window pos pWnd->SetWindowPos (NULL, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, SWP_NOOWNERZORDER|SWP_NOZORDER| @@ -2380,7 +2380,7 @@ IObjectViewer* IObjectViewer::getInterface (int version) // Check version number if (version!=OBJECT_VIEWER_VERSION) { - MessageBox (NULL, "Bad version of object_viewer.dll.", "NeL object viewer", MB_ICONEXCLAMATION|MB_OK); + MessageBox (NULL, _T("Bad version of object_viewer.dll."), _T("NeL object viewer"), MB_ICONEXCLAMATION|MB_OK); return NULL; } else @@ -2628,9 +2628,9 @@ void CObjectViewer::evalSoundTrack (float lastTime, float currentTime) { CEdit *edit = (CEdit*) _SoundAnimDlg->GetDlgItem(tab[i]); nlassert(edit); - char str[1024]; + TCHAR str[1024]; edit->GetLine(0, str, 1024); - SoundContext.Args[i] = atoi (str); + SoundContext.Args[i] = _ttoi (str); } // get the position of the skel if a skel is available @@ -3113,7 +3113,7 @@ bool CObjectViewer::createVegetableLandscape() // Load The Bank files (copied from CLandscapeUser :) ). // ================ // progress - dlgProgress.ProgressText.SetWindowText("Loading TileBanks..."); + dlgProgress.ProgressText.SetWindowText(_T("Loading TileBanks...")); dlgProgress.ProgressBar.SetPos(0); // load CIFile bankFile(CPath::lookup(_VegetableLandscapeTileBank)); @@ -3140,7 +3140,7 @@ bool CObjectViewer::createVegetableLandscape() if(CNELU::Driver) { // progress - dlgProgress.ProgressText.SetWindowText("Loading Tiles..."); + dlgProgress.ProgressText.SetWindowText(_T("Loading Tiles...")); dlgProgress.ProgressBar.SetPos(0); // count nbText to load. @@ -3195,7 +3195,7 @@ bool CObjectViewer::createVegetableLandscape() bool zoneLoaded= false; CAABBox landscapeBBox; // progress - dlgProgress.ProgressText.SetWindowText("Loading Zones..."); + dlgProgress.ProgressText.SetWindowText(_T("Loading Zones...")); dlgProgress.ProgressBar.SetPos(0); uint nbZones= (uint)_VegetableLandscapeZoneNames.size(); for(uint i=0; i 1000 -#define REGKEY_OBJ_VIEW "Software\\Nevrax\\nel\\object_viewer" -#define REGKEY_OBJ_VIEW_OPENGL_WND "Software\\Nevrax\\nel\\object_viewer\\opengl_wnd" -#define REGKEY_OBJ_VIEW_SCENE_DLG "Software\\Nevrax\\nel\\object_viewer\\scene_dlg" -#define REGKEY_OBJ_VIEW_ANIMATION_DLG "Software\\Nevrax\\nel\\object_viewer\\animation_dlg" -#define REGKEY_OBJ_VIEW_ANIMATION_SET_DLG "Software\\Nevrax\\nel\\object_viewer\\animation_set_dlg" -#define REGKEY_OBJ_VIEW_SLOT_DLG "Software\\Nevrax\\nel\\object_viewer\\slot_dlg" -#define REGKEY_OBJ_PARTICLE_DLG "Software\\Nevrax\\nel\\object_viewer\\particle_dlg" -#define REGKEY_OBJ_DAYNIGHT_DLG "Software\\Nevrax\\nel\\object_viewer\\daynight_dlg" -#define REGKEY_OBJ_WATERPOOL_DLG "Software\\Nevrax\\nel\\object_viewer\\daynight_dlg" -#define REGKEY_OBJ_VIEW_VEGETABLE_DLG "Software\\Nevrax\\nel\\object_viewer\\vegetable_dlg" -#define REGKEY_OBJ_GLOBAL_WIND_DLG "Software\\Nevrax\\nel\\object_viewer\\global_wind_dlg" -#define REGKEY_OBJ_SOUND_ANIM_DLG "Software\\Nevrax\\nel\\object_viewer\\sound_anim_dlg" -#define REGKEY_OBJ_LIGHT_GROUP_DLG "Software\\Nevrax\\nel\\object_viewer\\light_group_dlg" -#define REGKEY_CHOOSE_FRAME_DELAY_DLG "Software\\Nevrax\\nel\\object_viewer\\choose_frame_delay_dlg" -#define REGKEY_CHOOSE_BG_COLOR_DLG "Software\\Nevrax\\nel\\object_viewer\\choose_bg_color_dlg" -#define REGKEY_CHOOSE_SUN_COLOR_DLG "Software\\Nevrax\\nel\\object_viewer\\choose_sun_color_dlg" -#define REGKEY_SKELETON_SCALE_DLG "Software\\Nevrax\\nel\\object_viewer\\skeleton_scale_dlg" -#define REGKEY_TUNE_MRM_DLG "Software\\Nevrax\\nel\\object_viewer\\tune_mrm_dlg" +#define REGKEY_OBJ_VIEW _T("Software\\Nevrax\\nel\\object_viewer") +#define REGKEY_OBJ_VIEW_OPENGL_WND _T("Software\\Nevrax\\nel\\object_viewer\\opengl_wnd") +#define REGKEY_OBJ_VIEW_SCENE_DLG _T("Software\\Nevrax\\nel\\object_viewer\\scene_dlg") +#define REGKEY_OBJ_VIEW_ANIMATION_DLG _T("Software\\Nevrax\\nel\\object_viewer\\animation_dlg") +#define REGKEY_OBJ_VIEW_ANIMATION_SET_DLG _T("Software\\Nevrax\\nel\\object_viewer\\animation_set_dlg") +#define REGKEY_OBJ_VIEW_SLOT_DLG _T("Software\\Nevrax\\nel\\object_viewer\\slot_dlg") +#define REGKEY_OBJ_PARTICLE_DLG _T("Software\\Nevrax\\nel\\object_viewer\\particle_dlg") +#define REGKEY_OBJ_DAYNIGHT_DLG _T("Software\\Nevrax\\nel\\object_viewer\\daynight_dlg") +#define REGKEY_OBJ_WATERPOOL_DLG _T("Software\\Nevrax\\nel\\object_viewer\\daynight_dlg") +#define REGKEY_OBJ_VIEW_VEGETABLE_DLG _T("Software\\Nevrax\\nel\\object_viewer\\vegetable_dlg") +#define REGKEY_OBJ_GLOBAL_WIND_DLG _T("Software\\Nevrax\\nel\\object_viewer\\global_wind_dlg") +#define REGKEY_OBJ_SOUND_ANIM_DLG _T("Software\\Nevrax\\nel\\object_viewer\\sound_anim_dlg") +#define REGKEY_OBJ_LIGHT_GROUP_DLG _T("Software\\Nevrax\\nel\\object_viewer\\light_group_dlg") +#define REGKEY_CHOOSE_FRAME_DELAY_DLG _T("Software\\Nevrax\\nel\\object_viewer\\choose_frame_delay_dlg") +#define REGKEY_CHOOSE_BG_COLOR_DLG _T("Software\\Nevrax\\nel\\object_viewer\\choose_bg_color_dlg") +#define REGKEY_CHOOSE_SUN_COLOR_DLG _T("Software\\Nevrax\\nel\\object_viewer\\choose_sun_color_dlg") +#define REGKEY_SKELETON_SCALE_DLG _T("Software\\Nevrax\\nel\\object_viewer\\skeleton_scale_dlg") +#define REGKEY_TUNE_MRM_DLG _T("Software\\Nevrax\\nel\\object_viewer\\tune_mrm_dlg") @@ -650,8 +650,8 @@ private: void drawNamedMatrix(const NLMISC::CMatrix &matrix, const std::string &name, NLMISC::CRGBA color, float textZOffset, float testSize); }; -void setRegisterWindowState (const CWnd *pWnd, const char* keyName); -void getRegisterWindowState (CWnd *pWnd, const char* keyName, bool resize); +void setRegisterWindowState (const CWnd *pWnd, const TCHAR* keyName); +void getRegisterWindowState (CWnd *pWnd, const TCHAR* keyName, bool resize); /** display a localized message box. Caption an message text are retrieved from the string table * \param parentWindow Pointer to initiator of the message box @@ -661,7 +661,7 @@ void getRegisterWindowState (CWnd *pWnd, const char* keyName, bool resize); * \return Same value than ::MessageBox */ int localizedMessageBox(HWND parentWindow, int messageStringID, int captionStringID, UINT nType); -int localizedMessageBox(HWND parentWindow, const char *message, int captionStringID, UINT nType); +int localizedMessageBox(HWND parentWindow, const TCHAR *message, int captionStringID, UINT nType); // Return a string from the string table CString getStrRsc(uint stringID); diff --git a/code/nel/tools/3d/object_viewer/particle_dlg.cpp b/code/nel/tools/3d/object_viewer/particle_dlg.cpp index f56bfa1dd..a84f60349 100644 --- a/code/nel/tools/3d/object_viewer/particle_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/particle_dlg.cpp @@ -563,8 +563,8 @@ void CParticleDlg::OnCreateNewPsWorkspace() void CParticleDlg::OnLoadPSWorkspace() { checkModifiedWorkSpace(); - static const char BASED_CODE szFilter[] = "particle workspaces(*.pws)|*.pws||"; - CFileDialog fd( TRUE, ".pws", "*.pws", 0, szFilter); + static const TCHAR BASED_CODE szFilter[] = _T("particle workspaces(*.pws)|*.pws||"); + CFileDialog fd( TRUE, _T(".pws"), _T("*.pws"), 0, szFilter); INT_PTR result = fd.DoModal(); if (result != IDOK) return; loadWorkspace((LPCTSTR) fd.GetPathName()); 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 248a5cd1e..b3d29c589 100644 --- a/code/nel/tools/3d/object_viewer/particle_system_edit.cpp +++ b/code/nel/tools/3d/object_viewer/particle_system_edit.cpp @@ -34,12 +34,12 @@ static void concatEdit2Lines(CEdit &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]; n= edit.GetLine(0, tmp0, lineLen); tmp0[n]= 0; n= edit.GetLine(1, tmp1, lineLen); tmp1[n]= 0; // concat and update the CEdit. - edit.SetWindowText(strcat(tmp0, tmp1)); + edit.SetWindowText(_tcscat(tmp0, tmp1)); } @@ -221,14 +221,16 @@ void CParticleSystemEdit::updateDieOnEventParams() ew = FALSE; } GetDlgItem(IDC_APPLY_AFTER_DELAY)->EnableWindow(ew); - char out[128]; + + CString out; + if (_Node->getPSPointer()->getDelayBeforeDeathConditionTest() >= 0) { - sprintf(out, "%.2g", _Node->getPSPointer()->getDelayBeforeDeathConditionTest()); + out.Format(_T("%.2g"), _Node->getPSPointer()->getDelayBeforeDeathConditionTest()); } else { - strcpy(out,"???"); + out = _T("???"); } GetDlgItem(IDC_APPLY_AFTER_DELAY)->SetWindowText(out); ((CButton *) GetDlgItem(IDC_AUTO_DELAY))->SetCheck(autoDelay ? 1 : 0); @@ -394,13 +396,14 @@ void CParticleSystemEdit::OnEnableSlowDown() void CParticleSystemEdit::updateBBoxFromText() { NLMISC::CVector h; - char inX[128], inY[128], inZ[128]; + TCHAR inX[128], inY[128], inZ[128]; m_BBoxXCtrl.GetWindowText(inX, 128); m_BBoxYCtrl.GetWindowText(inY, 128); m_BBoxZCtrl.GetWindowText(inZ, 128); - if (sscanf(inX, "%f", &h.x) == 1 - && sscanf(inY, "%f", &h.y) == 1 - && sscanf(inZ, "%f", &h.z) == 1 + + if (_tcscanf(inX, "%f", &h.x) == 1 + && _tcscanf(inY, "%f", &h.y) == 1 + && _tcscanf(inZ, "%f", &h.z) == 1 ) { NLMISC::CAABBox b; @@ -409,7 +412,7 @@ void CParticleSystemEdit::updateBBoxFromText() } else { - MessageBox("Invalid entry","error", MB_OK); + MessageBox(_T("Invalid entry"), _T("error"), MB_OK); } } @@ -456,11 +459,12 @@ void CParticleSystemEdit::OnDieWhenOutOfFrustum() void CParticleSystemEdit::OnChangeApplyAfterDelay() { if (_Node->getPSPointer()->getAutoComputeDelayBeforeDeathConditionTest()) return; - // - char in[128]; - GetDlgItem(IDC_APPLY_AFTER_DELAY)->GetWindowText(in, 128); + + TCHAR in[128]; + GetDlgItem(IDC_APPLY_AFTER_DELAY)->GetWindowText(in, 128); + float value; - if (sscanf(in, "%f", &value) == 1) + if (_tcscanf(in, "%f", &value) == 1) { if (_Node->getPSPointer()->getDelayBeforeDeathConditionTest() != value) { @@ -728,7 +732,7 @@ void CParticleSystemEdit::OnEnableLoadBalancing() UpdateData(TRUE); if (m_EnableLoadBalancing == FALSE) { - int result = MessageBox("Are you sure ?", "Load balancing on/off", MB_OKCANCEL); + int result = MessageBox(_T("Are you sure ?"), _T("Load balancing on/off"), MB_OKCANCEL); if (result == IDOK) { _Node->getPSPointer()->enableLoadBalancing(false); @@ -791,7 +795,7 @@ void CParticleSystemEdit::OnBypassMaxNumSteps() UpdateData(TRUE); if (m_BypassMaxNumSteps && !_Node->getPSPointer()->canFinish()) { - MessageBox("The system must have a finite duration for this setting! Please check that.", "error", MB_ICONEXCLAMATION); + MessageBox(_T("The system must have a finite duration for this setting! Please check that."), _T("error"), MB_ICONEXCLAMATION); return; } _Node->getPSPointer()->setBypassMaxNumIntegrationSteps(m_BypassMaxNumSteps != FALSE); 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 9c58cd875..15c98d00b 100644 --- a/code/nel/tools/3d/object_viewer/particle_tree_ctrl.cpp +++ b/code/nel/tools/3d/object_viewer/particle_tree_ctrl.cpp @@ -165,7 +165,7 @@ void CParticleTreeCtrl::rebuildLocatedInstance(CParticleWorkspace::CNode &node) CNodeType *newNt = new CNodeType(loc, k); _NodeTypes.push_back(newNt); // bind located instance icon - InsertItem(TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM | TVIF_TEXT, "instance", PSIconLocatedInstance, PSIconLocatedInstance, 0, 0, (LPARAM) newNt, currLocated, TVI_LAST); + InsertItem(TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM | TVIF_TEXT, _T("instance"), PSIconLocatedInstance, PSIconLocatedInstance, 0, 0, (LPARAM) newNt, currLocated, TVI_LAST); } currLocated = GetNextItem(currLocated, TVGN_NEXT); } @@ -995,8 +995,8 @@ BOOL CParticleTreeCtrl::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHA case IDM_MERGE_PS: { _ParticleDlg->StartStopDlg->stop(); - static char BASED_CODE szFilter[] = "ps & shapes files(*.ps;*.shape)|*.ps; *.shape||"; - CFileDialog fd( TRUE, ".ps", "*.ps;*.shape", 0, szFilter); + static TCHAR BASED_CODE szFilter[] = _T("ps & shapes files(*.ps;*.shape)|*.ps; *.shape||"); + CFileDialog fd( TRUE, _T(".ps"), _T("*.ps;*.shape"), 0, szFilter); if (fd.DoModal() == IDOK) { @@ -1198,7 +1198,7 @@ BOOL CParticleTreeCtrl::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHA } if (!nt->Loc->bind(toCreate)) { - MessageBox("The system is flagged with 'No max Nb steps', or uses the preset 'Spell FX'. System must have finite duration. Can't add object. To solve this, set a limited life time for the father.", "Error", MB_ICONEXCLAMATION); + MessageBox(_T("The system is flagged with 'No max Nb steps', or uses the preset 'Spell FX'. System must have finite duration. Can't add object. To solve this, set a limited life time for the father."), _T("Error"), MB_ICONEXCLAMATION); delete toCreate; if (createLocAndBindable) { @@ -1528,11 +1528,11 @@ std::string CParticleTreeCtrl::computeCaption(CParticleWorkspace &workspace) //**************************************************************************************************************** void CParticleTreeCtrl::insertNewPS(CParticleWorkspace &pws) { - static const char BASED_CODE szFilter[] = "NeL Particle systems (*.ps)|*.ps||"; - CFileDialog fd(TRUE, ".ps", "*.ps", OFN_ALLOWMULTISELECT|OFN_FILEMUSTEXIST, szFilter, this); + static const TCHAR BASED_CODE szFilter[] = _T("NeL Particle systems (*.ps)|*.ps||"); + CFileDialog fd(TRUE, _T(".ps"), _T("*.ps"), OFN_ALLOWMULTISELECT|OFN_FILEMUSTEXIST, szFilter, this); const uint MAX_NUM_CHAR = 65536; - char filenamesBuf[MAX_NUM_CHAR]; - strcpy(filenamesBuf, "*.ps"); + TCHAR filenamesBuf[MAX_NUM_CHAR]; + _tcscpy(filenamesBuf, _T("*.ps")); fd.m_ofn.lpstrFile = filenamesBuf; fd.m_ofn.nMaxFile = MAX_NUM_CHAR - 1; if (fd.DoModal() == IDOK) @@ -1744,7 +1744,7 @@ void CParticleTreeCtrl::OnBeginlabeledit(NMHDR* pNMHDR, LRESULT* pResult) { if (!nt->PS->isLoaded()) { - pEdit->SetWindowText(""); + pEdit->SetWindowText(_T("")); //localizedMessageBox(*this, IDS_CANT_CHANGE_PS_NAME, IDS_ERROR, MB_OK|MB_ICONEXCLAMATION); } else diff --git a/code/nel/tools/3d/object_viewer/pick_sound.cpp b/code/nel/tools/3d/object_viewer/pick_sound.cpp index 280a65326..c2ecf9b9c 100644 --- a/code/nel/tools/3d/object_viewer/pick_sound.cpp +++ b/code/nel/tools/3d/object_viewer/pick_sound.cpp @@ -107,7 +107,7 @@ BOOL CPickSound::OnInitDialog() void CPickSound::OnSelchange() { UpdateData(); - char str[1024]; + TCHAR str[1024]; nlassert(m_NameList.GetTextLen(m_NameList.GetCurSel()) < 1024); m_NameList.GetText(m_NameList.GetCurSel(), str); diff --git a/code/nel/tools/3d/object_viewer/precomputed_rotations_dlg.cpp b/code/nel/tools/3d/object_viewer/precomputed_rotations_dlg.cpp index 21a1a2fac..3e8a1ecb7 100644 --- a/code/nel/tools/3d/object_viewer/precomputed_rotations_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/precomputed_rotations_dlg.cpp @@ -133,7 +133,7 @@ void CPrecomputedRotationsDlg::OnUpdateMinRotSpeed() } else { - MessageBox("invalid value !!"); + MessageBox(_T("invalid value !!")); } UpdateData(FALSE); updateModifiedFlag(); @@ -153,7 +153,7 @@ void CPrecomputedRotationsDlg::OnUpdateMaxRotSpeed() } else { - MessageBox("invalid value !!"); + MessageBox(_T("invalid value !!")); } UpdateData(FALSE); updateModifiedFlag(); @@ -178,7 +178,7 @@ void CPrecomputedRotationsDlg::OnUpdateNbModels() } else { - MessageBox("invalid value !!"); + MessageBox(_T("invalid value !!")); } UpdateData(FALSE); updateModifiedFlag(); diff --git a/code/nel/tools/3d/object_viewer/ps_mover_dlg.cpp b/code/nel/tools/3d/object_viewer/ps_mover_dlg.cpp index dce09b3dc..875af0557 100644 --- a/code/nel/tools/3d/object_viewer/ps_mover_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/ps_mover_dlg.cpp @@ -46,9 +46,9 @@ CPSMoverDlg::CPSMoverDlg(CParticleWorkspace::CNode *ownerNode, CWnd *parent, NL3 const NLMISC::CVector &pos = _EditedLocated->getPos()[_EditedLocatedIndex]; - m_X.Format("%.3g", pos.x); - m_Y.Format("%.3g", pos.y); - m_Z.Format("%.3g", pos.z); + m_X.Format(_T("%.3g"), pos.x); + m_Y.Format(_T("%.3g"), pos.y); + m_Z.Format(_T("%.3g"), pos.z); //{{AFX_DATA_INIT(CPSMoverDlg) //}}AFX_DATA_INIT @@ -84,9 +84,9 @@ void CPSMoverDlg::updatePosition(void) UpdateData(); const NLMISC::CVector &pos = _EditedLocated->getPos()[_EditedLocatedIndex]; - m_X.Format("%.3g", pos.x); - m_Y.Format("%.3g", pos.y); - m_Z.Format("%.3g", pos.z); + m_X.Format(_T("%.3g"), pos.x); + m_Y.Format(_T("%.3g"), pos.y); + m_Z.Format(_T("%.3g"), pos.z); UpdateData(FALSE); } @@ -127,7 +127,7 @@ void CPSMoverDlg::OnUpdateXpos() } else { - MessageBox("invalid entry", "error"); + MessageBox(_T("invalid entry"), _T("error")); } UpdateData(FALSE); } @@ -144,7 +144,7 @@ void CPSMoverDlg::OnUpdateYpos() } else { - MessageBox("invalid entry", "error"); + MessageBox(_T("invalid entry"), _T("error")); } UpdateData(FALSE); } @@ -161,7 +161,7 @@ void CPSMoverDlg::OnUpdateZpos() } else { - MessageBox("invalid entry", "error"); + MessageBox(_T("invalid entry"), _T("error")); } UpdateData(FALSE); } @@ -235,7 +235,7 @@ void CPSMoverDlg::createScaleControls(void) _Scale->init(100 + xPos, yPos, this); _ScaleText = new CStatic; - _ScaleText ->Create("Scale : ", SS_LEFT, CRect(xPos, yPos + 10, xPos + 60, yPos + 32), this); + _ScaleText ->Create(_T("Scale : "), SS_LEFT, CRect(xPos, yPos + 10, xPos + 60, yPos + 32), this); _ScaleText ->ShowWindow(SW_SHOW); _Scale->GetClientRect(&r); @@ -254,7 +254,7 @@ void CPSMoverDlg::createScaleControls(void) _XScale->GetClientRect(&r); _XScaleText = new CStatic; - _XScaleText ->Create("x Scale : ", SS_LEFT, CRect(xPos, yPos + 10, xPos + 60, yPos + 32), this); + _XScaleText ->Create(_T("x Scale : "), SS_LEFT, CRect(xPos, yPos + 10, xPos + 60, yPos + 32), this); _XScaleText ->ShowWindow(SW_SHOW); yPos += r.bottom; @@ -269,7 +269,7 @@ void CPSMoverDlg::createScaleControls(void) _YScaleText = new CStatic; - _YScaleText ->Create("y Scale : ", SS_LEFT, CRect(xPos, yPos + 10, xPos + 60, yPos + 32), this); + _YScaleText ->Create(_T("y Scale : "), SS_LEFT, CRect(xPos, yPos + 10, xPos + 60, yPos + 32), this); _YScaleText ->ShowWindow(SW_SHOW); yPos += r.bottom; @@ -283,7 +283,7 @@ void CPSMoverDlg::createScaleControls(void) _ZScale->GetClientRect(&r); _ZScaleText = new CStatic; - _ZScaleText ->Create("z Scale : ", SS_LEFT, CRect(xPos, yPos + 10, xPos + 60, yPos + 32), this); + _ZScaleText ->Create(_T("z Scale : "), SS_LEFT, CRect(xPos, yPos + 10, xPos + 60, yPos + 32), this); _ZScaleText ->ShowWindow(SW_SHOW); } diff --git a/code/nel/tools/3d/object_viewer/range_selector.cpp b/code/nel/tools/3d/object_viewer/range_selector.cpp index dca002b13..d809c7d11 100644 --- a/code/nel/tools/3d/object_viewer/range_selector.cpp +++ b/code/nel/tools/3d/object_viewer/range_selector.cpp @@ -32,8 +32,8 @@ CRangeSelector::CRangeSelector(const CString &lowerBound, const CString &upperBo : CDialog(CRangeSelector::IDD, pParent), _EditableRange(er) { //{{AFX_DATA_INIT(CRangeSelector) - m_LowerBound = _T(lowerBound); - m_UpperBound = _T(upperBound); + m_LowerBound = lowerBound; + m_UpperBound = upperBound; //}}AFX_DATA_INIT } diff --git a/code/nel/tools/3d/object_viewer/scheme_bank_dlg.cpp b/code/nel/tools/3d/object_viewer/scheme_bank_dlg.cpp index 65d1b8205..9d2b7594b 100644 --- a/code/nel/tools/3d/object_viewer/scheme_bank_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/scheme_bank_dlg.cpp @@ -93,8 +93,8 @@ void CSchemeBankDlg::buildList() void CSchemeBankDlg::OnSaveBank() { - static char BASED_CODE szFilter[] = "scheme bank files(*.scb)|*.scb||"; - CFileDialog fd( FALSE, NULL, "default.scb", 0, szFilter); + static TCHAR BASED_CODE szFilter[] = _T("scheme bank files(*.scb)|*.scb||"); + CFileDialog fd( FALSE, NULL, _T("default.scb"), 0, szFilter); if (fd.DoModal() == IDOK) { @@ -124,8 +124,8 @@ void CSchemeBankDlg::OnSaveBank() void CSchemeBankDlg::OnLoadBank() { - static char BASED_CODE szFilter[] = "scheme bank files(*.scb)|*.scb||"; - CFileDialog fd( TRUE, NULL, "*.scb", 0, szFilter); + static TCHAR BASED_CODE szFilter[] = _T("scheme bank files(*.scb)|*.scb||"); + CFileDialog fd( TRUE, NULL, _T("*.scb"), 0, szFilter); if (fd.DoModal() == IDOK) { diff --git a/code/nel/tools/3d/object_viewer/skeleton_scale_dlg.cpp b/code/nel/tools/3d/object_viewer/skeleton_scale_dlg.cpp index ed26b024f..d2f710136 100644 --- a/code/nel/tools/3d/object_viewer/skeleton_scale_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/skeleton_scale_dlg.cpp @@ -216,8 +216,8 @@ void CSkeletonScaleDlg::setSkeletonToEdit(NL3D::CSkeletonModel *skel, const std { _ScaleSliders[i]->SetRange(0, NL_SSD_SLIDER_SIZE); _ScaleSliders[i]->SetPos(NL_SSD_SLIDER_SIZE/2); - *_ScaleEdits[i]= ""; - _StaticScaleMarkers[i]->SetWindowText("100%"); + _ScaleEdits[i]->Empty(); + _StaticScaleMarkers[i]->SetWindowText(_T("100%")); } // ensure no problem with scale and ALT-TAB _SliderEdited= SidNone; @@ -338,7 +338,7 @@ void CSkeletonScaleDlg::onSliderReleased(TScaleId sid) // And reset the slider _ScaleSliders[_SliderEdited]->SetPos(NL_SSD_SLIDER_SIZE/2); - _StaticScaleMarkers[_SliderEdited]->SetWindowText("100%"); + _StaticScaleMarkers[_SliderEdited]->SetWindowText(_T("100%")); _SliderEdited= SidNone; // push an undo/redo only at release of slide. push the value of scale before slide @@ -592,12 +592,12 @@ static void concatEdit2Lines(CEdit &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]; n= edit.GetLine(0, tmp0, lineLen); tmp0[n]= 0; n= edit.GetLine(1, tmp1, lineLen); tmp1[n]= 0; // concat and update the CEdit. - edit.SetWindowText(strcat(tmp0, tmp1)); + edit.SetWindowText(_tcscat(tmp0, tmp1)); } @@ -1236,7 +1236,7 @@ void CSkeletonScaleDlg::OnSsdButtonSaveScale() } else { - MessageBox("Failed to open file for write!"); + MessageBox(_T("Failed to open file for write!")); } } } @@ -1262,7 +1262,7 @@ void CSkeletonScaleDlg::OnSsdButtonLoadScale() } else { - MessageBox("Failed to open file for read!"); + MessageBox(_T("Failed to open file for read!")); } } } @@ -1309,7 +1309,7 @@ bool CSkeletonScaleDlg::saveSkelScaleInStream(NLMISC::IStream &f) } catch(NLMISC::EStream &) { - MessageBox("Failed to save file!"); + MessageBox(_T("Failed to save file!")); return false; } @@ -1355,7 +1355,7 @@ bool CSkeletonScaleDlg::loadSkelScaleFromStream(NLMISC::IStream &f) } catch(NLMISC::EStream &) { - MessageBox("Failed to save file!"); + MessageBox(_T("Failed to save file!")); return false; } 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 6c212b53e..4bbd58e26 100644 --- a/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.cpp @@ -109,7 +109,7 @@ void CSnapshotToolDlg::DoDataExchange(CDataExchange* pDX) } //**************************************************************************************** -void CSnapshotToolDlg::stringFromRegistry(HKEY hKey, const char *name, CString &dest, const CString &defaultStr) +void CSnapshotToolDlg::stringFromRegistry(HKEY hKey, const TCHAR *name, CString &dest, const CString &defaultStr) { DWORD type; DWORD size; @@ -132,7 +132,7 @@ void CSnapshotToolDlg::stringFromRegistry(HKEY hKey, const char *name, CString & //**************************************************************************************** -template void integralTypeFromRegistry(HKEY hKey, const char *name, T &dest, const U &defaultValue) +template void integralTypeFromRegistry(HKEY hKey, const TCHAR *name, T &dest, const U &defaultValue) { if (hKey == 0) { @@ -163,8 +163,9 @@ void CSnapshotToolDlg::fromRegistry() { HKEY hKey = 0; RegOpenKeyEx(HKEY_CURRENT_USER, NEL_OV_SNAPSHOT_TOOL_REGKEY, 0, KEY_READ, &hKey); - stringFromRegistry(hKey, "InputPath", m_InputPath, ""); - stringFromRegistry(hKey, "OutputPath", m_OutputPath, ""); + stringFromRegistry(hKey, _T("InputPath"), m_InputPath, ""); + stringFromRegistry(hKey, _T("OutputPath"), m_OutputPath, ""); + CString filters; stringFromRegistry(hKey, "Filters", filters, "*.shape"); std::string stdFilters((LPCTSTR) filters); @@ -176,19 +177,19 @@ void CSnapshotToolDlg::fromRegistry() m_Filters.AddString(filterList[k].c_str()); } - integralTypeFromRegistry(hKey, "RecurseSubFolder", (int &) m_RecurseSubFolder, FALSE); - integralTypeFromRegistry(hKey, "DumpTextureSets", (int &) m_DumpTextureSets, TRUE); - integralTypeFromRegistry(hKey, "PostFixViewName", (int &) m_PostFixViewName, TRUE); - integralTypeFromRegistry(hKey, "ViewBack", (int &) m_ViewBack, FALSE); - integralTypeFromRegistry(hKey, "ViewBottom", (int &) m_ViewBottom, FALSE); - integralTypeFromRegistry(hKey, "ViewFront", (int &) m_ViewFront, TRUE); - integralTypeFromRegistry(hKey, "ViewLeft", (int &) m_ViewLeft, FALSE); - integralTypeFromRegistry(hKey, "ViewRight", (int &) m_ViewRight, FALSE); - integralTypeFromRegistry(hKey, "ViewTop", (int &) m_ViewTop, FALSE); - integralTypeFromRegistry(hKey, "OutputWidth", m_OutputWidth, 128); - integralTypeFromRegistry(hKey, "OutputHeight", m_OutputHeight, 128); - integralTypeFromRegistry(hKey, "Format", m_Format, 0); - integralTypeFromRegistry(hKey, "OutputPathOption", m_OutputPathOption, 1); + integralTypeFromRegistry(hKey, _T("RecurseSubFolder"), (int &) m_RecurseSubFolder, FALSE); + integralTypeFromRegistry(hKey, _T("DumpTextureSets"), (int &) m_DumpTextureSets, TRUE); + integralTypeFromRegistry(hKey, _T("PostFixViewName"), (int &) m_PostFixViewName, TRUE); + integralTypeFromRegistry(hKey, _T("ViewBack"), (int &) m_ViewBack, FALSE); + integralTypeFromRegistry(hKey, _T("ViewBottom"), (int &) m_ViewBottom, FALSE); + integralTypeFromRegistry(hKey, _T("ViewFront"), (int &) m_ViewFront, TRUE); + integralTypeFromRegistry(hKey, _T("ViewLeft"), (int &) m_ViewLeft, FALSE); + integralTypeFromRegistry(hKey, _T("ViewRight"), (int &) m_ViewRight, FALSE); + integralTypeFromRegistry(hKey, _T("ViewTop"), (int &) m_ViewTop, FALSE); + integralTypeFromRegistry(hKey, _T("OutputWidth"), m_OutputWidth, 128); + integralTypeFromRegistry(hKey, _T("OutputHeight"), m_OutputHeight, 128); + integralTypeFromRegistry(hKey, _T("Format"), m_Format, 0); + integralTypeFromRegistry(hKey, _T("OutputPathOption"), m_OutputPathOption, 1); UpdateData(FALSE); updateUIEnabledState(); } @@ -200,8 +201,8 @@ void CSnapshotToolDlg::toRegistry() HKEY hKey; if (RegCreateKey(HKEY_CURRENT_USER, NEL_OV_SNAPSHOT_TOOL_REGKEY, &hKey)==ERROR_SUCCESS) { - RegSetValueEx(hKey, "InputPath", 0, REG_SZ, (unsigned char *) (LPCTSTR) m_InputPath, m_InputPath.GetLength() + 1); - RegSetValueEx(hKey, "OutputPath", 0, REG_SZ, (unsigned char *) (LPCTSTR) m_OutputPath, m_OutputPath.GetLength() + 1); + RegSetValueEx(hKey, _T("InputPath"), 0, REG_SZ, (BYTE*) (LPCTSTR) m_InputPath, m_InputPath.GetLength() + 1); + RegSetValueEx(hKey, _T("OutputPath"), 0, REG_SZ, (BYTE*) (LPCTSTR) m_OutputPath, m_OutputPath.GetLength() + 1); CString filters; for (uint k = 0; k < (uint) m_Filters.GetCount(); ++k) { @@ -210,7 +211,8 @@ void CSnapshotToolDlg::toRegistry() m_Filters.GetText(k, filter); filters += filter; } - RegSetValueEx(hKey, "Filters", 0, REG_SZ, (unsigned char *) (LPCTSTR) filters, filters.GetLength() + 1); + + RegSetValueEx(hKey, _T("Filters"), 0, REG_SZ, (BYTE*) (LPCTSTR) filters, filters.GetLength() + 1); DWORD recurseSubFolder = m_RecurseSubFolder; DWORD dumpTextureSets = m_DumpTextureSets; DWORD views [] = @@ -227,19 +229,19 @@ void CSnapshotToolDlg::toRegistry() DWORD format = m_Format; DWORD outputPathOption = m_OutputPathOption; DWORD postFixViewName = m_PostFixViewName; - integralTypeFromRegistry(hKey, "PostFixViewName", (int &) m_PostFixViewName, TRUE); - RegSetValueEx(hKey, "ViewBack", 0, REG_DWORD, (const BYTE *) &m_ViewBack, sizeof(DWORD)); - RegSetValueEx(hKey, "ViewBottom", 0, REG_DWORD, (const BYTE *) &m_ViewBottom, sizeof(DWORD)); - RegSetValueEx(hKey, "ViewFront", 0, REG_DWORD, (const BYTE *) &m_ViewFront, sizeof(DWORD)); - RegSetValueEx(hKey, "ViewLeft", 0, REG_DWORD, (const BYTE *) &m_ViewLeft, sizeof(DWORD)); - RegSetValueEx(hKey, "ViewRight", 0, REG_DWORD, (const BYTE *) &m_ViewRight, sizeof(DWORD)); - RegSetValueEx(hKey, "ViewTop", 0, REG_DWORD, (const BYTE *) &m_ViewTop, sizeof(DWORD)); - RegSetValueEx(hKey, "RecurseSubFolder", 0, REG_DWORD, (const BYTE *) &recurseSubFolder, sizeof(DWORD)); - RegSetValueEx(hKey, "DumpTextureSets", 0, REG_DWORD, (const BYTE *) &dumpTextureSets, sizeof(DWORD)); - RegSetValueEx(hKey, "OutputWidth", 0, REG_DWORD, (const BYTE *) &width, sizeof(DWORD)); - RegSetValueEx(hKey, "OutputHeight", 0, REG_DWORD, (const BYTE *) &height, sizeof(DWORD)); - RegSetValueEx(hKey, "Format", 0, REG_DWORD, (const BYTE *) &format, sizeof(DWORD)); - RegSetValueEx(hKey, "OutputPathOption", 0, REG_DWORD, (const BYTE *) &outputPathOption, sizeof(DWORD)); + integralTypeFromRegistry(hKey, _T("PostFixViewName"), (int &) m_PostFixViewName, TRUE); + RegSetValueEx(hKey, _T("ViewBack"), 0, REG_DWORD, (const BYTE *) &m_ViewBack, sizeof(DWORD)); + RegSetValueEx(hKey, _T("ViewBottom"), 0, REG_DWORD, (const BYTE *) &m_ViewBottom, sizeof(DWORD)); + RegSetValueEx(hKey, _T("ViewFront"), 0, REG_DWORD, (const BYTE *) &m_ViewFront, sizeof(DWORD)); + RegSetValueEx(hKey, _T("ViewLeft"), 0, REG_DWORD, (const BYTE *) &m_ViewLeft, sizeof(DWORD)); + RegSetValueEx(hKey, _T("ViewRight"), 0, REG_DWORD, (const BYTE *) &m_ViewRight, sizeof(DWORD)); + RegSetValueEx(hKey, _T("ViewTop"), 0, REG_DWORD, (const BYTE *) &m_ViewTop, sizeof(DWORD)); + RegSetValueEx(hKey, _T("RecurseSubFolder"), 0, REG_DWORD, (const BYTE *) &recurseSubFolder, sizeof(DWORD)); + RegSetValueEx(hKey, _T("DumpTextureSets"), 0, REG_DWORD, (const BYTE *) &dumpTextureSets, sizeof(DWORD)); + RegSetValueEx(hKey, _T("OutputWidth"), 0, REG_DWORD, (const BYTE *) &width, sizeof(DWORD)); + RegSetValueEx(hKey, _T("OutputHeight"), 0, REG_DWORD, (const BYTE *) &height, sizeof(DWORD)); + RegSetValueEx(hKey, _T("Format"), 0, REG_DWORD, (const BYTE *) &format, sizeof(DWORD)); + RegSetValueEx(hKey, _T("OutputPathOption"), 0, REG_DWORD, (const BYTE *) &outputPathOption, sizeof(DWORD)); } } 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 c696163d5..72df1dea5 100644 --- a/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.h +++ b/code/nel/tools/3d/object_viewer/snapshot_tool_dlg.h @@ -137,7 +137,7 @@ private: void fromRegistry(); // Save the options chosen in the snapshot tool ui into the registry. void toRegistry(); - void stringFromRegistry(HKEY hKey, const char *name, CString &dest, const CString &defaultStr); + void stringFromRegistry(HKEY hKey, const TCHAR *name, CString &dest, const CString &defaultStr); void updateUIEnabledState(); static void setCamFromView(uint view, NL3D::CCamera *cam, const NLMISC::CAABBox &bbox); diff --git a/code/nel/tools/3d/object_viewer/sound_anim_view.cpp b/code/nel/tools/3d/object_viewer/sound_anim_view.cpp index 84998ad81..5f0b6ee92 100644 --- a/code/nel/tools/3d/object_viewer/sound_anim_view.cpp +++ b/code/nel/tools/3d/object_viewer/sound_anim_view.cpp @@ -67,7 +67,7 @@ bool CSoundAnimView::registerClass() _WndClass = AfxRegisterWndClass(CS_VREDRAW | CS_HREDRAW, ::LoadCursor(NULL, IDC_ARROW), (HBRUSH) ::GetStockObject(WHITE_BRUSH)); // Do some additional initialization of static veriables - _Font.CreateFont(14, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "Arial"); + _Font.CreateFont(14, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); _FillBrush.CreateSolidBrush(RGB(230, 245, 245)); _MarkerBrush.CreateSolidBrush(RGB(0, 0, 0)); _SelectBrush.CreateSolidBrush(RGB(0, 210, 210)); @@ -113,7 +113,7 @@ void CSoundAnimView::Create(CObjectViewer* objView, CAnimationDlg* animDlg, CSou } - CWnd::Create((LPCTSTR) _WndClass, "Sound Animation", WS_CHILD | WS_VISIBLE, rect, (CWnd*) sndDlg, ++_WndId); + CWnd::Create((LPCTSTR) _WndClass, _T("Sound Animation"), WS_CHILD | WS_VISIBLE, rect, (CWnd*) sndDlg, ++_WndId); } // ******************************************************** diff --git a/code/nel/tools/3d/object_viewer/sound_system.cpp b/code/nel/tools/3d/object_viewer/sound_system.cpp index 69e10ea18..e1c3495fb 100644 --- a/code/nel/tools/3d/object_viewer/sound_system.cpp +++ b/code/nel/tools/3d/object_viewer/sound_system.cpp @@ -178,7 +178,7 @@ void CSoundSystem::play(const string &soundName) } else { - MessageBox(NULL, "Can't play the sound (perhaps it's contextual sound)", "warning", MB_OK|MB_ICONWARNING ); + MessageBox(NULL, _T("Can't play the sound (perhaps it's contextual sound)"), _T("warning"), MB_OK|MB_ICONWARNING ); } } } @@ -198,7 +198,7 @@ USource *CSoundSystem::create(const std::string &soundName) } else { - MessageBox(NULL, "Can't play the sound (perhaps it's contextual sound)", "warning", MB_OK|MB_ICONWARNING ); + MessageBox(NULL, _T("Can't play the sound (perhaps it's contextual sound)"), _T("warning"), MB_OK|MB_ICONWARNING ); } return NULL; } return NULL; diff --git a/code/nel/tools/3d/object_viewer/start_stop_particle_system.cpp b/code/nel/tools/3d/object_viewer/start_stop_particle_system.cpp index 450b8b714..0dde68dab 100644 --- a/code/nel/tools/3d/object_viewer/start_stop_particle_system.cpp +++ b/code/nel/tools/3d/object_viewer/start_stop_particle_system.cpp @@ -210,7 +210,7 @@ void CStartStopParticleSystem::updateUIFromState() if (!getCurrPS()) { GetDlgItem(IDC_ACTIVE_PS)->SetWindowText(getStrRsc(IDS_NO_ACTIVE_PS)); - GetDlgItem(IDC_STICK_BONE)->SetWindowText(""); + GetDlgItem(IDC_STICK_BONE)->SetWindowText(_T("")); GetDlgItem(IDC_ENABLE_AUTO_COUNT)->EnableWindow(FALSE); GetDlgItem(IDC_RESET_COUNT)->EnableWindow(FALSE); ((CButton *) GetDlgItem(IDC_ENABLE_AUTO_COUNT))->SetCheck(0); @@ -235,7 +235,7 @@ void CStartStopParticleSystem::updateUIFromState() } else { - GetDlgItem(IDC_STICK_BONE)->SetWindowText(""); + GetDlgItem(IDC_STICK_BONE)->SetWindowText(_T("")); } GetDlgItem(IDC_ACTIVE_PS)->SetWindowText(_ActiveNode->getFilename().c_str()); GetDlgItem(IDC_ENABLE_AUTO_COUNT)->EnableWindow(TRUE); diff --git a/code/nel/tools/3d/object_viewer/texture_anim_dlg.cpp b/code/nel/tools/3d/object_viewer/texture_anim_dlg.cpp index 31babe7b3..79a05ad8f 100644 --- a/code/nel/tools/3d/object_viewer/texture_anim_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/texture_anim_dlg.cpp @@ -332,13 +332,13 @@ void CTextureAnimDlg::CGradientInterface::CTextureWrapper::set(NL3D::ITexture *t if (t->getWidth() != tex->getWidth() || t->getHeight() != tex->getHeight()) { - ::MessageBox(NULL, "All textures must have the same size !", "error", MB_OK); + ::MessageBox(NULL, _T("All textures must have the same size !"), _T("error"), MB_OK); return; } if (t->PixelFormat != tex->PixelFormat) { - ::MessageBox(NULL, "All textures must have the same pixel format !", "error", MB_OK); + ::MessageBox(NULL, _T("All textures must have the same pixel format !"), _T("error"), MB_OK); return; } } diff --git a/code/nel/tools/3d/object_viewer/value_gradient_dlg.cpp b/code/nel/tools/3d/object_viewer/value_gradient_dlg.cpp index ccddc5833..5eff39642 100644 --- a/code/nel/tools/3d/object_viewer/value_gradient_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/value_gradient_dlg.cpp @@ -100,7 +100,7 @@ void CValueGradientDlg::OnAddValue() UpdateData(); ++_Size; _ClientInterface->modifyGradient(IValueGradientDlgClient::Add, 0); - m_GradientList.AddString("value"); + m_GradientList.AddString(_T("value")); m_RemoveCtrl.EnableWindow(TRUE); m_GradientList.SetCurSel(_Size - 1); @@ -116,7 +116,7 @@ void CValueGradientDlg::OnInsertValue() uint oldIndex = m_GradientList.GetCurSel(); ++_Size; _ClientInterface->modifyGradient(IValueGradientDlgClient::Insert, m_GradientList.GetCurSel()); - m_GradientList.InsertString(m_GradientList.GetCurSel(), "value"); + m_GradientList.InsertString(m_GradientList.GetCurSel(), _T("value")); m_GradientList.Invalidate(); m_GradientList.SetCurSel(oldIndex); OnSelchangeGradientList(); @@ -185,7 +185,7 @@ BOOL CValueGradientDlg::OnInitDialog() m_GradientList.InitStorage(_Size, 16); for (uint k = 0; k < _Size; ++k) { - m_GradientList.AddString("value"); + m_GradientList.AddString(_T("value")); } m_RemoveCtrl.EnableWindow(_Size > _MinSize ? TRUE : FALSE); m_GradientList.SetCurSel(0); diff --git a/code/nel/tools/3d/object_viewer/vegetable_copy_dlg.cpp b/code/nel/tools/3d/object_viewer/vegetable_copy_dlg.cpp index 4e3162559..28fc3083c 100644 --- a/code/nel/tools/3d/object_viewer/vegetable_copy_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/vegetable_copy_dlg.cpp @@ -289,7 +289,7 @@ void CVegetableCopyDlg::OnOK() } else { - MessageBox("Select a vegetable to copy first", "Error", MB_OK | MB_ICONWARNING); + MessageBox(_T("Select a vegetable to copy first"), _T("Error"), MB_OK | MB_ICONWARNING); } } diff --git a/code/nel/tools/3d/object_viewer/vegetable_density_page.cpp b/code/nel/tools/3d/object_viewer/vegetable_density_page.cpp index 2465c4f83..f86a5bf43 100644 --- a/code/nel/tools/3d/object_viewer/vegetable_density_page.cpp +++ b/code/nel/tools/3d/object_viewer/vegetable_density_page.cpp @@ -198,8 +198,9 @@ void CVegetableDensityPage::updateViewAngleMin() sint pos= (sint)(angle/(NLMISC::Pi/2) * NL_VEGETABLE_EDIT_ANGLE_SLIDER_SIZE); NLMISC::clamp(pos, -NL_VEGETABLE_EDIT_ANGLE_SLIDER_SIZE, NL_VEGETABLE_EDIT_ANGLE_SLIDER_SIZE); AngleMinSlider.SetPos(pos); - char stmp[256]; - sprintf(stmp, "%.2f", (double)(angle*180/NLMISC::Pi)); + + CString stmp; + stmp.Format(_T("%.2f"), (double)(angle*180/NLMISC::Pi)); AngleMinEdit.SetWindowText(stmp); } @@ -213,8 +214,9 @@ void CVegetableDensityPage::updateViewAngleMax() sint pos= (sint)(angle/(NLMISC::Pi/2) * NL_VEGETABLE_EDIT_ANGLE_SLIDER_SIZE); NLMISC::clamp(pos, -NL_VEGETABLE_EDIT_ANGLE_SLIDER_SIZE, NL_VEGETABLE_EDIT_ANGLE_SLIDER_SIZE); AngleMaxSlider.SetPos(pos); - char stmp[256]; - sprintf(stmp, "%.2f", (double)(angle*180/NLMISC::Pi)); + + CString stmp; + stmp.Format(_T("%.2f"), (double)(angle * 180 / NLMISC::Pi)); AngleMaxEdit.SetWindowText(stmp); } 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 5997006d5..71e497d03 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 @@ -1111,7 +1111,7 @@ static void restoreDecimalSeparator() ///======================================================================= -float toFloatMax(const char *src) +float toFloatMax(const TCHAR *src) { float result = 0.f; if (toFloatMax(src, result)) return result; @@ -1119,7 +1119,7 @@ float toFloatMax(const char *src) } -bool toFloatMax(const char *src, float &dest) +bool toFloatMax(const TCHAR *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 11e762099..7421fad49 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,9 +1092,9 @@ private: /** replacment for sprintf scanf (because of localisation in max) */ -float toFloatMax(const char *src); +float toFloatMax(const TCHAR *src); // Same as to float max, but returns true if succeed -bool toFloatMax(const char *src, float &dest); +bool toFloatMax(const TCHAR *src, float &dest); std::string toStringMax(float value); std::string toStringMax(int value);