Changed: Minor changes

This commit is contained in:
kervala 2016-11-17 10:30:59 +01:00
parent 6c2b248af1
commit 68eb6448fb
4 changed files with 118 additions and 118 deletions

View file

@ -85,7 +85,7 @@ END_MESSAGE_MAP()
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// CAnimationDlg message handlers // CAnimationDlg message handlers
void CAnimationDlg::OnEnd() void CAnimationDlg::OnEnd()
{ {
UpdateData (); UpdateData ();
CurrentFrame=End; CurrentFrame=End;
@ -95,7 +95,7 @@ void CAnimationDlg::OnEnd()
updateBar (); updateBar ();
} }
void CAnimationDlg::OnPlay() void CAnimationDlg::OnPlay()
{ {
// play // play
UpdateData (); UpdateData ();
@ -111,7 +111,7 @@ void CAnimationDlg::OnPlay()
Main->enableFXs(true); Main->enableFXs(true);
} }
void CAnimationDlg::OnStop() void CAnimationDlg::OnStop()
{ {
// Is checked ? // Is checked ?
UpdateData (); UpdateData ();
@ -124,7 +124,7 @@ void CAnimationDlg::OnStop()
Main->enableFXs(false); Main->enableFXs(false);
} }
void CAnimationDlg::OnChangeCurrentFrame() void CAnimationDlg::OnChangeCurrentFrame()
{ {
// TODO: If this is a RICHEDIT control, the control will not // TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog() // send this notification unless you override the CDialog::OnInitDialog()
@ -133,7 +133,7 @@ void CAnimationDlg::OnChangeCurrentFrame()
// Update values // Update values
UpdateData (); UpdateData ();
// Clamp current frame // Clamp current frame
clamp (UICurrentFrame, (int)Start, (int)End); clamp (UICurrentFrame, (int)Start, (int)End);
CurrentFrame=(float)UICurrentFrame; CurrentFrame=(float)UICurrentFrame;
@ -141,21 +141,21 @@ void CAnimationDlg::OnChangeCurrentFrame()
// Update // Update
updateBar (); updateBar ();
UpdateData (FALSE); UpdateData (FALSE);
} }
void CAnimationDlg::OnChangeEndEdit() void CAnimationDlg::OnChangeEndEdit()
{ {
// TODO: If this is a RICHEDIT control, the control will not // TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog() // send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask() // function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask. // with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here // TODO: Add your control notification handler code here
// Update values // Update values
UpdateData (); UpdateData ();
// Clamp current frame // Clamp current frame
if (End<Start) if (End<Start)
Start=End; Start=End;
@ -167,17 +167,17 @@ void CAnimationDlg::OnChangeEndEdit()
UICurrentFrame=(int)CurrentFrame; UICurrentFrame=(int)CurrentFrame;
// Update // Update
UpdateData (FALSE); UpdateData (FALSE);
Main->setAnimTime (Start, End); Main->setAnimTime (Start, End);
} }
void CAnimationDlg::OnChangeSpeed() void CAnimationDlg::OnChangeSpeed()
{ {
// TODO: If this is a RICHEDIT control, the control will not // TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog() // send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask() // function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask. // with the ENM_CHANGE flag ORed into the mask.
UpdateData(); UpdateData();
if (Speed<=0.001f) if (Speed<=0.001f)
Speed=0.001f; Speed=0.001f;
@ -187,7 +187,7 @@ void CAnimationDlg::OnChangeSpeed()
Main->setAnimTime (Start, End); Main->setAnimTime (Start, End);
} }
void CAnimationDlg::OnStart() void CAnimationDlg::OnStart()
{ {
UpdateData (); UpdateData ();
CurrentFrame=Start; CurrentFrame=Start;
@ -197,16 +197,16 @@ void CAnimationDlg::OnStart()
updateBar (); updateBar ();
} }
void CAnimationDlg::OnChangeStartEdit() void CAnimationDlg::OnChangeStartEdit()
{ {
// TODO: If this is a RICHEDIT control, the control will not // TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog() // send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask() // function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask. // with the ENM_CHANGE flag ORed into the mask.
// Update values // Update values
UpdateData (); UpdateData ();
// Clamp current frame // Clamp current frame
if (End<Start) if (End<Start)
End=Start; End=Start;
@ -218,11 +218,11 @@ void CAnimationDlg::OnChangeStartEdit()
UICurrentFrame=(int)CurrentFrame; UICurrentFrame=(int)CurrentFrame;
// Update // Update
UpdateData (FALSE); UpdateData (FALSE);
Main->setAnimTime (Start, End); Main->setAnimTime (Start, End);
} }
void CAnimationDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) void CAnimationDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{ {
// TODO: Add your message handler code here and/or call default // TODO: Add your message handler code here and/or call default
@ -290,7 +290,7 @@ void CAnimationDlg::handle ()
float backup = CurrentFrame; float backup = CurrentFrame;
CurrentFrame=(float)fmod ((CurrentFrame-Start), End-Start)+Start; CurrentFrame=(float)fmod ((CurrentFrame-Start), End-Start)+Start;
if (backup!=CurrentFrame) if (backup!=CurrentFrame)
{ {
LastFrame = CurrentFrame; LastFrame = CurrentFrame;
Main->enableFXs(false); Main->enableFXs(false);
Main->enableFXs(true); Main->enableFXs(true);
@ -306,7 +306,7 @@ void CAnimationDlg::handle ()
// Stop animation // Stop animation
OnStop (); OnStop ();
} }
if (CurrentFrame<Start) if (CurrentFrame<Start)
{ {
@ -331,10 +331,10 @@ void CAnimationDlg::handle ()
LastTime=newTime; LastTime=newTime;
} }
BOOL CAnimationDlg::OnInitDialog() BOOL CAnimationDlg::OnInitDialog()
{ {
CDialog::OnInitDialog(); CDialog::OnInitDialog();
// Stop // Stop
LastTime=NLMISC::CTime::getLocalTime (); LastTime=NLMISC::CTime::getLocalTime ();
StopCtrl.SetCheck (1); StopCtrl.SetCheck (1);
@ -345,7 +345,7 @@ BOOL CAnimationDlg::OnInitDialog()
// Update the time line // Update the time line
updateBar (); updateBar ();
return TRUE; // return TRUE unless you set the focus to a control return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE // EXCEPTION: OCX Property Pages should return FALSE
} }
@ -363,7 +363,7 @@ void CAnimationDlg::updateBar ()
{ {
// Update value // Update value
UpdateData(); UpdateData();
// Set cursor position // Set cursor position
int position; int position;
if (fabs (End-Start)<0.00001f) if (fabs (End-Start)<0.00001f)
@ -389,7 +389,7 @@ NL3D::TAnimationTime CAnimationDlg::getLastTime ()
return LastFrame/Speed; return LastFrame/Speed;
} }
void CAnimationDlg::OnDestroy() void CAnimationDlg::OnDestroy()
{ {
setRegisterWindowState (this, REGKEY_OBJ_VIEW_ANIMATION_DLG); setRegisterWindowState (this, REGKEY_OBJ_VIEW_ANIMATION_DLG);
@ -412,9 +412,9 @@ void CAnimationDlg::setCurrentFrame (float currentFrame)
} }
BOOL CAnimationDlg::EnableWindow(BOOL enable /*=TRUE*/) BOOL CAnimationDlg::EnableWindow(BOOL enable /*=TRUE*/)
{ {
PlayCtrl.EnableWindow(Playing && enable); PlayCtrl.EnableWindow(Playing && enable);
StopCtrl.EnableWindow(FALSE); StopCtrl.EnableWindow(FALSE);
FRWCtrl.EnableWindow(enable); FRWCtrl.EnableWindow(enable);
FFWCtrl.EnableWindow(enable); FFWCtrl.EnableWindow(enable);
TimeLineCtrl.EnableWindow(enable); TimeLineCtrl.EnableWindow(enable);

View file

@ -46,7 +46,7 @@ public:
CButton StopCtrl; CButton StopCtrl;
float End; float End;
float Speed; float Speed;
float Start; float Start;
BOOL Loop; BOOL Loop;
int UICurrentFrame; int UICurrentFrame;
BOOL Inplace; BOOL Inplace;

View file

@ -55,10 +55,10 @@ END_MESSAGE_MAP()
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// CLBExternIDDlg message handlers // CLBExternIDDlg message handlers
BOOL CLBExternIDDlg::OnInitDialog() BOOL CLBExternIDDlg::OnInitDialog()
{ {
CDialog::OnInitDialog(); CDialog::OnInitDialog();
GetDlgItem(IDC_ID_VALUE)->EnableWindow(_ID != 0); GetDlgItem(IDC_ID_VALUE)->EnableWindow(_ID != 0);
((CButton *) GetDlgItem(IDC_ENABLE_EXTERN_ID))->SetCheck(_ID != 0 ? 1 : 0); ((CButton *) GetDlgItem(IDC_ENABLE_EXTERN_ID))->SetCheck(_ID != 0 ? 1 : 0);
@ -70,17 +70,17 @@ BOOL CLBExternIDDlg::OnInitDialog()
#ifdef NL_LITTLE_ENDIAN #ifdef NL_LITTLE_ENDIAN
val[k] = (unsigned char) (_ID >> ((3 - k) << 3)); val[k] = (unsigned char) (_ID >> ((3 - k) << 3));
#else #else
val[k] = (unsigned char) (_ID >> (k << 3)); val[k] = (unsigned char) (_ID >> (k << 3));
#endif #endif
} }
val[4] = '\0'; val[4] = '\0';
GetDlgItem(IDC_ID_VALUE)->SetWindowText(val); GetDlgItem(IDC_ID_VALUE)->SetWindowText(val);
} }
else else
{ {
_ID = 0; _ID = 0;
} }
return TRUE; // return TRUE unless you set the focus to a control return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE // EXCEPTION: OCX Property Pages should return FALSE
} }
@ -90,14 +90,14 @@ static uint32 StringToID(const char *buf)
{ {
uint32 id; uint32 id;
#ifdef NL_LITTLE_ENDIAN #ifdef NL_LITTLE_ENDIAN
id = ((uint32) buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3]); id = ((uint32) buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3]);
#else #else
id = *(uint32 *) buf; id = *(uint32 *) buf;
#endif #endif
return id; return id;
} }
void CLBExternIDDlg::OnEnableExternId() void CLBExternIDDlg::OnEnableExternId()
{ {
if (_ID == 0) if (_ID == 0)
{ {
@ -110,11 +110,11 @@ void CLBExternIDDlg::OnEnableExternId()
GetDlgItem(IDC_ID_VALUE)->EnableWindow(FALSE); GetDlgItem(IDC_ID_VALUE)->EnableWindow(FALSE);
GetDlgItem(IDC_ID_VALUE)->SetWindowText(""); GetDlgItem(IDC_ID_VALUE)->SetWindowText("");
_ID = 0; _ID = 0;
} }
} }
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]; char buf[6];
::memset(buf, 0, 6); ::memset(buf, 0, 6);
@ -133,7 +133,7 @@ void CLBExternIDDlg::OnChangeIdValue()
else else
{ {
GetDlgItem(IDOK)->EnableWindow(FALSE); GetDlgItem(IDOK)->EnableWindow(FALSE);
GetDlgItem(IDC_ENABLE_EXTERN_ID)->EnableWindow(FALSE); GetDlgItem(IDC_ENABLE_EXTERN_ID)->EnableWindow(FALSE);
} }
} }

View file

@ -42,7 +42,7 @@
#include "ribbon_dlg.h" #include "ribbon_dlg.h"
using NL3D::CPSLocatedBindable; using NL3D::CPSLocatedBindable;
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@ -55,7 +55,7 @@ CLocatedBindableDialog::CLocatedBindableDialog(CParticleWorkspace::CNode *ownerN
{ {
//{{AFX_DATA_INIT(CLocatedBindableDialog) //{{AFX_DATA_INIT(CLocatedBindableDialog)
m_IndependantSizes = FALSE; m_IndependantSizes = FALSE;
//}}AFX_DATA_INIT //}}AFX_DATA_INIT
} }
/// dtor /// dtor
@ -78,7 +78,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
NL3D::CParticleSystem *ps = _Bindable->getOwner()->getOwner(); NL3D::CParticleSystem *ps = _Bindable->getOwner()->getOwner();
if (ps->isSharingEnabled()) if (ps->isSharingEnabled())
{ {
GetDlgItem(IDC_NO_AUTO_LOD)->ShowWindow(TRUE); GetDlgItem(IDC_NO_AUTO_LOD)->ShowWindow(TRUE);
if (ps->isAutoLODEnabled() == false) if (ps->isAutoLODEnabled() == false)
{ {
@ -111,7 +111,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
NL3D::CPSMaterial *material = dynamic_cast<NL3D::CPSMaterial *>(_Bindable); NL3D::CPSMaterial *material = dynamic_cast<NL3D::CPSMaterial *>(_Bindable);
// blending mode // blending mode
m_BlendingMode.SetCurSel((uint) material->getBlendingMode() ); m_BlendingMode.SetCurSel((uint) material->getBlendingMode() );
// z-test // z-test
((CButton *) GetDlgItem(IDC_ZTEST))->SetCheck(material->isZTestEnabled() ? BST_CHECKED : BST_UNCHECKED); ((CButton *) GetDlgItem(IDC_ZTEST))->SetCheck(material->isZTestEnabled() ? BST_CHECKED : BST_UNCHECKED);
// z-bias // z-bias
GetDlgItem(IDC_ZBIAS)->SetWindowText(NLMISC::toString("%.2f", -material->getZBias()).c_str()); GetDlgItem(IDC_ZBIAS)->SetWindowText(NLMISC::toString("%.2f", -material->getZBias()).c_str());
@ -126,7 +126,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
} }
GetDlgItem(IDC_ALIGN_ON_MOTION)->ShowWindow(SW_HIDE); GetDlgItem(IDC_ALIGN_ON_MOTION)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_ZALIGN)->ShowWindow(SW_HIDE); GetDlgItem(IDC_ZALIGN)->ShowWindow(SW_HIDE);
// enable disable z-test // enable disable z-test
// //
if (dynamic_cast<NL3D::CPSParticle *>(_Bindable)) if (dynamic_cast<NL3D::CPSParticle *>(_Bindable))
{ {
@ -147,12 +147,12 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
// check support for color // check support for color
if (dynamic_cast<NL3D::CPSColoredParticle *>(_Bindable)) if (dynamic_cast<NL3D::CPSColoredParticle *>(_Bindable))
{ {
CAttribDlgRGBA *ad = new CAttribDlgRGBA("PARTICLE_COLOR", _Node); CAttribDlgRGBA *ad = new CAttribDlgRGBA("PARTICLE_COLOR", _Node);
pushWnd(ad); pushWnd(ad);
_ColorWrapper.S = dynamic_cast<NL3D::CPSColoredParticle *>(_Bindable); _ColorWrapper.S = dynamic_cast<NL3D::CPSColoredParticle *>(_Bindable);
ad->setWrapper(&_ColorWrapper); ad->setWrapper(&_ColorWrapper);
ad->setSchemeWrapper(&_ColorWrapper); ad->setSchemeWrapper(&_ColorWrapper);
HBITMAP bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PARTICLE_COLOR)); HBITMAP bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PARTICLE_COLOR));
@ -169,13 +169,13 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
// check support for angle 2D // check support for angle 2D
if (dynamic_cast<NL3D::CPSRotated2DParticle *>(_Bindable)) if (dynamic_cast<NL3D::CPSRotated2DParticle *>(_Bindable))
{ {
CAttribDlgFloat *ad = new CAttribDlgFloat("PARTICLE_ANGLE2D", _Node, 0.f, 256.f); CAttribDlgFloat *ad = new CAttribDlgFloat("PARTICLE_ANGLE2D", _Node, 0.f, 256.f);
pushWnd(ad); pushWnd(ad);
_Angle2DWrapper.S = dynamic_cast<NL3D::CPSRotated2DParticle *>(_Bindable); _Angle2DWrapper.S = dynamic_cast<NL3D::CPSRotated2DParticle *>(_Bindable);
ad->setWrapper(&_Angle2DWrapper); ad->setWrapper(&_Angle2DWrapper);
ad->setSchemeWrapper(&_Angle2DWrapper); ad->setSchemeWrapper(&_Angle2DWrapper);
HBITMAP bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PARTICLE_ANGLE)); HBITMAP bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PARTICLE_ANGLE));
ad->init(bmh, xPos, yPos, this); ad->init(bmh, xPos, yPos, this);
@ -183,7 +183,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
yPos += rect.bottom + 3; yPos += rect.bottom + 3;
} }
CAttribDlgPlaneBasis *pb = NULL; CAttribDlgPlaneBasis *pb = NULL;
@ -199,7 +199,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
pb->init(bmh, xPos, yPos, this); pb->init(bmh, xPos, yPos, this);
pb->GetClientRect(&rect); pb->GetClientRect(&rect);
yPos += rect.bottom + 3; yPos += rect.bottom + 3;
} }
// check support for precomputed rotations // check support for precomputed rotations
@ -236,14 +236,14 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
_MotionBlurThresholdWrapper.P = fla; _MotionBlurThresholdWrapper.P = fla;
mbc->setWrapper(&_MotionBlurThresholdWrapper); mbc->setWrapper(&_MotionBlurThresholdWrapper);
mbc->init(xPos + 140, yPos, this); mbc->init(xPos + 140, yPos, this);
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("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);
yPos += rect.bottom + 3; yPos += rect.bottom + 3;
GetDlgItem(IDC_ALIGN_ON_MOTION)->ShowWindow(SW_SHOW); GetDlgItem(IDC_ALIGN_ON_MOTION)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_ZALIGN)->ShowWindow(SW_SHOW); GetDlgItem(IDC_ZALIGN)->ShowWindow(SW_SHOW);
((CButton *) GetDlgItem(IDC_ALIGN_ON_MOTION))->SetCheck(fla->getAlignOnMotion()); ((CButton *) GetDlgItem(IDC_ALIGN_ON_MOTION))->SetCheck(fla->getAlignOnMotion());
@ -256,7 +256,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
{ {
NL3D::CPSShockWave *sw = static_cast<NL3D::CPSShockWave *>(_Bindable); NL3D::CPSShockWave *sw = static_cast<NL3D::CPSShockWave *>(_Bindable);
CEditableRangeFloat *rc = new CEditableRangeFloat(std::string("RADIUS CUT"), _Node, 0, 1); CEditableRangeFloat *rc = new CEditableRangeFloat(std::string("RADIUS CUT"), _Node, 0, 1);
pushWnd(rc); pushWnd(rc);
_RadiusCutWrapper.S = sw; _RadiusCutWrapper.S = sw;
rc->setWrapper(&_RadiusCutWrapper); rc->setWrapper(&_RadiusCutWrapper);
rc->init(xPos + 140, yPos, this); rc->init(xPos + 140, yPos, this);
@ -277,7 +277,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
snbs->setWrapper(&_ShockWaveNbSegWrapper); snbs->setWrapper(&_ShockWaveNbSegWrapper);
snbs->init(xPos + 140, yPos, this); snbs->init(xPos + 140, yPos, this);
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("Nb segs", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this);
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);
@ -291,13 +291,13 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
_ShockWaveUFactorWrapper.S = sw; _ShockWaveUFactorWrapper.S = sw;
uvd->setWrapper(&_ShockWaveUFactorWrapper); uvd->setWrapper(&_ShockWaveUFactorWrapper);
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("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;
} }
// fanlight // fanlight
@ -325,7 +325,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
_FanLightSmoothnessWrapper.P = static_cast<NL3D::CPSFanLight *>(_Bindable); _FanLightSmoothnessWrapper.P = static_cast<NL3D::CPSFanLight *>(_Bindable);
nbf->setWrapper(&_FanLightSmoothnessWrapper); nbf->setWrapper(&_FanLightSmoothnessWrapper);
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("Phase smoothnes:", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this);
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);
@ -334,11 +334,11 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
yPos += rect.bottom + 3; yPos += rect.bottom + 3;
CEditableRangeFloat *nbfp = new CEditableRangeFloat(std::string("FAN_LIGHT_PHASE"), _Node, 0, 4.f); CEditableRangeFloat *nbfp = new CEditableRangeFloat(std::string("FAN_LIGHT_PHASE"), _Node, 0, 4.f);
pushWnd(nbfp); pushWnd(nbfp);
_FanLightPhaseWrapper.P = static_cast<NL3D::CPSFanLight *>(_Bindable); _FanLightPhaseWrapper.P = static_cast<NL3D::CPSFanLight *>(_Bindable);
nbfp->setWrapper(&_FanLightPhaseWrapper); nbfp->setWrapper(&_FanLightPhaseWrapper);
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("Fan light speed :", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this);
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);
@ -347,11 +347,11 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
yPos += rect.bottom + 3; yPos += rect.bottom + 3;
nbfp = new CEditableRangeFloat(std::string("FAN_LIGHT_INTENSITY"), _Node, 0, 4.f); nbfp = new CEditableRangeFloat(std::string("FAN_LIGHT_INTENSITY"), _Node, 0, 4.f);
pushWnd(nbfp); pushWnd(nbfp);
_FanLightIntensityWrapper.P = static_cast<NL3D::CPSFanLight *>(_Bindable); _FanLightIntensityWrapper.P = static_cast<NL3D::CPSFanLight *>(_Bindable);
nbfp->setWrapper(&_FanLightIntensityWrapper); nbfp->setWrapper(&_FanLightIntensityWrapper);
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("Fan light intensity:", SS_LEFT, CRect(xPos, yPos + 16, xPos + 139, yPos + 48), this);
s->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW);
@ -383,8 +383,8 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
{ {
nbs->enableUpperBound(256, true); nbs->enableUpperBound(256, true);
} }
_TailParticleWrapper.P = dynamic_cast<NL3D::CPSTailParticle *>(_Bindable); _TailParticleWrapper.P = dynamic_cast<NL3D::CPSTailParticle *>(_Bindable);
nbs->setWrapper(&_TailParticleWrapper); nbs->setWrapper(&_TailParticleWrapper);
nbs->init(xPos + 140, yPos, this); nbs->init(xPos + 140, yPos, this);
@ -400,7 +400,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
CTailParticleDlg *tpd = new CTailParticleDlg(_Node, dynamic_cast<NL3D::CPSTailParticle *>(_Bindable)); CTailParticleDlg *tpd = new CTailParticleDlg(_Node, dynamic_cast<NL3D::CPSTailParticle *>(_Bindable));
pushWnd(tpd); pushWnd(tpd);
tpd->init(this, xPos, yPos); tpd->init(this, xPos, yPos);
tpd->GetClientRect(&rect); tpd->GetClientRect(&rect);
yPos += rect.bottom + 3; yPos += rect.bottom + 3;
} }
@ -429,7 +429,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
cmtd->GetClientRect(&rect); cmtd->GetClientRect(&rect);
yPos += rect.bottom + 3; yPos += rect.bottom + 3;
pushWnd(cmd); pushWnd(cmd);
pushWnd(cmtd); pushWnd(cmtd);
} }
@ -440,9 +440,9 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
CTextureAnimDlg *td = new CTextureAnimDlg(_Node, CTextureAnimDlg *td = new CTextureAnimDlg(_Node,
dynamic_cast<NL3D::CPSTexturedParticle *>(_Bindable), dynamic_cast<NL3D::CPSTexturedParticle *>(_Bindable),
dynamic_cast<NL3D::CPSMultiTexturedParticle *>(_Bindable) dynamic_cast<NL3D::CPSMultiTexturedParticle *>(_Bindable)
); );
pushWnd(td); pushWnd(td);
td->init(xPos, yPos, this); td->init(xPos, yPos, this);
td->GetClientRect(&rect); td->GetClientRect(&rect);
yPos += rect.bottom + 3; yPos += rect.bottom + 3;
@ -453,7 +453,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
{ {
NL3D::CPSTexturedParticleNoAnim *tp = dynamic_cast<NL3D::CPSTexturedParticleNoAnim *>(_Bindable); NL3D::CPSTexturedParticleNoAnim *tp = dynamic_cast<NL3D::CPSTexturedParticleNoAnim *>(_Bindable);
_TextureNoAnimWrapper.TP = tp; _TextureNoAnimWrapper.TP = tp;
CTextureChooser *tc = new CTextureChooser(dynamic_cast<NL3D::CPSMultiTexturedParticle *>(_Bindable), _Node); CTextureChooser *tc = new CTextureChooser(dynamic_cast<NL3D::CPSMultiTexturedParticle *>(_Bindable), _Node);
tc->enableRemoveButton(); tc->enableRemoveButton();
tc->setWrapper(&_TextureNoAnimWrapper); tc->setWrapper(&_TextureNoAnimWrapper);
pushWnd(tc); pushWnd(tc);
@ -465,8 +465,8 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
// ribbon texture (doesn't support texture animation for now) // ribbon texture (doesn't support texture animation for now)
if (dynamic_cast<NL3D::CPSRibbon *>(_Bindable)) if (dynamic_cast<NL3D::CPSRibbon *>(_Bindable))
{ {
// add dialog for uv tuning with ribbon // add dialog for uv tuning with ribbon
CEditableRangeFloat *uvd = new CEditableRangeFloat(std::string("RIBBON UFACTOR"), _Node, 0, 5); CEditableRangeFloat *uvd = new CEditableRangeFloat(std::string("RIBBON UFACTOR"), _Node, 0, 5);
pushWnd(uvd); pushWnd(uvd);
@ -486,7 +486,7 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
_RibbonVFactorWrapper.R = static_cast<NL3D::CPSRibbon *>(_Bindable); _RibbonVFactorWrapper.R = static_cast<NL3D::CPSRibbon *>(_Bindable);
uvd->setWrapper(&_RibbonVFactorWrapper); uvd->setWrapper(&_RibbonVFactorWrapper);
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("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)));
@ -494,11 +494,11 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
uvd->GetClientRect(&rect); uvd->GetClientRect(&rect);
yPos += rect.bottom + 3; yPos += rect.bottom + 3;
} }
if (dynamic_cast<NL3D::CPSRibbonBase *>(_Bindable)) if (dynamic_cast<NL3D::CPSRibbonBase *>(_Bindable))
{ {
// add dialog for uv tuning with ribbon // add dialog for uv tuning with ribbon
CEditableRangeFloat *sd = new CEditableRangeFloat(std::string("SEGMENT DURATION"), _Node, 0.05f, 0.5f); CEditableRangeFloat *sd = new CEditableRangeFloat(std::string("SEGMENT DURATION"), _Node, 0.05f, 0.5f);
sd->enableLowerBound(0, true); sd->enableLowerBound(0, true);
@ -514,13 +514,13 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
sd->GetClientRect(&rect); sd->GetClientRect(&rect);
yPos += rect.bottom + 3; yPos += rect.bottom + 3;
} }
// 'look at' independant sizes // 'look at' independant sizes
bool isLookAt = dynamic_cast<NL3D::CPSFaceLookAt *>(_Bindable) != NULL; bool isLookAt = dynamic_cast<NL3D::CPSFaceLookAt *>(_Bindable) != NULL;
GetDlgItem(IDC_INDE_SIZES)->ShowWindow(isLookAt ? SW_SHOW : SW_HIDE); GetDlgItem(IDC_INDE_SIZES)->ShowWindow(isLookAt ? SW_SHOW : SW_HIDE);
GetDlgItem(IDC_SIZE_WIDTH)->ShowWindow(isLookAt ? SW_SHOW : SW_HIDE); GetDlgItem(IDC_SIZE_WIDTH)->ShowWindow(isLookAt ? SW_SHOW : SW_HIDE);
GetDlgItem(IDC_SIZE_HEIGHT)->ShowWindow(isLookAt ? SW_SHOW : SW_HIDE); GetDlgItem(IDC_SIZE_HEIGHT)->ShowWindow(isLookAt ? SW_SHOW : SW_HIDE);
GetDlgItem(IDC_WIDTH_HEIGHT_BOX)->ShowWindow(isLookAt ? SW_SHOW : SW_HIDE); GetDlgItem(IDC_WIDTH_HEIGHT_BOX)->ShowWindow(isLookAt ? SW_SHOW : SW_HIDE);
((CButton *) GetDlgItem(IDC_SIZE_WIDTH))->SetCheck(1); ((CButton *) GetDlgItem(IDC_SIZE_WIDTH))->SetCheck(1);
if (isLookAt) if (isLookAt)
{ {
@ -539,8 +539,8 @@ void CLocatedBindableDialog::init(CParticleDlg* pParent)
pushWnd(rd); pushWnd(rd);
rd->GetClientRect(&rect); rd->GetClientRect(&rect);
yPos += rect.bottom + 3; yPos += rect.bottom + 3;
} }
} }
UpdateData(); UpdateData();
} }
@ -580,7 +580,7 @@ END_MESSAGE_MAP()
void CLocatedBindableDialog::touchPSState() void CLocatedBindableDialog::touchPSState()
{ {
if (_Node && _Node->getPSModel()) if (_Node && _Node->getPSModel())
{ {
_Node->getPSModel()->touchTransparencyState(); _Node->getPSModel()->touchTransparencyState();
_Node->getPSModel()->touchLightableState(); _Node->getPSModel()->touchLightableState();
} }
@ -588,19 +588,19 @@ void CLocatedBindableDialog::touchPSState()
//*********************************************************************************** //***********************************************************************************
void CLocatedBindableDialog::OnSelchangeBlendingMode() void CLocatedBindableDialog::OnSelchangeBlendingMode()
{ {
UpdateData(); UpdateData();
NL3D::CPSMaterial *m = dynamic_cast<NL3D::CPSMaterial *>(_Bindable); NL3D::CPSMaterial *m = dynamic_cast<NL3D::CPSMaterial *>(_Bindable);
nlassert(m); nlassert(m);
m->setBlendingMode( (NL3D::CPSMaterial::TBlendingMode) m_BlendingMode.GetCurSel()); m->setBlendingMode( (NL3D::CPSMaterial::TBlendingMode) m_BlendingMode.GetCurSel());
touchPSState(); touchPSState();
updateModifiedFlag(); updateModifiedFlag();
} }
//*********************************************************************************** //***********************************************************************************
void CLocatedBindableDialog::updateIndependantSizes() void CLocatedBindableDialog::updateIndependantSizes()
{ {
UpdateData(); UpdateData();
// make sure we are dealing with 'LookAt' for now // make sure we are dealing with 'LookAt' for now
@ -613,7 +613,7 @@ void CLocatedBindableDialog::updateIndependantSizes()
//*********************************************************************************** //***********************************************************************************
// user asked for independant sizes // user asked for independant sizes
void CLocatedBindableDialog::OnIndeSizes() void CLocatedBindableDialog::OnIndeSizes()
{ {
UpdateData(); UpdateData();
// make sure we are dealing with 'LookAt' for now // make sure we are dealing with 'LookAt' for now
@ -621,13 +621,13 @@ void CLocatedBindableDialog::OnIndeSizes()
NL3D::CPSFaceLookAt *la = static_cast<NL3D::CPSFaceLookAt *>(_Bindable); NL3D::CPSFaceLookAt *la = static_cast<NL3D::CPSFaceLookAt *>(_Bindable);
la->setIndependantSizes(m_IndependantSizes ? true : false /* VCC warning*/); la->setIndependantSizes(m_IndependantSizes ? true : false /* VCC warning*/);
updateIndependantSizes(); updateIndependantSizes();
updateSizeControl(); updateSizeControl();
updateModifiedFlag(); updateModifiedFlag();
} }
//*********************************************************************************** //***********************************************************************************
uint CLocatedBindableDialog::updateSizeControl() uint CLocatedBindableDialog::updateSizeControl()
{ {
HBITMAP bmh; HBITMAP bmh;
if (!dynamic_cast<NL3D::CPSSizedParticle *>(_Bindable)) return 0; if (!dynamic_cast<NL3D::CPSSizedParticle *>(_Bindable)) return 0;
// if a previous control was there, remove it // if a previous control was there, remove it
@ -645,7 +645,7 @@ uint CLocatedBindableDialog::updateSizeControl()
int editWidth = (((CButton *) GetDlgItem(IDC_SIZE_WIDTH))->GetCheck()); int editWidth = (((CButton *) GetDlgItem(IDC_SIZE_WIDTH))->GetCheck());
_SizeCtrl = new CAttribDlgFloat(editWidth ? "PARTICLE_WIDTH" : "PARTICLE_HEIGHT", _Node, 0.f, 1.f); _SizeCtrl = new CAttribDlgFloat(editWidth ? "PARTICLE_WIDTH" : "PARTICLE_HEIGHT", _Node, 0.f, 1.f);
if (editWidth) // wrap to the wanted size if (editWidth) // wrap to the wanted size
{ {
_SizeWrapper.S = fla; _SizeWrapper.S = fla;
@ -656,8 +656,8 @@ uint CLocatedBindableDialog::updateSizeControl()
} }
_SizeCtrl->setWrapper(&_SizeWrapper); _SizeCtrl->setWrapper(&_SizeWrapper);
_SizeCtrl->setSchemeWrapper(&_SizeWrapper); _SizeCtrl->setSchemeWrapper(&_SizeWrapper);
bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(editWidth ? IDB_PARTICLE_WIDTH : IDB_PARTICLE_HEIGHT)); bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(editWidth ? IDB_PARTICLE_WIDTH : IDB_PARTICLE_HEIGHT));
} }
else // general case. Wrap to the size interface and the appropriate dialog else // general case. Wrap to the size interface and the appropriate dialog
{ {
@ -666,29 +666,29 @@ uint CLocatedBindableDialog::updateSizeControl()
_SizeWrapper.S = dynamic_cast<NL3D::CPSSizedParticle *>(_Bindable); _SizeWrapper.S = dynamic_cast<NL3D::CPSSizedParticle *>(_Bindable);
_SizeCtrl->setWrapper(&_SizeWrapper); _SizeCtrl->setWrapper(&_SizeWrapper);
_SizeCtrl->setSchemeWrapper(&_SizeWrapper); _SizeCtrl->setSchemeWrapper(&_SizeWrapper);
bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PARTICLE_SIZE)); bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PARTICLE_SIZE));
} }
RECT rect; RECT rect;
_SizeCtrl->init(bmh, _SizeCtrlX, _SizeCtrlY, this); _SizeCtrl->init(bmh, _SizeCtrlX, _SizeCtrlY, this);
_SizeCtrl->GetClientRect(&rect); _SizeCtrl->GetClientRect(&rect);
return rect.bottom + 3; return rect.bottom + 3;
} }
//*********************************************************************************** //***********************************************************************************
void CLocatedBindableDialog::OnSizeWidth() void CLocatedBindableDialog::OnSizeWidth()
{ {
updateSizeControl(); updateSizeControl();
} }
//*********************************************************************************** //***********************************************************************************
void CLocatedBindableDialog::OnSizeHeight() void CLocatedBindableDialog::OnSizeHeight()
{ {
updateSizeControl(); updateSizeControl();
} }
//*********************************************************************************** //***********************************************************************************
void CLocatedBindableDialog::OnNoAutoLod() void CLocatedBindableDialog::OnNoAutoLod()
{ {
NL3D::CPSParticle *p = NLMISC::safe_cast<NL3D::CPSParticle *>(_Bindable); NL3D::CPSParticle *p = NLMISC::safe_cast<NL3D::CPSParticle *>(_Bindable);
p->disableAutoLOD(((CButton *) GetDlgItem(IDC_NO_AUTO_LOD))->GetCheck() != 0); p->disableAutoLOD(((CButton *) GetDlgItem(IDC_NO_AUTO_LOD))->GetCheck() != 0);
@ -696,8 +696,8 @@ void CLocatedBindableDialog::OnNoAutoLod()
} }
//*********************************************************************************** //***********************************************************************************
void CLocatedBindableDialog::OnGlobalColorLighting() void CLocatedBindableDialog::OnGlobalColorLighting()
{ {
NL3D::CPSParticle *p = NLMISC::safe_cast<NL3D::CPSParticle *>(_Bindable); NL3D::CPSParticle *p = NLMISC::safe_cast<NL3D::CPSParticle *>(_Bindable);
p->enableGlobalColorLighting(((CButton *) GetDlgItem(ID_GLOBAL_COLOR_LIGHTING))->GetCheck() == 1); p->enableGlobalColorLighting(((CButton *) GetDlgItem(ID_GLOBAL_COLOR_LIGHTING))->GetCheck() == 1);
touchPSState(); touchPSState();
@ -705,12 +705,12 @@ void CLocatedBindableDialog::OnGlobalColorLighting()
} }
//*********************************************************************************** //***********************************************************************************
void CLocatedBindableDialog::OnAlignOnMotion() void CLocatedBindableDialog::OnAlignOnMotion()
{ {
bool align = ((CButton *) GetDlgItem(IDC_ALIGN_ON_MOTION))->GetCheck() != 0; bool align = ((CButton *) GetDlgItem(IDC_ALIGN_ON_MOTION))->GetCheck() != 0;
NL3D::CPSFaceLookAt *fla = NLMISC::safe_cast<NL3D::CPSFaceLookAt *>(_Bindable); NL3D::CPSFaceLookAt *fla = NLMISC::safe_cast<NL3D::CPSFaceLookAt *>(_Bindable);
fla->setAlignOnMotion(align); fla->setAlignOnMotion(align);
updateValidWndForAlignOnMotion(align); updateValidWndForAlignOnMotion(align);
updateModifiedFlag(); updateModifiedFlag();
} }
@ -723,10 +723,10 @@ void CLocatedBindableDialog::updateValidWndForAlignOnMotion(bool align)
CEditAttribDlg *ead = dynamic_cast<CEditAttribDlg *>(_MotionBlurWnd[k]); CEditAttribDlg *ead = dynamic_cast<CEditAttribDlg *>(_MotionBlurWnd[k]);
if (ead) if (ead)
{ {
ead->EnableWindow(enable); // enable window not virtual in CWnd ... ead->EnableWindow(enable); // enable window not virtual in CWnd ...
} }
else else
{ {
_MotionBlurWnd[k]->EnableWindow(enable); _MotionBlurWnd[k]->EnableWindow(enable);
} }
} }
@ -734,7 +734,7 @@ void CLocatedBindableDialog::updateValidWndForAlignOnMotion(bool align)
} }
//*********************************************************************************** //***********************************************************************************
void CLocatedBindableDialog::OnZtest() void CLocatedBindableDialog::OnZtest()
{ {
UpdateData(); UpdateData();
NL3D::CPSMaterial *mat = dynamic_cast<NL3D::CPSMaterial *>(_Bindable); NL3D::CPSMaterial *mat = dynamic_cast<NL3D::CPSMaterial *>(_Bindable);
@ -762,7 +762,7 @@ void CLocatedBindableDialog::updateZBias()
{ {
CString value; CString value;
m_ZBias.GetWindowText(value); m_ZBias.GetWindowText(value);
float zbias = 0.f; float zbias = 0.f;
int dummy; // to test if end of string as no not wanted extra characters int dummy; // to test if end of string as no not wanted extra characters
if (sscanf((LPCTSTR) (value + "\n0"), "%f\n%d", &zbias, &dummy) == 2) if (sscanf((LPCTSTR) (value + "\n0"), "%f\n%d", &zbias, &dummy) == 2)
{ {
@ -782,28 +782,28 @@ void CLocatedBindableDialog::updateZBias()
} }
//*************************************************************************************************************************** //***************************************************************************************************************************
void CLocatedBindableDialog::OnChangeZbias() void CLocatedBindableDialog::OnChangeZbias()
{ {
UpdateData(); UpdateData();
// Trick to track "Enter" keypress: CEdit are multiline. If GetLineCount()>1, then // Trick to track "Enter" keypress: CEdit are multiline. If GetLineCount()>1, then
// user has press enter. // user has press enter.
if(m_ZBias.GetLineCount()>1) if(m_ZBias.GetLineCount()>1)
{ {
// must ccat 2 lines of the CEdit. // must ccat 2 lines of the CEdit.
concatEdit2Lines(m_ZBias); concatEdit2Lines(m_ZBias);
updateZBias(); updateZBias();
} }
} }
//*************************************************************************************************************************** //***************************************************************************************************************************
void CLocatedBindableDialog::OnKillfocusZbias() void CLocatedBindableDialog::OnKillfocusZbias()
{ {
updateZBias(); updateZBias();
} }
//*************************************************************************************************************************** //***************************************************************************************************************************
void CLocatedBindableDialog::OnZalign() void CLocatedBindableDialog::OnZalign()
{ {
bool align = ((CButton *) GetDlgItem(IDC_ZALIGN))->GetCheck() != 0; bool align = ((CButton *) GetDlgItem(IDC_ZALIGN))->GetCheck() != 0;
NL3D::CPSFaceLookAt *fla = NLMISC::safe_cast<NL3D::CPSFaceLookAt *>(_Bindable); NL3D::CPSFaceLookAt *fla = NLMISC::safe_cast<NL3D::CPSFaceLookAt *>(_Bindable);
fla->setAlignOnZAxis(align); fla->setAlignOnZAxis(align);