diff --git a/neo/sys/win32/rc/prey_tools.rc b/neo/sys/win32/rc/prey_tools.rc index b26e246..9aae6f4 100644 --- a/neo/sys/win32/rc/prey_tools.rc +++ b/neo/sys/win32/rc/prey_tools.rc @@ -838,8 +838,9 @@ BEGIN CONTROL "",IDC_TREE_MEDIA,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_NOTOOLTIPS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,10,10,320,359 CONTROL "",IDC_PREVIEW,"Static",SS_BLACKFRAME | SS_NOTIFY | SS_SUNKEN,341,10,201,171 EDITTEXT IDC_EDIT_INFO,341,221,200,117,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY - PUSHBUTTON "Reload",IDC_BUTTON_RELOAD,466,191,40,20 - PUSHBUTTON "Play",IDC_BUTTON_PLAY,378,191,40,20 + PUSHBUTTON "Reload",IDC_BUTTON_RELOAD,483,193,48,16 + PUSHBUTTON "Play",IDC_BUTTON_PLAY,361,194,45,15 + CONTROL "Gui Only",IDC_PREVIEW_GUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,421,195,51,14 END IDD_DIALOG_CONSOLE DIALOGEX 0, 0, 295, 292 @@ -1734,13 +1735,14 @@ BEGIN CONTROL "&Backcolor:",IDC_GUIED_USEBACKCOLOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,22,49,10 CONTROL "Button1",IDC_GUIED_ITEMBACKCOLOR,"Button",BS_OWNERDRAW | WS_TABSTOP,68,20,32,14 CONTROL "Button1",IDC_GUIED_ITEMBACKCOLORALPHA,"Button",BS_OWNERDRAW | WS_TABSTOP,100,20,19,14 - CONTROL "&Material:",IDC_GUIED_USEMATERIAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,44,44,10 - EDITTEXT IDC_GUIED_ITEMBACKGROUND,77,42,152,14,ES_AUTOHSCROLL - LTEXT "&X Scale:",IDC_GUIED_XSCALE_STATIC,78,62,26,8 - EDITTEXT IDC_GUIED_ITEMMATSCALEX,105,60,42,13,ES_AUTOHSCROLL - LTEXT "&Y Scale:",IDC_GUIED_YSCALE_STATIC,160,62,26,8 - EDITTEXT IDC_GUIED_ITEMMATSCALEY,187,60,42,13,ES_AUTOHSCROLL - CONTROL "&Disable Cache",IDC_GUIED_ITEMVARIABLEBACKGROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,77,79,61,10 + CONTROL "&Material:",IDC_GUIED_USEMATERIAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,53,44,10 + CONTROL "Pick",ID_GUIED_CHOOSE_MATERIAL,"Button",BS_OWNERDRAW | WS_GROUP | WS_TABSTOP,65,51,29,14 + EDITTEXT IDC_GUIED_ITEMBACKGROUND,97,51,129,14,ES_AUTOHSCROLL + LTEXT "&X Scale:",IDC_GUIED_XSCALE_STATIC,22,73,26,8 + EDITTEXT IDC_GUIED_ITEMMATSCALEX,49,71,42,13,ES_AUTOHSCROLL + LTEXT "&Y Scale:",IDC_GUIED_YSCALE_STATIC,100,73,26,8 + EDITTEXT IDC_GUIED_ITEMMATSCALEY,127,71,42,13,ES_AUTOHSCROLL + CONTROL "No Cache",IDC_GUIED_ITEMVARIABLEBACKGROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,179,72,45,10 GROUPBOX "Border",IDC_STATIC,7,105,229,78 LTEXT "&Size:",IDC_STATIC,19,119,16,8 EDITTEXT IDC_GUIED_ITEMBORDERSIZE,38,118,39,13,ES_AUTOHSCROLL @@ -1753,9 +1755,10 @@ BEGIN LTEXT "Ma&tcolor:",IDC_GUIED_ITEMMATCOLORSTATIC,19,205,31,8 CONTROL "Button1",IDC_GUIED_ITEMMATCOLOR,"Button",BS_OWNERDRAW | WS_TABSTOP,55,202,32,14 CONTROL "Button1",IDC_GUIED_ITEMMATCOLORALPHA,"Button",BS_OWNERDRAW | WS_TABSTOP,87,202,19,14 + GROUPBOX "Material",IDC_STATIC,13,37,220,57 END -IDD_GUIED_TRANSFORMER DIALOGEX 0, 0, 124, 32 +IDD_GUIED_TRANSFORMER DIALOGEX 0, 0, 124, 48 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 400, 0, 0x0 BEGIN @@ -1767,6 +1770,7 @@ BEGIN EDITTEXT IDC_GUIED_ITEMRECTW,73,2,43,12,ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_STATICEDGE LTEXT "H:",IDC_STATIC,65,19,8,8 EDITTEXT IDC_GUIED_ITEMRECTH,73,17,43,12,ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_STATICEDGE + CONTROL "Lock Aspect",IDC_GUIED_LOCK_ASPECT,"Button",BS_AUTOCHECKBOX,35,34,55,10 END IDD_DBG_QUICKWATCH DIALOGEX 0, 0, 306, 174 @@ -2189,6 +2193,7 @@ BEGIN IDD_GUIED_TRANSFORMER, DIALOG BEGIN + BOTTOMMARGIN, 32 END IDD_DBG_QUICKWATCH, DIALOG @@ -2944,7 +2949,9 @@ BEGIN MENUITEM SEPARATOR MENUITEM "Show &Navigator", ID_GUIED_WINDOW_SHOWNAVIGATOR MENUITEM "Show &Transformer", ID_GUIED_WINDOW_SHOWTRANSFORMER - MENUITEM "Show &Properties", ID_GUIED_WINDOW_SHOWPROPERTIES + MENUITEM "Show &Properties", ID_GUIED_WINDOW_SHOWPROPERTIES + MENUITEM "Show &Item Properties", ID_GUIED_WINDOW_SHOWITEMPROPERTIES + MENUITEM "Show &Scripts", ID_GUIED_WINDOW_SHOWSCRIPTS END POPUP "&Help" BEGIN @@ -3244,6 +3251,7 @@ IDR_GUIED_ACCELERATORS ACCELERATORS BEGIN "C", ID_GUIED_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT VK_DELETE, ID_GUIED_EDIT_DELETE, VIRTKEY, NOINVERT + VK_SPACE, ID_GUIED_EDIT_DUPLICATE, VIRTKEY, CONTROL, NOINVERT "V", ID_GUIED_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT "Y", ID_GUIED_EDIT_REDO, VIRTKEY, CONTROL, NOINVERT "Z", ID_GUIED_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT diff --git a/neo/sys/win32/rc/resource.h b/neo/sys/win32/rc/resource.h index e57f3b7..62e3437 100644 --- a/neo/sys/win32/rc/resource.h +++ b/neo/sys/win32/rc/resource.h @@ -1583,6 +1583,13 @@ #define IDD_WAITDLG_PROGRESS 45016 #define IDC_ABOUT_TEXT 45017 #define IDC_ABOUT_BITMAP 45018 +#define IDC_GUIED_LOCK_ASPECT 45019 +#define ID_GUIED_CHOOSE_MATERIAL 45020 +#define ID_GUIED_APPLY_ITEM_PROPS 45021 +#define ID_GUIED_EDIT_DUPLICATE 45022 +#define ID_GUIED_WINDOW_SHOWITEMPROPERTIES 45023 +#define ID_GUIED_WINDOW_SHOWSCRIPTS 45024 +#define IDC_PREVIEW_GUI 45025 // Next default values for new objects // diff --git a/neo/tools/af/DialogAF.cpp b/neo/tools/af/DialogAF.cpp index e0a8063..6a874b0 100644 --- a/neo/tools/af/DialogAF.cpp +++ b/neo/tools/af/DialogAF.cpp @@ -142,7 +142,7 @@ void DialogAF::LoadFile( idDeclAF* af ) DialogAF::LoadFile ================ */ -void DialogAF::SaveFile( void ) +void DialogAF::SaveFile() { if( !file ) { @@ -159,7 +159,7 @@ void DialogAF::SaveFile( void ) DialogAF::SetFileModified ================ */ -void DialogAF::SetFileModified( void ) +void DialogAF::SetFileModified() { if( file ) { @@ -173,7 +173,7 @@ void DialogAF::SetFileModified( void ) DialogAF::ReloadFile ================ */ -void DialogAF::ReloadFile( void ) +void DialogAF::ReloadFile() { LoadFile( file ); } @@ -183,7 +183,7 @@ void DialogAF::ReloadFile( void ) DialogAF::InitAFList ================ */ -void DialogAF::InitAFList( void ) +void DialogAF::InitAFList() { int i, c; @@ -238,7 +238,7 @@ DialogAF::SetTabChildPos position the child dialog box ================ */ -void DialogAF::SetTabChildPos( void ) +void DialogAF::SetTabChildPos() { if( wndTabDisplay ) { @@ -372,7 +372,7 @@ void AFEditorInit( const idDict* spawnArgs ) AFEditorRun ================ */ -void AFEditorRun( void ) +void AFEditorRun() { #if _MSC_VER >= 1300 MSG* msg = AfxGetCurrentMessage(); // TODO Robert fix me!! @@ -394,7 +394,7 @@ void AFEditorRun( void ) AFEditorShutdown ================ */ -void AFEditorShutdown( void ) +void AFEditorShutdown() { delete g_AFDialog; g_AFDialog = NULL; @@ -674,7 +674,7 @@ void DialogAF::OnBnClickedCancel() AFDialogSetFileModified ================ */ -void AFDialogSetFileModified( void ) +void AFDialogSetFileModified() { if( g_AFDialog ) { @@ -687,7 +687,7 @@ void AFDialogSetFileModified( void ) AFDialogReloadFile ================ */ -void AFDialogReloadFile( void ) +void AFDialogReloadFile() { if( g_AFDialog ) { diff --git a/neo/tools/af/DialogAF.h b/neo/tools/af/DialogAF.h index 9ea37f8..544fe3c 100644 --- a/neo/tools/af/DialogAF.h +++ b/neo/tools/af/DialogAF.h @@ -46,9 +46,9 @@ class DialogAF : public CDialog DialogAF( CWnd* pParent = NULL ); // standard constructor virtual ~DialogAF(); void LoadFile( idDeclAF* af ); - void SaveFile( void ); - void ReloadFile( void ); - void SetFileModified( void ); + void SaveFile(); + void ReloadFile(); + void SetFileModified(); enum { IDD = IDD_DIALOG_AF }; @@ -89,11 +89,11 @@ class DialogAF : public CDialog static toolTip_t toolTips[]; private: - void InitAFList( void ); + void InitAFList(); void AddTabItem( int id, const char* name ); void SetTab( int id ); - void SetTabChildPos( void ); + void SetTabChildPos(); }; -void AFDialogSetFileModified( void ); -void AFDialogReloadFile( void ); +void AFDialogSetFileModified(); +void AFDialogReloadFile(); diff --git a/neo/tools/af/DialogAFBody.cpp b/neo/tools/af/DialogAFBody.cpp index 39abb04..f04ca63 100644 --- a/neo/tools/af/DialogAFBody.cpp +++ b/neo/tools/af/DialogAFBody.cpp @@ -215,7 +215,7 @@ void DialogAFBody::DoDataExchange( CDataExchange* pDX ) DialogAFBody::InitBodyList ================ */ -void DialogAFBody::InitBodyList( void ) +void DialogAFBody::InitBodyList() { CString str; @@ -243,7 +243,7 @@ DialogAFBody::InitJointLists initialize the joint lists for bone collision models ================ */ -void DialogAFBody::InitJointLists( void ) +void DialogAFBody::InitJointLists() { idStrList joints; @@ -282,7 +282,7 @@ void DialogAFBody::InitJointLists( void ) DialogAFBody::InitCollisionModelType ================ */ -void DialogAFBody::InitCollisionModelType( void ) +void DialogAFBody::InitCollisionModelType() { int showBone, showOther; bool enableOther; @@ -362,7 +362,7 @@ void DialogAFBody::InitCollisionModelType( void ) DialogAFBody::InitModifiedJointList ================ */ -void DialogAFBody::InitModifiedJointList( void ) +void DialogAFBody::InitModifiedJointList() { int i, j, numJoints; CString str; @@ -447,7 +447,7 @@ void DialogAFBody::InitModifiedJointList( void ) DialogAFBody::InitNewRenameDeleteButtons ================ */ -void DialogAFBody::InitNewRenameDeleteButtons( void ) +void DialogAFBody::InitNewRenameDeleteButtons() { if( file && numJoints > file->bodies.Num() ) { @@ -489,7 +489,7 @@ void DialogAFBody::LoadFile( idDeclAF* af ) DialogAFBody::SaveFile ================ */ -void DialogAFBody::SaveFile( void ) +void DialogAFBody::SaveFile() { SaveBody(); } @@ -643,7 +643,7 @@ void DialogAFBody::LoadBody( const char* name ) DialogAFBody::SaveBody ================ */ -void DialogAFBody::SaveBody( void ) +void DialogAFBody::SaveBody() { int s1, s2; CString str; @@ -760,7 +760,7 @@ void DialogAFBody::SaveBody( void ) DialogAFBody::UpdateFile ================ */ -void DialogAFBody::UpdateFile( void ) +void DialogAFBody::UpdateFile() { SaveBody(); if( file ) diff --git a/neo/tools/af/DialogAFBody.h b/neo/tools/af/DialogAFBody.h index 4f2b4b7..65bbbbb 100644 --- a/neo/tools/af/DialogAFBody.h +++ b/neo/tools/af/DialogAFBody.h @@ -38,10 +38,10 @@ class DialogAFBody : public CDialog DialogAFBody( CWnd* pParent = NULL ); // standard constructor virtual ~DialogAFBody(); void LoadFile( idDeclAF* af ); - void SaveFile( void ); + void SaveFile(); void LoadBody( const char* name ); - void SaveBody( void ); - void UpdateFile( void ); + void SaveBody(); + void UpdateFile(); DialogAFConstraint* constraintDlg; @@ -148,11 +148,11 @@ class DialogAFBody : public CDialog static toolTip_t toolTips[]; private: - void InitBodyList( void ); - void InitJointLists( void ); - void InitCollisionModelType( void ); - void InitModifiedJointList( void ); - void InitNewRenameDeleteButtons( void ); + void InitBodyList(); + void InitJointLists(); + void InitCollisionModelType(); + void InitModifiedJointList(); + void InitNewRenameDeleteButtons(); void ValidateCollisionModelLength( bool update ); void ValidateCollisionModelHeight( bool update ); void ValidateCollisionModelWidth( bool update ); diff --git a/neo/tools/af/DialogAFConstraint.cpp b/neo/tools/af/DialogAFConstraint.cpp index d43d785..656b2c4 100644 --- a/neo/tools/af/DialogAFConstraint.cpp +++ b/neo/tools/af/DialogAFConstraint.cpp @@ -156,7 +156,7 @@ void DialogAFConstraint::DoDataExchange( CDataExchange* pDX ) DialogAFConstraint::InitConstraintList ================ */ -void DialogAFConstraint::InitConstraintList( void ) +void DialogAFConstraint::InitConstraintList() { CString str; @@ -182,7 +182,7 @@ void DialogAFConstraint::InitConstraintList( void ) DialogAFConstraint::InitConstraintTypeDlg ================ */ -void DialogAFConstraint::InitConstraintTypeDlg( void ) +void DialogAFConstraint::InitConstraintTypeDlg() { CString str; RECT rect; @@ -241,7 +241,7 @@ void DialogAFConstraint::InitConstraintTypeDlg( void ) DialogAFConstraint::InitBodyLists ================ */ -void DialogAFConstraint::InitBodyLists( void ) +void DialogAFConstraint::InitBodyLists() { m_comboBody1List.ResetContent(); m_comboBody2List.ResetContent(); @@ -263,7 +263,7 @@ void DialogAFConstraint::InitBodyLists( void ) DialogAFConstraint::InitNewRenameDeleteButtons ================ */ -void DialogAFConstraint::InitNewRenameDeleteButtons( void ) +void DialogAFConstraint::InitNewRenameDeleteButtons() { if( file && file->bodies.Num() >= 1 ) { @@ -310,7 +310,7 @@ void DialogAFConstraint::LoadFile( idDeclAF* af ) DialogAFConstraint::SaveFile ================ */ -void DialogAFConstraint::SaveFile( void ) +void DialogAFConstraint::SaveFile() { SaveConstraint(); } @@ -368,7 +368,7 @@ void DialogAFConstraint::LoadConstraint( const char* name ) DialogAFConstraint::SaveConstraint ================ */ -void DialogAFConstraint::SaveConstraint( void ) +void DialogAFConstraint::SaveConstraint() { int s1, s2; CString str; @@ -400,7 +400,7 @@ void DialogAFConstraint::SaveConstraint( void ) DialogAFConstraint::UpdateFile ================ */ -void DialogAFConstraint::UpdateFile( void ) +void DialogAFConstraint::UpdateFile() { SaveConstraint(); if( file ) diff --git a/neo/tools/af/DialogAFConstraint.h b/neo/tools/af/DialogAFConstraint.h index 2ce4422..3f549b6 100644 --- a/neo/tools/af/DialogAFConstraint.h +++ b/neo/tools/af/DialogAFConstraint.h @@ -45,10 +45,10 @@ class DialogAFConstraint : public CDialog DialogAFConstraint( CWnd* pParent = NULL ); // standard constructor virtual ~DialogAFConstraint(); void LoadFile( idDeclAF* af ); - void SaveFile( void ); + void SaveFile(); void LoadConstraint( const char* name ); - void SaveConstraint( void ); - void UpdateFile( void ); + void SaveConstraint(); + void UpdateFile(); enum { IDD = IDD_DIALOG_AF_CONSTRAINT }; @@ -92,8 +92,8 @@ class DialogAFConstraint : public CDialog static toolTip_t toolTips[]; private: - void InitConstraintList( void ); - void InitConstraintTypeDlg( void ); - void InitBodyLists( void ); - void InitNewRenameDeleteButtons( void ); + void InitConstraintList(); + void InitConstraintTypeDlg(); + void InitBodyLists(); + void InitNewRenameDeleteButtons(); }; diff --git a/neo/tools/af/DialogAFConstraintBallAndSocket.cpp b/neo/tools/af/DialogAFConstraintBallAndSocket.cpp index 862fc80..f368795 100644 --- a/neo/tools/af/DialogAFConstraintBallAndSocket.cpp +++ b/neo/tools/af/DialogAFConstraintBallAndSocket.cpp @@ -138,7 +138,7 @@ void DialogAFConstraintBallAndSocket::DoDataExchange( CDataExchange* pDX ) DialogAFConstraintBallAndSocket::InitJointLists ================ */ -void DialogAFConstraintBallAndSocket::InitJointLists( void ) +void DialogAFConstraintBallAndSocket::InitJointLists() { m_comboAnchorJoint.ResetContent(); m_comboLimitJoint1.ResetContent(); @@ -186,7 +186,7 @@ void DialogAFConstraintBallAndSocket::LoadFile( idDeclAF* af ) DialogAFConstraintBallAndSocket::SaveFile ================ */ -void DialogAFConstraintBallAndSocket::SaveFile( void ) +void DialogAFConstraintBallAndSocket::SaveFile() { SaveConstraint(); } @@ -279,7 +279,7 @@ void DialogAFConstraintBallAndSocket::LoadConstraint( idDeclAF_Constraint* c ) DialogAFConstraintBallAndSocket::SaveConstraint ================ */ -void DialogAFConstraintBallAndSocket::SaveConstraint( void ) +void DialogAFConstraintBallAndSocket::SaveConstraint() { int s1, s2; CString str; @@ -339,7 +339,7 @@ void DialogAFConstraintBallAndSocket::SaveConstraint( void ) DialogAFConstraintBallAndSocket::UpdateFile ================ */ -void DialogAFConstraintBallAndSocket::UpdateFile( void ) +void DialogAFConstraintBallAndSocket::UpdateFile() { SaveConstraint(); if( file ) diff --git a/neo/tools/af/DialogAFConstraintBallAndSocket.h b/neo/tools/af/DialogAFConstraintBallAndSocket.h index 7a0ad06..35550e6 100644 --- a/neo/tools/af/DialogAFConstraintBallAndSocket.h +++ b/neo/tools/af/DialogAFConstraintBallAndSocket.h @@ -38,10 +38,10 @@ class DialogAFConstraintBallAndSocket : public CDialog DialogAFConstraintBallAndSocket( CWnd* pParent = NULL ); // standard constructor virtual ~DialogAFConstraintBallAndSocket(); void LoadFile( idDeclAF* af ); - void SaveFile( void ); + void SaveFile(); void LoadConstraint( idDeclAF_Constraint* c ); - void SaveConstraint( void ); - void UpdateFile( void ); + void SaveConstraint(); + void UpdateFile(); enum { IDD = IDD_DIALOG_AF_CONSTRAINT_BALLANDSOCKET }; @@ -114,5 +114,5 @@ class DialogAFConstraintBallAndSocket : public CDialog static toolTip_t toolTips[]; private: - void InitJointLists( void ); + void InitJointLists(); }; diff --git a/neo/tools/af/DialogAFConstraintFixed.cpp b/neo/tools/af/DialogAFConstraintFixed.cpp index 7675401..1448340 100644 --- a/neo/tools/af/DialogAFConstraintFixed.cpp +++ b/neo/tools/af/DialogAFConstraintFixed.cpp @@ -86,7 +86,7 @@ void DialogAFConstraintFixed::DoDataExchange( CDataExchange* pDX ) DialogAFConstraintFixed::InitJointLists ================ */ -void DialogAFConstraintFixed::InitJointLists( void ) +void DialogAFConstraintFixed::InitJointLists() { } @@ -107,7 +107,7 @@ void DialogAFConstraintFixed::LoadFile( idDeclAF* af ) DialogAFConstraintFixed::SaveFile ================ */ -void DialogAFConstraintFixed::SaveFile( void ) +void DialogAFConstraintFixed::SaveFile() { SaveConstraint(); } @@ -131,7 +131,7 @@ void DialogAFConstraintFixed::LoadConstraint( idDeclAF_Constraint* c ) DialogAFConstraintFixed::SaveConstraint ================ */ -void DialogAFConstraintFixed::SaveConstraint( void ) +void DialogAFConstraintFixed::SaveConstraint() { if( !file || !constraint ) @@ -148,7 +148,7 @@ void DialogAFConstraintFixed::SaveConstraint( void ) DialogAFConstraintFixed::UpdateFile ================ */ -void DialogAFConstraintFixed::UpdateFile( void ) +void DialogAFConstraintFixed::UpdateFile() { SaveConstraint(); if( file ) diff --git a/neo/tools/af/DialogAFConstraintFixed.h b/neo/tools/af/DialogAFConstraintFixed.h index 050bcf3..39bd084 100644 --- a/neo/tools/af/DialogAFConstraintFixed.h +++ b/neo/tools/af/DialogAFConstraintFixed.h @@ -38,10 +38,10 @@ class DialogAFConstraintFixed : public CDialog DialogAFConstraintFixed( CWnd* pParent = NULL ); // standard constructor virtual ~DialogAFConstraintFixed(); void LoadFile( idDeclAF* af ); - void SaveFile( void ); + void SaveFile(); void LoadConstraint( idDeclAF_Constraint* c ); - void SaveConstraint( void ); - void UpdateFile( void ); + void SaveConstraint(); + void UpdateFile(); enum { IDD = IDD_DIALOG_AF_CONSTRAINT_FIXED }; @@ -62,5 +62,5 @@ class DialogAFConstraintFixed : public CDialog static toolTip_t toolTips[]; private: - void InitJointLists( void ); + void InitJointLists(); }; diff --git a/neo/tools/af/DialogAFConstraintHinge.cpp b/neo/tools/af/DialogAFConstraintHinge.cpp index 629cba8..509a2f1 100644 --- a/neo/tools/af/DialogAFConstraintHinge.cpp +++ b/neo/tools/af/DialogAFConstraintHinge.cpp @@ -122,7 +122,7 @@ void DialogAFConstraintHinge::DoDataExchange( CDataExchange* pDX ) DialogAFConstraintHinge::InitJointLists ================ */ -void DialogAFConstraintHinge::InitJointLists( void ) +void DialogAFConstraintHinge::InitJointLists() { m_comboAnchorJoint.ResetContent(); m_comboAxisJoint1.ResetContent(); @@ -166,7 +166,7 @@ void DialogAFConstraintHinge::LoadFile( idDeclAF* af ) DialogAFConstraintHinge::SaveFile ================ */ -void DialogAFConstraintHinge::SaveFile( void ) +void DialogAFConstraintHinge::SaveFile() { SaveConstraint(); } @@ -238,7 +238,7 @@ void DialogAFConstraintHinge::LoadConstraint( idDeclAF_Constraint* c ) DialogAFConstraintHinge::SaveConstraint ================ */ -void DialogAFConstraintHinge::SaveConstraint( void ) +void DialogAFConstraintHinge::SaveConstraint() { int s1, s2; CString str; @@ -282,7 +282,7 @@ void DialogAFConstraintHinge::SaveConstraint( void ) DialogAFConstraintHinge::UpdateFile ================ */ -void DialogAFConstraintHinge::UpdateFile( void ) +void DialogAFConstraintHinge::UpdateFile() { SaveConstraint(); if( file ) diff --git a/neo/tools/af/DialogAFConstraintHinge.h b/neo/tools/af/DialogAFConstraintHinge.h index bb6369e..098d360 100644 --- a/neo/tools/af/DialogAFConstraintHinge.h +++ b/neo/tools/af/DialogAFConstraintHinge.h @@ -38,10 +38,10 @@ class DialogAFConstraintHinge : public CDialog DialogAFConstraintHinge( CWnd* pParent = NULL ); // standard constructor virtual ~DialogAFConstraintHinge(); void LoadFile( idDeclAF* af ); - void SaveFile( void ); + void SaveFile(); void LoadConstraint( idDeclAF_Constraint* c ); - void SaveConstraint( void ); - void UpdateFile( void ); + void SaveConstraint(); + void UpdateFile(); enum { IDD = IDD_DIALOG_AF_CONSTRAINT_HINGE }; @@ -98,5 +98,5 @@ class DialogAFConstraintHinge : public CDialog static toolTip_t toolTips[]; private: - void InitJointLists( void ); + void InitJointLists(); }; diff --git a/neo/tools/af/DialogAFConstraintSlider.cpp b/neo/tools/af/DialogAFConstraintSlider.cpp index 1e46da4..518ed90 100644 --- a/neo/tools/af/DialogAFConstraintSlider.cpp +++ b/neo/tools/af/DialogAFConstraintSlider.cpp @@ -98,7 +98,7 @@ void DialogAFConstraintSlider::DoDataExchange( CDataExchange* pDX ) DialogAFConstraintSlider::InitJointLists ================ */ -void DialogAFConstraintSlider::InitJointLists( void ) +void DialogAFConstraintSlider::InitJointLists() { m_comboAxisJoint1.ResetContent(); m_comboAxisJoint2.ResetContent(); @@ -140,7 +140,7 @@ void DialogAFConstraintSlider::LoadFile( idDeclAF* af ) DialogAFConstraintSlider::SaveFile ================ */ -void DialogAFConstraintSlider::SaveFile( void ) +void DialogAFConstraintSlider::SaveFile() { SaveConstraint(); } @@ -183,7 +183,7 @@ void DialogAFConstraintSlider::LoadConstraint( idDeclAF_Constraint* c ) DialogAFConstraintSlider::SaveConstraint ================ */ -void DialogAFConstraintSlider::SaveConstraint( void ) +void DialogAFConstraintSlider::SaveConstraint() { int s1, s2; CString str; @@ -215,7 +215,7 @@ void DialogAFConstraintSlider::SaveConstraint( void ) DialogAFConstraintSlider::UpdateFile ================ */ -void DialogAFConstraintSlider::UpdateFile( void ) +void DialogAFConstraintSlider::UpdateFile() { SaveConstraint(); if( file ) diff --git a/neo/tools/af/DialogAFConstraintSlider.h b/neo/tools/af/DialogAFConstraintSlider.h index 6c8fc9f..56d0f8a 100644 --- a/neo/tools/af/DialogAFConstraintSlider.h +++ b/neo/tools/af/DialogAFConstraintSlider.h @@ -38,10 +38,10 @@ class DialogAFConstraintSlider : public CDialog DialogAFConstraintSlider( CWnd* pParent = NULL ); // standard constructor virtual ~DialogAFConstraintSlider(); void LoadFile( idDeclAF* af ); - void SaveFile( void ); + void SaveFile(); void LoadConstraint( idDeclAF_Constraint* c ); - void SaveConstraint( void ); - void UpdateFile( void ); + void SaveConstraint(); + void UpdateFile(); enum { IDD = IDD_DIALOG_AF_CONSTRAINT_HINGE }; @@ -74,5 +74,5 @@ class DialogAFConstraintSlider : public CDialog static toolTip_t toolTips[]; private: - void InitJointLists( void ); + void InitJointLists(); }; diff --git a/neo/tools/af/DialogAFConstraintSpring.cpp b/neo/tools/af/DialogAFConstraintSpring.cpp index 2d156a5..822c8d0 100644 --- a/neo/tools/af/DialogAFConstraintSpring.cpp +++ b/neo/tools/af/DialogAFConstraintSpring.cpp @@ -134,7 +134,7 @@ void DialogAFConstraintSpring::DoDataExchange( CDataExchange* pDX ) DialogAFConstraintSpring::InitJointLists ================ */ -void DialogAFConstraintSpring::InitJointLists( void ) +void DialogAFConstraintSpring::InitJointLists() { m_comboAnchorJoint.ResetContent(); m_comboAnchor2Joint.ResetContent(); @@ -176,7 +176,7 @@ void DialogAFConstraintSpring::LoadFile( idDeclAF* af ) DialogAFConstraintSpring::SaveFile ================ */ -void DialogAFConstraintSpring::SaveFile( void ) +void DialogAFConstraintSpring::SaveFile() { SaveConstraint(); } @@ -260,7 +260,7 @@ void DialogAFConstraintSpring::LoadConstraint( idDeclAF_Constraint* c ) DialogAFConstraintSpring::SaveConstraint ================ */ -void DialogAFConstraintSpring::SaveConstraint( void ) +void DialogAFConstraintSpring::SaveConstraint() { CString str; @@ -302,7 +302,7 @@ void DialogAFConstraintSpring::SaveConstraint( void ) DialogAFConstraintSpring::UpdateFile ================ */ -void DialogAFConstraintSpring::UpdateFile( void ) +void DialogAFConstraintSpring::UpdateFile() { SaveConstraint(); if( file ) diff --git a/neo/tools/af/DialogAFConstraintSpring.h b/neo/tools/af/DialogAFConstraintSpring.h index 642decb..2071093 100644 --- a/neo/tools/af/DialogAFConstraintSpring.h +++ b/neo/tools/af/DialogAFConstraintSpring.h @@ -38,10 +38,10 @@ class DialogAFConstraintSpring : public CDialog DialogAFConstraintSpring( CWnd* pParent = NULL ); // standard constructor virtual ~DialogAFConstraintSpring(); void LoadFile( idDeclAF* af ); - void SaveFile( void ); + void SaveFile(); void LoadConstraint( idDeclAF_Constraint* c ); - void SaveConstraint( void ); - void UpdateFile( void ); + void SaveConstraint(); + void UpdateFile(); enum { IDD = IDD_DIALOG_AF_CONSTRAINT_HINGE }; @@ -110,5 +110,5 @@ class DialogAFConstraintSpring : public CDialog static toolTip_t toolTips[]; private: - void InitJointLists( void ); + void InitJointLists(); }; diff --git a/neo/tools/af/DialogAFConstraintUniversal.cpp b/neo/tools/af/DialogAFConstraintUniversal.cpp index 76cdddc..2962969 100644 --- a/neo/tools/af/DialogAFConstraintUniversal.cpp +++ b/neo/tools/af/DialogAFConstraintUniversal.cpp @@ -150,7 +150,7 @@ void DialogAFConstraintUniversal::DoDataExchange( CDataExchange* pDX ) DialogAFConstraintUniversal::InitJointLists ================ */ -void DialogAFConstraintUniversal::InitJointLists( void ) +void DialogAFConstraintUniversal::InitJointLists() { m_comboAnchorJoint.ResetContent(); m_comboJoint1Shaft1.ResetContent(); @@ -202,7 +202,7 @@ void DialogAFConstraintUniversal::LoadFile( idDeclAF* af ) DialogAFConstraintUniversal::SaveFile ================ */ -void DialogAFConstraintUniversal::SaveFile( void ) +void DialogAFConstraintUniversal::SaveFile() { SaveConstraint(); } @@ -312,7 +312,7 @@ void DialogAFConstraintUniversal::LoadConstraint( idDeclAF_Constraint* c ) DialogAFConstraintUniversal::SaveConstraint ================ */ -void DialogAFConstraintUniversal::SaveConstraint( void ) +void DialogAFConstraintUniversal::SaveConstraint() { int s1, s2; CString str; @@ -385,7 +385,7 @@ void DialogAFConstraintUniversal::SaveConstraint( void ) DialogAFConstraintUniversal::UpdateFile ================ */ -void DialogAFConstraintUniversal::UpdateFile( void ) +void DialogAFConstraintUniversal::UpdateFile() { SaveConstraint(); if( file ) diff --git a/neo/tools/af/DialogAFConstraintUniversal.h b/neo/tools/af/DialogAFConstraintUniversal.h index f53c41e..656641d 100644 --- a/neo/tools/af/DialogAFConstraintUniversal.h +++ b/neo/tools/af/DialogAFConstraintUniversal.h @@ -38,10 +38,10 @@ class DialogAFConstraintUniversal : public CDialog DialogAFConstraintUniversal( CWnd* pParent = NULL ); // standard constructor virtual ~DialogAFConstraintUniversal(); void LoadFile( idDeclAF* af ); - void SaveFile( void ); + void SaveFile(); void LoadConstraint( idDeclAF_Constraint* c ); - void SaveConstraint( void ); - void UpdateFile( void ); + void SaveConstraint(); + void UpdateFile(); enum { IDD = IDD_DIALOG_AF_CONSTRAINT_UNIVERSAL }; @@ -126,5 +126,5 @@ class DialogAFConstraintUniversal : public CDialog static toolTip_t toolTips[]; private: - void InitJointLists( void ); + void InitJointLists(); }; diff --git a/neo/tools/af/DialogAFProperties.cpp b/neo/tools/af/DialogAFProperties.cpp index 6267a4e..33660fa 100644 --- a/neo/tools/af/DialogAFProperties.cpp +++ b/neo/tools/af/DialogAFProperties.cpp @@ -180,7 +180,7 @@ void DialogAFProperties::LoadFile( idDeclAF* af ) DialogAFProperties::SetFile ================ */ -void DialogAFProperties::SaveFile( void ) +void DialogAFProperties::SaveFile() { CString str; @@ -221,7 +221,7 @@ void DialogAFProperties::SaveFile( void ) DialogAFProperties::UpdateFile ================ */ -void DialogAFProperties::UpdateFile( void ) +void DialogAFProperties::UpdateFile() { SaveFile(); if( file ) @@ -235,7 +235,7 @@ void DialogAFProperties::UpdateFile( void ) DialogAFProperties::ClearFile ================ */ -void DialogAFProperties::ClearFile( void ) +void DialogAFProperties::ClearFile() { m_editModel.SetWindowText( "" ); m_editSkin.SetWindowText( "" ); diff --git a/neo/tools/af/DialogAFProperties.h b/neo/tools/af/DialogAFProperties.h index 6579f75..c8261e9 100644 --- a/neo/tools/af/DialogAFProperties.h +++ b/neo/tools/af/DialogAFProperties.h @@ -38,7 +38,7 @@ class DialogAFProperties : public CDialog DialogAFProperties( CWnd* pParent = NULL ); // standard constructor virtual ~DialogAFProperties(); void LoadFile( idDeclAF* af ); - void SaveFile( void ); + void SaveFile(); DialogAFBody* bodyDlg; DialogAFConstraint* constraintDlg; @@ -106,6 +106,6 @@ class DialogAFProperties : public CDialog static toolTip_t toolTips[]; private: - void UpdateFile( void ); - void ClearFile( void ); + void UpdateFile(); + void ClearFile(); }; diff --git a/neo/tools/comafx/CPathTreeCtrl.h b/neo/tools/comafx/CPathTreeCtrl.h index 3f1f383..ca5b483 100644 --- a/neo/tools/comafx/CPathTreeCtrl.h +++ b/neo/tools/comafx/CPathTreeCtrl.h @@ -40,30 +40,30 @@ If you have questions concerning this license or the applicable additional terms class idPathTreeStack { public: - idPathTreeStack( void ) + idPathTreeStack() { size = 0; } void PushRoot( HTREEITEM root ); void Push( HTREEITEM item, const char* name ); - void Pop( void ) + void Pop() { size--; } - HTREEITEM TopItem( void ) const + HTREEITEM TopItem() const { return stackItem[size - 1]; } - const char* TopName( void ) const + const char* TopName() const { return stackName[size - 1]; } - int TopNameLength( void ) const + int TopNameLength() const { return stackName[size - 1].Length(); } - int Num( void ) const + int Num() const { return size; } diff --git a/neo/tools/comafx/CSyntaxRichEditCtrl.cpp b/neo/tools/comafx/CSyntaxRichEditCtrl.cpp index 052416a..2ca1f85 100644 --- a/neo/tools/comafx/CSyntaxRichEditCtrl.cpp +++ b/neo/tools/comafx/CSyntaxRichEditCtrl.cpp @@ -84,7 +84,7 @@ END_MESSAGE_MAP() CSyntaxRichEditCtrl::CSyntaxRichEditCtrl ================ */ -CSyntaxRichEditCtrl::CSyntaxRichEditCtrl( void ) +CSyntaxRichEditCtrl::CSyntaxRichEditCtrl() { m_TextDoc = NULL; keyWords = defaultKeyWords; @@ -117,7 +117,7 @@ CSyntaxRichEditCtrl::CSyntaxRichEditCtrl( void ) CSyntaxRichEditCtrl::~CSyntaxRichEditCtrl ================ */ -CSyntaxRichEditCtrl::~CSyntaxRichEditCtrl( void ) +CSyntaxRichEditCtrl::~CSyntaxRichEditCtrl() { FreeKeyWordsFromFile(); delete m_pchTip; @@ -130,7 +130,7 @@ CSyntaxRichEditCtrl::~CSyntaxRichEditCtrl( void ) CSyntaxRichEditCtrl::InitFont ================ */ -void CSyntaxRichEditCtrl::InitFont( void ) +void CSyntaxRichEditCtrl::InitFont() { LOGFONT lf; CFont font; @@ -214,7 +214,7 @@ void CSyntaxRichEditCtrl::SetCharType( int first, int last, int type ) CSyntaxRichEditCtrl::InitSyntaxHighlighting ================ */ -void CSyntaxRichEditCtrl::InitSyntaxHighlighting( void ) +void CSyntaxRichEditCtrl::InitSyntaxHighlighting() { SetCharType( 0x00, 0xFF, CT_PUNCTUATION ); SetCharType( '\0', ' ', CT_WHITESPACE ); @@ -233,7 +233,7 @@ void CSyntaxRichEditCtrl::InitSyntaxHighlighting( void ) CSyntaxRichEditCtrl::Init ================ */ -void CSyntaxRichEditCtrl::Init( void ) +void CSyntaxRichEditCtrl::Init() { // get the Rich Edit ITextDocument to use the wonky TOM interface @@ -435,7 +435,7 @@ bool CSyntaxRichEditCtrl::LoadKeyWordsFromFile( const char* fileName ) CSyntaxRichEditCtrl::FreeKeyWordsFromFile ================ */ -void CSyntaxRichEditCtrl::FreeKeyWordsFromFile( void ) +void CSyntaxRichEditCtrl::FreeKeyWordsFromFile() { for( int i = 0; i < keyWordsFromFile.Num(); i++ ) { @@ -559,7 +559,7 @@ void CSyntaxRichEditCtrl::EnableKeyWordAutoCompletion( bool enable ) CSyntaxRichEditCtrl::GetVisibleRange ================ */ -CHARRANGE CSyntaxRichEditCtrl::GetVisibleRange( void ) const +CHARRANGE CSyntaxRichEditCtrl::GetVisibleRange() const { RECT rectArea; int firstLine, lastLine; @@ -940,7 +940,7 @@ CSyntaxRichEditCtrl::UpdateVisibleRange Updates the visible character range if it is not yet properly highlighted. ================ */ -void CSyntaxRichEditCtrl::UpdateVisibleRange( void ) +void CSyntaxRichEditCtrl::UpdateVisibleRange() { CHARRANGE visRange; tom::ITextRange* range; @@ -1178,7 +1178,7 @@ void CSyntaxRichEditCtrl::ReplaceText( int startCharIndex, int endCharIndex, con CSyntaxRichEditCtrl::AutoCompleteInsertText ================ */ -void CSyntaxRichEditCtrl::AutoCompleteInsertText( void ) +void CSyntaxRichEditCtrl::AutoCompleteInsertText() { long selStart, selEnd; int index; @@ -1200,7 +1200,7 @@ void CSyntaxRichEditCtrl::AutoCompleteInsertText( void ) CSyntaxRichEditCtrl::AutoCompleteUpdate ================ */ -void CSyntaxRichEditCtrl::AutoCompleteUpdate( void ) +void CSyntaxRichEditCtrl::AutoCompleteUpdate() { long selStart, selEnd; int index; @@ -1250,7 +1250,7 @@ void CSyntaxRichEditCtrl::AutoCompleteShow( int charIndex ) CSyntaxRichEditCtrl::AutoCompleteHide ================ */ -void CSyntaxRichEditCtrl::AutoCompleteHide( void ) +void CSyntaxRichEditCtrl::AutoCompleteHide() { autoCompleteStart = -1; autoCompleteListBox.ShowWindow( FALSE ); @@ -1293,7 +1293,7 @@ void CSyntaxRichEditCtrl::ToolTipShow( int charIndex, const char* string ) CSyntaxRichEditCtrl::ToolTipHide ================ */ -void CSyntaxRichEditCtrl::ToolTipHide( void ) +void CSyntaxRichEditCtrl::ToolTipHide() { funcParmToolTipStart = -1; funcParmToolTip.ShowWindow( FALSE ); @@ -1384,7 +1384,7 @@ bool CSyntaxRichEditCtrl::BracedSectionEnd( char braceStartChar, char braceEndCh CSyntaxRichEditCtrl::BracedSectionAdjustEndTabs ================ */ -void CSyntaxRichEditCtrl::BracedSectionAdjustEndTabs( void ) +void CSyntaxRichEditCtrl::BracedSectionAdjustEndTabs() { int line, lineIndex, length, column, numTabs, i; char buffer[1024]; @@ -1424,7 +1424,7 @@ void CSyntaxRichEditCtrl::BracedSectionAdjustEndTabs( void ) CSyntaxRichEditCtrl::BracedSectionShow ================ */ -void CSyntaxRichEditCtrl::BracedSectionShow( void ) +void CSyntaxRichEditCtrl::BracedSectionShow() { for( int i = 0; i < 2; i++ ) { @@ -1440,7 +1440,7 @@ void CSyntaxRichEditCtrl::BracedSectionShow( void ) CSyntaxRichEditCtrl::BracedSectionHide ================ */ -void CSyntaxRichEditCtrl::BracedSectionHide( void ) +void CSyntaxRichEditCtrl::BracedSectionHide() { for( int i = 0; i < 2; i++ ) { diff --git a/neo/tools/comafx/CSyntaxRichEditCtrl.h b/neo/tools/comafx/CSyntaxRichEditCtrl.h index 3c45d6d..2afcb7c 100644 --- a/neo/tools/comafx/CSyntaxRichEditCtrl.h +++ b/neo/tools/comafx/CSyntaxRichEditCtrl.h @@ -95,10 +95,10 @@ typedef bool ( *toolTipCallback_t )( const char* name, CString& string ); class CSyntaxRichEditCtrl : public CRichEditCtrl { public: - CSyntaxRichEditCtrl( void ); - ~CSyntaxRichEditCtrl( void ); + CSyntaxRichEditCtrl(); + ~CSyntaxRichEditCtrl(); - void Init( void ); + void Init(); void SetCaseSensitive( bool caseSensitive ); void AllowPathNames( bool allow ); @@ -118,7 +118,7 @@ class CSyntaxRichEditCtrl : public CRichEditCtrl COLORREF GetBackColor( int charIndex ) const; void GetCursorPos( int& line, int& column, int& character ) const; - CHARRANGE GetVisibleRange( void ) const; + CHARRANGE GetVisibleRange() const; void GetText( idStr& text ) const; void GetText( idStr& text, int startCharIndex, int endCharIndex ) const; @@ -206,34 +206,34 @@ class CSyntaxRichEditCtrl : public CRichEditCtrl WCHAR* m_pwchTip; protected: - void InitFont( void ); - void InitSyntaxHighlighting( void ); + void InitFont(); + void InitSyntaxHighlighting(); void SetCharType( int first, int last, int type ); void SetDefaultFont( int startCharIndex, int endCharIndex ); void SetColor( int startCharIndex, int endCharIndex, COLORREF foreColor, COLORREF backColor, bool bold ); - void FreeKeyWordsFromFile( void ); + void FreeKeyWordsFromFile(); int FindKeyWord( const char* keyWord, int length ) const; void HighlightSyntax( int startCharIndex, int endCharIndex ); - void UpdateVisibleRange( void ); + void UpdateVisibleRange(); bool GetNameBeforeCurrentSelection( CString& name, int& charIndex ) const; bool GetNameForMousePosition( idStr& name ) const; - void AutoCompleteInsertText( void ); - void AutoCompleteUpdate( void ); + void AutoCompleteInsertText(); + void AutoCompleteUpdate(); void AutoCompleteShow( int charIndex ); - void AutoCompleteHide( void ); + void AutoCompleteHide(); void ToolTipShow( int charIndex, const char* string ); - void ToolTipHide( void ); + void ToolTipHide(); bool BracedSectionStart( char braceStartChar, char braceEndChar ); bool BracedSectionEnd( char braceStartChar, char braceEndChar ); - void BracedSectionAdjustEndTabs( void ); - void BracedSectionShow( void ); - void BracedSectionHide( void ); + void BracedSectionAdjustEndTabs(); + void BracedSectionShow(); + void BracedSectionHide(); }; #endif /* !__CSYNTAXRICHEDITCTR_H__ */ diff --git a/neo/tools/comafx/DialogGoToLine.cpp b/neo/tools/comafx/DialogGoToLine.cpp index 972333c..01e4270 100644 --- a/neo/tools/comafx/DialogGoToLine.cpp +++ b/neo/tools/comafx/DialogGoToLine.cpp @@ -94,7 +94,7 @@ void DialogGoToLine::SetRange( int firstLine, int lastLine ) DialogGoToLine::GetLine ================ */ -int DialogGoToLine::GetLine( void ) const +int DialogGoToLine::GetLine() const { return line; } diff --git a/neo/tools/comafx/DialogGoToLine.h b/neo/tools/comafx/DialogGoToLine.h index 1e40087..b11daa7 100644 --- a/neo/tools/comafx/DialogGoToLine.h +++ b/neo/tools/comafx/DialogGoToLine.h @@ -44,7 +44,7 @@ class DialogGoToLine : public CDialog enum { IDD = IDD_DIALOG_GOTOLINE }; void SetRange( int firstLine, int lastLine ); - int GetLine( void ) const; + int GetLine() const; protected: virtual BOOL OnInitDialog(); diff --git a/neo/tools/comafx/pch.cpp b/neo/tools/comafx/pch.cpp index 0d0cff2..eb96f18 100644 --- a/neo/tools/comafx/pch.cpp +++ b/neo/tools/comafx/pch.cpp @@ -50,7 +50,7 @@ bool afxInitialized = false; InitAfx ================ */ -void InitAfx( void ) +void InitAfx() { if( !afxInitialized ) { diff --git a/neo/tools/comafx/pch.h b/neo/tools/comafx/pch.h index fb512a3..0b3f6e8 100644 --- a/neo/tools/comafx/pch.h +++ b/neo/tools/comafx/pch.h @@ -29,7 +29,7 @@ If you have questions concerning this license or the applicable additional terms #ifndef __PCH_H__ #define __PCH_H__ -void InitAfx( void ); +void InitAfx(); // tool tips typedef struct toolTip_s diff --git a/neo/tools/common/AboutBoxDlg.cpp b/neo/tools/common/AboutBoxDlg.cpp index c54d384..399faf8 100644 --- a/neo/tools/common/AboutBoxDlg.cpp +++ b/neo/tools/common/AboutBoxDlg.cpp @@ -45,7 +45,7 @@ BEGIN_MESSAGE_MAP( CAboutDlg, CDialog ) ON_COMMAND( IDOK, &CAboutDlg::OnOK ) END_MESSAGE_MAP() -void CAboutDlg::OnOK( void ) +void CAboutDlg::OnOK() { EndDialog( IDOK ); } diff --git a/neo/tools/common/AboutBoxDlg.h b/neo/tools/common/AboutBoxDlg.h index 4386987..7780d68 100644 --- a/neo/tools/common/AboutBoxDlg.h +++ b/neo/tools/common/AboutBoxDlg.h @@ -42,7 +42,7 @@ class CAboutDlg : public CDialog virtual void DoDataExchange( CDataExchange* pDX ); virtual BOOL OnInitDialog(); - afx_msg void OnOK( void ); + afx_msg void OnOK(); DECLARE_MESSAGE_MAP() diff --git a/neo/tools/common/DialogHelpers.h b/neo/tools/common/DialogHelpers.h index 8e5bc1a..d0dd9ff 100644 --- a/neo/tools/common/DialogHelpers.h +++ b/neo/tools/common/DialogHelpers.h @@ -56,7 +56,7 @@ class rvDialogItem EnableWindow( mWindow, enable ); } - bool IsChecked( void ) + bool IsChecked() { return SendMessage( mWindow, BM_GETCHECK, 0, 0 ) == BST_CHECKED ? true : false; } @@ -73,7 +73,7 @@ class rvDialogItem out = text; } - float GetFloat( void ) + float GetFloat() { idStr text; GetText( text ); @@ -85,7 +85,7 @@ class rvDialogItem SetText( va( "%g", f ) ); } - operator HWND( void ) const + operator HWND() const { return mWindow; } @@ -112,7 +112,7 @@ class rvDialogItemContainer class name : public rvDialogItemContainer \ { \ public: \ - name ( void ) { } \ + name () { } \ name ( HWND hwnd ) { Cache ( hwnd ); } \ void Cache ( HWND parent ) \ { \ diff --git a/neo/tools/common/Parse.h b/neo/tools/common/Parse.h index a2409a6..2c5d311 100644 --- a/neo/tools/common/Parse.h +++ b/neo/tools/common/Parse.h @@ -35,5 +35,5 @@ extern int scriptline; void StartTokenParsing( const char* data ); bool GetToken( bool crossline ); -void UngetToken( void ); -bool TokenAvailable( void ); +void UngetToken(); +bool TokenAvailable(); diff --git a/neo/tools/common/PropertyGrid.cpp b/neo/tools/common/PropertyGrid.cpp index c42c110..a685f8e 100644 --- a/neo/tools/common/PropertyGrid.cpp +++ b/neo/tools/common/PropertyGrid.cpp @@ -52,7 +52,7 @@ rvPropertyGrid::rvPropertyGrid constructor ================ */ -rvPropertyGrid::rvPropertyGrid( void ) +rvPropertyGrid::rvPropertyGrid() { mWindow = NULL; mEdit = NULL; @@ -162,7 +162,7 @@ rvPropertyGrid::FinishEdit Finish editing by copying the data in the edit control to the internal value ================ */ -void rvPropertyGrid::FinishEdit( void ) +void rvPropertyGrid::FinishEdit() { char value[1024]; rvPropertyGridItem* item; @@ -239,7 +239,7 @@ rvPropertyGrid::CancelEdit Stop editing without saving the data ================ */ -void rvPropertyGrid::CancelEdit( void ) +void rvPropertyGrid::CancelEdit() { if( mState == STATE_EDIT && !mEditLabel ) { @@ -311,7 +311,7 @@ rvPropertyGrid::RemoveAllItems Remove all items from the property grid ================ */ -void rvPropertyGrid::RemoveAllItems( void ) +void rvPropertyGrid::RemoveAllItems() { int i; @@ -667,11 +667,11 @@ int rvPropertyGrid::HandleDrawItem( WPARAM wParam, LPARAM lParam ) rText.right = rText.left + mSplitter; rText.left += 2; - DrawText( dis->hDC, item->mName, item->mName.Length(), &rText, DT_LEFT | DT_VCENTER | DT_SINGLELINE ); + DrawTextA( dis->hDC, item->mName, item->mName.Length(), &rText, DT_LEFT | DT_VCENTER | DT_SINGLELINE ); rText.left = dis->rcItem.left + mSplitter + 2; rText.right = dis->rcItem.right; - DrawText( dis->hDC, item->mValue, item->mValue.Length(), &rText, DT_LEFT | DT_VCENTER | DT_SINGLELINE ); + DrawTextA( dis->hDC, item->mValue, item->mValue.Length(), &rText, DT_LEFT | DT_VCENTER | DT_SINGLELINE ); return 0; } \ No newline at end of file diff --git a/neo/tools/common/PropertyGrid.h b/neo/tools/common/PropertyGrid.h index 203e44d..8cb2183 100644 --- a/neo/tools/common/PropertyGrid.h +++ b/neo/tools/common/PropertyGrid.h @@ -65,12 +65,12 @@ class rvPropertyGrid int AddItem( const char* name, const char* value, EItemType type = PGIT_STRING ); void RemoveItem( int index ); - void RemoveAllItems( void ); + void RemoveAllItems(); void SetCurSel( int index ); - int GetCurSel( void ); + int GetCurSel(); - HWND GetWindow( void ); + HWND GetWindow(); const char* GetItemName( int index ); const char* GetItemValue( int index ); @@ -84,8 +84,8 @@ class rvPropertyGrid }; void StartEdit( int item, bool label ); - void FinishEdit( void ); - void CancelEdit( void ); + void FinishEdit(); + void CancelEdit(); int HandleDrawItem( WPARAM wParam, LPARAM lParam ); @@ -104,12 +104,12 @@ class rvPropertyGrid static LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); }; -inline HWND rvPropertyGrid::GetWindow( void ) +inline HWND rvPropertyGrid::GetWindow() { return mWindow; } -inline int rvPropertyGrid::GetCurSel( void ) +inline int rvPropertyGrid::GetCurSel() { return SendMessage( mWindow, LB_GETCURSEL, 0, 0 ); } diff --git a/neo/tools/common/RegistryOptions.cpp b/neo/tools/common/RegistryOptions.cpp index 9767107..505940b 100644 --- a/neo/tools/common/RegistryOptions.cpp +++ b/neo/tools/common/RegistryOptions.cpp @@ -38,7 +38,7 @@ rvRegistryOptions::rvRegistryOptions Constructor ================ */ -rvRegistryOptions::rvRegistryOptions( void ) +rvRegistryOptions::rvRegistryOptions() { } @@ -59,7 +59,7 @@ rvRegistryOptions::Save Write the options to the registry ================ */ -bool rvRegistryOptions::Save( void ) +bool rvRegistryOptions::Save() { HKEY hKey; int i; @@ -94,7 +94,7 @@ rvRegistryOptions::Load Read the options from the registry ================ */ -bool rvRegistryOptions::Load( void ) +bool rvRegistryOptions::Load() { HKEY hKey; char temp[MAX_PATH]; diff --git a/neo/tools/common/RegistryOptions.h b/neo/tools/common/RegistryOptions.h index ddba64d..b5492c3 100644 --- a/neo/tools/common/RegistryOptions.h +++ b/neo/tools/common/RegistryOptions.h @@ -40,10 +40,10 @@ class rvRegistryOptions void Init( const char* key ); // Write the options to the registery - bool Save( void ); + bool Save(); // Read the options from the registry - bool Load( void ); + bool Load(); // Window placement routines void SetWindowPlacement( const char* name, HWND hwnd ); @@ -72,7 +72,7 @@ class rvRegistryOptions // MRU related methods void AddRecentFile( const char* filename ); const char* GetRecentFile( int index ); - int GetRecentFileCount( void ); + int GetRecentFileCount(); private: @@ -131,7 +131,7 @@ ID_INLINE idVec4 rvRegistryOptions::GetVec4( const char* name ) return mValues.GetVec4( name ); } -ID_INLINE int rvRegistryOptions::GetRecentFileCount( void ) +ID_INLINE int rvRegistryOptions::GetRecentFileCount() { return mRecentFiles.Num( ); } diff --git a/neo/tools/debugger/DebuggerApp.cpp b/neo/tools/debugger/DebuggerApp.cpp index 40a3c51..f3f6031 100644 --- a/neo/tools/debugger/DebuggerApp.cpp +++ b/neo/tools/debugger/DebuggerApp.cpp @@ -102,7 +102,7 @@ rvDebuggerApp::ProcessWindowMessages Process windows messages ================ */ -bool rvDebuggerApp::ProcessWindowMessages( void ) +bool rvDebuggerApp::ProcessWindowMessages() { MSG msg; @@ -147,7 +147,7 @@ rvDebuggerApp::Run Main Loop for the debugger application ================ */ -int rvDebuggerApp::Run( void ) +int rvDebuggerApp::Run() { // Main message loop: while( ProcessWindowMessages( ) ) diff --git a/neo/tools/debugger/DebuggerApp.h b/neo/tools/debugger/DebuggerApp.h index fcfc80a..04b02ea 100644 --- a/neo/tools/debugger/DebuggerApp.h +++ b/neo/tools/debugger/DebuggerApp.h @@ -60,13 +60,13 @@ class rvDebuggerApp ~rvDebuggerApp(); bool Initialize( HINSTANCE hInstance ); - int Run( void ); + int Run(); - rvRegistryOptions& GetOptions( void ); - rvDebuggerClient& GetClient( void ); - rvDebuggerWindow& GetWindow( void ); + rvRegistryOptions& GetOptions(); + rvDebuggerClient& GetClient(); + rvDebuggerWindow& GetWindow(); - HINSTANCE GetInstance( void ); + HINSTANCE GetInstance(); bool TranslateAccelerator( LPMSG msg ); @@ -80,26 +80,26 @@ class rvDebuggerApp private: - bool ProcessNetMessages( void ); - bool ProcessWindowMessages( void ); + bool ProcessNetMessages(); + bool ProcessWindowMessages(); }; -ID_INLINE HINSTANCE rvDebuggerApp::GetInstance( void ) +ID_INLINE HINSTANCE rvDebuggerApp::GetInstance() { return mInstance; } -ID_INLINE rvDebuggerClient& rvDebuggerApp::GetClient( void ) +ID_INLINE rvDebuggerClient& rvDebuggerApp::GetClient() { return mClient; } -ID_INLINE rvRegistryOptions& rvDebuggerApp::GetOptions( void ) +ID_INLINE rvRegistryOptions& rvDebuggerApp::GetOptions() { return mOptions; } -ID_INLINE rvDebuggerWindow& rvDebuggerApp::GetWindow( void ) +ID_INLINE rvDebuggerWindow& rvDebuggerApp::GetWindow() { assert( mDebuggerWindow ); return *mDebuggerWindow; diff --git a/neo/tools/debugger/DebuggerBreakpoint.cpp b/neo/tools/debugger/DebuggerBreakpoint.cpp index 91e326e..f5b4db7 100644 --- a/neo/tools/debugger/DebuggerBreakpoint.cpp +++ b/neo/tools/debugger/DebuggerBreakpoint.cpp @@ -60,6 +60,6 @@ rvDebuggerBreakpoint::rvDebuggerBreakpoint( rvDebuggerBreakpoint& bp ) mLineNumber = bp.mLineNumber; } -rvDebuggerBreakpoint::~rvDebuggerBreakpoint( void ) +rvDebuggerBreakpoint::~rvDebuggerBreakpoint() { } diff --git a/neo/tools/debugger/DebuggerBreakpoint.h b/neo/tools/debugger/DebuggerBreakpoint.h index 13d9cf4..b2780df 100644 --- a/neo/tools/debugger/DebuggerBreakpoint.h +++ b/neo/tools/debugger/DebuggerBreakpoint.h @@ -34,12 +34,12 @@ class rvDebuggerBreakpoint rvDebuggerBreakpoint( const char* filename, int linenumber, int id = -1, bool onceOnly = false ); rvDebuggerBreakpoint( rvDebuggerBreakpoint& bp ); - ~rvDebuggerBreakpoint( void ); + ~rvDebuggerBreakpoint(); - const char* GetFilename( void ); - int GetLineNumber( void ); - int GetID( void ); - bool GetOnceOnly( void ); + const char* GetFilename(); + int GetLineNumber(); + int GetID(); + bool GetOnceOnly(); protected: @@ -53,22 +53,22 @@ class rvDebuggerBreakpoint static int mNextID; }; -ID_INLINE const char* rvDebuggerBreakpoint::GetFilename( void ) +ID_INLINE const char* rvDebuggerBreakpoint::GetFilename() { return mFilename; } -ID_INLINE int rvDebuggerBreakpoint::GetLineNumber( void ) +ID_INLINE int rvDebuggerBreakpoint::GetLineNumber() { return mLineNumber; } -ID_INLINE int rvDebuggerBreakpoint::GetID( void ) +ID_INLINE int rvDebuggerBreakpoint::GetID() { return mID; } -ID_INLINE bool rvDebuggerBreakpoint::GetOnceOnly( void ) +ID_INLINE bool rvDebuggerBreakpoint::GetOnceOnly() { return mOnceOnly; } diff --git a/neo/tools/debugger/DebuggerClient.cpp b/neo/tools/debugger/DebuggerClient.cpp index 2c88e53..1a619b5 100644 --- a/neo/tools/debugger/DebuggerClient.cpp +++ b/neo/tools/debugger/DebuggerClient.cpp @@ -61,7 +61,7 @@ rvDebuggerClient::Initialize Initialize the debugger client ================ */ -bool rvDebuggerClient::Initialize( void ) +bool rvDebuggerClient::Initialize() { // Nothing else can run with the debugger com_editors = EDITOR_DEBUGGER; @@ -91,7 +91,7 @@ Shutdown the debugger client and let the debugger server know we are shutting down ================ */ -void rvDebuggerClient::Shutdown( void ) +void rvDebuggerClient::Shutdown() { if( mConnected ) { @@ -107,7 +107,7 @@ rvDebuggerClient::ProcessMessages Process all incomding messages from the debugger server ================ */ -bool rvDebuggerClient::ProcessMessages( void ) +bool rvDebuggerClient::ProcessMessages() { netadr_t adrFrom; idBitMsg msg; @@ -250,7 +250,7 @@ rvDebuggerClient::InspectScripts Instructs the client to inspect the loaded scripts ================ */ -void rvDebuggerClient::InspectScripts( void ) +void rvDebuggerClient::InspectScripts() { idBitMsg msg; byte buffer[MAX_MSGLEN]; @@ -474,7 +474,7 @@ rvDebuggerClient::ClearBreakpoints Removes all breakpoints from the client and server ================ */ -void rvDebuggerClient::ClearBreakpoints( void ) +void rvDebuggerClient::ClearBreakpoints() { int i; @@ -557,7 +557,7 @@ rvDebuggerClient::SendBreakpoints Send all breakpoints to the debugger server ================ */ -void rvDebuggerClient::SendBreakpoints( void ) +void rvDebuggerClient::SendBreakpoints() { int i; @@ -633,7 +633,7 @@ rvDebuggerClient::ClearCallstack Clear all callstack entries ================ */ -void rvDebuggerClient::ClearCallstack( void ) +void rvDebuggerClient::ClearCallstack() { int depth; @@ -652,7 +652,7 @@ rvDebuggerClient::ClearThreads Clear all thread entries ================ */ -void rvDebuggerClient::ClearThreads( void ) +void rvDebuggerClient::ClearThreads() { int i; diff --git a/neo/tools/debugger/DebuggerClient.h b/neo/tools/debugger/DebuggerClient.h index 7187224..6294973 100644 --- a/neo/tools/debugger/DebuggerClient.h +++ b/neo/tools/debugger/DebuggerClient.h @@ -65,44 +65,44 @@ class rvDebuggerClient rvDebuggerClient( ); ~rvDebuggerClient( ); - bool Initialize( void ); - void Shutdown( void ); - bool ProcessMessages( void ); + bool Initialize(); + void Shutdown(); + bool ProcessMessages(); bool WaitFor( EDebuggerMessage msg, int time ); - bool IsConnected( void ); - bool IsStopped( void ); + bool IsConnected(); + bool IsStopped(); - int GetActiveBreakpointID( void ); - const char* GetBreakFilename( void ); - int GetBreakLineNumber( void ); - idProgram* GetBreakProgram( void ); - rvDebuggerCallstackList& GetCallstack( void ); - rvDebuggerThreadList& GetThreads( void ); + int GetActiveBreakpointID(); + const char* GetBreakFilename(); + int GetBreakLineNumber(); + idProgram* GetBreakProgram(); + rvDebuggerCallstackList& GetCallstack(); + rvDebuggerThreadList& GetThreads(); const char* GetVariableValue( const char* name, int stackDepth ); - idStrList& GetServerScripts( void ); + idStrList& GetServerScripts(); void InspectVariable( const char* name, int callstackDepth ); - void InspectScripts( void ); - void Break( void ); - void Resume( void ); - void StepInto( void ); - void StepOver( void ); + void InspectScripts(); + void Break(); + void Resume(); + void StepInto(); + void StepOver(); void SendCommand( const char* cmdStr ); // Breakpoints int AddBreakpoint( const char* filename, int lineNumber, bool onceOnly = false ); bool RemoveBreakpoint( int bpID ); - void ClearBreakpoints( void ); - int GetBreakpointCount( void ); + void ClearBreakpoints(); + int GetBreakpointCount(); rvDebuggerBreakpoint* GetBreakpoint( int index ); rvDebuggerBreakpoint* FindBreakpoint( const char* filename, int linenumber ); protected: void SendMessage( EDebuggerMessage dbmsg ); - void SendBreakpoints( void ); + void SendBreakpoints(); void SendAddBreakpoint( rvDebuggerBreakpoint& bp ); void SendRemoveBreakpoint( rvDebuggerBreakpoint& bp ); void SendPacket( void* data, int datasize ); @@ -128,10 +128,10 @@ class rvDebuggerClient private: - void ClearCallstack( void ); - void ClearThreads( void ); + void ClearCallstack(); + void ClearThreads(); - void UpdateWatches( void ); + void UpdateWatches(); // Network message handlers void HandleBreak( idBitMsg* msg ); @@ -148,7 +148,7 @@ class rvDebuggerClient rvDebuggerClient::IsConnected ================ */ -ID_INLINE bool rvDebuggerClient::IsConnected( void ) +ID_INLINE bool rvDebuggerClient::IsConnected() { return mConnected; } @@ -158,7 +158,7 @@ ID_INLINE bool rvDebuggerClient::IsConnected( void ) rvDebuggerClient::IsStopped ================ */ -ID_INLINE bool rvDebuggerClient::IsStopped( void ) +ID_INLINE bool rvDebuggerClient::IsStopped() { return mBreak; } @@ -168,7 +168,7 @@ ID_INLINE bool rvDebuggerClient::IsStopped( void ) rvDebuggerClient::GetActiveBreakpointID ================ */ -ID_INLINE int rvDebuggerClient::GetActiveBreakpointID( void ) +ID_INLINE int rvDebuggerClient::GetActiveBreakpointID() { return mBreakID; } @@ -178,7 +178,7 @@ ID_INLINE int rvDebuggerClient::GetActiveBreakpointID( void ) rvDebuggerClient::GetBreakFilename ================ */ -ID_INLINE const char* rvDebuggerClient::GetBreakFilename( void ) +ID_INLINE const char* rvDebuggerClient::GetBreakFilename() { return mBreakFilename; } @@ -188,7 +188,7 @@ ID_INLINE const char* rvDebuggerClient::GetBreakFilename( void ) rvDebuggerClient::GetBreakLineNumber ================ */ -ID_INLINE int rvDebuggerClient::GetBreakLineNumber( void ) +ID_INLINE int rvDebuggerClient::GetBreakLineNumber() { return mBreakLineNumber; } @@ -198,7 +198,7 @@ ID_INLINE int rvDebuggerClient::GetBreakLineNumber( void ) rvDebuggerClient::GetCallstack ================ */ -ID_INLINE rvDebuggerCallstackList& rvDebuggerClient::GetCallstack( void ) +ID_INLINE rvDebuggerCallstackList& rvDebuggerClient::GetCallstack() { return mCallstack; } @@ -208,7 +208,7 @@ ID_INLINE rvDebuggerCallstackList& rvDebuggerClient::GetCallstack( void ) rvDebuggerClient::GetThreads ================ */ -ID_INLINE rvDebuggerThreadList& rvDebuggerClient::GetThreads( void ) +ID_INLINE rvDebuggerThreadList& rvDebuggerClient::GetThreads() { return mThreads; } @@ -228,7 +228,7 @@ ID_INLINE const char* rvDebuggerClient::GetVariableValue( const char* var, int s rvDebuggerClient::GetBreakpointCount ================ */ -ID_INLINE int rvDebuggerClient::GetBreakpointCount( void ) +ID_INLINE int rvDebuggerClient::GetBreakpointCount() { return mBreakpoints.Num( ); } @@ -248,7 +248,7 @@ ID_INLINE rvDebuggerBreakpoint* rvDebuggerClient::GetBreakpoint( int index ) rvDebuggerClient::Break ================ */ -ID_INLINE void rvDebuggerClient::Break( void ) +ID_INLINE void rvDebuggerClient::Break() { SendMessage( DBMSG_BREAK ); } @@ -258,7 +258,7 @@ ID_INLINE void rvDebuggerClient::Break( void ) rvDebuggerClient::Resume ================ */ -ID_INLINE void rvDebuggerClient::Resume( void ) +ID_INLINE void rvDebuggerClient::Resume() { mBreak = false; SendMessage( DBMSG_RESUME ); @@ -269,7 +269,7 @@ ID_INLINE void rvDebuggerClient::Resume( void ) rvDebuggerClient::StepOver ================ */ -ID_INLINE void rvDebuggerClient::StepOver( void ) +ID_INLINE void rvDebuggerClient::StepOver() { mBreak = false; SendMessage( DBMSG_STEPOVER ); @@ -280,7 +280,7 @@ ID_INLINE void rvDebuggerClient::StepOver( void ) rvDebuggerClient::StepInto ================ */ -ID_INLINE void rvDebuggerClient::StepInto( void ) +ID_INLINE void rvDebuggerClient::StepInto() { mBreak = false; SendMessage( DBMSG_STEPINTO ); @@ -302,7 +302,7 @@ ID_INLINE void rvDebuggerClient::SendPacket( void* data, int size ) rvDebuggerClient::GetServerScripts ================ */ -ID_INLINE idStrList& rvDebuggerClient::GetServerScripts( void ) +ID_INLINE idStrList& rvDebuggerClient::GetServerScripts() { return mServerScripts; } diff --git a/neo/tools/debugger/DebuggerFindDlg.cpp b/neo/tools/debugger/DebuggerFindDlg.cpp index a34ee0c..e66e273 100644 --- a/neo/tools/debugger/DebuggerFindDlg.cpp +++ b/neo/tools/debugger/DebuggerFindDlg.cpp @@ -41,7 +41,7 @@ char rvDebuggerFindDlg::mFindText[ 256 ]; rvDebuggerFindDlg::rvDebuggerFindDlg ================ */ -rvDebuggerFindDlg::rvDebuggerFindDlg( void ) +rvDebuggerFindDlg::rvDebuggerFindDlg() { } diff --git a/neo/tools/debugger/DebuggerFindDlg.h b/neo/tools/debugger/DebuggerFindDlg.h index b8156ae..288a0c7 100644 --- a/neo/tools/debugger/DebuggerFindDlg.h +++ b/neo/tools/debugger/DebuggerFindDlg.h @@ -38,7 +38,7 @@ class rvDebuggerFindDlg bool DoModal( rvDebuggerWindow* window ); - const char* GetFindText( void ); + const char* GetFindText(); protected: @@ -51,7 +51,7 @@ class rvDebuggerFindDlg static INT_PTR CALLBACK DlgProc( HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam ); }; -ID_INLINE const char* rvDebuggerFindDlg::GetFindText( void ) +ID_INLINE const char* rvDebuggerFindDlg::GetFindText() { return mFindText; } diff --git a/neo/tools/debugger/DebuggerQuickWatchDlg.cpp b/neo/tools/debugger/DebuggerQuickWatchDlg.cpp index 327c6a3..13e288e 100644 --- a/neo/tools/debugger/DebuggerQuickWatchDlg.cpp +++ b/neo/tools/debugger/DebuggerQuickWatchDlg.cpp @@ -39,7 +39,7 @@ If you have questions concerning this license or the applicable additional terms rvDebuggerQuickWatchDlg::rvDebuggerQuickWatchDlg ================ */ -rvDebuggerQuickWatchDlg::rvDebuggerQuickWatchDlg( void ) +rvDebuggerQuickWatchDlg::rvDebuggerQuickWatchDlg() { } diff --git a/neo/tools/debugger/DebuggerScript.cpp b/neo/tools/debugger/DebuggerScript.cpp index 88b5efb..82ec71e 100644 --- a/neo/tools/debugger/DebuggerScript.cpp +++ b/neo/tools/debugger/DebuggerScript.cpp @@ -41,7 +41,7 @@ If you have questions concerning this license or the applicable additional terms rvDebuggerScript::rvDebuggerScript ================ */ -rvDebuggerScript::rvDebuggerScript( void ) +rvDebuggerScript::rvDebuggerScript() { mContents = NULL; mProgram = NULL; @@ -53,7 +53,7 @@ rvDebuggerScript::rvDebuggerScript( void ) rvDebuggerScript::~rvDebuggerScript ================ */ -rvDebuggerScript::~rvDebuggerScript( void ) +rvDebuggerScript::~rvDebuggerScript() { Unload( ); } @@ -66,7 +66,7 @@ rvDebuggerScript::Unload Unload the script from memory ================ */ -void rvDebuggerScript::Unload( void ) +void rvDebuggerScript::Unload() { delete[] mContents; @@ -125,7 +125,7 @@ rvDebuggerScript::Reload Reload the contents of the script ================ */ -bool rvDebuggerScript::Reload( void ) +bool rvDebuggerScript::Reload() { return Load( mFilename ); } diff --git a/neo/tools/debugger/DebuggerScript.h b/neo/tools/debugger/DebuggerScript.h index 99e1c9d..13de55a 100644 --- a/neo/tools/debugger/DebuggerScript.h +++ b/neo/tools/debugger/DebuggerScript.h @@ -35,24 +35,24 @@ class rvDebuggerScript { public: - rvDebuggerScript( void ); - ~rvDebuggerScript( void ); + rvDebuggerScript(); + ~rvDebuggerScript(); bool Load( const char* filename ); - bool Reload( void ); + bool Reload(); - const char* GetFilename( void ); - const char* GetContents( void ); - idProgram* GetProgram( void ); + const char* GetFilename(); + const char* GetContents(); + idProgram* GetProgram(); #if 0// Test code - idProgram& GetProgram( void ); + idProgram& GetProgram(); #endif bool IsLineCode( int linenumber ); bool IsFileModified( bool updateTime = false ); protected: - void Unload( void ); + void Unload(); idProgram* mProgram; idUserInterfaceLocal* mInterface; @@ -61,17 +61,17 @@ class rvDebuggerScript ID_TIME_T mModifiedTime; }; -ID_INLINE const char* rvDebuggerScript::GetFilename( void ) +ID_INLINE const char* rvDebuggerScript::GetFilename() { return mFilename; } -ID_INLINE const char* rvDebuggerScript::GetContents( void ) +ID_INLINE const char* rvDebuggerScript::GetContents() { return mContents ? mContents : ""; } -ID_INLINE idProgram* rvDebuggerScript::GetProgram( void ) +ID_INLINE idProgram* rvDebuggerScript::GetProgram() { return mProgram; } diff --git a/neo/tools/debugger/DebuggerServer.cpp b/neo/tools/debugger/DebuggerServer.cpp index cb20b1c..ac06de3 100644 --- a/neo/tools/debugger/DebuggerServer.cpp +++ b/neo/tools/debugger/DebuggerServer.cpp @@ -83,7 +83,7 @@ Initialize the debugger server. This function should be called before the debugger server is used. ================ */ -bool rvDebuggerServer::Initialize( void ) +bool rvDebuggerServer::Initialize() { // Initialize the network connection if( !mPort.InitForPort( 27980 ) ) @@ -130,7 +130,7 @@ rvDebuggerServer::Shutdown Shutdown the debugger server. ================ */ -void rvDebuggerServer::Shutdown( void ) +void rvDebuggerServer::Shutdown() { // Let the debugger client know we are shutting down if( mConnected ) @@ -160,7 +160,7 @@ rvDebuggerServer::ProcessMessages Process all incoming network messages from the debugger client ================ */ -bool rvDebuggerServer::ProcessMessages( void ) +bool rvDebuggerServer::ProcessMessages() { netadr_t adrFrom; idBitMsg msg; @@ -736,7 +736,7 @@ rvDebuggerServer::Resume Resume execution of the game. ================ */ -void rvDebuggerServer::Resume( void ) +void rvDebuggerServer::Resume() { // Cant resume if not paused if( !mBreak ) @@ -758,7 +758,7 @@ rvDebuggerServer::ClearBreakpoints Remove all known breakpoints ================ */ -void rvDebuggerServer::ClearBreakpoints( void ) +void rvDebuggerServer::ClearBreakpoints() { int i; diff --git a/neo/tools/debugger/DebuggerServer.h b/neo/tools/debugger/DebuggerServer.h index 7a773f2..65270e4 100644 --- a/neo/tools/debugger/DebuggerServer.h +++ b/neo/tools/debugger/DebuggerServer.h @@ -52,12 +52,12 @@ class rvDebuggerServer rvDebuggerServer( ); ~rvDebuggerServer( ); - bool Initialize( void ); - void Shutdown( void ); + bool Initialize(); + void Shutdown(); - bool ProcessMessages( void ); + bool ProcessMessages(); - bool IsConnected( void ); + bool IsConnected(); void CheckBreakpoints( idInterpreter* interpreter, idProgram* program, int instructionPointer ); @@ -65,13 +65,13 @@ class rvDebuggerServer void OSPathToRelativePath( const char* osPath, idStr& qpath ); - bool GameSuspended( void ); + bool GameSuspended(); private: - void ClearBreakpoints( void ); + void ClearBreakpoints(); void Break( idInterpreter* interpreter, idProgram* program, int instructionPointer ); - void Resume( void ); + void Resume(); void SendMessage( EDebuggerMessage dbmsg ); void SendPacket( void* data, int datasize ); @@ -120,7 +120,7 @@ class rvDebuggerServer rvDebuggerServer::IsConnected ================ */ -ID_INLINE bool rvDebuggerServer::IsConnected( void ) +ID_INLINE bool rvDebuggerServer::IsConnected() { return mConnected; } @@ -140,7 +140,7 @@ ID_INLINE void rvDebuggerServer::SendPacket( void* data, int size ) rvDebuggerServer::GameSuspended ================ */ -ID_INLINE bool rvDebuggerServer::GameSuspended( void ) +ID_INLINE bool rvDebuggerServer::GameSuspended() { return mBreak; } diff --git a/neo/tools/debugger/DebuggerWindow.cpp b/neo/tools/debugger/DebuggerWindow.cpp index b0b45c7..afb802e 100644 --- a/neo/tools/debugger/DebuggerWindow.cpp +++ b/neo/tools/debugger/DebuggerWindow.cpp @@ -59,7 +59,7 @@ If you have questions concerning this license or the applicable additional terms class CAboutDebuggerDlg : public CAboutDlg { public: - CAboutDebuggerDlg( void ); + CAboutDebuggerDlg(); virtual BOOL OnInitDialog(); }; @@ -175,7 +175,7 @@ Registers the window class used by the debugger window. This is called when the window is created. ================ */ -bool rvDebuggerWindow::RegisterClass( void ) +bool rvDebuggerWindow::RegisterClass() { WNDCLASSEX wcex; @@ -511,7 +511,7 @@ LRESULT CALLBACK rvDebuggerWindow::MarginWndProc( HWND wnd, UINT msg, WPARAM wpa t.right -= s4; // a little space between text and "border" to code part of window idStr lntxt( iFirstVisibleLine + i + 1 ); - DrawText( dc, lntxt, lntxt.Length(), &t, DT_RIGHT ); + DrawTextA( dc, lntxt, lntxt.Length(), &t, DT_RIGHT ); } DeleteObject( hf ); @@ -588,7 +588,7 @@ rvDebuggerWindow::UpdateTitle Updates the window title of the script debugger to show a few states ================ */ -void rvDebuggerWindow::UpdateTitle( void ) +void rvDebuggerWindow::UpdateTitle() { idStr title; @@ -634,7 +634,7 @@ rvDebuggerWindow::UpdateScript Updates the edit window to contain the current script ================ */ -void rvDebuggerWindow::UpdateScript( void ) +void rvDebuggerWindow::UpdateScript() { UpdateTitle( ); @@ -672,7 +672,7 @@ rvDebuggerWindow::UpdateWindowMenu Updates the windows displayed in the window menu ================ */ -void rvDebuggerWindow::UpdateWindowMenu( void ) +void rvDebuggerWindow::UpdateWindowMenu() { while( GetMenuItemCount( mWindowMenu ) > mWindowMenuPos ) { @@ -702,7 +702,7 @@ rvDebuggerWindow::UpdateCallstack Updates the contents of teh callastack ================ */ -void rvDebuggerWindow::UpdateCallstack( void ) +void rvDebuggerWindow::UpdateCallstack() { LVITEM item; ListView_DeleteAllItems( mWndCallstack ); @@ -723,7 +723,7 @@ void rvDebuggerWindow::UpdateCallstack( void ) } } -void rvDebuggerWindow::UpdateScriptList( void ) +void rvDebuggerWindow::UpdateScriptList() { LVITEM item; ListView_DeleteAllItems( mWndScriptList ); @@ -751,7 +751,7 @@ void rvDebuggerWindow::UpdateScriptList( void ) } -void rvDebuggerWindow::UpdateBreakpointList( void ) +void rvDebuggerWindow::UpdateBreakpointList() { LVITEM item; ListView_DeleteAllItems( mWndBreakList ); @@ -780,7 +780,7 @@ rvDebuggerWindow::UpdateWatch Updates the contents of the watch window ================ */ -void rvDebuggerWindow::UpdateWatch( void ) +void rvDebuggerWindow::UpdateWatch() { int i; @@ -948,7 +948,7 @@ void rvDebuggerWindow::ResizeImageList( int& widthOut, int& heightOut ) heightOut = height; } -float rvDebuggerWindow::GetMarginWidth( void ) +float rvDebuggerWindow::GetMarginWidth() { TEXTMETRIC tm; HDC dc; @@ -1221,7 +1221,7 @@ int rvDebuggerWindow::HandleCommand( WPARAM wparam, LPARAM lparam ) filename = gDebuggerApp.GetOptions().GetRecentFile( gDebuggerApp.GetOptions().GetRecentFileCount() - ( LOWORD( wparam ) - ID_DBG_FILE_MRU1 ) - 1 ); if( !OpenScript( filename ) ) { - MessageBox( mWnd, va( "Failed to open script '%s'", filename.c_str() ), "Quake 4 Script Debugger", MB_OK ); + MessageBoxA( mWnd, va( "Failed to open script '%s'", filename.c_str() ), "Quake 4 Script Debugger", MB_OK ); } return 0; } @@ -1929,7 +1929,7 @@ LRESULT CALLBACK rvDebuggerWindow::WndProc( HWND wnd, UINT msg, WPARAM wparam, L case WM_CLOSE: if( window->mClient->IsConnected( ) ) { - if( IDNO == MessageBox( wnd, "The debugger is currently connected to a running version of the game. Are you sure you want to close now?", "Script Debugger", MB_YESNO | MB_ICONQUESTION ) ) + if( IDNO == MessageBoxA( wnd, "The debugger is currently connected to a running version of the game. Are you sure you want to close now?", "Script Debugger", MB_YESNO | MB_ICONQUESTION ) ) { return 0; } @@ -1949,7 +1949,7 @@ Static method that will activate the currently running debugger. If one is foun and activated then true will be returned. ================ */ -bool rvDebuggerWindow::Activate( void ) +bool rvDebuggerWindow::Activate() { HWND find; @@ -2265,7 +2265,7 @@ rvDebuggerWindow::ToggleBreakpoint Toggles the breakpoint on the current script line ================ */ -void rvDebuggerWindow::ToggleBreakpoint( void ) +void rvDebuggerWindow::ToggleBreakpoint() { rvDebuggerBreakpoint* bp; DWORD sel; @@ -2326,7 +2326,7 @@ rvDebuggerWindow::CreateToolbar Create the toolbar and and all of its buttons ================ */ -void rvDebuggerWindow::CreateToolbar( void ) +void rvDebuggerWindow::CreateToolbar() { // Create the toolbar control mWndToolbar = CreateWindowEx( 0, TOOLBARCLASSNAME, "", WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, mWnd, ( HMENU )IDC_DBG_TOOLBAR, mInstance, NULL ); @@ -2352,6 +2352,7 @@ void rvDebuggerWindow::CreateToolbar( void ) // Add the buttons to the toolbar // FIXME: warning C4838: conversion from 'int' to 'BYTE' requires a narrowing conversion // most probably because TBBUTTON has 4 more bytes in bReserved for alignment on _WIN64 +#pragma warning(disable:4838) TBBUTTON tbb[] = { { 0, 0, TBSTATE_ENABLED, BTNS_SEP, 0, 0, -1 }, { 8, ID_DBG_FILE_OPEN, TBSTATE_ENABLED, BTNS_BUTTON, 0, 0, -1 }, { 0, 0, TBSTATE_ENABLED, BTNS_SEP, 0, 0, -1 }, @@ -2363,7 +2364,7 @@ void rvDebuggerWindow::CreateToolbar( void ) { 6, ID_DBG_DEBUG_STEPOUT, TBSTATE_ENABLED, BTNS_BUTTON, 0, 0, -1 }, { 0, 0, TBSTATE_ENABLED, BTNS_SEP, 0, 0, -1 } }; - +#pragma warning(default:4838) SendMessage( mWndToolbar, TB_ADDBUTTONS, ( WPARAM )sizeof( tbb ) / sizeof( TBBUTTON ), ( LPARAM ) tbb ); } @@ -2441,7 +2442,7 @@ int rvDebuggerWindow::HandleActivate( WPARAM wparam, LPARAM lparam ) { if( mScripts[i]->IsFileModified( true ) ) { - if( IDYES == MessageBox( mWnd, va( "%s\n\nThis file has been modified outside of the debugger.\nDo you want to reload it?", mScripts[i]->GetFilename() ), "Quake 4 Script Debugger", MB_YESNO | MB_ICONQUESTION ) ) + if( IDYES == MessageBoxA( mWnd, va( "%s\n\nThis file has been modified outside of the debugger.\nDo you want to reload it?", mScripts[i]->GetFilename() ), "Quake 4 Script Debugger", MB_YESNO | MB_ICONQUESTION ) ) { mScripts[i]->Reload( ); @@ -2532,7 +2533,7 @@ Finds the file menu and the location within it where the MRU should be added. ================ */ -bool rvDebuggerWindow::InitRecentFiles( void ) +bool rvDebuggerWindow::InitRecentFiles() { int i; int count; @@ -2560,7 +2561,7 @@ rvDebuggerWindow::UpdateRecentFiles Updates the mru in the menu ================ */ -void rvDebuggerWindow::UpdateRecentFiles( void ) +void rvDebuggerWindow::UpdateRecentFiles() { int i; int j; @@ -2808,7 +2809,7 @@ int rvDebuggerWindow::HandleDrawItem( WPARAM wparam, LPARAM lparam ) { case 0: SetTextColor( dis->hDC, GetSysColor( selected ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT ) ); - DrawText( dis->hDC, watch->mVariable, -1, &textrect, DT_LEFT | DT_VCENTER ); + DrawTextA( dis->hDC, watch->mVariable, -1, &textrect, DT_LEFT | DT_VCENTER ); break; case 1: @@ -2820,7 +2821,7 @@ int rvDebuggerWindow::HandleDrawItem( WPARAM wparam, LPARAM lparam ) { SetTextColor( dis->hDC, GetSysColor( selected ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT ) ); } - DrawText( dis->hDC, watch->mValue, -1, &textrect, DT_LEFT | DT_VCENTER ); + DrawTextA( dis->hDC, watch->mValue, -1, &textrect, DT_LEFT | DT_VCENTER ); break; } } diff --git a/neo/tools/debugger/DebuggerWindow.h b/neo/tools/debugger/DebuggerWindow.h index 2ab3f67..ec279a6 100644 --- a/neo/tools/debugger/DebuggerWindow.h +++ b/neo/tools/debugger/DebuggerWindow.h @@ -54,22 +54,22 @@ class rvDebuggerWindow bool Create( HINSTANCE hInstance ); - static bool Activate( void ); + static bool Activate(); void ProcessNetMessage( idBitMsg* msg ); void Printf( const char* format, ... ); - HWND GetWindow( void ); + HWND GetWindow(); void AddWatch( const char* name, bool update = true ); - HINSTANCE GetInstance( void ); + HINSTANCE GetInstance(); private: - bool RegisterClass( void ); - void CreateToolbar( void ); - bool InitRecentFiles( void ); + bool RegisterClass(); + void CreateToolbar(); + bool InitRecentFiles(); int HandleInitMenu( WPARAM wParam, LPARAM lParam ); int HandleCommand( WPARAM wParam, LPARAM lParam ); @@ -88,22 +88,22 @@ class rvDebuggerWindow bool FindPrev( const char* text = NULL ); bool FindNext( const char* text = NULL ); - void UpdateBreakpointList( void ); - void UpdateScriptList( void ); - void UpdateWatch( void ); - void UpdateWindowMenu( void ); - void UpdateScript( void ); - void UpdateToolbar( void ); - void UpdateTitle( void ); - void UpdateCallstack( void ); - void UpdateRecentFiles( void ); + void UpdateBreakpointList(); + void UpdateScriptList(); + void UpdateWatch(); + void UpdateWindowMenu(); + void UpdateScript(); + void UpdateToolbar(); + void UpdateTitle(); + void UpdateCallstack(); + void UpdateRecentFiles(); bool OpenScript( const char* filename, int lineNumber = -1, idProgram* program = NULL ); void EnableWindows( bool state ); int GetSelectedText( idStr& text ); - void ToggleBreakpoint( void ); - float GetMarginWidth( void ); + void ToggleBreakpoint(); + float GetMarginWidth(); HWND mWnd; HWND mWndScript; HWND mWndOutput; @@ -159,7 +159,7 @@ class rvDebuggerWindow rvDebuggerWindow::GetWindow ================ */ -ID_INLINE HWND rvDebuggerWindow::GetWindow( void ) +ID_INLINE HWND rvDebuggerWindow::GetWindow() { return mWnd; } @@ -169,7 +169,7 @@ ID_INLINE HWND rvDebuggerWindow::GetWindow( void ) rvDebuggerWindow::UpdateToolbar ================ */ -ID_INLINE void rvDebuggerWindow::UpdateToolbar( void ) +ID_INLINE void rvDebuggerWindow::UpdateToolbar() { HandleInitMenu( ( WPARAM )GetMenu( mWnd ), 0 ); } @@ -179,7 +179,7 @@ ID_INLINE void rvDebuggerWindow::UpdateToolbar( void ) rvDebuggerWindow::GetInstance ================ */ -ID_INLINE HINSTANCE rvDebuggerWindow::GetInstance( void ) +ID_INLINE HINSTANCE rvDebuggerWindow::GetInstance() { return mInstance; } diff --git a/neo/tools/debugger/debugger.cpp b/neo/tools/debugger/debugger.cpp index 815f69e..f167bba 100644 --- a/neo/tools/debugger/debugger.cpp +++ b/neo/tools/debugger/debugger.cpp @@ -86,7 +86,7 @@ Launches another instance of the running executable with +debugger appended to the end to indicate that the debugger should start up. ================ */ -void DebuggerClientLaunch( void ) +void DebuggerClientLaunch() { if( renderSystem->IsFullScreen() ) { @@ -141,7 +141,6 @@ static int SDLCALL DebuggerServerThread( void* param ) return 0; } - /* ================ DebuggerServerInit @@ -149,7 +148,7 @@ DebuggerServerInit Starts up the debugger server ================ */ -bool DebuggerServerInit( void ) +bool DebuggerServerInit() { com_enableDebuggerServer.ClearModified( ); @@ -198,7 +197,7 @@ DebuggerServerShutdown Shuts down the debugger server ================ */ -void DebuggerServerShutdown( void ) +void DebuggerServerShutdown() { if( gDebuggerServerThread != NULL ) { diff --git a/neo/tools/decl/DialogDeclBrowser.cpp b/neo/tools/decl/DialogDeclBrowser.cpp index 84f8374..a557347 100644 --- a/neo/tools/decl/DialogDeclBrowser.cpp +++ b/neo/tools/decl/DialogDeclBrowser.cpp @@ -222,7 +222,7 @@ void DialogDeclBrowser::AddGUIsToTree( CPathTreeCtrl& tree ) DialogDeclBrowser::InitBaseDeclTree ================ */ -void DialogDeclBrowser::InitBaseDeclTree( void ) +void DialogDeclBrowser::InitBaseDeclTree() { int i; @@ -294,7 +294,7 @@ const idDecl* DialogDeclBrowser::GetDeclFromTreeItem( HTREEITEM item ) const DialogDeclBrowser::GetSelectedDecl ================ */ -const idDecl* DialogDeclBrowser::GetSelectedDecl( void ) const +const idDecl* DialogDeclBrowser::GetSelectedDecl() const { return GetDeclFromTreeItem( declTree.GetSelectedItem() ); } @@ -304,7 +304,7 @@ const idDecl* DialogDeclBrowser::GetSelectedDecl( void ) const DialogDeclBrowser::EditSelected ================ */ -void DialogDeclBrowser::EditSelected( void ) const +void DialogDeclBrowser::EditSelected() const { int id, index; idDict spawnArgs; @@ -514,7 +514,7 @@ void DeclBrowserInit( const idDict* spawnArgs ) DeclBrowserRun ================ */ -void DeclBrowserRun( void ) +void DeclBrowserRun() { #if _MSC_VER >= 1300 MSG* msg = AfxGetCurrentMessage(); // TODO Robert fix me!! @@ -536,7 +536,7 @@ void DeclBrowserRun( void ) DeclBrowserShutdown ================ */ -void DeclBrowserShutdown( void ) +void DeclBrowserShutdown() { delete g_DeclDialog; g_DeclDialog = NULL; @@ -547,7 +547,7 @@ void DeclBrowserShutdown( void ) DeclBrowserReloadDeclarations ================ */ -void DeclBrowserReloadDeclarations( void ) +void DeclBrowserReloadDeclarations() { if( g_DeclDialog ) { @@ -560,7 +560,7 @@ void DeclBrowserReloadDeclarations( void ) DialogDeclBrowser::ReloadDeclarations ================ */ -void DialogDeclBrowser::ReloadDeclarations( void ) +void DialogDeclBrowser::ReloadDeclarations() { InitBaseDeclTree(); OnBnClickedFind(); diff --git a/neo/tools/decl/DialogDeclBrowser.h b/neo/tools/decl/DialogDeclBrowser.h index abb8bbf..5c86972 100644 --- a/neo/tools/decl/DialogDeclBrowser.h +++ b/neo/tools/decl/DialogDeclBrowser.h @@ -42,7 +42,7 @@ class DialogDeclBrowser : public CDialog DialogDeclBrowser( CWnd* pParent = NULL ); // standard constructor virtual ~DialogDeclBrowser(); - void ReloadDeclarations( void ); + void ReloadDeclarations(); bool CompareDecl( HTREEITEM item, const char* name ) const; //{{AFX_VIRTUAL(DialogDeclBrowser) @@ -103,12 +103,12 @@ class DialogDeclBrowser : public CDialog void AddDeclTypeToTree( declType_t type, const char* root, CPathTreeCtrl& tree ); void AddScriptsToTree( CPathTreeCtrl& tree ); void AddGUIsToTree( CPathTreeCtrl& tree ); - void InitBaseDeclTree( void ); + void InitBaseDeclTree(); void GetDeclName( HTREEITEM item, idStr& typeName, idStr& declName ) const; const idDecl* GetDeclFromTreeItem( HTREEITEM item ) const; - const idDecl* GetSelectedDecl( void ) const; - void EditSelected( void ) const; + const idDecl* GetSelectedDecl() const; + void EditSelected() const; }; #endif /* !__DIALOGDECLBROWSER_H__ */ diff --git a/neo/tools/decl/DialogDeclEditor.cpp b/neo/tools/decl/DialogDeclEditor.cpp index 57b5c10..350382f 100644 --- a/neo/tools/decl/DialogDeclEditor.cpp +++ b/neo/tools/decl/DialogDeclEditor.cpp @@ -160,7 +160,7 @@ bool DialogDeclEditor::TestDecl( const idStr& declText ) DialogDeclEditor::UpdateStatusBar ================ */ -void DialogDeclEditor::UpdateStatusBar( void ) +void DialogDeclEditor::UpdateStatusBar() { int line, column, character; diff --git a/neo/tools/decl/DialogDeclEditor.h b/neo/tools/decl/DialogDeclEditor.h index 7118b06..3282efd 100644 --- a/neo/tools/decl/DialogDeclEditor.h +++ b/neo/tools/decl/DialogDeclEditor.h @@ -101,7 +101,7 @@ class DialogDeclEditor : public CDialog private: bool TestDecl( const idStr& declText ); - void UpdateStatusBar( void ); + void UpdateStatusBar(); }; #endif /* !__DIALOGDECLEDITOR_H__ */ diff --git a/neo/tools/decl/DialogDeclNew.cpp b/neo/tools/decl/DialogDeclNew.cpp index 2fdd55b..cbf0f4b 100644 --- a/neo/tools/decl/DialogDeclNew.cpp +++ b/neo/tools/decl/DialogDeclNew.cpp @@ -101,7 +101,7 @@ void DialogDeclNew::DoDataExchange( CDataExchange* pDX ) DialogDeclNew::InitTypeList ================ */ -void DialogDeclNew::InitTypeList( void ) +void DialogDeclNew::InitTypeList() { int i; diff --git a/neo/tools/decl/DialogDeclNew.h b/neo/tools/decl/DialogDeclNew.h index 9cc7da4..cf242d6 100644 --- a/neo/tools/decl/DialogDeclNew.h +++ b/neo/tools/decl/DialogDeclNew.h @@ -59,7 +59,7 @@ class DialogDeclNew : public CDialog { defaultFile = file; } - idDecl* GetNewDecl( void ) const + idDecl* GetNewDecl() const { return newDecl; } @@ -103,7 +103,7 @@ class DialogDeclNew : public CDialog idDecl* newDecl; private: - void InitTypeList( void ); + void InitTypeList(); }; #endif /* !__DIALOGDECLNEW_H__ */ diff --git a/neo/tools/decl/DialogEntityDefEditor.cpp b/neo/tools/decl/DialogEntityDefEditor.cpp index 37fb47b..9a4f373 100644 --- a/neo/tools/decl/DialogEntityDefEditor.cpp +++ b/neo/tools/decl/DialogEntityDefEditor.cpp @@ -166,7 +166,7 @@ bool DialogEntityDefEditor::TestDecl( const idStr& declText ) DialogEntityDefEditor::UpdateStatusBar ================ */ -void DialogEntityDefEditor::UpdateStatusBar( void ) +void DialogEntityDefEditor::UpdateStatusBar() { if( decl ) { diff --git a/neo/tools/decl/DialogEntityDefEditor.h b/neo/tools/decl/DialogEntityDefEditor.h index f07d6c7..2a75c51 100644 --- a/neo/tools/decl/DialogEntityDefEditor.h +++ b/neo/tools/decl/DialogEntityDefEditor.h @@ -112,7 +112,7 @@ class DialogEntityDefEditor : public CDialog void SetInherit( idStr& inherit ); void BuildDeclText( idStr& declText ); bool TestDecl( const idStr& declText ); - void UpdateStatusBar( void ); + void UpdateStatusBar(); }; #endif /* !__DIALOGENTITYDEFEDITOR_H__ */ diff --git a/neo/tools/edit_public.h b/neo/tools/edit_public.h index c684830..8bd7931 100644 --- a/neo/tools/edit_public.h +++ b/neo/tools/edit_public.h @@ -43,67 +43,67 @@ class idInterpreter; // Radiant Level Editor -void RadiantInit( void ); -void RadiantShutdown( void ); -void RadiantRun( void ); +void RadiantInit(); +void RadiantShutdown(); +void RadiantRun(); void RadiantPrint( const char* text ); // in-game Light Editor void LightEditorInit( const idDict* spawnArgs ); -void LightEditorShutdown( void ); -void LightEditorRun( void ); +void LightEditorShutdown(); +void LightEditorRun(); // in-game Sound Editor void SoundEditorInit( const idDict* spawnArgs ); -void SoundEditorShutdown( void ); -void SoundEditorRun( void ); +void SoundEditorShutdown(); +void SoundEditorRun(); // in-game Articulated Figure Editor void AFEditorInit( const idDict* spawnArgs ); -void AFEditorShutdown( void ); -void AFEditorRun( void ); +void AFEditorShutdown(); +void AFEditorRun(); // in-game Particle Editor void ParticleEditorInit( const idDict* spawnArgs ); -void ParticleEditorShutdown( void ); -void ParticleEditorRun( void ); +void ParticleEditorShutdown(); +void ParticleEditorRun(); // in-game Script Editor void ScriptEditorInit( const idDict* spawnArgs ); -void ScriptEditorShutdown( void ); -void ScriptEditorRun( void ); +void ScriptEditorShutdown(); +void ScriptEditorRun(); // in-game Declaration Browser void DeclBrowserInit( const idDict* spawnArgs ); -void DeclBrowserShutdown( void ); -void DeclBrowserRun( void ); -void DeclBrowserReloadDeclarations( void ); +void DeclBrowserShutdown(); +void DeclBrowserRun(); +void DeclBrowserReloadDeclarations(); // GUI Editor -void GUIEditorInit( void ); -void GUIEditorShutdown( void ); -void GUIEditorRun( void ); +void GUIEditorInit(); +void GUIEditorShutdown(); +void GUIEditorRun(); bool GUIEditorHandleMessage( void* msg ); // Script Debugger -void DebuggerClientLaunch( void ); +void DebuggerClientLaunch(); void DebuggerClientInit( const char* cmdline ); -bool DebuggerServerInit( void ); -void DebuggerServerShutdown( void ); +bool DebuggerServerInit(); +void DebuggerServerShutdown(); void DebuggerServerPrint( const char* text ); void DebuggerServerCheckBreakpoint( idInterpreter* interpreter, idProgram* program, int instructionPointer ); //Material Editor -void MaterialEditorInit( void ); -void MaterialEditorRun( void ); -void MaterialEditorShutdown( void ); +void MaterialEditorInit(); +void MaterialEditorRun(); +void MaterialEditorShutdown(); void MaterialEditorPrintConsole( const char* msg ); #endif /* !__EDIT_PUBLIC_H__ */ diff --git a/neo/tools/guied/GEApp.cpp b/neo/tools/guied/GEApp.cpp index 1d872bd..c98bbf1 100644 --- a/neo/tools/guied/GEApp.cpp +++ b/neo/tools/guied/GEApp.cpp @@ -37,14 +37,18 @@ If you have questions concerning this license or the applicable additional terms #include "GEApp.h" #include "GEOptionsDlg.h" #include "GEViewer.h" +#include "GEStateModifier.h" +#include "GEItemScriptsDlg.h" static const int IDM_WINDOWCHILD = 1000; static const int ID_GUIED_FILE_MRU1 = 10000; +static INT_PTR CALLBACK AboutDlg_WndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); + class CAboutGEDlg : public CAboutDlg { public: - CAboutGEDlg( void ); + CAboutGEDlg(); virtual BOOL OnInitDialog(); }; @@ -101,6 +105,8 @@ static void ShowAboutDialog( HINSTANCE hInstance, HWND hParent ) DialogBoxParam( hInstance, MAKEINTRESOURCE( IDD_ABOUT ), hParent, AboutDlgProc, reinterpret_cast( &aboutDlg ) ); } +bool rvGEApp::mDontExit = false; + rvGEApp::rvGEApp( ) { mMDIFrame = NULL; @@ -122,7 +128,7 @@ rvGEApp::Initialize Initialize the gui editor application ================ */ -bool rvGEApp::Initialize( void ) +bool rvGEApp::Initialize() { mOptions.Init(); @@ -202,6 +208,31 @@ bool rvGEApp::Initialize( void ) return true; } +/* +================ +rvGEApp::ApplyProperties + +Callback function performed when pressing the Apply button on the properties dialog. +================ +*/ +bool rvGEApp::ApplyProperties( idDict* dict, bool keyShortcut ) +{ + rvGEWorkspace* workspace = GetActiveWorkspace(); + + if( workspace != 0 ) + { + workspace->GetModifierStack().Append( new rvGEStateModifier( "Item Properties", workspace->GetSelectionMgr()[0], *dict ) ); + workspace->SetModified( true ); + + GetNavigator().Update(); + GetTransformer().Update(); + GetProperties().Update(); + + return true; + } + + return false; +} /* ================ @@ -250,6 +281,18 @@ bool rvGEApp::TranslateAccelerator( LPMSG msg ) msg->hwnd = GetMDIClient( ); } + if( msg->message == WM_KEYDOWN ) + { + HWND hFocus = GetFocus(); + if( hFocus == GetDlgItem( gApp.GetScriptWindow(), IDC_GUIED_SCRIPT ) ) + { + if( rvGEWorkspace* ws = GetActiveWorkspace() ) + { + ws->SetModified( true ); + } + } + } + if( mViewer ) { return false; @@ -259,7 +302,7 @@ bool rvGEApp::TranslateAccelerator( LPMSG msg ) // Only use accelerators when on the main window or navigator window if( focus == mMDIClient || focus == mMDIFrame || - focus == GetNavigator().GetWindow( ) ) + focus == GetNavigator().GetWindow( ) || focus == GetItemProperties().GetWindow() ) { if( ::TranslateAccelerator( mMDIFrame, mAccelerators, msg ) ) { @@ -282,7 +325,7 @@ rvGEApp::RunFrame Runs the current frame which causes the active window to be redrawn ================ */ -void rvGEApp::RunFrame( void ) +void rvGEApp::RunFrame() { HWND wnd; rvGEWorkspace* workspace = GetActiveWorkspace( &wnd ); @@ -362,19 +405,57 @@ LRESULT CALLBACK rvGEApp::FrameWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPA break; case WM_CLOSE: - while( app->mWorkspaces.Num( ) ) + + if( gApp.IsActive() ) + { + if( gApp.GetActiveWorkspace() && gApp.GetActiveWorkspace()->IsModified() ) + { + int res = gApp.MessageBox( va( "Save changes to the document \"%s\" before closing?", gApp.GetActiveWorkspace()->GetFilename() ), MB_YESNOCANCEL | MB_ICONQUESTION ); + if( res == IDYES ) + { + SendMessage( gApp.GetMDIFrame(), WM_COMMAND, MAKELONG( ID_GUIED_FILE_SAVE, 0 ), 0 ); + } + else if( res == IDNO ) + { + while( app->mWorkspaces.Num() ) + { + SendMessage( app->mWorkspaces[0]->GetWindow(), WM_CLOSE, 0, 0 ); + } + } + else if( res == IDCANCEL ) + { + mDontExit = true; + return -1; + } + } + else + { + mDontExit = false; + } + } + else { - SendMessage( app->mWorkspaces[0]->GetWindow( ), WM_CLOSE, 0, 0 ); + mDontExit = false; } break; case WM_DESTROY: - app->mOptions.SetWindowPlacement( "mdiframe", hWnd ); - app->mOptions.Save( ); - GUIEditorShutdown(); - ExitProcess( 0 ); - break; - + { + if( !mDontExit ) + { + app->mOptions.SetWindowPlacement( "mdiframe", hWnd ); + app->mOptions.Save(); + // foresthale 2014-05-29: added common->Shutdown() here to prevent a hang on idGameThread dtor + common->Shutdown(); + ExitProcess( 0 ); + break; + } + else + { + mDontExit = true; + return 1; + } + } case WM_COMMAND: { int result; @@ -406,17 +487,23 @@ LRESULT CALLBACK rvGEApp::FrameWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPA app->mTransformer.Create( hWnd, gApp.mOptions.GetTransformerVisible( ) ); app->mStatusBar.Create( hWnd, 9999, gApp.mOptions.GetStatusBarVisible( ) ); app->mProperties.Create( hWnd, gApp.mOptions.GetPropertiesVisible( ) ); + app->mItemProperties.Create( hWnd, gApp.mOptions.GetItemPropertiesVisible() ); + HWND mScripts = GEItemScriptsDlg_DoModal( hWnd, 0 ); + app->SetScriptWindow( mScripts ); // add all the tool windows to the tool window array app->mToolWindows.Append( app->mMDIFrame ); app->mToolWindows.Append( app->mNavigator.GetWindow( ) ); app->mToolWindows.Append( app->mProperties.GetWindow( ) ); app->mToolWindows.Append( app->mTransformer.GetWindow( ) ); + app->mToolWindows.Append( app->mItemProperties.GetWindow( ) ); + app->mToolWindows.Append( app->GetScriptWindow() ); SendMessage( app->mNavigator.GetWindow( ), WM_NCACTIVATE, true, ( LONG_PTR ) - 1 ); SendMessage( app->mProperties.GetWindow( ), WM_NCACTIVATE, true, ( LONG_PTR ) - 1 ); SendMessage( app->mTransformer.GetWindow( ), WM_NCACTIVATE, true, ( LONG_PTR ) - 1 ); - + SendMessage( app->mItemProperties.GetWindow( ), WM_NCACTIVATE, true, ( LONG_PTR ) - 1 ); + SendMessage( app->GetScriptWindow(), WM_NCACTIVATE, true, ( LONG_PTR ) - 1 ); break; } } @@ -444,9 +531,17 @@ LRESULT CALLBACK rvGEApp::MDIChildProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPA switch( uMsg ) { case WM_CLOSE: - workspace->GetApplication( )->mWorkspaces.Remove( workspace ); - break; - + { + if( !mDontExit ) + { + workspace->GetApplication()->mWorkspaces.Remove( workspace ); + break; + } + else + { + mDontExit = false; + } + } case WM_CREATE: { LPMDICREATESTRUCT mdics; @@ -470,9 +565,18 @@ LRESULT CALLBACK rvGEApp::MDIChildProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPA assert( workspace ); if( ( HWND )lParam == hWnd ) { + rvGEWorkspace* prev = workspace->GetApplication()->GetTransformer().GetWorkspace(); + if( prev != 0 && prev != workspace ) + { + GEItescriptsDlg_Apply( gApp.GetScriptWindow(), prev ); + } workspace->GetApplication( )->GetNavigator().SetWorkspace( workspace ); workspace->GetApplication( )->GetTransformer().SetWorkspace( workspace ); workspace->GetApplication( )->GetProperties().SetWorkspace( workspace ); + workspace->GetApplication( )->GetItemProperties().SetWorkspace( workspace ); + + GEItemScriptsDlg_Clear( gApp.GetScriptWindow() ); + GEItescriptsDlg_Init( gApp.GetScriptWindow(), workspace ); gApp.GetStatusBar( ).SetSimple( false ); } else if( lParam == NULL ) @@ -567,6 +671,7 @@ void rvGEApp::HandleCommandSave( rvGEWorkspace* workspace, const char* filename realFilename = filename; } + GEItescriptsDlg_Apply( gApp.GetScriptWindow() ); // Now performe the file save if( workspace->SaveFile( realFilename ) ) { @@ -612,6 +717,11 @@ int rvGEApp::HandleCommand( WPARAM wParam, LPARAM lParam ) workspace->Copy( ); break; + case ID_GUIED_EDIT_DUPLICATE: + assert( workspace ); + workspace->Duplicate(); + break; + case ID_GUIED_EDIT_PASTE: assert( workspace ); workspace->Paste( ); @@ -794,10 +904,19 @@ int rvGEApp::HandleCommand( WPARAM wParam, LPARAM lParam ) mProperties.Show( mOptions.GetPropertiesVisible() ? false : true ); break; + case ID_GUIED_WINDOW_SHOWITEMPROPERTIES: + mItemProperties.Show( mOptions.GetItemPropertiesVisible() ? false : true ); + break; + case ID_GUIED_WINDOW_SHOWTRANSFORMER: mTransformer.Show( mOptions.GetTransformerVisible() ? false : true ); break; + case ID_GUIED_WINDOW_SHOWSCRIPTS: + ShowWindow( mScripts, mOptions.GetScriptsVisible() ? false : true ); + mOptions.SetScriptsVisible( mOptions.GetScriptsVisible() ? false : true ); + break; + case ID_GUIED_EDIT_DELETE: assert( workspace ); workspace->DeleteSelected( ); @@ -823,6 +942,7 @@ int rvGEApp::HandleCommand( WPARAM wParam, LPARAM lParam ) workspace->GetModifierStack().Undo( ); mNavigator.Update( ); mTransformer.Update( ); + mItemProperties.Update( ); break; case ID_GUIED_EDIT_REDO: @@ -830,6 +950,7 @@ int rvGEApp::HandleCommand( WPARAM wParam, LPARAM lParam ) workspace->GetModifierStack().Redo( ); mNavigator.Update( ); mTransformer.Update( ); + mItemProperties.Update( ); break; case ID_GUIED_VIEW_OPTIONS: @@ -855,15 +976,64 @@ int rvGEApp::HandleCommand( WPARAM wParam, LPARAM lParam ) break; case ID_GUIED_FILE_EXIT: - DestroyWindow( mMDIFrame ); - break; + { + if( active ) + { + if( workspace->IsModified() ) + { + int res = gApp.MessageBox( va( "Save changes to the document \"%s\" before closing?", workspace->GetFilename() ), MB_YESNOCANCEL | MB_ICONQUESTION ); + if( res == IDYES ) + { + SendMessage( gApp.GetMDIFrame(), WM_COMMAND, MAKELONG( ID_GUIED_FILE_SAVE, 0 ), 0 ); + } + else if( res == IDNO ) + { + gApp.GetOptions().SetWindowPlacement( "itemProperties", mItemProperties.GetWindow() ); + DestroyWindow( mItemProperties.GetWindow() ); + DestroyWindow( mScripts ); + DestroyWindow( mMDIFrame ); + } + } + else + { + gApp.GetOptions().SetWindowPlacement( "itemProperties", mItemProperties.GetWindow() ); + DestroyWindow( mItemProperties.GetWindow() ); + DestroyWindow( mScripts ); + DestroyWindow( mMDIFrame ); + } + } + else + { + gApp.GetOptions().SetWindowPlacement( "itemProperties", mItemProperties.GetWindow() ); + DestroyWindow( mItemProperties.GetWindow() ); + DestroyWindow( mScripts ); + DestroyWindow( mMDIFrame ); + } + break; + } case ID_GUIED_FILE_CLOSE: if( active ) { assert( workspace ); - SendMessage( active, WM_CLOSE, 0, 0 ); + if( workspace->IsModified() ) + { + int res = gApp.MessageBox( va( "Save changes to the document \"%s\" before closing?", workspace->GetFilename() ), MB_YESNOCANCEL | MB_ICONQUESTION ); + if( res == IDYES ) + { + SendMessage( gApp.GetMDIFrame(), WM_COMMAND, MAKELONG( ID_GUIED_FILE_SAVE, 0 ), 0 ); + } + else if( res == IDNO ) + { + SendMessage( active, WM_CLOSE, 0, 0 ); + } + } + else + { + SendMessage( active, WM_CLOSE, 0, 0 ); + } } + break; case ID_GUIED_FILE_NEW: @@ -879,7 +1049,11 @@ int rvGEApp::HandleCommand( WPARAM wParam, LPARAM lParam ) assert( workspace ); HandleCommandSave( workspace, NULL ); break; - + case ID_GUIED_APPLY_ITEM_PROPS: + { + SendMessage( mItemProperties.GetWindow(), PSM_APPLY, 0, 0 ); + break; + } case ID_GUIED_FILE_OPEN: { OPENFILENAME ofn; @@ -965,10 +1139,20 @@ int rvGEApp::HandleInitMenu( WPARAM wParam, LPARAM lParam ) CheckMenuItem( hmenu, id, flags ); break; + case ID_GUIED_WINDOW_SHOWITEMPROPERTIES: + flags = MF_BYCOMMAND | ( mOptions.GetItemPropertiesVisible() ? MF_CHECKED : MF_UNCHECKED ); + CheckMenuItem( hmenu, id, flags ); + break; + case ID_GUIED_WINDOW_SHOWTRANSFORMER: flags = MF_BYCOMMAND | ( mOptions.GetTransformerVisible() ? MF_CHECKED : MF_UNCHECKED ); CheckMenuItem( hmenu, id, flags ); break; + + case ID_GUIED_WINDOW_SHOWSCRIPTS: + flags = MF_BYCOMMAND | ( mOptions.GetScriptsVisible() ? MF_CHECKED : MF_UNCHECKED ); + CheckMenuItem( hmenu, id, flags ); + break; } // Handle the basic case where an item is disabled because @@ -1009,6 +1193,7 @@ int rvGEApp::HandleInitMenu( WPARAM wParam, LPARAM lParam ) case ID_GUIED_FILE_SAVE: case ID_GUIED_FILE_SAVEAS: case ID_GUIED_EDIT_COPY: + case ID_GUIED_EDIT_DUPLICATE: case ID_GUIED_EDIT_PASTE: case ID_GUIED_ITEM_ARRANGEMAKECHILD: case ID_GUIED_FILE_CLOSE: @@ -1112,6 +1297,7 @@ int rvGEApp::HandleInitMenu( WPARAM wParam, LPARAM lParam ) case ID_GUIED_VIEW_UNHIDESELECTED: case ID_GUIED_EDIT_DELETE: case ID_GUIED_EDIT_COPY: + case ID_GUIED_EDIT_DUPLICATE: EnableMenuItem( hmenu, nPos, MF_BYPOSITION | ( workspace->GetSelectionMgr().Num() > 0 ? MF_ENABLED : MF_GRAYED ) ); break; @@ -1159,8 +1345,9 @@ rvGEApp::NewFile Creates a new file and opens a window for it ================ */ -bool rvGEApp::NewFile( void ) +bool rvGEApp::NewFile() { + GEItescriptsDlg_Apply( gApp.GetScriptWindow() ); rvGEWorkspace* workspace = new rvGEWorkspace( this ); if( workspace->NewFile( ) ) { @@ -1171,8 +1358,8 @@ bool rvGEApp::NewFile( void ) WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | WS_MAXIMIZE, CW_USEDEFAULT, CW_USEDEFAULT, - 640, - 480, + SCREEN_WIDTH, + SCREEN_HEIGHT, mMDIClient, mInstance, ( LONG_PTR )workspace ); @@ -1212,6 +1399,8 @@ bool rvGEApp::OpenFile( const char* filename ) // Setup the default error. error = va( "Failed to parse '%s'", filename ); + GEItescriptsDlg_Apply( gApp.GetScriptWindow() ); + rvGEWorkspace* workspace = new rvGEWorkspace( this ); if( workspace->LoadFile( filename, &error ) ) { @@ -1222,8 +1411,8 @@ bool rvGEApp::OpenFile( const char* filename ) WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | WS_MAXIMIZE, CW_USEDEFAULT, CW_USEDEFAULT, - 640, - 480, + SCREEN_WIDTH, + SCREEN_HEIGHT, mMDIClient, mInstance, ( LONG_PTR )workspace ); @@ -1253,7 +1442,7 @@ Finds the file menu and the location within it where the MRU should be added. ================ */ -bool rvGEApp::InitRecentFiles( void ) +bool rvGEApp::InitRecentFiles() { int i; int count; @@ -1281,7 +1470,7 @@ rvGEApp::UpdateRecentFiles Updates the mru in the menu ================ */ -void rvGEApp::UpdateRecentFiles( void ) +void rvGEApp::UpdateRecentFiles() { int i; int j; @@ -1329,7 +1518,7 @@ rvGEApp::CloseViewer Closes the gui viewer ================ */ -void rvGEApp::CloseViewer( void ) +void rvGEApp::CloseViewer() { if( !mViewer ) { @@ -1395,5 +1584,5 @@ Displays a modal message box */ int rvGEApp::MessageBox( const char* text, int flags ) { - return ::MessageBox( mMDIFrame, text, "Quake 4 GUI Editor", flags ); + return ::MessageBoxA( mMDIFrame, text, "Quake 4 GUI Editor", flags ); } diff --git a/neo/tools/guied/GEApp.h b/neo/tools/guied/GEApp.h index b647214..2627f8d 100644 --- a/neo/tools/guied/GEApp.h +++ b/neo/tools/guied/GEApp.h @@ -62,6 +62,10 @@ If you have questions concerning this license or the applicable additional terms #include "GEStatusBar.h" #endif // GESTATUSBAR_H_ +#ifndef GEITEMPROPS_H_ + #include "GEItemPropsDlg.h" +#endif + // Utility functions const char* StringFromVec4( idVec4& vec ); bool IsExpression( const char* s ); @@ -76,34 +80,45 @@ class rvGEApp rvGEApp( ); ~rvGEApp( ); - bool Initialize( void ); - void RunFrame( void ); -// bool Uninitialize ( void ); + bool Initialize(); + void RunFrame(); +// bool Uninitialize (); bool TranslateAccelerator( LPMSG msg ); rvGEWorkspace* GetActiveWorkspace( HWND* retwnd = NULL ); - rvGENavigator& GetNavigator( void ); - rvGEProperties& GetProperties( void ); - rvGETransformer& GetTransformer( void ); - rvGEOptions& GetOptions( void ); - HINSTANCE GetInstance( void ); - HWND GetMDIFrame( void ); - HWND GetMDIClient( void ); - rvGEStatusBar& GetStatusBar( void ); + rvGENavigator& GetNavigator(); + rvGEProperties& GetProperties(); + rvGETransformer& GetTransformer(); + rvGEOptions& GetOptions(); + rvGEItemProps& GetItemProperties(); + HINSTANCE GetInstance(); + HWND GetMDIFrame(); + HWND GetMDIClient(); + rvGEStatusBar& GetStatusBar(); + HWND GetScriptWindow(); + void SetScriptWindow( HWND hWnd ) + { + mScripts = hWnd; + } bool OpenFile( const char* filename ); bool SaveFile( const char* filename ); - bool NewFile( void ); + bool NewFile(); - bool IsActive( void ); + bool IsActive(); - void CloseViewer( void ); + void CloseViewer(); int ToolWindowActivate( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); int MessageBox( const char* text, int flags ); + bool ApplyProperties( idDict* dict, bool keyShortcut = false ); + + // helper bool to not exit if user chooses to not do so during quit dialogs + static bool mDontExit; + protected: int HandleCommand( WPARAM wParam, LPARAM lParam ); @@ -111,8 +126,8 @@ class rvGEApp void HandleCommandSave( rvGEWorkspace* workspace, const char* filename ); - bool InitRecentFiles( void ); - void UpdateRecentFiles( void ); + bool InitRecentFiles(); + void UpdateRecentFiles(); HWND mMDIFrame; HWND mMDIClient; @@ -123,6 +138,8 @@ class rvGEApp rvGETransformer mTransformer; rvGEStatusBar mStatusBar; rvGEProperties mProperties; + rvGEItemProps mItemProperties; + HWND mScripts; HMENU mRecentFileMenu; int mRecentFileInsertPos; @@ -139,47 +156,57 @@ class rvGEApp }; -ID_INLINE bool rvGEApp::IsActive( void ) +ID_INLINE bool rvGEApp::IsActive() { return mMDIFrame ? true : false; } -ID_INLINE rvGENavigator& rvGEApp::GetNavigator( void ) +ID_INLINE rvGENavigator& rvGEApp::GetNavigator() { return mNavigator; } -ID_INLINE rvGEProperties& rvGEApp::GetProperties( void ) +ID_INLINE rvGEProperties& rvGEApp::GetProperties() { return mProperties; } -ID_INLINE rvGETransformer& rvGEApp::GetTransformer( void ) +ID_INLINE rvGETransformer& rvGEApp::GetTransformer() { return mTransformer; } -ID_INLINE rvGEOptions& rvGEApp::GetOptions( void ) +ID_INLINE HWND rvGEApp::GetScriptWindow( void ) +{ + return mScripts; +} + +ID_INLINE rvGEItemProps& rvGEApp::GetItemProperties( void ) +{ + return mItemProperties; +} + +ID_INLINE rvGEOptions& rvGEApp::GetOptions() { return mOptions; } -ID_INLINE HINSTANCE rvGEApp::GetInstance( void ) +ID_INLINE HINSTANCE rvGEApp::GetInstance() { return mInstance; } -ID_INLINE rvGEStatusBar& rvGEApp::GetStatusBar( void ) +ID_INLINE rvGEStatusBar& rvGEApp::GetStatusBar() { return mStatusBar; } -ID_INLINE HWND rvGEApp::GetMDIFrame( void ) +ID_INLINE HWND rvGEApp::GetMDIFrame() { return mMDIFrame; } -ID_INLINE HWND rvGEApp::GetMDIClient( void ) +ID_INLINE HWND rvGEApp::GetMDIClient() { return mMDIClient; } diff --git a/neo/tools/guied/GEDeleteModifier.cpp b/neo/tools/guied/GEDeleteModifier.cpp index d916e7b..294a46f 100644 --- a/neo/tools/guied/GEDeleteModifier.cpp +++ b/neo/tools/guied/GEDeleteModifier.cpp @@ -44,7 +44,7 @@ rvGEDeleteModifier::Apply Apply the delete modifier by setting the deleted flag in the wrapper ================ */ -bool rvGEDeleteModifier::Apply( void ) +bool rvGEDeleteModifier::Apply() { mWrapper->SetDeleted( true ); @@ -58,7 +58,7 @@ rvGEDeleteModifier::Undo Undo the delete modifier by unsetting the deleted flag in the wrapper ================ */ -bool rvGEDeleteModifier::Undo( void ) +bool rvGEDeleteModifier::Undo() { mWrapper->SetDeleted( false ); diff --git a/neo/tools/guied/GEDeleteModifier.h b/neo/tools/guied/GEDeleteModifier.h index bd24f38..0275a23 100644 --- a/neo/tools/guied/GEDeleteModifier.h +++ b/neo/tools/guied/GEDeleteModifier.h @@ -38,8 +38,8 @@ class rvGEDeleteModifier : public rvGEModifier rvGEDeleteModifier( const char* name, idWindow* window ); - virtual bool Apply( void ); - virtual bool Undo( void ); + virtual bool Apply(); + virtual bool Undo(); }; #endif // GEDELETEMODIFIER_H_ \ No newline at end of file diff --git a/neo/tools/guied/GEHideModifier.cpp b/neo/tools/guied/GEHideModifier.cpp index 1ff1013..f5c1cac 100644 --- a/neo/tools/guied/GEHideModifier.cpp +++ b/neo/tools/guied/GEHideModifier.cpp @@ -61,7 +61,7 @@ rvGEHideModifier::Apply Apply the hide modifier by setting the visible state of the wrapper window ================ */ -bool rvGEHideModifier::Apply( void ) +bool rvGEHideModifier::Apply() { mWrapper->SetHidden( mHide ); @@ -80,7 +80,7 @@ rvGEHideModifier::Undo Undo the hide modifier by setting the undo visible state of the wrapper window ================ */ -bool rvGEHideModifier::Undo( void ) +bool rvGEHideModifier::Undo() { mWrapper->SetHidden( mUndoHide ); diff --git a/neo/tools/guied/GEHideModifier.h b/neo/tools/guied/GEHideModifier.h index 55f698b..77709af 100644 --- a/neo/tools/guied/GEHideModifier.h +++ b/neo/tools/guied/GEHideModifier.h @@ -38,8 +38,8 @@ class rvGEHideModifier : public rvGEModifier rvGEHideModifier( const char* name, idWindow* window, bool hide ); - virtual bool Apply( void ); - virtual bool Undo( void ); + virtual bool Apply(); + virtual bool Undo(); protected: diff --git a/neo/tools/guied/GEInsertModifier.cpp b/neo/tools/guied/GEInsertModifier.cpp index d853578..0344960 100644 --- a/neo/tools/guied/GEInsertModifier.cpp +++ b/neo/tools/guied/GEInsertModifier.cpp @@ -77,7 +77,7 @@ Apply the insert modifier by removing the child from its original parent and inserting it as a child of the new parent ================ */ -bool rvGEInsertModifier::Apply( void ) +bool rvGEInsertModifier::Apply() { if( mUndoParent ) { @@ -98,7 +98,7 @@ Undo the insert modifier by removing the window from the parent it was added to and re-inserting it back into its original parent ================ */ -bool rvGEInsertModifier::Undo( void ) +bool rvGEInsertModifier::Undo() { mParent->RemoveChild( mWindow ); diff --git a/neo/tools/guied/GEInsertModifier.h b/neo/tools/guied/GEInsertModifier.h index 5e04031..387cca8 100644 --- a/neo/tools/guied/GEInsertModifier.h +++ b/neo/tools/guied/GEInsertModifier.h @@ -38,8 +38,8 @@ class rvGEInsertModifier : public rvGEModifier rvGEInsertModifier( const char* name, idWindow* window, idWindow* parent, idWindow* before ); - virtual bool Apply( void ); - virtual bool Undo( void ); + virtual bool Apply(); + virtual bool Undo(); protected: diff --git a/neo/tools/guied/GEItemPropsDlg.cpp b/neo/tools/guied/GEItemPropsDlg.cpp index cc48ec9..24b64a4 100644 --- a/neo/tools/guied/GEItemPropsDlg.cpp +++ b/neo/tools/guied/GEItemPropsDlg.cpp @@ -31,6 +31,7 @@ If you have questions concerning this license or the applicable additional terms #include "../../sys/win32/rc/resource.h" +#include "../common/GLWidget.h" #include "../common/ColorButton.h" #include "../common/MaskEdit.h" @@ -38,6 +39,8 @@ If you have questions concerning this license or the applicable additional terms #include "GEItemPropsDlg.h" #include "GEPropertyPage.h" +#include "../tools/radiant/PreviewDlg.h" + enum { RVITEMPROPS_GENERAL = 0, @@ -52,16 +55,24 @@ class rvGEItemPropsImagePage : public rvGEPropertyPage { public: + rvGEItemPropsImagePage() : rvGEPropertyPage(), mDict( 0 ) {} rvGEItemPropsImagePage( idDict* dictValues ); - virtual bool Init( void ); - virtual bool SetActive( void ); - virtual bool KillActive( void ); + virtual bool Apply(); + virtual bool Init(); + virtual bool SetActive(); + virtual bool KillActive(); virtual int HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ); + void SetDict( idDict* dict ) + { + mDict = dict; + } + void Enable( BOOL enable ); + protected: - void UpdateCheckedStates( void ); + void UpdateCheckedStates(); idDict* mDict; }; @@ -71,6 +82,20 @@ rvGEItemPropsImagePage::rvGEItemPropsImagePage( idDict* dict ) mDict = dict; } +bool rvGEItemPropsImagePage::Apply( void ) +{ + //Ross T 1/6/2015 - could have this check here to only apply on the active page + //but applying on all pages at once is more flexible and doesn't appear to cause any harm + //if (gApp.GetOptions().GetLastOptionsPage() == RVITEMPROPS_IMAGE) + //{ + //com_editors = EDITOR_RADIANT; + gApp.ApplyProperties( mDict ); + //com_editors = EDITOR_GUI; + return true; + //} + //return false; +} + /* ================ rvGEItemPropsImagePage::Init @@ -78,7 +103,7 @@ rvGEItemPropsImagePage::Init Subclass the custom controls on the page ================ */ -bool rvGEItemPropsImagePage::Init( void ) +bool rvGEItemPropsImagePage::Init() { NumberEdit_Attach( GetDlgItem( mPage, IDC_GUIED_ITEMMATSCALEX ) ); NumberEdit_Attach( GetDlgItem( mPage, IDC_GUIED_ITEMMATSCALEY ) ); @@ -94,7 +119,7 @@ rvGEItemPropsImagePage::UpdateCheckedStates Updates the enabled state of all the controls that are linked to a checkbox ================ */ -void rvGEItemPropsImagePage::UpdateCheckedStates( void ) +void rvGEItemPropsImagePage::UpdateCheckedStates() { char temp[64]; bool state; @@ -117,6 +142,8 @@ void rvGEItemPropsImagePage::UpdateCheckedStates( void ) EnableWindow( GetDlgItem( mPage, IDC_GUIED_XSCALE_STATIC ), state ); EnableWindow( GetDlgItem( mPage, IDC_GUIED_YSCALE_STATIC ), state ); + EnableWindow( GetDlgItem( mPage, ID_GUIED_CHOOSE_MATERIAL ), state ); + GetWindowText( GetDlgItem( mPage, IDC_GUIED_ITEMBORDERSIZE ), temp, 64 ); enable = !IsExpression( mDict->GetString( "bordersize", "0" ) ); EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMBORDERSIZE ), enable ); @@ -151,7 +178,6 @@ int rvGEItemPropsImagePage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lPara case WM_DRAWITEM: ColorButton_DrawItem( GetDlgItem( mPage, wParam ), ( LPDRAWITEMSTRUCT )lParam ); return TRUE; - case WM_COMMAND: switch( LOWORD( wParam ) ) { @@ -159,9 +185,16 @@ int rvGEItemPropsImagePage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lPara if( HIWORD( wParam ) == EN_CHANGE ) { UpdateCheckedStates( ); + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); + } + break; + case IDC_GUIED_ITEMMATSCALEX: + case IDC_GUIED_ITEMMATSCALEY: + if( HIWORD( wParam ) == EN_CHANGE ) + { + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); } break; - case IDC_GUIED_USEBORDERCOLOR: case IDC_GUIED_USEBORDERMATERIAL: case IDC_GUIED_USEBACKCOLOR: @@ -174,6 +207,7 @@ int rvGEItemPropsImagePage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lPara case IDC_GUIED_ITEMBORDERCOLORALPHA: { AlphaButton_OpenPopup( GetDlgItem( mPage, LOWORD( wParam ) ) ); + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); break; } @@ -192,6 +226,29 @@ int rvGEItemPropsImagePage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lPara if( ChooseColor( &col ) ) { ColorButton_SetColor( GetDlgItem( mPage, LOWORD( wParam ) ), col.rgbResult ); + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); + } + break; + } + case ID_GUIED_CHOOSE_MATERIAL: + { + CPreviewDlg matDlg( CWnd::FromHandle( mPage ) ); + matDlg.SetOnlyFilter( true, idStr( "gui/" ) ); + matDlg.SetMode( CPreviewDlg::MATERIALS, "gui" ); + + com_editors = EDITOR_RADIANT; + INT_PTR res = matDlg.DoModal(); + com_editors = EDITOR_GUI; + if( res == IDOK ) + { + idStr matName = matDlg.mediaName; + SetWindowText( GetDlgItem( mPage, IDC_GUIED_ITEMBACKGROUND ), matName.StripQuotes() ); + idStr s; + s = "\""; + s.Append( matName ); + s.Append( "\"" ); + mDict->Set( "background", s ); + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); } break; } @@ -202,6 +259,25 @@ int rvGEItemPropsImagePage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lPara return rvGEPropertyPage::HandleMessage( msg, wParam, lParam ); } +void rvGEItemPropsImagePage::Enable( BOOL enable ) +{ + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMBORDERSIZE ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMMATSCALEX ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMMATSCALEY ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_USEBORDERCOLOR ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_USEBORDERMATERIAL ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_USEBACKCOLOR ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_USEMATERIAL ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMBACKCOLORALPHA ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMMATCOLORALPHA ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMBORDERCOLORALPHA ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMBORDERCOLOR ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMBACKCOLOR ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMMATCOLOR ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_USEBACKCOLOR ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMVARIABLEBACKGROUND ), enable ); +} + /* ================ rvGEItemPropsImagePage::SetActive @@ -210,10 +286,34 @@ Initializes the text properties page by copying data from the attached window into the controls ================ */ -bool rvGEItemPropsImagePage::SetActive( void ) +bool rvGEItemPropsImagePage::SetActive() { gApp.GetOptions().SetLastOptionsPage( RVITEMPROPS_IMAGE ); + /*static bool loadedOnce = false; + + if (loadedOnce) + { + if (gApp.GetActiveWorkspace() == 0) + { + Enable(FALSE); + return false; + } + + if (gApp.GetActiveWorkspace()->GetSelectionMgr().Num() == 0) + { + Enable(FALSE); + return false; + } + + loadedOnce = true; + }*/ + + if( mDict == NULL ) + { + return false; + } + ColorButton_SetColor( GetDlgItem( mPage, IDC_GUIED_ITEMBACKCOLOR ), mDict->GetString( "backcolor", "1,1,1,1" ) ); AlphaButton_SetColor( GetDlgItem( mPage, IDC_GUIED_ITEMBACKCOLORALPHA ), mDict->GetString( "backcolor", "1,1,1,1" ) ); @@ -250,8 +350,32 @@ rvGEItemPropsImagePage::KillActive Applys the settings currently stored in the property page back into the attached window ================ */ -bool rvGEItemPropsImagePage::KillActive( void ) +bool rvGEItemPropsImagePage::KillActive() { + /*static bool loadedOnce = false; + + if (loadedOnce) + { + if (gApp.GetActiveWorkspace() == 0) + { + Enable(FALSE); + return false; + } + + if (gApp.GetActiveWorkspace()->GetSelectionMgr().Num() == 0) + { + Enable(FALSE); + return false; + } + + loadedOnce = true; + }*/ + + if( mDict == NULL ) + { + return false; + } + char temp[1024]; bool matcolor = false; idStr s; @@ -370,6 +494,8 @@ bool rvGEItemPropsImagePage::KillActive( void ) mDict->Delete( "matcolor" ); } + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); + return true; } @@ -377,16 +503,24 @@ class rvGEItemPropsTextPage : public rvGEPropertyPage { public: + rvGEItemPropsTextPage() : rvGEPropertyPage(), mDict( 0 ) {} rvGEItemPropsTextPage( idDict* dictValues ); - virtual bool Init( void ); - virtual bool SetActive( void ); - virtual bool KillActive( void ); + virtual bool Apply(); + virtual bool Init(); + virtual bool SetActive(); + virtual bool KillActive(); virtual int HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ); + void SetDict( idDict* dict ) + { + mDict = dict; + } + void Enable( BOOL enable ); + protected: - void UpdateCheckedStates( void ); + void UpdateCheckedStates(); idDict* mDict; }; @@ -396,6 +530,18 @@ rvGEItemPropsTextPage::rvGEItemPropsTextPage( idDict* dict ) mDict = dict; } +bool rvGEItemPropsTextPage::Apply( void ) +{ + //Ross T 1/6/2015 - could have this check here to only apply on the active page + //but applying on all pages at once is more flexible and doesn't appear to cause any harm + //if (gApp.GetOptions().GetLastOptionsPage() == RVITEMPROPS_TEXT) + //{ + return gApp.ApplyProperties( mDict ); + //} + + return false; +} + /* ================ rvGEItemPropsTextPage::Init @@ -403,7 +549,7 @@ rvGEItemPropsTextPage::Init Subclass the custom controls on the page ================ */ -bool rvGEItemPropsTextPage::Init( void ) +bool rvGEItemPropsTextPage::Init() { NumberEdit_Attach( GetDlgItem( mPage, IDC_GUIED_ITEMTEXTSCALE ) ); NumberEdit_Attach( GetDlgItem( mPage, IDC_GUIED_ITEMTEXTALIGNX ) ); @@ -442,7 +588,7 @@ rvGEItemPropsTextPage::UpdateCheckedStates Updates the enabled state of all the controls that are linked to a checkbox ================ */ -void rvGEItemPropsTextPage::UpdateCheckedStates( void ) +void rvGEItemPropsTextPage::UpdateCheckedStates() { bool state; idStr result; @@ -471,6 +617,30 @@ void rvGEItemPropsTextPage::UpdateCheckedStates( void ) EnableWindow( GetDlgItem( mPage, IDC_GUIED_STATIC_FONT ), state ); } +void rvGEItemPropsTextPage::Enable( BOOL enable ) +{ + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMFORECOLOR ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMFORECOLORALPHA ), enable ); + + EnableWindow( GetDlgItem( mPage, IDC_GUIED_USETEXT ), enable ); + + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMTEXT ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMTEXTSCALE ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMTEXTSCALE ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMTEXTALIGN ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMTEXTALIGNX ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMTEXTALIGNY ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMTEXTFONT ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMTEXTNOWRAP ), enable ); + + EnableWindow( GetDlgItem( mPage, IDC_GUIED_STATIC_ALIGNMENT ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_STATIC_X ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_STATIC_Y ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_STATIC_SCALE ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_STATIC_COLOR ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_STATIC_FONT ), enable ); +} + /* ================ rvGEItemPropsTextPage::HandleMessage @@ -490,14 +660,20 @@ int rvGEItemPropsTextPage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam switch( LOWORD( wParam ) ) { case IDC_GUIED_ITEMTEXTFONT: + if( HIWORD( wParam ) == EN_SELCHANGE ) + { + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); + } break; case IDC_GUIED_USETEXT: UpdateCheckedStates( ); + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); break; case IDC_GUIED_ITEMFORECOLORALPHA: AlphaButton_OpenPopup( GetDlgItem( mPage, LOWORD( wParam ) ) ); + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); break; case IDC_GUIED_ITEMFORECOLOR: @@ -513,10 +689,21 @@ int rvGEItemPropsTextPage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam if( ChooseColor( &col ) ) { ColorButton_SetColor( GetDlgItem( mPage, LOWORD( wParam ) ), col.rgbResult ); + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); + } + break; + } + + case IDC_GUIED_ITEMTEXT: + { + if( HIWORD( wParam ) == EN_CHANGE ) + { + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); } break; } } + break; } @@ -531,10 +718,34 @@ Initializes the text properties page by copying data from the attached window into the controls ================ */ -bool rvGEItemPropsTextPage::SetActive( void ) +bool rvGEItemPropsTextPage::SetActive() { gApp.GetOptions().SetLastOptionsPage( RVITEMPROPS_TEXT ); + /*static bool loadedOnce = false; + + if (loadedOnce) + { + if (gApp.GetActiveWorkspace() == 0) + { + Enable(FALSE); + return false; + } + + if (gApp.GetActiveWorkspace()->GetSelectionMgr().Num() == 0) + { + Enable(FALSE); + return false; + } + + loadedOnce = true; + }*/ + + if( mDict == NULL ) + { + return false; + } + ColorButton_SetColor( GetDlgItem( mPage, IDC_GUIED_ITEMFORECOLOR ), mDict->GetString( "forecolor", "1,1,1,1" ) ); AlphaButton_SetColor( GetDlgItem( mPage, IDC_GUIED_ITEMFORECOLORALPHA ), mDict->GetString( "forecolor", "1,1,1,1" ) ); @@ -569,8 +780,32 @@ rvGEItemPropsTextPage::KillActive Applys the settings currently stored in the property page back into the attached window ================ */ -bool rvGEItemPropsTextPage::KillActive( void ) +bool rvGEItemPropsTextPage::KillActive() { + /*static bool loadedOnce = false; + + if (loadedOnce) + { + if (gApp.GetActiveWorkspace() == 0) + { + Enable(FALSE); + return false; + } + + if (gApp.GetActiveWorkspace()->GetSelectionMgr().Num() == 0) + { + Enable(FALSE); + return false; + } + + loadedOnce = true; + }*/ + + if( mDict == NULL ) + { + return false; + } + idStr s; char temp[1024]; int i; @@ -660,6 +895,8 @@ bool rvGEItemPropsTextPage::KillActive( void ) mDict->Delete( "font" ); } + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); + return true; } @@ -667,12 +904,24 @@ class rvGEItemPropsKeysPage : public rvGEPropertyPage { public: + rvGEItemPropsKeysPage() : rvGEPropertyPage(), mDict( 0 ), mWrapper( 0 ) {} rvGEItemPropsKeysPage( idDict* dictValues, rvGEWindowWrapper* wrapper ); - virtual bool Init( void ); - virtual bool SetActive( void ); + virtual bool Apply(); + virtual bool Init(); + virtual bool SetActive(); virtual int HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ); + void SetDict( idDict* dict ) + { + mDict = dict; + } + void SetWrapper( rvGEWindowWrapper* wrapper ) + { + mWrapper = wrapper; + } + void Enable( BOOL enable ); + protected: idDict* mDict; @@ -732,12 +981,16 @@ INT_PTR CALLBACK ModifyItemKeyDlg_WndProc( HWND hwnd, UINT msg, WPARAM wParam, L } else { + const_cast( keyValue->GetKey() ) = key; + const_cast( keyValue->GetValue() ) = value; + // FIXME: MrE may never change key value pairs directly! //keyValue->GetKey() = key; //keyValue->GetValue = value; EndDialog( hwnd, 1 ); } + break; } @@ -751,6 +1004,19 @@ INT_PTR CALLBACK ModifyItemKeyDlg_WndProc( HWND hwnd, UINT msg, WPARAM wParam, L return FALSE; } +bool rvGEItemPropsKeysPage::Apply( void ) +{ + //Ross T 1/6/2015 - could have this check here to only apply on the active page + //but applying on all pages at once is more flexible and doesn't appear to cause any harm + //if (gApp.GetOptions().GetLastOptionsPage() == RVITEMPROPS_KEYS) + //{ + return gApp.ApplyProperties( mDict ); + //} + + return false; +} + + int rvGEItemPropsKeysPage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { switch( msg ) @@ -792,7 +1058,6 @@ int rvGEItemPropsKeysPage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam mDict->Set( "guied_temp", "" ); const idKeyValue* key = mDict->FindKey( "guied_temp" ); - idStr old = key->GetValue(); while( 1 ) { if( DialogBoxParam( gApp.GetInstance(), MAKEINTRESOURCE( IDD_GUIED_ITEMKEY ), mPage, ModifyItemKeyDlg_WndProc, ( LPARAM )key ) ) @@ -812,7 +1077,9 @@ int rvGEItemPropsKeysPage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam } } - mDict->Set( key->GetKey(), finalValue ); + //Ross T 1/6/2015 - commented this out since it gets set + //within the dialog's callback now (so it can show up right away on the item props dialog) + //mDict->Set(key->GetKey(), finalValue); LVITEM item; ZeroMemory( &item, sizeof( item ) ); @@ -833,6 +1100,9 @@ int rvGEItemPropsKeysPage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam break; } } + + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); + break; } @@ -879,6 +1149,8 @@ int rvGEItemPropsKeysPage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam break; } } + + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); } break; } @@ -899,6 +1171,8 @@ int rvGEItemPropsKeysPage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam mDict->Delete( key->GetKey() ); ListView_DeleteItem( list, index ); + + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); } break; } @@ -909,6 +1183,14 @@ int rvGEItemPropsKeysPage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam return rvGEPropertyPage::HandleMessage( msg, wParam, lParam ); } +void rvGEItemPropsKeysPage::Enable( BOOL enable ) +{ + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMKEYS ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ADDKEY ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_DELETEKEY ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_EDITKEY ), enable ); +} + /* ================ rvGEItemPropsKeysPage::Init @@ -917,7 +1199,7 @@ Called when the advanced page is first initialized. Setup the extended control styles and add the key/value columns ================ */ -bool rvGEItemPropsKeysPage::Init( void ) +bool rvGEItemPropsKeysPage::Init() { HWND list; RECT rWindow; @@ -954,13 +1236,32 @@ Called when the advanced page is made active and will add an entry to the keys list view for each key in the properties dictionary ================ */ -bool rvGEItemPropsKeysPage::SetActive( void ) +bool rvGEItemPropsKeysPage::SetActive() { int i; HWND list; gApp.GetOptions().SetLastOptionsPage( RVITEMPROPS_KEYS ); + /*static bool loadedOnce = false; + + if (loadedOnce) + { + if (gApp.GetActiveWorkspace() == 0) + { + Enable(FALSE); + return false; + } + + if (gApp.GetActiveWorkspace()->GetSelectionMgr().Num() == 0) + { + Enable(FALSE); + return false; + } + + loadedOnce = true; + }*/ + // Get listview control list = GetDlgItem( mPage, IDC_GUIED_ITEMKEYS ); assert( list ); @@ -999,16 +1300,29 @@ class rvGEItemPropsGeneralPage : public rvGEPropertyPage { public: + rvGEItemPropsGeneralPage() : rvGEPropertyPage(), mDict( 0 ) {} + rvGEItemPropsGeneralPage( idDict* dict, rvGEWindowWrapper::EWindowType type ); - virtual bool SetActive( void ); - virtual bool KillActive( void ); - virtual bool Init( void ); + virtual bool Apply(); + virtual bool SetActive(); + virtual bool KillActive(); + virtual bool Init(); virtual int HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ); + void SetDict( idDict* dict ) + { + mDict = dict; + } + void SetWrapperType( const idStr& type ) + { + mType = type; + } + void Enable( BOOL enable ); + protected: - void UpdateCheckedStates( void ); + void UpdateCheckedStates(); idDict* mDict; idStr mType; @@ -1020,6 +1334,28 @@ rvGEItemPropsGeneralPage::rvGEItemPropsGeneralPage( idDict* dict, rvGEWindowWrap mType = rvGEWindowWrapper::WindowTypeToString( type ); } +bool rvGEItemPropsGeneralPage::Apply( void ) +{ + //Ross T 1/6/2015 - could have this check here to only apply on the active page + //but applying on all pages at once is more flexible and doesn't appear to cause any harm + //if (gApp.GetOptions().GetLastOptionsPage() == RVITEMPROPS_GENERAL) + //{ + return gApp.ApplyProperties( mDict ); + //} + + return false; +} + +void rvGEItemPropsGeneralPage::Enable( BOOL enable ) +{ + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMNAME ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMVISIBLE ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMNOTIME ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMNOEVENTS ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_ITEMNOCURSOR ), enable ); + EnableWindow( GetDlgItem( mPage, IDC_GUIED_TYPE ), enable ); +} + /* ================ rvGEItemPropsGeneralPage::UpdateCheckedStates @@ -1027,7 +1363,7 @@ rvGEItemPropsGeneralPage::UpdateCheckedStates Updates the enabled state of all the controls that are linked to a checkbox ================ */ -void rvGEItemPropsGeneralPage::UpdateCheckedStates( void ) +void rvGEItemPropsGeneralPage::UpdateCheckedStates() { } @@ -1040,16 +1376,23 @@ Handles messages for the general item properties page */ int rvGEItemPropsGeneralPage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { - /* - switch ( msg ) + switch( msg ) + { + case WM_COMMAND: { - case WM_COMMAND: - switch ( LOWORD(wParam) ) + switch( LOWORD( wParam ) ) + { + case IDC_GUIED_ITEMNAME: { + if( HIWORD( wParam ) == EN_CHANGE ) + { + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); + } + break; } - break; + } } - */ + } return rvGEPropertyPage::HandleMessage( msg, wParam, lParam ); } @@ -1061,7 +1404,7 @@ rvGEItemPropsGeneralPage::Init Subclass the custom controls on the page ================ */ -bool rvGEItemPropsGeneralPage::Init( void ) +bool rvGEItemPropsGeneralPage::Init() { MaskEdit_Attach( GetDlgItem( mPage, IDC_GUIED_ITEMNAME ), " \t\n\r" ); @@ -1076,13 +1419,32 @@ Initializes the general properties page by copying data from the attached window into the controls ================ */ -bool rvGEItemPropsGeneralPage::SetActive( void ) +bool rvGEItemPropsGeneralPage::SetActive() { bool enable; idStr result; gApp.GetOptions().SetLastOptionsPage( RVITEMPROPS_GENERAL ); + /*static bool loadedOnce = false; + + if (loadedOnce) + { + if (gApp.GetActiveWorkspace() == 0) + { + Enable(FALSE); + return false; + } + + if (gApp.GetActiveWorkspace()->GetSelectionMgr().Num() == 0) + { + Enable(FALSE); + return false; + } + + loadedOnce = true; + }*/ + if( mDict == NULL ) { return false; @@ -1125,8 +1487,27 @@ rvGEItemPropsGeneralPage::KillActive Applys the settings currently stored in the property page back into the attached window ================ */ -bool rvGEItemPropsGeneralPage::KillActive( void ) +bool rvGEItemPropsGeneralPage::KillActive() { + /*static bool loadedOnce = false; + + if (loadedOnce) + { + if (gApp.GetActiveWorkspace() == 0) + { + Enable(FALSE); + return false; + } + + if (gApp.GetActiveWorkspace()->GetSelectionMgr().Num() == 0) + { + Enable(FALSE); + return false; + } + + loadedOnce = true; + }*/ + if( mDict == NULL ) { return false; @@ -1135,7 +1516,21 @@ bool rvGEItemPropsGeneralPage::KillActive( void ) char temp[1024]; GetWindowText( GetDlgItem( mPage, IDC_GUIED_ITEMNAME ), temp, 1024 ); - mDict->Set( "name", temp ); + + const idKeyValue* kv = mDict->FindKey( "name" ); + if( kv ) + { + if( kv->GetValue().Icmp( temp ) != 0 ) + { + mDict->Set( "name", temp ); + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); + } + } + else + { + mDict->Set( "name", temp ); + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); + } if( IsWindowEnabled( GetDlgItem( mPage, IDC_GUIED_ITEMVISIBLE ) ) ) { @@ -1147,6 +1542,8 @@ bool rvGEItemPropsGeneralPage::KillActive( void ) { mDict->Set( "visible" , "0" ); } + + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); } if( IsWindowEnabled( GetDlgItem( mPage, IDC_GUIED_ITEMNOTIME ) ) ) @@ -1171,6 +1568,8 @@ bool rvGEItemPropsGeneralPage::KillActive( void ) { mDict->Delete( "noevents" ); } + + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); } if( IsWindowEnabled( GetDlgItem( mPage, IDC_GUIED_ITEMNOCLIP ) ) ) @@ -1183,6 +1582,8 @@ bool rvGEItemPropsGeneralPage::KillActive( void ) { mDict->Delete( "noclip" ); } + + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); } if( IsWindowEnabled( GetDlgItem( mPage, IDC_GUIED_ITEMNOCURSOR ) ) ) @@ -1195,80 +1596,205 @@ bool rvGEItemPropsGeneralPage::KillActive( void ) { mDict->Delete( "nocursor" ); } + + SendMessage( GetParent( mPage ), PSM_CHANGED, ( WPARAM )mPage, 0 ); } return true; } + /* ================ -GEItemPropsDlg_DoModal +rvGEItemProps::rvGEItemProps -Starts the item properties dialog +constructor ================ */ -bool GEItemPropsDlg_DoModal( HWND parent, idWindow* window, idDict& dict ) +rvGEItemProps::rvGEItemProps( void ) +{ + mWrapper = NULL; + mWnd = NULL; + mDlg = NULL; + mWorkspace = NULL; +} + +rvGEItemProps::~rvGEItemProps() { - PROPSHEETHEADER propsh; - PROPSHEETPAGE propsp[4]; - rvGEWindowWrapper* wrapper; - bool result; - - wrapper = rvGEWindowWrapper::GetWrapper( window ); - assert( wrapper ); - - // Start the destination dictionary with the values in the window dictionary - dict.Clear( ); - dict.Copy( wrapper->GetStateDict( ) ); - - propsp[RVITEMPROPS_GENERAL].dwSize = sizeof( PROPSHEETPAGE ); - propsp[RVITEMPROPS_GENERAL].dwFlags = PSP_USETITLE; - propsp[RVITEMPROPS_GENERAL].hInstance = win32.hInstance; - propsp[RVITEMPROPS_GENERAL].pszTemplate = MAKEINTRESOURCE( IDD_GUIED_ITEMPROPS_GENERAL ); - propsp[RVITEMPROPS_GENERAL].pfnDlgProc = rvGEPropertyPage::WndProc; - propsp[RVITEMPROPS_GENERAL].pszTitle = "General"; - propsp[RVITEMPROPS_GENERAL].lParam = ( LONG_PTR )new rvGEItemPropsGeneralPage( &dict, wrapper->GetWindowType( ) ); - - propsp[RVITEMPROPS_IMAGE].dwSize = sizeof( PROPSHEETPAGE ); - propsp[RVITEMPROPS_IMAGE].dwFlags = PSP_USETITLE; - propsp[RVITEMPROPS_IMAGE].hInstance = win32.hInstance; - propsp[RVITEMPROPS_IMAGE].pszTemplate = MAKEINTRESOURCE( IDD_GUIED_ITEMPROPS_IMAGE ); - propsp[RVITEMPROPS_IMAGE].pfnDlgProc = rvGEPropertyPage::WndProc; - propsp[RVITEMPROPS_IMAGE].pszTitle = "Image"; - propsp[RVITEMPROPS_IMAGE].lParam = ( LONG_PTR )new rvGEItemPropsImagePage( &dict );; - - propsp[RVITEMPROPS_TEXT].dwSize = sizeof( PROPSHEETPAGE ); - propsp[RVITEMPROPS_TEXT].dwFlags = PSP_USETITLE; - propsp[RVITEMPROPS_TEXT].hInstance = win32.hInstance; - propsp[RVITEMPROPS_TEXT].pszTemplate = MAKEINTRESOURCE( IDD_GUIED_ITEMPROPS_TEXT ); - propsp[RVITEMPROPS_TEXT].pfnDlgProc = rvGEPropertyPage::WndProc; - propsp[RVITEMPROPS_TEXT].pszTitle = "Text"; - propsp[RVITEMPROPS_TEXT].lParam = ( LONG_PTR )new rvGEItemPropsTextPage( &dict );; - - propsp[RVITEMPROPS_KEYS].dwSize = sizeof( PROPSHEETPAGE ); - propsp[RVITEMPROPS_KEYS].dwFlags = PSP_USETITLE; - propsp[RVITEMPROPS_KEYS].hInstance = win32.hInstance; - propsp[RVITEMPROPS_KEYS].pszTemplate = MAKEINTRESOURCE( IDD_GUIED_ITEMPROPS_KEYS ); - propsp[RVITEMPROPS_KEYS].pfnDlgProc = rvGEPropertyPage::WndProc; - propsp[RVITEMPROPS_KEYS].pszTitle = "Keys"; - propsp[RVITEMPROPS_KEYS].lParam = ( LONG_PTR )new rvGEItemPropsKeysPage( &dict, wrapper ); - - propsh.dwSize = sizeof( PROPSHEETHEADER ); - propsh.nStartPage = gApp.GetOptions().GetLastOptionsPage( ); - propsh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW | PSH_NOCONTEXTHELP; - propsh.hwndParent = parent; - propsh.pszCaption = "Item Properties"; - propsh.nPages = RVITEMPROPS_MAX; - propsh.ppsp = ( LPCPROPSHEETPAGE )&propsp; + delete( rvGEItemPropsGeneralPage* )propsp[RVITEMPROPS_GENERAL].lParam; + delete( rvGEItemPropsImagePage* )propsp[RVITEMPROPS_IMAGE].lParam; + delete( rvGEItemPropsTextPage* )propsp[RVITEMPROPS_TEXT].lParam; + delete( rvGEItemPropsKeysPage* )propsp[RVITEMPROPS_KEYS].lParam; +} + +bool rvGEItemProps::Create( HWND parent, bool visible ) +{ + propsp[RVITEMPROPS_GENERAL].dwSize = sizeof( PROPSHEETPAGE ); + propsp[RVITEMPROPS_GENERAL].dwFlags = PSP_USETITLE; + propsp[RVITEMPROPS_GENERAL].hInstance = win32.hInstance; + propsp[RVITEMPROPS_GENERAL].pszTemplate = MAKEINTRESOURCE( IDD_GUIED_ITEMPROPS_GENERAL ); + propsp[RVITEMPROPS_GENERAL].pfnDlgProc = rvGEPropertyPage::WndProc; + propsp[RVITEMPROPS_GENERAL].pszTitle = "General"; + propsp[RVITEMPROPS_GENERAL].lParam = ( LONG_PTR )new rvGEItemPropsGeneralPage(); + + propsp[RVITEMPROPS_IMAGE].dwSize = sizeof( PROPSHEETPAGE ); + propsp[RVITEMPROPS_IMAGE].dwFlags = PSP_USETITLE; + propsp[RVITEMPROPS_IMAGE].hInstance = win32.hInstance; + propsp[RVITEMPROPS_IMAGE].pszTemplate = MAKEINTRESOURCE( IDD_GUIED_ITEMPROPS_IMAGE ); + propsp[RVITEMPROPS_IMAGE].pfnDlgProc = rvGEPropertyPage::WndProc; + propsp[RVITEMPROPS_IMAGE].pszTitle = "Image"; + propsp[RVITEMPROPS_IMAGE].lParam = ( LONG_PTR )new rvGEItemPropsImagePage(); + + propsp[RVITEMPROPS_TEXT].dwSize = sizeof( PROPSHEETPAGE ); + propsp[RVITEMPROPS_TEXT].dwFlags = PSP_USETITLE; + propsp[RVITEMPROPS_TEXT].hInstance = win32.hInstance; + propsp[RVITEMPROPS_TEXT].pszTemplate = MAKEINTRESOURCE( IDD_GUIED_ITEMPROPS_TEXT ); + propsp[RVITEMPROPS_TEXT].pfnDlgProc = rvGEPropertyPage::WndProc; + propsp[RVITEMPROPS_TEXT].pszTitle = "Text"; + propsp[RVITEMPROPS_TEXT].lParam = ( LONG_PTR )new rvGEItemPropsTextPage(); + + propsp[RVITEMPROPS_KEYS].dwSize = sizeof( PROPSHEETPAGE ); + propsp[RVITEMPROPS_KEYS].dwFlags = PSP_USETITLE; + propsp[RVITEMPROPS_KEYS].hInstance = win32.hInstance; + propsp[RVITEMPROPS_KEYS].pszTemplate = MAKEINTRESOURCE( IDD_GUIED_ITEMPROPS_KEYS ); + propsp[RVITEMPROPS_KEYS].pfnDlgProc = rvGEPropertyPage::WndProc; + propsp[RVITEMPROPS_KEYS].pszTitle = "Keys"; + propsp[RVITEMPROPS_KEYS].lParam = ( LONG_PTR )new rvGEItemPropsKeysPage(); + + propsh.dwSize = sizeof( PROPSHEETHEADER ); + propsh.nStartPage = gApp.GetOptions().GetLastOptionsPage(); + propsh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOCONTEXTHELP | PSH_MODELESS | PSH_USECALLBACK; + propsh.hwndParent = parent; + propsh.pszCaption = "Item Properties"; + propsh.nPages = RVITEMPROPS_MAX; + propsh.ppsp = ( LPCPROPSHEETPAGE )&propsp; + propsh.pfnCallback = ( PFNPROPSHEETCALLBACK )rvGEItemProps::WndProc; // Bring up the item properties dialog now - result = PropertySheet( &propsh ) != NULL; + INT_PTR result = PropertySheet( &propsh ); + mWnd = ( HWND )result; + + LONG_PTR st = GetWindowLongPtr( mWnd, GWL_STYLE ); + SetWindowLongPtr( mWnd, GWL_STYLE, st & ~WS_SYSMENU ); + //these four lines make sure the individual pages get initiated.. + SendMessage( mWnd, PSM_SETCURSEL, RVITEMPROPS_GENERAL, 0 ); + SendMessage( mWnd, PSM_SETCURSEL, RVITEMPROPS_IMAGE, 0 ); + SendMessage( mWnd, PSM_SETCURSEL, RVITEMPROPS_TEXT, 0 ); + SendMessage( mWnd, PSM_SETCURSEL, RVITEMPROPS_KEYS, 0 ); - // Cleanup - delete( rvGEItemPropsGeneralPage* ) propsp[0].lParam; - delete( rvGEItemPropsImagePage* ) propsp[1].lParam; - delete( rvGEItemPropsTextPage* ) propsp[2].lParam; - delete( rvGEItemPropsKeysPage* ) propsp[3].lParam; + SendMessage( mWnd, PSM_SETCURSEL, gApp.GetOptions().GetLastOptionsPage(), 0 ); - return result; + if( !gApp.GetOptions().GetWindowPlacement( "itemProperties", mWnd ) ) + { + RECT rParent; + RECT rTrans; + + GetWindowRect( GetParent( mWnd ), &rParent ); + GetWindowRect( mWnd, &rTrans ); + SetWindowPos( mWnd, NULL, + rParent.right - 10 - ( rTrans.right - rTrans.left ), + rParent.bottom - 10 - ( rTrans.bottom - rTrans.top ), + 0, 0, + SWP_NOZORDER | SWP_NOSIZE ); + } + + ShowWindow( GetDlgItem( mWnd, IDOK ), SW_HIDE ); + ShowWindow( GetDlgItem( mWnd, IDCANCEL ), SW_HIDE ); + return true; } + +void rvGEItemProps::Show( bool visible ) +{ + gApp.GetOptions().SetItemPropertiesVisible( visible ); + ShowWindow( mWnd, visible ? SW_SHOW : SW_HIDE ); +} + +void rvGEItemProps::Update( void ) +{ + rvGEWorkspace* workspace = gApp.GetActiveWorkspace(); + if( workspace ) + { + if( workspace->GetSelectionMgr().Num() > 0 ) + { + rvGEWindowWrapper* wrapper = rvGEWindowWrapper::GetWrapper( workspace->GetSelectionMgr()[0] ); + assert( wrapper ); + + // Start the destination dictionary with the values in the window dictionary + mDict.Clear(); + mDict.Copy( wrapper->GetStateDict() ); + + ( ( rvGEItemPropsGeneralPage* )propsp[RVITEMPROPS_GENERAL].lParam )->Enable( TRUE ); + ( ( rvGEItemPropsTextPage* )propsp[RVITEMPROPS_TEXT].lParam )->Enable( TRUE ); + ( ( rvGEItemPropsImagePage* )propsp[RVITEMPROPS_IMAGE].lParam )->Enable( TRUE ); + ( ( rvGEItemPropsKeysPage* )propsp[RVITEMPROPS_KEYS].lParam )->Enable( TRUE ); + + ( ( rvGEItemPropsKeysPage* )propsp[RVITEMPROPS_KEYS].lParam )->SetDict( &mDict ); + ( ( rvGEItemPropsKeysPage* )propsp[RVITEMPROPS_KEYS].lParam )->SetWrapper( wrapper ); + + ( ( rvGEItemPropsImagePage* )propsp[RVITEMPROPS_IMAGE].lParam )->SetDict( &mDict ); + + ( ( rvGEItemPropsTextPage* )propsp[RVITEMPROPS_TEXT].lParam )->SetDict( &mDict ); + + ( ( rvGEItemPropsGeneralPage* )propsp[RVITEMPROPS_GENERAL].lParam )->SetDict( &mDict ); + ( ( rvGEItemPropsGeneralPage* )propsp[RVITEMPROPS_GENERAL].lParam )->SetWrapperType( rvGEWindowWrapper::WindowTypeToString( wrapper->GetWindowType() ) ); + + ( ( rvGEItemPropsGeneralPage* )propsp[gApp.GetOptions().GetLastOptionsPage()].lParam )->SetActive(); + } + else + { + //disable controls... + mDict.Clear(); + ( ( rvGEItemPropsGeneralPage* )propsp[RVITEMPROPS_GENERAL].lParam )->Enable( FALSE ); + ( ( rvGEItemPropsTextPage* )propsp[RVITEMPROPS_TEXT].lParam )->Enable( FALSE ); + ( ( rvGEItemPropsImagePage* )propsp[RVITEMPROPS_IMAGE].lParam )->Enable( FALSE ); + ( ( rvGEItemPropsKeysPage* )propsp[RVITEMPROPS_KEYS].lParam )->Enable( FALSE ); + } + } + else + { + mDict.Clear(); + ( ( rvGEItemPropsGeneralPage* )propsp[RVITEMPROPS_GENERAL].lParam )->Enable( FALSE ); + ( ( rvGEItemPropsTextPage* )propsp[RVITEMPROPS_TEXT].lParam )->Enable( FALSE ); + ( ( rvGEItemPropsImagePage* )propsp[RVITEMPROPS_IMAGE].lParam )->Enable( FALSE ); + ( ( rvGEItemPropsKeysPage* )propsp[RVITEMPROPS_KEYS].lParam )->Enable( FALSE ); + } +} + + +void rvGEItemProps::SetWorkspace( rvGEWorkspace* workspace ) +{ + mWorkspace = workspace; + if( mWorkspace == NULL ) + { + mDict.Clear(); + ( ( rvGEItemPropsGeneralPage* )propsp[RVITEMPROPS_GENERAL].lParam )->Enable( FALSE ); + ( ( rvGEItemPropsTextPage* )propsp[RVITEMPROPS_TEXT].lParam )->Enable( FALSE ); + ( ( rvGEItemPropsImagePage* )propsp[RVITEMPROPS_IMAGE].lParam )->Enable( FALSE ); + ( ( rvGEItemPropsKeysPage* )propsp[RVITEMPROPS_KEYS].lParam )->Enable( FALSE ); + } + else + { + Update(); + } +} + +int CALLBACK rvGEItemProps::WndProc( HWND hWnd, UINT msg, LPARAM lParam ) +{ + switch( msg ) + { + case PSCB_BUTTONPRESSED: + { + if( lParam == PSBTN_FINISH ) + { + ShowWindow( hWnd, FALSE ); + } + else if( lParam == PSBTN_CANCEL ) + { + ShowWindow( hWnd, FALSE ); + } + break; + } + } + + return 0; +} \ No newline at end of file diff --git a/neo/tools/guied/GEItemPropsDlg.h b/neo/tools/guied/GEItemPropsDlg.h index 474478f..e0450de 100644 --- a/neo/tools/guied/GEItemPropsDlg.h +++ b/neo/tools/guied/GEItemPropsDlg.h @@ -28,6 +28,38 @@ If you have questions concerning this license or the applicable additional terms #ifndef GEITEMPROPSDLG_H_ #define GEITEMPROPSDLG_H_ -bool GEItemPropsDlg_DoModal( HWND parent, idWindow* window, idDict& outDict ); +//bool GEItemPropsDlg_DoModal ( HWND parent, idWindow* window, idDict& outDict ); + +class rvGEItemProps +{ +public: + rvGEItemProps(); + ~rvGEItemProps(); + + bool Create( HWND parent, bool visible ); + void Show( bool visible ); + void Update( void ); + + HWND GetWindow( void ); + void SetWorkspace( rvGEWorkspace* workspace ); + +protected: + + static int CALLBACK WndProc( HWND hWnd, UINT msg, LPARAM lParam ); + + HWND mWnd; + HWND mDlg; + rvGEWindowWrapper* mWrapper; + rvGEWorkspace* mWorkspace; + + idDict mDict; + PROPSHEETHEADER propsh; + PROPSHEETPAGE propsp[4]; +}; + +ID_INLINE HWND rvGEItemProps::GetWindow( void ) +{ + return mWnd; +} #endif // GEITEMPROPSDLG_H_ \ No newline at end of file diff --git a/neo/tools/guied/GEItemScriptsDlg.cpp b/neo/tools/guied/GEItemScriptsDlg.cpp index 6839be5..a006e0f 100644 --- a/neo/tools/guied/GEItemScriptsDlg.cpp +++ b/neo/tools/guied/GEItemScriptsDlg.cpp @@ -35,269 +35,316 @@ If you have questions concerning this license or the applicable additional terms #include "GEApp.h" #include "GEPropertyPage.h" -LRESULT CALLBACK GEScriptEdit_WndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) +bool GEItescriptsDlg_Init( HWND hwnd, rvGEWorkspace* newWorkspace ) { - WNDPROC wndproc = ( WNDPROC ) GetWindowLongPtr( hwnd, GWLP_USERDATA ); + idWindow* window; + rvGEWindowWrapper* wrapper; + HWND script; - switch( msg ) + rvGEWorkspace* workspace = 0; + if( newWorkspace == 0 ) { - case WM_CHAR: - if( wParam == VK_ESCAPE ) - { - SendMessage( GetParent( hwnd ), WM_CLOSE, 0, 0 ); - } - break; - - case WM_GETDLGCODE: - return DLGC_WANTALLKEYS; + workspace = gApp.GetActiveWorkspace(); + } + else + { + workspace = newWorkspace; } - return CallWindowProc( wndproc, hwnd, msg, wParam, lParam ); -} + bool bSel = false; -bool GEItescriptsDlg_Init( HWND hwnd ) -{ - idWindow* window; - rvGEWindowWrapper* wrapper; - HWND script; + if( workspace ) + { + if( workspace->GetSelectionMgr().Num() > 0 ) + { + window = workspace->GetSelectionMgr()[0]; - // Extract the window pointer from the win32 windows user data long - window = ( idWindow* )GetWindowLongPtr( hwnd, GWLP_USERDATA ); - assert( window ); + if( window ) + { + bSel = true; + // Get the window wrapper of the script window + wrapper = rvGEWindowWrapper::GetWrapper( window ); + assert( wrapper ); - // Get the window wrapper of the script window - wrapper = rvGEWindowWrapper::GetWrapper( window ); - assert( wrapper ); + // Get the edit box used to edit the script + script = GetDlgItem( hwnd, IDC_GUIED_SCRIPT ); - // Get the edit box used to edit the script - script = GetDlgItem( hwnd, IDC_GUIED_SCRIPT ); + UINT tabsize = 16; + SendMessage( script, EM_SETTABSTOPS, 1, ( LPARAM )&tabsize ); - UINT tabsize = 16; - SendMessage( script, EM_SETTABSTOPS, 1, ( LPARAM )&tabsize ); - SetWindowLongPtr( script, GWLP_USERDATA, GetWindowLongPtr( script, GWLP_WNDPROC ) ); - SetWindowLongPtr( script, GWLP_WNDPROC, ( LONG_PTR ) GEScriptEdit_WndProc ); + TEXTMETRIC tm; + HDC dc; + dc = GetDC( script ); + GetTextMetrics( dc, &tm ); + ReleaseDC( script, dc ); - TEXTMETRIC tm; - HDC dc; - dc = GetDC( script ); - GetTextMetrics( dc, &tm ); - ReleaseDC( script, dc ); + LOGFONT lf; + ZeroMemory( &lf, sizeof( lf ) ); + lf.lfHeight = tm.tmHeight; + strcpy( lf.lfFaceName, "Courier New" ); - LOGFONT lf; - ZeroMemory( &lf, sizeof( lf ) ); - lf.lfHeight = tm.tmHeight; - strcpy( lf.lfFaceName, "Courier New" ); + SendMessage( script, WM_SETFONT, ( WPARAM )CreateFontIndirect( &lf ), 0 ); - SendMessage( script, WM_SETFONT, ( WPARAM )CreateFontIndirect( &lf ), 0 ); + SendMessage( script, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG( 10, 10 ) ); - SendMessage( script, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG( 10, 10 ) ); + int i; - int i; + for( i = 0; i < wrapper->GetVariableDict().GetNumKeyVals(); i++ ) + { + const idKeyValue* key = wrapper->GetVariableDict().GetKeyVal( i ); + + SendMessage( script, EM_SETSEL, -1, -1 ); + SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )key->GetKey().c_str() ); + SendMessage( script, EM_SETSEL, -1, -1 ); + SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )"\t" ); + SendMessage( script, EM_SETSEL, -1, -1 ); + SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )key->GetValue().c_str() ); + SendMessage( script, EM_SETSEL, -1, -1 ); + SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )"\r\n" ); + } - for( i = 0; i < wrapper->GetVariableDict().GetNumKeyVals( ); i ++ ) - { - const idKeyValue* key = wrapper->GetVariableDict().GetKeyVal( i ); - - SendMessage( script, EM_SETSEL, -1, -1 ); - SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )key->GetKey().c_str() ); - SendMessage( script, EM_SETSEL, -1, -1 ); - SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )"\t" ); - SendMessage( script, EM_SETSEL, -1, -1 ); - SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )key->GetValue().c_str() ); - SendMessage( script, EM_SETSEL, -1, -1 ); - SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )"\r\n" ); - } + if( i ) + { + SendMessage( script, EM_SETSEL, -1, -1 ); + SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )"\r\n" ); + } - if( i ) - { - SendMessage( script, EM_SETSEL, -1, -1 ); - SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )"\r\n" ); + for( i = 0; i < wrapper->GetScriptDict().GetNumKeyVals(); i++ ) + { + const idKeyValue* key = wrapper->GetScriptDict().GetKeyVal( i ); + + SendMessage( script, EM_SETSEL, -1, -1 ); + SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )va( "%s\r\n", key->GetKey().c_str() ) ); + SendMessage( script, EM_SETSEL, -1, -1 ); + SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )key->GetValue().c_str() ); + SendMessage( script, EM_SETSEL, -1, -1 ); + SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )"\r\n\r\n" ); + } + + SendMessage( script, EM_SETSEL, 0, 0 ); + SendMessage( script, EM_SCROLLCARET, 0, 0 ); + } + } } - for( i = 0; i < wrapper->GetScriptDict().GetNumKeyVals( ); i ++ ) + + if( !bSel ) { - const idKeyValue* key = wrapper->GetScriptDict().GetKeyVal( i ); - - SendMessage( script, EM_SETSEL, -1, -1 ); - SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )va( "%s\r\n", key->GetKey().c_str() ) ); - SendMessage( script, EM_SETSEL, -1, -1 ); - SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )key->GetValue().c_str() ); - SendMessage( script, EM_SETSEL, -1, -1 ); - SendMessage( script, EM_REPLACESEL, FALSE, ( LPARAM )"\r\n\r\n" ); + script = GetDlgItem( hwnd, IDC_GUIED_SCRIPT ); + SendMessage( script, WM_SETTEXT, 0, ( LPARAM )"\0" ); + SendMessage( script, EM_SETSEL, 0, 0 ); + SendMessage( script, EM_SCROLLCARET, 0, 0 ); } + return true; +} + +void GEItemScriptsDlg_Clear( HWND hwnd ) +{ + HWND script = GetDlgItem( hwnd, IDC_GUIED_SCRIPT ); + SendMessage( script, WM_SETTEXT, 0, ( LPARAM )"\0" ); SendMessage( script, EM_SETSEL, 0, 0 ); SendMessage( script, EM_SCROLLCARET, 0, 0 ); - - return true; } -bool GEItescriptsDlg_Apply( HWND hwnd ) +bool GEItescriptsDlg_Apply( HWND hwnd, rvGEWorkspace* newWorkspace ) { idWindow* window; rvGEWindowWrapper* wrapper; HWND script; - // Extract the window pointer from the win32 windows user data long - window = ( idWindow* )GetWindowLongPtr( hwnd, GWLP_USERDATA ); - assert( window ); - - // Get the window wrapper of the script window - wrapper = rvGEWindowWrapper::GetWrapper( window ); - assert( wrapper ); - - // Get the edit box used to edit the script - script = GetDlgItem( hwnd, IDC_GUIED_SCRIPT ); - - GETTEXTLENGTHEX textLen; - int chars; - textLen.flags = GTL_DEFAULT | GTL_USECRLF; - textLen.codepage = CP_ACP; - chars = SendMessage( script, EM_GETTEXTLENGTHEX, ( WPARAM )&textLen, 0 ); - - char* text = new char[chars + 1]; - - GETTEXTEX getText; - getText.cb = chars + 1; - getText.codepage = CP_ACP; - getText.flags = GT_DEFAULT | GT_USECRLF; - getText.lpDefaultChar = NULL; - getText.lpUsedDefChar = NULL; - SendMessage( script, EM_GETTEXTEX, ( WPARAM )&getText, ( LPARAM )text ); - - idStr parse = text; - delete[] text; - - try + rvGEWorkspace* pCurr = 0; + if( newWorkspace != 0 ) { - idParser src( parse, parse.Length(), "", LEXFL_ALLOWMULTICHARLITERALS | LEXFL_NOSTRINGCONCAT | LEXFL_ALLOWBACKSLASHSTRINGCONCAT ); - idToken token; + pCurr = newWorkspace; + } + else + { + pCurr = gApp.GetActiveWorkspace(); + } - wrapper->GetVariableDict().Clear( ); - wrapper->GetScriptDict().Clear( ); + if( pCurr ) + { - while( src.ReadToken( &token ) ) + if( pCurr->GetSelectionMgr().Num() > 0 ) { - idStr scriptName; - idStr out; - - if( !token.Icmp( "definevec4" ) ) - { - idToken token2; - idStr result; + window = pCurr->GetSelectionMgr()[0]; - if( !src.ReadToken( &token2 ) ) - { - src.Error( "expected define name" ); - return false; - } - - idWinVec4 var; - idUserInterfaceLocal ui; - idWindow tempwin( &ui ); - idStr out; - int i; - - src.SetMarker( ); - for( i = 0; i < 3; i ++ ) - { - tempwin.ParseExpression( &src, &var ); - src.ExpectTokenString( "," ); - } - - tempwin.ParseExpression( &src, &var ); - src.GetStringFromMarker( out, true ); - - wrapper->GetVariableDict().Set( token + "\t\"" + token2 + "\"", out ); - - continue; - } - else if( !token.Icmp( "definefloat" ) || !token.Icmp( "float" ) ) + if( window ) { - idToken token2; - idStr result; - - if( !src.ReadToken( &token2 ) ) + pCurr->SetModified( true ); + // Get the window wrapper of the script window + wrapper = rvGEWindowWrapper::GetWrapper( window ); + assert( wrapper ); + + // Get the edit box used to edit the script + script = GetDlgItem( hwnd, IDC_GUIED_SCRIPT ); + + GETTEXTLENGTHEX textLen; + int chars; + textLen.flags = GTL_DEFAULT | GTL_USECRLF; + textLen.codepage = CP_ACP; + chars = SendMessage( script, EM_GETTEXTLENGTHEX, ( WPARAM )&textLen, 0 ); + + char* text = new char[chars + 1]; + + GETTEXTEX getText; + getText.cb = chars + 1; + getText.codepage = CP_ACP; + getText.flags = GT_DEFAULT | GT_USECRLF; + getText.lpDefaultChar = NULL; + getText.lpUsedDefChar = NULL; + SendMessage( script, EM_GETTEXTEX, ( WPARAM )&getText, ( LPARAM )text ); + + idStr parse = text; + delete[] text; + + try { - src.Error( "expected define name" ); - return false; - } - - idWinFloat var; - idUserInterfaceLocal ui; - idWindow tempwin( &ui ); - idStr out; + idParser src( parse, parse.Length(), "", LEXFL_ALLOWMULTICHARLITERALS | LEXFL_NOSTRINGCONCAT | LEXFL_ALLOWBACKSLASHSTRINGCONCAT ); + idToken token; - src.SetMarker( ); - tempwin.ParseExpression( &src, &var ); - src.GetStringFromMarker( out, true ); + wrapper->GetVariableDict().Clear(); + wrapper->GetScriptDict().Clear(); - wrapper->GetVariableDict().Set( token + "\t\"" + token2 + "\"", out ); - - continue; - } - // If the token is a scriptdef then just parse out the - // braced section and add it to the list. Right now only - // one scriptdef per window is supported - else if( !token.Icmp( "scriptdef" ) ) - { - scriptName = "scriptDef"; - } - else if( !token.Icmp( "ontime" ) ) - { - if( !src.ReadToken( &token ) ) - { - src.Error( "expected time" ); - return false; - } - - scriptName = "onTime "; - scriptName.Append( token ); - } - else if( !token.Icmp( "onevent" ) ) - { - if( !src.ReadToken( &token ) ) - { - src.Error( "expected time" ); - return false; - } - - scriptName = "onEvent "; - scriptName.Append( token ); - } - else - { - int i; - - for( i = 0; i < idWindow::SCRIPT_COUNT; i ++ ) - { - if( idStr::Icmp( idWindow::ScriptNames[i], token ) == 0 ) + while( src.ReadToken( &token ) ) { - scriptName = idWindow::ScriptNames[i]; - break; + idStr scriptName; + idStr out; + + if( !token.Icmp( "definevec4" ) ) + { + idToken token2; + idStr result; + + if( !src.ReadToken( &token2 ) ) + { + src.Error( "expected define name" ); + return false; + } + + idWinVec4 var; + idUserInterfaceLocal ui; + idWindow tempwin( &ui ); + idStr out; + int i; + + src.SetMarker(); + for( i = 0; i < 3; i++ ) + { + tempwin.ParseExpression( &src, &var ); + src.ExpectTokenString( "," ); + } + + tempwin.ParseExpression( &src, &var ); + src.GetStringFromMarker( out, true ); + + wrapper->GetVariableDict().Set( token + "\t\"" + token2 + "\"", out ); + + continue; + } + else if( !token.Icmp( "definefloat" ) || !token.Icmp( "float" ) ) + { + idToken token2; + idStr result; + + if( !src.ReadToken( &token2 ) ) + { + src.Error( "expected define name" ); + return false; + } + + idWinFloat var; + idUserInterfaceLocal ui; + idWindow tempwin( &ui ); + idStr out; + + src.SetMarker(); + tempwin.ParseExpression( &src, &var ); + src.GetStringFromMarker( out, true ); + + wrapper->GetVariableDict().Set( token + "\t\"" + token2 + "\"", out ); + + continue; + } + + // If the token is a scriptdef then just parse out the + // braced section and add it to the list. Right now only + // one scriptdef per window is supported + else if( !token.Icmp( "scriptdef" ) ) + { + scriptName = "scriptDef"; + } + else if( !token.Icmp( "ontime" ) ) + { + if( !src.ReadToken( &token ) ) + { + src.Error( "expected time" ); + return false; + } + + scriptName = "onTime "; + scriptName.Append( token ); + } + else if( !token.Icmp( "onevent" ) ) + { + /*if ( !src.ReadToken ( &token ) ) + { + src.Error ( "expected time" ); + return false; + }*/ + + scriptName = "onEvent "; + //scriptName.Append ( token ); + } + else if( !token.Icmp( "onNamedEvent" ) ) + { + if( !src.ReadToken( &token ) ) + { + src.Error( "expected event name" ); + return false; + } + + scriptName = "onNamedEvent "; + scriptName.Append( token ); + } + else + { + + int i; + + for( i = 0; i < idWindow::SCRIPT_COUNT; i++ ) + { + if( idStr::Icmp( idWindow::ScriptNames[i], token ) == 0 ) + { + scriptName = idWindow::ScriptNames[i]; + break; + } + } + + if( i >= idWindow::SCRIPT_COUNT ) + { + src.Error( "expected script name" ); + return false; + } + } + + if( !src.ParseBracedSectionExact( out, 1 ) ) + { + return false; + } + + wrapper->GetScriptDict().Set( scriptName, out ); } } - - if( i >= idWindow::SCRIPT_COUNT ) + catch( idException& e ) { - src.Error( "expected script name" ); + MessageBoxA( hwnd, e.error, "Script Error", MB_OK | MB_ICONERROR ); return false; } } - - if( !src.ParseBracedSectionExact( out, 1 ) ) - { - return false; - } - - wrapper->GetScriptDict().Set( scriptName, out ); } } - catch( idException& e ) - { - MessageBox( hwnd, e.error, "Script Error", MB_OK | MB_ICONERROR ); - return false; - } return true; } @@ -308,7 +355,7 @@ INT_PTR CALLBACK GEItescriptsDlg_WndProc( HWND hwnd, UINT msg, WPARAM wParam, LP { case WM_INITDIALOG: SetWindowLongPtr( hwnd, GWLP_USERDATA, lParam ); - GEItescriptsDlg_Init( hwnd ); + GEItescriptsDlg_Init( hwnd , 0 ); gApp.GetOptions().GetWindowPlacement( "scripts", hwnd ); @@ -325,18 +372,12 @@ INT_PTR CALLBACK GEItescriptsDlg_WndProc( HWND hwnd, UINT msg, WPARAM wParam, LP FALSE ); break; } - case WM_ERASEBKGND: return TRUE; - + case WM_DESTROY: case WM_CLOSE: - if( !GEItescriptsDlg_Apply( hwnd ) ) - { - return TRUE; - } - gApp.GetOptions().SetWindowPlacement( "scripts", hwnd ); - EndDialog( hwnd, 1 ); + SendMessage( gApp.GetMDIFrame(), WM_COMMAND, MAKELONG( ID_GUIED_WINDOW_SHOWSCRIPTS, 0 ), 0 ); break; } @@ -350,14 +391,18 @@ GEItemScriptsDlg_DoModal Starts the item properties dialog ================ */ -bool GEItemScriptsDlg_DoModal( HWND parent, idWindow* window ) +HWND GEItemScriptsDlg_DoModal( HWND parent, idWindow* window ) { LoadLibrary( "Riched20.dll" ); - if( DialogBoxParam( gApp.GetInstance(), MAKEINTRESOURCE( IDD_GUIED_SCRIPTS ), parent, GEItescriptsDlg_WndProc, ( LPARAM ) window ) ) - { - return true; - } + HWND hWnd = CreateDialog( gApp.GetInstance(), MAKEINTRESOURCE( IDD_GUIED_SCRIPTS ), parent, GEItescriptsDlg_WndProc ); + + //HWND script = GetDlgItem(hWnd, IDC_GUIED_SCRIPT); + //SetWindowLongPtr(script, GWLP_WNDPROC, (LONG_PTR)GEScriptEdit_WndProc); + + gApp.GetOptions().GetWindowPlacement( "scripts", hWnd ); + + ShowWindow( hWnd, gApp.GetOptions().GetScriptsVisible() ? SW_SHOW : SW_HIDE ); - return false; + return hWnd; } diff --git a/neo/tools/guied/GEItemScriptsDlg.h b/neo/tools/guied/GEItemScriptsDlg.h index f19d32d..323d165 100644 --- a/neo/tools/guied/GEItemScriptsDlg.h +++ b/neo/tools/guied/GEItemScriptsDlg.h @@ -28,6 +28,9 @@ If you have questions concerning this license or the applicable additional terms #ifndef GEITEMSCRIPTSDLG_H_ #define GEITEMSCRIPTSDLG_H_ -bool GEItemScriptsDlg_DoModal( HWND parent, idWindow* window ); +bool GEItescriptsDlg_Init( HWND hwnd, rvGEWorkspace* newWorkspace = 0 ); +bool GEItescriptsDlg_Apply( HWND hwnd, rvGEWorkspace* newWorkspace = 0 ); +HWND GEItemScriptsDlg_DoModal( HWND parent, idWindow* window ); +void GEItemScriptsDlg_Clear( HWND hwnd ); #endif // GEITEMSCRIPTSDLG_H_ \ No newline at end of file diff --git a/neo/tools/guied/GEKeyValueModifier.cpp b/neo/tools/guied/GEKeyValueModifier.cpp index bee8233..be009a1 100644 --- a/neo/tools/guied/GEKeyValueModifier.cpp +++ b/neo/tools/guied/GEKeyValueModifier.cpp @@ -40,7 +40,7 @@ rvGEKeyValueModifier::rvGEKeyValueModifier( const char* name, idWindow* window, mUndoValue = mWrapper->GetStateDict().GetString( mKey ); } -bool rvGEKeyValueModifier::Apply( void ) +bool rvGEKeyValueModifier::Apply() { if( mValue.Length( ) ) { @@ -54,7 +54,7 @@ bool rvGEKeyValueModifier::Apply( void ) return true; } -bool rvGEKeyValueModifier::Undo( void ) +bool rvGEKeyValueModifier::Undo() { mWrapper->SetStateKey( mKey, mValue ); diff --git a/neo/tools/guied/GEKeyValueModifier.h b/neo/tools/guied/GEKeyValueModifier.h index 93a7e56..7ad0727 100644 --- a/neo/tools/guied/GEKeyValueModifier.h +++ b/neo/tools/guied/GEKeyValueModifier.h @@ -38,8 +38,8 @@ class rvGEKeyValueModifier : public rvGEModifier rvGEKeyValueModifier( const char* name, idWindow* window, const char* key, const char* value ); - virtual bool Apply( void ); - virtual bool Undo( void ); + virtual bool Apply(); + virtual bool Undo(); virtual bool CanMerge( rvGEModifier* merge ); virtual bool Merge( rvGEModifier* merge ); diff --git a/neo/tools/guied/GEModifier.h b/neo/tools/guied/GEModifier.h index abef959..d293b24 100644 --- a/neo/tools/guied/GEModifier.h +++ b/neo/tools/guied/GEModifier.h @@ -38,16 +38,16 @@ class rvGEModifier rvGEModifier( const char* name, idWindow* window ); virtual ~rvGEModifier( ) { } - virtual bool Apply( void ) = 0; - virtual bool Undo( void ) = 0; - virtual const char* GetName( void ); + virtual bool Apply() = 0; + virtual bool Undo() = 0; + virtual const char* GetName(); virtual bool CanMerge( rvGEModifier* merge ); - virtual bool IsValid( void ); + virtual bool IsValid(); virtual bool Merge( rvGEModifier* merge ); - idWindow* GetWindow( void ); + idWindow* GetWindow(); protected: @@ -57,17 +57,17 @@ class rvGEModifier idStr mName; }; -ID_INLINE bool rvGEModifier::IsValid( void ) +ID_INLINE bool rvGEModifier::IsValid() { return true; } -ID_INLINE idWindow* rvGEModifier::GetWindow( void ) +ID_INLINE idWindow* rvGEModifier::GetWindow() { return mWindow; } -ID_INLINE const char* rvGEModifier::GetName( void ) +ID_INLINE const char* rvGEModifier::GetName() { return mName; } diff --git a/neo/tools/guied/GEModifierGroup.cpp b/neo/tools/guied/GEModifierGroup.cpp index 84054e9..6c3c56c 100644 --- a/neo/tools/guied/GEModifierGroup.cpp +++ b/neo/tools/guied/GEModifierGroup.cpp @@ -62,7 +62,7 @@ bool rvGEModifierGroup::Append( rvGEModifier* mod ) return true; } -bool rvGEModifierGroup::IsValid( void ) +bool rvGEModifierGroup::IsValid() { int i; @@ -77,7 +77,7 @@ bool rvGEModifierGroup::IsValid( void ) return true; } -bool rvGEModifierGroup::Apply( void ) +bool rvGEModifierGroup::Apply() { int i; @@ -89,7 +89,7 @@ bool rvGEModifierGroup::Apply( void ) return true; } -bool rvGEModifierGroup::Undo( void ) +bool rvGEModifierGroup::Undo() { int i; diff --git a/neo/tools/guied/GEModifierGroup.h b/neo/tools/guied/GEModifierGroup.h index 13ff58e..3c3fe80 100644 --- a/neo/tools/guied/GEModifierGroup.h +++ b/neo/tools/guied/GEModifierGroup.h @@ -39,17 +39,17 @@ class rvGEModifierGroup : public rvGEModifier rvGEModifierGroup( ); ~rvGEModifierGroup( ); - virtual bool Apply( void ); - virtual bool Undo( void ); + virtual bool Apply(); + virtual bool Undo(); virtual bool CanMerge( rvGEModifier* merge ); virtual bool Merge( rvGEModifier* merge ); - virtual bool IsValid( void ); + virtual bool IsValid(); bool Append( rvGEModifier* mod ); - int GetCount( void ); + int GetCount(); protected: @@ -58,7 +58,7 @@ class rvGEModifierGroup : public rvGEModifier }; -ID_INLINE int rvGEModifierGroup::GetCount( void ) +ID_INLINE int rvGEModifierGroup::GetCount() { return mModifiers.Num( ); } diff --git a/neo/tools/guied/GEModifierStack.cpp b/neo/tools/guied/GEModifierStack.cpp index db17682..886e5b9 100644 --- a/neo/tools/guied/GEModifierStack.cpp +++ b/neo/tools/guied/GEModifierStack.cpp @@ -43,7 +43,7 @@ rvGEModifierStack::~rvGEModifierStack( ) Reset( ); } -void rvGEModifierStack::Reset( void ) +void rvGEModifierStack::Reset() { int i; @@ -86,6 +86,7 @@ bool rvGEModifierStack::Append( rvGEModifier* modifier ) gApp.GetProperties().Update( ); gApp.GetTransformer().Update( ); + gApp.GetItemProperties().Update( ); delete modifier; return true; @@ -102,11 +103,12 @@ bool rvGEModifierStack::Append( rvGEModifier* modifier ) gApp.GetProperties().Update( ); gApp.GetTransformer().Update( ); + gApp.GetItemProperties().Update( ); return true; } -bool rvGEModifierStack::Undo( void ) +bool rvGEModifierStack::Undo() { if( mCurrentModifier < 0 ) { @@ -117,12 +119,13 @@ bool rvGEModifierStack::Undo( void ) mCurrentModifier--; gApp.GetProperties().Update( ); + gApp.GetItemProperties().Update( ); gApp.GetTransformer().Update( ); return true; } -bool rvGEModifierStack::Redo( void ) +bool rvGEModifierStack::Redo() { if( mCurrentModifier + 1 < mModifiers.Num( ) ) { @@ -131,6 +134,7 @@ bool rvGEModifierStack::Redo( void ) } gApp.GetProperties().Update( ); + gApp.GetItemProperties().Update( ); gApp.GetTransformer().Update( ); return true; diff --git a/neo/tools/guied/GEModifierStack.h b/neo/tools/guied/GEModifierStack.h index 2d74ee3..a84202f 100644 --- a/neo/tools/guied/GEModifierStack.h +++ b/neo/tools/guied/GEModifierStack.h @@ -39,19 +39,19 @@ class rvGEModifierStack rvGEModifierStack( ); ~rvGEModifierStack( ); - void BlockNextMerge( void ); + void BlockNextMerge(); bool Append( rvGEModifier* modifier ); - bool Undo( void ); - bool Redo( void ); + bool Undo(); + bool Redo(); - void Reset( void ); + void Reset(); - bool CanUndo( void ); - bool CanRedo( void ); + bool CanUndo(); + bool CanRedo(); - rvGEModifier* GetUndoModifier( void ); - rvGEModifier* GetRedoModifier( void ); + rvGEModifier* GetUndoModifier(); + rvGEModifier* GetRedoModifier(); protected: @@ -60,28 +60,28 @@ class rvGEModifierStack bool mMergeBlock; }; -ID_INLINE bool rvGEModifierStack::CanRedo( void ) +ID_INLINE bool rvGEModifierStack::CanRedo() { return mCurrentModifier < mModifiers.Num() - 1; } -ID_INLINE bool rvGEModifierStack::CanUndo( void ) +ID_INLINE bool rvGEModifierStack::CanUndo() { return mCurrentModifier >= 0; } -ID_INLINE void rvGEModifierStack::BlockNextMerge( void ) +ID_INLINE void rvGEModifierStack::BlockNextMerge() { mMergeBlock = true; } -ID_INLINE rvGEModifier* rvGEModifierStack::GetUndoModifier( void ) +ID_INLINE rvGEModifier* rvGEModifierStack::GetUndoModifier() { assert( CanUndo( ) ); return mModifiers[mCurrentModifier]; } -ID_INLINE rvGEModifier* rvGEModifierStack::GetRedoModifier( void ) +ID_INLINE rvGEModifier* rvGEModifierStack::GetRedoModifier() { assert( CanRedo( ) ); return mModifiers[mCurrentModifier + 1]; diff --git a/neo/tools/guied/GEMoveModifier.cpp b/neo/tools/guied/GEMoveModifier.cpp index f57133d..8434589 100644 --- a/neo/tools/guied/GEMoveModifier.cpp +++ b/neo/tools/guied/GEMoveModifier.cpp @@ -52,21 +52,21 @@ bool rvGEMoveModifier::Merge( rvGEModifier* mergebase ) return true; } -bool rvGEMoveModifier::Apply( void ) +bool rvGEMoveModifier::Apply() { mWrapper->SetRect( mNewRect ); return true; } -bool rvGEMoveModifier::Undo( void ) +bool rvGEMoveModifier::Undo() { mWrapper->SetRect( mOldRect ); return true; } -bool rvGEMoveModifier::IsValid( void ) +bool rvGEMoveModifier::IsValid() { if( !mWindow->GetParent( ) ) { diff --git a/neo/tools/guied/GEMoveModifier.h b/neo/tools/guied/GEMoveModifier.h index 0c84ba4..5b4c7cf 100644 --- a/neo/tools/guied/GEMoveModifier.h +++ b/neo/tools/guied/GEMoveModifier.h @@ -37,10 +37,10 @@ class rvGEMoveModifier : public rvGEModifier virtual bool CanMerge( rvGEModifier* merge ); virtual bool Merge( rvGEModifier* merge ); - virtual bool Apply( void ); - virtual bool Undo( void ); + virtual bool Apply(); + virtual bool Undo(); - virtual bool IsValid( void ); + virtual bool IsValid(); protected: diff --git a/neo/tools/guied/GENavigator.cpp b/neo/tools/guied/GENavigator.cpp index cd917d8..c803340 100644 --- a/neo/tools/guied/GENavigator.cpp +++ b/neo/tools/guied/GENavigator.cpp @@ -248,7 +248,7 @@ LRESULT CALLBACK rvGENavigator::WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPA int colorIndex = ( ( dis->itemState & ODS_SELECTED ) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT ); SetTextColor( dis->hDC, GetSysColor( colorIndex ) ); - DrawText( dis->hDC, name, name.Length(), &rDraw, DT_LEFT | DT_VCENTER | DT_SINGLELINE ); + DrawTextA( dis->hDC, name, name.Length(), &rDraw, DT_LEFT | DT_VCENTER | DT_SINGLELINE ); if( wrapper->GetVariableDict().GetNumKeyVals( ) || wrapper->GetScriptDict().GetNumKeyVals( ) ) { @@ -518,7 +518,7 @@ rvGENavigator::Update Updates the contents of the navigator window from the current workspace ================ */ -void rvGENavigator::Update( void ) +void rvGENavigator::Update() { // Clear the list first ListView_DeleteAllItems( mTree ); @@ -543,7 +543,7 @@ rvGENavigator::UpdateSelection Updates the currently selected items ================ */ -void rvGENavigator::UpdateSelections( void ) +void rvGENavigator::UpdateSelections() { int count = ListView_GetItemCount( mTree ); int i; @@ -576,7 +576,7 @@ rvGENavigator::Refresh Repaints the navigator window ================ */ -void rvGENavigator::Refresh( void ) +void rvGENavigator::Refresh() { InvalidateRect( mTree, NULL, FALSE ); // UpdateWindow ( mTree ); diff --git a/neo/tools/guied/GENavigator.h b/neo/tools/guied/GENavigator.h index 8ffe218..78e8b61 100644 --- a/neo/tools/guied/GENavigator.h +++ b/neo/tools/guied/GENavigator.h @@ -40,14 +40,14 @@ class rvGENavigator bool Create( HWND parent, bool visible ); void Show( bool visibile ); - void Refresh( void ); + void Refresh(); void SetWorkspace( rvGEWorkspace* workspace ); - void Update( void ); - void UpdateSelections( void ); + void Update(); + void UpdateSelections(); - HWND GetWindow( void ); + HWND GetWindow(); protected: @@ -69,7 +69,7 @@ class rvGENavigator WNDPROC mListWndProc; }; -ID_INLINE HWND rvGENavigator::GetWindow( void ) +ID_INLINE HWND rvGENavigator::GetWindow() { return mWnd; } diff --git a/neo/tools/guied/GEOptions.cpp b/neo/tools/guied/GEOptions.cpp index 963ea1d..3b9979f 100644 --- a/neo/tools/guied/GEOptions.cpp +++ b/neo/tools/guied/GEOptions.cpp @@ -47,6 +47,8 @@ rvGEOptions::rvGEOptions() mIgnoreDesktopSelect = true; mStatusBarVisible = true; mPropertiesVisible = true; + mItemPropertiesVisible = true; + mScriptsVisible = true; mWorkspaceColor.Set( 0.0f, 0.0f, 0.0f, 1.0f ); mSelectionColor.Set( 0.5f, 0.5f, 1.0f, 1.0f ); @@ -59,7 +61,7 @@ rvGEOptions::rvGEOptions() rvGEOptions::Init ================ */ -void rvGEOptions::Init( void ) +void rvGEOptions::Init() { mRegistry.Init( "Software\\id Software\\DOOM3\\Tools\\GUIEditor" ); } @@ -71,7 +73,7 @@ rvGEOptions::Save Writes the options to the registry so they can later be read using the Load method ================ */ -bool rvGEOptions::Save( void ) +bool rvGEOptions::Save() { // Write the last page we visited mRegistry.SetLong( "lastOptionsPage", mLastOptionsPage ); @@ -85,9 +87,11 @@ bool rvGEOptions::Save( void ) // Tool window states mRegistry.SetBool( "navigatorVisible", mNavigatorVisible ); + mRegistry.SetBool( "ItemPropertiesVisible", mItemPropertiesVisible ); mRegistry.SetBool( "PropertiesVisible", mPropertiesVisible ); mRegistry.SetBool( "transformerVisible", mTransformerVisible ); mRegistry.SetBool( "statusBarVisible", mStatusBarVisible ); + mRegistry.SetBool( "scriptsVisible", mScriptsVisible ); // General stuff mRegistry.SetVec4( "selectionColor", mSelectionColor ); @@ -110,7 +114,7 @@ rvGEOptions::Load Loads previsouly saved options from the registry ================ */ -bool rvGEOptions::Load( void ) +bool rvGEOptions::Load() { if( !mRegistry.Load( ) ) { @@ -130,6 +134,7 @@ bool rvGEOptions::Load( void ) // Tool window states mNavigatorVisible = mRegistry.GetBool( "navigatorVisible" ); mPropertiesVisible = mRegistry.GetBool( "PropertiesVisible" ); + mItemPropertiesVisible = mRegistry.GetBool( "ItemPropertiesVisible" ); mTransformerVisible = mRegistry.GetBool( "transformerVisible" ); mStatusBarVisible = mRegistry.GetBool( "statusBarVisible" ); diff --git a/neo/tools/guied/GEOptions.h b/neo/tools/guied/GEOptions.h index f695c37..912ec62 100644 --- a/neo/tools/guied/GEOptions.h +++ b/neo/tools/guied/GEOptions.h @@ -43,13 +43,13 @@ class rvGEOptions rvGEOptions(); - void Init( void ); + void Init(); // Write the options to the registery - bool Save( void ); + bool Save(); // Read the options from the registry - bool Load( void ); + bool Load(); void SetSelectionColor( idVec4& color ); void SetSelectionColor( COLORREF color ); @@ -60,6 +60,8 @@ class rvGEOptions void SetGridVisible( bool vis ); void SetGridSnap( bool snap ); void SetLastOptionsPage( int page ); + void SetItemPropertiesVisible( bool vis ); + void SetScriptsVisible( bool vis ); void SetNavigatorVisible( bool vis ); void SetPropertiesVisible( bool vis ); void SetTransformerVisible( bool vis ); @@ -67,23 +69,25 @@ class rvGEOptions void SetStatusBarVisible( bool vis ); void AddRecentFile( const char* filename ); - int GetRecentFileCount( void ); + int GetRecentFileCount(); const char* GetRecentFile( int index ); - idVec4& GetGridColor( void ); - int GetGridWidth( void ); - int GetGridHeight( void ); - bool GetGridVisible( void ); - bool GetGridSnap( void ); - int GetLastOptionsPage( void ); - idVec4& GetWorkspaceColor( void ); - bool GetNavigatorVisible( void ); - bool GetTransformerVisible( void ); - bool GetPropertiesVisible( void ); - idVec4& GetSelectionColor( void ); - COLORREF* GetCustomColors( void ); - bool GetIgnoreDesktopSelect( void ); - bool GetStatusBarVisible( void ); + idVec4& GetGridColor(); + int GetGridWidth(); + int GetGridHeight(); + bool GetGridVisible(); + bool GetGridSnap(); + int GetLastOptionsPage(); + idVec4& GetWorkspaceColor(); + bool GetNavigatorVisible(); + bool GetTransformerVisible(); + bool GetPropertiesVisible(); + bool GetItemPropertiesVisible(); + bool GetScriptsVisible(); + idVec4& GetSelectionColor(); + COLORREF* GetCustomColors(); + bool GetIgnoreDesktopSelect(); + bool GetStatusBarVisible(); void SetWindowPlacement( const char* name, HWND hwnd ); bool GetWindowPlacement( const char* name, HWND hwnd ); @@ -108,8 +112,10 @@ class rvGEOptions idVec4 mSelectionColor; bool mNavigatorVisible; + bool mItemPropertiesVisible; bool mPropertiesVisible; bool mTransformerVisible; + bool mScriptsVisible; bool mStatusBarVisible; bool mIgnoreDesktopSelect; @@ -193,6 +199,18 @@ ID_INLINE void rvGEOptions::SetNavigatorVisible( bool vis ) SetModified( true ); } +ID_INLINE void rvGEOptions::SetScriptsVisible( bool vis ) +{ + mScriptsVisible = vis; + SetModified( true ); +} + +ID_INLINE void rvGEOptions::SetItemPropertiesVisible( bool vis ) +{ + mItemPropertiesVisible = vis; + SetModified( true ); +} + ID_INLINE void rvGEOptions::SetPropertiesVisible( bool vis ) { mPropertiesVisible = vis; @@ -205,37 +223,37 @@ ID_INLINE void rvGEOptions::SetTransformerVisible( bool vis ) SetModified( true ); } -ID_INLINE idVec4& rvGEOptions::GetGridColor( void ) +ID_INLINE idVec4& rvGEOptions::GetGridColor() { return mGridColor; } -ID_INLINE int rvGEOptions::GetGridWidth( void ) +ID_INLINE int rvGEOptions::GetGridWidth() { return mGridWidth; } -ID_INLINE int rvGEOptions::GetGridHeight( void ) +ID_INLINE int rvGEOptions::GetGridHeight() { return mGridHeight; } -ID_INLINE bool rvGEOptions::GetGridVisible( void ) +ID_INLINE bool rvGEOptions::GetGridVisible() { return mGridVisible; } -ID_INLINE bool rvGEOptions::GetGridSnap( void ) +ID_INLINE bool rvGEOptions::GetGridSnap() { return mGridSnap; } -ID_INLINE idVec4& rvGEOptions::GetWorkspaceColor( void ) +ID_INLINE idVec4& rvGEOptions::GetWorkspaceColor() { return mWorkspaceColor; } -ID_INLINE int rvGEOptions::GetLastOptionsPage( void ) +ID_INLINE int rvGEOptions::GetLastOptionsPage() { return mLastOptionsPage; } @@ -245,32 +263,42 @@ ID_INLINE void rvGEOptions::SetLastOptionsPage( int page ) mLastOptionsPage = page; } -ID_INLINE bool rvGEOptions::GetNavigatorVisible( void ) +ID_INLINE bool rvGEOptions::GetNavigatorVisible() { return mNavigatorVisible; } -ID_INLINE bool rvGEOptions::GetPropertiesVisible( void ) +ID_INLINE bool rvGEOptions::GetPropertiesVisible() { return mPropertiesVisible; } -ID_INLINE bool rvGEOptions::GetTransformerVisible( void ) +ID_INLINE bool rvGEOptions::GetScriptsVisible() +{ + return mScriptsVisible; +} + +ID_INLINE bool rvGEOptions::GetItemPropertiesVisible() +{ + return mItemPropertiesVisible; +} + +ID_INLINE bool rvGEOptions::GetTransformerVisible() { return mTransformerVisible; } -ID_INLINE bool rvGEOptions::GetStatusBarVisible( void ) +ID_INLINE bool rvGEOptions::GetStatusBarVisible() { return mStatusBarVisible; } -ID_INLINE idVec4& rvGEOptions::GetSelectionColor( void ) +ID_INLINE idVec4& rvGEOptions::GetSelectionColor() { return mSelectionColor; } -ID_INLINE COLORREF* rvGEOptions::GetCustomColors( void ) +ID_INLINE COLORREF* rvGEOptions::GetCustomColors() { return mCustomColors; } @@ -280,7 +308,7 @@ ID_INLINE void rvGEOptions::SetIgnoreDesktopSelect( bool ignore ) mIgnoreDesktopSelect = ignore; } -ID_INLINE bool rvGEOptions::GetIgnoreDesktopSelect( void ) +ID_INLINE bool rvGEOptions::GetIgnoreDesktopSelect() { return mIgnoreDesktopSelect; } @@ -300,7 +328,7 @@ ID_INLINE void rvGEOptions::AddRecentFile( const char* filename ) mRegistry.AddRecentFile( filename ); } -ID_INLINE int rvGEOptions::GetRecentFileCount( void ) +ID_INLINE int rvGEOptions::GetRecentFileCount() { return mRegistry.GetRecentFileCount( ); } diff --git a/neo/tools/guied/GEProperties.cpp b/neo/tools/guied/GEProperties.cpp index 0daff53..b445099 100644 --- a/neo/tools/guied/GEProperties.cpp +++ b/neo/tools/guied/GEProperties.cpp @@ -44,7 +44,7 @@ rvGEProperties::rvGEProperties constructor ================ */ -rvGEProperties::rvGEProperties( void ) +rvGEProperties::rvGEProperties() { mWrapper = NULL; mWnd = NULL; @@ -125,7 +125,7 @@ rvGEProperties::Update Update the properties in the window ================ */ -void rvGEProperties::Update( void ) +void rvGEProperties::Update() { int i; @@ -187,6 +187,7 @@ bool rvGEProperties::AddModifier( const char* name, const char* value ) mWorkspace->GetModifierStack().Append( new rvGEStateModifier( "Property Change", mWrapper->GetWindow(), tempstate ) ); mWorkspace->SetModified( true ); gApp.GetNavigator().Update( ); + gApp.GetItemProperties().Update( ); return true; } diff --git a/neo/tools/guied/GEProperties.h b/neo/tools/guied/GEProperties.h index 1fe2b9b..1402dd8 100644 --- a/neo/tools/guied/GEProperties.h +++ b/neo/tools/guied/GEProperties.h @@ -47,9 +47,9 @@ class rvGEProperties void SetWorkspace( rvGEWorkspace* workspace ); - void Update( void ); + void Update(); - HWND GetWindow( void ); + HWND GetWindow(); protected: @@ -63,7 +63,7 @@ class rvGEProperties rvGEWorkspace* mWorkspace; }; -ID_INLINE HWND rvGEProperties::GetWindow( void ) +ID_INLINE HWND rvGEProperties::GetWindow() { return mWnd; } diff --git a/neo/tools/guied/GEPropertyPage.cpp b/neo/tools/guied/GEPropertyPage.cpp index 86041ff..07bc50a 100644 --- a/neo/tools/guied/GEPropertyPage.cpp +++ b/neo/tools/guied/GEPropertyPage.cpp @@ -101,6 +101,15 @@ int rvGEPropertyPage::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ) case PSN_KILLACTIVE: KillActive( ); break; + + } + break; + case WM_KEYDOWN: + case WM_KEYUP: + case WM_CHAR: + if( gApp.GetActiveWorkspace() ) + { + return SendMessage( gApp.GetMDIFrame(), msg, wParam, lParam ); } break; } diff --git a/neo/tools/guied/GEPropertyPage.h b/neo/tools/guied/GEPropertyPage.h index b61c705..9d9124b 100644 --- a/neo/tools/guied/GEPropertyPage.h +++ b/neo/tools/guied/GEPropertyPage.h @@ -35,19 +35,19 @@ class rvGEPropertyPage rvGEPropertyPage( ); - virtual bool Init( void ) + virtual bool Init() { return true; } - virtual bool Apply( void ) + virtual bool Apply() { return true; } - virtual bool SetActive( void ) + virtual bool SetActive() { return true; } - virtual bool KillActive( void ) + virtual bool KillActive() { return true; } diff --git a/neo/tools/guied/GESelectionMgr.cpp b/neo/tools/guied/GESelectionMgr.cpp index 62a238c..cf1707f 100644 --- a/neo/tools/guied/GESelectionMgr.cpp +++ b/neo/tools/guied/GESelectionMgr.cpp @@ -34,6 +34,7 @@ If you have questions concerning this license or the applicable additional terms #include "GEApp.h" #include "GESelectionMgr.h" +#include "GEItemScriptsDlg.h" #define GUIED_GRABSIZE 7 #define GUIED_CENTERSIZE 5 @@ -92,6 +93,8 @@ void rvGESelectionMgr::Add( idWindow* window, bool expand ) gApp.GetNavigator( ).Refresh( ); gApp.GetTransformer( ).Update( ); gApp.GetProperties().Update( ); + gApp.GetItemProperties().Update( ); + GEItescriptsDlg_Init( gApp.GetScriptWindow() ); UpdateExpression( ); } @@ -116,6 +119,8 @@ void rvGESelectionMgr::Remove( idWindow* window ) return; } + GEItescriptsDlg_Apply( gApp.GetScriptWindow() ); + wrapper->SetSelected( false ); mSelections.Remove( window ); @@ -124,6 +129,8 @@ void rvGESelectionMgr::Remove( idWindow* window ) gApp.GetNavigator( ).Refresh( ); gApp.GetTransformer( ).Update( ); gApp.GetProperties().Update( ); + gApp.GetItemProperties().Update( ); + GEItescriptsDlg_Init( gApp.GetScriptWindow() ); UpdateExpression( ); } @@ -135,10 +142,15 @@ rvGESelectionMgr::ClearSelections Remove all of the current selections ================ */ -void rvGESelectionMgr::Clear( void ) +void rvGESelectionMgr::Clear() { int i; + if( mSelections.Num() > 0 ) + { + GEItescriptsDlg_Apply( gApp.GetScriptWindow() ); + } + for( i = 0; i < mSelections.Num( ); i ++ ) { rvGEWindowWrapper::GetWrapper( mSelections[i] )->SetSelected( false ); @@ -150,6 +162,8 @@ void rvGESelectionMgr::Clear( void ) gApp.GetNavigator( ).Refresh( ); gApp.GetTransformer( ).Update( ); gApp.GetProperties().Update( ); + gApp.GetItemProperties().Update( ); + GEItescriptsDlg_Init( gApp.GetScriptWindow() ); mExpression = false; } @@ -161,7 +175,7 @@ rvGESelectionMgr::Render Render the selections including the move/size bars ================ */ -void rvGESelectionMgr::Render( void ) +void rvGESelectionMgr::Render() { if( !mSelections.Num( ) ) { @@ -296,7 +310,7 @@ rvGESelectionMgr::UpdateRectangle Update the selection rectangle from all the currently selected items. ================ */ -void rvGESelectionMgr::UpdateRectangle( void ) +void rvGESelectionMgr::UpdateRectangle() { int i; idVec2 point; @@ -341,7 +355,7 @@ rvGESelectionMgr::UpdateExpression Update whether or not the selection has an expression in it ================ */ -void rvGESelectionMgr::UpdateExpression( void ) +void rvGESelectionMgr::UpdateExpression() { int i; @@ -444,7 +458,7 @@ rvGESelectionMgr::GetBottomMost Returns the bottom most selected window. ================ */ -idWindow* rvGESelectionMgr::GetBottomMost( void ) +idWindow* rvGESelectionMgr::GetBottomMost() { idWindow* bottom; int depth; diff --git a/neo/tools/guied/GESelectionMgr.h b/neo/tools/guied/GESelectionMgr.h index 8aa3690..2cfa970 100644 --- a/neo/tools/guied/GESelectionMgr.h +++ b/neo/tools/guied/GESelectionMgr.h @@ -57,26 +57,26 @@ class rvGESelectionMgr void Set( idWindow* ); void Add( idWindow* window, bool expand = true ); void Remove( idWindow* ); - void Clear( void ); + void Clear(); - int Num( void ); + int Num(); - void Render( void ); + void Render(); EHitTest HitTest( float x, float y ); bool IsSelected( idWindow* window ); - bool IsExpression( void ); + bool IsExpression(); - idRectangle& GetRect( void ); - idWindow* GetBottomMost( void ); + idRectangle& GetRect(); + idWindow* GetBottomMost(); idWindow*& operator[]( int index ); protected: - void UpdateRectangle( void ); - void UpdateExpression( void ); + void UpdateRectangle(); + void UpdateExpression(); idList mSelections; idRectangle mRect; @@ -84,7 +84,7 @@ class rvGESelectionMgr bool mExpression; }; -ID_INLINE int rvGESelectionMgr::Num( void ) +ID_INLINE int rvGESelectionMgr::Num() { return mSelections.Num( ); } @@ -102,7 +102,7 @@ ID_INLINE void rvGESelectionMgr::SetWorkspace( rvGEWorkspace* workspace ) mWorkspace = workspace; } -ID_INLINE idRectangle& rvGESelectionMgr::GetRect( void ) +ID_INLINE idRectangle& rvGESelectionMgr::GetRect() { UpdateRectangle( ); return mRect; @@ -113,7 +113,7 @@ ID_INLINE bool rvGESelectionMgr::IsSelected( idWindow* window ) return mSelections.FindIndex( window ) != -1 ? true : false; } -ID_INLINE bool rvGESelectionMgr::IsExpression( void ) +ID_INLINE bool rvGESelectionMgr::IsExpression() { return mExpression; } diff --git a/neo/tools/guied/GESizeModifier.cpp b/neo/tools/guied/GESizeModifier.cpp index 2af24ad..35ff901 100644 --- a/neo/tools/guied/GESizeModifier.cpp +++ b/neo/tools/guied/GESizeModifier.cpp @@ -52,21 +52,21 @@ bool rvGESizeModifier::Merge( rvGEModifier* mergebase ) return true; } -bool rvGESizeModifier::Apply( void ) +bool rvGESizeModifier::Apply() { mWrapper->SetRect( mNewRect ); return true; } -bool rvGESizeModifier::Undo( void ) +bool rvGESizeModifier::Undo() { mWrapper->SetRect( mOldRect ); return true; } -bool rvGESizeModifier::IsValid( void ) +bool rvGESizeModifier::IsValid() { if( !mWindow->GetParent( ) ) { diff --git a/neo/tools/guied/GESizeModifier.h b/neo/tools/guied/GESizeModifier.h index 64bf63b..f913372 100644 --- a/neo/tools/guied/GESizeModifier.h +++ b/neo/tools/guied/GESizeModifier.h @@ -37,10 +37,10 @@ class rvGESizeModifier : public rvGEModifier virtual bool CanMerge( rvGEModifier* merge ); virtual bool Merge( rvGEModifier* merge ); - virtual bool Apply( void ); - virtual bool Undo( void ); + virtual bool Apply(); + virtual bool Undo(); - virtual bool IsValid( void ); + virtual bool IsValid(); protected: diff --git a/neo/tools/guied/GEStateModifier.cpp b/neo/tools/guied/GEStateModifier.cpp index 454dd6b..41b6a64 100644 --- a/neo/tools/guied/GEStateModifier.cpp +++ b/neo/tools/guied/GEStateModifier.cpp @@ -51,7 +51,7 @@ rvGEStateModifier::Apply Applys the new state dictionary to the window ================ */ -bool rvGEStateModifier::Apply( void ) +bool rvGEStateModifier::Apply() { return SetState( mDict ); } @@ -63,7 +63,7 @@ rvGEStateModifier::Undo Applies the undo dictionary to the window ================ */ -bool rvGEStateModifier::Undo( void ) +bool rvGEStateModifier::Undo() { return SetState( mUndoDict ); } diff --git a/neo/tools/guied/GEStateModifier.h b/neo/tools/guied/GEStateModifier.h index cce7124..ec6ee78 100644 --- a/neo/tools/guied/GEStateModifier.h +++ b/neo/tools/guied/GEStateModifier.h @@ -38,8 +38,8 @@ class rvGEStateModifier : public rvGEModifier rvGEStateModifier( const char* name, idWindow* window, idDict& dict ); - virtual bool Apply( void ); - virtual bool Undo( void ); + virtual bool Apply(); + virtual bool Undo(); protected: diff --git a/neo/tools/guied/GEStatusBar.cpp b/neo/tools/guied/GEStatusBar.cpp index 7b0c3cb..78444d4 100644 --- a/neo/tools/guied/GEStatusBar.cpp +++ b/neo/tools/guied/GEStatusBar.cpp @@ -80,7 +80,7 @@ rvGEStatusBar::Update Updates the status bar by setting up each part's width and text ================ */ -void rvGEStatusBar::Update( void ) +void rvGEStatusBar::Update() { RECT rStatus; SIZE zoomSize; diff --git a/neo/tools/guied/GEStatusBar.h b/neo/tools/guied/GEStatusBar.h index 5bc01a5..def4006 100644 --- a/neo/tools/guied/GEStatusBar.h +++ b/neo/tools/guied/GEStatusBar.h @@ -37,14 +37,14 @@ class rvGEStatusBar bool Create( HWND parent, UINT id, bool visible = true ); void Resize( int width, int height ); - HWND GetWindow( void ); + HWND GetWindow(); void SetZoom( int zoom ); void SetTriangles( int tris ); void SetSimple( bool simple ); void Show( bool state ); - void Update( void ); + void Update(); protected: @@ -54,7 +54,7 @@ class rvGEStatusBar int mTriangles; }; -ID_INLINE HWND rvGEStatusBar::GetWindow( void ) +ID_INLINE HWND rvGEStatusBar::GetWindow() { return mWnd; } diff --git a/neo/tools/guied/GETransformer.cpp b/neo/tools/guied/GETransformer.cpp index 465fc75..5be80bf 100644 --- a/neo/tools/guied/GETransformer.cpp +++ b/neo/tools/guied/GETransformer.cpp @@ -61,7 +61,7 @@ bool rvGETransformer::Create( HWND parent, bool visible ) "GUIEDITOR_TRANSFORMER_CLASS", "Transformer", WS_SYSMENU | WS_CAPTION | WS_POPUP | WS_OVERLAPPED | WS_BORDER | WS_CLIPSIBLINGS | WS_CHILD, - 0, 0, 200, 100, + 0, 0, 200, 192, parent, NULL, win32.hInstance, @@ -107,7 +107,9 @@ LRESULT CALLBACK rvGETransformer::WndProc( HWND hWnd, UINT msg, WPARAM wParam, L case WM_DESTROY: gApp.GetOptions().SetWindowPlacement( "transformer", hWnd ); break; - + case WM_CLOSE: + SendMessage( gApp.GetMDIFrame(), WM_COMMAND, MAKELONG( ID_GUIED_WINDOW_SHOWTRANSFORMER, 0 ), 0 ); + break; case WM_ERASEBKGND: return TRUE; @@ -197,6 +199,8 @@ INT_PTR CALLBACK rvGETransformer::DlgProc( HWND hWnd, UINT msg, WPARAM wParam, L rect.y -= screenRect.y; } + bool bLockAspect = trans->GetLockAspect(); + switch( LOWORD( wParam ) ) { case IDC_GUIED_ITEMRECTX: @@ -216,14 +220,28 @@ INT_PTR CALLBACK rvGETransformer::DlgProc( HWND hWnd, UINT msg, WPARAM wParam, L case IDC_GUIED_ITEMRECTW: if( value - rect[2] ) { - trans->mWorkspace->AddModifierSize( "Transform Size", 0, 0, value - rect[2], 0, false ); + if( bLockAspect ) + { + trans->mWorkspace->AddModifierSize( "Transform Size", 0, 0, value - rect[2], value - rect[2], false ); + } + else + { + trans->mWorkspace->AddModifierSize( "Transform Size", 0, 0, value - rect[2], 0, false ); + } } break; case IDC_GUIED_ITEMRECTH: if( value - rect[3] ) { - trans->mWorkspace->AddModifierSize( "Transform Size", 0, 0, 0, value - rect[3], false ); + if( bLockAspect ) + { + trans->mWorkspace->AddModifierSize( "Transform Size", 0, 0, value - rect[3], value - rect[3], false ); + } + else + { + trans->mWorkspace->AddModifierSize( "Transform Size", 0, 0, 0, value - rect[3], false ); + } } break; } @@ -234,6 +252,18 @@ INT_PTR CALLBACK rvGETransformer::DlgProc( HWND hWnd, UINT msg, WPARAM wParam, L return FALSE; } +bool rvGETransformer::GetLockAspect( void ) +{ + UINT retVal = IsDlgButtonChecked( mDlg, IDC_GUIED_LOCK_ASPECT ); + + if( retVal == BST_CHECKED ) + { + return true; + } + + return false; +} + /* ================ rvGETransformer::Show @@ -270,7 +300,7 @@ Update the enabled/disabled states based on the selections and update the rectangle coordinates ================ */ -void rvGETransformer::Update( void ) +void rvGETransformer::Update() { bool state = false; @@ -311,6 +341,7 @@ void rvGETransformer::Update( void ) EnableWindow( GetDlgItem( mDlg, IDC_GUIED_ITEMRECTY ), state ); EnableWindow( GetDlgItem( mDlg, IDC_GUIED_ITEMRECTW ), state ); EnableWindow( GetDlgItem( mDlg, IDC_GUIED_ITEMRECTH ), state ); + EnableWindow( GetDlgItem( mDlg, IDC_GUIED_LOCK_ASPECT ), state ); } /* diff --git a/neo/tools/guied/GETransformer.h b/neo/tools/guied/GETransformer.h index 2e5f8a9..8ccd0cd 100644 --- a/neo/tools/guied/GETransformer.h +++ b/neo/tools/guied/GETransformer.h @@ -39,10 +39,14 @@ class rvGETransformer void Show( bool show ); void SetWorkspace( rvGEWorkspace* workspace ); - void Update( void ); - - HWND GetWindow( void ); - + void Update(); + + bool GetLockAspect(); + HWND GetWindow(); + rvGEWorkspace* GetWorkspace() + { + return mWorkspace; + } protected: HWND mWnd; @@ -57,7 +61,7 @@ class rvGETransformer static LRESULT FAR PASCAL GetMsgProc( int nCode, WPARAM wParam, LPARAM lParam ); }; -ID_INLINE HWND rvGETransformer::GetWindow( void ) +ID_INLINE HWND rvGETransformer::GetWindow() { return mWnd; } diff --git a/neo/tools/guied/GEViewer.cpp b/neo/tools/guied/GEViewer.cpp index 8c8f0cf..1b8745e 100644 --- a/neo/tools/guied/GEViewer.cpp +++ b/neo/tools/guied/GEViewer.cpp @@ -71,7 +71,7 @@ bool rvGEViewer::Create( HWND parent ) return true; } -void rvGEViewer::Play( void ) +void rvGEViewer::Play() { if( !mPaused ) { @@ -89,7 +89,7 @@ void rvGEViewer::Play( void ) SendMessage( mToolbar, TB_SETBUTTONINFO, ID_GUIED_VIEWER_PLAY, ( LPARAM )&tbinfo ); } -void rvGEViewer::Pause( void ) +void rvGEViewer::Pause() { if( mPaused ) { @@ -107,7 +107,7 @@ void rvGEViewer::Pause( void ) } -bool rvGEViewer::Destroy( void ) +bool rvGEViewer::Destroy() { gApp.GetOptions().SetWindowPlacement( "viewer", mWnd ); @@ -455,7 +455,7 @@ rvGEViewer::SetupPixelFormat Setup the pixel format for the opengl context ================ */ -bool rvGEViewer::SetupPixelFormat( void ) +bool rvGEViewer::SetupPixelFormat() { HDC hDC = GetDC( mWnd ); bool result = true; @@ -548,7 +548,7 @@ void rvGEViewer::Render( HDC dc ) qwglSwapBuffers( dc ); } -void rvGEViewer::RunFrame( void ) +void rvGEViewer::RunFrame() { if( !mPaused ) { diff --git a/neo/tools/guied/GEViewer.h b/neo/tools/guied/GEViewer.h index 9ddad2a..2d08203 100644 --- a/neo/tools/guied/GEViewer.h +++ b/neo/tools/guied/GEViewer.h @@ -36,18 +36,18 @@ class rvGEViewer rvGEViewer( ); bool Create( HWND parent ); - bool Destroy( void ); + bool Destroy(); bool OpenFile( const char* filename ); - void RunFrame( void ); + void RunFrame(); - HWND GetWindow( void ); + HWND GetWindow(); protected: void Render( HDC dc ); - void Play( void ); - void Pause( void ); + void Play(); + void Pause(); HWND mWnd; int mWindowWidth; @@ -63,12 +63,12 @@ class rvGEViewer private: - bool SetupPixelFormat( void ); + bool SetupPixelFormat(); static LRESULT CALLBACK WndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); }; -ID_INLINE HWND rvGEViewer::GetWindow( void ) +ID_INLINE HWND rvGEViewer::GetWindow() { return mWnd; } diff --git a/neo/tools/guied/GEWindowWrapper.cpp b/neo/tools/guied/GEWindowWrapper.cpp index 8eac2b8..153d65a 100644 --- a/neo/tools/guied/GEWindowWrapper.cpp +++ b/neo/tools/guied/GEWindowWrapper.cpp @@ -137,7 +137,7 @@ Updates the gui editor's representation of the window rectangle from the windows rectangle ================ */ -void rvGEWindowWrapper::UpdateRect( void ) +void rvGEWindowWrapper::UpdateRect() { idVec4 rect; idWinRectangle* winrect; @@ -177,7 +177,7 @@ Calculates the screen rectangle from the client rectangle by running through the parent windows and adding their offsets ================ */ -void rvGEWindowWrapper::CalcScreenRect( void ) +void rvGEWindowWrapper::CalcScreenRect() { idWindow* parent; @@ -335,7 +335,7 @@ Updates the windows real state with wrappers internal state. Visibility is handled specially ================ */ -void rvGEWindowWrapper::UpdateWindowState( void ) +void rvGEWindowWrapper::UpdateWindowState() { idStr realVisible; bool tempVisible; @@ -482,7 +482,7 @@ rvGEWindowWrapper::GetChildCount Returns the number of children the window being wrapped has ================ */ -int rvGEWindowWrapper::GetChildCount( void ) +int rvGEWindowWrapper::GetChildCount() { if( !CanHaveChildren() ) { @@ -528,7 +528,7 @@ rvGEWindowWrapper::CanHaveChildren Returns true if the window is allowed to have child windows ================ */ -bool rvGEWindowWrapper::CanHaveChildren( void ) +bool rvGEWindowWrapper::CanHaveChildren() { if( mType == WT_HTML || mType == WT_LIST ) { @@ -545,7 +545,7 @@ rvGEWindowWrapper::GetDepth Returns the depth of the wrapped window ================ */ -int rvGEWindowWrapper::GetDepth( void ) +int rvGEWindowWrapper::GetDepth() { idWindow* parent; int depth; @@ -563,7 +563,7 @@ rvGEWindowWrapper::Expand Expand the window in the navigator and all of its parents too ================ */ -bool rvGEWindowWrapper::Expand( void ) +bool rvGEWindowWrapper::Expand() { bool result; @@ -593,7 +593,7 @@ rvGEWindowWrapper::Collapse Returns the depth of the wrapped window ================ */ -bool rvGEWindowWrapper::Collapse( void ) +bool rvGEWindowWrapper::Collapse() { bool result; @@ -624,7 +624,7 @@ After a the windwo wrapper is attached to a window and the window is parsed the finish method is called to finish up any last details ================ */ -void rvGEWindowWrapper::Finish( void ) +void rvGEWindowWrapper::Finish() { mOldVisible = ( ( bool ) * dynamic_cast< idWinBool*>( mWindow->GetWinVarByName( "visible" ) ) ); mHidden = mOldVisible ? false : true; diff --git a/neo/tools/guied/GEWindowWrapper.h b/neo/tools/guied/GEWindowWrapper.h index 629ee10..6b0ebe5 100644 --- a/neo/tools/guied/GEWindowWrapper.h +++ b/neo/tools/guied/GEWindowWrapper.h @@ -56,15 +56,15 @@ class rvGEWindowWrapper static rvGEWindowWrapper* GetWrapper( idWindow* window ); - idWindow* GetWindow( void ); - idDict& GetStateDict( void ); - idDict& GetVariableDict( void ); - idDict& GetScriptDict( void ); - idRectangle& GetClientRect( void ); - idRectangle& GetScreenRect( void ); - EWindowType GetWindowType( void ); - int GetChildCount( void ); - int GetDepth( void ); + idWindow* GetWindow(); + idDict& GetStateDict(); + idDict& GetVariableDict(); + idDict& GetScriptDict(); + idRectangle& GetClientRect(); + idRectangle& GetScreenRect(); + EWindowType GetWindowType(); + int GetChildCount(); + int GetDepth(); idWindow* GetChild( int index ); void SetRect( idRectangle& rect ); @@ -73,15 +73,15 @@ class rvGEWindowWrapper void DeleteStateKey( const char* key ); bool VerfiyStateKey( const char* name, const char* value, idStr* result = NULL ); - bool IsFlippedHorz( void ); - bool IsFlippedVert( void ); - bool IsHidden( void ); - bool IsDeleted( void ); - bool IsSelected( void ); - bool IsExpanded( void ); + bool IsFlippedHorz(); + bool IsFlippedVert(); + bool IsHidden(); + bool IsDeleted(); + bool IsSelected(); + bool IsExpanded(); - bool CanHaveChildren( void ); - bool CanMoveAndSize( void ); + bool CanHaveChildren(); + bool CanMoveAndSize(); void SetFlippedHorz( bool f ); void SetFlippedVert( bool f ); @@ -90,23 +90,23 @@ class rvGEWindowWrapper void SetSelected( bool sel ); void SetWindowType( EWindowType type ); - bool Expand( void ); - bool Collapse( void ); + bool Expand(); + bool Collapse(); bool EnumChildren( PFNENUMCHILDRENPROC proc, void* data ); idWindow* WindowFromPoint( float x, float y, bool visibleOnly = true ); - void Finish( void ); + void Finish(); static EWindowType StringToWindowType( const char* string ); static const char* WindowTypeToString( EWindowType type ); protected: - void CalcScreenRect( void ); - void UpdateRect( void ); - void UpdateWindowState( void ); + void CalcScreenRect(); + void UpdateRect(); + void UpdateWindowState(); idRectangle mClientRect; idRectangle mScreenRect; @@ -125,32 +125,32 @@ class rvGEWindowWrapper EWindowType mType; }; -ID_INLINE idDict& rvGEWindowWrapper::GetStateDict( void ) +ID_INLINE idDict& rvGEWindowWrapper::GetStateDict() { return mState; } -ID_INLINE idDict& rvGEWindowWrapper::GetVariableDict( void ) +ID_INLINE idDict& rvGEWindowWrapper::GetVariableDict() { return mVariables; } -ID_INLINE idDict& rvGEWindowWrapper::GetScriptDict( void ) +ID_INLINE idDict& rvGEWindowWrapper::GetScriptDict() { return mScripts; } -ID_INLINE bool rvGEWindowWrapper::IsFlippedHorz( void ) +ID_INLINE bool rvGEWindowWrapper::IsFlippedHorz() { return mFlippedHorz; } -ID_INLINE bool rvGEWindowWrapper::IsFlippedVert( void ) +ID_INLINE bool rvGEWindowWrapper::IsFlippedVert() { return mFlippedVert; } -ID_INLINE bool rvGEWindowWrapper::IsExpanded( void ) +ID_INLINE bool rvGEWindowWrapper::IsExpanded() { return mExpanded; } @@ -165,27 +165,27 @@ ID_INLINE void rvGEWindowWrapper::SetFlippedVert( bool f ) mFlippedVert = f; } -ID_INLINE idRectangle& rvGEWindowWrapper::GetClientRect( void ) +ID_INLINE idRectangle& rvGEWindowWrapper::GetClientRect() { return mClientRect; } -ID_INLINE idRectangle& rvGEWindowWrapper::GetScreenRect( void ) +ID_INLINE idRectangle& rvGEWindowWrapper::GetScreenRect() { return mScreenRect; } -ID_INLINE bool rvGEWindowWrapper::IsHidden( void ) +ID_INLINE bool rvGEWindowWrapper::IsHidden() { return mHidden; } -ID_INLINE bool rvGEWindowWrapper::IsDeleted( void ) +ID_INLINE bool rvGEWindowWrapper::IsDeleted() { return mDeleted; } -ID_INLINE bool rvGEWindowWrapper::IsSelected( void ) +ID_INLINE bool rvGEWindowWrapper::IsSelected() { return mSelected; } @@ -195,7 +195,7 @@ ID_INLINE void rvGEWindowWrapper::SetSelected( bool sel ) mSelected = sel; } -ID_INLINE rvGEWindowWrapper::EWindowType rvGEWindowWrapper::GetWindowType( void ) +ID_INLINE rvGEWindowWrapper::EWindowType rvGEWindowWrapper::GetWindowType() { return mType; } @@ -210,12 +210,12 @@ ID_INLINE idWindow* rvGEWindowWrapper::GetChild( int index ) return mWindow->GetChild( index ); } -ID_INLINE idWindow* rvGEWindowWrapper::GetWindow( void ) +ID_INLINE idWindow* rvGEWindowWrapper::GetWindow() { return mWindow; } -ID_INLINE bool rvGEWindowWrapper::CanMoveAndSize( void ) +ID_INLINE bool rvGEWindowWrapper::CanMoveAndSize() { return mMoveable; } diff --git a/neo/tools/guied/GEWorkspace.cpp b/neo/tools/guied/GEWorkspace.cpp index bd572fa..23e4d19 100644 --- a/neo/tools/guied/GEWorkspace.cpp +++ b/neo/tools/guied/GEWorkspace.cpp @@ -122,7 +122,7 @@ rvGEWorkspace::GetZoomScale Returns the scale of the current zoom level ================ */ -float rvGEWorkspace::GetZoomScale( void ) +float rvGEWorkspace::GetZoomScale() { return g_ZoomScales [ mZoom ]; } @@ -160,7 +160,7 @@ rvGEWorkspace::Detach Detaches the workspace from the window it is currently attached to ================ */ -void rvGEWorkspace::Detach( void ) +void rvGEWorkspace::Detach() { assert( mWnd ); @@ -175,7 +175,7 @@ rvGEWorkspace::SetupPixelFormat Setup the pixel format for the opengl context ================ */ -bool rvGEWorkspace::SetupPixelFormat( void ) +bool rvGEWorkspace::SetupPixelFormat() { HDC hDC = GetDC( mWnd ); bool result = true; @@ -205,7 +205,7 @@ rvGEWorkspace::RenderGrid Renders the grid on top of the user interface ================ */ -void rvGEWorkspace::RenderGrid( void ) +void rvGEWorkspace::RenderGrid() { float x; float y; @@ -371,7 +371,7 @@ rvGEWorkspace::UpdateTitle Updates the window title with the name of the file and the zoom level and weither its open or not ================ */ -void rvGEWorkspace::UpdateTitle( void ) +void rvGEWorkspace::UpdateTitle() { // Set the window title based on the current filename SetWindowText( mWnd, va( "%s%s (%d%%)", idStr( mFilename ).StripPath( ).c_str( ), mModified ? "*" : "", ( int )( g_ZoomScales[mZoom] * 100 ) ) ); @@ -519,7 +519,7 @@ rvGEWorkspace::UpdateScrollbars Updates the states and the ranges of the scrollbars as well as the rectangle ================ */ -void rvGEWorkspace::UpdateScrollbars( void ) +void rvGEWorkspace::UpdateScrollbars() { SCROLLINFO info; @@ -647,7 +647,7 @@ void rvGEWorkspace::UpdateCursor( float x, float y ) } } -void rvGEWorkspace::UpdateCursor( void ) +void rvGEWorkspace::UpdateCursor() { if( mDragType == rvGESelectionMgr::HT_NONE ) { @@ -679,19 +679,11 @@ void rvGEWorkspace::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { case WM_CLOSE: { - - if( IsModified( ) ) - { - if( IDYES == gApp.MessageBox( va( "Save changes to the document \"%s\" before closing?", GetFilename() ), MB_YESNO | MB_ICONQUESTION ) ) - { - SendMessage( mApplication->GetMDIFrame(), WM_COMMAND, MAKELONG( ID_GUIED_FILE_SAVE, 0 ), 0 ); - } - } - - GetApplication( )->GetNavigator().SetWorkspace( NULL ); GetApplication( )->GetTransformer().SetWorkspace( NULL ); GetApplication( )->GetProperties().SetWorkspace( NULL ); + GetApplication( )->GetItemProperties().SetWorkspace( NULL ); + GEItemScriptsDlg_Clear( GetApplication()->GetScriptWindow() ); break; } @@ -1097,6 +1089,8 @@ int rvGEWorkspace::HandleMouseMove( WPARAM wParam, LPARAM lParam ) return 0; } + bool bLockAspect = mApplication->GetTransformer().GetLockAspect(); + switch( mDragType ) { case rvGESelectionMgr::HT_MOVE: @@ -1104,36 +1098,105 @@ int rvGEWorkspace::HandleMouseMove( WPARAM wParam, LPARAM lParam ) break; case rvGESelectionMgr::HT_SIZE_BOTTOM: - AddModifierSize( "Size", 0, 0, 0, cursor.y - mDragPoint.y, mApplication->GetOptions().GetGridSnap( ) ); + { + if( bLockAspect ) + { + AddModifierSize( "Size", 0, 0, cursor.y - mDragPoint.y, cursor.y - mDragPoint.y, mApplication->GetOptions().GetGridSnap() ); + } + else + { + AddModifierSize( "Size", 0, 0, 0, cursor.y - mDragPoint.y, mApplication->GetOptions().GetGridSnap() ); + } break; - + } case rvGESelectionMgr::HT_SIZE_TOP: - AddModifierSize( "Size", 0, cursor.y - mDragPoint.y, 0, 0, mApplication->GetOptions().GetGridSnap( ) ); + { + if( bLockAspect ) + { + AddModifierSize( "Size", 0, cursor.y - mDragPoint.y, mDragPoint.y - cursor.y, 0, mApplication->GetOptions().GetGridSnap() ); + } + else + { + AddModifierSize( "Size", 0, cursor.y - mDragPoint.y, 0, 0, mApplication->GetOptions().GetGridSnap() ); + } break; - + } case rvGESelectionMgr::HT_SIZE_RIGHT: - AddModifierSize( "Size", 0, 0, cursor.x - mDragPoint.x, 0, mApplication->GetOptions().GetGridSnap( ) ); + { + if( bLockAspect ) + { + AddModifierSize( "Size", 0, 0, cursor.x - mDragPoint.x, cursor.x - mDragPoint.x, mApplication->GetOptions().GetGridSnap() ); + } + else + { + AddModifierSize( "Size", 0, 0, cursor.x - mDragPoint.x, 0, mApplication->GetOptions().GetGridSnap() ); + } break; - + } case rvGESelectionMgr::HT_SIZE_LEFT: - AddModifierSize( "Size", cursor.x - mDragPoint.x, 0, 0, 0, mApplication->GetOptions().GetGridSnap( ) ); + { + if( bLockAspect ) + { + AddModifierSize( "Size", cursor.x - mDragPoint.x, 0, 0, mDragPoint.x - cursor.x, mApplication->GetOptions().GetGridSnap() ); + } + else + { + AddModifierSize( "Size", cursor.x - mDragPoint.x, 0, 0, 0, mApplication->GetOptions().GetGridSnap() ); + } break; - + } case rvGESelectionMgr::HT_SIZE_TOPLEFT: - AddModifierSize( "Size", cursor.x - mDragPoint.x, cursor.y - mDragPoint.y, 0, 0, mApplication->GetOptions().GetGridSnap( ) ); + { + if( bLockAspect ) + { + int bigger = abs( cursor.x - mDragPoint.x ) > abs( cursor.y - mDragPoint.y ) ? cursor.x - mDragPoint.x : cursor.y - mDragPoint.y; + AddModifierSize( "Size", bigger, bigger, 0, 0, mApplication->GetOptions().GetGridSnap() ); + } + else + { + AddModifierSize( "Size", cursor.x - mDragPoint.x, cursor.y - mDragPoint.y, 0, 0, mApplication->GetOptions().GetGridSnap() ); + } break; - + } case rvGESelectionMgr::HT_SIZE_TOPRIGHT: - AddModifierSize( "Size", 0, cursor.y - mDragPoint.y, cursor.x - mDragPoint.x, 0, mApplication->GetOptions().GetGridSnap( ) ); + { + if( bLockAspect ) + { + int bigger = cursor.x - mDragPoint.x; + AddModifierSize( "Size", 0, -bigger, bigger, 0, mApplication->GetOptions().GetGridSnap() ); + } + else + { + AddModifierSize( "Size", 0, cursor.y - mDragPoint.y, cursor.x - mDragPoint.x, 0, mApplication->GetOptions().GetGridSnap() ); + } break; - + } case rvGESelectionMgr::HT_SIZE_BOTTOMLEFT: - AddModifierSize( "Size", cursor.x - mDragPoint.x, 0, 0, cursor.y - mDragPoint.y, mApplication->GetOptions().GetGridSnap( ) ); + { + if( bLockAspect ) + { + int bigger = cursor.x - mDragPoint.x; + AddModifierSize( "Size", bigger, 0, 0, -bigger, mApplication->GetOptions().GetGridSnap() ); + } + else + { + AddModifierSize( "Size", cursor.x - mDragPoint.x, 0, 0, cursor.y - mDragPoint.y, mApplication->GetOptions().GetGridSnap() ); + } break; - + } case rvGESelectionMgr::HT_SIZE_BOTTOMRIGHT: - AddModifierSize( "Size", 0, 0, cursor.x - mDragPoint.x, cursor.y - mDragPoint.y, mApplication->GetOptions().GetGridSnap( ) ); + { + if( bLockAspect ) + { + int bigger = abs( cursor.x - mDragPoint.x ) > abs( cursor.y - mDragPoint.y ) ? cursor.x - mDragPoint.x : cursor.y - mDragPoint.y; + AddModifierSize( "Size", 0, 0, bigger, bigger, mApplication->GetOptions().GetGridSnap() ); + } + else + { + AddModifierSize( "Size", 0, 0, cursor.x - mDragPoint.x, cursor.y - mDragPoint.y, mApplication->GetOptions().GetGridSnap() ); + } break; + } } UpdateCursor( mDragType ); @@ -1213,6 +1276,7 @@ int rvGEWorkspace::HandleKeyDown( WPARAM wParam, LPARAM lParam ) case VK_ESCAPE: mSelections.Clear( ); mApplication->GetNavigator().Update( ); + mApplication->GetItemProperties().Update(); break; } @@ -1276,7 +1340,7 @@ rvGEWorkspace::ZoomIn Zooms the workspace in by one zoom level ================ */ -rvGEWorkspace::EZoomLevel rvGEWorkspace::ZoomIn( void ) +rvGEWorkspace::EZoomLevel rvGEWorkspace::ZoomIn() { mZoom = mZoom + 1; if( mZoom >= ZOOM_MAX ) @@ -1299,7 +1363,7 @@ rvGEWorkspace::ZoomOut Zooms the workspace out by one level ================ */ -rvGEWorkspace::EZoomLevel rvGEWorkspace::ZoomOut( void ) +rvGEWorkspace::EZoomLevel rvGEWorkspace::ZoomOut() { mZoom--; if( mZoom <= ZOOM_MIN ) @@ -1459,7 +1523,7 @@ bool rvGEWorkspace::ShowAllEnumProc( rvGEWindowWrapper* wrapper, void* data ) return true; } -void rvGEWorkspace::AddModifierShowAll( void ) +void rvGEWorkspace::AddModifierShowAll() { rvGEModifierGroup* group = new rvGEModifierGroup; @@ -1477,11 +1541,12 @@ void rvGEWorkspace::AddModifierShowAll( void ) mApplication->GetNavigator().Refresh( ); } -void rvGEWorkspace::DeleteSelected( void ) +void rvGEWorkspace::DeleteSelected() { AddModifiers( MOD_DELETE ); mSelections.Clear( ); mApplication->GetNavigator().Update( ); + mApplication->GetItemProperties().Update(); } /* @@ -1520,6 +1585,9 @@ idWindow* rvGEWorkspace::NewWindow( idDict* state, rvGEWindowWrapper::EWindowTyp window = new idEditWindow( mInterface->GetDesktop()->GetDC(), mInterface ); break; + case rvGEWindowWrapper::WT_LIST: + window = new idListWindow( mInterface->GetDesktop()->GetDC(), mInterface ); + break; default: assert( false ); return NULL; @@ -1537,7 +1605,11 @@ idWindow* rvGEWorkspace::NewWindow( idDict* state, rvGEWindowWrapper::EWindowTyp drawWin_t* dw = mInterface->GetDesktop()->FindChildByName( va( "%s%d", baseName.c_str(), count ) ); if( !dw ) { - break; + dw = mInterface->GetDesktop()->FindChildByName( va( "%s_%d", baseName.c_str(), count ) ); + if( !dw ) + { + break; + } } assert( dw->win ); wrapper = rvGEWindowWrapper::GetWrapper( dw->win ); @@ -1554,7 +1626,7 @@ idWindow* rvGEWorkspace::NewWindow( idDict* state, rvGEWindowWrapper::EWindowTyp if( count ) { - winName = va( "%s%d", baseName.c_str(), count ); + winName = va( "%s_%d", baseName.c_str(), count ); } else { @@ -1598,61 +1670,55 @@ idWindow* rvGEWorkspace::AddWindow( rvGEWindowWrapper::EWindowType type ) mApplication->GetNavigator().Update( ); mApplication->GetTransformer().Update( ); mApplication->GetProperties().Update( ); + mApplication->GetItemProperties().Update( ); + GEItescriptsDlg_Init( mApplication->GetScriptWindow() ); return window; } -bool rvGEWorkspace::EditSelectedProperties( void ) +bool rvGEWorkspace::EditSelectedProperties() { if( !mSelections.Num( ) || mSelections.Num() > 1 ) { return false; } - idDict dict; - if( GEItemPropsDlg_DoModal( mWnd, mSelections[0], dict ) ) - { - mModifiers.Append( new rvGEStateModifier( "Item Properties", mSelections[0], dict ) ); - SetModified( true ); - } - - mApplication->GetNavigator().Update( ); - mApplication->GetTransformer().Update( ); - mApplication->GetProperties().Update( ); + SendMessage( gApp.GetMDIFrame(), WM_COMMAND, MAKELONG( ID_GUIED_WINDOW_SHOWITEMPROPERTIES, 0 ), 0 ); return true; } -bool rvGEWorkspace::EditSelectedScripts( void ) +bool rvGEWorkspace::EditSelectedScripts() { - if( GEItemScriptsDlg_DoModal( mWnd, mSelections[0] ) ) + if( !mSelections.Num() || mSelections.Num() > 1 ) { - gApp.GetNavigator().Refresh( ); - SetModified( true ); + return false; } + SendMessage( gApp.GetMDIFrame(), WM_COMMAND, MAKELONG( ID_GUIED_WINDOW_SHOWSCRIPTS, 0 ), 0 ); + return true; } -void rvGEWorkspace::BringSelectedForward( void ) +void rvGEWorkspace::BringSelectedForward() { AddModifiers( MOD_BRING_FORWARD ); mApplication->GetNavigator().Update( ); } -void rvGEWorkspace::BringSelectedToFront( void ) +void rvGEWorkspace::BringSelectedToFront() { AddModifiers( MOD_BRING_FRONT ); mApplication->GetNavigator().Update( ); } -void rvGEWorkspace::SendSelectedToBack( void ) +void rvGEWorkspace::SendSelectedToBack() { AddModifiers( MOD_SEND_BACK ); mApplication->GetNavigator().Update( ); } -void rvGEWorkspace::SendSelectedBackward( void ) +void rvGEWorkspace::SendSelectedBackward() { AddModifiers( MOD_SEND_BACKWARD ); mApplication->GetNavigator().Update( ); @@ -1939,7 +2005,7 @@ rvGEWorkspace::MakeSelectedAChild Makes the selected windows a child of the first selected window ================ */ -void rvGEWorkspace::MakeSelectedAChild( void ) +void rvGEWorkspace::MakeSelectedAChild() { rvGEModifierGroup* group; int i; @@ -1975,7 +2041,7 @@ void rvGEWorkspace::MakeSelectedAChild( void ) SetModified( true ); } -void rvGEWorkspace::Copy( void ) +void rvGEWorkspace::Copy() { int i; @@ -2003,6 +2069,98 @@ void rvGEWorkspace::Copy( void ) } } +rvGEClipboardItem* rvGEWorkspace::CreateClipboardItem( idWindow* window ) +{ + rvGEWindowWrapper* wrapper = rvGEWindowWrapper::GetWrapper( window ); + + if( wrapper ) + { + rvGEClipboardItem* item = new rvGEClipboardItem; + item->mStateDict = wrapper->GetStateDict(); + item->mScriptDict = wrapper->GetScriptDict(); + item->mVarDict = wrapper->GetVariableDict(); + + item->mStateDict.Set( "windowType", rvGEWindowWrapper::WindowTypeToString( wrapper->GetWindowType() ) ); + + for( int i = 0; i < window->GetChildCount(); ++i ) + { + rvGEClipboardItem* childItem = CreateClipboardItem( window->GetChild( i ) ); + if( childItem != 0 ) + { + item->mChildren.Append( childItem ); + } + } + + return item; + } + + return 0; +} + +void rvGEWorkspace::Duplicate( void ) +{ + int i; + + // Clear the current clipboard + for( i = 0; i < mClipboard.Num(); i++ ) + { + delete mClipboard[i]; + } + + mClipboard.Clear(); + + idList insertIndices; + for( i = 0; i < mSelections.Num(); i++ ) + { + rvGEClipboardItem* item = CreateClipboardItem( mSelections[i] ); + mClipboard.Append( item ); + } + + rvGEModifierGroup* group = new rvGEModifierGroup; + + for( i = 0; i < mClipboard.Num(); i++ ) + { + PasteClipboardItem( mClipboard[i], mSelections[i]->GetParent() == 0 ? mInterface->GetDesktop() : mSelections[i]->GetParent(), group, mSelections[i] ); + } + + //mSelections.Clear(); + + //mSelections.Add(group->GetWindow()); + + mModifiers.Append( group ); + + mApplication->GetNavigator().Update(); + + SetModified( true ); +} + +void rvGEWorkspace::PasteClipboardItem( rvGEClipboardItem* item, idWindow* parent, rvGEModifierGroup* group, idWindow* before ) +{ + idDict state; + rvGEWindowWrapper::EWindowType type; + + state.Copy( item->mStateDict ); + type = rvGEWindowWrapper::StringToWindowType( state.GetString( "windowType", "windowDef" ) ); + state.Delete( "windowType" ); + + idWindow* window = NewWindow( &state, type ); + group->Append( new rvGEInsertModifier( "Paste", window, parent, before ) ); + + if( before != 0 ) + { + mSelections.Remove( mSelections[0] ); + mSelections.Add( window ); + } + + rvGEWindowWrapper::GetWrapper( window )->GetScriptDict() = item->mScriptDict; + rvGEWindowWrapper::GetWrapper( window )->GetVariableDict() = item->mVarDict; + + for( int i = 0; i < item->mChildren.Num(); ++i ) + { + PasteClipboardItem( item->mChildren[i], window, group ); + } +} + void rvGEWorkspace::Paste( void ) { int i; @@ -2035,14 +2193,14 @@ void rvGEWorkspace::Paste( void ) SetModified( true ); } -void rvGEWorkspace::HideSelected( void ) +void rvGEWorkspace::HideSelected() { AddModifiers( MOD_HIDE ); mSelections.Clear( ); mApplication->GetNavigator().Refresh( ); } -void rvGEWorkspace::UnhideSelected( void ) +void rvGEWorkspace::UnhideSelected() { AddModifiers( MOD_UNHIDE ); mApplication->GetNavigator().Refresh( ); diff --git a/neo/tools/guied/GEWorkspace.h b/neo/tools/guied/GEWorkspace.h index 7eccc4c..10ff56c 100644 --- a/neo/tools/guied/GEWorkspace.h +++ b/neo/tools/guied/GEWorkspace.h @@ -38,6 +38,7 @@ If you have questions concerning this license or the applicable additional terms #endif // GEMODIFIERSTACK_H_ class rvGEApp; +class rvGEModifierGroup; class rvGEClipboardItem { @@ -46,6 +47,8 @@ class rvGEClipboardItem idDict mStateDict; idDict mScriptDict; idDict mVarDict; + + idList mChildren; }; class rvGEWorkspace @@ -83,46 +86,46 @@ class rvGEWorkspace bool Attach( HWND wnd ); // Detach the workspace from the current win32 window - void Detach( void ); + void Detach(); - bool NewFile( void ); + bool NewFile(); bool LoadFile( const char* filename, idStr* error = NULL ); bool SaveFile( const char* filename ); - const char* GetFilename( void ); + const char* GetFilename(); void Render( HDC hDC ); - rvGEApp* GetApplication( void ); - - void HideSelected( void ); - void UnhideSelected( void ); - void DeleteSelected( void ); - bool EditSelectedProperties( void ); - bool EditSelectedScripts( void ); - void BringSelectedForward( void ); - void BringSelectedToFront( void ); - void SendSelectedBackward( void ); - void SendSelectedToBack( void ); + rvGEApp* GetApplication(); + + void HideSelected(); + void UnhideSelected(); + void DeleteSelected(); + bool EditSelectedProperties(); + bool EditSelectedScripts(); + void BringSelectedForward(); + void BringSelectedToFront(); + void SendSelectedBackward(); + void SendSelectedToBack(); void AlignSelected( EItemAlign align ); void MakeSelectedSameSize( bool width, bool height ); - void MakeSelectedAChild( void ); + void MakeSelectedAChild(); - bool CanHide( void ); - void ShowHidden( void ); + bool CanHide(); + void ShowHidden(); void HideWindow( idWindow* window ); void UnhideWindow( idWindow* window ); - EZoomLevel ZoomIn( void ); - EZoomLevel ZoomOut( void ); - EZoomLevel GetZoom( void ); - float GetZoomScale( void ); + EZoomLevel ZoomIn(); + EZoomLevel ZoomOut(); + EZoomLevel GetZoom(); + float GetZoomScale(); static rvGEWorkspace* GetWorkspace( HWND wnd ); - rvGEModifierStack& GetModifierStack( void ); - idUserInterfaceLocal* GetInterface( void ); - rvGESelectionMgr& GetSelectionMgr( void ); - idList GetClipboard( void ); - HWND GetWindow( void ); + rvGEModifierStack& GetModifierStack(); + idUserInterfaceLocal* GetInterface(); + rvGESelectionMgr& GetSelectionMgr(); + idList GetClipboard(); + HWND GetWindow(); void HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ); @@ -131,14 +134,15 @@ class rvGEWorkspace idRectangle& WindowToWorkspace( idRectangle& rect ); idRectangle& WorkspaceToWindow( idRectangle& rect ); - bool IsModified( void ); - bool IsNew( void ); + bool IsModified(); + bool IsNew(); idWindow* AddWindow( rvGEWindowWrapper::EWindowType type ); -// void Cut ( void ); - void Copy( void ); - void Paste( void ); +// void Cut (); + void Duplicate( void ); + void Copy(); + void Paste(); void AddModifierMove( const char* modName, float x, float y, bool snap ); void AddModifierSize( const char* modName, float l, float t, float r, float b, bool snap ); @@ -160,11 +164,11 @@ class rvGEWorkspace MOD_BRING_FRONT, }; - bool SetupPixelFormat( void ); - void UpdateSelections( void ); + bool SetupPixelFormat(); + void UpdateSelections(); // Additional rendering routines - void RenderGrid( void ); + void RenderGrid(); // File related methods void WriteTabs( idFile* file, int depth ); @@ -183,19 +187,19 @@ class rvGEWorkspace int HandleCommand( WPARAM wParam, LPARAM lParam ); // General protected functions - void UpdateScrollbars( void ); + void UpdateScrollbars(); void UpdateRectangle( bool useScroll = true ); - void UpdateCursor( void ); + void UpdateCursor(); void UpdateCursor( float x, float y ); void UpdateCursor( rvGESelectionMgr::EHitTest type ); - void UpdateTitle( void ); + void UpdateTitle(); idWindow* NewWindow( idDict* state, rvGEWindowWrapper::EWindowType type ); void Scroll( int scrollbar, int offset ); // Modifier methods void AddModifierMoveNudge( float x, float y, bool snap ); void AddModifierSizeNudge( float w, float h, bool snap ); - void AddModifierShowAll( void ); + void AddModifierShowAll(); void AddModifiers( EModifierType type, ... ); void AddModifiers( idWindow* window, EModifierType type, ... ); @@ -233,6 +237,9 @@ class rvGEWorkspace private: + void PasteClipboardItem( rvGEClipboardItem* item, idWindow* parent, rvGEModifierGroup* group, idWindow* before = NULL ); + static rvGEClipboardItem* CreateClipboardItem( idWindow* window ); + static bool CleanupEnumProc( rvGEWindowWrapper* wrapper, void* data ); static bool ShowAllEnumProc( rvGEWindowWrapper* wrapper, void* data ); static bool BuildSelectMenuEnumProc( rvGEWindowWrapper* wrapper, void* data ); @@ -241,12 +248,13 @@ class rvGEWorkspace bool mModified; bool mNew; bool mDontAdd; + bool mWasDuplicate; // Resources HCURSOR mHandCursor; }; -ID_INLINE rvGEWorkspace::EZoomLevel rvGEWorkspace::GetZoom( void ) +ID_INLINE rvGEWorkspace::EZoomLevel rvGEWorkspace::GetZoom() { return ( EZoomLevel )mZoom; } @@ -256,32 +264,32 @@ ID_INLINE rvGEWorkspace* rvGEWorkspace::GetWorkspace( HWND wnd ) return ( rvGEWorkspace* ) GetWindowLongPtr( wnd, GWLP_USERDATA ); } -ID_INLINE const char* rvGEWorkspace::GetFilename( void ) +ID_INLINE const char* rvGEWorkspace::GetFilename() { return mFilename; } -ID_INLINE bool rvGEWorkspace::IsModified( void ) +ID_INLINE bool rvGEWorkspace::IsModified() { return mModified; } -ID_INLINE bool rvGEWorkspace::IsNew( void ) +ID_INLINE bool rvGEWorkspace::IsNew() { return mNew; } -ID_INLINE rvGEModifierStack& rvGEWorkspace::GetModifierStack( void ) +ID_INLINE rvGEModifierStack& rvGEWorkspace::GetModifierStack() { return mModifiers; } -ID_INLINE rvGESelectionMgr& rvGEWorkspace::GetSelectionMgr( void ) +ID_INLINE rvGESelectionMgr& rvGEWorkspace::GetSelectionMgr() { return mSelections; } -ID_INLINE void rvGEWorkspace::ShowHidden( void ) +ID_INLINE void rvGEWorkspace::ShowHidden() { AddModifierShowAll( ); } @@ -296,22 +304,22 @@ ID_INLINE void rvGEWorkspace::AddModifierSizeNudge( float w, float h, bool snap AddModifierSize( "Nudge Size", 0, 0, w, h, snap ); } -ID_INLINE idUserInterfaceLocal* rvGEWorkspace::GetInterface( void ) +ID_INLINE idUserInterfaceLocal* rvGEWorkspace::GetInterface() { return mInterface; } -ID_INLINE rvGEApp* rvGEWorkspace::GetApplication( void ) +ID_INLINE rvGEApp* rvGEWorkspace::GetApplication() { return mApplication; } -ID_INLINE HWND rvGEWorkspace::GetWindow( void ) +ID_INLINE HWND rvGEWorkspace::GetWindow() { return mWnd; } -ID_INLINE idList rvGEWorkspace::GetClipboard( void ) +ID_INLINE idList rvGEWorkspace::GetClipboard() { return mClipboard; } diff --git a/neo/tools/guied/GEWorkspaceFile.cpp b/neo/tools/guied/GEWorkspaceFile.cpp index 8f9ff5b..bd37e52 100644 --- a/neo/tools/guied/GEWorkspaceFile.cpp +++ b/neo/tools/guied/GEWorkspaceFile.cpp @@ -239,7 +239,7 @@ rvGEWorkspace::NewFile Opens a new file for editing ================ */ -bool rvGEWorkspace::NewFile( void ) +bool rvGEWorkspace::NewFile() { idStr empty; idStr ospath; diff --git a/neo/tools/guied/GEZOrderModifier.cpp b/neo/tools/guied/GEZOrderModifier.cpp index 7355ded..24c1a89 100644 --- a/neo/tools/guied/GEZOrderModifier.cpp +++ b/neo/tools/guied/GEZOrderModifier.cpp @@ -94,7 +94,7 @@ rvGEZOrderModifier::rvGEZOrderModifier( const char* name, idWindow* window, EZOr } } -bool rvGEZOrderModifier::Apply( void ) +bool rvGEZOrderModifier::Apply() { idWindow* parent; @@ -106,7 +106,7 @@ bool rvGEZOrderModifier::Apply( void ) return true; } -bool rvGEZOrderModifier::Undo( void ) +bool rvGEZOrderModifier::Undo() { idWindow* parent; @@ -118,7 +118,7 @@ bool rvGEZOrderModifier::Undo( void ) return true; } -bool rvGEZOrderModifier::IsValid( void ) +bool rvGEZOrderModifier::IsValid() { if( !mWindow->GetParent( ) ) { diff --git a/neo/tools/guied/GEZOrderModifier.h b/neo/tools/guied/GEZOrderModifier.h index dff4c38..98267b9 100644 --- a/neo/tools/guied/GEZOrderModifier.h +++ b/neo/tools/guied/GEZOrderModifier.h @@ -46,9 +46,9 @@ class rvGEZOrderModifier : public rvGEModifier rvGEZOrderModifier( const char* name, idWindow* window, EZOrderChange change ); - virtual bool Apply( void ); - virtual bool Undo( void ); - virtual bool IsValid( void ); + virtual bool Apply(); + virtual bool Undo(); + virtual bool IsValid(); protected: diff --git a/neo/tools/guied/guied.cpp b/neo/tools/guied/guied.cpp index a9d6935..ba7add9 100644 --- a/neo/tools/guied/guied.cpp +++ b/neo/tools/guied/guied.cpp @@ -46,8 +46,10 @@ GUIEditorInit Start the gui editor ================ */ -void GUIEditorInit( void ) +void GUIEditorInit() { + InitAfx(); + gApp.Initialize(); } @@ -56,7 +58,7 @@ void GUIEditorInit( void ) GUIEditorShutdown ================ */ -void GUIEditorShutdown( void ) +void GUIEditorShutdown() { } diff --git a/neo/tools/materialeditor/MEOptions.cpp b/neo/tools/materialeditor/MEOptions.cpp index 11cc8c0..f5aa184 100644 --- a/neo/tools/materialeditor/MEOptions.cpp +++ b/neo/tools/materialeditor/MEOptions.cpp @@ -57,7 +57,7 @@ MEOptions::~MEOptions() /** * Saves the material editor options to the registry. */ -bool MEOptions::Save( void ) +bool MEOptions::Save() { registry.SetFloat( "materialTreeWidth", materialTreeWidth ); @@ -73,7 +73,7 @@ bool MEOptions::Save( void ) /** * Loads the material editor options from the registry. */ -bool MEOptions::Load( void ) +bool MEOptions::Load() { if( !registry.Load() ) diff --git a/neo/tools/materialeditor/MEOptions.h b/neo/tools/materialeditor/MEOptions.h index a88d4fa..34e0e84 100644 --- a/neo/tools/materialeditor/MEOptions.h +++ b/neo/tools/materialeditor/MEOptions.h @@ -41,8 +41,8 @@ class MEOptions MEOptions(); ~MEOptions(); - bool Save( void ); - bool Load( void ); + bool Save(); + bool Load(); /** * Sets the flag that determines if the settings need to be saved because diff --git a/neo/tools/materialeditor/MaterialDef.cpp b/neo/tools/materialeditor/MaterialDef.cpp index 17fc6da..01e216f 100644 --- a/neo/tools/materialeditor/MaterialDef.cpp +++ b/neo/tools/materialeditor/MaterialDef.cpp @@ -34,7 +34,7 @@ If you have questions concerning this license or the applicable additional terms /** * Constructor. */ -MaterialDef::MaterialDef( void ) +MaterialDef::MaterialDef() { type = 0; quotes = false; @@ -43,7 +43,7 @@ MaterialDef::MaterialDef( void ) /** * Destructor. */ -MaterialDef::~MaterialDef( void ) +MaterialDef::~MaterialDef() { } diff --git a/neo/tools/materialeditor/MaterialDef.h b/neo/tools/materialeditor/MaterialDef.h index 34f6da5..c3dbbb3 100644 --- a/neo/tools/materialeditor/MaterialDef.h +++ b/neo/tools/materialeditor/MaterialDef.h @@ -58,8 +58,8 @@ class MaterialDef public: - MaterialDef( void ); - virtual ~MaterialDef( void ); + MaterialDef(); + virtual ~MaterialDef(); DWORD GetViewData( const char* viewName ); void SetViewData( const char* viewName, DWORD value ); diff --git a/neo/tools/materialeditor/MaterialDoc.cpp b/neo/tools/materialeditor/MaterialDoc.cpp index c51cbd9..f479108 100644 --- a/neo/tools/materialeditor/MaterialDoc.cpp +++ b/neo/tools/materialeditor/MaterialDoc.cpp @@ -34,7 +34,7 @@ If you have questions concerning this license or the applicable additional terms /** * Constructor for MaterialDoc. */ -MaterialDoc::MaterialDoc( void ) +MaterialDoc::MaterialDoc() { modified = false; applyWaiting = false; @@ -44,7 +44,7 @@ MaterialDoc::MaterialDoc( void ) /** * Destructor for MaterialDoc. */ -MaterialDoc::~MaterialDoc( void ) +MaterialDoc::~MaterialDoc() { ClearEditMaterial(); } @@ -707,7 +707,7 @@ void MaterialDoc::Save() } else { - MessageBox( GetMaterialEditorWindow(), va( "Unable to save '%s'. It may be read-only", name.c_str() ), "Save Error", MB_OK | MB_ICONERROR ); + MessageBoxA( GetMaterialEditorWindow(), va( "Unable to save '%s'. It may be read-only", name.c_str() ), "Save Error", MB_OK | MB_ICONERROR ); } } diff --git a/neo/tools/materialeditor/MaterialDoc.h b/neo/tools/materialeditor/MaterialDoc.h index 35986cc..ca25f45 100644 --- a/neo/tools/materialeditor/MaterialDoc.h +++ b/neo/tools/materialeditor/MaterialDoc.h @@ -87,8 +87,8 @@ class MaterialDoc SourceModifyOwner* sourceModifyOwner; public: - MaterialDoc( void ); - ~MaterialDoc( void ); + MaterialDoc(); + ~MaterialDoc(); /** * Define the types of stages in a material. diff --git a/neo/tools/materialeditor/MaterialDocManager.cpp b/neo/tools/materialeditor/MaterialDocManager.cpp index 2473e73..2b2a4d6 100644 --- a/neo/tools/materialeditor/MaterialDocManager.cpp +++ b/neo/tools/materialeditor/MaterialDocManager.cpp @@ -36,7 +36,7 @@ If you have questions concerning this license or the applicable additional terms /** * Constructor for MaterialDocManager. */ -MaterialDocManager::MaterialDocManager( void ) +MaterialDocManager::MaterialDocManager() { currentMaterial = NULL; cutMaterial = false; @@ -45,7 +45,7 @@ MaterialDocManager::MaterialDocManager( void ) /** * Destructor for MaterialDocManager. */ -MaterialDocManager::~MaterialDocManager( void ) +MaterialDocManager::~MaterialDocManager() { UnRegisterAllMaterialViews(); diff --git a/neo/tools/materialeditor/MaterialDocManager.h b/neo/tools/materialeditor/MaterialDocManager.h index d23b698..fca7012 100644 --- a/neo/tools/materialeditor/MaterialDocManager.h +++ b/neo/tools/materialeditor/MaterialDocManager.h @@ -42,8 +42,8 @@ class MaterialDocManager { public: - MaterialDocManager( void ); - ~MaterialDocManager( void ); + MaterialDocManager(); + ~MaterialDocManager(); //Reg/UnReg Material Views void RegisterMaterialView( MaterialView* view ); diff --git a/neo/tools/materialeditor/MaterialEditor.cpp b/neo/tools/materialeditor/MaterialEditor.cpp index b838c0c..7e6a02b 100644 --- a/neo/tools/materialeditor/MaterialEditor.cpp +++ b/neo/tools/materialeditor/MaterialEditor.cpp @@ -44,7 +44,7 @@ CFont* materialEditorFont = NULL; /** * Initializes the material editor tool. */ -void MaterialEditorInit( void ) +void MaterialEditorInit() { InitPropTree( win32.hInstance ); @@ -104,7 +104,7 @@ void MaterialEditorInit( void ) /** * Called every frame by the doom engine to allow the material editor to process messages. */ -void MaterialEditorRun( void ) +void MaterialEditorRun() { MSG* msg = AfxGetCurrentMessage(); @@ -121,7 +121,7 @@ void MaterialEditorRun( void ) /** * Called by the doom engine when the material editor needs to be destroyed. */ -void MaterialEditorShutdown( void ) +void MaterialEditorShutdown() { delete meMainFrame; diff --git a/neo/tools/materialeditor/MaterialPreviewPropView.cpp b/neo/tools/materialeditor/MaterialPreviewPropView.cpp index 0536920..494b2a7 100644 --- a/neo/tools/materialeditor/MaterialPreviewPropView.cpp +++ b/neo/tools/materialeditor/MaterialPreviewPropView.cpp @@ -53,7 +53,7 @@ BEGIN_MESSAGE_MAP( MaterialPreviewPropView, CPropTreeView ) END_MESSAGE_MAP() -void MaterialPreviewPropView::AddLight( void ) +void MaterialPreviewPropView::AddLight() { int i, count, lightShaderIndex = 0; const idMaterial* mat; @@ -125,7 +125,7 @@ void MaterialPreviewPropView::AddLight( void ) } //Create sample data for the preview properties -void MaterialPreviewPropView::InitializePropTree( void ) +void MaterialPreviewPropView::InitializePropTree() { int i; CPropTreeItem* pRoot; diff --git a/neo/tools/materialeditor/MaterialPreviewPropView.h b/neo/tools/materialeditor/MaterialPreviewPropView.h index 9fe483f..e76094b 100644 --- a/neo/tools/materialeditor/MaterialPreviewPropView.h +++ b/neo/tools/materialeditor/MaterialPreviewPropView.h @@ -51,8 +51,8 @@ class MaterialPreviewPropView : public CPropTreeView virtual void Dump( CDumpContext& dc ) const; #endif - void AddLight( void ); - void InitializePropTree( void ); + void AddLight(); + void InitializePropTree(); void RegisterPreviewView( MaterialPreviewView* view ); diff --git a/neo/tools/materialeditor/MaterialPreviewView.cpp b/neo/tools/materialeditor/MaterialPreviewView.cpp index 0db021a..9c99c21 100644 --- a/neo/tools/materialeditor/MaterialPreviewView.cpp +++ b/neo/tools/materialeditor/MaterialPreviewView.cpp @@ -161,7 +161,7 @@ void MaterialPreviewView::OnLightAllowMoveChange( int lightId, bool move ) renderedView.setLightAllowMove( lightId, move ); } -void MaterialPreviewView::OnAddLight( void ) +void MaterialPreviewView::OnAddLight() { renderedView.addLight(); @@ -224,7 +224,7 @@ idGLDrawableView::~idGLDrawableView() delete worldModel; } -void idGLDrawableView::ResetView( void ) +void idGLDrawableView::ResetView() { idDict spawnArgs; @@ -404,7 +404,7 @@ void idGLDrawableView::mouseMove( float x, float y ) } } -void idGLDrawableView::addLight( void ) +void idGLDrawableView::addLight() { int lightId; idStr str; @@ -462,7 +462,7 @@ void idGLDrawableView::UpdateCamera( renderView_t* refdef ) } -void idGLDrawableView::UpdateModel( void ) +void idGLDrawableView::UpdateModel() { switch( objectId ) @@ -511,7 +511,7 @@ void idGLDrawableView::UpdateModel( void ) world->UpdateEntityDef( modelDefHandle, &worldEntity ); } -void idGLDrawableView::UpdateLights( void ) +void idGLDrawableView::UpdateLights() { int i; diff --git a/neo/tools/materialeditor/MaterialPreviewView.h b/neo/tools/materialeditor/MaterialPreviewView.h index cadafbd..72596bf 100644 --- a/neo/tools/materialeditor/MaterialPreviewView.h +++ b/neo/tools/materialeditor/MaterialPreviewView.h @@ -46,15 +46,15 @@ class idGLDrawableView : public idGLDrawable virtual void Update() {}; void UpdateCamera( renderView_t* refdef ); - void UpdateModel( void ); - void UpdateLights( void ); + void UpdateModel(); + void UpdateLights(); - void addLight( void ); + void addLight(); void deleteLight( const int lightId ); void drawLights( renderView_t* refdef ); void InitWorld(); - void ResetView( void ); + void ResetView(); void setLightShader( const int lightId, const idStr shaderName ); void setLightColor( const int lightId, const idVec3& value ); @@ -128,7 +128,7 @@ class MaterialPreviewView : public CView, public MaterialView void OnLightColorChange( int lightId, idVec3& color ); void OnLightAllowMoveChange( int lightId, bool move ); - void OnAddLight( void ); + void OnAddLight(); void OnDeleteLight( int lightId ); #ifdef _DEBUG diff --git a/neo/tools/materialeditor/MaterialView.h b/neo/tools/materialeditor/MaterialView.h index 2270160..940c55d 100644 --- a/neo/tools/materialeditor/MaterialView.h +++ b/neo/tools/materialeditor/MaterialView.h @@ -41,14 +41,14 @@ class MaterialView /** * Constructor. */ - MaterialView( void ) + MaterialView() { materialDocManager = NULL; }; /** * Destructor. */ - virtual ~MaterialView( void ) {}; + virtual ~MaterialView() {}; ////////////////////////////////////////////////////////////////////////// //Public Interface to be implemented by subclasses diff --git a/neo/tools/materialeditor/ToggleListView.cpp b/neo/tools/materialeditor/ToggleListView.cpp index 1f72fcc..461ce71 100644 --- a/neo/tools/materialeditor/ToggleListView.cpp +++ b/neo/tools/materialeditor/ToggleListView.cpp @@ -315,7 +315,7 @@ void ToggleListView::DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct ) int colorIndex = ( ( lpDrawItemStruct->itemState & ODS_SELECTED ) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT ); SetTextColor( lpDrawItemStruct->hDC, GetSysColor( colorIndex ) ); - DrawText( lpDrawItemStruct->hDC, szBuff, strlen( szBuff ), &rDraw, DT_LEFT | DT_VCENTER | DT_SINGLELINE ); + DrawTextA( lpDrawItemStruct->hDC, szBuff, strlen( szBuff ), &rDraw, DT_LEFT | DT_VCENTER | DT_SINGLELINE ); } diff --git a/neo/tools/particle/DialogParticleEditor.cpp b/neo/tools/particle/DialogParticleEditor.cpp index fb445cb..df3161b 100644 --- a/neo/tools/particle/DialogParticleEditor.cpp +++ b/neo/tools/particle/DialogParticleEditor.cpp @@ -185,7 +185,7 @@ void ParticleEditorInit( const idDict* spawnArgs ) ParticleEditorRun ================ */ -void ParticleEditorRun( void ) +void ParticleEditorRun() { #if _MSC_VER >= 1300 MSG* msg = AfxGetCurrentMessage(); // TODO Robert fix me!! @@ -207,7 +207,7 @@ void ParticleEditorRun( void ) ParticleEditorShutdown ================ */ -void ParticleEditorShutdown( void ) +void ParticleEditorShutdown() { delete g_ParticleDialog; g_ParticleDialog = NULL; diff --git a/neo/tools/radiant/CSG.cpp b/neo/tools/radiant/CSG.cpp index ef1ab1a..e703cf7 100644 --- a/neo/tools/radiant/CSG.cpp +++ b/neo/tools/radiant/CSG.cpp @@ -38,7 +38,7 @@ const float PLANE_EPSILON = 0.0001f; CSG_MakeHollow ============= */ -void CSG_MakeHollow( void ) +void CSG_MakeHollow() { idEditorBrush* b, *front, *back, *next; face_t* f; @@ -555,7 +555,7 @@ idEditorBrush* Brush_Subtract( idEditorBrush* a, idEditorBrush* b ) CSG_Subtract ============= */ -void CSG_Subtract( void ) +void CSG_Subtract() { idEditorBrush* b, *s, *fragments, *nextfragment, *frag, *next, *snext; idEditorBrush fragmentlist; @@ -697,7 +697,7 @@ void CSG_Subtract( void ) CSG_Merge ============= */ -void CSG_Merge( void ) +void CSG_Merge() { idEditorBrush* b, *next, *newlist, *newbrush; idEditorEntity* owner; diff --git a/neo/tools/radiant/CamWnd.cpp b/neo/tools/radiant/CamWnd.cpp index 8d7b3e2..26f8e43 100644 --- a/neo/tools/radiant/CamWnd.cpp +++ b/neo/tools/radiant/CamWnd.cpp @@ -1525,281 +1525,6 @@ void Tris_ToOBJ( const char* outFile, idTriList* tris, idMatList* mats ) } } -/* -================== -idEditorBrushransformModel -================== -*/ -int idEditorBrushransformModel( idEditorBrush* brush, idTriList* tris, idMatList* mats ) -{ - int ret = 0; - if( brush->modelHandle > 0 ) - { - idRenderModel* model = brush->modelHandle; - if( model ) - { - float a = brush->owner->FloatForKey( "angle" ); - float s = 0.0f, c = 0.0f; - //FIXME: support full rotation matrix - bool matrix = false; - if( a ) - { - s = sin( DEG2RAD( a ) ); - c = cos( DEG2RAD( a ) ); - } - idMat3 mat; - if( brush->owner->GetMatrixForKey( "rotation", mat ) ) - { - matrix = true; - } - - - for( int i = 0; i < model->NumSurfaces() ; i++ ) - { - const modelSurface_t* surf = model->Surface( i ); - srfTriangles_t* tri = surf->geometry; - srfTriangles_t* tri2 = R_CopyStaticTriSurf( tri ); - for( int j = 0; j < tri2->numVerts; j++ ) - { - idVec3 v; - if( matrix ) - { - v = tri2->verts[j].xyz * brush->owner->rotation + brush->owner->origin; - } - else - { - v = tri2->verts[j].xyz; - VectorAdd( v, brush->owner->origin, v ); - float x = v[0]; - float y = v[1]; - if( a ) - { - float x2 = ( ( ( x - brush->owner->origin[0] ) * c ) - ( ( y - brush->owner->origin[1] ) * s ) ) + brush->owner->origin[0]; - float y2 = ( ( ( x - brush->owner->origin[0] ) * s ) + ( ( y - brush->owner->origin[1] ) * c ) ) + brush->owner->origin[1]; - x = x2; - y = y2; - } - v[0] = x; - v[1] = y; - } - tri2->verts[j].xyz = v; - } - tris->Append( tri2 ); - mats->Append( surf->shader ); - } - return model->NumSurfaces(); - } - } - return ret; -} - - -#define MAX_TRI_SURFACES 16384 - -/* -================== -idEditorBrushoTris -================== -*/ -int idEditorBrushoTris( idEditorBrush* brush, idTriList* tris, idMatList* mats, bool models, bool bmodel ) -{ - int i, j; - srfTriangles_t* tri; - // - // patches - // - if( brush->modelHandle > 0 ) - { - if( !models ) - { - return 0; - } - else - { - return idEditorBrushransformModel( brush, tris, mats ); - } - } - - int numSurfaces = 0; - - if( brush->owner->eclass->fixedsize && !brush->entityModel ) - { - return NULL; - } - - if( brush->pPatch ) - { - patchMesh_t* pm; - int width, height; - - pm = brush->pPatch; - - // build a patch mesh - idSurface_Patch* cp = new idSurface_Patch( pm->width * 6, pm->height * 6 ); - cp->SetSize( pm->width, pm->height ); - for( i = 0; i < pm->width; i++ ) - { - for( j = 0; j < pm->height; j++ ) - { - ( *cp )[j * cp->GetWidth() + i].xyz = pm->ctrl( i, j ).xyz; - ( *cp )[j * cp->GetWidth() + i].st = pm->ctrl( i, j ).st; - } - } - - // subdivide it - if( pm->explicitSubdivisions ) - { - cp->SubdivideExplicit( pm->horzSubdivisions, pm->vertSubdivisions, true ); - } - else - { - cp->Subdivide( DEFAULT_CURVE_MAX_ERROR, DEFAULT_CURVE_MAX_ERROR, DEFAULT_CURVE_MAX_LENGTH, true ); - } - width = cp->GetWidth(); - height = cp->GetHeight(); - - // convert to srfTriangles - tri = R_AllocStaticTriSurf(); - tri->numVerts = width * height; - tri->numIndexes = 6 * ( width - 1 ) * ( height - 1 ); - R_AllocStaticTriSurfVerts( tri, tri->numVerts ); - R_AllocStaticTriSurfIndexes( tri, tri->numIndexes ); - for( i = 0 ; i < tri->numVerts ; i++ ) - { - tri->verts[i] = ( *cp )[i]; - if( bmodel ) - { - tri->verts[i].xyz -= brush->owner->origin; - } - } - - tri->numIndexes = 0; - for( i = 1 ; i < width ; i++ ) - { - for( j = 1 ; j < height ; j++ ) - { - tri->indexes[tri->numIndexes++] = ( j - 1 ) * width + i; - tri->indexes[tri->numIndexes++] = ( j - 1 ) * width + i - 1; - tri->indexes[tri->numIndexes++] = j * width + i - 1; - - tri->indexes[tri->numIndexes++] = j * width + i; - tri->indexes[tri->numIndexes++] = ( j - 1 ) * width + i; - tri->indexes[tri->numIndexes++] = j * width + i - 1; - } - } - - delete cp; - - tris->Append( tri ); - mats->Append( pm->d_texture ); - //surfaces[numSurfaces] = tri; - //materials[numSurfaces] = pm->d_texture; - return 1; - } - - // - // normal brush - // - for( face_t* face = brush->brush_faces ; face; face = face->next ) - { - idWinding* w; - - w = face->face_winding; - if( !w ) - { - continue; // freed or degenerate face - } - - tri = R_AllocStaticTriSurf(); - tri->numVerts = w->GetNumPoints(); - tri->numIndexes = ( w->GetNumPoints() - 2 ) * 3; - R_AllocStaticTriSurfVerts( tri, tri->numVerts ); - R_AllocStaticTriSurfIndexes( tri, tri->numIndexes ); - - for( i = 0 ; i < tri->numVerts ; i++ ) - { - - tri->verts[i].Clear(); - - tri->verts[i].xyz[0] = ( *w )[i][0]; - tri->verts[i].xyz[1] = ( *w )[i][1]; - tri->verts[i].xyz[2] = ( *w )[i][2]; - - if( bmodel ) - { - tri->verts[i].xyz -= brush->owner->origin; - } - - tri->verts[i].st[0] = ( *w )[i][3]; - tri->verts[i].st[1] = ( *w )[i][4]; - - tri->verts[i].normal = face->plane.Normal(); - } - - tri->numIndexes = 0; - for( i = 2 ; i < w->GetNumPoints() ; i++ ) - { - tri->indexes[tri->numIndexes++] = 0; - tri->indexes[tri->numIndexes++] = i - 1; - tri->indexes[tri->numIndexes++] = i; - } - - const idMaterial* material = face->d_texture; - bool found = false; - - for( int j = 0; j < tris->Num(); j++ ) - { - if( ( *mats )[j] == material ) - { - found = true; - srfTriangles_t* existingTri = ( *tris )[j]; - - int startVert = existingTri->numVerts; - int startIndex = existingTri->numIndexes; - - // Allocate new vertices and indexes arrays with increased sizes - int newNumVerts = existingTri->numVerts + tri->numVerts; - int newNumIndexes = existingTri->numIndexes + tri->numIndexes; - - R_ResizeStaticTriSurfVerts( existingTri, newNumVerts ); - R_ResizeStaticTriSurfIndexes( existingTri, newNumIndexes ); - - idDrawVert* newVerts = existingTri->verts; - glIndex_t* newIndexes = existingTri->indexes; - - // Copy new vertices - for( int k = 0; k < tri->numVerts; k++ ) - { - newVerts[startVert + k] = tri->verts[k]; - } - - // Copy new indexes with updated indices - for( int k = 0; k < tri->numIndexes; k++ ) - { - newIndexes[startIndex + k] = tri->indexes[k] + startVert; - } - - // Free the temporary triangle - R_FreeStaticTriSurf( tri ); - - // Update numVerts and numIndexes for the existing triangle(resize above doesn't actually do this). - existingTri->numVerts = newNumVerts; - existingTri->numIndexes = newNumIndexes; - break; - } - } - - if( !found ) - { - tris->Append( tri ); - mats->Append( material ); - numSurfaces++; - } - } - - return numSurfaces; -} - /* ================== Select_ToOBJ @@ -1827,7 +1552,7 @@ void Select_ToOBJ() continue; } - idEditorBrushoTris( b, &tris, &mats, true, false ); + Brush_ToTris( b, &tris, &mats, true, false ); } Tris_ToOBJ( dlgFile.GetPathName().GetBuffer( 0 ), &tris, &mats ); @@ -1937,7 +1662,7 @@ void CCamWnd::BuildRendererState() if( !IsBModel( brush ) ) { - numSurfaces += idEditorBrushoTris( brush, &tris, &mats, false, false ); + numSurfaces += Brush_ToTris( brush, &tris, &mats, false, false ); } // add the surfaces to the renderModel diff --git a/neo/tools/radiant/Drag.cpp b/neo/tools/radiant/Drag.cpp index 20baa73..73cf7ee 100644 --- a/neo/tools/radiant/Drag.cpp +++ b/neo/tools/radiant/Drag.cpp @@ -391,7 +391,7 @@ void Drag_Begin( int x, int y, int buttons, if( t.face ) { g_qeglobals.d_new_brush_bottom = t.brush->mins; - g_qeglobals.d_new_idEditorBrushop = t.brush->maxs; + g_qeglobals.d_new_brush_top = t.brush->maxs; // use a local brushprimit_texdef fitted to a default 2x2 texture brushprimit_texdef_t bp_local; diff --git a/neo/tools/radiant/EClass.cpp b/neo/tools/radiant/EClass.cpp index c4e7135..0439d5d 100644 --- a/neo/tools/radiant/EClass.cpp +++ b/neo/tools/radiant/EClass.cpp @@ -111,7 +111,7 @@ bool LoadModel( const char* pLocation, eclass_t* e, idVec3& vMin, idVec3& vMax, return false; } -eclass_t* EClass_Alloc( void ) +eclass_t* EClass_Alloc() { eclass_t* e = new eclass_t; e->fixedsize = false; diff --git a/neo/tools/radiant/EditViewDlg.cpp b/neo/tools/radiant/EditViewDlg.cpp index 0f66cfc..f2bda38 100644 --- a/neo/tools/radiant/EditViewDlg.cpp +++ b/neo/tools/radiant/EditViewDlg.cpp @@ -124,7 +124,7 @@ void CEditViewDlg::ShowFindDlg() void CEditViewDlg::OnBnClickedButtonOpen() { - CPreviewDlg* dlg = nullptr; + CPreviewDlg* dlg = NULL; dlg = ( ( mode == MATERIALS ) ? CEntityDlg::ShowMaterialChooser() : CEntityDlg::ShowGuiChooser() ); if( dlg ) { @@ -185,7 +185,7 @@ BOOL CEditViewDlg::OnInitDialog() LONG lSize = sizeof( rct ); if( LoadRegistryInfo( "radiant_editviewwindow", &rct, &lSize ) ) { - SetWindowPos( nullptr, rct.left, rct.top, rct.Width(), rct.Height(), SWP_SHOWWINDOW ); + SetWindowPos( NULL, rct.left, rct.top, rct.Width(), rct.Height(), SWP_SHOWWINDOW ); } editInfo.SetTabStops(); @@ -193,7 +193,7 @@ BOOL CEditViewDlg::OnInitDialog() UpdateEditPreview(); - SetTimer( 1, 250, nullptr ); + SetTimer( 1, 250, NULL ); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE @@ -241,7 +241,7 @@ void CEditViewDlg::SetGuiInfo( const char* name ) fileName = ""; line = 0; void* buf; - int size = fileSystem->ReadFile( name, &buf, nullptr ); + int size = fileSystem->ReadFile( name, &buf, NULL ); if( size > 0 ) { fileName = name; @@ -320,14 +320,14 @@ BOOL CEditViewDlg::PreTranslateMessage( MSG* pMsg ) LRESULT CEditViewDlg::OnFindDialogMessage( WPARAM wParam, LPARAM lParam ) { - if( findDlg == nullptr ) + if( findDlg == NULL ) { return 0; } if( findDlg->IsTerminating() ) { - findDlg = nullptr; + findDlg = NULL; return 0; } diff --git a/neo/tools/radiant/EditorBrush.cpp b/neo/tools/radiant/EditorBrush.cpp index ab266d8..f38971f 100644 --- a/neo/tools/radiant/EditorBrush.cpp +++ b/neo/tools/radiant/EditorBrush.cpp @@ -328,7 +328,7 @@ static void SnapVectorToGrid( idVec3& v ) Brush_Alloc ================ */ -idEditorBrush* Brush_Alloc( void ) +idEditorBrush* Brush_Alloc() { idEditorBrush* b = new idEditorBrush; b->prev = b->next = NULL; @@ -499,7 +499,7 @@ float ShadeForNormal( idVec3 normal ) Face_Alloc ================ */ -face_t* Face_Alloc( void ) +face_t* Face_Alloc() { brushprimit_texdef_t bp; @@ -1914,28 +1914,6 @@ idEditorBrush* Brush_Parse( idVec3 origin ) return b; } -/* -================ -QERApp_MapPrintf_FILE - - callback for surface properties plugin must fit a PFN_QERAPP_MAPPRINTF ( see isurfaceplugin.h ) - carefully initialize ! -================ -*/ -FILE* g_File; - -void WINAPI QERApp_MapPrintf_FILE( char* text, ... ) -{ - va_list argptr; - char buf[32768]; - - va_start( argptr, text ); - vsprintf( buf, text, argptr ); - va_end( argptr ); - - fprintf( g_File, buf ); -} - /* ================ Brush_SetEpair @@ -3415,7 +3393,7 @@ extern void UpdateSelectablePoint( idEditorBrush* b, idVec3 v, int type ); /* ================ -idEditorBrushransformedPoint +Brush_TransformedPoint ================ */ @@ -3430,7 +3408,7 @@ idMat3 Brush_RotationMatrix( idEditorBrush* b ) return mat; } -idVec3 idEditorBrushransformedPoint( idEditorBrush* b, const idVec3& in ) +idVec3 Brush_TransformedPoint( idEditorBrush* b, const idVec3& in ) { idVec3 out = in; out -= b->owner->origin; @@ -3518,11 +3496,11 @@ static void Brush_UpdateLightPoints( idEditorBrush* b, const idVec3& offset ) VectorAdd( b->lightTarget, vRight, b->lightRight ); VectorAdd( b->lightTarget, vUp, b->lightUp ); - UpdateSelectablePoint( b, idEditorBrushransformedPoint( b, b->lightUp ), LIGHT_UP ); - UpdateSelectablePoint( b, idEditorBrushransformedPoint( b, b->lightRight ), LIGHT_RIGHT ); - UpdateSelectablePoint( b, idEditorBrushransformedPoint( b, b->lightTarget ), LIGHT_TARGET ); - UpdateSelectablePoint( b, idEditorBrushransformedPoint( b, b->lightStart ), LIGHT_START ); - UpdateSelectablePoint( b, idEditorBrushransformedPoint( b, b->lightEnd ), LIGHT_END ); + UpdateSelectablePoint( b, Brush_TransformedPoint( b, b->lightUp ), LIGHT_UP ); + UpdateSelectablePoint( b, Brush_TransformedPoint( b, b->lightRight ), LIGHT_RIGHT ); + UpdateSelectablePoint( b, Brush_TransformedPoint( b, b->lightTarget ), LIGHT_TARGET ); + UpdateSelectablePoint( b, Brush_TransformedPoint( b, b->lightStart ), LIGHT_START ); + UpdateSelectablePoint( b, Brush_TransformedPoint( b, b->lightEnd ), LIGHT_END ); b->pointLight = false; } else @@ -5035,7 +5013,7 @@ void Brush_Draw( const idEditorBrush* b, bool bSelected ) qglEnd(); - if( model ) + if( model || face->d_texture->GetEditorAlpha() != 1.0f ) { qglDisable( GL_BLEND ); } diff --git a/neo/tools/radiant/EditorBrush.h b/neo/tools/radiant/EditorBrush.h index 07fc632..465c921 100644 --- a/neo/tools/radiant/EditorBrush.h +++ b/neo/tools/radiant/EditorBrush.h @@ -117,7 +117,7 @@ const char* Brush_GetKeyValue( idEditorBrush* b, const char* pKey ); void Brush_RebuildBrush( idEditorBrush* b, idVec3 vMins, idVec3 vMaxs, bool patch = true ); void Brush_GetBounds( idEditorBrush* b, idBounds& bo ); -face_t* Face_Alloc( void ); +face_t* Face_Alloc(); void Face_Free( face_t* f ); face_t* Face_Clone( face_t* f ); void Face_MakePlane( face_t* f ); diff --git a/neo/tools/radiant/EditorEntity.cpp b/neo/tools/radiant/EditorEntity.cpp index 688cef2..4af52bc 100644 --- a/neo/tools/radiant/EditorEntity.cpp +++ b/neo/tools/radiant/EditorEntity.cpp @@ -1385,7 +1385,7 @@ idEditorEntity* Entity_Create( eclass_t* entityClass, bool forceFixed ) { if( b->owner != world_entity ) { - MessageBox( g_pParentWnd->GetSafeHwnd(), "Entity NOT created, brushes not all from world.", "Can't Create Entity", MB_OK | MB_ICONERROR ); + MessageBoxA( g_pParentWnd->GetSafeHwnd(), "Entity NOT created, brushes not all from world.", "Can't Create Entity", MB_OK | MB_ICONERROR ); return NULL; } } diff --git a/neo/tools/radiant/EditorMap.cpp b/neo/tools/radiant/EditorMap.cpp index bcdf221..203b5c0 100644 --- a/neo/tools/radiant/EditorMap.cpp +++ b/neo/tools/radiant/EditorMap.cpp @@ -48,8 +48,8 @@ idEditorEntity entities; // head/tail of doubly linked list idEditorEntity* world_entity = NULL; // "classname" "worldspawn" ! -void AddRegionBrushes( void ); -void RemoveRegionBrushes( void ); +void AddRegionBrushes(); +void RemoveRegionBrushes(); bool g_bRestoreBetween = false; @@ -57,7 +57,7 @@ bool g_bRestoreBetween = false; ======================================================================================================================= ======================================================================================================================= */ -void Map_SaveBetween( void ) +void Map_SaveBetween() { if( g_pParentWnd->ActiveXY() ) { @@ -73,7 +73,7 @@ void Map_SaveBetween( void ) ======================================================================================================================= ======================================================================================================================= */ -void Map_RestoreBetween( void ) +void Map_RestoreBetween() { if( g_pParentWnd->ActiveXY() && g_bRestoreBetween ) { @@ -111,7 +111,7 @@ bool CheckForTinyBrush( idEditorBrush* b, int n, float fSize ) ======================================================================================================================= ======================================================================================================================= */ -void Map_BuildBrushData( void ) +void Map_BuildBrushData() { idEditorBrush* b, *next; @@ -228,7 +228,7 @@ bool Entity_NameIsUnique( const char* name ) Map_Free ======================================================================================================================= */ -void Map_Free( void ) +void Map_Free() { g_bRestoreBetween = false; if( selected_brushes.next && ( selected_brushes.next != &selected_brushes ) ) @@ -902,7 +902,7 @@ bool Map_SaveFile( const char* filename, bool use_region, bool autosave ) Map_New ======================================================================================================================= */ -void Map_New( void ) +void Map_New() { common->Printf( "Map_New\n" ); Map_Free(); @@ -942,7 +942,7 @@ idEditorBrush* region_sides[6]; AddRegionBrushes a regioned map will have temp walls put up at the region boundary ======================================================================================================================= */ -void AddRegionBrushes( void ) +void AddRegionBrushes() { idVec3 mins, maxs; int i; @@ -1007,7 +1007,7 @@ void AddRegionBrushes( void ) ======================================================================================================================= ======================================================================================================================= */ -void RemoveRegionBrushes( void ) +void RemoveRegionBrushes() { int i; @@ -1056,7 +1056,7 @@ bool Map_IsBrushFiltered( idEditorBrush* b ) Map_RegionOff Other filtering options may still be on ======================================================================================================================= */ -void Map_RegionOff( void ) +void Map_RegionOff() { idEditorBrush* b, *next; int i; @@ -1093,7 +1093,7 @@ void Map_RegionOff( void ) ======================================================================================================================= ======================================================================================================================= */ -void Map_ApplyRegion( void ) +void Map_ApplyRegion() { idEditorBrush* b, *next; @@ -1118,7 +1118,7 @@ void Map_ApplyRegion( void ) Map_RegionSelectedBrushes ======================================================================================================================= */ -void Map_RegionSelectedBrushes( void ) +void Map_RegionSelectedBrushes() { Map_RegionOff(); @@ -1155,7 +1155,7 @@ void Map_RegionSelectedBrushes( void ) Map_RegionXY ======================================================================================================================= */ -void Map_RegionXY( void ) +void Map_RegionXY() { Map_RegionOff(); @@ -1185,7 +1185,7 @@ void Map_RegionXY( void ) Map_RegionTallBrush ======================================================================================================================= */ -void Map_RegionTallBrush( void ) +void Map_RegionTallBrush() { idEditorBrush* b; @@ -1212,7 +1212,7 @@ void Map_RegionTallBrush( void ) Map_RegionBrush ======================================================================================================================= */ -void Map_RegionBrush( void ) +void Map_RegionBrush() { idEditorBrush* b; diff --git a/neo/tools/radiant/EditorMap.h b/neo/tools/radiant/EditorMap.h index df15ec2..767989d 100644 --- a/neo/tools/radiant/EditorMap.h +++ b/neo/tools/radiant/EditorMap.h @@ -50,14 +50,14 @@ extern bool region_active; void Map_LoadFile( const char* filename ); bool Map_SaveFile( const char* filename, bool use_region, bool autosave = false ); -void Map_New( void ); -void Map_BuildBrushData( void ); - -void Map_RegionOff( void ); -void Map_RegionXY( void ); -void Map_RegionTallBrush( void ); -void Map_RegionBrush( void ); -void Map_RegionSelectedBrushes( void ); +void Map_New(); +void Map_BuildBrushData(); + +void Map_RegionOff(); +void Map_RegionXY(); +void Map_RegionTallBrush(); +void Map_RegionBrush(); +void Map_RegionSelectedBrushes(); bool Map_IsBrushFiltered( idEditorBrush* b ); void Map_SaveSelected( CMemFile* pMemFile, CMemFile* pPatchFile = NULL ); diff --git a/neo/tools/radiant/FindBrushDlg.cpp b/neo/tools/radiant/FindBrushDlg.cpp index 48e2b89..f8e53b8 100644 --- a/neo/tools/radiant/FindBrushDlg.cpp +++ b/neo/tools/radiant/FindBrushDlg.cpp @@ -150,7 +150,7 @@ CFindBrushDlg::CFindBrushDlg( CWnd* pParent ) { } -CFindBrushDlg::~CFindBrushDlg( void ) +CFindBrushDlg::~CFindBrushDlg() { } @@ -166,7 +166,7 @@ BEGIN_MESSAGE_MAP( CFindBrushDlg, CDialogEx ) ON_BN_CLICKED( IDCANCEL, &CFindBrushDlg::OnBnClickedCancel ) END_MESSAGE_MAP() -BOOL CFindBrushDlg::OnInitDialog( void ) +BOOL CFindBrushDlg::OnInitDialog() { CDialogEx::OnInitDialog(); @@ -186,7 +186,7 @@ BOOL CFindBrushDlg::OnInitDialog( void ) return FALSE; // return TRUE unless you set the focus to a control } -void CFindBrushDlg::OnBnClickedOk( void ) +void CFindBrushDlg::OnBnClickedOk() { CString entStr, brushStr; m_editEntity.GetWindowText( entStr ); diff --git a/neo/tools/radiant/FindBrushDlg.h b/neo/tools/radiant/FindBrushDlg.h index 94da81e..1955275 100644 --- a/neo/tools/radiant/FindBrushDlg.h +++ b/neo/tools/radiant/FindBrushDlg.h @@ -34,7 +34,7 @@ class CFindBrushDlg : public CDialogEx public: CFindBrushDlg( CWnd* pParent = nullptr ); // standard constructor - virtual ~CFindBrushDlg( void ); + virtual ~CFindBrushDlg(); protected: virtual void DoDataExchange( CDataExchange* pDX ); // DDX/DDV support diff --git a/neo/tools/radiant/GetString.cpp b/neo/tools/radiant/GetString.cpp index cc47c23..b549286 100644 --- a/neo/tools/radiant/GetString.cpp +++ b/neo/tools/radiant/GetString.cpp @@ -95,7 +95,7 @@ LPCSTR GetString( LPCSTR psPrompt ) bool GetYesNo( const char* psQuery ) { - if( MessageBox( g_pParentWnd->GetSafeHwnd(), psQuery, "Query", MB_YESNO | MB_ICONWARNING ) == IDYES ) + if( MessageBoxA( g_pParentWnd->GetSafeHwnd(), psQuery, "Query", MB_YESNO | MB_ICONWARNING ) == IDYES ) { return true; } @@ -114,15 +114,15 @@ void ErrorBox( const char* sString ) PlaySound( "k:\\util\\overlay.bin", NULL, SND_FILENAME | SND_ASYNC ); } } - MessageBox( g_pParentWnd->GetSafeHwnd(), sString, "Error", MB_OK | MB_ICONERROR | MB_TASKMODAL ); + MessageBoxA( g_pParentWnd->GetSafeHwnd(), sString, "Error", MB_OK | MB_ICONERROR | MB_TASKMODAL ); } void InfoBox( const char* sString ) { - MessageBox( g_pParentWnd->GetSafeHwnd(), sString, "Info", MB_OK | MB_ICONINFORMATION | MB_TASKMODAL ); + MessageBoxA( g_pParentWnd->GetSafeHwnd(), sString, "Info", MB_OK | MB_ICONINFORMATION | MB_TASKMODAL ); } void WarningBox( const char* sString ) { - MessageBox( g_pParentWnd->GetSafeHwnd(), sString, "Warning", MB_OK | MB_ICONWARNING | MB_TASKMODAL ); + MessageBoxA( g_pParentWnd->GetSafeHwnd(), sString, "Warning", MB_OK | MB_ICONWARNING | MB_TASKMODAL ); } diff --git a/neo/tools/radiant/LightDlg.cpp b/neo/tools/radiant/LightDlg.cpp index 82d1d77..a99c3a5 100644 --- a/neo/tools/radiant/LightDlg.cpp +++ b/neo/tools/radiant/LightDlg.cpp @@ -488,7 +488,7 @@ void CLightDlg::EnableControls() SetSpecifics(); } -void CLightDlg::UpdateDialogFromLightInfo( void ) +void CLightDlg::UpdateDialogFromLightInfo() { m_hasCenter = lightInfo.hasCenter; m_bEqualRadius = lightInfo.equalRadius; @@ -558,7 +558,7 @@ void CLightDlg::UpdateDialogFromLightInfo( void ) UpdateData( FALSE ); } -void CLightDlg::UpdateLightInfoFromDialog( void ) +void CLightDlg::UpdateLightInfoFromDialog() { UpdateData( TRUE ); @@ -915,7 +915,7 @@ void LightEditorInit( const idDict* spawnArgs ) } } -void LightEditorRun( void ) +void LightEditorRun() { MSG* msg = AfxGetCurrentMessage(); // TODO Robert fix me!! while( ::PeekMessage( msg, NULL, NULL, NULL, PM_NOREMOVE ) ) @@ -927,7 +927,7 @@ void LightEditorRun( void ) } } -void LightEditorShutdown( void ) +void LightEditorShutdown() { delete g_LightDialog; g_LightDialog = NULL; diff --git a/neo/tools/radiant/LightDlg.h b/neo/tools/radiant/LightDlg.h index af7bf6b..dd14c12 100644 --- a/neo/tools/radiant/LightDlg.h +++ b/neo/tools/radiant/LightDlg.h @@ -79,9 +79,9 @@ class CLightDlg : public CDialogEx CLightDlg( CWnd* pParent = NULL ); // standard constructor ~CLightDlg(); - void UpdateDialogFromLightInfo( void ); + void UpdateDialogFromLightInfo(); void UpdateDialog( bool updateChecks ); - void UpdateLightInfoFromDialog( void ); + void UpdateLightInfoFromDialog(); void UpdateColor( float r, float g, float b, float a ); void SetSpecifics(); void EnableControls(); diff --git a/neo/tools/radiant/MRU.CPP b/neo/tools/radiant/MRU.CPP index 4c6c931..44a70dd 100644 --- a/neo/tools/radiant/MRU.CPP +++ b/neo/tools/radiant/MRU.CPP @@ -539,7 +539,7 @@ BOOL LoadMruInIni( LPMRUMENU lpMruMenu, LPSTR lpszSection, LPSTR lpszFile ) #ifdef WIN32 -BOOL IsWin395OrHigher( void ) +BOOL IsWin395OrHigher() { WORD wVer; diff --git a/neo/tools/radiant/MainFrm.cpp b/neo/tools/radiant/MainFrm.cpp index 6bab47e..5f59fa3 100644 --- a/neo/tools/radiant/MainFrm.cpp +++ b/neo/tools/radiant/MainFrm.cpp @@ -1625,7 +1625,7 @@ void CMainFrame::OnSize( UINT nType, int cx, int cy ) } } -void OpenDialog( void ); +void OpenDialog(); void SaveAsDialog( bool bRegion ); void Select_Ungroup(); @@ -2246,7 +2246,7 @@ void CMainFrame::OnViewSide() Sys_UpdateWindows( W_XY ); } -static void UpdateGrid( void ) +static void UpdateGrid() { // g_qeglobals.d_gridsize = 1 << g_qeglobals.d_gridsize; if( g_PrefsDlg.m_bSnapTToGrid ) diff --git a/neo/tools/radiant/NewTexWnd.cpp b/neo/tools/radiant/NewTexWnd.cpp index e1ba2c0..9d239d6 100644 --- a/neo/tools/radiant/NewTexWnd.cpp +++ b/neo/tools/radiant/NewTexWnd.cpp @@ -726,7 +726,7 @@ const idMaterial* Texture_LoadLight( const char* name ) return declManager->FindMaterial( name ); } -void Texture_ShowAll( void ) +void Texture_ShowAll() { int count = declManager->GetNumDecls( DECL_MATERIAL ); for( int i = 0; i < count; i++ ) @@ -770,7 +770,7 @@ const idMaterial* Texture_ForName( const char* name ) return mat; } -void Texture_ShowInuse( void ) +void Texture_ShowInuse() { Texture_HideAll(); diff --git a/neo/tools/radiant/PMesh.cpp b/neo/tools/radiant/PMesh.cpp index 85a8632..2c75812 100644 --- a/neo/tools/radiant/PMesh.cpp +++ b/neo/tools/radiant/PMesh.cpp @@ -65,7 +65,7 @@ const int PATCH_STYLEMASK = 0xffff0000; // // externs extern void MemFile_fprintf( CMemFile* pMemFile, const char* pText, ... ); -extern face_t* Face_Alloc( void ); +extern face_t* Face_Alloc(); void _Write3DMatrix( FILE* f, int y, int x, int z, float* m ); void _Write3DMatrix( CMemFile* f, int y, int x, int z, float* m ); extern void SamplePatch( float ctrl[3][3][5], int baseCol, int baseRow, int width, int horzSub, int vertSub, idDrawVert* outVerts, idDrawVert* drawVerts ); diff --git a/neo/tools/radiant/PointFile.cpp b/neo/tools/radiant/PointFile.cpp index b1a5928..9ae3aef 100644 --- a/neo/tools/radiant/PointFile.cpp +++ b/neo/tools/radiant/PointFile.cpp @@ -36,7 +36,7 @@ static idVec3 s_pointvecs[MAX_POINTFILE]; static int s_num_points = 0; static int s_check_point = 0; -void Pointfile_Delete( void ) +void Pointfile_Delete() { char name[1024]; @@ -48,7 +48,7 @@ void Pointfile_Delete( void ) } // advance camera to next point -void Pointfile_Next( void ) +void Pointfile_Next() { if( s_check_point >= s_num_points - 2 ) { @@ -70,7 +70,7 @@ void Pointfile_Next( void ) } // advance camera to previous point -void Pointfile_Prev( void ) +void Pointfile_Prev() { if( s_check_point == 0 ) { @@ -91,7 +91,7 @@ void Pointfile_Prev( void ) Sys_UpdateWindows( W_ALL ); } -void Pointfile_Check( void ) +void Pointfile_Check() { char name[1024]; FILE* f; @@ -128,7 +128,7 @@ void Pointfile_Check( void ) fclose( f ); } -void Pointfile_Draw( void ) +void Pointfile_Draw() { qglColor3f( 1.0F, 0.0F, 0.0F ); qglDisable( GL_TEXTURE_2D ); @@ -145,7 +145,7 @@ void Pointfile_Draw( void ) qglLineWidth( 0.5 ); } -void Pointfile_Clear( void ) +void Pointfile_Clear() { s_num_points = 0; } diff --git a/neo/tools/radiant/PreviewDlg.cpp b/neo/tools/radiant/PreviewDlg.cpp index 920bf5f..36d499b 100644 --- a/neo/tools/radiant/PreviewDlg.cpp +++ b/neo/tools/radiant/PreviewDlg.cpp @@ -67,6 +67,7 @@ BEGIN_MESSAGE_MAP( CPreviewDlg, CDialogEx ) ON_BN_CLICKED( IDC_BUTTON_RELOAD, OnBnClickedButtonReload ) ON_BN_CLICKED( IDC_BUTTON_ADD, OnBnClickedButtonAdd ) ON_BN_CLICKED( IDC_BUTTON_PLAY, OnBnClickedButtonPlay ) + ON_BN_CLICKED( IDC_PREVIEW_GUI, OnBnClickedPreviewGui ) END_MESSAGE_MAP() // CPreviewDlg message handlers @@ -104,10 +105,33 @@ BOOL CPreviewDlg::OnInitDialog() } } mediaName = ""; + + CButton* but = ( CButton* )GetDlgItem( IDC_PREVIEW_GUI ); + but->SetCheck( 1 ); + if( strOnlyFilter.Icmp( "particles/" ) == 0 ) + { + but->SetWindowTextA( "Particles Only" ); + } + else + { + but->SetWindowTextA( "Gui Only" ); + } + return TRUE; // return TRUE unless you set the focus to a control } +void CPreviewDlg::OnBnClickedPreviewGui( void ) +{ + onlyFilter = !onlyFilter; +} + +void CPreviewDlg::SetOnlyFilter( bool gOnly, idStr filter ) +{ + onlyFilter = gOnly; + strOnlyFilter = filter; +} + void CPreviewDlg::BuildTree() { @@ -652,6 +676,11 @@ void CPreviewDlg::SetMode( int mode, const char* preSelect ) { wnd->ShowWindow( SW_SHOW ); } + wnd = GetDlgItem( IDC_PREVIEW_GUI ); + if( wnd ) + { + wnd->ShowWindow( SW_HIDE ); + } break; case MATERIALS : wndPreview.ShowWindow( SW_SHOW ); @@ -670,6 +699,11 @@ void CPreviewDlg::SetMode( int mode, const char* preSelect ) { wnd->ShowWindow( SW_HIDE ); } + wnd = GetDlgItem( IDC_PREVIEW_GUI ); + if( wnd ) + { + wnd->ShowWindow( SW_SHOW ); + } break; case SOUNDS : case WAVES : @@ -689,6 +723,11 @@ void CPreviewDlg::SetMode( int mode, const char* preSelect ) { wnd->ShowWindow( SW_HIDE ); } + wnd = GetDlgItem( IDC_PREVIEW_GUI ); + if( wnd ) + { + wnd->ShowWindow( SW_HIDE ); + } break; } } @@ -715,7 +754,18 @@ void CPreviewDlg::AddMaterials( bool rootItems ) continue; } } - list.Append( mat->GetName() ); + + if( onlyFilter ) + { + if( strstr( mat->GetName(), strOnlyFilter.c_str() ) != 0 ) + { + list.Append( mat->GetName() ); + } + } + else + { + list.Append( mat->GetName() ); + } } list.Sort(); AddStrList( "Materials", list, MATERIALS ); // FIXME: SteelStorm2 has a _v1 suffix here diff --git a/neo/tools/radiant/PreviewDlg.h b/neo/tools/radiant/PreviewDlg.h index d2a43f5..b809878 100644 --- a/neo/tools/radiant/PreviewDlg.h +++ b/neo/tools/radiant/PreviewDlg.h @@ -46,6 +46,7 @@ class CPreviewDlg : public CDialogEx CPreviewDlg( CWnd* pParent = NULL ); // standard constructor virtual ~CPreviewDlg(); + void SetOnlyFilter( bool gOnly, idStr filter ); void SetMode( int mode, const char* preSelect = NULL ); void RebuildTree( const char* data ); void SetDisablePreview( bool b ) @@ -79,6 +80,8 @@ class CPreviewDlg : public CDialogEx void AddCommentedItems(); idStr data; bool disablePreview; + bool onlyFilter; + idStr strOnlyFilter; protected: virtual void DoDataExchange( CDataExchange* pDX ); // DDX/DDV support @@ -102,4 +105,5 @@ class CPreviewDlg : public CDialogEx afx_msg void OnBnClickedButtonReload(); afx_msg void OnBnClickedButtonAdd(); afx_msg void OnBnClickedButtonPlay(); + afx_msg void OnBnClickedPreviewGui(); }; diff --git a/neo/tools/radiant/QE3.H b/neo/tools/radiant/QE3.H index 6155eec..68c07a1 100644 --- a/neo/tools/radiant/QE3.H +++ b/neo/tools/radiant/QE3.H @@ -84,7 +84,6 @@ typedef struct { int iSize; int iTexMenu; // nearest, linear, etc - char szProject[256]; // last project loaded idVec3 colors[COLOR_LAST]; bool show_names; bool show_coordinates; @@ -100,15 +99,15 @@ typedef struct // system functions // // TTimo NOTE: WINAPI funcs can be accessed by plugins -void Sys_UpdateStatusBar( void ); +void Sys_UpdateStatusBar(); void Sys_UpdateWindows( int bits ); -double Sys_DoubleTime( void ); +double Sys_DoubleTime(); void Sys_GetCursorPos( int* x, int* y ); void Sys_SetCursorPos( int x, int y ); void Sys_SetTitle( const char* text ); -void Sys_BeginWait( void ); +void Sys_BeginWait(); bool Sys_Waiting(); -void Sys_EndWait( void ); +void Sys_EndWait(); void Sys_Status( const char* psz, int part = -1 ); /* @@ -125,7 +124,7 @@ typedef struct int d_num_entities; - idVec3 d_new_brush_bottom, d_new_idEditorBrushop; + idVec3 d_new_brush_bottom, d_new_brush_top; HINSTANCE d_hInstance; @@ -177,12 +176,12 @@ typedef struct //========================= // pointfile.cpp //======================== -void Pointfile_Delete( void ); -void Pointfile_Check( void ); -void Pointfile_Next( void ); -void Pointfile_Prev( void ); -void Pointfile_Clear( void ); -void Pointfile_Draw( void ); +void Pointfile_Delete(); +void Pointfile_Check(); +void Pointfile_Next(); +void Pointfile_Prev(); +void Pointfile_Clear(); +void Pointfile_Draw(); //======================== // drag.c @@ -197,18 +196,18 @@ extern bool g_moveOnly; //======================== // csg.c //======================== -void CSG_MakeHollow( void ); -void CSG_Subtract( void ); -void CSG_Merge( void ); +void CSG_MakeHollow(); +void CSG_Subtract(); +void CSG_Merge(); //======================== // vertsel.c //======================== -void SetupVertexSelection( void ); +void SetupVertexSelection(); void SelectEdgeByRay( idVec3 org, idVec3 dir ); void SelectVertexByRay( idVec3 org, idVec3 dir ); -void ConnectEntities( void ); +void ConnectEntities(); //======================== // win_main.c @@ -240,17 +239,17 @@ bool TryDocking( HWND h, long side, LPRECT rect, int widthlimit ); //======================== // QE function declarations //======================== -void QE_CheckAutoSave( void ); -void QE_CountBrushesAndUpdateStatusBar( void ); -void WINAPI QE_CheckOpenGLForErrors( void ); -void QE_Init( void ); +void QE_CheckAutoSave(); +void QE_CountBrushesAndUpdateStatusBar(); +void WINAPI QE_CheckOpenGLForErrors(); +void QE_Init(); bool QE_SingleBrush( bool bQuiet = false, bool entityOK = false ); //======================== // sys stuff //======================== -void Sys_MarkMapModified( void ); +void Sys_MarkMapModified(); //======================== // QE Win32 function declarations @@ -360,7 +359,7 @@ extern void SaveWindowPlacement( HWND hwnd, const char* pName ); extern bool LoadWindowPlacement( HWND hwnd, const char* pName ); void SaveDialogPlacement( CDialog* dlg, const char* pName ); -extern bool ConfirmModified( void ); +extern bool ConfirmModified(); extern void DoPatchInspector(); void UpdatePatchInspector(); extern int g_nSmartX; diff --git a/neo/tools/radiant/QE3.cpp b/neo/tools/radiant/QE3.cpp index a4d6f9c..0bfc576 100644 --- a/neo/tools/radiant/QE3.cpp +++ b/neo/tools/radiant/QE3.cpp @@ -38,7 +38,7 @@ QEGlobals_t g_qeglobals; ======================================================================================================================= ======================================================================================================================= */ -void WINAPI QE_CheckOpenGLForErrors( void ) +void WINAPI QE_CheckOpenGLForErrors() { CString strMsg; int i = qglGetError(); @@ -106,7 +106,7 @@ void Map_Snapshot() QE_CheckAutoSave If five minutes have passed since making a change and the map hasn't been saved, save it out. ======================================================================================================================= */ -void QE_CheckAutoSave( void ) +void QE_CheckAutoSave() { static bool inAutoSave = false; static bool autoToggle = false; @@ -153,7 +153,7 @@ void QE_CheckAutoSave( void ) ConnectEntities Sets target / name on the two entities selected from the first selected to the secon ======================================================================================================================= */ -void ConnectEntities( void ) +void ConnectEntities() { idEditorEntity* e1; const char* target; @@ -162,7 +162,7 @@ void ConnectEntities( void ) if( g_qeglobals.d_select_count < 2 ) { - MessageBox( g_pParentWnd->GetSafeHwnd(), "Must have at least two brushes selected.", "Can't Connect Entity", MB_OK | MB_ICONINFORMATION ); + MessageBoxA( g_pParentWnd->GetSafeHwnd(), "Must have at least two brushes selected.", "Can't Connect Entity", MB_OK | MB_ICONINFORMATION ); return; } @@ -172,7 +172,7 @@ void ConnectEntities( void ) { if( g_qeglobals.d_select_order[i]->owner == world_entity ) { - MessageBox( g_pParentWnd->GetSafeHwnd(), "Can't connect to the world.", "Can't Connect Entity", MB_OK | MB_ICONWARNING ); + MessageBoxA( g_pParentWnd->GetSafeHwnd(), "Can't connect to the world.", "Can't Connect Entity", MB_OK | MB_ICONWARNING ); return; } } @@ -181,7 +181,7 @@ void ConnectEntities( void ) { if( e1 == g_qeglobals.d_select_order[i]->owner ) { - MessageBox( g_pParentWnd->GetSafeHwnd(), "Brushes are from same entity.", "Can't Connect Entity", MB_OK | MB_ICONINFORMATION ); + MessageBoxA( g_pParentWnd->GetSafeHwnd(), "Brushes are from same entity.", "Can't Connect Entity", MB_OK | MB_ICONINFORMATION ); return; } } @@ -245,7 +245,7 @@ bool QE_SingleBrush( bool bQuiet, bool entityOK ) { if( !bQuiet ) { - MessageBox( g_pParentWnd->GetSafeHwnd(), "You must have a single brush selected.", "Brush Manipulation", MB_OK | MB_ICONERROR ); + MessageBoxA( g_pParentWnd->GetSafeHwnd(), "You must have a single brush selected.", "Brush Manipulation", MB_OK | MB_ICONERROR ); } return false; @@ -255,7 +255,7 @@ bool QE_SingleBrush( bool bQuiet, bool entityOK ) { if( !bQuiet ) { - MessageBox( g_pParentWnd->GetSafeHwnd(), "You cannot manipulate fixed size entities.", "Brush Manipulation", MB_OK | MB_ICONERROR ); + MessageBoxA( g_pParentWnd->GetSafeHwnd(), "You cannot manipulate fixed size entities.", "Brush Manipulation", MB_OK | MB_ICONERROR ); } return false; @@ -268,7 +268,7 @@ bool QE_SingleBrush( bool bQuiet, bool entityOK ) ======================================================================================================================= ======================================================================================================================= */ -void QE_Init( void ) +void QE_Init() { g_qeglobals.d_gridsize = 8; g_qeglobals.d_showgrid = true; @@ -292,7 +292,7 @@ int g_numbrushes, g_numentities; ======================================================================================================================= ======================================================================================================================= */ -void QE_CountBrushesAndUpdateStatusBar( void ) +void QE_CountBrushesAndUpdateStatusBar() { static int s_lastbrushcount, s_lastentitycount; static bool s_didonce; diff --git a/neo/tools/radiant/Radiant.cpp b/neo/tools/radiant/Radiant.cpp index cad4b8a..af1a8b0 100644 --- a/neo/tools/radiant/Radiant.cpp +++ b/neo/tools/radiant/Radiant.cpp @@ -105,24 +105,33 @@ BOOL CRadiantApp::InitInstance() qglEnableClientState( GL_VERTEX_ARRAY ); - CMainFrame* pMainFrame = new CMainFrame; - if( !pMainFrame->LoadFrame( IDR_MAINFRAME ) ) - { - return FALSE; - } + InitContextMenuManager(); + + InitKeyboardManager(); - if( pMainFrame->m_hAccelTable ) + InitTooltipManager(); + CMFCToolTipInfo ttParams; + ttParams.m_bVislManagerTheme = TRUE; + theApp.GetTooltipManager()->SetTooltipParams( AFX_TOOLTIP_TYPE_ALL, + RUNTIME_CLASS( CMFCToolTipCtrl ), &ttParams ); + + // To create the main window, this code creates a new frame window + // object and then sets it as the application's main window object + CFrameWnd* pFrame = new CMainFrame; + if( !pFrame ) { - ::DestroyAcceleratorTable( pMainFrame->m_hAccelTable ); + return FALSE; } - pMainFrame->LoadAccelTable( MAKEINTRESOURCE( IDR_MINIACCEL ) ); - - m_pMainWnd = pMainFrame; + m_pMainWnd = pFrame; + // create and load the frame with its resources + pFrame->LoadFrame( IDR_MAINFRAME, + WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, nullptr, + nullptr ); - // The main window has been initialized, so show and update it. - pMainFrame->ShowWindow( m_nCmdShow ); - pMainFrame->UpdateWindow(); + // The one and only window has been initialized, so show and update it + pFrame->ShowWindow( SW_SHOW ); + pFrame->UpdateWindow(); return TRUE; } @@ -170,7 +179,7 @@ void CRadiantApp::OnAppHelp() CRadiantApp::Run ================ */ -int CRadiantApp::Run( void ) +int CRadiantApp::Run() { BOOL bIdle = TRUE; LONG lIdleCount = 0; @@ -218,7 +227,7 @@ int CRadiantApp::Run( void ) class CAboutRadiantDlg : public CAboutDlg { public: - CAboutRadiantDlg( void ); + CAboutRadiantDlg(); virtual BOOL OnInitDialog(); }; diff --git a/neo/tools/radiant/Radiant.h b/neo/tools/radiant/Radiant.h index 06978d3..25c12f6 100644 --- a/neo/tools/radiant/Radiant.h +++ b/neo/tools/radiant/Radiant.h @@ -43,7 +43,7 @@ class CRadiantApp : public CWinAppEx virtual int ExitInstance(); virtual BOOL OnIdle( LONG lCount ); - virtual int Run( void ); + virtual int Run(); afx_msg void OnAppHelp(); afx_msg void OnAppAbout(); diff --git a/neo/tools/radiant/RadiantEditor.cpp b/neo/tools/radiant/RadiantEditor.cpp index 112f848..4868f6c 100644 --- a/neo/tools/radiant/RadiantEditor.cpp +++ b/neo/tools/radiant/RadiantEditor.cpp @@ -307,7 +307,7 @@ void RadiantPrint( const char* text ) RadiantShutdown ================ */ -void RadiantShutdown( void ) +void RadiantShutdown() { theApp.ExitInstance(); } @@ -319,7 +319,7 @@ RadiantInit This is also called when you 'quit' in doom ================= */ -void RadiantInit( void ) +void RadiantInit() { // make sure the renderer is initialized @@ -389,7 +389,7 @@ void RadiantInit( void ) RadiantRun ================ */ -void RadiantRun( void ) +void RadiantRun() { static bool exceptionErr = false; int show = ::IsWindowVisible( win32.hWnd ); @@ -409,7 +409,7 @@ void RadiantRun( void ) } catch( idException& ex ) { - ::MessageBox( NULL, ex.error, "Exception error", MB_OK ); + ::MessageBoxA( NULL, ex.error, "Exception error", MB_OK ); RadiantShutdown(); } } @@ -516,7 +516,7 @@ bool LoadWindowState( HWND hWnd, const char* pszName ) Sys_UpdateStatusBar ================ */ -void Sys_UpdateStatusBar( void ) +void Sys_UpdateStatusBar() { extern int g_numbrushes, g_numentities; diff --git a/neo/tools/radiant/RadiantEditor.h b/neo/tools/radiant/RadiantEditor.h index 0679193..0e589df 100644 --- a/neo/tools/radiant/RadiantEditor.h +++ b/neo/tools/radiant/RadiantEditor.h @@ -68,9 +68,9 @@ Radiant "Editor" Implementation ================================= */ void RadiantPrint( const char* text ); -void RadiantShutdown( void ); -void RadiantInit( void ); -void RadiantRun( void ); +void RadiantShutdown(); +void RadiantInit(); +void RadiantRun(); bool SaveRegistryInfo( const char* pszName, void* pvBuf, long lSize ); bool LoadRegistryInfo( const char* pszName, void* pvBuf, long* plSize ); @@ -78,5 +78,5 @@ bool LoadRegistryInfo( const char* pszName, void* pvBuf, long* plSize ); bool SaveWindowState( HWND hWnd, const char* pszName ); bool LoadWindowState( HWND hWnd, const char* pszName ); -void Sys_UpdateStatusBar( void ); +void Sys_UpdateStatusBar(); void Sys_Status( const char* psz, int part ); \ No newline at end of file diff --git a/neo/tools/radiant/Select.cpp b/neo/tools/radiant/Select.cpp index c358e1d..4f9cf11 100644 --- a/neo/tools/radiant/Select.cpp +++ b/neo/tools/radiant/Select.cpp @@ -232,7 +232,7 @@ qertrace_t Test_Ray( const idVec3& origin, const idVec3& dir, int flags ) extern void AddSelectablePoint( idEditorBrush* b, idVec3 v, int type, bool priority ); extern void ClearSelectablePoints( idEditorBrush* b ); -extern idVec3 idEditorBrushransformedPoint( idEditorBrush* b, const idVec3& in ); +extern idVec3 Brush_TransformedPoint( idEditorBrush* b, const idVec3& in ); /* ======================================================================================================================= @@ -309,18 +309,18 @@ void Select_Brush( idEditorBrush* brush, bool bComplete, bool bStatus ) // add center drag point if not at the origin if( brush->lightCenter[0] || brush->lightCenter[1] || brush->lightCenter[2] ) { - AddSelectablePoint( brush, idEditorBrushransformedPoint( brush, brush->lightCenter ), LIGHT_CENTER, false ); + AddSelectablePoint( brush, Brush_TransformedPoint( brush, brush->lightCenter ), LIGHT_CENTER, false ); } } else { - AddSelectablePoint( brush, idEditorBrushransformedPoint( brush, brush->lightTarget ), LIGHT_TARGET, true ); - AddSelectablePoint( brush, idEditorBrushransformedPoint( brush, brush->lightUp ), LIGHT_UP, false ); - AddSelectablePoint( brush, idEditorBrushransformedPoint( brush, brush->lightRight ), LIGHT_RIGHT, false ); + AddSelectablePoint( brush, Brush_TransformedPoint( brush, brush->lightTarget ), LIGHT_TARGET, true ); + AddSelectablePoint( brush, Brush_TransformedPoint( brush, brush->lightUp ), LIGHT_UP, false ); + AddSelectablePoint( brush, Brush_TransformedPoint( brush, brush->lightRight ), LIGHT_RIGHT, false ); if( brush->startEnd ) { - AddSelectablePoint( brush, idEditorBrushransformedPoint( brush, brush->lightStart ), LIGHT_START, false ); - AddSelectablePoint( brush, idEditorBrushransformedPoint( brush, brush->lightEnd ), LIGHT_END, false ); + AddSelectablePoint( brush, Brush_TransformedPoint( brush, brush->lightStart ), LIGHT_START, false ); + AddSelectablePoint( brush, Brush_TransformedPoint( brush, brush->lightEnd ), LIGHT_END, false ); } } UpdateLightInspector(); @@ -462,7 +462,7 @@ void Select_Ray( idVec3 origin, idVec3 dir, int flags ) ======================================================================================================================= ======================================================================================================================= */ -void Select_Delete( void ) +void Select_Delete() { idEditorBrush* brush; @@ -535,7 +535,7 @@ void Select_Deselect( bool bDeselectFaces ) if( b->mins[2] < b->maxs[2] ) { g_qeglobals.d_new_brush_bottom = b->mins; - g_qeglobals.d_new_idEditorBrushop = b->maxs; + g_qeglobals.d_new_brush_top = b->maxs; } selected_brushes.next->prev = &active_brushes; @@ -594,7 +594,7 @@ void Select_Move( idVec3 delta, bool bSnap ) positions ======================================================================================================================= */ -void Select_Clone( void ) +void Select_Clone() { ASSERT( g_pParentWnd->ActiveXY() ); g_bScreenUpdates = false; @@ -1273,7 +1273,7 @@ void Select_Scale( float x, float y, float z ) GROUP SELECTIONS ======================================================================================================================= */ -void Select_CompleteTall( void ) +void Select_CompleteTall() { idEditorBrush* b, *next; @@ -1326,7 +1326,7 @@ void Select_CompleteTall( void ) ======================================================================================================================= ======================================================================================================================= */ -void Select_PartialTall( void ) +void Select_PartialTall() { idEditorBrush* b, *next; @@ -1393,7 +1393,7 @@ void Select_PartialTall( void ) ======================================================================================================================= ======================================================================================================================= */ -void Select_Touching( void ) +void Select_Touching() { idEditorBrush* b, *next; int i; @@ -1440,7 +1440,7 @@ void Select_Touching( void ) ======================================================================================================================= ======================================================================================================================= */ -void Select_Inside( void ) +void Select_Inside() { idEditorBrush* b, *next; int i; @@ -2002,7 +2002,7 @@ void Select_ShowAllHidden() Select_Invert ======================================================================================================================= */ -void Select_Invert( void ) +void Select_Invert() { idEditorBrush* next, *prev; diff --git a/neo/tools/radiant/Select.h b/neo/tools/radiant/Select.h index 40946ad..85e783a 100644 --- a/neo/tools/radiant/Select.h +++ b/neo/tools/radiant/Select.h @@ -95,18 +95,18 @@ void SelectCurvePointByRay( const idVec3& org, const idVec3& dir, int buttons ); void Select_GetBounds( idVec3& mins, idVec3& maxs ); void Select_Brush( idEditorBrush* b, bool bComplete = true, bool bStatus = true ); void Select_Ray( idVec3 origin, idVec3 dir, int flags ); -void Select_Delete( void ); +void Select_Delete(); void Select_Deselect( bool bDeselectFaces = true ); -void Select_Invert( void ); -void Select_Clone( void ); +void Select_Invert(); +void Select_Clone(); void Select_Move( idVec3 delta, bool bSnap = true ); void WINAPI Select_SetTexture( texdef_t* texdef, brushprimit_texdef_t* brushprimit_texdef, bool bFitScale = false, void* pPlugTexdef = NULL, bool update = true ); void Select_FlipAxis( int axis ); void Select_RotateAxis( int axis, float deg, bool bPaint = true, bool bMouse = false ); -void Select_CompleteTall( void ); -void Select_PartialTall( void ); -void Select_Touching( void ); -void Select_Inside( void ); +void Select_CompleteTall(); +void Select_PartialTall(); +void Select_Touching(); +void Select_Inside(); void Select_CenterOrigin(); void Select_AllOfType(); void Select_Reselect(); diff --git a/neo/tools/radiant/Splines.cpp b/neo/tools/radiant/Splines.cpp index 986a054..0aac890 100644 --- a/neo/tools/radiant/Splines.cpp +++ b/neo/tools/radiant/Splines.cpp @@ -29,7 +29,8 @@ If you have questions concerning this license or the applicable additional terms #include "precompiled.h" #pragma hdrstop -#include "splines.h" +#include "QE3.h" +#include "Splines.h" idCameraDef splineList; idCameraDef* g_splineList = &splineList; @@ -1796,6 +1797,11 @@ bool idCameraPosition::parseToken( const idStr& key, idParser* src ) name = token; return true; } + else if( !key.Icmp( "time" ) ) + { + time = src->ParseInt(); + return true; + } else { src->Error( "unknown camera position key: %s", key.c_str() ); diff --git a/neo/tools/radiant/SurfaceDlg.cpp b/neo/tools/radiant/SurfaceDlg.cpp index 502456d..40fc4de 100644 --- a/neo/tools/radiant/SurfaceDlg.cpp +++ b/neo/tools/radiant/SurfaceDlg.cpp @@ -292,7 +292,7 @@ void UpdateSurfaceDialog() bool ByeByeSurfaceDialog(); -void DoSurface( void ) +void DoSurface() { g_bNewApplyHandling = ( g_PrefsDlg.m_bNewApplyHandling != FALSE ); diff --git a/neo/tools/radiant/Textures.h b/neo/tools/radiant/Textures.h index b31eda2..a405ce7 100644 --- a/neo/tools/radiant/Textures.h +++ b/neo/tools/radiant/Textures.h @@ -29,7 +29,7 @@ If you have questions concerning this license or the applicable additional terms // a texturename of the form (0 0 0) will // create a solid color texture -void Texture_ShowInuse( void ); +void Texture_ShowInuse(); void Texture_ShowAll(); void Texture_HideAll(); diff --git a/neo/tools/radiant/Undo.cpp b/neo/tools/radiant/Undo.cpp index a0d8203..3fe0755 100644 --- a/neo/tools/radiant/Undo.cpp +++ b/neo/tools/radiant/Undo.cpp @@ -77,7 +77,7 @@ int g_redoId = 1; //current redo ID (zero is invalid id) Undo_MemorySize ============= */ -int Undo_MemorySize( void ) +int Undo_MemorySize() { /* int size; @@ -108,7 +108,7 @@ int Undo_MemorySize( void ) Undo_ClearRedo ============= */ -void Undo_ClearRedo( void ) +void Undo_ClearRedo() { undo_t* redo, *nextredo; idEditorBrush* pBrush, *pNextBrush; @@ -141,7 +141,7 @@ Undo_Clear Clears the undo buffer. ============= */ -void Undo_Clear( void ) +void Undo_Clear() { undo_t* undo, *nextundo; idEditorBrush* pBrush, *pNextBrush; @@ -196,7 +196,7 @@ void Undo_SetMaxSize( int size ) Undo_GetMaxSize ============= */ -int Undo_GetMaxSize( void ) +int Undo_GetMaxSize() { return g_undoMaxSize; } @@ -224,7 +224,7 @@ void Undo_SetMaxMemorySize( int size ) Undo_GetMaxMemorySize ============= */ -int Undo_GetMaxMemorySize( void ) +int Undo_GetMaxMemorySize() { return g_undoMaxMemorySize; } @@ -234,7 +234,7 @@ int Undo_GetMaxMemorySize( void ) Undo_FreeFirstUndo ============= */ -void Undo_FreeFirstUndo( void ) +void Undo_FreeFirstUndo() { undo_t* undo; idEditorBrush* pBrush, *pNextBrush; @@ -590,7 +590,7 @@ void Undo_EndEntity( idEditorEntity* entity ) Undo_End ============= */ -void Undo_End( void ) +void Undo_End() { if( !g_lastundo ) { @@ -623,7 +623,7 @@ void Undo_End( void ) Undo_Undo ============= */ -void Undo_Undo( void ) +void Undo_Undo() { undo_t* undo, *redo; idEditorBrush* pBrush, *pNextBrush; @@ -825,7 +825,7 @@ void Undo_Undo( void ) Undo_Redo ============= */ -void Undo_Redo( void ) +void Undo_Redo() { undo_t* redo; idEditorBrush* pBrush, *pNextBrush; @@ -957,7 +957,7 @@ void Undo_Redo( void ) Undo_RedoAvailable ============= */ -int Undo_RedoAvailable( void ) +int Undo_RedoAvailable() { if( g_lastredo ) { @@ -971,7 +971,7 @@ int Undo_RedoAvailable( void ) Undo_UndoAvailable ============= */ -int Undo_UndoAvailable( void ) +int Undo_UndoAvailable() { if( g_lastundo ) { diff --git a/neo/tools/radiant/Undo.h b/neo/tools/radiant/Undo.h index c3063a9..7c56e8e 100644 --- a/neo/tools/radiant/Undo.h +++ b/neo/tools/radiant/Undo.h @@ -29,7 +29,7 @@ If you have questions concerning this license or the applicable additional terms //start operation void Undo_Start( char* operation ); //end operation -void Undo_End( void ); +void Undo_End(); //add brush to the undo void Undo_AddBrush( idEditorBrush* pBrush ); //add a list with brushes to the undo @@ -43,22 +43,22 @@ void Undo_AddEntity( idEditorEntity* entity ); //end an entity after the operation is performed void Undo_EndEntity( idEditorEntity* entity ); //undo last operation -void Undo_Undo( void ); +void Undo_Undo(); //redo last undone operation -void Undo_Redo( void ); +void Undo_Redo(); //returns true if there is something to be undone available -int Undo_UndoAvailable( void ); +int Undo_UndoAvailable(); //returns true if there is something to redo available -int Undo_RedoAvailable( void ); +int Undo_RedoAvailable(); //clear the undo buffer -void Undo_Clear( void ); +void Undo_Clear(); //set maximum undo size (default 64) void Undo_SetMaxSize( int size ); //get maximum undo size -int Undo_GetMaxSize( void ); +int Undo_GetMaxSize(); //set maximum undo memory in bytes (default 2 MB) void Undo_SetMaxMemorySize( int size ); //get maximum undo memory in bytes -int Undo_GetMaxMemorySize( void ); +int Undo_GetMaxMemorySize(); //returns the amount of memory used by undo -int Undo_MemorySize( void ); +int Undo_MemorySize(); diff --git a/neo/tools/radiant/VertSel.cpp b/neo/tools/radiant/VertSel.cpp index 4a93cdb..c9e0f55 100644 --- a/neo/tools/radiant/VertSel.cpp +++ b/neo/tools/radiant/VertSel.cpp @@ -119,7 +119,7 @@ static void MakeFace( idEditorBrush* b, face_t* f ) ======================================================================================================================= ======================================================================================================================= */ -void SetupVertexSelection( void ) +void SetupVertexSelection() { face_t* f; idEditorBrush* b; diff --git a/neo/tools/radiant/WaitDlg.cpp b/neo/tools/radiant/WaitDlg.cpp index 363a123..83b0bf0 100644 --- a/neo/tools/radiant/WaitDlg.cpp +++ b/neo/tools/radiant/WaitDlg.cpp @@ -115,7 +115,7 @@ void CWaitDlg::AllowCancel( bool enable ) } } -bool CWaitDlg::CancelPressed( void ) +bool CWaitDlg::CancelPressed() { MSG* msg = AfxGetCurrentMessage(); // TODO Robert fix me!! while( ::PeekMessage( msg, NULL, NULL, NULL, PM_NOREMOVE ) ) diff --git a/neo/tools/radiant/WaitDlg.h b/neo/tools/radiant/WaitDlg.h index d0306f7..7ee936a 100644 --- a/neo/tools/radiant/WaitDlg.h +++ b/neo/tools/radiant/WaitDlg.h @@ -37,7 +37,7 @@ class CWaitDlg : public CDialogEx ~CWaitDlg(); void SetText( const char* msg, float percent = 0.0f, bool append = false ); void AllowCancel( bool enable ); - bool CancelPressed( void ); + bool CancelPressed(); enum { IDD = IDD_DLG_WAIT }; CString waitStr; diff --git a/neo/tools/radiant/Win_QE3.cpp b/neo/tools/radiant/Win_QE3.cpp index 0c9f8f7..2a431a7 100644 --- a/neo/tools/radiant/Win_QE3.cpp +++ b/neo/tools/radiant/Win_QE3.cpp @@ -36,7 +36,7 @@ If you have questions concerning this license or the applicable additional terms ======================================================================================================================= ======================================================================================================================= */ -void Sys_MarkMapModified( void ) +void Sys_MarkMapModified() { idStr title; @@ -66,7 +66,7 @@ void Sys_SetTitle( const char* text ) */ HCURSOR waitcursor; -void Sys_BeginWait( void ) +void Sys_BeginWait() { waitcursor = SetCursor( LoadCursor( NULL, IDC_WAIT ) ); } @@ -76,7 +76,7 @@ bool Sys_Waiting() return ( waitcursor != NULL ); } -void Sys_EndWait( void ) +void Sys_EndWait() { if( waitcursor ) { @@ -111,7 +111,7 @@ void Sys_SetCursorPos( int x, int y ) ======================================================================================================================= ======================================================================================================================= */ -double Sys_DoubleTime( void ) +double Sys_DoubleTime() { return clock() / 1000.0; } @@ -143,7 +143,7 @@ int WINAPI QEW_SetupPixelFormat( HDC hDC, bool zbuffer ) FILE DIALOGS ======================================================================================================================= */ -bool ConfirmModified( void ) +bool ConfirmModified() { if( !mapModified ) { @@ -167,7 +167,7 @@ static char szFilter[260] = "Map file (*.map, *.reg)\0*.map;*.reg\0"; /* filte ======================================================================================================================= ======================================================================================================================= */ -void OpenDialog( void ) +void OpenDialog() { /* Place the terminating null character in the szFile. */ szFile[0] = '\0'; diff --git a/neo/tools/radiant/XYWnd.cpp b/neo/tools/radiant/XYWnd.cpp index 070496a..7bfcbb5 100644 --- a/neo/tools/radiant/XYWnd.cpp +++ b/neo/tools/radiant/XYWnd.cpp @@ -394,7 +394,7 @@ static void RotateLight( idVec3& target, idVec3& up, idVec3& right, const idVec3 ======================================================================================================================= ======================================================================================================================= */ -extern idVec3 idEditorBrushransformedPoint( idEditorBrush* b, const idVec3& in ); +extern idVec3 Brush_TransformedPoint( idEditorBrush* b, const idVec3& in ); extern idMat3 Brush_RotationMatrix( idEditorBrush* b ); bool UpdateActiveDragPoint( const idVec3& move ) { @@ -422,11 +422,11 @@ bool UpdateActiveDragPoint( const idVec3& move ) owner->SetKeyVec3( "light_up", up ); owner->SetKeyVec3( "light_right", right ); target += ( activeDrag->pBrush->trackLightOrigin ) ? activeDrag->pBrush->owner->lightOrigin : activeDrag->pBrush->owner->origin; - UpdateSelectablePoint( activeDrag->pBrush, idEditorBrushransformedPoint( activeDrag->pBrush, target ), LIGHT_TARGET ); + UpdateSelectablePoint( activeDrag->pBrush, Brush_TransformedPoint( activeDrag->pBrush, target ), LIGHT_TARGET ); up += target; - UpdateSelectablePoint( activeDrag->pBrush, idEditorBrushransformedPoint( activeDrag->pBrush, up ), LIGHT_UP ); + UpdateSelectablePoint( activeDrag->pBrush, Brush_TransformedPoint( activeDrag->pBrush, up ), LIGHT_UP ); right += target; - UpdateSelectablePoint( activeDrag->pBrush, idEditorBrushransformedPoint( activeDrag->pBrush, right ), LIGHT_RIGHT ); + UpdateSelectablePoint( activeDrag->pBrush, Brush_TransformedPoint( activeDrag->pBrush, right ), LIGHT_RIGHT ); } else if( activeDrag->nType == LIGHT_UP ) { @@ -438,7 +438,7 @@ bool UpdateActiveDragPoint( const idVec3& move ) owner->GetVectorForKey( "light_target", target ); target += ( activeDrag->pBrush->trackLightOrigin ) ? activeDrag->pBrush->owner->lightOrigin : activeDrag->pBrush->owner->origin; up += target; - UpdateSelectablePoint( activeDrag->pBrush, idEditorBrushransformedPoint( activeDrag->pBrush, up ), LIGHT_UP ); + UpdateSelectablePoint( activeDrag->pBrush, Brush_TransformedPoint( activeDrag->pBrush, up ), LIGHT_UP ); } else if( activeDrag->nType == LIGHT_RIGHT ) { @@ -450,7 +450,7 @@ bool UpdateActiveDragPoint( const idVec3& move ) owner->GetVectorForKey( "light_target", target ); target += ( activeDrag->pBrush->trackLightOrigin ) ? activeDrag->pBrush->owner->lightOrigin : activeDrag->pBrush->owner->origin; right += target; - UpdateSelectablePoint( activeDrag->pBrush, idEditorBrushransformedPoint( activeDrag->pBrush, right ), LIGHT_RIGHT ); + UpdateSelectablePoint( activeDrag->pBrush, Brush_TransformedPoint( activeDrag->pBrush, right ), LIGHT_RIGHT ); } else if( activeDrag->nType == LIGHT_START ) { @@ -460,7 +460,7 @@ bool UpdateActiveDragPoint( const idVec3& move ) start *= invmat; owner->SetKeyVec3( "light_start", start ); start += ( activeDrag->pBrush->trackLightOrigin ) ? activeDrag->pBrush->owner->lightOrigin : activeDrag->pBrush->owner->origin; - UpdateSelectablePoint( activeDrag->pBrush, idEditorBrushransformedPoint( activeDrag->pBrush, start ), LIGHT_START ); + UpdateSelectablePoint( activeDrag->pBrush, Brush_TransformedPoint( activeDrag->pBrush, start ), LIGHT_START ); } else if( activeDrag->nType == LIGHT_END ) { @@ -470,7 +470,7 @@ bool UpdateActiveDragPoint( const idVec3& move ) end *= invmat; owner->SetKeyVec3( "light_end", end ); end += ( activeDrag->pBrush->trackLightOrigin ) ? activeDrag->pBrush->owner->lightOrigin : activeDrag->pBrush->owner->origin; - UpdateSelectablePoint( activeDrag->pBrush, idEditorBrushransformedPoint( activeDrag->pBrush, end ), LIGHT_END ); + UpdateSelectablePoint( activeDrag->pBrush, Brush_TransformedPoint( activeDrag->pBrush, end ), LIGHT_END ); } else if( activeDrag->nType == LIGHT_CENTER ) { @@ -480,7 +480,7 @@ bool UpdateActiveDragPoint( const idVec3& move ) end *= invmat; owner->SetKeyVec3( "light_center", end ); end += ( activeDrag->pBrush->trackLightOrigin ) ? activeDrag->pBrush->owner->lightOrigin : activeDrag->pBrush->owner->origin; - UpdateSelectablePoint( activeDrag->pBrush, idEditorBrushransformedPoint( activeDrag->pBrush, end ), LIGHT_CENTER ); + UpdateSelectablePoint( activeDrag->pBrush, Brush_TransformedPoint( activeDrag->pBrush, end ), LIGHT_CENTER ); } // FIXME: just build the frustrum values @@ -1843,7 +1843,7 @@ idEditorBrush* CreateEntityBrush( int x, int y, CXYWnd* pWnd ) int nDim = ( pWnd->GetViewType() == ViewType::XY ) ? 2 : ( pWnd->GetViewType() == ViewType::YZ ) ? 0 : 1; mins[nDim] = g_qeglobals.d_gridsize * ( ( int )( g_qeglobals.d_new_brush_bottom[nDim] / g_qeglobals.d_gridsize ) ); - maxs[nDim] = g_qeglobals.d_gridsize * ( ( int )( g_qeglobals.d_new_idEditorBrushop[nDim] / g_qeglobals.d_gridsize ) ); + maxs[nDim] = g_qeglobals.d_gridsize * ( ( int )( g_qeglobals.d_new_brush_top[nDim] / g_qeglobals.d_gridsize ) ); if( maxs[nDim] <= mins[nDim] ) { @@ -2756,7 +2756,7 @@ void CXYWnd::NewBrushDrag( int x, int y ) mins[nDim] = g_qeglobals.d_gridsize * ( ( int )( g_qeglobals.d_new_brush_bottom[nDim] / g_qeglobals.d_gridsize ) ); SnapToPoint( x, y, maxs ); - maxs[nDim] = g_qeglobals.d_gridsize * ( ( int )( g_qeglobals.d_new_idEditorBrushop[nDim] / g_qeglobals.d_gridsize ) ); + maxs[nDim] = g_qeglobals.d_gridsize * ( ( int )( g_qeglobals.d_new_brush_top[nDim] / g_qeglobals.d_gridsize ) ); if( maxs[nDim] <= mins[nDim] ) { maxs[nDim] = mins[nDim] + g_qeglobals.d_gridsize; @@ -3552,12 +3552,12 @@ bool FilterBrush( const idEditorBrush* pb ) /* ======================================================================================================================= - PATH LINES � + PATH LINES £ DrawPathLines Draws connections between entities. Needs to consider all entities, not just ones on screen, because the lines can be visible when neither end is. Called for both camera view and xy view. ======================================================================================================================= */ -void DrawPathLines( void ) +void DrawPathLines() { int i, k; idVec3 mid, mid1; @@ -4916,7 +4916,7 @@ BOOL CXYWnd::OnMouseWheel( UINT nFlags, short zDelta, CPoint pt ) // PRECISION_CURSOR_SNAP // PRECISION_CURSOR_FREE //--------------------------------------------------------------------------- -void CXYWnd::CyclePrecisionCrosshairMode( void ) +void CXYWnd::CyclePrecisionCrosshairMode() { common->Printf( "TODO: Make DrawPrecisionCrosshair work..." ); @@ -4939,7 +4939,7 @@ void CXYWnd::CyclePrecisionCrosshairMode( void ) // PRECISION_CROSSHAIR_SNAP Crosshair snaps to grid size. Force refresh of XY view. // PRECISION_CROSSHAIR_FREE Crosshair does not snap to grid. Force refresh of XY view. //--------------------------------------------------------------------------- -void CXYWnd::DrawPrecisionCrosshair( void ) +void CXYWnd::DrawPrecisionCrosshair() { // FIXME: m_mouseX, m_mouseY, m_axisHoriz, m_axisVert, etc... are never set #if 0 diff --git a/neo/tools/radiant/XYWnd.h b/neo/tools/radiant/XYWnd.h index db5f9cc..31fc9f6 100644 --- a/neo/tools/radiant/XYWnd.h +++ b/neo/tools/radiant/XYWnd.h @@ -197,7 +197,7 @@ class CXYWnd : public CDialogEx } bool m_bActive; - void UpdateViewDependencies( void ); + void UpdateViewDependencies(); void DrawPrecisionCrosshair(); void CyclePrecisionCrosshairMode(); diff --git a/neo/tools/radiant/Z.cpp b/neo/tools/radiant/Z.cpp index bc497dc..3c49e60 100644 --- a/neo/tools/radiant/Z.cpp +++ b/neo/tools/radiant/Z.cpp @@ -40,7 +40,7 @@ z_t z; Z_Init ======================================================================================================================= */ -void Z_Init( void ) +void Z_Init() { z.origin[0] = 0; z.origin[1] = 20; @@ -236,7 +236,7 @@ void Z_MouseMoved( int x, int y, int buttons ) Z_DrawGrid ======================================================================================================================= */ -void Z_DrawGrid( void ) +void Z_DrawGrid() { float zz, zb, ze; int w, h; @@ -318,7 +318,7 @@ void Z_DrawGrid( void ) ======================================================================================================================= ======================================================================================================================= */ -void ZDrawCameraIcon( void ) +void ZDrawCameraIcon() { float x, y; int xCam = z.width / 4; @@ -361,7 +361,7 @@ GLbitfield glbitClear = GL_COLOR_BUFFER_BIT; // HACK Z_Draw ======================================================================================================================= */ -void Z_Draw( void ) +void Z_Draw() { idEditorBrush* brush; float w, h; diff --git a/neo/tools/radiant/Z.h b/neo/tools/radiant/Z.h index 7c8e684..ccae9e3 100644 --- a/neo/tools/radiant/Z.h +++ b/neo/tools/radiant/Z.h @@ -38,8 +38,8 @@ typedef struct extern z_t z; -void Z_Init( void ); +void Z_Init(); void Z_MouseDown( int x, int y, int buttons ); void Z_MouseUp( int x, int y, int buttons ); void Z_MouseMoved( int x, int y, int buttons ); -void Z_Draw( void ); +void Z_Draw(); diff --git a/neo/tools/radiant/ZClip.cpp b/neo/tools/radiant/ZClip.cpp index 81b38b8..ab9a940 100644 --- a/neo/tools/radiant/ZClip.cpp +++ b/neo/tools/radiant/ZClip.cpp @@ -68,7 +68,7 @@ CZClip::~CZClip() SaveRegistryInfo( "radiant_ZClipBottom", &m_iZClipBottom, sizeof( m_iZClipBottom ) ); } -void CZClip::Reset( void ) +void CZClip::Reset() { m_iZClipTop = 64; // arb. starting values, but must be at least 64 apart m_iZClipBottom = -64; @@ -78,17 +78,17 @@ void CZClip::Reset( void ) } -int CZClip::GetTop( void ) +int CZClip::GetTop() { return m_iZClipTop; } -int CZClip::GetBottom( void ) +int CZClip::GetBottom() { return m_iZClipBottom; } -void CZClip::Legalise( void ) +void CZClip::Legalise() { // need swapping? // @@ -124,7 +124,7 @@ void CZClip::SetBottom( int iNewZ ) Legalise(); } -bool CZClip::IsEnabled( void ) +bool CZClip::IsEnabled() { return m_bEnabled; } @@ -139,7 +139,7 @@ bool CZClip::Enable( bool bOnOff ) #define ZCLIP_BAR_THICKNESS 8 #define ZCLIP_ARROWHEIGHT (ZCLIP_BAR_THICKNESS*8) -void CZClip::Paint( void ) +void CZClip::Paint() { float x, y; int xCam = z.width / 4; // hmmm, a rather unpleasant and obscure global name, but it was already called that so... diff --git a/neo/tools/radiant/ZClip.h b/neo/tools/radiant/ZClip.h index dcf26ef..41d423a 100644 --- a/neo/tools/radiant/ZClip.h +++ b/neo/tools/radiant/ZClip.h @@ -42,17 +42,17 @@ class CZClip CZClip(); ~CZClip(); - int GetTop( void ); - int GetBottom( void ); + int GetTop(); + int GetBottom(); void SetTop( int iNewZ ); void SetBottom( int iNewZ ); - void Reset( void ); - bool IsEnabled( void ); + void Reset(); + bool IsEnabled(); bool Enable( bool bOnOff ); - void Paint( void ); + void Paint(); protected: - void Legalise( void ); + void Legalise(); bool m_bEnabled; int m_iZClipTop; diff --git a/neo/tools/script/DialogScriptEditor.cpp b/neo/tools/script/DialogScriptEditor.cpp index 8acebf4..6bd201c 100644 --- a/neo/tools/script/DialogScriptEditor.cpp +++ b/neo/tools/script/DialogScriptEditor.cpp @@ -127,7 +127,7 @@ BOOL DialogScriptEditor::PreTranslateMessage( MSG* pMsg ) DialogScriptEditor::UpdateStatusBar ================ */ -void DialogScriptEditor::UpdateStatusBar( void ) +void DialogScriptEditor::UpdateStatusBar() { int line, column, character; @@ -140,7 +140,7 @@ void DialogScriptEditor::UpdateStatusBar( void ) DialogScriptEditor::InitScriptEvents ================ */ -void DialogScriptEditor::InitScriptEvents( void ) +void DialogScriptEditor::InitScriptEvents() { int index; idParser src; @@ -446,7 +446,7 @@ void ScriptEditorInit( const idDict* spawnArgs ) ScriptEditorRun ================ */ -void ScriptEditorRun( void ) +void ScriptEditorRun() { #if _MSC_VER >= 1300 MSG* msg = AfxGetCurrentMessage(); // TODO Robert fix me!! @@ -468,7 +468,7 @@ void ScriptEditorRun( void ) ScriptEditorShutdown ================ */ -void ScriptEditorShutdown( void ) +void ScriptEditorShutdown() { delete g_ScriptDialog; g_ScriptDialog = NULL; diff --git a/neo/tools/script/DialogScriptEditor.h b/neo/tools/script/DialogScriptEditor.h index 6089c93..3026cd4 100644 --- a/neo/tools/script/DialogScriptEditor.h +++ b/neo/tools/script/DialogScriptEditor.h @@ -98,8 +98,8 @@ class DialogScriptEditor : public CDialog int firstLine; private: - void InitScriptEvents( void ); - void UpdateStatusBar( void ); + void InitScriptEvents(); + void UpdateStatusBar(); }; #endif /* !__DIALOGSCRIPTEDITOR_H__ */ diff --git a/neo/tools/sound/DialogSound.cpp b/neo/tools/sound/DialogSound.cpp index 3ba142c..180cc5c 100644 --- a/neo/tools/sound/DialogSound.cpp +++ b/neo/tools/sound/DialogSound.cpp @@ -183,7 +183,7 @@ void SoundEditorInit( const idDict* spawnArgs ) } } -void SoundEditorRun( void ) +void SoundEditorRun() { #if _MSC_VER >= 1300 MSG* msg = AfxGetCurrentMessage(); // TODO Robert fix me!! @@ -200,7 +200,7 @@ void SoundEditorRun( void ) } } -void SoundEditorShutdown( void ) +void SoundEditorShutdown() { delete g_SoundDialog; g_SoundDialog = NULL;