1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 // edit_ps_light.cpp : implementation file
21 #include "object_viewer.h"
22 #include "edit_ps_light.h"
23 #include "attrib_dlg.h"
26 /////////////////////////////////////////////////////////////////////////////
27 // CEditPSLight dialog
30 //***************************************************************************************
31 CEditPSLight::CEditPSLight(CParticleWorkspace::CNode
*ownerNode
, NL3D::CPSLight
*light
)
37 //{{AFX_DATA_INIT(CEditPSLight)
38 // NOTE: the ClassWizard will add member initialization here
44 //***************************************************************************************
45 CEditPSLight::~CEditPSLight()
49 _ColorDlg
->DestroyWindow();
54 _AttenStartDlg
->DestroyWindow();
55 delete _AttenStartDlg
;
59 _AttenEndDlg
->DestroyWindow();
65 //***************************************************************************************
66 void CEditPSLight::DoDataExchange(CDataExchange
* pDX
)
68 CDialog::DoDataExchange(pDX
);
69 //{{AFX_DATA_MAP(CEditPSLight)
70 // NOTE: the ClassWizard will add DDX and DDV calls here
74 //***************************************************************************************
75 void CEditPSLight::init(CWnd
* pParent
/*=NULL*/)
77 Create(IDD_PS_LIGHT
, pParent
);
83 _ColorDlg
= new CAttribDlgRGBA("LIGHT_COLOR", _Node
);
84 _ColorWrapper
.L
= _Light
;
85 _ColorDlg
->setWrapper(&_ColorWrapper
);
86 _ColorDlg
->setSchemeWrapper(&_ColorWrapper
);
87 GetDlgItem(IDC_COLOR_PLACEHOLDER
)->GetWindowRect(&r
);
89 bmh
= LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PARTICLE_COLOR
));
90 _ColorDlg
->init(bmh
, r
.left
, r
.top
, this);
92 _AttenStartDlg
= new CAttribDlgFloat("LIGHT_ATTEN_START", _Node
, 0.01f
, 5.f
);
93 _AttenStartDlg
->enableLowerBound(0.01f
, true);
94 _AttenStartWrapper
.L
= _Light
;
95 _AttenStartDlg
->setWrapper(&_AttenStartWrapper
);
96 _AttenStartDlg
->setSchemeWrapper(&_AttenStartWrapper
);
97 GetDlgItem(IDC_ATTEN_START_PLACEHOLDER
)->GetWindowRect(&r
);
99 bmh
= LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_LIGHT_ATTEN_START
));
100 _AttenStartDlg
->init(bmh
, r
.left
, r
.top
, this);
102 _AttenEndDlg
= new CAttribDlgFloat("LIGHT_ATTEN_END", _Node
, 0.01f
, 5.f
);
103 _AttenEndDlg
->enableLowerBound(0.01f
, true);
104 _AttenEndWrapper
.L
= _Light
;
105 _AttenEndDlg
->setWrapper(&_AttenEndWrapper
);
106 _AttenEndDlg
->setSchemeWrapper(&_AttenEndWrapper
);
107 GetDlgItem(IDC_ATTEN_END_PLACEHOLDER
)->GetWindowRect(&r
);
109 bmh
= LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_LIGHT_ATTEN_END
));
110 _AttenEndDlg
->init(bmh
, r
.left
, r
.top
, this);
118 BEGIN_MESSAGE_MAP(CEditPSLight
, CDialog
)
119 //{{AFX_MSG_MAP(CEditPSLight)
120 // NOTE: the ClassWizard will add message map macros here
124 /////////////////////////////////////////////////////////////////////////////
125 // CEditPSLight message handlers