/*
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see .
*/
#if !defined(AFX_GLOBALLIGHTOPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_)
#define AFX_GLOBALLIGHTOPTIONS_H__6B56E20C_582E_4030_A251_879097C8853C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GLOBALLIGHTOPTIONS.h : header file
//
#include "WBPopupSlider.h"
#include "resource.h"
#include "CButtonShowColor.h"
/////////////////////////////////////////////////////////////////////////////
/// GlobalLightOptions modeless (floating) dialog - allows entry and display of brush width and feather.
#define GLOBALLIGHT_OPTIONS_PANEL_SECTION "LightOptionsWindow"
class GlobalLightOptions : public CDialog , public PopupSliderOwner
{
// Construction
public:
enum {K_TERRAIN=1, K_OBJECTS=2, K_BOTH=3};
enum {K_SUN=0, K_ACCENT1=1, K_ACCENT2=2};
int kUIRedIDs[3];// = {IDC_RD_EDIT, IDC_RD_EDIT1, IDC_RD_EDIT2};
int kUIGreenIDs[3];// = {IDC_GD_EDIT, IDC_GD_EDIT1, IDC_GD_EDIT2};
int kUIBlueIDs[3];// = {IDC_BD_EDIT, IDC_BD_EDIT1, IDC_BD_EDIT2};
CButtonShowColor m_colorButton;
GlobalLightOptions(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(GlobalLightOptions)
enum { IDD = IDD_GLOBAL_LIGHT_OPTIONS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(GlobalLightOptions)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(GlobalLightOptions)
virtual BOOL OnInitDialog();
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
afx_msg void OnMove(int x, int y);
afx_msg void OnChangeFrontBackEdit();
afx_msg void OnChangeLeftRightEdit();
afx_msg void OnChangeColorEdit();
afx_msg void OnRadioEverything();
afx_msg void OnRadioObjects();
afx_msg void OnRadioTerrain();
afx_msg void OnColorPress();
afx_msg void OnResetLights();
afx_msg void OnClose();
virtual void OnOK(){return;}; //!< Modeless dialogs don't OK, so eat this for modeless.
virtual void OnCancel(){return;}; //!< Modeless dialogs don't close on ESC, so eat this for modeless.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
Real ComponentToPercent(Int component)
{
Real percent;
if (component >= 255) {
return 1.0;
}
if (component <= 0) {
return 0.0;
}
percent = (Real)component/255.0;
return percent;
}
Int PercentToComponent(Real percent)
{
Int component;
if (percent >= 1.0) {
return 255;
}
if (percent <= 0.0) {
return 0;
}
component = (percent * 255.0);
return component;
};
BOOL GetInt(Int ctrlID, Int *rVal);
void PutInt(Int ctrlID, Int val);
protected:
Bool m_updating; ///