diff --git a/neo/CMakeLists.txt b/neo/CMakeLists.txt index bec49bc1..558d87d0 100644 --- a/neo/CMakeLists.txt +++ b/neo/CMakeLists.txt @@ -50,7 +50,7 @@ option(CORE "Build the core" ON) option(BASE "Build the base game code" ON) option(D3XP "Build the d3xp game code" ON) if(MSVC) - option(TOOLS "Build the tools game code (32bit Windows+Visual Studio+SDL2 only)" OFF) + option(TOOLS "Build the tools game code (Visual Studio+SDL2 only)" OFF) endif() option(DEDICATED "Build the dedicated server" OFF) option(ONATIVE "Optimize for the host CPU" OFF) diff --git a/neo/tools/af/DialogAFBody.cpp b/neo/tools/af/DialogAFBody.cpp index a15156a0..8504e101 100644 --- a/neo/tools/af/DialogAFBody.cpp +++ b/neo/tools/af/DialogAFBody.cpp @@ -707,7 +707,7 @@ BOOL DialogAFBody::OnInitDialog() { DialogAFBody::OnToolHitTest ================ */ -int DialogAFBody::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { +INT_PTR DialogAFBody::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { CDialog::OnToolHitTest( point, pTI ); return DefaultOnToolHitTest( toolTips, this, point, pTI ); } diff --git a/neo/tools/af/DialogAFBody.h b/neo/tools/af/DialogAFBody.h index 8e93da9f..a438911c 100644 --- a/neo/tools/af/DialogAFBody.h +++ b/neo/tools/af/DialogAFBody.h @@ -49,7 +49,7 @@ public: protected: virtual BOOL OnInitDialog(); virtual void DoDataExchange( CDataExchange* pDX ); // DDX/DDV support - virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; + virtual INT_PTR OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; afx_msg BOOL OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ); afx_msg void OnShowWindow( BOOL bShow, UINT nStatus ); afx_msg void OnCbnSelchangeComboBodies(); diff --git a/neo/tools/af/DialogAFConstraint.cpp b/neo/tools/af/DialogAFConstraint.cpp index 67c41225..693c1a99 100644 --- a/neo/tools/af/DialogAFConstraint.cpp +++ b/neo/tools/af/DialogAFConstraint.cpp @@ -414,7 +414,7 @@ BOOL DialogAFConstraint::OnInitDialog() { DialogAFConstraint::OnToolHitTest ================ */ -int DialogAFConstraint::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { +INT_PTR DialogAFConstraint::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { CDialog::OnToolHitTest( point, pTI ); return DefaultOnToolHitTest( toolTips, this, point, pTI ); } diff --git a/neo/tools/af/DialogAFConstraint.h b/neo/tools/af/DialogAFConstraint.h index 634d5e98..c3a1c900 100644 --- a/neo/tools/af/DialogAFConstraint.h +++ b/neo/tools/af/DialogAFConstraint.h @@ -54,7 +54,7 @@ public: protected: virtual BOOL OnInitDialog(); virtual void DoDataExchange( CDataExchange* pDX ); // DDX/DDV support - virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; + virtual INT_PTR OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; afx_msg BOOL OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ); afx_msg void OnShowWindow( BOOL bShow, UINT nStatus ); afx_msg void OnCbnSelchangeComboConstraints(); diff --git a/neo/tools/af/DialogAFConstraintBallAndSocket.cpp b/neo/tools/af/DialogAFConstraintBallAndSocket.cpp index 1568499a..d962e5d6 100644 --- a/neo/tools/af/DialogAFConstraintBallAndSocket.cpp +++ b/neo/tools/af/DialogAFConstraintBallAndSocket.cpp @@ -325,7 +325,7 @@ void DialogAFConstraintBallAndSocket::UpdateFile( void ) { DialogAFConstraintBallAndSocket::OnToolHitTest ================ */ -int DialogAFConstraintBallAndSocket::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { +INT_PTR DialogAFConstraintBallAndSocket::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { CDialog::OnToolHitTest( point, pTI ); return DefaultOnToolHitTest( toolTips, this, point, pTI ); } diff --git a/neo/tools/af/DialogAFConstraintBallAndSocket.h b/neo/tools/af/DialogAFConstraintBallAndSocket.h index 35a9a273..f19b07b2 100644 --- a/neo/tools/af/DialogAFConstraintBallAndSocket.h +++ b/neo/tools/af/DialogAFConstraintBallAndSocket.h @@ -46,7 +46,7 @@ public: protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; + virtual INT_PTR OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; afx_msg BOOL OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ); afx_msg void OnBnClickedRadioAnchorJoint(); afx_msg void OnBnClickedRadioAnchorCoordinates(); diff --git a/neo/tools/af/DialogAFConstraintFixed.cpp b/neo/tools/af/DialogAFConstraintFixed.cpp index 849716c7..00e9e493 100644 --- a/neo/tools/af/DialogAFConstraintFixed.cpp +++ b/neo/tools/af/DialogAFConstraintFixed.cpp @@ -150,7 +150,7 @@ void DialogAFConstraintFixed::UpdateFile( void ) { DialogAFConstraintFixed::OnToolHitTest ================ */ -int DialogAFConstraintFixed::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { +INT_PTR DialogAFConstraintFixed::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { CDialog::OnToolHitTest( point, pTI ); return DefaultOnToolHitTest( toolTips, this, point, pTI ); } diff --git a/neo/tools/af/DialogAFConstraintFixed.h b/neo/tools/af/DialogAFConstraintFixed.h index 64af6f39..fcb79972 100644 --- a/neo/tools/af/DialogAFConstraintFixed.h +++ b/neo/tools/af/DialogAFConstraintFixed.h @@ -46,7 +46,7 @@ public: protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; + virtual INT_PTR OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; afx_msg BOOL OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ); DECLARE_MESSAGE_MAP() diff --git a/neo/tools/af/DialogAFConstraintHinge.cpp b/neo/tools/af/DialogAFConstraintHinge.cpp index dd0031a7..67a5187e 100644 --- a/neo/tools/af/DialogAFConstraintHinge.cpp +++ b/neo/tools/af/DialogAFConstraintHinge.cpp @@ -273,7 +273,7 @@ void DialogAFConstraintHinge::UpdateFile( void ) { DialogAFConstraintHinge::OnToolHitTest ================ */ -int DialogAFConstraintHinge::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { +INT_PTR DialogAFConstraintHinge::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { CDialog::OnToolHitTest( point, pTI ); return DefaultOnToolHitTest( toolTips, this, point, pTI ); } diff --git a/neo/tools/af/DialogAFConstraintHinge.h b/neo/tools/af/DialogAFConstraintHinge.h index b98bd606..9e0c4d40 100644 --- a/neo/tools/af/DialogAFConstraintHinge.h +++ b/neo/tools/af/DialogAFConstraintHinge.h @@ -46,7 +46,7 @@ public: protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; + virtual INT_PTR OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; afx_msg BOOL OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ); afx_msg void OnBnClickedRadioAnchorJoint(); afx_msg void OnBnClickedRadioAnchorCoordinates(); diff --git a/neo/tools/af/DialogAFConstraintSlider.cpp b/neo/tools/af/DialogAFConstraintSlider.cpp index 77e31864..06fa36b1 100644 --- a/neo/tools/af/DialogAFConstraintSlider.cpp +++ b/neo/tools/af/DialogAFConstraintSlider.cpp @@ -210,7 +210,7 @@ void DialogAFConstraintSlider::UpdateFile( void ) { DialogAFConstraintSlider::OnToolHitTest ================ */ -int DialogAFConstraintSlider::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { +INT_PTR DialogAFConstraintSlider::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { CDialog::OnToolHitTest( point, pTI ); return DefaultOnToolHitTest( toolTips, this, point, pTI ); } diff --git a/neo/tools/af/DialogAFConstraintSlider.h b/neo/tools/af/DialogAFConstraintSlider.h index cbbdf11a..d5cf53b8 100644 --- a/neo/tools/af/DialogAFConstraintSlider.h +++ b/neo/tools/af/DialogAFConstraintSlider.h @@ -46,7 +46,7 @@ public: protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; + virtual INT_PTR OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; afx_msg BOOL OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ); afx_msg void OnBnClickedRadioSliderAxisBone(); afx_msg void OnBnClickedRadioSliderAxisAngles(); diff --git a/neo/tools/af/DialogAFConstraintSpring.cpp b/neo/tools/af/DialogAFConstraintSpring.cpp index b3428fd5..ccb18c9c 100644 --- a/neo/tools/af/DialogAFConstraintSpring.cpp +++ b/neo/tools/af/DialogAFConstraintSpring.cpp @@ -293,7 +293,7 @@ void DialogAFConstraintSpring::UpdateFile( void ) { DialogAFConstraintSpring::OnToolHitTest ================ */ -int DialogAFConstraintSpring::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { +INT_PTR DialogAFConstraintSpring::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { CDialog::OnToolHitTest( point, pTI ); return DefaultOnToolHitTest( toolTips, this, point, pTI ); } diff --git a/neo/tools/af/DialogAFConstraintSpring.h b/neo/tools/af/DialogAFConstraintSpring.h index 31e48719..f9c7f8c4 100644 --- a/neo/tools/af/DialogAFConstraintSpring.h +++ b/neo/tools/af/DialogAFConstraintSpring.h @@ -46,7 +46,7 @@ public: protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; + virtual INT_PTR OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; afx_msg BOOL OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ); afx_msg void OnBnClickedRadioAnchorJoint(); afx_msg void OnBnClickedRadioAnchorCoordinates(); diff --git a/neo/tools/af/DialogAFConstraintUniversal.cpp b/neo/tools/af/DialogAFConstraintUniversal.cpp index 613b7114..bcd186b2 100644 --- a/neo/tools/af/DialogAFConstraintUniversal.cpp +++ b/neo/tools/af/DialogAFConstraintUniversal.cpp @@ -369,7 +369,7 @@ void DialogAFConstraintUniversal::UpdateFile( void ) { DialogAFConstraintUniversal::OnToolHitTest ================ */ -int DialogAFConstraintUniversal::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { +INT_PTR DialogAFConstraintUniversal::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { CDialog::OnToolHitTest( point, pTI ); return DefaultOnToolHitTest( toolTips, this, point, pTI ); } diff --git a/neo/tools/af/DialogAFConstraintUniversal.h b/neo/tools/af/DialogAFConstraintUniversal.h index 927f6cfd..23c3e370 100644 --- a/neo/tools/af/DialogAFConstraintUniversal.h +++ b/neo/tools/af/DialogAFConstraintUniversal.h @@ -46,7 +46,7 @@ public: protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; + virtual INT_PTR OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; afx_msg BOOL OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ); afx_msg void OnBnClickedRadioAnchorJoint(); afx_msg void OnBnClickedRadioAnchorCoordinates(); diff --git a/neo/tools/af/DialogAFProperties.cpp b/neo/tools/af/DialogAFProperties.cpp index be6232c7..1bfd5e2b 100644 --- a/neo/tools/af/DialogAFProperties.cpp +++ b/neo/tools/af/DialogAFProperties.cpp @@ -253,7 +253,7 @@ void DialogAFProperties::ClearFile( void ) { DialogAFProperties::OnToolHitTest ================ */ -int DialogAFProperties::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { +INT_PTR DialogAFProperties::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { CDialog::OnToolHitTest( point, pTI ); return DefaultOnToolHitTest( toolTips, this, point, pTI ); } diff --git a/neo/tools/af/DialogAFProperties.h b/neo/tools/af/DialogAFProperties.h index 2abf7d32..8b48d053 100644 --- a/neo/tools/af/DialogAFProperties.h +++ b/neo/tools/af/DialogAFProperties.h @@ -46,7 +46,7 @@ public: protected: virtual void DoDataExchange( CDataExchange* pDX ); // DDX/DDV support - virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; + virtual INT_PTR OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; afx_msg BOOL OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ); afx_msg void OnEnChangeEditModel(); afx_msg void OnEnChangeEditSkin(); diff --git a/neo/tools/af/DialogAFView.cpp b/neo/tools/af/DialogAFView.cpp index 652a6f27..0ba1db3f 100644 --- a/neo/tools/af/DialogAFView.cpp +++ b/neo/tools/af/DialogAFView.cpp @@ -150,7 +150,7 @@ void DialogAFView::DoDataExchange(CDataExchange* pDX) { DialogAFView::OnToolHitTest ================ */ -int DialogAFView::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { +INT_PTR DialogAFView::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { CDialog::OnToolHitTest( point, pTI ); return DefaultOnToolHitTest( toolTips, this, point, pTI ); } diff --git a/neo/tools/af/DialogAFView.h b/neo/tools/af/DialogAFView.h index da2f411b..21ded2b2 100644 --- a/neo/tools/af/DialogAFView.h +++ b/neo/tools/af/DialogAFView.h @@ -41,7 +41,7 @@ public: protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; + virtual INT_PTR OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; afx_msg BOOL OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ); afx_msg void OnBnClickedCheckViewBodies(); afx_msg void OnBnClickedCheckViewBodynames(); diff --git a/neo/tools/comafx/CPathTreeCtrl.cpp b/neo/tools/comafx/CPathTreeCtrl.cpp index cb580a38..feb9a882 100644 --- a/neo/tools/comafx/CPathTreeCtrl.cpp +++ b/neo/tools/comafx/CPathTreeCtrl.cpp @@ -241,7 +241,7 @@ END_MESSAGE_MAP() CPathTreeCtrl::OnToolHitTest ================ */ -int CPathTreeCtrl::OnToolHitTest( CPoint point, TOOLINFO * pTI ) const { +INT_PTR CPathTreeCtrl::OnToolHitTest( CPoint point, TOOLINFO * pTI ) const { RECT rect; UINT nFlags; diff --git a/neo/tools/comafx/CPathTreeCtrl.h b/neo/tools/comafx/CPathTreeCtrl.h index 6441e456..1ec64393 100644 --- a/neo/tools/comafx/CPathTreeCtrl.h +++ b/neo/tools/comafx/CPathTreeCtrl.h @@ -84,7 +84,7 @@ public: protected: virtual void PreSubclassWindow(); - virtual int OnToolHitTest( CPoint point, TOOLINFO * pTI ) const; + virtual INT_PTR OnToolHitTest( CPoint point, TOOLINFO * pTI ) const; afx_msg BOOL OnToolTipText( UINT id, NMHDR * pNMHDR, LRESULT * pResult ); DECLARE_MESSAGE_MAP() diff --git a/neo/tools/comafx/CSyntaxRichEditCtrl.cpp b/neo/tools/comafx/CSyntaxRichEditCtrl.cpp index 0315d695..f8207aa5 100644 --- a/neo/tools/comafx/CSyntaxRichEditCtrl.cpp +++ b/neo/tools/comafx/CSyntaxRichEditCtrl.cpp @@ -1361,7 +1361,7 @@ void CSyntaxRichEditCtrl::GoToLine( int line ) { CSyntaxRichEditCtrl::OnToolHitTest ================ */ -int CSyntaxRichEditCtrl::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { +INT_PTR CSyntaxRichEditCtrl::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { CRichEditCtrl::OnToolHitTest( point, pTI ); pTI->hwnd = GetSafeHwnd(); diff --git a/neo/tools/comafx/CSyntaxRichEditCtrl.h b/neo/tools/comafx/CSyntaxRichEditCtrl.h index 274b8417..5a8ff53b 100644 --- a/neo/tools/comafx/CSyntaxRichEditCtrl.h +++ b/neo/tools/comafx/CSyntaxRichEditCtrl.h @@ -128,7 +128,7 @@ public: void ReplaceText( int startCharIndex, int endCharIndex, const char *replace ); protected: - virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; + virtual INT_PTR OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; afx_msg BOOL OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ); afx_msg UINT OnGetDlgCode(); afx_msg void OnChar( UINT nChar, UINT nRepCnt, UINT nFlags ); diff --git a/neo/tools/comafx/DialogColorPicker.cpp b/neo/tools/comafx/DialogColorPicker.cpp index c92570b2..fa829c83 100644 --- a/neo/tools/comafx/DialogColorPicker.cpp +++ b/neo/tools/comafx/DialogColorPicker.cpp @@ -46,7 +46,7 @@ class CMyColorDialog : public CColorDialog // Construction public: CMyColorDialog( COLORREF clrInit = 0, DWORD dwFlags = 0, CWnd *pParentWnd = NULL ); - virtual int DoModal(); + virtual INT_PTR DoModal(); protected: enum { NCUSTCOLORS = 16 }; @@ -120,7 +120,7 @@ CMyColorDialog::CMyColorDialog( COLORREF clrInit, DWORD dwFlags, m_cc.lpCustColors = c_CustColors; } -int CMyColorDialog::DoModal() { +INT_PTR CMyColorDialog::DoModal() { int code = CColorDialog::DoModal(); SaveCustColors(); return code; @@ -1281,7 +1281,7 @@ void CDialogColorPicker::OnSysColorChange() LoadMappedBitmap(m_RgbBitmap,IDB_BITMAP_RGB,size); } -void CDialogColorPicker::OnTimer(UINT nIDEvent) { +void CDialogColorPicker::OnTimer(UINT_PTR nIDEvent) { if ( UpdateParent ) { UpdateParent( color.r, color.g, color.b, 1.0f ); } diff --git a/neo/tools/comafx/DialogColorPicker.h b/neo/tools/comafx/DialogColorPicker.h index f71527a8..c18173b5 100644 --- a/neo/tools/comafx/DialogColorPicker.h +++ b/neo/tools/comafx/DialogColorPicker.h @@ -112,7 +112,7 @@ protected: afx_msg void OnChangeEditSat(); afx_msg void OnChangeEditVal(); afx_msg void OnChangeEditOverbright(); - afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg void OnBtnColor(); //}}AFX_MSG DECLARE_MESSAGE_MAP() diff --git a/neo/tools/comafx/StdAfx.cpp b/neo/tools/comafx/StdAfx.cpp index 5a9773cf..b6959d87 100644 --- a/neo/tools/comafx/StdAfx.cpp +++ b/neo/tools/comafx/StdAfx.cpp @@ -72,7 +72,7 @@ void InitAfx( void ) { DefaultOnToolHitTest ================ */ -int DefaultOnToolHitTest( const toolTip_t *toolTips, const CDialog *dialog, CPoint point, TOOLINFO* pTI ) { +INT_PTR DefaultOnToolHitTest( const toolTip_t *toolTips, const CDialog *dialog, CPoint point, TOOLINFO* pTI ) { CWnd *wnd; RECT clientRect, rect; diff --git a/neo/tools/comafx/StdAfx.h b/neo/tools/comafx/StdAfx.h index 6b336fa1..253a9889 100644 --- a/neo/tools/comafx/StdAfx.h +++ b/neo/tools/comafx/StdAfx.h @@ -50,7 +50,7 @@ typedef struct toolTip_s { char *tip; } toolTip_t; -int DefaultOnToolHitTest( const toolTip_t *toolTips, const CDialog *dialog, CPoint point, TOOLINFO* pTI ); +INT_PTR DefaultOnToolHitTest( const toolTip_t *toolTips, const CDialog *dialog, CPoint point, TOOLINFO* pTI ); BOOL DefaultOnToolTipNotify( const toolTip_t *toolTips, UINT id, NMHDR *pNMHDR, LRESULT *pResult ); // edit control diff --git a/neo/tools/common/AlphaPopup.cpp b/neo/tools/common/AlphaPopup.cpp index 68eb557f..ee620476 100644 --- a/neo/tools/common/AlphaPopup.cpp +++ b/neo/tools/common/AlphaPopup.cpp @@ -91,7 +91,7 @@ LRESULT CALLBACK AlphaSlider_WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARA v = (float)((short)LOWORD(lParam)-5) / (float)(rClient.right - rClient.left - 10); if ( v < 0 ) v = 0; if ( v > 1.0f ) v = 1.0f; - SetWindowLong ( hwnd, GWL_USERDATA, MAKELONG(0x8000,(unsigned short)(255.0f * v)) ); + SetWindowLongPtr ( hwnd, GWLP_USERDATA, MAKELONG(0x8000,(unsigned short)(255.0f * v)) ); InvalidateRect ( hwnd, NULL, FALSE ); SetCapture ( hwnd ); @@ -100,7 +100,7 @@ LRESULT CALLBACK AlphaSlider_WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARA } case WM_MOUSEMOVE: - if ( LOWORD(GetWindowLong ( hwnd, GWL_USERDATA ) ) & 0x8000 ) + if ( LOWORD( GetWindowLongPtr ( hwnd, GWLP_USERDATA ) ) & 0x8000 ) { RECT rClient; float v; @@ -109,13 +109,13 @@ LRESULT CALLBACK AlphaSlider_WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARA v = (float)((short)LOWORD(lParam)-5) / (float)(rClient.right - rClient.left - 10); if ( v < 0 ) v = 0; if ( v > 1.0f ) v = 1.0f; - SetWindowLong ( hwnd, GWL_USERDATA, MAKELONG(0x8000,(unsigned short)(255.0f * v)) ); + SetWindowLongPtr ( hwnd, GWLP_USERDATA, MAKELONG(0x8000,(unsigned short)(255.0f * v)) ); InvalidateRect ( hwnd, NULL, FALSE ); } break; case WM_LBUTTONUP: - if ( LOWORD(GetWindowLong ( hwnd, GWL_USERDATA ) ) & 0x8000 ) + if ( LOWORD( GetWindowLongPtr ( hwnd, GWLP_USERDATA ) ) & 0x8000 ) { RECT rClient; float v; @@ -124,7 +124,7 @@ LRESULT CALLBACK AlphaSlider_WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARA v = (float)((short)LOWORD(lParam)-5) / (float)(rClient.right - rClient.left - 10); if ( v < 0 ) v = 0; if ( v > 1.0f ) v = 1.0f; - SetWindowLong ( hwnd, GWL_USERDATA, MAKELONG(0x8000,(unsigned short)(255.0f * v)) ); + SetWindowLongPtr ( hwnd, GWLP_USERDATA, MAKELONG(0x8000,(unsigned short)(255.0f * v)) ); InvalidateRect ( hwnd, NULL, FALSE ); ReleaseCapture ( ); SendMessage ( GetParent ( hwnd ), WM_COMMAND, MAKELONG(GetWindowLong (hwnd,GWL_ID),0), 0 ); @@ -172,7 +172,7 @@ LRESULT CALLBACK AlphaSlider_WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARA // Draw the thumb RECT rThumb; - short s = HIWORD(GetWindowLong ( hwnd, GWL_USERDATA )); + short s = HIWORD(GetWindowLongPtr ( hwnd, GWLP_USERDATA )); float thumb = (float)(short)s; thumb /= 255.0f; thumb *= (float)(rDraw.right-rDraw.left); @@ -242,10 +242,10 @@ INT_PTR CALLBACK AlphaSelectDlg_WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LP color = GetRValue(ColorButton_GetColor ((HWND)lParam)); // The lParam for the alpha select dialog is the window handle of the button pressed - SetWindowLong ( hwnd, GWL_USERDATA, lParam ); + SetWindowLongPtr ( hwnd, GWLP_USERDATA, lParam ); // Subclass the alpha - SetWindowLong ( GetDlgItem ( hwnd, IDC_GUIED_ALPHASLIDER ), GWL_USERDATA, MAKELONG(0,color) ); + SetWindowLongPtr ( GetDlgItem ( hwnd, IDC_GUIED_ALPHASLIDER ), GWLP_USERDATA, MAKELONG(0,color) ); // Numbers only on the edit box and start it with the current alpha value. NumberEdit_Attach ( GetDlgItem ( hwnd, IDC_GUIED_ALPHA ) ); @@ -288,15 +288,15 @@ INT_PTR CALLBACK AlphaSelectDlg_WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LP } // Set the current alpha value in the slider - SetWindowLong ( GetDlgItem ( hwnd, IDC_GUIED_ALPHASLIDER ), GWL_USERDATA, MAKELONG(0,(255.0f * value)) ); + SetWindowLongPtr ( GetDlgItem ( hwnd, IDC_GUIED_ALPHASLIDER ), GWLP_USERDATA, MAKELONG(0,(255.0f * value)) ); break; } case IDC_GUIED_ALPHASLIDER: case IDOK: { - int color = (short)HIWORD(GetWindowLong ( GetDlgItem ( hwnd, IDC_GUIED_ALPHASLIDER ), GWL_USERDATA )); - ColorButton_SetColor ( (HWND)GetWindowLong ( hwnd, GWL_USERDATA ), RGB(color,color,color) ); + int color = (short)HIWORD( GetWindowLongPtr ( GetDlgItem ( hwnd, IDC_GUIED_ALPHASLIDER ), GWLP_USERDATA )); + ColorButton_SetColor ( (HWND)GetWindowLongPtr ( hwnd, GWLP_USERDATA ), RGB(color,color,color) ); EndDialog ( hwnd, 0 ); break; } diff --git a/neo/tools/common/ColorButton.cpp b/neo/tools/common/ColorButton.cpp index 044e31fd..5f07d5d1 100644 --- a/neo/tools/common/ColorButton.cpp +++ b/neo/tools/common/ColorButton.cpp @@ -47,7 +47,7 @@ void ColorButton_SetColor ( HWND hWnd, COLORREF color ) { return; } - SetWindowLong ( hWnd, GWL_USERDATA, color ); + SetWindowLongPtr ( hWnd, GWLP_USERDATA, color ); InvalidateRect ( hWnd, NULL, FALSE ); } @@ -94,7 +94,7 @@ Retrieves the current color button color */ COLORREF ColorButton_GetColor ( HWND hWnd ) { - return (COLORREF) GetWindowLong ( hWnd, GWL_USERDATA ); + return (COLORREF) GetWindowLongPtr ( hWnd, GWLP_USERDATA ); } /* @@ -198,7 +198,7 @@ void ColorButton_DrawItem ( HWND hWnd, LPDRAWITEMSTRUCT dis ) // Draw Color if ((state & ODS_DISABLED) == 0) { - HBRUSH color = CreateSolidBrush ( (COLORREF)GetWindowLong ( hWnd, GWL_USERDATA ) ); + HBRUSH color = CreateSolidBrush ( (COLORREF)GetWindowLongPtr ( hWnd, GWLP_USERDATA ) ); FillRect ( hDC, &rDraw, color ); FrameRect ( hDC, &rDraw, (HBRUSH)::GetStockObject(BLACK_BRUSH)); DeleteObject( color ); diff --git a/neo/tools/common/MaskEdit.cpp b/neo/tools/common/MaskEdit.cpp index c4970356..a6ade643 100644 --- a/neo/tools/common/MaskEdit.cpp +++ b/neo/tools/common/MaskEdit.cpp @@ -45,7 +45,7 @@ Prevents the invalid characters from being entered */ LRESULT CALLBACK MaskEdit_WndProc ( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - rvGEMaskEdit* edit = (rvGEMaskEdit*)GetWindowLong ( hWnd, GWL_USERDATA ); + rvGEMaskEdit* edit = (rvGEMaskEdit*)GetWindowLongPtr ( hWnd, GWLP_USERDATA ); WNDPROC wndproc = edit->mProc; switch ( msg ) @@ -60,7 +60,7 @@ LRESULT CALLBACK MaskEdit_WndProc ( HWND hWnd, UINT msg, WPARAM wParam, LPARAM l case WM_DESTROY: delete edit; - SetWindowLong ( hWnd, GWL_WNDPROC, (LONG)wndproc ); + SetWindowLongPtr ( hWnd, GWLP_WNDPROC, (LONG)wndproc ); break; } @@ -77,10 +77,10 @@ Attaches the mask edit control to a normal edit control void MaskEdit_Attach ( HWND hWnd, const char* invalid ) { rvGEMaskEdit* edit = new rvGEMaskEdit; - edit->mProc = (WNDPROC)GetWindowLong ( hWnd, GWL_WNDPROC ); + edit->mProc = (WNDPROC)GetWindowLongPtr ( hWnd, GWLP_WNDPROC ); strcpy ( edit->mInvalid, invalid ); - SetWindowLong ( hWnd, GWL_USERDATA, (LONG)edit ); - SetWindowLong ( hWnd, GWL_WNDPROC, (LONG)MaskEdit_WndProc ); + SetWindowLongPtr ( hWnd, GWLP_USERDATA, (LONG)edit ); + SetWindowLongPtr ( hWnd, GWLP_WNDPROC, (LONG)MaskEdit_WndProc ); } /* diff --git a/neo/tools/common/OpenFileDialog.cpp b/neo/tools/common/OpenFileDialog.cpp index 4927dc05..0c334ef5 100644 --- a/neo/tools/common/OpenFileDialog.cpp +++ b/neo/tools/common/OpenFileDialog.cpp @@ -413,13 +413,13 @@ Dialog Procedure for the open file dialog */ INT_PTR rvOpenFileDialog::DlgProc ( HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam ) { - rvOpenFileDialog* dlg = (rvOpenFileDialog*) GetWindowLong ( wnd, GWL_USERDATA ); + rvOpenFileDialog* dlg = (rvOpenFileDialog*) GetWindowLongPtr ( wnd, GWLP_USERDATA ); switch ( msg ) { case WM_INITDIALOG: dlg = (rvOpenFileDialog*) lparam; - SetWindowLong ( wnd, GWL_USERDATA, lparam ); + SetWindowLongPtr ( wnd, GWLP_USERDATA, lparam ); dlg->mWnd = wnd; dlg->HandleInitDialog ( ); return TRUE; diff --git a/neo/tools/common/PropertyGrid.cpp b/neo/tools/common/PropertyGrid.cpp index efe87074..42c84aae 100644 --- a/neo/tools/common/PropertyGrid.cpp +++ b/neo/tools/common/PropertyGrid.cpp @@ -76,9 +76,9 @@ bool rvPropertyGrid::Create ( HWND parent, int id, int style ) // Create the List view mWindow = CreateWindowEx ( 0, "LISTBOX", "", WS_VSCROLL|WS_CHILD|WS_VISIBLE|LBS_OWNERDRAWFIXED|LBS_NOINTEGRALHEIGHT|LBS_NOTIFY, 0, 0, 0, 0, parent, (HMENU)id, win32.hInstance, 0 ); - mListWndProc = (WNDPROC)GetWindowLong ( mWindow, GWL_WNDPROC ); - SetWindowLong ( mWindow, GWL_USERDATA, (LONG)this ); - SetWindowLong ( mWindow, GWL_WNDPROC, (LONG)WndProc ); + mListWndProc = (WNDPROC)GetWindowLongPtr ( mWindow, GWLP_WNDPROC ); + SetWindowLongPtr ( mWindow, GWLP_USERDATA, (LONG)this ); + SetWindowLongPtr ( mWindow, GWLP_WNDPROC, (LONG)WndProc ); LoadLibrary ( "Riched20.dll" ); mEdit = CreateWindowEx ( 0, "RichEdit20A", "", WS_CHILD, 0, 0, 0, 0, mWindow, (HMENU) 999, win32.hInstance, NULL ); @@ -383,7 +383,7 @@ Window procedure for property grid */ LRESULT CALLBACK rvPropertyGrid::WndProc ( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - rvPropertyGrid* grid = (rvPropertyGrid*) GetWindowLong ( hWnd, GWL_USERDATA ); + rvPropertyGrid* grid = (rvPropertyGrid*) GetWindowLongPtr ( hWnd, GWLP_USERDATA ); switch ( msg ) { @@ -398,7 +398,7 @@ LRESULT CALLBACK rvPropertyGrid::WndProc ( HWND hWnd, UINT msg, WPARAM wParam, L nmkey.hdr.hwndFrom = grid->mWindow; nmkey.nVKey = wParam; nmkey.uFlags = HIWORD(lParam); - nmkey.hdr.idFrom = GetWindowLong ( hWnd, GWL_ID ); + nmkey.hdr.idFrom = GetWindowLongPtr ( hWnd, GWL_ID ); SendMessage ( GetParent ( hWnd ), WM_NOTIFY, nmkey.hdr.idFrom, (LPARAM)&nmkey ); break; } diff --git a/neo/tools/common/RollupPanel.cpp b/neo/tools/common/RollupPanel.cpp index 09407fd5..452bbe0d 100644 --- a/neo/tools/common/RollupPanel.cpp +++ b/neo/tools/common/RollupPanel.cpp @@ -161,8 +161,8 @@ int rvRollupPanel::InsertItem ( const char* caption, HWND dialog, bool autoDestr item->mDialog = dialog; item->mButton = button; item->mGroupBox = groupbox; - item->mOldDlgProc = (WNDPROC) GetWindowLong ( dialog, DWL_DLGPROC ); - item->mOldButtonProc = (WNDPROC) GetWindowLong ( button, GWL_WNDPROC ); + item->mOldDlgProc = (WNDPROC) GetWindowLongPtr ( dialog, DWLP_DLGPROC ); + item->mOldButtonProc = (WNDPROC) GetWindowLongPtr ( button, GWLP_WNDPROC ); item->mAutoDestroy = autoDestroy; strcpy ( item->mCaption, caption ); @@ -176,17 +176,17 @@ int rvRollupPanel::InsertItem ( const char* caption, HWND dialog, bool autoDestr } // Store data with the dialog window in its user data - SetWindowLong ( dialog, GWL_USERDATA, (LONG)item ); + SetWindowLongPtr ( dialog, GWLP_USERDATA, (LONG)item ); // Attach item to button through user data - SetWindowLong ( button, GWL_USERDATA, (LONG)item ); - SetWindowLong ( button, GWL_ID, index ); + SetWindowLongPtr( button, GWLP_USERDATA, (LONG)item ); + SetWindowLongPtr( button, GWL_ID, index ); // Subclass dialog - SetWindowLong ( dialog, DWL_DLGPROC, (LONG)DialogProc ); + SetWindowLongPtr( dialog, DWLP_DLGPROC, (LONG)DialogProc ); // SubClass button - SetWindowLong ( button, GWL_WNDPROC, (LONG)ButtonProc ); + SetWindowLongPtr( button, GWLP_WNDPROC, (LONG)ButtonProc ); // Update mItemHeight += RP_PGBUTTONHEIGHT+(RP_GRPBOXINDENT/2); @@ -699,8 +699,8 @@ Dialog procedure for items */ LRESULT CALLBACK rvRollupPanel::DialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - RPITEM* item = (RPITEM*)GetWindowLong ( hWnd, GWL_USERDATA ); - rvRollupPanel* _this = (rvRollupPanel*)GetWindowLong ( GetParent ( hWnd ), GWL_USERDATA ); + RPITEM* item = (RPITEM*)GetWindowLongPtr ( hWnd, GWLP_USERDATA ); + rvRollupPanel* _this = (rvRollupPanel*)GetWindowLongPtr( GetParent ( hWnd ), GWLP_USERDATA ); RECT r; GetClientRect ( _this->mWindow, &r ); @@ -771,7 +771,7 @@ LRESULT CALLBACK rvRollupPanel::ButtonProc (HWND hWnd, UINT uMsg, WPARAM wParam, return FALSE; } - RPITEM* item = (RPITEM*)GetWindowLong(hWnd, GWL_USERDATA); + RPITEM* item = (RPITEM*)GetWindowLongPtr(hWnd, GWLP_USERDATA); return ::CallWindowProc( item->mOldButtonProc, hWnd, uMsg, wParam, lParam ); } @@ -785,7 +785,7 @@ Window procedure for rollup panel LRESULT CALLBACK rvRollupPanel::WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { rvRollupPanel* panel; - panel = (rvRollupPanel*)GetWindowLong (hWnd, GWL_USERDATA); + panel = (rvRollupPanel*)GetWindowLongPtr (hWnd, GWLP_USERDATA); switch ( uMsg ) { @@ -796,7 +796,7 @@ LRESULT CALLBACK rvRollupPanel::WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, // Attach the class to the window first cs = (LPCREATESTRUCT) lParam; panel = (rvRollupPanel*) cs->lpCreateParams; - SetWindowLong ( hWnd, GWL_USERDATA, (LONG)panel ); + SetWindowLongPtr ( hWnd, GWLP_USERDATA, (LONG)panel ); break; } diff --git a/neo/tools/common/SpinButton.cpp b/neo/tools/common/SpinButton.cpp index 8520bf41..a1cde7be 100644 --- a/neo/tools/common/SpinButton.cpp +++ b/neo/tools/common/SpinButton.cpp @@ -33,7 +33,7 @@ If you have questions concerning this license or the applicable additional terms void SpinButton_SetIncrement ( HWND hWnd, float inc ) { - SetWindowLong ( hWnd, GWL_USERDATA, (long)(inc * 100.0f) ); + SetWindowLongPtr ( hWnd, GWLP_USERDATA, (long)(inc * 100.0f) ); } void SpinButton_SetRange ( HWND hWnd, float minRange, float maxRange ) @@ -51,11 +51,11 @@ void SpinButton_HandleNotify ( NMHDR* hdr ) float value; GetWindowText ( (HWND)SendMessage ( hdr->hwndFrom, UDM_GETBUDDY, 0, 0 ), strValue, 63 ); - float inc = (float)GetWindowLong ( hdr->hwndFrom, GWL_USERDATA ); + float inc = (float)GetWindowLongPtr ( hdr->hwndFrom, GWLP_USERDATA ); if ( inc == 0 ) { inc = 100.0f; - SetWindowLong ( hdr->hwndFrom, GWL_USERDATA, 100 ); + SetWindowLongPtr ( hdr->hwndFrom, GWLP_USERDATA, 100 ); } inc /= 100.0f; diff --git a/neo/tools/guied/GEApp.cpp b/neo/tools/guied/GEApp.cpp index 440d307b..0f65b7ed 100644 --- a/neo/tools/guied/GEApp.cpp +++ b/neo/tools/guied/GEApp.cpp @@ -123,7 +123,7 @@ bool rvGEApp::Initialize ( void ) return false; } - SetClassLong( mMDIFrame, GCL_HICON, ( LONG )LoadIcon( win32.hInstance, MAKEINTRESOURCE( IDI_GUIED ) ) ); + SetClassLongPtr( mMDIFrame, GCLP_HICON, (LONG_PTR)LoadIcon( win32.hInstance, MAKEINTRESOURCE( IDI_GUIED ) ) ); // Create the MDI window CLIENTCREATESTRUCT ccs; @@ -263,7 +263,7 @@ Main frame window procedure */ LRESULT CALLBACK rvGEApp::FrameWndProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { - rvGEApp* app = (rvGEApp*) GetWindowLong ( hWnd, GWL_USERDATA ); + rvGEApp* app = (rvGEApp*) GetWindowLongPtr ( hWnd, GWLP_USERDATA ); switch ( uMsg ) { @@ -348,7 +348,7 @@ LRESULT CALLBACK rvGEApp::FrameWndProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LP assert ( app ); - SetWindowLong ( hWnd, GWL_USERDATA, (LONG)app ); + SetWindowLongPtr( hWnd, GWLP_USERDATA, (LONG_PTR)app ); app->mMDIFrame = hWnd; @@ -385,7 +385,7 @@ MDI Child window procedure */ LRESULT CALLBACK rvGEApp::MDIChildProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { - rvGEWorkspace* workspace = (rvGEWorkspace*)GetWindowLong ( hWnd, GWL_USERDATA ); + rvGEWorkspace* workspace = (rvGEWorkspace*)GetWindowLongPtr ( hWnd, GWLP_USERDATA ); // Give the active workspace a chance to play with it if ( workspace ) diff --git a/neo/tools/guied/GECheckInDlg.cpp b/neo/tools/guied/GECheckInDlg.cpp index 1fd627be..5b540a3c 100644 --- a/neo/tools/guied/GECheckInDlg.cpp +++ b/neo/tools/guied/GECheckInDlg.cpp @@ -49,12 +49,12 @@ Dialog procedure for the check in dialog */ static INT_PTR CALLBACK GECheckInDlg_GeneralProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - GECHECKINDLG* dlg = (GECHECKINDLG*) GetWindowLong ( hwnd, GWL_USERDATA ); + GECHECKINDLG* dlg = (GECHECKINDLG*) GetWindowLongPtr ( hwnd, GWLP_USERDATA ); switch ( msg ) { case WM_INITDIALOG: - SetWindowLong ( hwnd, GWL_USERDATA, lParam ); + SetWindowLongPtr ( hwnd, GWLP_USERDATA, lParam ); dlg = (GECHECKINDLG*) lParam; SetWindowText ( GetDlgItem ( hwnd, IDC_GUIED_FILENAME ), dlg->mFilename ); diff --git a/neo/tools/guied/GEItemPropsDlg.cpp b/neo/tools/guied/GEItemPropsDlg.cpp index b717f676..8788251a 100644 --- a/neo/tools/guied/GEItemPropsDlg.cpp +++ b/neo/tools/guied/GEItemPropsDlg.cpp @@ -706,7 +706,7 @@ INT_PTR CALLBACK ModifyItemKeyDlg_WndProc ( HWND hwnd, UINT msg, WPARAM wParam, SetWindowText ( hwnd, "New Item Key" ); } - SetWindowLong ( hwnd, GWL_USERDATA, lParam ); + SetWindowLongPtr ( hwnd, GWLP_USERDATA, lParam ); return FALSE; } @@ -718,7 +718,7 @@ INT_PTR CALLBACK ModifyItemKeyDlg_WndProc ( HWND hwnd, UINT msg, WPARAM wParam, char key[1024]; char value[1024]; - const idKeyValue* keyValue = (const idKeyValue*) GetWindowLong ( hwnd, GWL_USERDATA ); + const idKeyValue* keyValue = (const idKeyValue*) GetWindowLongPtr ( hwnd, GWLP_USERDATA ); GetWindowText ( GetDlgItem ( hwnd, IDC_GUIED_ITEMKEY ), key, 1024 ); GetWindowText ( GetDlgItem ( hwnd, IDC_GUIED_ITEMVALUE ), value, 1024 ); @@ -965,25 +965,28 @@ bool rvGEItemPropsKeysPage::SetActive ( void ) // Delete anything already in there ListView_DeleteAllItems ( list ); - // Add each key in the properties dictionary - for ( i = 0; i < mDict->GetNumKeyVals(); i ++ ) + if ( mDict != NULL ) { - const idKeyValue* key = mDict->GetKeyVal ( i ); - assert ( key ); - - // Add the item - LVITEM item; - ZeroMemory ( &item, sizeof(item) ); - item.mask = LVIF_TEXT|LVIF_PARAM; - item.iItem = ListView_GetItemCount ( list ); - item.pszText = (LPSTR)key->GetKey().c_str ( ); - item.lParam = (LONG) key; - int index = ListView_InsertItem ( list, &item ); - - idStr value; - value = key->GetValue(); - value.StripQuotes ( ); - ListView_SetItemText ( list, index, 1, (LPSTR)value.c_str() ); + // Add each key in the properties dictionary + for ( i = 0; i < mDict->GetNumKeyVals(); i ++ ) + { + const idKeyValue* key = mDict->GetKeyVal ( i ); + assert ( key ); + + // Add the item + LVITEM item; + ZeroMemory ( &item, sizeof(item) ); + item.mask = LVIF_TEXT|LVIF_PARAM; + item.iItem = ListView_GetItemCount ( list ); + item.pszText = (LPSTR)key->GetKey().c_str ( ); + item.lParam = (LONG) key; + int index = ListView_InsertItem ( list, &item ); + + idStr value; + value = key->GetValue(); + value.StripQuotes ( ); + ListView_SetItemText ( list, index, 1, (LPSTR)value.c_str() ); + } } return true; @@ -1077,6 +1080,11 @@ bool rvGEItemPropsGeneralPage::SetActive ( void ) gApp.GetOptions().SetLastOptionsPage ( RVITEMPROPS_GENERAL ); + if ( mDict == NULL ) + { + return false; + } + SetWindowText ( GetDlgItem ( mPage, IDC_GUIED_ITEMNAME ), idStr(mDict->GetString ( "name", "unnamed" )).StripQuotes ( ) ); enable = !IsExpression ( mDict->GetString ( "visible", "1" ) ); @@ -1116,6 +1124,11 @@ Applys the settings currently stored in the property page back into the attached */ bool rvGEItemPropsGeneralPage::KillActive ( void ) { + if ( mDict == NULL ) + { + return false; + } + char temp[1024]; GetWindowText ( GetDlgItem(mPage,IDC_GUIED_ITEMNAME), temp, 1024 ); diff --git a/neo/tools/guied/GEItemScriptsDlg.cpp b/neo/tools/guied/GEItemScriptsDlg.cpp index e5832d57..a172f11b 100644 --- a/neo/tools/guied/GEItemScriptsDlg.cpp +++ b/neo/tools/guied/GEItemScriptsDlg.cpp @@ -36,7 +36,7 @@ If you have questions concerning this license or the applicable additional terms LRESULT CALLBACK GEScriptEdit_WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - WNDPROC wndproc = (WNDPROC) GetWindowLong ( hwnd, GWL_USERDATA ); + WNDPROC wndproc = (WNDPROC) GetWindowLongPtr ( hwnd, GWLP_USERDATA ); switch ( msg ) { @@ -61,7 +61,7 @@ bool GEItescriptsDlg_Init ( HWND hwnd ) HWND script; // Extract the window pointer from the win32 windows user data long - window = (idWindow*)GetWindowLong ( hwnd, GWL_USERDATA ); + window = (idWindow*)GetWindowLongPtr ( hwnd, GWLP_USERDATA ); assert ( window ); // Get the window wrapper of the script window @@ -73,8 +73,8 @@ bool GEItescriptsDlg_Init ( HWND hwnd ) UINT tabsize = 16; SendMessage ( script, EM_SETTABSTOPS, 1, (LPARAM)&tabsize ); - SetWindowLong ( script, GWL_USERDATA, GetWindowLong ( script, GWL_WNDPROC ) ); - SetWindowLong ( script, GWL_WNDPROC, (LONG) GEScriptEdit_WndProc ); + SetWindowLongPtr ( script, GWLP_USERDATA, GetWindowLongPtr ( script, GWLP_WNDPROC ) ); + SetWindowLongPtr ( script, GWLP_WNDPROC, (LONG_PTR) GEScriptEdit_WndProc ); TEXTMETRIC tm; HDC dc; @@ -138,7 +138,7 @@ bool GEItescriptsDlg_Apply ( HWND hwnd ) HWND script; // Extract the window pointer from the win32 windows user data long - window = (idWindow*)GetWindowLong ( hwnd, GWL_USERDATA ); + window = (idWindow*)GetWindowLongPtr ( hwnd, GWLP_USERDATA ); assert ( window ); // Get the window wrapper of the script window @@ -306,7 +306,7 @@ INT_PTR CALLBACK GEItescriptsDlg_WndProc ( HWND hwnd, UINT msg, WPARAM wParam, L switch ( msg ) { case WM_INITDIALOG: - SetWindowLong ( hwnd, GWL_USERDATA, lParam ); + SetWindowLongPtr ( hwnd, GWLP_USERDATA, lParam ); GEItescriptsDlg_Init ( hwnd ); gApp.GetOptions().GetWindowPlacement ( "scripts", hwnd ); diff --git a/neo/tools/guied/GENavigator.cpp b/neo/tools/guied/GENavigator.cpp index 342c25e7..948fc34d 100644 --- a/neo/tools/guied/GENavigator.cpp +++ b/neo/tools/guied/GENavigator.cpp @@ -139,7 +139,7 @@ Window Procedure */ LRESULT CALLBACK rvGENavigator::WndProc ( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - rvGENavigator* nav = (rvGENavigator*) GetWindowLong ( hWnd, GWL_USERDATA ); + rvGENavigator* nav = (rvGENavigator*) GetWindowLongPtr ( hWnd, GWLP_USERDATA ); switch ( msg ) { @@ -273,16 +273,16 @@ LRESULT CALLBACK rvGENavigator::WndProc ( HWND hWnd, UINT msg, WPARAM wParam, LP // Attach the class to the window first cs = (LPCREATESTRUCT) lParam; nav = (rvGENavigator*) cs->lpCreateParams; - SetWindowLong ( hWnd, GWL_USERDATA, (LONG)nav ); + SetWindowLongPtr( hWnd, GWLP_USERDATA, (LONG_PTR)nav ); // Create the List view nav->mTree = CreateWindowEx ( 0, "SysListView32", "", WS_VSCROLL|WS_CHILD|WS_VISIBLE|LVS_REPORT|LVS_OWNERDRAWFIXED|LVS_NOCOLUMNHEADER|LVS_SHOWSELALWAYS, 0, 0, 0, 0, hWnd, (HMENU)IDC_GUIED_WINDOWTREE, win32.hInstance, 0 ); ListView_SetExtendedListViewStyle ( nav->mTree, LVS_EX_FULLROWSELECT ); ListView_SetBkColor ( nav->mTree, GetSysColor ( COLOR_3DFACE ) ); ListView_SetTextBkColor ( nav->mTree, GetSysColor ( COLOR_3DFACE ) ); - nav->mListWndProc = (WNDPROC)GetWindowLong ( nav->mTree, GWL_WNDPROC ); - SetWindowLong ( nav->mTree, GWL_USERDATA, (LONG)nav ); - SetWindowLong ( nav->mTree, GWL_WNDPROC, (LONG)ListWndProc ); + nav->mListWndProc = (WNDPROC)GetWindowLongPtr ( nav->mTree, GWLP_WNDPROC ); + SetWindowLongPtr( nav->mTree, GWLP_USERDATA, (LONG_PTR)nav ); + SetWindowLongPtr( nav->mTree, GWLP_WNDPROC, (LONG_PTR)ListWndProc ); // Insert the only column col.mask = 0; @@ -429,7 +429,7 @@ Window Procedure for the embedded list control */ LRESULT CALLBACK rvGENavigator::ListWndProc ( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - rvGENavigator* nav = (rvGENavigator*) GetWindowLong ( hWnd, GWL_USERDATA ); + rvGENavigator* nav = (rvGENavigator*) GetWindowLongPtr ( hWnd, GWLP_USERDATA ); assert ( nav ); switch ( msg ) diff --git a/neo/tools/guied/GEProperties.cpp b/neo/tools/guied/GEProperties.cpp index a1571867..c591a55c 100644 --- a/neo/tools/guied/GEProperties.cpp +++ b/neo/tools/guied/GEProperties.cpp @@ -199,7 +199,7 @@ Window Procedure for the properties window */ LRESULT CALLBACK rvGEProperties::WndProc ( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - rvGEProperties* kv = (rvGEProperties*) GetWindowLong ( hWnd, GWL_USERDATA ); + rvGEProperties* kv = (rvGEProperties*) GetWindowLongPtr ( hWnd, GWLP_USERDATA ); if ( kv && kv->mGrid.ReflectMessage ( hWnd, msg, wParam, lParam ) ) { @@ -271,7 +271,7 @@ LRESULT CALLBACK rvGEProperties::WndProc ( HWND hWnd, UINT msg, WPARAM wParam, L // Attach the class to the window first cs = (LPCREATESTRUCT) lParam; kv = (rvGEProperties*) cs->lpCreateParams; - SetWindowLong ( hWnd, GWL_USERDATA, (LONG)kv ); + SetWindowLongPtr( hWnd, GWLP_USERDATA, (LONG_PTR)kv ); kv->mGrid.Create ( hWnd, 999, PGS_ALLOWINSERT ); diff --git a/neo/tools/guied/GEPropertyPage.cpp b/neo/tools/guied/GEPropertyPage.cpp index f937d8ea..4264f662 100644 --- a/neo/tools/guied/GEPropertyPage.cpp +++ b/neo/tools/guied/GEPropertyPage.cpp @@ -47,7 +47,7 @@ Window procedure for the property page class. */ INT_PTR CALLBACK rvGEPropertyPage::WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - rvGEPropertyPage* page = (rvGEPropertyPage*) GetWindowLong ( hwnd, GWL_USERDATA ); + rvGEPropertyPage* page = (rvGEPropertyPage*) GetWindowLongPtr ( hwnd, GWLP_USERDATA ); // Pages dont get the init dialog since their Init method is called instead if ( msg == WM_INITDIALOG ) @@ -56,7 +56,7 @@ INT_PTR CALLBACK rvGEPropertyPage::WndProc ( HWND hwnd, UINT msg, WPARAM wParam, page = (rvGEPropertyPage*) psp->lParam; - SetWindowLong ( hwnd, GWL_USERDATA, (LONG)page ); + SetWindowLongPtr( hwnd, GWLP_USERDATA, (LONG_PTR)page ); page->mPage = hwnd; page->Init ( ); @@ -89,7 +89,7 @@ int rvGEPropertyPage::HandleMessage ( UINT msg, WPARAM wParam, LPARAM lParam ) case PSN_APPLY: if ( !Apply ( ) ) { - SetWindowLong ( mPage, DWL_MSGRESULT, PSNRET_INVALID ); + SetWindowLongPtr ( mPage, DWLP_MSGRESULT, PSNRET_INVALID ); return TRUE; } break; diff --git a/neo/tools/guied/GEStateModifier.cpp b/neo/tools/guied/GEStateModifier.cpp index 6a65598f..c4848449 100644 --- a/neo/tools/guied/GEStateModifier.cpp +++ b/neo/tools/guied/GEStateModifier.cpp @@ -36,7 +36,9 @@ rvGEStateModifier::rvGEStateModifier ( const char* name, idWindow* window, idDic rvGEModifier ( name, window ), mDict ( dict ) { - mDict.Copy ( dict ); + //Ross T 1/6/2015 - commented out this mDict copy because it seems completely + //redundant (copy constructor happens two lines above) and was causing a bug with adding keys + //mDict.Copy ( dict ); // Make a copy of the current dictionary mUndoDict.Copy ( mWrapper->GetStateDict() ); diff --git a/neo/tools/guied/GETransformer.cpp b/neo/tools/guied/GETransformer.cpp index cb93567d..03b27817 100644 --- a/neo/tools/guied/GETransformer.cpp +++ b/neo/tools/guied/GETransformer.cpp @@ -92,7 +92,7 @@ bool rvGETransformer::Create ( HWND parent, bool visible ) LRESULT CALLBACK rvGETransformer::WndProc ( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - rvGETransformer* trans = (rvGETransformer*) GetWindowLong ( hWnd, GWL_USERDATA ); + rvGETransformer* trans = (rvGETransformer*) GetWindowLongPtr ( hWnd, GWLP_USERDATA ); switch ( msg ) { @@ -117,7 +117,7 @@ LRESULT CALLBACK rvGETransformer::WndProc ( HWND hWnd, UINT msg, WPARAM wParam, // Attach the class to the window first cs = (LPCREATESTRUCT) lParam; trans = (rvGETransformer*) cs->lpCreateParams; - SetWindowLong ( hWnd, GWL_USERDATA, (LONG)trans ); + SetWindowLongPtr( hWnd, GWLP_USERDATA, (LONG_PTR)trans ); trans->mWnd = hWnd; trans->mDlg = CreateDialogParam ( gApp.GetInstance(), MAKEINTRESOURCE(IDD_GUIED_TRANSFORMER), @@ -148,7 +148,7 @@ LRESULT CALLBACK rvGETransformer::WndProc ( HWND hWnd, UINT msg, WPARAM wParam, INT_PTR CALLBACK rvGETransformer::DlgProc ( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - rvGETransformer* trans = (rvGETransformer*) GetWindowLong ( hWnd, GWL_USERDATA ); + rvGETransformer* trans = (rvGETransformer*) GetWindowLongPtr ( hWnd, GWLP_USERDATA ); switch ( msg ) { @@ -163,7 +163,7 @@ INT_PTR CALLBACK rvGETransformer::DlgProc ( HWND hWnd, UINT msg, WPARAM wParam, case WM_INITDIALOG: trans = (rvGETransformer*) lParam; trans->mDlg = hWnd; - SetWindowLong ( hWnd, GWL_USERDATA, lParam ); + SetWindowLongPtr ( hWnd, GWLP_USERDATA, lParam ); NumberEdit_Attach ( GetDlgItem ( hWnd, IDC_GUIED_ITEMRECTX ) ); NumberEdit_Attach ( GetDlgItem ( hWnd, IDC_GUIED_ITEMRECTY ) ); NumberEdit_Attach ( GetDlgItem ( hWnd, IDC_GUIED_ITEMRECTW ) ); diff --git a/neo/tools/guied/GEViewer.cpp b/neo/tools/guied/GEViewer.cpp index f7c16d74..94ac9b13 100644 --- a/neo/tools/guied/GEViewer.cpp +++ b/neo/tools/guied/GEViewer.cpp @@ -229,7 +229,7 @@ static int MapKey (int key) LRESULT CALLBACK rvGEViewer::WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - rvGEViewer* viewer = (rvGEViewer*) GetWindowLong ( hwnd, GWL_USERDATA ); + rvGEViewer* viewer = (rvGEViewer*) GetWindowLongPtr ( hwnd, GWLP_USERDATA ); switch ( msg ) { @@ -365,7 +365,7 @@ LRESULT CALLBACK rvGEViewer::WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARA case WM_CREATE: { CREATESTRUCT* cs = (CREATESTRUCT*) lParam; - SetWindowLong ( hwnd, GWL_USERDATA, (LONG)cs->lpCreateParams ); + SetWindowLongPtr( hwnd, GWLP_USERDATA, (LONG_PTR)cs->lpCreateParams ); viewer = (rvGEViewer*)cs->lpCreateParams; viewer->mWnd = hwnd; diff --git a/neo/tools/guied/GEWorkspace.cpp b/neo/tools/guied/GEWorkspace.cpp index 8c98427b..482bab61 100644 --- a/neo/tools/guied/GEWorkspace.cpp +++ b/neo/tools/guied/GEWorkspace.cpp @@ -144,7 +144,7 @@ bool rvGEWorkspace::Attach ( HWND wnd ) // Jam the workspace pointer into the userdata window long so // we can retrieve the workspace from the window later - SetWindowLong ( mWnd, GWL_USERDATA, (LONG) this ); + SetWindowLongPtr( mWnd, GWLP_USERDATA, ( LONG_PTR ) this ); UpdateTitle ( ); @@ -162,7 +162,7 @@ void rvGEWorkspace::Detach ( void ) { assert ( mWnd ); - SetWindowLong ( mWnd, GWL_USERDATA, 0 ); + SetWindowLongPtr ( mWnd, GWLP_USERDATA, 0 ); mWnd = NULL; } diff --git a/neo/tools/guied/GEWorkspace.h b/neo/tools/guied/GEWorkspace.h index 17002722..068d87b3 100644 --- a/neo/tools/guied/GEWorkspace.h +++ b/neo/tools/guied/GEWorkspace.h @@ -267,7 +267,7 @@ ID_INLINE rvGEWorkspace::EZoomLevel rvGEWorkspace::GetZoom ( void ) ID_INLINE rvGEWorkspace* rvGEWorkspace::GetWorkspace ( HWND wnd ) { - return (rvGEWorkspace*) GetWindowLong ( wnd, GWL_USERDATA ); + return (rvGEWorkspace*) GetWindowLongPtr ( wnd, GWLP_USERDATA ); } ID_INLINE const char* rvGEWorkspace::GetFilename ( void ) diff --git a/neo/tools/radiant/CamWnd.cpp b/neo/tools/radiant/CamWnd.cpp index 835944da..9052e7b8 100644 --- a/neo/tools/radiant/CamWnd.cpp +++ b/neo/tools/radiant/CamWnd.cpp @@ -126,7 +126,7 @@ END_MESSAGE_MAP() ======================================================================================================================= ======================================================================================================================= */ -LONG WINAPI CamWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { +LONG_PTR WINAPI CamWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { RECT rect; GetClientRect(hWnd, &rect); @@ -2129,7 +2129,7 @@ void CCamWnd::Cam_Render() { } -void CCamWnd::OnTimer(UINT nIDEvent) +void CCamWnd::OnTimer(UINT_PTR nIDEvent) { if (animationMode || nIDEvent == 1) { Sys_UpdateWindows(W_CAMERA); diff --git a/neo/tools/radiant/CamWnd.h b/neo/tools/radiant/CamWnd.h index 2bbe1bd3..0291ec53 100644 --- a/neo/tools/radiant/CamWnd.h +++ b/neo/tools/radiant/CamWnd.h @@ -192,7 +192,7 @@ protected: afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); - afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnTimer(UINT_PTR nIDEvent); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; diff --git a/neo/tools/radiant/EditViewDlg.cpp b/neo/tools/radiant/EditViewDlg.cpp index 2fe4d599..add5c665 100644 --- a/neo/tools/radiant/EditViewDlg.cpp +++ b/neo/tools/radiant/EditViewDlg.cpp @@ -212,7 +212,7 @@ void CEditViewDlg::SetGuiInfo(const char *name) { UpdateEditPreview(); } -void CEditViewDlg::OnTimer(UINT nIDEvent) { +void CEditViewDlg::OnTimer(UINT_PTR nIDEvent) { CDialog::OnTimer(nIDEvent); CWnd *wnd = GetDlgItem(IDC_EDIT_LINE); if (wnd) { diff --git a/neo/tools/radiant/EditViewDlg.h b/neo/tools/radiant/EditViewDlg.h index bcb31228..e66f5419 100644 --- a/neo/tools/radiant/EditViewDlg.h +++ b/neo/tools/radiant/EditViewDlg.h @@ -74,7 +74,7 @@ public: afx_msg void OnBnClickedButtonSave(); virtual BOOL OnInitDialog(); afx_msg void OnDestroy(); - afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg void OnBnClickedButtonGoto(); virtual BOOL PreTranslateMessage(MSG* pMsg); afx_msg LRESULT OnFindDialogMessage(WPARAM wParam, LPARAM lParam); diff --git a/neo/tools/radiant/EntityDlg.cpp b/neo/tools/radiant/EntityDlg.cpp index 618c1de8..782e8993 100644 --- a/neo/tools/radiant/EntityDlg.cpp +++ b/neo/tools/radiant/EntityDlg.cpp @@ -106,7 +106,7 @@ BOOL CEntityDlg::OnInitDialog() // EXCEPTION: OCX Property Pages should return FALSE } -int CEntityDlg::OnToolHitTest(CPoint point, TOOLINFO* pTI) const +INT_PTR CEntityDlg::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const { // TODO: Add your specialized code here and/or call the base class @@ -1148,7 +1148,7 @@ void CEntityDlg::OnBnClickedStopAnimation() KillTimer ( 0 ); } -void CEntityDlg::OnTimer(UINT nIDEvent) +void CEntityDlg::OnTimer( UINT_PTR nIDEvent ) { if ( !editEntity ) { OnBnClickedStopAnimation (); diff --git a/neo/tools/radiant/EntityDlg.h b/neo/tools/radiant/EntityDlg.h index 708427ed..c0b8a543 100644 --- a/neo/tools/radiant/EntityDlg.h +++ b/neo/tools/radiant/EntityDlg.h @@ -76,7 +76,7 @@ protected: public: virtual BOOL OnInitDialog(); - virtual int OnToolHitTest(CPoint point, TOOLINFO* pTI) const; + virtual INT_PTR OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; void AddClassNames(); void UpdateEntitySel(eclass_t *ent); void SetKeyValPairs( bool updateAnims = true ); @@ -160,7 +160,7 @@ public: afx_msg void OnLbnDblclkListVars(); void OnNMReleasedcaptureSlider1(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnCbnAnimationChange (); - void OnTimer(UINT nIDEvent); + void OnTimer(UINT_PTR nIDEvent); afx_msg void OnBnClickedButtonParticle(); afx_msg void OnBnClickedButtonSkin(); afx_msg void OnBnClickedButtonCurve(); diff --git a/neo/tools/radiant/GLWidget.cpp b/neo/tools/radiant/GLWidget.cpp index 652fa76b..70f0063b 100644 --- a/neo/tools/radiant/GLWidget.cpp +++ b/neo/tools/radiant/GLWidget.cpp @@ -807,7 +807,7 @@ void idGLWidget::setDrawable(idGLDrawable *d) { } -void idGLWidget::OnTimer(UINT nIDEvent) { +void idGLWidget::OnTimer(UINT_PTR nIDEvent) { if (drawable && drawable->getRealTime()) { Invalidate(FALSE); } else { diff --git a/neo/tools/radiant/GLWidget.h b/neo/tools/radiant/GLWidget.h index ee8ccff1..debf7015 100644 --- a/neo/tools/radiant/GLWidget.h +++ b/neo/tools/radiant/GLWidget.h @@ -212,7 +212,7 @@ protected: afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); afx_msg void OnRButtonDown(UINT nFlags, CPoint point); afx_msg void OnRButtonUp(UINT nFlags, CPoint point); - afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg BOOL OnEraseBkgnd(CDC* pDC); //}}AFX_MSG diff --git a/neo/tools/radiant/MainFrm.cpp b/neo/tools/radiant/MainFrm.cpp index 9a0bfac9..28dcd4ce 100644 --- a/neo/tools/radiant/MainFrm.cpp +++ b/neo/tools/radiant/MainFrm.cpp @@ -727,8 +727,8 @@ static UINT indicators[] = { ======================================================================================================================= ======================================================================================================================= */ -void CMainFrame::OnDisplayChange(UINT wParam, long lParam) { - int n = wParam; +void CMainFrame::OnDisplayChange( WPARAM wp, LPARAM lp ) { + int n = wp; } /* @@ -1412,7 +1412,7 @@ bool MouseDown() { ======================================================================================================================= */ -void CMainFrame::OnTimer(UINT nIDEvent) { +void CMainFrame::OnTimer(UINT_PTR nIDEvent) { static bool autoSavePending = false; if ( nIDEvent == QE_TIMER0 && !MouseDown() ) { diff --git a/neo/tools/radiant/MainFrm.h b/neo/tools/radiant/MainFrm.h index f5777683..bf4000d3 100644 --- a/neo/tools/radiant/MainFrm.h +++ b/neo/tools/radiant/MainFrm.h @@ -180,7 +180,7 @@ public: afx_msg void OnBSPDone(UINT wParam, long lParam); afx_msg void OnParentNotify(UINT message, LPARAM lParam); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg void OnDestroy(); afx_msg void OnClose(); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); diff --git a/neo/tools/radiant/NewTexWnd.cpp b/neo/tools/radiant/NewTexWnd.cpp index 10ec3b04..dd85459a 100644 --- a/neo/tools/radiant/NewTexWnd.cpp +++ b/neo/tools/radiant/NewTexWnd.cpp @@ -878,7 +878,7 @@ BOOL CNewTexWnd::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult ) { return(FALSE); } -int CNewTexWnd::OnToolHitTest(CPoint point, TOOLINFO * pTI) +INT_PTR CNewTexWnd::OnToolHitTest(CPoint point, TOOLINFO * pTI) { const idMaterial *mat = getMaterialAtPoint(point); if (mat) { diff --git a/neo/tools/radiant/NewTexWnd.h b/neo/tools/radiant/NewTexWnd.h index b0561412..b41a5011 100644 --- a/neo/tools/radiant/NewTexWnd.h +++ b/neo/tools/radiant/NewTexWnd.h @@ -71,7 +71,7 @@ public: void LoadMaterials(); virtual ~CNewTexWnd(); BOOL OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult ); - int CNewTexWnd::OnToolHitTest(CPoint point, TOOLINFO * pTI); + INT_PTR CNewTexWnd::OnToolHitTest(CPoint point, TOOLINFO * pTI); virtual BOOL PreTranslateMessage(MSG* pMsg); protected: diff --git a/neo/tools/radiant/Radiant.cpp b/neo/tools/radiant/Radiant.cpp index c7c2216a..018a8b1f 100644 --- a/neo/tools/radiant/Radiant.cpp +++ b/neo/tools/radiant/Radiant.cpp @@ -123,11 +123,12 @@ void RadiantInit( void ) { Sys_GrabMouseCursor( false ); g_DoomInstance = win32.hInstance; - CWinApp* pApp = AfxGetApp(); - CWinThread *pThread = AfxGetThread(); InitAfx(); + CWinApp* pApp = AfxGetApp(); + CWinThread *pThread = AfxGetThread(); + // App global initializations (rare) pApp->InitApplication(); @@ -175,7 +176,8 @@ void RadiantRun( void ) { theApp.Run(); //qglPopAttrib(); //qwglMakeCurrent(0, 0); - qwglMakeCurrent(win32.hDC, win32.hGLRC); + if (win32.hDC != NULL && win32.hGLRC != NULL) + qwglMakeCurrent(win32.hDC, win32.hGLRC); } } catch( idException &ex ) { diff --git a/neo/tools/radiant/WIN_DLG.CPP b/neo/tools/radiant/WIN_DLG.CPP index b6523ef7..f4e680c2 100644 --- a/neo/tools/radiant/WIN_DLG.CPP +++ b/neo/tools/radiant/WIN_DLG.CPP @@ -31,7 +31,7 @@ If you have questions concerning this license or the applicable additional terms #include "qe3.h" -BOOL CALLBACK EditCommandDlgProc ( +INT_PTR CALLBACK EditCommandDlgProc( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter @@ -96,7 +96,7 @@ BOOL CALLBACK EditCommandDlgProc ( return FALSE; } -BOOL CALLBACK AddCommandDlgProc ( +INT_PTR CALLBACK AddCommandDlgProc ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter @@ -161,7 +161,7 @@ void UpdateBSPCommandList (HWND hwndDlg) // FIXME: turn this into an MFC dialog -BOOL CALLBACK ProjectDlgProc ( +INT_PTR CALLBACK ProjectDlgProc( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter @@ -255,7 +255,7 @@ void DoProjectSettings() -BOOL CALLBACK GammaDlgProc ( +INT_PTR CALLBACK GammaDlgProc( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter @@ -390,7 +390,7 @@ void GetSelectionIndex (int *ent, int *brush) ; } -BOOL CALLBACK FindBrushDlgProc ( +INT_PTR CALLBACK FindBrushDlgProc( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter @@ -450,7 +450,7 @@ void DoFind(void) */ -BOOL CALLBACK RotateDlgProc ( +INT_PTR CALLBACK RotateDlgProc( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter @@ -517,7 +517,7 @@ void DoRotate(void) bool g_bDoCone = false; bool g_bDoSphere = false; -BOOL CALLBACK SidesDlgProc ( +INT_PTR CALLBACK SidesDlgProc( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter @@ -575,7 +575,7 @@ void DoSides(bool bCone, bool bSphere, bool bTorus) DoAbout =================== */ -BOOL CALLBACK AboutDlgProc( HWND hwndDlg, +INT_PTR CALLBACK AboutDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) diff --git a/neo/tools/radiant/XYWnd.cpp b/neo/tools/radiant/XYWnd.cpp index 3250e16d..7f4c28cc 100644 --- a/neo/tools/radiant/XYWnd.cpp +++ b/neo/tools/radiant/XYWnd.cpp @@ -4366,7 +4366,7 @@ idVec3 &CXYWnd::RotateOrigin() { ======================================================================================================================= ======================================================================================================================= */ -void CXYWnd::OnTimer(UINT nIDEvent) { +void CXYWnd::OnTimer(UINT_PTR nIDEvent) { if (nIDEvent == 100) { int nDim1 = (m_nViewType == YZ) ? 1 : 0; int nDim2 = (m_nViewType == XY) ? 1 : 2; diff --git a/neo/tools/radiant/XYWnd.h b/neo/tools/radiant/XYWnd.h index 94b36cbd..b55bd798 100644 --- a/neo/tools/radiant/XYWnd.h +++ b/neo/tools/radiant/XYWnd.h @@ -242,7 +242,7 @@ protected: afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnDestroy(); afx_msg void OnSelectMouserotate(); - afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); afx_msg void OnKillFocus(CWnd* pNewWnd);