29 #include "../../idlib/precompiled.h"
34 #include "../../game/game.h"
35 #include "../comafx/DialogColorPicker.h"
38 #ifdef ID_DEBUG_MEMORY
146 float radius = e->
GetFloat(
"light");
215 e->
Delete(
"light_target");
220 e->
Delete(
"light_radius");
221 e->
Delete(
"light_center");
254 e->
Set(
"parallel",
"1");
327 CDialog::DoDataExchange(pDX);
390 if (lightInfo.pointLight) {
400 GetDlgItem(
IDC_EDIT_ENDX)->EnableWindow(lightInfo.explicitStartEnd);
401 GetDlgItem(
IDC_EDIT_ENDY)->EnableWindow(lightInfo.explicitStartEnd);
402 GetDlgItem(
IDC_EDIT_ENDZ)->EnableWindow(lightInfo.explicitStartEnd);
577 if ( (
b->owner->eclass->nShowFlags & ECLASS_LIGHT ) && !
b->entityModel ) {
617 pBtn->GetClientRect(&r);
619 colorBitmap.CreateCompatibleBitmap(&dc, r.Width(), r.Height());
621 MemDC.CreateCompatibleDC(&dc);
622 CBitmap *pOldBmp = MemDC.SelectObject(&
colorBitmap);
625 MemDC.FillRect(r,&br);
627 dc.SelectObject(pOldBmp);
636 for (i = 0; i <
count; i++) {
640 if (str.
Icmpn(
"lights/", strlen(
"lights/")) == 0 || str.
Icmpn(
"fogs/", strlen(
"fogs/")) == 0) {
648 CDialog::OnInitDialog();
668 return CDialog::OnDestroy();
715 if ( QE_SingleBrush(
true,
true ) ) {
717 if ( ( b->owner->eclass->nShowFlags & ECLASS_LIGHT ) && !b->entityModel ) {
737 title =
"Light Editor";
742 if ( (
b->owner->eclass->nShowFlags & ECLASS_LIGHT ) && !
b->entityModel ) {
751 title =
"Light Editor - (Multiple lights selected)";
753 title =
"Light Editor - (No lights selected)";
766 title =
"Light Editor";
768 title =
"Light Editor - (No entities selected)";
772 SetWindowText( title );
777 if ( updateChecks ) {
784 common->
Printf(
"Cannot run the light editor in fullscreen mode.\n"
785 "Set r_fullscreen to 0 and vid_restart.\n" );
789 if ( g_LightDialog ==
NULL ) {
794 if ( g_LightDialog->GetSafeHwnd() ==
NULL ) {
797 LONG lSize =
sizeof( rct );
799 g_LightDialog->SetWindowPos(
NULL, rct.left, rct.top, 0,0, SWP_NOSIZE);
805 g_LightDialog->ShowWindow( SW_SHOW );
806 g_LightDialog->SetFocus();
816 MSG *msg = AfxGetCurrentMessage();
818 MSG *msg = &m_msgCur;
821 while( ::PeekMessage(msg,
NULL,
NULL,
NULL, PM_NOREMOVE) ) {
823 if ( !AfxGetApp()->PumpMessage() ) {
830 g_LightDialog =
NULL;
834 if ( g_LightDialog && g_LightDialog->GetSafeHwnd() !=
NULL ) {
880 HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
893 return CDialog::DestroyWindow();
959 if ( !valOriginal || ( valModified->
GetValue() == valOriginal->
GetValue() ) ) {
void UpdateColor(float r, float g, float b, float a)
virtual void EntityUpdateChangeableSpawnArgs(idEntity *ent, const idDict *dict)
void UpdateLightInspector()
float GetFloat(const char *key, const char *defaultString="0") const
void WINAPI Sys_UpdateWindows(int nBits)
void UpdateRadiantColor(float r, float g, float b, float a)
#define IDC_CHECK_PROJECTED
afx_msg void OnSelchangeComboTexture()
afx_msg void OnCheckPoint()
virtual void setMedia(const char *name)
idGLDrawableMaterial * m_drawMaterial
void Delete(const char *key)
virtual BOOL OnInitDialog()
void LightEditorRun(void)
#define IDC_CHECK_PARALLEL
CONST PIXELFORMATDESCRIPTOR UINT
const idStr & GetKey(void) const
void SetNum(int newnum, bool resize=true)
void ToDictWriteAllInfo(idDict *e)
afx_msg void OnCheckCenter()
afx_msg void OnCheckProjected()
#define IDC_CHECK_SHADOWS
afx_msg HBRUSH OnCtlColor(CDC *pDC, CWnd *pWnd, UINT nCtlColor)
idRenderSystem * renderSystem
#define IDC_COMBO_TEXTURE
virtual BOOL DestroyWindow()
const char * GetName(void) const
void Set(const char *key, const char *value)
bool LoadRegistryInfo(const char *pszName, void *pvBuf, long *plSize)
void LightEditorInit(const idDict *spawnArgs)
void SetFloat(const char *key, float val)
void Brush_Build(brush_t *b, bool bSnap, bool bMarkMap, bool bConvert, bool updateLights)
int Icmpn(const char *text, int n) const
GLuint GLuint GLsizei count
virtual bool IsFullScreen(void) const =0
#define IDC_CHECK_EQUALRADIUS
const char * GetString(const char *key, const char *defaultString="") const
void SaveLightInfo(const idDict *differences)
void UpdateLightInfoFromDialog(void)
void UpdateDialogFromLightInfo(void)
idVec4 GetVec4(const char *key, const char *defaultString=NULL) const
bool DoNewColor(int *i1, int *i2, int *i3, float *overBright, void(*Update)(float, float, float, float))
bool GetBool(const char *key, const char *defaultString="0") const
#define IDC_CHECK_SPECULAR
idVec3 GetVector(const char *key, const char *defaultString=NULL) const
void LightEditorShutdown(void)
afx_msg void OnRadioFalloff()
#define IDC_RADIO_FALLOFF2
afx_msg void OnBtnTexture()
const idStr & GetValue(void) const
afx_msg void OnCheckEqualradius()
bool SaveRegistryInfo(const char *pszName, void *pvBuf, long lSize)
const idKeyValue * FindKey(const char *key) const
GLubyte GLubyte GLubyte a
CLightDlg(CWnd *pParent=NULL)
virtual void Printf(const char *fmt,...) id_attribute((format(printf
void FromDict(const idDict *e)
virtual int GetSelectedEntities(idEntity *list[], int max)
idDeclManager * declManager
afx_msg void OnCheckParallel()
virtual int GetNumDecls(declType_t type)=0
void UpdateLightDialog(float r, float g, float b, float a)
GLdouble GLdouble GLdouble r
#define IDC_CHECK_EXPLICITFALLOFF
afx_msg void OnApplyDifferences()
afx_msg void OnCheckExplicitfalloff()
virtual const idMaterial * MaterialByIndex(int index, bool forceParse=true)=0
#define IDC_CHECK_DIFFUSE
#define IDC_RADIO_FALLOFF3
CLightInfo lightInfoOriginal
#define IDC_RADIO_FALLOFF
const char * c_str(void) const
CLightDlg * g_LightDialog
entity_t * SingleLightSelected()
#define IDC_APPLY_DIFFERENT
const idKeyValue * GetKeyVal(int index) const
virtual const idDict * EntityGetSpawnArgs(idEntity *ent) const
virtual void DoDataExchange(CDataExchange *pDX)
char * va(const char *fmt,...)
virtual void EntityChangeSpawnArgs(idEntity *ent, const idDict *newArgs)
void ToDictFromDifferences(idDict *e, const idDict *differences)
afx_msg void OnBtnColor()
int GetNumKeyVals(void) const
void SetVector(const char *key, const idVec3 &val)
void UpdateDialog(bool updateChecks)
virtual void EntityUpdateVisuals(idEntity *ent)