Changed: Use _T macro and TCHAR to support UNICODE

This commit is contained in:
kervala 2016-11-17 10:55:21 +01:00
parent 68eb6448fb
commit a0b502c752
38 changed files with 318 additions and 310 deletions

View file

@ -124,17 +124,17 @@ bool CMaxToLigo::loadLigoConfigFile (CLigoConfig& config, Interface& it, bool di
if (hModule) if (hModule)
{ {
// Get the path // Get the path
char sModulePath[256]; TCHAR sModulePath[256];
int res=GetModuleFileName(hModule, sModulePath, 256); int res=GetModuleFileName(hModule, sModulePath, 256);
// Success ? // Success ?
if (res) if (res)
{ {
// Path // Path
char sDrive[256]; TCHAR sDrive[256];
char sDir[256]; TCHAR sDir[256];
_splitpath (sModulePath, sDrive, sDir, NULL, NULL); _tsplitpath (sModulePath, sDrive, sDir, NULL, NULL);
_makepath (sModulePath, sDrive, sDir, "ligoscape", ".cfg"); _tmakepath (sModulePath, sDrive, sDir, _T("ligoscape"), _T(".cfg"));
try try
{ {

View file

@ -132,8 +132,8 @@ void CAnimationSetDlg::OnAddAnimation ()
while (*c) while (*c)
{ {
// File name // File name
char filename[256]; TCHAR filename[256];
char *ptr=filename; TCHAR *ptr=filename;
// Read a file name // Read a file name
while (*c) while (*c)
@ -173,8 +173,8 @@ void CAnimationSetDlg::OnAddSkelWt()
if (instance != CB_ERR) if (instance != CB_ERR)
{ {
// TODO: Add your control notification handler code here // TODO: Add your control notification handler code here
static char BASED_CODE szFilter[] = "NeL Skeleton Weight Template Files (*.swt)|*.swt|All Files (*.*)|*.*||"; static TCHAR BASED_CODE szFilter[] = _T("NeL Skeleton Weight Template Files (*.swt)|*.swt|All Files (*.*)|*.*||");
CFileDialog fileDlg( TRUE, ".swt", "*.swt", OFN_ALLOWMULTISELECT|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter); CFileDialog fileDlg( TRUE, _T(".swt"), _T("*.swt"), OFN_ALLOWMULTISELECT|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter);
if (fileDlg.DoModal()==IDOK) if (fileDlg.DoModal()==IDOK)
{ {
// Open the file // Open the file
@ -372,7 +372,7 @@ void CAnimationSetDlg::refresh (BOOL update)
for (i=0; i<object->Saved.PlayList.size(); i++) for (i=0; i<object->Saved.PlayList.size(); i++)
{ {
// Insert an intem // Insert an intem
char text[512]; TCHAR text[512];
PlayList.GetText( i, text); PlayList.GetText( i, text);
object->Saved.PlayList[i] = text; object->Saved.PlayList[i] = text;
} }

View file

@ -683,7 +683,7 @@ END_MESSAGE_MAP()
{ {
CString out; CString out;
out.Format("%g", Scheme->getValue(index) ); out.Format(_T("%g"), Scheme->getValue(index) );
dc->TextOut(x + 10, y + 4, out); dc->TextOut(x + 10, y + 4, out);
} }
CEditAttribDlg *newDialog(const std::string &id, IPSWrapperFloat *wrapper) CEditAttribDlg *newDialog(const std::string &id, IPSWrapperFloat *wrapper)
@ -896,7 +896,7 @@ END_MESSAGE_MAP()
{ {
CString out; CString out;
out.Format("%d", Scheme->getValue(index) ); out.Format(_T("%d"), Scheme->getValue(index) );
dc->TextOut(x + 10, y + 4, out); dc->TextOut(x + 10, y + 4, out);
} }
CEditAttribDlg *newDialog(const std::string &id, IPSWrapperUInt *wrapper) CEditAttribDlg *newDialog(const std::string &id, IPSWrapperUInt *wrapper)
@ -1085,7 +1085,7 @@ END_MESSAGE_MAP()
{ {
CString out; CString out;
out.Format("%d", Scheme->getValue(index) ); out.Format(_T("%d"), Scheme->getValue(index) );
dc->TextOut(x + 10, y + 4, out); dc->TextOut(x + 10, y + 4, out);
} }
CEditAttribDlg *newDialog(const std::string &id, IPSWrapper<sint32> *wrapper) CEditAttribDlg *newDialog(const std::string &id, IPSWrapper<sint32> *wrapper)

View file

@ -98,7 +98,7 @@ public:
} }
// init the operator list box // 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) for (k = 0 ; k < (uint) NL3D::CPSBinOp::last ; ++k)
{ {
// SchemeWrapper[k].S reference the atriobute maker being edited // SchemeWrapper[k].S reference the atriobute maker being edited

View file

@ -74,7 +74,7 @@ float CEditEx::getFloat() const
std::string CEditEx::getString() const std::string CEditEx::getString() const
{ {
char buf[128]; TCHAR buf[128];
GetWindowText(buf, sizeof(buf)); GetWindowText(buf, sizeof(buf));
return std::string(buf); return std::string(buf);
} }
@ -82,28 +82,28 @@ std::string CEditEx::getString() const
void CEditEx::setSInt(sint value) void CEditEx::setSInt(sint value)
{ {
nlassert(_Type == SIntType); nlassert(_Type == SIntType);
char buf[16]; TCHAR buf[16];
sprintf(buf, "%d", (int) value); _tcprintf(buf, "%d", (int) value);
setString(buf); setString(buf);
} }
void CEditEx::setUInt(uint value) void CEditEx::setUInt(uint value)
{ {
nlassert(_Type == UIntType); nlassert(_Type == UIntType);
char buf[16]; TCHAR buf[16];
sprintf(buf, "%d", (int) value); _tcprintf(buf, "%d", (int) value);
setString(buf); setString(buf);
} }
void CEditEx::setFloat(float value) void CEditEx::setFloat(float value)
{ {
nlassert(_Type == FloatType); nlassert(_Type == FloatType);
char buf[16]; TCHAR buf[16];
sprintf(buf, "%g", (double) value); _tcprintf(buf, "%g", (double) value);
setString(buf); setString(buf);
} }
void CEditEx::setString(const char *value) void CEditEx::setString(const TCHAR *value)
{ {
SetWindowText(value); SetWindowText(value);
} }
@ -121,7 +121,7 @@ void CEditEx::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
} }
else else
{ {
MessageBox("Invalid value", "Error", MB_OK | MB_ICONEXCLAMATION); MessageBox(_T("Invalid value"), _T("Error"), MB_OK | MB_ICONEXCLAMATION);
} }
} }
CEdit::OnKeyDown(nChar, nRepCnt, nFlags); CEdit::OnKeyDown(nChar, nRepCnt, nFlags);

View file

@ -57,7 +57,7 @@ public:
void setSInt(sint value); void setSInt(sint value);
void setUInt(uint value); void setUInt(uint value);
void setFloat(float value); void setFloat(float value);
void setString(const char *value); void setString(const TCHAR *value);
// Overrides // Overrides

View file

@ -81,7 +81,7 @@ void CEditMorphMeshDlg::init(CWnd *pParent)
//==================================================================== //====================================================================
bool CEditMorphMeshDlg::getShapeNameFromDlg(std::string &name) 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) if (fd.DoModal() == IDOK)
{ {
// Add to the path // Add to the path

View file

@ -185,12 +185,12 @@ static void concatEdit2Lines(CEdit &edit)
const uint lineLen= 1000; const uint lineLen= 1000;
uint n; uint n;
// retrieve the 2 lines. // retrieve the 2 lines.
char tmp0[2*lineLen]; TCHAR tmp0[2*lineLen];
char tmp1[lineLen]; TCHAR tmp1[lineLen];
n= edit.GetLine(0, tmp0, lineLen); tmp0[n]= 0; n= edit.GetLine(0, tmp0, lineLen); tmp0[n]= 0;
n= edit.GetLine(1, tmp1, lineLen); tmp1[n]= 0; n= edit.GetLine(1, tmp1, lineLen); tmp1[n]= 0;
// concat and update the CEdit. // concat and update the CEdit.
edit.SetWindowText(strcat(tmp0, tmp1)); edit.SetWindowText(_tcscat(tmp0, tmp1));
} }

View file

@ -129,11 +129,11 @@ void CEmitterDlg::OnSelchangeEmittedType()
{ {
if (_Emitter->getOwner()->getOwner()->getBehaviourType() == NL3D::CParticleSystem::SpellFX || _Emitter->getOwner()->getOwner()->getBypassMaxNumIntegrationSteps()) 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 else
{ {
MessageBox("Loops with emitters are forbidden.", "Error", MB_ICONEXCLAMATION); MessageBox(_T("Loops with emitters are forbidden."), _T("Error"), MB_ICONEXCLAMATION);
} }
initEmittedType(); initEmittedType();
} }
@ -267,7 +267,7 @@ BOOL CEmitterDlg::OnInitDialog()
CStatic *s = new CStatic; CStatic *s = new CStatic;
pushWnd(s); 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->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)));
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);

View file

@ -61,11 +61,11 @@ END_MESSAGE_MAP()
void CGlobalWindDlg::updateView() void CGlobalWindDlg::updateView()
{ {
float a; float a;
char str[256]; TCHAR str[256];
// update Power. // update Power.
a= _ObjViewer->getGlobalWindPower(); a= _ObjViewer->getGlobalWindPower();
sprintf(str, "%.2f", a); _tcprintf(str, "%.2f", a);
StaticPower.SetWindowText(str); StaticPower.SetWindowText(str);
NLMISC::clamp(a, 0.f, 1.f); NLMISC::clamp(a, 0.f, 1.f);
SliderPower.SetPos((sint)(a*NL_GLOBAL_WIND_SLIDER_RANGE)); 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) if( sliderCtrl==&SliderPower && nSBCode==SB_THUMBPOSITION || nSBCode==SB_THUMBTRACK)
{ {
float a; float a;
char str[256]; TCHAR str[256];
a= (float)nPos / NL_GLOBAL_WIND_SLIDER_RANGE; a= (float)nPos / NL_GLOBAL_WIND_SLIDER_RANGE;
_ObjViewer->setGlobalWindPower(a); _ObjViewer->setGlobalWindPower(a);
sprintf(str, "%.2f", a); _tcprintf(str, "%.2f", a);
StaticPower.SetWindowText(str); StaticPower.SetWindowText(str);
} }
else else

View file

@ -64,7 +64,7 @@ BOOL CLBExternIDDlg::OnInitDialog()
if (_ID) if (_ID)
{ {
char val[5]; TCHAR val[5];
for (uint k = 0; k < 4; ++k) for (uint k = 0; k < 4; ++k)
{ {
#ifdef NL_LITTLE_ENDIAN #ifdef NL_LITTLE_ENDIAN
@ -103,12 +103,12 @@ void CLBExternIDDlg::OnEnableExternId()
{ {
GetDlgItem(IDC_ID_VALUE)->EnableWindow(TRUE); GetDlgItem(IDC_ID_VALUE)->EnableWindow(TRUE);
_ID = StringToID("NONE"); _ID = StringToID("NONE");
GetDlgItem(IDC_ID_VALUE)->SetWindowText("NONE"); GetDlgItem(IDC_ID_VALUE)->SetWindowText(_T("NONE"));
} }
else else
{ {
GetDlgItem(IDC_ID_VALUE)->EnableWindow(FALSE); GetDlgItem(IDC_ID_VALUE)->EnableWindow(FALSE);
GetDlgItem(IDC_ID_VALUE)->SetWindowText(""); GetDlgItem(IDC_ID_VALUE)->SetWindowText(_T(""));
_ID = 0; _ID = 0;
} }
} }
@ -116,7 +116,7 @@ void CLBExternIDDlg::OnEnableExternId()
void CLBExternIDDlg::OnChangeIdValue() void CLBExternIDDlg::OnChangeIdValue()
{ {
if (!((CButton *) GetDlgItem(IDC_ENABLE_EXTERN_ID))->GetCheck()) return; if (!((CButton *) GetDlgItem(IDC_ENABLE_EXTERN_ID))->GetCheck()) return;
char buf[6]; TCHAR buf[6];
::memset(buf, 0, 6); ::memset(buf, 0, 6);
GetDlgItem(IDC_ID_VALUE)->GetWindowText(buf, 6); GetDlgItem(IDC_ID_VALUE)->GetWindowText(buf, 6);
_ID = StringToID(buf); _ID = StringToID(buf);
@ -124,7 +124,7 @@ void CLBExternIDDlg::OnChangeIdValue()
{ {
GetDlgItem(IDOK)->EnableWindow(TRUE); GetDlgItem(IDOK)->EnableWindow(TRUE);
GetDlgItem(IDC_ENABLE_EXTERN_ID)->EnableWindow(TRUE); GetDlgItem(IDC_ENABLE_EXTERN_ID)->EnableWindow(TRUE);
if (::strlen(buf) > 4) if (::_tcslen(buf) > 4)
{ {
buf[4] = '\0'; buf[4] = '\0';
GetDlgItem(IDC_ID_VALUE)->SetWindowText(buf); GetDlgItem(IDC_ID_VALUE)->SetWindowText(buf);

View file

@ -225,7 +225,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
CStatic *s = new CStatic; CStatic *s = new CStatic;
pushWnd(s); pushWnd(s);
_MotionBlurWnd.push_back(s); _MotionBlurWnd.push_back(s);
s->Create("Fake motion blur coeff.", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); 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->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)));
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);
mbc->GetClientRect(&rect); mbc->GetClientRect(&rect);
@ -239,7 +239,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
s = new CStatic; s = new CStatic;
pushWnd(s); pushWnd(s);
_MotionBlurWnd.push_back(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->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)));
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);
mbc->GetClientRect(&rect); mbc->GetClientRect(&rect);
@ -262,7 +262,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
rc->init(xPos + 140, yPos, this); rc->init(xPos + 140, yPos, this);
CStatic *s = new CStatic; CStatic *s = new CStatic;
pushWnd(s); pushWnd(s);
s->Create("Radius cut.", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); 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->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)));
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);
@ -279,7 +279,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
s = new CStatic; s = new CStatic;
pushWnd(s); 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); s->ShowWindow(SW_SHOW);
snbs->GetClientRect(&rect); snbs->GetClientRect(&rect);
@ -293,7 +293,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
uvd->init(xPos + 140, yPos, this); uvd->init(xPos + 140, yPos, this);
s = new CStatic; s = new CStatic;
pushWnd(s); 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); s->ShowWindow(SW_SHOW);
uvd->GetClientRect(&rect); uvd->GetClientRect(&rect);
yPos += rect.bottom + 3; yPos += rect.bottom + 3;
@ -312,7 +312,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
nbf->init(xPos + 140, yPos, this); nbf->init(xPos + 140, yPos, this);
CStatic *s = new CStatic; CStatic *s = new CStatic;
pushWnd(s); pushWnd(s);
s->Create("Nb fan lights :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); 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->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)));
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);
@ -327,7 +327,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
nbf->init(xPos + 140, yPos, this); nbf->init(xPos + 140, yPos, this);
s = new CStatic; s = new CStatic;
pushWnd(s); 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); s->ShowWindow(SW_SHOW);
nbf->GetClientRect(&rect); nbf->GetClientRect(&rect);
@ -340,7 +340,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
nbfp->init(xPos + 140, yPos, this); nbfp->init(xPos + 140, yPos, this);
s = new CStatic; s = new CStatic;
pushWnd(s); 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); s->ShowWindow(SW_SHOW);
nbf->GetClientRect(&rect); nbf->GetClientRect(&rect);
@ -353,7 +353,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
nbfp->init(xPos + 140, yPos, this); nbfp->init(xPos + 140, yPos, this);
s = new CStatic; s = new CStatic;
pushWnd(s); 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); s->ShowWindow(SW_SHOW);
nbf->GetClientRect(&rect); nbf->GetClientRect(&rect);
@ -390,7 +390,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
nbs->init(xPos + 140, yPos, this); nbs->init(xPos + 140, yPos, this);
CStatic *s = new CStatic; CStatic *s = new CStatic;
pushWnd(s); 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->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)));
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);
@ -475,7 +475,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
uvd->init(xPos + 140, yPos, this); uvd->init(xPos + 140, yPos, this);
CStatic *s = new CStatic; CStatic *s = new CStatic;
pushWnd(s); 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->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT))); s->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)));
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);
uvd->GetClientRect(&rect); uvd->GetClientRect(&rect);
@ -488,7 +488,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
uvd->init(xPos + 140, yPos, this); uvd->init(xPos + 140, yPos, this);
s = new CStatic; s = new CStatic;
pushWnd(s); 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->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)));
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);
uvd->GetClientRect(&rect); uvd->GetClientRect(&rect);
@ -508,7 +508,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
sd->init(xPos + 140, yPos, this); sd->init(xPos + 140, yPos, this);
CStatic *s = new CStatic; CStatic *s = new CStatic;
pushWnd(s); pushWnd(s);
s->Create("Seg Duration :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this); 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->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)));
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);
sd->GetClientRect(&rect); sd->GetClientRect(&rect);
@ -749,12 +749,12 @@ static void concatEdit2Lines(CEdit &edit)
const uint lineLen= 1000; const uint lineLen= 1000;
uint n; uint n;
// retrieve the 2 lines. // retrieve the 2 lines.
char tmp0[2*lineLen]; TCHAR tmp0[2*lineLen];
char tmp1[lineLen]; TCHAR tmp1[lineLen];
n= edit.GetLine(0, tmp0, lineLen); tmp0[n]= 0; n= edit.GetLine(0, tmp0, lineLen); tmp0[n]= 0;
n= edit.GetLine(1, tmp1, lineLen); tmp1[n]= 0; n= edit.GetLine(1, tmp1, lineLen); tmp1[n]= 0;
// concat and update the CEdit. // concat and update the CEdit.
edit.SetWindowText(strcat(tmp0, tmp1)); edit.SetWindowText(_tcscat(tmp0, tmp1));
} }
//*************************************************************************************************************************** //***************************************************************************************************************************
@ -774,7 +774,7 @@ void CLocatedBindableDialog::updateZBias()
CString mess; CString mess;
caption.LoadString(IDS_CAPTION_ERROR); caption.LoadString(IDS_CAPTION_ERROR);
mess.LoadString(IDS_BAD_ZBIAS); mess.LoadString(IDS_BAD_ZBIAS);
m_ZBias.SetWindowText("0.00"); m_ZBias.SetWindowText(_T("0.00"));
MessageBox((LPCTSTR) mess, (LPCTSTR) caption, MB_ICONERROR); MessageBox((LPCTSTR) mess, (LPCTSTR) caption, MB_ICONERROR);
NLMISC::safe_cast<NL3D::CPSParticle *>(_Bindable)->setZBias(0); NLMISC::safe_cast<NL3D::CPSParticle *>(_Bindable)->setZBias(0);
updateModifiedFlag(); updateModifiedFlag();

View file

@ -227,7 +227,7 @@ BOOL CLocatedTargetDlg::OnInitDialog()
rv->init(posX + 140, posY, this); rv->init(posX + 140, posY, this);
CStatic *s = new CStatic; CStatic *s = new CStatic;
pushWnd(s); 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->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)));
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);
@ -243,7 +243,7 @@ BOOL CLocatedTargetDlg::OnInitDialog()
s = new CStatic; s = new CStatic;
pushWnd(s); 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); s->ShowWindow(SW_SHOW);
tv->GetClientRect(&r); tv->GetClientRect(&r);
@ -273,7 +273,7 @@ BOOL CLocatedTargetDlg::OnInitDialog()
rv->init(posX + 140, posY, this); rv->init(posX + 140, posY, this);
CStatic *s = new CStatic; CStatic *s = new CStatic;
pushWnd(s); 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->SetFont(CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT)));
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);

View file

@ -293,41 +293,41 @@ void CMainFrame::registerValue (bool read)
DWORD len=sizeof (BOOL); DWORD len=sizeof (BOOL);
DWORD type; DWORD type;
NLMISC::CRGBA bgCol ; NLMISC::CRGBA bgCol ;
RegQueryValueEx (hKey, "ViewAnimation", 0, &type, (LPBYTE)&AnimationWindow, &len); RegQueryValueEx (hKey, _T("ViewAnimation"), 0, &type, (LPBYTE)&AnimationWindow, &len);
len=sizeof (BOOL); len=sizeof (BOOL);
RegQueryValueEx (hKey, "ViewAnimationSet", 0, &type, (LPBYTE)&AnimationSetWindow, &len); RegQueryValueEx (hKey, _T("ViewAnimationSet"), 0, &type, (LPBYTE)&AnimationSetWindow, &len);
len=sizeof (BOOL); len=sizeof (BOOL);
RegQueryValueEx (hKey, "ViewSlots", 0, &type, (LPBYTE)&MixerSlotsWindow, &len); RegQueryValueEx (hKey, _T("ViewSlots"), 0, &type, (LPBYTE)&MixerSlotsWindow, &len);
len=sizeof (BOOL); len=sizeof (BOOL);
RegQueryValueEx (hKey, "ViewParticles", 0, &type, (LPBYTE)&ParticlesWindow, &len); RegQueryValueEx (hKey, _T("ViewParticles"), 0, &type, (LPBYTE)&ParticlesWindow, &len);
len=sizeof (BOOL); len=sizeof (BOOL);
RegQueryValueEx (hKey, "ViewDayNight", 0, &type, (LPBYTE)&DayNightWindow, &len); RegQueryValueEx (hKey, _T("ViewDayNight"), 0, &type, (LPBYTE)&DayNightWindow, &len);
len=sizeof (BOOL); len=sizeof (BOOL);
RegQueryValueEx (hKey, "ViewWaterPool", 0, &type, (LPBYTE)&WaterPoolWindow, &len); RegQueryValueEx (hKey, _T("ViewWaterPool"), 0, &type, (LPBYTE)&WaterPoolWindow, &len);
len=sizeof (BOOL); len=sizeof (BOOL);
RegQueryValueEx (hKey, "ViewVegetable", 0, &type, (LPBYTE)&VegetableWindow, &len); RegQueryValueEx (hKey, _T("ViewVegetable"), 0, &type, (LPBYTE)&VegetableWindow, &len);
len=sizeof (BOOL); len=sizeof (BOOL);
RegQueryValueEx (hKey, "ViewGlobalWind", 0, &type, (LPBYTE)&GlobalWindWindow, &len); RegQueryValueEx (hKey, _T("ViewGlobalWind"), 0, &type, (LPBYTE)&GlobalWindWindow, &len);
len=sizeof (BOOL); len=sizeof (BOOL);
RegQueryValueEx (hKey, "ViewSoundAnimWind", 0, &type, (LPBYTE)&GlobalWindWindow, &len); RegQueryValueEx (hKey, _T("ViewSoundAnimWind"), 0, &type, (LPBYTE)&GlobalWindWindow, &len);
len=sizeof (float); len=sizeof (float);
RegQueryValueEx (hKey, "MoveSpeed", 0, &type, (LPBYTE)&MoveSpeed, &len); RegQueryValueEx (hKey, _T("MoveSpeed"), 0, &type, (LPBYTE)&MoveSpeed, &len);
len=sizeof (uint); len=sizeof (uint);
RegQueryValueEx (hKey, "ObjectMode", 0, &type, (LPBYTE)&MoveMode, &len); RegQueryValueEx (hKey, _T("ObjectMode"), 0, &type, (LPBYTE)&MoveMode, &len);
len=sizeof(NLMISC::CRGBA) ; len=sizeof(NLMISC::CRGBA) ;
RegQueryValueEx (hKey, "BackGroundColor", 0, &type, (LPBYTE)&BgColor, &len); RegQueryValueEx (hKey, _T("BackGroundColor"), 0, &type, (LPBYTE)&BgColor, &len);
len=sizeof (float); len=sizeof (float);
RegQueryValueEx (hKey, "GlobalWindPower", 0, &type, (LPBYTE)&GlobalWindPower, &len); RegQueryValueEx (hKey, _T("GlobalWindPower"), 0, &type, (LPBYTE)&GlobalWindPower, &len);
len=sizeof (BOOL); len=sizeof (BOOL);
RegQueryValueEx (hKey, "ViewChooseFrameDelay", 0, &type, (LPBYTE)&ChooseFrameDelayWindow, &len); RegQueryValueEx (hKey, _T("ViewChooseFrameDelay"), 0, &type, (LPBYTE)&ChooseFrameDelayWindow, &len);
len=sizeof (BOOL); len=sizeof (BOOL);
RegQueryValueEx (hKey, "ViewChooseBGColor", 0, &type, (LPBYTE)&ChooseBGColorWindow, &len); RegQueryValueEx (hKey, _T("ViewChooseBGColor"), 0, &type, (LPBYTE)&ChooseBGColorWindow, &len);
len=sizeof (BOOL); len=sizeof (BOOL);
RegQueryValueEx (hKey, "ViewChooseSunColor", 0, &type, (LPBYTE)&ChooseSunColorWindow, &len); RegQueryValueEx (hKey, _T("ViewChooseSunColor"), 0, &type, (LPBYTE)&ChooseSunColorWindow, &len);
len=sizeof (BOOL); len=sizeof (BOOL);
RegQueryValueEx (hKey, "ViewSkeletonScaleWindow", 0, &type, (LPBYTE)&SkeletonScaleWindow, &len); RegQueryValueEx (hKey, _T("ViewSkeletonScaleWindow"), 0, &type, (LPBYTE)&SkeletonScaleWindow, &len);
len=sizeof (BOOL); len=sizeof (BOOL);
RegQueryValueEx (hKey, "ViewTuneMRMWindow", 0, &type, (LPBYTE)&TuneMRMWindow, &len); RegQueryValueEx (hKey, _T("ViewTuneMRMWindow"), 0, &type, (LPBYTE)&TuneMRMWindow, &len);
} }
} }
else else
@ -335,26 +335,26 @@ void CMainFrame::registerValue (bool read)
HKEY hKey; HKEY hKey;
if (RegCreateKey(HKEY_CURRENT_USER, REGKEY_OBJ_VIEW_SCENE_DLG, &hKey)==ERROR_SUCCESS) 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, _T("ViewAnimation"), 0, REG_BINARY, (LPBYTE)&AnimationWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewAnimationSet", 0, REG_BINARY, (LPBYTE)&AnimationSetWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewAnimationSet"), 0, REG_BINARY, (LPBYTE)&AnimationSetWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewSlots", 0, REG_BINARY, (LPBYTE)&MixerSlotsWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewSlots"), 0, REG_BINARY, (LPBYTE)&MixerSlotsWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewParticles", 0, REG_BINARY, (LPBYTE)&ParticlesWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewParticles"), 0, REG_BINARY, (LPBYTE)&ParticlesWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewDayNight", 0, REG_BINARY, (LPBYTE)&DayNightWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewDayNight"), 0, REG_BINARY, (LPBYTE)&DayNightWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewWaterPool", 0, REG_BINARY, (LPBYTE)&WaterPoolWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewWaterPool"), 0, REG_BINARY, (LPBYTE)&WaterPoolWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewDayNight", 0, REG_BINARY, (LPBYTE)&DayNightWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewDayNight"), 0, REG_BINARY, (LPBYTE)&DayNightWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewVegetable", 0, REG_BINARY, (LPBYTE)&VegetableWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewVegetable"), 0, REG_BINARY, (LPBYTE)&VegetableWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewGlobalWind", 0, REG_BINARY, (LPBYTE)&GlobalWindWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewGlobalWind"), 0, REG_BINARY, (LPBYTE)&GlobalWindWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewSoundAnimWind", 0, REG_BINARY, (LPBYTE)&SoundAnimWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewSoundAnimWind"), 0, REG_BINARY, (LPBYTE)&SoundAnimWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewLightGroupWind", 0, REG_BINARY, (LPBYTE)&LightGroupWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewLightGroupWind"), 0, REG_BINARY, (LPBYTE)&LightGroupWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewChooseFrameDelay", 0, REG_BINARY, (LPBYTE)&ChooseFrameDelayWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewChooseFrameDelay"), 0, REG_BINARY, (LPBYTE)&ChooseFrameDelayWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewChooseBGColor", 0, REG_BINARY, (LPBYTE)&ChooseBGColorWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewChooseBGColor"), 0, REG_BINARY, (LPBYTE)&ChooseBGColorWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewChooseSunColor", 0, REG_BINARY, (LPBYTE)&ChooseSunColorWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewChooseSunColor"), 0, REG_BINARY, (LPBYTE)&ChooseSunColorWindow, sizeof(bool));
RegSetValueEx(hKey, "MoveSpeed", 0, REG_BINARY, (LPBYTE)&MoveSpeed, sizeof(float)); RegSetValueEx(hKey, _T("MoveSpeed"), 0, REG_BINARY, (LPBYTE)&MoveSpeed, sizeof(float));
RegSetValueEx(hKey, "ObjectMode", 0, REG_BINARY, (LPBYTE)&MoveMode, sizeof(uint)); RegSetValueEx(hKey, _T("ObjectMode"), 0, REG_BINARY, (LPBYTE)&MoveMode, sizeof(uint));
RegSetValueEx(hKey, "BackGroundColor", 0, REG_BINARY, (LPBYTE)&BgColor, sizeof(NLMISC::CRGBA)); RegSetValueEx(hKey, _T("BackGroundColor"), 0, REG_BINARY, (LPBYTE)&BgColor, sizeof(NLMISC::CRGBA));
RegSetValueEx(hKey, "GlobalWindPower", 0, REG_BINARY, (LPBYTE)&GlobalWindPower, sizeof(float)); RegSetValueEx(hKey, _T("GlobalWindPower"), 0, REG_BINARY, (LPBYTE)&GlobalWindPower, sizeof(float));
RegSetValueEx(hKey, "ViewSkeletonScaleWindow", 0, REG_BINARY, (LPBYTE)&SkeletonScaleWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewSkeletonScaleWindow"), 0, REG_BINARY, (LPBYTE)&SkeletonScaleWindow, sizeof(bool));
RegSetValueEx(hKey, "ViewTuneMRMWindow", 0, REG_BINARY, (LPBYTE)&TuneMRMWindow, sizeof(bool)); RegSetValueEx(hKey, _T("ViewTuneMRMWindow"), 0, REG_BINARY, (LPBYTE)&TuneMRMWindow, sizeof(bool));
} }
} }
} }
@ -568,8 +568,8 @@ void CMainFrame::OnFileLoadconfig()
update (); update ();
// Create a dialog // Create a dialog
static char BASED_CODE szFilter[] = "NeL Object viewer config (*.ovcgf)|*.ovcgf|All Files (*.*)|*.*||"; static TCHAR BASED_CODE szFilter[] = _T("NeL Object viewer config (*.ovcgf)|*.ovcgf|All Files (*.*)|*.*||");
CFileDialog fileDlg( TRUE, ".ovcgf", "*.ovcgf", OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter); CFileDialog fileDlg( TRUE, _T(".ovcgf"), _T("*.ovcgf"), OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter);
if (fileDlg.DoModal()==IDOK) if (fileDlg.DoModal()==IDOK)
{ {
// Open the file // Open the file
@ -598,9 +598,9 @@ void CMainFrame::OnFileLoadconfig()
else else
{ {
// Create a message // Create a message
char msg[512]; CString msg;
_snprintf (msg, 512, "Can't open the file %s for reading.", (const char*)fileDlg.GetPathName()); msg.Format(_T("Can't open the file %s for reading."), (LPCTSTR)fileDlg.GetPathName());
MessageBox (msg, "NeL object viewer", MB_OK|MB_ICONEXCLAMATION); MessageBox (msg, _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION);
} }
} }
} }
@ -613,15 +613,15 @@ void CMainFrame::OnFileOpen()
update (); update ();
// Create a dialog // Create a dialog
static char BASED_CODE szFilter[] = static TCHAR BASED_CODE szFilter[] =
"All NeL Files (*.shape;*.ps;*.ig)\0*.shape;*.ps;*.ig\0" _T("All NeL Files (*.shape;*.ps;*.ig)\0*.shape;*.ps;*.ig\0")
"NeL Shape Files (*.shape)\0*.shape\0" _T("NeL Shape Files (*.shape)\0*.shape\0")
"NeL Particule System Files (*.ps)\0*.ps\0" _T("NeL Particule System Files (*.ps)\0*.ps\0")
"NeL Instance Group Files (*.ig)\0*.ig\0" _T("NeL Instance Group Files (*.ig)\0*.ig\0")
"All Files (*.*)\0*.*\0\0"; _T("All Files (*.*)\0*.*\0\0");
// Filename buffer // Filename buffer
char buffer[65535]; TCHAR buffer[65535];
buffer[0]=0; buffer[0]=0;
OPENFILENAME openFile; OPENFILENAME openFile;
@ -633,7 +633,7 @@ void CMainFrame::OnFileOpen()
openFile.lpstrFile = buffer; openFile.lpstrFile = buffer;
openFile.nMaxFile = 65535; openFile.nMaxFile = 65535;
openFile.Flags = OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_ALLOWMULTISELECT|OFN_ENABLESIZING|OFN_EXPLORER; 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)) if (GetOpenFileName(&openFile))
@ -642,7 +642,7 @@ void CMainFrame::OnFileOpen()
std::vector<std::string> meshFilename; std::vector<std::string> meshFilename;
// Filename pointer // Filename pointer
char *c=buffer; TCHAR *c=buffer;
// Read the path // Read the path
CString path = buffer; CString path = buffer;
@ -682,7 +682,7 @@ void CMainFrame::OnFileOpen()
CString name = path + filename; CString name = path + filename;
// file is an ig ? // file is an ig ?
if (name.Find(".ig") != -1) if (name.Find(_T(".ig")) != -1)
{ {
// Load the instance group // Load the instance group
if (ObjView->loadInstanceGroup (name)) if (ObjView->loadInstanceGroup (name))
@ -705,8 +705,8 @@ void CMainFrame::OnFileOpen()
if ( !meshFilename.empty() ) if ( !meshFilename.empty() )
{ {
// Create a dialog for the skel // Create a dialog for the skel
static char BASED_CODE szFilter2[] = "NeL Skeleton Files (*.skel)|*.skel|All Files (*.*)|*.*||"; static TCHAR BASED_CODE szFilter2[] = _T("NeL Skeleton Files (*.skel)|*.skel|All Files (*.*)|*.*||");
CFileDialog fileDlg2 ( TRUE, ".skel", "*.skel", OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter2); CFileDialog fileDlg2 ( TRUE, _T(".skel"), _T("*.skel"), OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter2);
if (fileDlg2.DoModal()==IDOK) if (fileDlg2.DoModal()==IDOK)
{ {
// Load the shape with a skeleton // Load the shape with a skeleton
@ -741,8 +741,8 @@ void CMainFrame::OnFileSaveconfig()
update (); update ();
// Create a dialog // Create a dialog
static char BASED_CODE szFilter[] = "NeL Object viewer config (*.ovcgf)|*.ovcgf|All Files (*.*)|*.*||"; static TCHAR BASED_CODE szFilter[] = _T("NeL Object viewer config (*.ovcgf)|*.ovcgf|All Files (*.*)|*.*||");
CFileDialog fileDlg( FALSE, ".ovcgf", "*.ovcgf", OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter); CFileDialog fileDlg( FALSE, _T(".ovcgf"), _T("*.ovcgf"), OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter);
if (fileDlg.DoModal()==IDOK) if (fileDlg.DoModal()==IDOK)
{ {
ObjView->ParticleWorkspaceFilename = ""; ObjView->ParticleWorkspaceFilename = "";
@ -770,9 +770,9 @@ void CMainFrame::OnFileSaveconfig()
else else
{ {
// Create a message // Create a message
char msg[512]; CString msg;
_snprintf (msg, 512, "Can't open the file %s for writing", (const char*)fileDlg.GetPathName()); msg.Format(_T("Can't open the file %s for writing"), (LPCTSTR)fileDlg.GetPathName());
MessageBox (msg, "NeL object viewer", MB_OK|MB_ICONEXCLAMATION); MessageBox (msg, _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION);
} }
} }
} }
@ -1154,7 +1154,7 @@ void CMainFrame::OnHelpAboutobjectviewer()
///=========================================================================================== ///===========================================================================================
void CMainFrame::OnRemoveAllInstancesFromScene() 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(); ObjView->removeAllInstancesFromScene();
@ -1445,7 +1445,7 @@ void CMainFrame::OnUpdateSceneCamera(CCmdUI* pCmdUI)
} }
else else
{ {
pCmdUI->SetText ("No camera"); pCmdUI->SetText (_T("No camera"));
} }
} }

View file

@ -90,7 +90,7 @@ void CMeshDlg::touchPSState()
void CMeshDlg::OnBrowseShape() 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) if (fd.DoModal() == IDOK)
{ {
// Add to the path // Add to the path
@ -238,7 +238,7 @@ BOOL CMeshDlg::EnableWindow( BOOL bEnable)
///================================================================== ///==================================================================
void CMeshDlg::updateMeshErrorString() void CMeshDlg::updateMeshErrorString()
{ {
GetDlgItem(IDC_MESH_ERROR)->SetWindowText(""); GetDlgItem(IDC_MESH_ERROR)->SetWindowText(_T(""));
NL3D::CPSConstraintMesh *cm = dynamic_cast<NL3D::CPSConstraintMesh *>(_ShapeParticle); NL3D::CPSConstraintMesh *cm = dynamic_cast<NL3D::CPSConstraintMesh *>(_ShapeParticle);
if (!cm) return; if (!cm) return;
std::vector<sint> numVerts; std::vector<sint> numVerts;

View file

@ -181,10 +181,10 @@ void CMultiTexDlg::readValues(bool alternate)
} }
else else
{ {
GetDlgItem(IDC_U_SPEED_1_ALTERNATE)->SetWindowText(""); GetDlgItem(IDC_U_SPEED_1_ALTERNATE)->SetWindowText(_T(""));
GetDlgItem(IDC_V_SPEED_1_ALTERNATE)->SetWindowText(""); GetDlgItem(IDC_V_SPEED_1_ALTERNATE)->SetWindowText(_T(""));
GetDlgItem(IDC_U_SPEED_2_ALTERNATE)->SetWindowText(""); GetDlgItem(IDC_U_SPEED_2_ALTERNATE)->SetWindowText(_T(""));
GetDlgItem(IDC_V_SPEED_2_ALTERNATE)->SetWindowText(""); GetDlgItem(IDC_V_SPEED_2_ALTERNATE)->SetWindowText(_T(""));
} }
} }
sprintf(buf, "%.3f", _MTP->getBumpFactor()); GetDlgItem(IDC_BUMP_FACTOR)->SetWindowText(buf); sprintf(buf, "%.3f", _MTP->getBumpFactor()); GetDlgItem(IDC_BUMP_FACTOR)->SetWindowText(buf);
@ -204,7 +204,7 @@ void CMultiTexDlg::updateBumpFactorEnabled()
//====================================================== //======================================================
void CMultiTexDlg::writeValues(bool alternate) 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; NLMISC::CVector2f vs1, vs2;
@ -215,10 +215,10 @@ void CMultiTexDlg::writeValues(bool alternate)
GetDlgItem(IDC_U_SPEED_2)->GetWindowText(u2, 10); GetDlgItem(IDC_U_SPEED_2)->GetWindowText(u2, 10);
GetDlgItem(IDC_V_SPEED_2)->GetWindowText(v2, 10); GetDlgItem(IDC_V_SPEED_2)->GetWindowText(v2, 10);
if (sscanf(u1, "%f", &vs1.x) == 1 && if (_tcscanf(u1, "%f", &vs1.x) == 1 &&
sscanf(v1, "%f", &vs1.y) == 1 && _tcscanf(v1, "%f", &vs1.y) == 1 &&
sscanf(u2, "%f", &vs2.x) == 1 && _tcscanf(u2, "%f", &vs2.x) == 1 &&
sscanf(v2, "%f", &vs2.y) == 1) _tcscanf(v2, "%f", &vs2.y) == 1)
{ {
_MTP->setScrollSpeed(0, vs1); _MTP->setScrollSpeed(0, vs1);
_MTP->setScrollSpeed(1, vs2); _MTP->setScrollSpeed(1, vs2);
@ -226,7 +226,7 @@ void CMultiTexDlg::writeValues(bool alternate)
} }
else else
{ {
MessageBox("Invalid value(s)", "Error", MB_OK | MB_ICONEXCLAMATION); MessageBox(_T("Invalid value(s)"), _T("Error"), MB_OK | MB_ICONEXCLAMATION);
} }
} }
else else
@ -237,10 +237,10 @@ void CMultiTexDlg::writeValues(bool alternate)
GetDlgItem(IDC_V_SPEED_1_ALTERNATE)->GetWindowText(v1, 10); GetDlgItem(IDC_V_SPEED_1_ALTERNATE)->GetWindowText(v1, 10);
GetDlgItem(IDC_U_SPEED_2_ALTERNATE)->GetWindowText(u2, 10); GetDlgItem(IDC_U_SPEED_2_ALTERNATE)->GetWindowText(u2, 10);
GetDlgItem(IDC_V_SPEED_2_ALTERNATE)->GetWindowText(v2, 10); GetDlgItem(IDC_V_SPEED_2_ALTERNATE)->GetWindowText(v2, 10);
if (sscanf(u1, "%f", &vs1.x) == 1 && if (_tcscanf(u1, "%f", &vs1.x) == 1 &&
sscanf(v1, "%f", &vs1.y) == 1 && _tcscanf(v1, "%f", &vs1.y) == 1 &&
sscanf(u2, "%f", &vs2.x) == 1 && _tcscanf(u2, "%f", &vs2.x) == 1 &&
sscanf(v2, "%f", &vs2.y) == 1) _tcscanf(v2, "%f", &vs2.y) == 1)
{ {
_MTP->setAlternateScrollSpeed(0, vs1); _MTP->setAlternateScrollSpeed(0, vs1);
_MTP->setAlternateScrollSpeed(1, vs2); _MTP->setAlternateScrollSpeed(1, vs2);
@ -249,10 +249,10 @@ void CMultiTexDlg::writeValues(bool alternate)
} }
} }
char bumpFactorTxt[10]; TCHAR bumpFactorTxt[10];
float bumpFactor; float bumpFactor;
GetDlgItem(IDC_BUMP_FACTOR)->GetWindowText(bumpFactorTxt, 10); GetDlgItem(IDC_BUMP_FACTOR)->GetWindowText(bumpFactorTxt, 10);
if (sscanf(bumpFactorTxt, "%f", &bumpFactor) == 1) if (_tcscanf(bumpFactorTxt, "%f", &bumpFactor) == 1)
{ {
_MTP->setBumpFactor(bumpFactor); _MTP->setBumpFactor(bumpFactor);
updateModifiedFlag(); updateModifiedFlag();

View file

@ -281,7 +281,7 @@ std::string CObjectViewer::getModulePath() const
HMODULE hModule = AfxGetInstanceHandle(); HMODULE hModule = AfxGetInstanceHandle();
nlassert(hModule); // shouldn't be null now anymore in any case 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 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); int res = GetModuleFileName(hModule, sModulePath, 256); nlassert(res);
nldebug("Object viewer module path is '%s'", sModulePath); nldebug("Object viewer module path is '%s'", sModulePath);
_splitpath (sModulePath, SDrive, SDir, NULL, NULL); _splitpath (sModulePath, SDrive, SDir, NULL, NULL);
@ -654,7 +654,7 @@ bool CObjectViewer::initUI (HWND parent)
// Create the window // Create the window
_MainFrame->CFrameWnd::Create (AfxRegisterWndClass(0, 0, NULL, hIcon), _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*/); MAKEINTRESOURCE(IDR_OBJECT_VIEWER_MENU), 0x00000300 /*WS_EX_ACCEPTFILES*/ /*|WS_EX_CLIENTEDGE*/);
// Detach the hwnd // Detach the hwnd
@ -1316,13 +1316,13 @@ void CObjectViewer::go ()
{ {
if(_VegetableLandscape != NULL) if(_VegetableLandscape != NULL)
{ {
char vegetMsgBar[1024]; CString vegetMsgBar;
sprintf (vegetMsgBar, "%d", _VegetableLandscape->Landscape.getNumVegetableFaceRendered()); vegetMsgBar.Format(_T("%u"), _VegetableLandscape->Landscape.getNumVegetableFaceRendered());
_VegetableDlg->StaticPolyCount.SetWindowText(vegetMsgBar); _VegetableDlg->StaticPolyCount.SetWindowText(vegetMsgBar);
} }
else 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; HKEY hKey;
if (RegCreateKey(HKEY_CURRENT_USER, keyName, &hKey)==ERROR_SUCCESS) if (RegCreateKey(HKEY_CURRENT_USER, keyName, &hKey)==ERROR_SUCCESS)
{ {
RECT rect; RECT rect;
pWnd->GetWindowRect (&rect); pWnd->GetWindowRect (&rect);
RegSetValueEx(hKey, "Left", 0, REG_DWORD, (LPBYTE)&rect.left, 4); RegSetValueEx(hKey, _T("Left"), 0, REG_DWORD, (LPBYTE)&rect.left, 4);
RegSetValueEx(hKey, "Right", 0, REG_DWORD, (LPBYTE)&rect.right, 4); RegSetValueEx(hKey, _T("Right"), 0, REG_DWORD, (LPBYTE)&rect.right, 4);
RegSetValueEx(hKey, "Top", 0, REG_DWORD, (LPBYTE)&rect.top, 4); RegSetValueEx(hKey, _T("Top"), 0, REG_DWORD, (LPBYTE)&rect.top, 4);
RegSetValueEx(hKey, "Bottom", 0, REG_DWORD, (LPBYTE)&rect.bottom, 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; HKEY hKey;
if (RegOpenKeyEx(HKEY_CURRENT_USER, keyName, 0, KEY_READ, &hKey)==ERROR_SUCCESS) 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 len=4;
DWORD type; DWORD type;
RECT rect; RECT rect;
RegQueryValueEx (hKey, "Left", 0, &type, (LPBYTE)&rect.left, &len); RegQueryValueEx (hKey, _T("Left"), 0, &type, (LPBYTE)&rect.left, &len);
RegQueryValueEx (hKey, "Right", 0, &type, (LPBYTE)&rect.right, &len); RegQueryValueEx (hKey, _T("Right"), 0, &type, (LPBYTE)&rect.right, &len);
RegQueryValueEx (hKey, "Top", 0, &type, (LPBYTE)&rect.top, &len); RegQueryValueEx (hKey, _T("Top"), 0, &type, (LPBYTE)&rect.top, &len);
RegQueryValueEx (hKey, "Bottom", 0, &type, (LPBYTE)&rect.bottom, &len); RegQueryValueEx (hKey, _T("Bottom"), 0, &type, (LPBYTE)&rect.bottom, &len);
// Set window pos // Set window pos
pWnd->SetWindowPos (NULL, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, SWP_NOOWNERZORDER|SWP_NOZORDER| 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 // Check version number
if (version!=OBJECT_VIEWER_VERSION) 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; return NULL;
} }
else else
@ -2628,9 +2628,9 @@ void CObjectViewer::evalSoundTrack (float lastTime, float currentTime)
{ {
CEdit *edit = (CEdit*) _SoundAnimDlg->GetDlgItem(tab[i]); CEdit *edit = (CEdit*) _SoundAnimDlg->GetDlgItem(tab[i]);
nlassert(edit); nlassert(edit);
char str[1024]; TCHAR str[1024];
edit->GetLine(0, 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 // 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 :) ). // Load The Bank files (copied from CLandscapeUser :) ).
// ================ // ================
// progress // progress
dlgProgress.ProgressText.SetWindowText("Loading TileBanks..."); dlgProgress.ProgressText.SetWindowText(_T("Loading TileBanks..."));
dlgProgress.ProgressBar.SetPos(0); dlgProgress.ProgressBar.SetPos(0);
// load // load
CIFile bankFile(CPath::lookup(_VegetableLandscapeTileBank)); CIFile bankFile(CPath::lookup(_VegetableLandscapeTileBank));
@ -3140,7 +3140,7 @@ bool CObjectViewer::createVegetableLandscape()
if(CNELU::Driver) if(CNELU::Driver)
{ {
// progress // progress
dlgProgress.ProgressText.SetWindowText("Loading Tiles..."); dlgProgress.ProgressText.SetWindowText(_T("Loading Tiles..."));
dlgProgress.ProgressBar.SetPos(0); dlgProgress.ProgressBar.SetPos(0);
// count nbText to load. // count nbText to load.
@ -3195,7 +3195,7 @@ bool CObjectViewer::createVegetableLandscape()
bool zoneLoaded= false; bool zoneLoaded= false;
CAABBox landscapeBBox; CAABBox landscapeBBox;
// progress // progress
dlgProgress.ProgressText.SetWindowText("Loading Zones..."); dlgProgress.ProgressText.SetWindowText(_T("Loading Zones..."));
dlgProgress.ProgressBar.SetPos(0); dlgProgress.ProgressBar.SetPos(0);
uint nbZones= (uint)_VegetableLandscapeZoneNames.size(); uint nbZones= (uint)_VegetableLandscapeZoneNames.size();
for(uint i=0; i<nbZones;i++) for(uint i=0; i<nbZones;i++)
@ -3891,7 +3891,7 @@ int localizedMessageBox(HWND parentWindow, int messageStringID, int captionStrin
// TODO : replace older call to ::MessageBox in the object viewer with that function // TODO : replace older call to ::MessageBox in the object viewer with that function
} }
int localizedMessageBox(HWND parentWindow, const char *message, int captionStringID, UINT nType) int localizedMessageBox(HWND parentWindow, const TCHAR *message, int captionStringID, UINT nType)
{ {
CString caption; CString caption;
caption.LoadString(captionStringID); caption.LoadString(captionStringID);
@ -3907,7 +3907,7 @@ CString getStrRsc(uint stringID)
bool browseFolder(const CString &caption, CString &destFolder, HWND parent) bool browseFolder(const CString &caption, CString &destFolder, HWND parent)
{ {
char chosenPath[MAX_PATH]; TCHAR chosenPath[MAX_PATH];
// browse folder // browse folder
BROWSEINFO bi; BROWSEINFO bi;
bi.hwndOwner = parent; bi.hwndOwner = parent;

View file

@ -22,24 +22,24 @@
#endif // _MSC_VER > 1000 #endif // _MSC_VER > 1000
#define REGKEY_OBJ_VIEW "Software\\Nevrax\\nel\\object_viewer" #define REGKEY_OBJ_VIEW _T("Software\\Nevrax\\nel\\object_viewer")
#define REGKEY_OBJ_VIEW_OPENGL_WND "Software\\Nevrax\\nel\\object_viewer\\opengl_wnd" #define REGKEY_OBJ_VIEW_OPENGL_WND _T("Software\\Nevrax\\nel\\object_viewer\\opengl_wnd")
#define REGKEY_OBJ_VIEW_SCENE_DLG "Software\\Nevrax\\nel\\object_viewer\\scene_dlg" #define REGKEY_OBJ_VIEW_SCENE_DLG _T("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_DLG _T("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_ANIMATION_SET_DLG _T("Software\\Nevrax\\nel\\object_viewer\\animation_set_dlg")
#define REGKEY_OBJ_VIEW_SLOT_DLG "Software\\Nevrax\\nel\\object_viewer\\slot_dlg" #define REGKEY_OBJ_VIEW_SLOT_DLG _T("Software\\Nevrax\\nel\\object_viewer\\slot_dlg")
#define REGKEY_OBJ_PARTICLE_DLG "Software\\Nevrax\\nel\\object_viewer\\particle_dlg" #define REGKEY_OBJ_PARTICLE_DLG _T("Software\\Nevrax\\nel\\object_viewer\\particle_dlg")
#define REGKEY_OBJ_DAYNIGHT_DLG "Software\\Nevrax\\nel\\object_viewer\\daynight_dlg" #define REGKEY_OBJ_DAYNIGHT_DLG _T("Software\\Nevrax\\nel\\object_viewer\\daynight_dlg")
#define REGKEY_OBJ_WATERPOOL_DLG "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 "Software\\Nevrax\\nel\\object_viewer\\vegetable_dlg" #define REGKEY_OBJ_VIEW_VEGETABLE_DLG _T("Software\\Nevrax\\nel\\object_viewer\\vegetable_dlg")
#define REGKEY_OBJ_GLOBAL_WIND_DLG "Software\\Nevrax\\nel\\object_viewer\\global_wind_dlg" #define REGKEY_OBJ_GLOBAL_WIND_DLG _T("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_SOUND_ANIM_DLG _T("Software\\Nevrax\\nel\\object_viewer\\sound_anim_dlg")
#define REGKEY_OBJ_LIGHT_GROUP_DLG "Software\\Nevrax\\nel\\object_viewer\\light_group_dlg" #define REGKEY_OBJ_LIGHT_GROUP_DLG _T("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_FRAME_DELAY_DLG _T("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_BG_COLOR_DLG _T("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_CHOOSE_SUN_COLOR_DLG _T("Software\\Nevrax\\nel\\object_viewer\\choose_sun_color_dlg")
#define REGKEY_SKELETON_SCALE_DLG "Software\\Nevrax\\nel\\object_viewer\\skeleton_scale_dlg" #define REGKEY_SKELETON_SCALE_DLG _T("Software\\Nevrax\\nel\\object_viewer\\skeleton_scale_dlg")
#define REGKEY_TUNE_MRM_DLG "Software\\Nevrax\\nel\\object_viewer\\tune_mrm_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 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 setRegisterWindowState (const CWnd *pWnd, const TCHAR* keyName);
void getRegisterWindowState (CWnd *pWnd, const char* keyName, bool resize); void getRegisterWindowState (CWnd *pWnd, const TCHAR* keyName, bool resize);
/** display a localized message box. Caption an message text are retrieved from the string table /** display a localized message box. Caption an message text are retrieved from the string table
* \param parentWindow Pointer to initiator of the message box * \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 * \return Same value than ::MessageBox
*/ */
int localizedMessageBox(HWND parentWindow, int messageStringID, int captionStringID, UINT nType); 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 // Return a string from the string table
CString getStrRsc(uint stringID); CString getStrRsc(uint stringID);

View file

@ -563,8 +563,8 @@ void CParticleDlg::OnCreateNewPsWorkspace()
void CParticleDlg::OnLoadPSWorkspace() void CParticleDlg::OnLoadPSWorkspace()
{ {
checkModifiedWorkSpace(); checkModifiedWorkSpace();
static const char BASED_CODE szFilter[] = "particle workspaces(*.pws)|*.pws||"; static const TCHAR BASED_CODE szFilter[] = _T("particle workspaces(*.pws)|*.pws||");
CFileDialog fd( TRUE, ".pws", "*.pws", 0, szFilter); CFileDialog fd( TRUE, _T(".pws"), _T("*.pws"), 0, szFilter);
INT_PTR result = fd.DoModal(); INT_PTR result = fd.DoModal();
if (result != IDOK) return; if (result != IDOK) return;
loadWorkspace((LPCTSTR) fd.GetPathName()); loadWorkspace((LPCTSTR) fd.GetPathName());

View file

@ -34,12 +34,12 @@ static void concatEdit2Lines(CEdit &edit)
const uint lineLen= 1000; const uint lineLen= 1000;
uint n; uint n;
// retrieve the 2 lines. // retrieve the 2 lines.
char tmp0[2*lineLen]; TCHAR tmp0[2*lineLen];
char tmp1[lineLen]; TCHAR tmp1[lineLen];
n= edit.GetLine(0, tmp0, lineLen); tmp0[n]= 0; n= edit.GetLine(0, tmp0, lineLen); tmp0[n]= 0;
n= edit.GetLine(1, tmp1, lineLen); tmp1[n]= 0; n= edit.GetLine(1, tmp1, lineLen); tmp1[n]= 0;
// concat and update the CEdit. // concat and update the CEdit.
edit.SetWindowText(strcat(tmp0, tmp1)); edit.SetWindowText(_tcscat(tmp0, tmp1));
} }
@ -221,14 +221,16 @@ void CParticleSystemEdit::updateDieOnEventParams()
ew = FALSE; ew = FALSE;
} }
GetDlgItem(IDC_APPLY_AFTER_DELAY)->EnableWindow(ew); GetDlgItem(IDC_APPLY_AFTER_DELAY)->EnableWindow(ew);
char out[128];
CString out;
if (_Node->getPSPointer()->getDelayBeforeDeathConditionTest() >= 0) if (_Node->getPSPointer()->getDelayBeforeDeathConditionTest() >= 0)
{ {
sprintf(out, "%.2g", _Node->getPSPointer()->getDelayBeforeDeathConditionTest()); out.Format(_T("%.2g"), _Node->getPSPointer()->getDelayBeforeDeathConditionTest());
} }
else else
{ {
strcpy(out,"???"); out = _T("???");
} }
GetDlgItem(IDC_APPLY_AFTER_DELAY)->SetWindowText(out); GetDlgItem(IDC_APPLY_AFTER_DELAY)->SetWindowText(out);
((CButton *) GetDlgItem(IDC_AUTO_DELAY))->SetCheck(autoDelay ? 1 : 0); ((CButton *) GetDlgItem(IDC_AUTO_DELAY))->SetCheck(autoDelay ? 1 : 0);
@ -394,13 +396,14 @@ void CParticleSystemEdit::OnEnableSlowDown()
void CParticleSystemEdit::updateBBoxFromText() void CParticleSystemEdit::updateBBoxFromText()
{ {
NLMISC::CVector h; NLMISC::CVector h;
char inX[128], inY[128], inZ[128]; TCHAR inX[128], inY[128], inZ[128];
m_BBoxXCtrl.GetWindowText(inX, 128); m_BBoxXCtrl.GetWindowText(inX, 128);
m_BBoxYCtrl.GetWindowText(inY, 128); m_BBoxYCtrl.GetWindowText(inY, 128);
m_BBoxZCtrl.GetWindowText(inZ, 128); m_BBoxZCtrl.GetWindowText(inZ, 128);
if (sscanf(inX, "%f", &h.x) == 1
&& sscanf(inY, "%f", &h.y) == 1 if (_tcscanf(inX, "%f", &h.x) == 1
&& sscanf(inZ, "%f", &h.z) == 1 && _tcscanf(inY, "%f", &h.y) == 1
&& _tcscanf(inZ, "%f", &h.z) == 1
) )
{ {
NLMISC::CAABBox b; NLMISC::CAABBox b;
@ -409,7 +412,7 @@ void CParticleSystemEdit::updateBBoxFromText()
} }
else 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() void CParticleSystemEdit::OnChangeApplyAfterDelay()
{ {
if (_Node->getPSPointer()->getAutoComputeDelayBeforeDeathConditionTest()) return; if (_Node->getPSPointer()->getAutoComputeDelayBeforeDeathConditionTest()) return;
//
char in[128]; TCHAR in[128];
GetDlgItem(IDC_APPLY_AFTER_DELAY)->GetWindowText(in, 128); GetDlgItem(IDC_APPLY_AFTER_DELAY)->GetWindowText(in, 128);
float value; float value;
if (sscanf(in, "%f", &value) == 1) if (_tcscanf(in, "%f", &value) == 1)
{ {
if (_Node->getPSPointer()->getDelayBeforeDeathConditionTest() != value) if (_Node->getPSPointer()->getDelayBeforeDeathConditionTest() != value)
{ {
@ -728,7 +732,7 @@ void CParticleSystemEdit::OnEnableLoadBalancing()
UpdateData(TRUE); UpdateData(TRUE);
if (m_EnableLoadBalancing == FALSE) 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) if (result == IDOK)
{ {
_Node->getPSPointer()->enableLoadBalancing(false); _Node->getPSPointer()->enableLoadBalancing(false);
@ -791,7 +795,7 @@ void CParticleSystemEdit::OnBypassMaxNumSteps()
UpdateData(TRUE); UpdateData(TRUE);
if (m_BypassMaxNumSteps && !_Node->getPSPointer()->canFinish()) 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; return;
} }
_Node->getPSPointer()->setBypassMaxNumIntegrationSteps(m_BypassMaxNumSteps != FALSE); _Node->getPSPointer()->setBypassMaxNumIntegrationSteps(m_BypassMaxNumSteps != FALSE);

View file

@ -165,7 +165,7 @@ void CParticleTreeCtrl::rebuildLocatedInstance(CParticleWorkspace::CNode &node)
CNodeType *newNt = new CNodeType(loc, k); CNodeType *newNt = new CNodeType(loc, k);
_NodeTypes.push_back(newNt); _NodeTypes.push_back(newNt);
// bind located instance icon // 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); currLocated = GetNextItem(currLocated, TVGN_NEXT);
} }
@ -995,8 +995,8 @@ BOOL CParticleTreeCtrl::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHA
case IDM_MERGE_PS: case IDM_MERGE_PS:
{ {
_ParticleDlg->StartStopDlg->stop(); _ParticleDlg->StartStopDlg->stop();
static char BASED_CODE szFilter[] = "ps & shapes files(*.ps;*.shape)|*.ps; *.shape||"; static TCHAR BASED_CODE szFilter[] = _T("ps & shapes files(*.ps;*.shape)|*.ps; *.shape||");
CFileDialog fd( TRUE, ".ps", "*.ps;*.shape", 0, szFilter); CFileDialog fd( TRUE, _T(".ps"), _T("*.ps;*.shape"), 0, szFilter);
if (fd.DoModal() == IDOK) if (fd.DoModal() == IDOK)
{ {
@ -1198,7 +1198,7 @@ BOOL CParticleTreeCtrl::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHA
} }
if (!nt->Loc->bind(toCreate)) 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; delete toCreate;
if (createLocAndBindable) if (createLocAndBindable)
{ {
@ -1528,11 +1528,11 @@ std::string CParticleTreeCtrl::computeCaption(CParticleWorkspace &workspace)
//**************************************************************************************************************** //****************************************************************************************************************
void CParticleTreeCtrl::insertNewPS(CParticleWorkspace &pws) void CParticleTreeCtrl::insertNewPS(CParticleWorkspace &pws)
{ {
static const char BASED_CODE szFilter[] = "NeL Particle systems (*.ps)|*.ps||"; static const TCHAR BASED_CODE szFilter[] = _T("NeL Particle systems (*.ps)|*.ps||");
CFileDialog fd(TRUE, ".ps", "*.ps", OFN_ALLOWMULTISELECT|OFN_FILEMUSTEXIST, szFilter, this); CFileDialog fd(TRUE, _T(".ps"), _T("*.ps"), OFN_ALLOWMULTISELECT|OFN_FILEMUSTEXIST, szFilter, this);
const uint MAX_NUM_CHAR = 65536; const uint MAX_NUM_CHAR = 65536;
char filenamesBuf[MAX_NUM_CHAR]; TCHAR filenamesBuf[MAX_NUM_CHAR];
strcpy(filenamesBuf, "*.ps"); _tcscpy(filenamesBuf, _T("*.ps"));
fd.m_ofn.lpstrFile = filenamesBuf; fd.m_ofn.lpstrFile = filenamesBuf;
fd.m_ofn.nMaxFile = MAX_NUM_CHAR - 1; fd.m_ofn.nMaxFile = MAX_NUM_CHAR - 1;
if (fd.DoModal() == IDOK) if (fd.DoModal() == IDOK)
@ -1744,7 +1744,7 @@ void CParticleTreeCtrl::OnBeginlabeledit(NMHDR* pNMHDR, LRESULT* pResult)
{ {
if (!nt->PS->isLoaded()) if (!nt->PS->isLoaded())
{ {
pEdit->SetWindowText(""); pEdit->SetWindowText(_T(""));
//localizedMessageBox(*this, IDS_CANT_CHANGE_PS_NAME, IDS_ERROR, MB_OK|MB_ICONEXCLAMATION); //localizedMessageBox(*this, IDS_CANT_CHANGE_PS_NAME, IDS_ERROR, MB_OK|MB_ICONEXCLAMATION);
} }
else else

View file

@ -107,7 +107,7 @@ BOOL CPickSound::OnInitDialog()
void CPickSound::OnSelchange() void CPickSound::OnSelchange()
{ {
UpdateData(); UpdateData();
char str[1024]; TCHAR str[1024];
nlassert(m_NameList.GetTextLen(m_NameList.GetCurSel()) < 1024); nlassert(m_NameList.GetTextLen(m_NameList.GetCurSel()) < 1024);
m_NameList.GetText(m_NameList.GetCurSel(), str); m_NameList.GetText(m_NameList.GetCurSel(), str);

View file

@ -133,7 +133,7 @@ void CPrecomputedRotationsDlg::OnUpdateMinRotSpeed()
} }
else else
{ {
MessageBox("invalid value !!"); MessageBox(_T("invalid value !!"));
} }
UpdateData(FALSE); UpdateData(FALSE);
updateModifiedFlag(); updateModifiedFlag();
@ -153,7 +153,7 @@ void CPrecomputedRotationsDlg::OnUpdateMaxRotSpeed()
} }
else else
{ {
MessageBox("invalid value !!"); MessageBox(_T("invalid value !!"));
} }
UpdateData(FALSE); UpdateData(FALSE);
updateModifiedFlag(); updateModifiedFlag();
@ -178,7 +178,7 @@ void CPrecomputedRotationsDlg::OnUpdateNbModels()
} }
else else
{ {
MessageBox("invalid value !!"); MessageBox(_T("invalid value !!"));
} }
UpdateData(FALSE); UpdateData(FALSE);
updateModifiedFlag(); updateModifiedFlag();

View file

@ -46,9 +46,9 @@ CPSMoverDlg::CPSMoverDlg(CParticleWorkspace::CNode *ownerNode, CWnd *parent, NL3
const NLMISC::CVector &pos = _EditedLocated->getPos()[_EditedLocatedIndex]; const NLMISC::CVector &pos = _EditedLocated->getPos()[_EditedLocatedIndex];
m_X.Format("%.3g", pos.x); m_X.Format(_T("%.3g"), pos.x);
m_Y.Format("%.3g", pos.y); m_Y.Format(_T("%.3g"), pos.y);
m_Z.Format("%.3g", pos.z); m_Z.Format(_T("%.3g"), pos.z);
//{{AFX_DATA_INIT(CPSMoverDlg) //{{AFX_DATA_INIT(CPSMoverDlg)
//}}AFX_DATA_INIT //}}AFX_DATA_INIT
@ -84,9 +84,9 @@ void CPSMoverDlg::updatePosition(void)
UpdateData(); UpdateData();
const NLMISC::CVector &pos = _EditedLocated->getPos()[_EditedLocatedIndex]; const NLMISC::CVector &pos = _EditedLocated->getPos()[_EditedLocatedIndex];
m_X.Format("%.3g", pos.x); m_X.Format(_T("%.3g"), pos.x);
m_Y.Format("%.3g", pos.y); m_Y.Format(_T("%.3g"), pos.y);
m_Z.Format("%.3g", pos.z); m_Z.Format(_T("%.3g"), pos.z);
UpdateData(FALSE); UpdateData(FALSE);
} }
@ -127,7 +127,7 @@ void CPSMoverDlg::OnUpdateXpos()
} }
else else
{ {
MessageBox("invalid entry", "error"); MessageBox(_T("invalid entry"), _T("error"));
} }
UpdateData(FALSE); UpdateData(FALSE);
} }
@ -144,7 +144,7 @@ void CPSMoverDlg::OnUpdateYpos()
} }
else else
{ {
MessageBox("invalid entry", "error"); MessageBox(_T("invalid entry"), _T("error"));
} }
UpdateData(FALSE); UpdateData(FALSE);
} }
@ -161,7 +161,7 @@ void CPSMoverDlg::OnUpdateZpos()
} }
else else
{ {
MessageBox("invalid entry", "error"); MessageBox(_T("invalid entry"), _T("error"));
} }
UpdateData(FALSE); UpdateData(FALSE);
} }
@ -235,7 +235,7 @@ void CPSMoverDlg::createScaleControls(void)
_Scale->init(100 + xPos, yPos, this); _Scale->init(100 + xPos, yPos, this);
_ScaleText = new CStatic; _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); _ScaleText ->ShowWindow(SW_SHOW);
_Scale->GetClientRect(&r); _Scale->GetClientRect(&r);
@ -254,7 +254,7 @@ void CPSMoverDlg::createScaleControls(void)
_XScale->GetClientRect(&r); _XScale->GetClientRect(&r);
_XScaleText = new CStatic; _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); _XScaleText ->ShowWindow(SW_SHOW);
yPos += r.bottom; yPos += r.bottom;
@ -269,7 +269,7 @@ void CPSMoverDlg::createScaleControls(void)
_YScaleText = new CStatic; _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); _YScaleText ->ShowWindow(SW_SHOW);
yPos += r.bottom; yPos += r.bottom;
@ -283,7 +283,7 @@ void CPSMoverDlg::createScaleControls(void)
_ZScale->GetClientRect(&r); _ZScale->GetClientRect(&r);
_ZScaleText = new CStatic; _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); _ZScaleText ->ShowWindow(SW_SHOW);
} }

View file

@ -32,8 +32,8 @@ CRangeSelector::CRangeSelector(const CString &lowerBound, const CString &upperBo
: CDialog(CRangeSelector::IDD, pParent), _EditableRange(er) : CDialog(CRangeSelector::IDD, pParent), _EditableRange(er)
{ {
//{{AFX_DATA_INIT(CRangeSelector) //{{AFX_DATA_INIT(CRangeSelector)
m_LowerBound = _T(lowerBound); m_LowerBound = lowerBound;
m_UpperBound = _T(upperBound); m_UpperBound = upperBound;
//}}AFX_DATA_INIT //}}AFX_DATA_INIT
} }

View file

@ -93,8 +93,8 @@ void CSchemeBankDlg::buildList()
void CSchemeBankDlg::OnSaveBank() void CSchemeBankDlg::OnSaveBank()
{ {
static char BASED_CODE szFilter[] = "scheme bank files(*.scb)|*.scb||"; static TCHAR BASED_CODE szFilter[] = _T("scheme bank files(*.scb)|*.scb||");
CFileDialog fd( FALSE, NULL, "default.scb", 0, szFilter); CFileDialog fd( FALSE, NULL, _T("default.scb"), 0, szFilter);
if (fd.DoModal() == IDOK) if (fd.DoModal() == IDOK)
{ {
@ -124,8 +124,8 @@ void CSchemeBankDlg::OnSaveBank()
void CSchemeBankDlg::OnLoadBank() void CSchemeBankDlg::OnLoadBank()
{ {
static char BASED_CODE szFilter[] = "scheme bank files(*.scb)|*.scb||"; static TCHAR BASED_CODE szFilter[] = _T("scheme bank files(*.scb)|*.scb||");
CFileDialog fd( TRUE, NULL, "*.scb", 0, szFilter); CFileDialog fd( TRUE, NULL, _T("*.scb"), 0, szFilter);
if (fd.DoModal() == IDOK) if (fd.DoModal() == IDOK)
{ {

View file

@ -216,8 +216,8 @@ void CSkeletonScaleDlg::setSkeletonToEdit(NL3D::CSkeletonModel *skel, const std
{ {
_ScaleSliders[i]->SetRange(0, NL_SSD_SLIDER_SIZE); _ScaleSliders[i]->SetRange(0, NL_SSD_SLIDER_SIZE);
_ScaleSliders[i]->SetPos(NL_SSD_SLIDER_SIZE/2); _ScaleSliders[i]->SetPos(NL_SSD_SLIDER_SIZE/2);
*_ScaleEdits[i]= ""; _ScaleEdits[i]->Empty();
_StaticScaleMarkers[i]->SetWindowText("100%"); _StaticScaleMarkers[i]->SetWindowText(_T("100%"));
} }
// ensure no problem with scale and ALT-TAB // ensure no problem with scale and ALT-TAB
_SliderEdited= SidNone; _SliderEdited= SidNone;
@ -338,7 +338,7 @@ void CSkeletonScaleDlg::onSliderReleased(TScaleId sid)
// And reset the slider // And reset the slider
_ScaleSliders[_SliderEdited]->SetPos(NL_SSD_SLIDER_SIZE/2); _ScaleSliders[_SliderEdited]->SetPos(NL_SSD_SLIDER_SIZE/2);
_StaticScaleMarkers[_SliderEdited]->SetWindowText("100%"); _StaticScaleMarkers[_SliderEdited]->SetWindowText(_T("100%"));
_SliderEdited= SidNone; _SliderEdited= SidNone;
// push an undo/redo only at release of slide. push the value of scale before slide // 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; const uint lineLen= 1000;
uint n; uint n;
// retrieve the 2 lines. // retrieve the 2 lines.
char tmp0[2*lineLen]; TCHAR tmp0[2*lineLen];
char tmp1[lineLen]; TCHAR tmp1[lineLen];
n= edit.GetLine(0, tmp0, lineLen); tmp0[n]= 0; n= edit.GetLine(0, tmp0, lineLen); tmp0[n]= 0;
n= edit.GetLine(1, tmp1, lineLen); tmp1[n]= 0; n= edit.GetLine(1, tmp1, lineLen); tmp1[n]= 0;
// concat and update the CEdit. // concat and update the CEdit.
edit.SetWindowText(strcat(tmp0, tmp1)); edit.SetWindowText(_tcscat(tmp0, tmp1));
} }
@ -1236,7 +1236,7 @@ void CSkeletonScaleDlg::OnSsdButtonSaveScale()
} }
else else
{ {
MessageBox("Failed to open file for write!"); MessageBox(_T("Failed to open file for write!"));
} }
} }
} }
@ -1262,7 +1262,7 @@ void CSkeletonScaleDlg::OnSsdButtonLoadScale()
} }
else 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 &) catch(NLMISC::EStream &)
{ {
MessageBox("Failed to save file!"); MessageBox(_T("Failed to save file!"));
return false; return false;
} }
@ -1355,7 +1355,7 @@ bool CSkeletonScaleDlg::loadSkelScaleFromStream(NLMISC::IStream &f)
} }
catch(NLMISC::EStream &) catch(NLMISC::EStream &)
{ {
MessageBox("Failed to save file!"); MessageBox(_T("Failed to save file!"));
return false; return false;
} }

View file

@ -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 type;
DWORD size; DWORD size;
@ -132,7 +132,7 @@ void CSnapshotToolDlg::stringFromRegistry(HKEY hKey, const char *name, CString &
//**************************************************************************************** //****************************************************************************************
template <class T, class U> void integralTypeFromRegistry(HKEY hKey, const char *name, T &dest, const U &defaultValue) template <class T, class U> void integralTypeFromRegistry(HKEY hKey, const TCHAR *name, T &dest, const U &defaultValue)
{ {
if (hKey == 0) if (hKey == 0)
{ {
@ -163,8 +163,9 @@ void CSnapshotToolDlg::fromRegistry()
{ {
HKEY hKey = 0; HKEY hKey = 0;
RegOpenKeyEx(HKEY_CURRENT_USER, NEL_OV_SNAPSHOT_TOOL_REGKEY, 0, KEY_READ, &hKey); RegOpenKeyEx(HKEY_CURRENT_USER, NEL_OV_SNAPSHOT_TOOL_REGKEY, 0, KEY_READ, &hKey);
stringFromRegistry(hKey, "InputPath", m_InputPath, ""); stringFromRegistry(hKey, _T("InputPath"), m_InputPath, "");
stringFromRegistry(hKey, "OutputPath", m_OutputPath, ""); stringFromRegistry(hKey, _T("OutputPath"), m_OutputPath, "");
CString filters; CString filters;
stringFromRegistry(hKey, "Filters", filters, "*.shape"); stringFromRegistry(hKey, "Filters", filters, "*.shape");
std::string stdFilters((LPCTSTR) filters); std::string stdFilters((LPCTSTR) filters);
@ -176,19 +177,19 @@ void CSnapshotToolDlg::fromRegistry()
m_Filters.AddString(filterList[k].c_str()); m_Filters.AddString(filterList[k].c_str());
} }
integralTypeFromRegistry(hKey, "RecurseSubFolder", (int &) m_RecurseSubFolder, FALSE); integralTypeFromRegistry(hKey, _T("RecurseSubFolder"), (int &) m_RecurseSubFolder, FALSE);
integralTypeFromRegistry(hKey, "DumpTextureSets", (int &) m_DumpTextureSets, TRUE); integralTypeFromRegistry(hKey, _T("DumpTextureSets"), (int &) m_DumpTextureSets, TRUE);
integralTypeFromRegistry(hKey, "PostFixViewName", (int &) m_PostFixViewName, TRUE); integralTypeFromRegistry(hKey, _T("PostFixViewName"), (int &) m_PostFixViewName, TRUE);
integralTypeFromRegistry(hKey, "ViewBack", (int &) m_ViewBack, FALSE); integralTypeFromRegistry(hKey, _T("ViewBack"), (int &) m_ViewBack, FALSE);
integralTypeFromRegistry(hKey, "ViewBottom", (int &) m_ViewBottom, FALSE); integralTypeFromRegistry(hKey, _T("ViewBottom"), (int &) m_ViewBottom, FALSE);
integralTypeFromRegistry(hKey, "ViewFront", (int &) m_ViewFront, TRUE); integralTypeFromRegistry(hKey, _T("ViewFront"), (int &) m_ViewFront, TRUE);
integralTypeFromRegistry(hKey, "ViewLeft", (int &) m_ViewLeft, FALSE); integralTypeFromRegistry(hKey, _T("ViewLeft"), (int &) m_ViewLeft, FALSE);
integralTypeFromRegistry(hKey, "ViewRight", (int &) m_ViewRight, FALSE); integralTypeFromRegistry(hKey, _T("ViewRight"), (int &) m_ViewRight, FALSE);
integralTypeFromRegistry(hKey, "ViewTop", (int &) m_ViewTop, FALSE); integralTypeFromRegistry(hKey, _T("ViewTop"), (int &) m_ViewTop, FALSE);
integralTypeFromRegistry(hKey, "OutputWidth", m_OutputWidth, 128); integralTypeFromRegistry(hKey, _T("OutputWidth"), m_OutputWidth, 128);
integralTypeFromRegistry(hKey, "OutputHeight", m_OutputHeight, 128); integralTypeFromRegistry(hKey, _T("OutputHeight"), m_OutputHeight, 128);
integralTypeFromRegistry(hKey, "Format", m_Format, 0); integralTypeFromRegistry(hKey, _T("Format"), m_Format, 0);
integralTypeFromRegistry(hKey, "OutputPathOption", m_OutputPathOption, 1); integralTypeFromRegistry(hKey, _T("OutputPathOption"), m_OutputPathOption, 1);
UpdateData(FALSE); UpdateData(FALSE);
updateUIEnabledState(); updateUIEnabledState();
} }
@ -200,8 +201,8 @@ void CSnapshotToolDlg::toRegistry()
HKEY hKey; HKEY hKey;
if (RegCreateKey(HKEY_CURRENT_USER, NEL_OV_SNAPSHOT_TOOL_REGKEY, &hKey)==ERROR_SUCCESS) 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, _T("InputPath"), 0, REG_SZ, (BYTE*) (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("OutputPath"), 0, REG_SZ, (BYTE*) (LPCTSTR) m_OutputPath, m_OutputPath.GetLength() + 1);
CString filters; CString filters;
for (uint k = 0; k < (uint) m_Filters.GetCount(); ++k) for (uint k = 0; k < (uint) m_Filters.GetCount(); ++k)
{ {
@ -210,7 +211,8 @@ void CSnapshotToolDlg::toRegistry()
m_Filters.GetText(k, filter); m_Filters.GetText(k, filter);
filters += 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 recurseSubFolder = m_RecurseSubFolder;
DWORD dumpTextureSets = m_DumpTextureSets; DWORD dumpTextureSets = m_DumpTextureSets;
DWORD views [] = DWORD views [] =
@ -227,19 +229,19 @@ void CSnapshotToolDlg::toRegistry()
DWORD format = m_Format; DWORD format = m_Format;
DWORD outputPathOption = m_OutputPathOption; DWORD outputPathOption = m_OutputPathOption;
DWORD postFixViewName = m_PostFixViewName; DWORD postFixViewName = m_PostFixViewName;
integralTypeFromRegistry(hKey, "PostFixViewName", (int &) m_PostFixViewName, TRUE); integralTypeFromRegistry(hKey, _T("PostFixViewName"), (int &) m_PostFixViewName, TRUE);
RegSetValueEx(hKey, "ViewBack", 0, REG_DWORD, (const BYTE *) &m_ViewBack, sizeof(DWORD)); RegSetValueEx(hKey, _T("ViewBack"), 0, REG_DWORD, (const BYTE *) &m_ViewBack, sizeof(DWORD));
RegSetValueEx(hKey, "ViewBottom", 0, REG_DWORD, (const BYTE *) &m_ViewBottom, sizeof(DWORD)); RegSetValueEx(hKey, _T("ViewBottom"), 0, REG_DWORD, (const BYTE *) &m_ViewBottom, sizeof(DWORD));
RegSetValueEx(hKey, "ViewFront", 0, REG_DWORD, (const BYTE *) &m_ViewFront, sizeof(DWORD)); RegSetValueEx(hKey, _T("ViewFront"), 0, REG_DWORD, (const BYTE *) &m_ViewFront, sizeof(DWORD));
RegSetValueEx(hKey, "ViewLeft", 0, REG_DWORD, (const BYTE *) &m_ViewLeft, sizeof(DWORD)); RegSetValueEx(hKey, _T("ViewLeft"), 0, REG_DWORD, (const BYTE *) &m_ViewLeft, sizeof(DWORD));
RegSetValueEx(hKey, "ViewRight", 0, REG_DWORD, (const BYTE *) &m_ViewRight, sizeof(DWORD)); RegSetValueEx(hKey, _T("ViewRight"), 0, REG_DWORD, (const BYTE *) &m_ViewRight, sizeof(DWORD));
RegSetValueEx(hKey, "ViewTop", 0, REG_DWORD, (const BYTE *) &m_ViewTop, sizeof(DWORD)); RegSetValueEx(hKey, _T("ViewTop"), 0, REG_DWORD, (const BYTE *) &m_ViewTop, sizeof(DWORD));
RegSetValueEx(hKey, "RecurseSubFolder", 0, REG_DWORD, (const BYTE *) &recurseSubFolder, sizeof(DWORD)); RegSetValueEx(hKey, _T("RecurseSubFolder"), 0, REG_DWORD, (const BYTE *) &recurseSubFolder, sizeof(DWORD));
RegSetValueEx(hKey, "DumpTextureSets", 0, REG_DWORD, (const BYTE *) &dumpTextureSets, sizeof(DWORD)); RegSetValueEx(hKey, _T("DumpTextureSets"), 0, REG_DWORD, (const BYTE *) &dumpTextureSets, sizeof(DWORD));
RegSetValueEx(hKey, "OutputWidth", 0, REG_DWORD, (const BYTE *) &width, sizeof(DWORD)); RegSetValueEx(hKey, _T("OutputWidth"), 0, REG_DWORD, (const BYTE *) &width, sizeof(DWORD));
RegSetValueEx(hKey, "OutputHeight", 0, REG_DWORD, (const BYTE *) &height, sizeof(DWORD)); RegSetValueEx(hKey, _T("OutputHeight"), 0, REG_DWORD, (const BYTE *) &height, sizeof(DWORD));
RegSetValueEx(hKey, "Format", 0, REG_DWORD, (const BYTE *) &format, sizeof(DWORD)); RegSetValueEx(hKey, _T("Format"), 0, REG_DWORD, (const BYTE *) &format, sizeof(DWORD));
RegSetValueEx(hKey, "OutputPathOption", 0, REG_DWORD, (const BYTE *) &outputPathOption, sizeof(DWORD)); RegSetValueEx(hKey, _T("OutputPathOption"), 0, REG_DWORD, (const BYTE *) &outputPathOption, sizeof(DWORD));
} }
} }

View file

@ -137,7 +137,7 @@ private:
void fromRegistry(); void fromRegistry();
// Save the options chosen in the snapshot tool ui into the registry. // Save the options chosen in the snapshot tool ui into the registry.
void toRegistry(); 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(); void updateUIEnabledState();
static void setCamFromView(uint view, NL3D::CCamera *cam, const NLMISC::CAABBox &bbox); static void setCamFromView(uint view, NL3D::CCamera *cam, const NLMISC::CAABBox &bbox);

View file

@ -67,7 +67,7 @@ bool CSoundAnimView::registerClass()
_WndClass = AfxRegisterWndClass(CS_VREDRAW | CS_HREDRAW, ::LoadCursor(NULL, IDC_ARROW), (HBRUSH) ::GetStockObject(WHITE_BRUSH)); _WndClass = AfxRegisterWndClass(CS_VREDRAW | CS_HREDRAW, ::LoadCursor(NULL, IDC_ARROW), (HBRUSH) ::GetStockObject(WHITE_BRUSH));
// Do some additional initialization of static veriables // 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)); _FillBrush.CreateSolidBrush(RGB(230, 245, 245));
_MarkerBrush.CreateSolidBrush(RGB(0, 0, 0)); _MarkerBrush.CreateSolidBrush(RGB(0, 0, 0));
_SelectBrush.CreateSolidBrush(RGB(0, 210, 210)); _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);
} }
// ******************************************************** // ********************************************************

View file

@ -178,7 +178,7 @@ void CSoundSystem::play(const string &soundName)
} }
else 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 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;
} }
return NULL; return NULL;

View file

@ -210,7 +210,7 @@ void CStartStopParticleSystem::updateUIFromState()
if (!getCurrPS()) if (!getCurrPS())
{ {
GetDlgItem(IDC_ACTIVE_PS)->SetWindowText(getStrRsc(IDS_NO_ACTIVE_PS)); 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_ENABLE_AUTO_COUNT)->EnableWindow(FALSE);
GetDlgItem(IDC_RESET_COUNT)->EnableWindow(FALSE); GetDlgItem(IDC_RESET_COUNT)->EnableWindow(FALSE);
((CButton *) GetDlgItem(IDC_ENABLE_AUTO_COUNT))->SetCheck(0); ((CButton *) GetDlgItem(IDC_ENABLE_AUTO_COUNT))->SetCheck(0);
@ -235,7 +235,7 @@ void CStartStopParticleSystem::updateUIFromState()
} }
else else
{ {
GetDlgItem(IDC_STICK_BONE)->SetWindowText(""); GetDlgItem(IDC_STICK_BONE)->SetWindowText(_T(""));
} }
GetDlgItem(IDC_ACTIVE_PS)->SetWindowText(_ActiveNode->getFilename().c_str()); GetDlgItem(IDC_ACTIVE_PS)->SetWindowText(_ActiveNode->getFilename().c_str());
GetDlgItem(IDC_ENABLE_AUTO_COUNT)->EnableWindow(TRUE); GetDlgItem(IDC_ENABLE_AUTO_COUNT)->EnableWindow(TRUE);

View file

@ -332,13 +332,13 @@ void CTextureAnimDlg::CGradientInterface::CTextureWrapper::set(NL3D::ITexture *t
if (t->getWidth() != tex->getWidth() || t->getHeight() != tex->getHeight()) 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; return;
} }
if (t->PixelFormat != tex->PixelFormat) 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; return;
} }
} }

View file

@ -100,7 +100,7 @@ void CValueGradientDlg::OnAddValue()
UpdateData(); UpdateData();
++_Size; ++_Size;
_ClientInterface->modifyGradient(IValueGradientDlgClient::Add, 0); _ClientInterface->modifyGradient(IValueGradientDlgClient::Add, 0);
m_GradientList.AddString("value"); m_GradientList.AddString(_T("value"));
m_RemoveCtrl.EnableWindow(TRUE); m_RemoveCtrl.EnableWindow(TRUE);
m_GradientList.SetCurSel(_Size - 1); m_GradientList.SetCurSel(_Size - 1);
@ -116,7 +116,7 @@ void CValueGradientDlg::OnInsertValue()
uint oldIndex = m_GradientList.GetCurSel(); uint oldIndex = m_GradientList.GetCurSel();
++_Size; ++_Size;
_ClientInterface->modifyGradient(IValueGradientDlgClient::Insert, m_GradientList.GetCurSel()); _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.Invalidate();
m_GradientList.SetCurSel(oldIndex); m_GradientList.SetCurSel(oldIndex);
OnSelchangeGradientList(); OnSelchangeGradientList();
@ -185,7 +185,7 @@ BOOL CValueGradientDlg::OnInitDialog()
m_GradientList.InitStorage(_Size, 16); m_GradientList.InitStorage(_Size, 16);
for (uint k = 0; k < _Size; ++k) for (uint k = 0; k < _Size; ++k)
{ {
m_GradientList.AddString("value"); m_GradientList.AddString(_T("value"));
} }
m_RemoveCtrl.EnableWindow(_Size > _MinSize ? TRUE : FALSE); m_RemoveCtrl.EnableWindow(_Size > _MinSize ? TRUE : FALSE);
m_GradientList.SetCurSel(0); m_GradientList.SetCurSel(0);

View file

@ -289,7 +289,7 @@ void CVegetableCopyDlg::OnOK()
} }
else 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);
} }
} }

View file

@ -198,8 +198,9 @@ void CVegetableDensityPage::updateViewAngleMin()
sint pos= (sint)(angle/(NLMISC::Pi/2) * NL_VEGETABLE_EDIT_ANGLE_SLIDER_SIZE); 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); NLMISC::clamp(pos, -NL_VEGETABLE_EDIT_ANGLE_SLIDER_SIZE, NL_VEGETABLE_EDIT_ANGLE_SLIDER_SIZE);
AngleMinSlider.SetPos(pos); 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); AngleMinEdit.SetWindowText(stmp);
} }
@ -213,8 +214,9 @@ void CVegetableDensityPage::updateViewAngleMax()
sint pos= (sint)(angle/(NLMISC::Pi/2) * NL_VEGETABLE_EDIT_ANGLE_SLIDER_SIZE); 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); NLMISC::clamp(pos, -NL_VEGETABLE_EDIT_ANGLE_SLIDER_SIZE, NL_VEGETABLE_EDIT_ANGLE_SLIDER_SIZE);
AngleMaxSlider.SetPos(pos); 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); AngleMaxEdit.SetWindowText(stmp);
} }

View file

@ -1111,7 +1111,7 @@ static void restoreDecimalSeparator()
///======================================================================= ///=======================================================================
float toFloatMax(const char *src) float toFloatMax(const TCHAR *src)
{ {
float result = 0.f; float result = 0.f;
if (toFloatMax(src, result)) return result; 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(); setDecimalSeparatorAsPoint();
std::string str(src); std::string str(src);

View file

@ -1092,9 +1092,9 @@ private:
/** replacment for sprintf scanf (because of localisation in max) /** 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 // 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(float value);
std::string toStringMax(int value); std::string toStringMax(int value);