doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LightDlg.h
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 #if !defined(AFX_LIGHTDLG_H__9DF57520_ED11_4BD8_968A_F6A7E34167D2__INCLUDED_)
29 #define AFX_LIGHTDLG_H__9DF57520_ED11_4BD8_968A_F6A7E34167D2__INCLUDED_
30 
31 #if _MSC_VER > 1000
32 #pragma once
33 #endif // _MSC_VER > 1000
34 
35 #include "GLWidget.h"
36 
37 class CLightInfo {
38 public:
39  CLightInfo();
40 
41  bool pointLight;
42  float fallOff;
43  CString strTexture;
53  bool fog;
55 
56  bool strobe;
57  float strobeSpeed;
58  bool rotate;
59  float rotateSpeed;
60 
65  bool hasCenter;
66  bool isParallel;
67 
68  void Defaults();
69  void DefaultProjected();
70  void DefaultPoint();
71  void FromDict( const idDict *e );
72  void ToDict( idDict *e );
73  void ToDictFromDifferences( idDict *e, const idDict *differences );
74  void ToDictWriteAllInfo( idDict *e );
75 };
76 
78 // CLightDlg dialog
79 
80 class CLightDlg : public CDialog {
81 public:
82  CLightDlg(CWnd* pParent = NULL); // standard constructor
83  ~CLightDlg();
84 
85  void UpdateDialogFromLightInfo( void );
86  void UpdateDialog( bool updateChecks );
87  void UpdateLightInfoFromDialog( void );
88  void UpdateColor( float r, float g, float b, float a );
89  void SetSpecifics();
90  void EnableControls();
91  void LoadLightTextures();
92  void ColorButtons();
93  void SaveLightInfo( const idDict *differences );
94 
95 // Dialog Data
96  //{{AFX_DATA(CLightDlg)
97  enum { IDD = IDD_DIALOG_LIGHT };
99  CComboBox m_wndLights;
100  CSliderCtrl m_wndFalloff;
105  float m_fFallloff;
111  float m_fEndX;
112  float m_fEndY;
113  float m_fEndZ;
114  float m_fRadiusX;
115  float m_fRadiusY;
116  float m_fRadiusZ;
117  float m_fRightX;
118  float m_fRightY;
119  float m_fRightZ;
120  float m_fRotate;
121  float m_fStartX;
122  float m_fStartY;
123  float m_fStartZ;
124  float m_fTargetX;
125  float m_fTargetY;
126  float m_fTargetZ;
127  float m_fUpX;
128  float m_fUpY;
129  float m_fUpZ;
131  float m_centerX;
132  float m_centerY;
133  float m_centerZ;
135  //}}AFX_DATA
136 
137 
138 // Overrides
139  // ClassWizard generated virtual function overrides
140  //{{AFX_VIRTUAL(CLightDlg)
141  public:
142  virtual BOOL DestroyWindow();
143  protected:
144  virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
145  //}}AFX_VIRTUAL
146 
147 // Implementation
148 protected:
149 
150  // Generated message map functions
151  //{{AFX_MSG(CLightDlg)
152  virtual BOOL OnInitDialog();
153  afx_msg void OnDestroy();
154  afx_msg void OnBtnTexture();
155  afx_msg void OnCheckEqualradius();
156  afx_msg void OnCheckExplicitfalloff();
157  afx_msg void OnCheckPoint();
158  afx_msg void OnCheckProjected();
159  afx_msg void OnRadioFalloff();
160  virtual void OnOK();
161  afx_msg void OnApply();
162  afx_msg void OnBtnColor();
163  afx_msg void OnBtnFog();
164  afx_msg void OnCheckFog();
165  afx_msg void OnCheckRotate();
166  afx_msg void OnCheckStrobe();
167  virtual void OnCancel();
168  afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
169  afx_msg void OnSelchangeComboTexture();
170  afx_msg void OnCheckCenter();
171  afx_msg void OnCheckParallel();
172  afx_msg void OnApplyDifferences();
173  //}}AFX_MSG
174  DECLARE_MESSAGE_MAP()
175 
176 private:
177  CBitmap colorBitmap;
178  CBitmap fogBitmap;
183 };
184 
185 //{{AFX_INSERT_LOCATION}}
186 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
187 
188 #endif // !defined(AFX_LIGHTDLG_H__9DF57520_ED11_4BD8_968A_F6A7E34167D2__INCLUDED_)
void UpdateColor(float r, float g, float b, float a)
Definition: LightDlg.cpp:850
float strobeSpeed
Definition: LightDlg.h:57
GLubyte g
Definition: glext.h:4662
BOOL m_bPointLight
Definition: LightDlg.h:103
BOOL m_bExplicitFalloff
Definition: LightDlg.h:102
float m_fUpZ
Definition: LightDlg.h:129
#define IDD_DIALOG_LIGHT
float m_fUpX
Definition: LightDlg.h:127
float m_fTargetX
Definition: LightDlg.h:124
afx_msg void OnSelchangeComboTexture()
Definition: LightDlg.cpp:896
float m_fEndZ
Definition: LightDlg.h:113
afx_msg void OnCheckPoint()
Definition: LightDlg.cpp:689
idGLDrawableMaterial * m_drawMaterial
Definition: LightDlg.h:182
virtual BOOL OnInitDialog()
Definition: LightDlg.cpp:646
float m_centerX
Definition: LightDlg.h:131
BOOL m_bCheckProjected
Definition: LightDlg.h:104
CONST PIXELFORMATDESCRIPTOR UINT
Definition: win_qgl.cpp:47
bool equalRadius
Definition: LightDlg.h:44
#define private
Definition: TypeInfo.cpp:30
void ToDictWriteAllInfo(idDict *e)
Definition: LightDlg.cpp:174
afx_msg void OnCheckCenter()
Definition: LightDlg.cpp:911
float m_fStartX
Definition: LightDlg.h:121
afx_msg void OnCheckProjected()
Definition: LightDlg.cpp:696
idVec3 color
Definition: LightDlg.h:181
afx_msg HBRUSH OnCtlColor(CDC *pDC, CWnd *pWnd, UINT nCtlColor)
Definition: LightDlg.cpp:878
afx_msg void OnDestroy()
Definition: LightDlg.cpp:664
bool castSpecular
Definition: LightDlg.h:63
bool castShadows
Definition: LightDlg.h:62
idVec3 lightStart
Definition: LightDlg.h:46
bool explicitStartEnd
Definition: LightDlg.h:45
bool rotate
Definition: LightDlg.h:58
virtual BOOL DestroyWindow()
Definition: LightDlg.cpp:885
Definition: Vector.h:316
BOOL m_bSpecular
Definition: LightDlg.h:109
idVec3 lightTarget
Definition: LightDlg.h:50
CLightInfo lightInfo
Definition: LightDlg.h:179
float m_fStartZ
Definition: LightDlg.h:123
BOOL m_bIsParallel
Definition: LightDlg.h:134
idGLWidget m_wndPreview
Definition: LightDlg.h:98
void DefaultPoint()
Definition: LightDlg.cpp:74
#define BOOL
Definition: mprintf.c:71
CBitmap fogBitmap
Definition: LightDlg.h:178
idVec3 lightCenter
Definition: LightDlg.h:51
float m_fUpY
Definition: LightDlg.h:128
bool castDiffuse
Definition: LightDlg.h:64
CSliderCtrl m_wndFalloff
Definition: LightDlg.h:100
float m_fRadiusX
Definition: LightDlg.h:114
void LoadLightTextures()
Definition: LightDlg.cpp:632
float fallOff
Definition: LightDlg.h:42
float m_fRightZ
Definition: LightDlg.h:119
BOOL m_bRotate
Definition: LightDlg.h:107
void SaveLightInfo(const idDict *differences)
Definition: LightDlg.cpp:571
Definition: Vector.h:808
idVec3 color
Definition: LightDlg.h:52
void UpdateLightInfoFromDialog(void)
Definition: LightDlg.cpp:504
void UpdateDialogFromLightInfo(void)
Definition: LightDlg.cpp:443
afx_msg void OnCheckRotate()
idVec3 lightRight
Definition: LightDlg.h:49
idVec3 lightEnd
Definition: LightDlg.h:47
float m_fStartY
Definition: LightDlg.h:122
float m_fEndY
Definition: LightDlg.h:112
CString strTexture
Definition: LightDlg.h:43
void ColorButtons()
Definition: LightDlg.cpp:611
Definition: Dict.h:65
#define NULL
Definition: Lib.h:88
CComboBox m_wndLights
Definition: LightDlg.h:99
afx_msg void OnRadioFalloff()
Definition: LightDlg.cpp:703
afx_msg void OnBtnTexture()
Definition: LightDlg.cpp:671
afx_msg void OnCheckEqualradius()
Definition: LightDlg.cpp:677
int m_nFalloff
Definition: LightDlg.h:106
float m_fTargetZ
Definition: LightDlg.h:126
float m_fFallloff
Definition: LightDlg.h:105
GLubyte GLubyte GLubyte a
Definition: glext.h:4662
CLightDlg(CWnd *pParent=NULL)
Definition: LightDlg.cpp:279
float m_fTargetY
Definition: LightDlg.h:125
idVec3 lightUp
Definition: LightDlg.h:48
CBitmap colorBitmap
Definition: LightDlg.h:177
void FromDict(const idDict *e)
Definition: LightDlg.cpp:91
afx_msg void OnCheckParallel()
Definition: LightDlg.cpp:926
GLubyte GLubyte b
Definition: glext.h:4662
idVec3 lightRadius
Definition: LightDlg.h:61
idVec4 fogDensity
Definition: LightDlg.h:54
float m_fRightY
Definition: LightDlg.h:118
bool fog
Definition: LightDlg.h:53
void SetSpecifics()
Definition: LightDlg.cpp:389
BOOL m_bEqualRadius
Definition: LightDlg.h:101
BOOL m_hasCenter
Definition: LightDlg.h:130
GLdouble GLdouble GLdouble r
Definition: glext.h:2951
void ToDict(idDict *e)
Definition: LightDlg.cpp:205
float m_fRadiusZ
Definition: LightDlg.h:116
float m_centerZ
Definition: LightDlg.h:133
float m_fRotate
Definition: LightDlg.h:120
afx_msg void OnApplyDifferences()
Definition: LightDlg.cpp:943
afx_msg void OnCheckExplicitfalloff()
Definition: LightDlg.cpp:683
afx_msg void OnCheckStrobe()
virtual void OnOK()
Definition: LightDlg.cpp:707
void Defaults()
Definition: LightDlg.cpp:45
virtual void OnCancel()
Definition: LightDlg.cpp:874
void DefaultProjected()
Definition: LightDlg.cpp:81
bool isParallel
Definition: LightDlg.h:66
afx_msg void OnApply()
Definition: LightDlg.cpp:839
CLightInfo lightInfoOriginal
Definition: LightDlg.h:180
void EnableControls()
Definition: LightDlg.cpp:406
BOOL m_bDiffuse
Definition: LightDlg.h:110
BOOL m_bShadows
Definition: LightDlg.h:108
afx_msg void OnBtnFog()
float m_centerY
Definition: LightDlg.h:132
virtual void DoDataExchange(CDataExchange *pDX)
Definition: LightDlg.cpp:325
float m_fEndX
Definition: LightDlg.h:111
bool strobe
Definition: LightDlg.h:56
bool hasCenter
Definition: LightDlg.h:65
float m_fRightX
Definition: LightDlg.h:117
float m_fRadiusY
Definition: LightDlg.h:115
void ToDictFromDifferences(idDict *e, const idDict *differences)
Definition: LightDlg.cpp:159
afx_msg void OnBtnColor()
Definition: LightDlg.cpp:860
bool pointLight
Definition: LightDlg.h:41
float rotateSpeed
Definition: LightDlg.h:59
afx_msg void OnCheckFog()
void UpdateDialog(bool updateChecks)
Definition: LightDlg.cpp:724