| 1 | /* |
| 2 | * Descent 3 |
| 3 | * Copyright (C) 2024 Parallax Software |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | --- HISTORICAL COMMENTS FOLLOW --- |
| 19 | |
| 20 | * $Logfile: /DescentIII/Main/editor/LightingDialog.h $ |
| 21 | * $Revision: 1.1.1.1 $ |
| 22 | * $Date: 2003-08-26 03:57:38 $ |
| 23 | * $Author: kevinb $ |
| 24 | * |
| 25 | * Lighting keypad dialog |
| 26 | * |
| 27 | * $Log: not supported by cvs2svn $ |
| 28 | * |
| 29 | * 37 8/17/99 4:09p Matt |
| 30 | * Added some accelerator keys, and a function to copy face light |
| 31 | * multiples. |
| 32 | * |
| 33 | * 36 5/05/99 12:58a Matt |
| 34 | * Added button to clear the lightmaps on a level. |
| 35 | * |
| 36 | * 35 4/03/99 7:55p Matt |
| 37 | * Use new keypad update system instead of timer to update. |
| 38 | * |
| 39 | * 34 3/24/99 5:54p Jason |
| 40 | * |
| 41 | * 33 2/18/99 12:33p Jason |
| 42 | * added room multiplier |
| 43 | * |
| 44 | * 32 1/21/99 12:22p Jason |
| 45 | * adding strobing and flickering |
| 46 | * |
| 47 | * 31 1/15/99 2:33p Jason |
| 48 | * added global multiplier |
| 49 | * |
| 50 | * 30 8/04/98 11:52a Jason |
| 51 | * added reverse corona check |
| 52 | * |
| 53 | * 29 7/24/98 4:44p Jason |
| 54 | * added corona button functionality |
| 55 | * |
| 56 | * 28 6/05/98 5:22p Jason |
| 57 | * added volumetric fog |
| 58 | * |
| 59 | * 27 5/26/98 5:56p Jason |
| 60 | * only render coronas which are flagged |
| 61 | * |
| 62 | * 26 5/20/98 5:44p Jason |
| 63 | * incremental checkin for bumpmapping |
| 64 | * |
| 65 | * 25 4/24/98 12:58p Jason |
| 66 | * added functions to resave all bitmaps |
| 67 | * |
| 68 | * 24 4/21/98 2:36p Jason |
| 69 | * added some lighting options |
| 70 | * |
| 71 | * 23 4/02/98 12:23p Jason |
| 72 | * trimmed some fat from our structures |
| 73 | * |
| 74 | * 22 2/10/98 5:09p Jason |
| 75 | * added a SetRoomPulse function for settinng pulse parameters for an |
| 76 | * entire room |
| 77 | * |
| 78 | * 21 2/10/98 3:50p Jason |
| 79 | * added pulsing walls |
| 80 | * |
| 81 | * 20 2/04/98 8:25p Jason |
| 82 | * added light multiplier for faces |
| 83 | * |
| 84 | * 19 12/31/97 12:51p Jason |
| 85 | * debugged and implementd BSP tree for lighting |
| 86 | * |
| 87 | * 18 12/16/97 4:17p Jason |
| 88 | * added ignore_satellites and ignore terrain |
| 89 | * |
| 90 | * 17 12/10/97 12:23p Jason |
| 91 | * added "SuperDetail" |
| 92 | * |
| 93 | * |
| 94 | * 16 12/05/97 12:34p Jason |
| 95 | * added ambient light to the terrain |
| 96 | * |
| 97 | * 15 11/28/97 6:41p Jason |
| 98 | * added functions to blur lightmaps - not very helpful though |
| 99 | * |
| 100 | * 14 11/25/97 12:28p Jason |
| 101 | * another pass at shadows |
| 102 | * |
| 103 | * 13 11/19/97 12:39p Jason |
| 104 | * added dynamic terrain button |
| 105 | * |
| 106 | * 12 11/14/97 6:39p Jason |
| 107 | * added ability to do lighting on a single room |
| 108 | * |
| 109 | * 11 11/14/97 1:13p Jason |
| 110 | * added better light counting |
| 111 | * |
| 112 | * 10 10/28/97 3:41p Jason |
| 113 | * added "use hemicubes" option |
| 114 | * |
| 115 | * 9 10/10/97 1:10p Jason |
| 116 | * more support for volumetrics |
| 117 | * |
| 118 | * 8 10/10/97 11:38a Jason |
| 119 | * put in better volumetric support |
| 120 | * |
| 121 | * 7 9/25/97 4:47p Jason |
| 122 | * update alpha edit box via timer |
| 123 | * |
| 124 | * 6 9/23/97 5:53p Jason |
| 125 | * added more custom options to radiosity |
| 126 | * |
| 127 | * 5 9/04/97 12:12p Jason |
| 128 | * added lightmap visibility |
| 129 | * |
| 130 | * 4 9/02/97 11:47a Jason |
| 131 | * Got alpha per vertex working |
| 132 | * |
| 133 | * 3 8/27/97 5:19p Jason |
| 134 | * added "Count lights" |
| 135 | * |
| 136 | * 2 8/26/97 4:36p Jason |
| 137 | * added terrain radiosity |
| 138 | * |
| 139 | * 7 6/03/97 4:55p Mark |
| 140 | * |
| 141 | * 6 5/30/97 5:45p Jason |
| 142 | * changes to support user-definable lighting parameters |
| 143 | * |
| 144 | * 5 2/20/97 2:37p Mark |
| 145 | * |
| 146 | * 4 1/27/97 11:38a Samir |
| 147 | * Added horizontal scrolling of keypad modeless dialog. |
| 148 | * |
| 149 | * $NoKeywords: $ |
| 150 | */ |
| 151 | |
| 152 | #include "KeypadDialog.h" |
| 153 | |
| 154 | ///////////////////////////////////////////////////////////////////////////// |
| 155 | // CLightingDialog dialog |
| 156 | |
| 157 | class CLightingDialog : public CKeypadDialog { |
| 158 | // Construction |
| 159 | public: |
| 160 | CLightingDialog(CWnd *pParent = NULL); // standard constructor |
| 161 | void UpdateKeypad(int mask); |
| 162 | |
| 163 | // Dialog Data |
| 164 | //{{AFX_DATA(CLightingDialog) |
| 165 | enum { IDD = IDD_LIGHTINGKEYPAD }; |
| 166 | // NOTE: the ClassWizard will add data members here |
| 167 | //}}AFX_DATA |
| 168 | |
| 169 | // Overrides |
| 170 | // ClassWizard generated virtual function overrides |
| 171 | //{{AFX_VIRTUAL(CLightingDialog) |
| 172 | protected: |
| 173 | virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support |
| 174 | //}}AFX_VIRTUAL |
| 175 | |
| 176 | // Implementation |
| 177 | protected: |
| 178 | // Generated message map functions |
| 179 | //{{AFX_MSG(CLightingDialog) |
| 180 | afx_msg void OnSize(UINT nType, int cx, int cy); |
| 181 | afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar); |
| 182 | afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar); |
| 183 | afx_msg void OnLitepadSetdefault(); |
| 184 | afx_msg void OnLitepadSmoothall(); |
| 185 | afx_msg void OnKillfocusLightIterationEdit(); |
| 186 | virtual BOOL OnInitDialog(); |
| 187 | afx_msg BOOL OnHelpInfo(HELPINFO *pHelpInfo); |
| 188 | afx_msg void OnLitepadTerrainRadiosity(); |
| 189 | afx_msg void OnLitepadCountLights(); |
| 190 | afx_msg void OnLitepadNextvertex(); |
| 191 | afx_msg void OnPaint(); |
| 192 | afx_msg void OnKillfocusAlphaEdit(); |
| 193 | afx_msg void OnShowLightmaps(); |
| 194 | afx_msg void OnKillfocusHemicubeResEdit(); |
| 195 | afx_msg void OnKillfocusLightSpacingEdit(); |
| 196 | afx_msg void OnBestfitCheck(); |
| 197 | afx_msg void OnCreateVolumeCone(); |
| 198 | afx_msg void OnClearVolumetricRoom(); |
| 199 | afx_msg void OnFillVolumeTexture(); |
| 200 | afx_msg void OnKillfocusAngleEdit(); |
| 201 | afx_msg void OnKillfocusStartAlphaEdit(); |
| 202 | afx_msg void OnKillfocusResolutionEdit(); |
| 203 | afx_msg void OnEdgeVolumetric(); |
| 204 | afx_msg void OnKillfocusFalloffEdit(); |
| 205 | afx_msg void OnFarthestPoint(); |
| 206 | afx_msg void OnKillfocusPitchAngleEdit(); |
| 207 | afx_msg void OnKillfocusHeadingAngleEdit(); |
| 208 | afx_msg void OnHemicubeCheck(); |
| 209 | afx_msg void OnCountTerrainLights(); |
| 210 | afx_msg void OnCurroomRadiosity(); |
| 211 | afx_msg void OnDynamicTerrain(); |
| 212 | afx_msg void OnBlurLightmaps(); |
| 213 | afx_msg void OnKillfocusIgnoreLimitEdit(); |
| 214 | afx_msg void OnKillfocusRedAmbientEdit(); |
| 215 | afx_msg void OnKillfocusGreenAmbientEdit(); |
| 216 | afx_msg void OnKillfocusBlueAmbientEdit(); |
| 217 | afx_msg void OnElementCheck(); |
| 218 | afx_msg void OnIgnoreTerrain(); |
| 219 | afx_msg void OnIgnoreSatellites(); |
| 220 | afx_msg void OnUseBspCheck(); |
| 221 | afx_msg void OnKillfocusLightMultiplyEdit(); |
| 222 | afx_msg void OnKillfocusPulseTimeEdit(); |
| 223 | afx_msg void OnKillfocusPulseOffsetEdit(); |
| 224 | afx_msg void OnPulseRoom(); |
| 225 | afx_msg void OnResetMultiples(); |
| 226 | afx_msg void OnDestroyBsp(); |
| 227 | afx_msg void OnCombineFaces(); |
| 228 | afx_msg void OnVolumeLights(); |
| 229 | afx_msg void OnCoronaCheck(); |
| 230 | afx_msg void OnFogCheck(); |
| 231 | afx_msg void OnKillfocusFogDensity(); |
| 232 | afx_msg void OnKillfocusFogRed(); |
| 233 | afx_msg void OnKillfocusFogGreen(); |
| 234 | afx_msg void OnKillfocusFogBlue(); |
| 235 | afx_msg void OnRoomCoronas(); |
| 236 | afx_msg void OnMineCoronas(); |
| 237 | afx_msg void OnReverseCorona(); |
| 238 | afx_msg void OnKillfocusGlobalMultiplierEdit(); |
| 239 | afx_msg void OnStrobeCheck(); |
| 240 | afx_msg void OnFlickerCheck(); |
| 241 | afx_msg void OnKillfocusRoomMultiplierEdit(); |
| 242 | afx_msg void OnKillfocusRoomAmred(); |
| 243 | afx_msg void OnKillfocusRoomAmgreen(); |
| 244 | afx_msg void OnKillfocusRoomAmblue(); |
| 245 | afx_msg void OnClearLightmaps(); |
| 246 | afx_msg void OnCopyMultiplier(); |
| 247 | //}}AFX_MSG |
| 248 | DECLARE_MESSAGE_MAP() |
| 249 | |
| 250 | private: |
| 251 | void UpdateDialog(); |
| 252 | void ShootRayForLighting(vector *dest, vector *from, vector *to, int startseg); |
| 253 | int m_angle; |
| 254 | float m_start_alpha; |
| 255 | int m_resolution; |
| 256 | float m_falloff; |
| 257 | int m_pitch_angle; |
| 258 | int m_heading_angle; |
| 259 | }; |