diff --git a/neo/tools/comafx/CDIB.cpp b/neo/tools/comafx/CDIB.cpp index 0bfd3b00..6ddd74a6 100644 --- a/neo/tools/comafx/CDIB.cpp +++ b/neo/tools/comafx/CDIB.cpp @@ -340,8 +340,8 @@ void CDIB::ExpandBlt(int nXDest,int nYDest,int xRatio,int yRatio,CDIB& dibSrc,in void CDIB::Expand(int nXDest,int nYDest,int xRatio,int yRatio,CDIB& dibSrc,int xSrc,int ySrc,int nSWidth,int nSHeight) { -int xNum,yNum,xErr,yErr; -int nDWidth,nDHeight; + int xNum,yNum,xErr,yErr; + int nDWidth,nDHeight; nDWidth = nSWidth*xRatio; nDHeight = nSHeight*yRatio; @@ -354,8 +354,8 @@ int nDWidth,nDHeight; xErr = nDWidth%xRatio; yErr = nDHeight%yRatio; -unsigned char *buffer,*srcPtr,*destPtr,*ptr; -int i,j,k; + unsigned char *buffer,*srcPtr,*destPtr,*ptr; + int i,j,k = 0; buffer = (unsigned char *)malloc(nDWidth+20); if(!buffer) return; @@ -687,7 +687,7 @@ void CDIB::GetPixel(UINT x,UINT y,int& pixel) BOOL CDIB::Make8Bit(CDIB& dib) { -int nBits; + int nBits; ASSERT(Width() == dib.Width()); ASSERT(Height() == dib.Height()); nBits = dib.GetBitCount(); @@ -708,7 +708,6 @@ int nBits; default: return FALSE; } - return FALSE; } /* @@ -813,7 +812,7 @@ unsigned char cols[256]; int CDIB::ClosestColor(RGBQUAD *pRgb) { -unsigned int dist=BIG_DISTANCE,i,d,c; +unsigned int dist=BIG_DISTANCE,i,d,c = 0; RGBQUAD *pQuad=m_pRGB; unsigned int pSize=GetPaletteSize(); for(i=0; i < pSize;i++) diff --git a/neo/tools/comafx/CPathTreeCtrl.cpp b/neo/tools/comafx/CPathTreeCtrl.cpp index feb9a882..ca68bc7c 100644 --- a/neo/tools/comafx/CPathTreeCtrl.cpp +++ b/neo/tools/comafx/CPathTreeCtrl.cpp @@ -249,7 +249,7 @@ INT_PTR CPathTreeCtrl::OnToolHitTest( CPoint point, TOOLINFO * pTI ) const { if( nFlags & TVHT_ONITEM ) { GetItemRect( hitem, &rect, TRUE ); pTI->hwnd = m_hWnd; - pTI->uId = (UINT)hitem; + pTI->uId = (UINT_PTR)hitem; pTI->lpszText = LPSTR_TEXTCALLBACK; pTI->rect = rect; return pTI->uId; @@ -272,7 +272,7 @@ BOOL CPathTreeCtrl::OnToolTipText( UINT id, NMHDR * pNMHDR, LRESULT * pResult ) *pResult = 0; // Do not process the message from built in tooltip - if( nID == (UINT)m_hWnd && + if( nID == (UINT_PTR)m_hWnd && (( pNMHDR->code == TTN_NEEDTEXTA && pTTTA->uFlags & TTF_IDISHWND ) || ( pNMHDR->code == TTN_NEEDTEXTW && pTTTW->uFlags & TTF_IDISHWND ) ) ) { return FALSE; @@ -295,7 +295,7 @@ BOOL CPathTreeCtrl::OnToolTipText( UINT id, NMHDR * pNMHDR, LRESULT * pResult ) if( nFlags & TVHT_ONITEM ) { // relay message to parent pTTTA->hdr.hwndFrom = GetSafeHwnd(); - pTTTA->hdr.idFrom = (UINT) hitem; + pTTTA->hdr.idFrom = (UINT_PTR) hitem; if ( GetParent()->SendMessage( WM_NOTIFY, ( TTN_NEEDTEXT << 16 ) | GetDlgCtrlID(), (LPARAM)pTTTA ) == FALSE ) { return FALSE; } diff --git a/neo/tools/comafx/CSyntaxRichEditCtrl.cpp b/neo/tools/comafx/CSyntaxRichEditCtrl.cpp index f8207aa5..4ede3d73 100644 --- a/neo/tools/comafx/CSyntaxRichEditCtrl.cpp +++ b/neo/tools/comafx/CSyntaxRichEditCtrl.cpp @@ -1380,8 +1380,12 @@ CSyntaxRichEditCtrl::OnToolTipNotify ================ */ BOOL CSyntaxRichEditCtrl::OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ) { + +#ifdef _UNICODE TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR; +#else TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR; +#endif *pResult = 0; diff --git a/neo/tools/comafx/DialogColorPicker.cpp b/neo/tools/comafx/DialogColorPicker.cpp index fa829c83..c0b17c16 100644 --- a/neo/tools/comafx/DialogColorPicker.cpp +++ b/neo/tools/comafx/DialogColorPicker.cpp @@ -912,7 +912,6 @@ void CDialogColorPicker::DrawLines(CDC *pDC) pt[1] = PointOnLine(Vertex,Left,(color.g*GreenLen)/255,GreenLen); pt[2] = PointOnLine(Vertex,Right,(color.b*BlueLen)/255,BlueLen); - COLORREF col = RGB(255,255,255); CRect cr; for(int i = 0; i < 3; i++ ) { diff --git a/neo/tools/comafx/StdAfx.cpp b/neo/tools/comafx/StdAfx.cpp index b6959d87..361a93da 100644 --- a/neo/tools/comafx/StdAfx.cpp +++ b/neo/tools/comafx/StdAfx.cpp @@ -108,7 +108,7 @@ BOOL DefaultOnToolTipNotify( const toolTip_t *toolTips, UINT id, NMHDR *pNMHDR, *pResult = 0; - UINT nID = pNMHDR->idFrom; + UINT_PTR nID = pNMHDR->idFrom; if ( pTTTA->uFlags & TTF_IDISHWND ) { // idFrom is actually the HWND of the tool nID = ::GetDlgCtrlID((HWND)nID); diff --git a/neo/tools/comafx/VectorCtl.cpp b/neo/tools/comafx/VectorCtl.cpp index 613677c1..dba1b0b2 100644 --- a/neo/tools/comafx/VectorCtl.cpp +++ b/neo/tools/comafx/VectorCtl.cpp @@ -153,8 +153,8 @@ COLORREF CVectorCtl::CalcLight (double dx, double dy, double dz) { double NL = dx * m_dVec[0] + dy * m_dVec[1] + dz * m_dVec[2], RV = 2.0 * NL, - rx = m_dVec[0] - (dx * RV), - ry = m_dVec[1] - (dy * RV), + //rx = m_dVec[0] - (dx * RV), + //ry = m_dVec[1] - (dy * RV), rz = m_dVec[2] - (dz * RV); if (NL < 0.0) // Diffuse coefficient diff --git a/neo/tools/common/MaskEdit.cpp b/neo/tools/common/MaskEdit.cpp index a6ade643..aff8c57d 100644 --- a/neo/tools/common/MaskEdit.cpp +++ b/neo/tools/common/MaskEdit.cpp @@ -60,7 +60,7 @@ LRESULT CALLBACK MaskEdit_WndProc ( HWND hWnd, UINT msg, WPARAM wParam, LPARAM l case WM_DESTROY: delete edit; - SetWindowLongPtr ( hWnd, GWLP_WNDPROC, (LONG)wndproc ); + SetWindowLongPtr ( hWnd, GWLP_WNDPROC, (LONG_PTR)wndproc ); break; } @@ -79,8 +79,8 @@ void MaskEdit_Attach ( HWND hWnd, const char* invalid ) rvGEMaskEdit* edit = new rvGEMaskEdit; edit->mProc = (WNDPROC)GetWindowLongPtr ( hWnd, GWLP_WNDPROC ); strcpy ( edit->mInvalid, invalid ); - SetWindowLongPtr ( hWnd, GWLP_USERDATA, (LONG)edit ); - SetWindowLongPtr ( hWnd, GWLP_WNDPROC, (LONG)MaskEdit_WndProc ); + SetWindowLongPtr ( hWnd, GWLP_USERDATA, (LONG_PTR)edit ); + SetWindowLongPtr ( hWnd, GWLP_WNDPROC, (LONG_PTR)MaskEdit_WndProc ); } /* diff --git a/neo/tools/common/OpenFileDialog.cpp b/neo/tools/common/OpenFileDialog.cpp index 0c334ef5..6da65c8f 100644 --- a/neo/tools/common/OpenFileDialog.cpp +++ b/neo/tools/common/OpenFileDialog.cpp @@ -306,7 +306,7 @@ void rvOpenFileDialog::HandleInitDialog ( void ) SendMessage( mWndLookin,CBEM_SETIMAGELIST,0,(LPARAM) mImageList ); // Back button is a bitmap button - SendMessage( GetDlgItem ( mWnd, IDC_TOOLS_BACK ), BM_SETIMAGE, IMAGE_BITMAP, (LONG) mBackBitmap ); + SendMessage( GetDlgItem ( mWnd, IDC_TOOLS_BACK ), BM_SETIMAGE, IMAGE_BITMAP, (LONG_PTR) mBackBitmap ); // Allow custom titles SetWindowText ( mWnd, mTitle ); diff --git a/neo/tools/common/PropTree/PropTree.cpp b/neo/tools/common/PropTree/PropTree.cpp index 6df28573..9ddcb557 100644 --- a/neo/tools/common/PropTree/PropTree.cpp +++ b/neo/tools/common/PropTree/PropTree.cpp @@ -889,7 +889,7 @@ LRESULT CPropTree::SendNotify(UINT nNotifyCode, CPropTreeItem* pItem) if (lpnm) { - UINT id = (UINT)::GetMenu(m_hWnd); + UINT_PTR id = (UINT_PTR)::GetMenu(m_hWnd); lpnm->code = nNotifyCode; lpnm->hwndFrom = m_hWnd; lpnm->idFrom = id; diff --git a/neo/tools/common/PropTree/PropTreeItemCheck.cpp b/neo/tools/common/PropTree/PropTreeItemCheck.cpp index 94776543..fbb01388 100644 --- a/neo/tools/common/PropTree/PropTreeItemCheck.cpp +++ b/neo/tools/common/PropTree/PropTreeItemCheck.cpp @@ -154,8 +154,6 @@ void CPropTreeItemCheck::OnBnKillfocus() void CPropTreeItemCheck::OnBnClicked() { - int state = GetCheck(); - SetCheckState(GetCheck() == BST_CHECKED ? FALSE : TRUE); CommitChanges(); } diff --git a/neo/tools/common/PropTree/PropTreeView.cpp b/neo/tools/common/PropTree/PropTreeView.cpp index 4a79acf0..2ea69820 100644 --- a/neo/tools/common/PropTree/PropTreeView.cpp +++ b/neo/tools/common/PropTree/PropTreeView.cpp @@ -32,7 +32,7 @@ END_MESSAGE_MAP() void CPropTreeView::OnDraw(CDC* pDC) { - CDocument* pDoc = GetDocument(); + //CDocument* pDoc = GetDocument(); // TODO: add draw code here } diff --git a/neo/tools/common/PropertyGrid.cpp b/neo/tools/common/PropertyGrid.cpp index 42c84aae..f2b9f660 100644 --- a/neo/tools/common/PropertyGrid.cpp +++ b/neo/tools/common/PropertyGrid.cpp @@ -77,8 +77,8 @@ 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)GetWindowLongPtr ( mWindow, GWLP_WNDPROC ); - SetWindowLongPtr ( mWindow, GWLP_USERDATA, (LONG)this ); - SetWindowLongPtr ( mWindow, GWLP_WNDPROC, (LONG)WndProc ); + SetWindowLongPtr ( mWindow, GWLP_USERDATA, (LONG_PTR)this ); + SetWindowLongPtr ( mWindow, GWLP_WNDPROC, (LONG_PTR)WndProc ); LoadLibrary ( "Riched20.dll" ); mEdit = CreateWindowEx ( 0, "RichEdit20A", "", WS_CHILD, 0, 0, 0, 0, mWindow, (HMENU) 999, win32.hInstance, NULL ); diff --git a/neo/tools/common/RollupPanel.cpp b/neo/tools/common/RollupPanel.cpp index 452bbe0d..282772c6 100644 --- a/neo/tools/common/RollupPanel.cpp +++ b/neo/tools/common/RollupPanel.cpp @@ -176,17 +176,17 @@ int rvRollupPanel::InsertItem ( const char* caption, HWND dialog, bool autoDestr } // Store data with the dialog window in its user data - SetWindowLongPtr ( dialog, GWLP_USERDATA, (LONG)item ); + SetWindowLongPtr ( dialog, GWLP_USERDATA, (LONG_PTR)item ); // Attach item to button through user data - SetWindowLongPtr( button, GWLP_USERDATA, (LONG)item ); + SetWindowLongPtr( button, GWLP_USERDATA, (LONG_PTR)item ); SetWindowLongPtr( button, GWL_ID, index ); // Subclass dialog - SetWindowLongPtr( dialog, DWLP_DLGPROC, (LONG)DialogProc ); + SetWindowLongPtr( dialog, DWLP_DLGPROC, (LONG_PTR)DialogProc ); // SubClass button - SetWindowLongPtr( button, GWLP_WNDPROC, (LONG)ButtonProc ); + SetWindowLongPtr( button, GWLP_WNDPROC, (LONG_PTR)ButtonProc ); // Update mItemHeight += RP_PGBUTTONHEIGHT+(RP_GRPBOXINDENT/2); @@ -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; - SetWindowLongPtr ( hWnd, GWLP_USERDATA, (LONG)panel ); + SetWindowLongPtr ( hWnd, GWLP_USERDATA, (LONG_PTR)panel ); break; } diff --git a/neo/tools/common/SpinButton.cpp b/neo/tools/common/SpinButton.cpp index a1cde7be..0b5d390c 100644 --- a/neo/tools/common/SpinButton.cpp +++ b/neo/tools/common/SpinButton.cpp @@ -72,7 +72,7 @@ void SpinButton_HandleNotify ( NMHDR* hdr ) LONG minRange; LONG maxRange; - SendMessage ( hdr->hwndFrom, UDM_GETRANGE32, (LONG)&minRange, (LONG)&maxRange ); + SendMessage ( hdr->hwndFrom, UDM_GETRANGE32, (LONG_PTR)&minRange, (LONG_PTR)&maxRange ); if ( minRange != 0 || maxRange != 0 ) { float minRangef = (float)(long)minRange / 100.0f; diff --git a/neo/tools/decl/DialogDeclBrowser.cpp b/neo/tools/decl/DialogDeclBrowser.cpp index 7186ca35..ba3bdf9b 100644 --- a/neo/tools/decl/DialogDeclBrowser.cpp +++ b/neo/tools/decl/DialogDeclBrowser.cpp @@ -559,8 +559,11 @@ DialogDeclBrowser::OnToolTipNotify */ BOOL DialogDeclBrowser::OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ) { // need to handle both ANSI and UNICODE versions of the message +#ifdef _UNICODE TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR; +#else TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR; +#endif if ( pNMHDR->hwndFrom == declTree.GetSafeHwnd() ) { CString toolTip; @@ -807,7 +810,6 @@ DialogDeclBrowser::OnTreeSelChanged ================ */ void DialogDeclBrowser::OnTreeSelChanged( NMHDR* pNMHDR, LRESULT* pResult ) { - LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR; const idDecl *decl = GetSelectedDecl(); if ( decl ) { diff --git a/neo/tools/guied/GEApp.cpp b/neo/tools/guied/GEApp.cpp index 0f65b7ed..5a3ca1cf 100644 --- a/neo/tools/guied/GEApp.cpp +++ b/neo/tools/guied/GEApp.cpp @@ -365,9 +365,9 @@ LRESULT CALLBACK rvGEApp::FrameWndProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LP app->mToolWindows.Append ( app->mProperties.GetWindow ( ) ); app->mToolWindows.Append ( app->mTransformer.GetWindow ( ) ); - SendMessage ( app->mNavigator.GetWindow ( ), WM_NCACTIVATE, true, (LONG)-1 ); - SendMessage ( app->mProperties.GetWindow ( ), WM_NCACTIVATE, true, (LONG)-1 ); - SendMessage ( app->mTransformer.GetWindow ( ), WM_NCACTIVATE, true, (LONG)-1 ); + 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 ); break; } @@ -1159,7 +1159,7 @@ bool rvGEApp::NewFile ( void ) 480, mMDIClient, mInstance, - (LONG)workspace ); + (LONG_PTR)workspace ); ShowWindow ( child, SW_SHOW ); } @@ -1210,7 +1210,7 @@ bool rvGEApp::OpenFile ( const char* filename ) 480, mMDIClient, mInstance, - (LONG)workspace ); + (LONG_PTR)workspace ); ShowWindow ( child, SW_SHOW ); @@ -1362,7 +1362,7 @@ int rvGEApp::ToolWindowActivate ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa { if ( mToolWindows[i] != hwnd && mToolWindows[i] != (HWND) lParam ) { - SendMessage ( mToolWindows[i], WM_NCACTIVATE, keepActive, (LONG)-1 ); + SendMessage ( mToolWindows[i], WM_NCACTIVATE, keepActive, (LONG_PTR)-1 ); } } } diff --git a/neo/tools/guied/GEItemPropsDlg.cpp b/neo/tools/guied/GEItemPropsDlg.cpp index 8788251a..e06f75db 100644 --- a/neo/tools/guied/GEItemPropsDlg.cpp +++ b/neo/tools/guied/GEItemPropsDlg.cpp @@ -412,7 +412,7 @@ bool rvGEItemPropsTextPage::Init ( void ) SendMessage ( GetDlgItem ( mPage, IDC_GUIED_ITEMTEXTALIGN ), CB_ADDSTRING, 0, (LPARAM)"Center" ); SendMessage ( GetDlgItem ( mPage, IDC_GUIED_ITEMTEXTALIGN ), CB_ADDSTRING, 0, (LPARAM)"Right" ); - SendMessage ( GetDlgItem ( mPage, IDC_GUIED_ITEMTEXTFONT ), CB_ADDSTRING, 0, (LONG)"" ); + SendMessage ( GetDlgItem ( mPage, IDC_GUIED_ITEMTEXTFONT ), CB_ADDSTRING, 0, (LONG_PTR)"" ); idFileList *folders; int i; @@ -424,7 +424,7 @@ bool rvGEItemPropsTextPage::Init ( void ) continue; } - SendMessage ( GetDlgItem ( mPage, IDC_GUIED_ITEMTEXTFONT ), CB_ADDSTRING, 0, (LONG)folders->GetFile(i) ); + SendMessage ( GetDlgItem ( mPage, IDC_GUIED_ITEMTEXTFONT ), CB_ADDSTRING, 0, (LONG_PTR)folders->GetFile(i) ); } fileSystem->FreeFileList( folders ); @@ -547,7 +547,7 @@ bool rvGEItemPropsTextPage::SetActive ( void ) int fontSel; font.StripQuotes ( ); font.StripPath ( ); - fontSel = SendMessage ( GetDlgItem ( mPage, IDC_GUIED_ITEMTEXTFONT ), CB_FINDSTRING, -1, (LONG)font.c_str () ); + fontSel = SendMessage ( GetDlgItem ( mPage, IDC_GUIED_ITEMTEXTFONT ), CB_FINDSTRING, -1, (LONG_PTR)font.c_str () ); SendMessage ( GetDlgItem ( mPage, IDC_GUIED_ITEMTEXTFONT ), CB_SETCURSEL, 0, 0 ); SendMessage ( GetDlgItem ( mPage, IDC_GUIED_ITEMTEXTFONT ), CB_SETCURSEL, fontSel==-1?0:fontSel, 0 ); @@ -633,7 +633,7 @@ bool rvGEItemPropsTextPage::KillActive ( void ) else { char fontName[MAX_PATH]; - SendMessage ( GetDlgItem ( mPage, IDC_GUIED_ITEMTEXTFONT ), CB_GETLBTEXT, fontSel, (LONG)fontName ); + SendMessage ( GetDlgItem ( mPage, IDC_GUIED_ITEMTEXTFONT ), CB_GETLBTEXT, fontSel, (LONG_PTR)fontName ); mDict->Set ( "font", idStr("\"fonts/") + idStr(fontName) + idStr("\"" ) ); } @@ -816,7 +816,7 @@ int rvGEItemPropsKeysPage::HandleMessage ( UINT msg, WPARAM wParam, LPARAM lPara item.mask = LVIF_TEXT|LVIF_PARAM; item.iItem = ListView_GetItemCount ( list ); item.pszText = (LPSTR)key->GetKey().c_str ( ); - item.lParam = (LONG) key; + item.lParam = (LONG_PTR) key; int index = ListView_InsertItem ( list, &item ); finalValue.StripQuotes ( ); @@ -979,7 +979,7 @@ bool rvGEItemPropsKeysPage::SetActive ( void ) item.mask = LVIF_TEXT|LVIF_PARAM; item.iItem = ListView_GetItemCount ( list ); item.pszText = (LPSTR)key->GetKey().c_str ( ); - item.lParam = (LONG) key; + item.lParam = (LONG_PTR) key; int index = ListView_InsertItem ( list, &item ); idStr value; @@ -1224,7 +1224,7 @@ bool GEItemPropsDlg_DoModal ( HWND parent, idWindow* window, idDict& dict ) 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)new rvGEItemPropsGeneralPage ( &dict, wrapper->GetWindowType ( ) ); + propsp[RVITEMPROPS_GENERAL].lParam = (LONG_PTR)new rvGEItemPropsGeneralPage ( &dict, wrapper->GetWindowType ( ) ); propsp[RVITEMPROPS_IMAGE].dwSize = sizeof(PROPSHEETPAGE); propsp[RVITEMPROPS_IMAGE].dwFlags = PSP_USETITLE; @@ -1232,7 +1232,7 @@ bool GEItemPropsDlg_DoModal ( HWND parent, idWindow* window, idDict& dict ) 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)new rvGEItemPropsImagePage ( &dict );; + propsp[RVITEMPROPS_IMAGE].lParam = (LONG_PTR)new rvGEItemPropsImagePage ( &dict );; propsp[RVITEMPROPS_TEXT].dwSize = sizeof(PROPSHEETPAGE); propsp[RVITEMPROPS_TEXT].dwFlags = PSP_USETITLE; @@ -1240,7 +1240,7 @@ bool GEItemPropsDlg_DoModal ( HWND parent, idWindow* window, idDict& dict ) 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)new rvGEItemPropsTextPage ( &dict );; + propsp[RVITEMPROPS_TEXT].lParam = (LONG_PTR)new rvGEItemPropsTextPage ( &dict );; propsp[RVITEMPROPS_KEYS].dwSize = sizeof(PROPSHEETPAGE); propsp[RVITEMPROPS_KEYS].dwFlags = PSP_USETITLE; @@ -1248,7 +1248,7 @@ bool GEItemPropsDlg_DoModal ( HWND parent, idWindow* window, idDict& dict ) 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)new rvGEItemPropsKeysPage ( &dict, wrapper ); + propsp[RVITEMPROPS_KEYS].lParam = (LONG_PTR)new rvGEItemPropsKeysPage ( &dict, wrapper ); propsh.dwSize = sizeof(PROPSHEETHEADER); propsh.nStartPage = gApp.GetOptions().GetLastOptionsPage ( ); diff --git a/neo/tools/guied/GENavigator.cpp b/neo/tools/guied/GENavigator.cpp index 948fc34d..7167d1da 100644 --- a/neo/tools/guied/GENavigator.cpp +++ b/neo/tools/guied/GENavigator.cpp @@ -472,7 +472,7 @@ void rvGENavigator::AddWindow ( idWindow* window ) ZeroMemory ( &item, sizeof(item) ); item.mask = LVIF_PARAM|LVIF_STATE|LVIF_IMAGE; item.iItem = ListView_GetItemCount ( mTree ); - item.lParam = (LONG) window; + item.lParam = (LONG_PTR) window; item.iImage = 0; item.state = rvGEWindowWrapper::GetWrapper(window)->IsSelected ()? LVIS_SELECTED:0; item.stateMask = LVIS_SELECTED; diff --git a/neo/tools/guied/GEStatusBar.cpp b/neo/tools/guied/GEStatusBar.cpp index fefc41f3..5a51ccdd 100644 --- a/neo/tools/guied/GEStatusBar.cpp +++ b/neo/tools/guied/GEStatusBar.cpp @@ -93,7 +93,7 @@ void rvGEStatusBar::Update ( void ) { parts[0] = -1; - SendMessage ( mWnd, SB_SETPARTS, 1, (LONG)parts ); + SendMessage ( mWnd, SB_SETPARTS, 1, (LONG_PTR)parts ); SendMessage ( mWnd, SB_SETTEXT, 1, (LPARAM) "" ); } else @@ -107,7 +107,7 @@ void rvGEStatusBar::Update ( void ) parts[3] = parts[2] + 40; parts[4] = -1; - SendMessage ( mWnd, SB_SETPARTS, 5, (LONG)parts ); + SendMessage ( mWnd, SB_SETPARTS, 5, (LONG_PTR)parts ); SendMessage ( mWnd, SB_SETTEXT, 0, (LPARAM) "" ); SendMessage ( mWnd, SB_SETTEXT, 1, (LPARAM) va(" Tris: %d", mTriangles ) ); SendMessage ( mWnd, SB_SETTEXT, 2, (LPARAM) va(" Zoom: %d%%", mZoom ) ); diff --git a/neo/tools/guied/GEWorkspace.cpp b/neo/tools/guied/GEWorkspace.cpp index 482bab61..3f197680 100644 --- a/neo/tools/guied/GEWorkspace.cpp +++ b/neo/tools/guied/GEWorkspace.cpp @@ -887,7 +887,7 @@ int rvGEWorkspace::HandleRButtonDown ( WPARAM wParam, LPARAM lParam ) AppendMenu ( popup, MF_STRING|MF_ENABLED|(wrapper->IsSelected()?MF_CHECKED:0), ID_GUIED_SELECT_FIRST + i, mSelectMenu[i]->GetName() ); } - InsertMenu ( menu, 1, MF_POPUP|MF_BYPOSITION, (LONG) popup, "Select" ); + InsertMenu ( menu, 1, MF_POPUP|MF_BYPOSITION, (UINT_PTR) popup, "Select" ); // Bring up the popup menu ClientToScreen ( mWnd, &point ); diff --git a/neo/tools/guied/GEWorkspaceFile.cpp b/neo/tools/guied/GEWorkspaceFile.cpp index de1e37ae..937dc84a 100644 --- a/neo/tools/guied/GEWorkspaceFile.cpp +++ b/neo/tools/guied/GEWorkspaceFile.cpp @@ -58,9 +58,9 @@ bool rvGEWorkspace::SaveFile ( const char* filename ) ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_savepath" ); // Open the output file for write - if ( !(file = fileSystem->OpenFileWrite ( tempfile ) ) ) + file = fileSystem->OpenFileWrite(tempfile); + if ( !file ) { - int error = GetLastError ( ); SetCursor ( LoadCursor ( NULL, MAKEINTRESOURCE(IDC_ARROW ) ) ); return false; } diff --git a/neo/tools/materialeditor/MaterialDoc.cpp b/neo/tools/materialeditor/MaterialDoc.cpp index 479c902d..aca567e2 100644 --- a/neo/tools/materialeditor/MaterialDoc.cpp +++ b/neo/tools/materialeditor/MaterialDoc.cpp @@ -768,7 +768,6 @@ void MaterialDoc::ParseStage(idLexer* src) { */ void MaterialDoc::AddSpecialMapStage(const char* stageName, const char* map) { MEStage_t* newStage = new MEStage_t(); - int index = editMaterial.stages.Append(newStage); newStage->stageData.Set("name", stageName); newStage->stageData.Set("map", map); newStage->stageData.SetInt("stagetype", STAGE_TYPE_SPECIALMAP); diff --git a/neo/tools/materialeditor/MaterialTreeView.cpp b/neo/tools/materialeditor/MaterialTreeView.cpp index 2a204e89..69f93f6a 100644 --- a/neo/tools/materialeditor/MaterialTreeView.cpp +++ b/neo/tools/materialeditor/MaterialTreeView.cpp @@ -119,8 +119,6 @@ void MaterialTreeView::InitializeMaterialList(bool includeFile, const char* file */ void MaterialTreeView::BuildMaterialList(bool includeFile, const char* filename) { - CTreeCtrl& tree = GetTreeCtrl(); - idStrList list(1024); int count = declManager->GetNumDecls( DECL_MATERIAL ); @@ -140,10 +138,6 @@ void MaterialTreeView::BuildMaterialList(bool includeFile, const char* filename) continue; } - if(filename.Find("def") != -1) { - int x = 0; - } - if(includeFile) { filename.StripPath(); temp = idStr(mat->GetFileName()) + "/" + idStr(mat->GetName()) + "|" + filename; @@ -1807,7 +1801,7 @@ void MaterialTreeView::SetItemImage(HTREEITEM item, bool mod, bool apply, bool c CTreeCtrl& tree = GetTreeCtrl(); - int image; + int image = 0; DWORD itemType = tree.GetItemData(item); switch(itemType) { diff --git a/neo/tools/materialeditor/StageView.cpp b/neo/tools/materialeditor/StageView.cpp index eb58fb53..cca42af9 100644 --- a/neo/tools/materialeditor/StageView.cpp +++ b/neo/tools/materialeditor/StageView.cpp @@ -365,8 +365,6 @@ void StageView::OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult) { * Notifies the property view that all stages have been removed. */ void StageView::OnLvnDeleteallitems(NMHDR *pNMHDR, LRESULT *pResult) { - LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR); - //The list has been cleared so clear the prop view m_propView->SetPropertyListType(-1); diff --git a/neo/tools/pda/DialogPDAEditor.cpp b/neo/tools/pda/DialogPDAEditor.cpp index a2061e6f..3599d4e5 100644 --- a/neo/tools/pda/DialogPDAEditor.cpp +++ b/neo/tools/pda/DialogPDAEditor.cpp @@ -125,12 +125,14 @@ void PDAEditorInit( const idDict *spawnArgs ) { g_PDAEditorDialog->ShowWindow( SW_SHOW ); g_PDAEditorDialog->SetFocus(); +#if 0 if ( spawnArgs ) { // select PDA based on spawn args const char *name = spawnArgs->GetString( "pda" ); idDeclPDA *decl = static_cast( const_cast( declManager->FindType( DECL_PDA, name ) ) ); // FIXME: select this PDA } +#endif } void PDAEditorRun( void ) { diff --git a/neo/tools/radiant/CamWnd.cpp b/neo/tools/radiant/CamWnd.cpp index 9052e7b8..8c12edb8 100644 --- a/neo/tools/radiant/CamWnd.cpp +++ b/neo/tools/radiant/CamWnd.cpp @@ -199,7 +199,6 @@ brush_t *g_pSplitList = NULL; */ void CCamWnd::OnPaint() { CPaintDC dc(this); // device context for painting - bool bPaint = true; if (!qwglMakeCurrent(dc.m_hDC, win32.hGLRC)) { common->Printf("ERROR: wglMakeCurrent failed..\n "); @@ -762,7 +761,7 @@ bool CCamWnd::CullBrush(brush_t *b, bool cubicOnly) { float distance = g_PrefsDlg.m_nCubicScale * 64; idVec3 mid; - for (int i = 0; i < 3; i++) { + for (i = 0; i < 3; i++) { mid[i] = (b->mins[i] + ((b->maxs[i] - b->mins[i]) / 2)); } @@ -1065,7 +1064,7 @@ void CCamWnd::Cam_Draw() { int nCount = g_ptrSelectedFaces.GetSize(); if (!renderMode) { - for (int i = 0; i < nCount; i++) { + for (i = 0; i < nCount; i++) { face_t *selFace = reinterpret_cast < face_t * > (g_ptrSelectedFaces.GetAt(i)); Face_Draw(selFace); DrawAxial(selFace); @@ -1079,7 +1078,7 @@ void CCamWnd::Cam_Draw() { if (renderMode) { qglColor3f(1, 0, 0); - for (int i = 0; i < nCount; i++) { + for (i = 0; i < nCount; i++) { face_t *selFace = reinterpret_cast < face_t * > (g_ptrSelectedFaces.GetAt(i)); Face_Draw(selFace); } @@ -1394,7 +1393,6 @@ void Tris_ToOBJ(const char *outFile, idTriList *tris, idMatList *mats) { int i, j, k; int indexBase = 1; idStr lastMaterial(""); - int matCount = 0; //idStr basePath = cvarSystem->GetCVarString( "fs_savepath" ); f->Printf( "mtllib %s.mtl\n", out ); for (i = 0; i < tris->Num(); i++) { @@ -1429,7 +1427,7 @@ void Tris_ToOBJ(const char *outFile, idTriList *tris, idMatList *mats) { } } - for (int j = 0; j < tri->numIndexes; j += 3) { + for (j = 0; j < tri->numIndexes; j += 3) { int i1, i2, i3; i1 = tri->indexes[j+2] + indexBase; i2 = tri->indexes[j+1] + indexBase; @@ -1461,7 +1459,7 @@ int Brush_TransformModel(brush_t *brush, idTriList *tris, idMatList *mats) { idRenderModel *model = brush->modelHandle; if (model) { float a = FloatForKey(brush->owner, "angle"); - float s, c; + float s = 0.0f, c = 0.0f; //FIXME: support full rotation matrix bool matrix = false; if (a) { diff --git a/neo/tools/radiant/CapDialog.h b/neo/tools/radiant/CapDialog.h index e78451eb..4e552baf 100644 --- a/neo/tools/radiant/CapDialog.h +++ b/neo/tools/radiant/CapDialog.h @@ -41,10 +41,10 @@ class CCapDialog : public CDialog { // Construction public: - static enum {BEVEL = 0, ENDCAP, IBEVEL, IENDCAP}; + enum {BEVEL = 0, ENDCAP, IBEVEL, IENDCAP}; CCapDialog(CWnd* pParent = NULL); // standard constructor - int getCapType() {return m_nCap;}; + int getCapType() {return m_nCap;}; // Dialog Data //{{AFX_DATA(CCapDialog) enum { IDD = IDD_DIALOG_CAP }; diff --git a/neo/tools/radiant/DRAG.CPP b/neo/tools/radiant/DRAG.CPP index a0a5bdf8..48d10f12 100644 --- a/neo/tools/radiant/DRAG.CPP +++ b/neo/tools/radiant/DRAG.CPP @@ -556,7 +556,7 @@ static void MoveSelection( const idVec3 &orgMove ) { if (g_pParentWnd->ActiveXY()->ScaleMode()) { idVec3 v; v[0] = v[1] = v[2] = 1.0f; - for (int i = 0; i < 3; i++) { + for (i = 0; i < 3; i++) { if ( move[i] > 0.0f ) { v[i] = 1.1f; } else if ( move[i] < 0.0f ) { diff --git a/neo/tools/radiant/DialogTextures.cpp b/neo/tools/radiant/DialogTextures.cpp index 4714106b..ecc4dec0 100644 --- a/neo/tools/radiant/DialogTextures.cpp +++ b/neo/tools/radiant/DialogTextures.cpp @@ -501,7 +501,6 @@ void CDialogTextures::OnClickTreeTextures(NMHDR *pNMHDR, LRESULT *pResult) { ======================================================================================================================= */ void CDialogTextures::OnSelchangedTreeTextures(NMHDR *pNMHDR, LRESULT *pResult) { - NM_TREEVIEW *pNMTreeView = (NM_TREEVIEW *) pNMHDR; *pResult = 0; editMaterial = NULL; diff --git a/neo/tools/radiant/DlgCamera.cpp b/neo/tools/radiant/DlgCamera.cpp index e26f65e4..eecac84f 100644 --- a/neo/tools/radiant/DlgCamera.cpp +++ b/neo/tools/radiant/DlgCamera.cpp @@ -186,7 +186,7 @@ void CDlgCamera::OnSelchangeComboSplines() void CDlgCamera::OnSelchangeListEvents() { - int sel = m_wndEvents.GetCurSel(); + //int sel = m_wndEvents.GetCurSel(); //g_splineList->setActiveSegment(sel >= 0 ? sel : 0); } diff --git a/neo/tools/radiant/EditorBrush.cpp b/neo/tools/radiant/EditorBrush.cpp index 092eb267..389c1047 100644 --- a/neo/tools/radiant/EditorBrush.cpp +++ b/neo/tools/radiant/EditorBrush.cpp @@ -1518,10 +1518,6 @@ brush_t *Brush_Parse(idVec3 origin) { // read the texturedef GetToken(false); f->texdef.SetName(token); - if (token[0] == '(') { - int i = 32; - } - GetToken(false); f->texdef.shift[0] = atoi(token); GetToken(false); @@ -2063,6 +2059,7 @@ brush_t *Brush_CreatePyramid(idVec3 mins, idVec3 maxs, texdef_t *texdef) { // ++timo handle new brush primitive ? return here ?? return Brush_Create(mins, maxs, texdef); +#if 0 int i; for (i = 0; i < 3; i++) { if (maxs[i] < mins[i]) { @@ -2125,6 +2122,7 @@ brush_t *Brush_CreatePyramid(idVec3 mins, idVec3 maxs, texdef_t *texdef) { } return b; +#endif } /* @@ -2135,7 +2133,7 @@ Brush_MakeSided ================ */ void Brush_MakeSided(int sides) { - int i, axis; + int i, axis = 0; idVec3 mins, maxs; brush_t *b; texdef_t *texdef; @@ -2537,7 +2535,7 @@ bool Brush_ModelIntersect(brush_t *b, idVec3 origin, idVec3 dir,float &scale) { bool matrix = false; idMat3 mat; - float a, s, c; + float a = 0.0f, s = 0.0f, c = 0.0f; if (GetMatrixForKey(b->owner, "rotation", mat)) { matrix = true; } else { @@ -3144,7 +3142,6 @@ void Brush_UpdateLightPoints(brush_t *b, const idVec3 &offset) { if (GetVectorForKey(b->owner, "light_center", vCenter)) { if (offset.x || offset.y || offset.z) { - CString str; VectorAdd(vCenter, offset, vCenter); SetKeyVec3(b->owner, "light_center", vCenter); } @@ -4356,7 +4353,6 @@ void Brush_DrawCombatNode( brush_t *b, bool cameraView, bool bSelected ) { idVec3 cone_left = leftang.ToForward(); idAngles rightang( 0.0f, yaw - fov * 0.5f + 90.0f, 0.0f ); idVec3 cone_right = rightang.ToForward(); - bool disabled = b->owner->epairs.GetBool( "start_off" ); idVec4 color; if ( bSelected ) { @@ -4610,7 +4606,7 @@ void Brush_DrawCurve( brush_t *b, bool bSelected, bool cam ) { } int maxage = b->owner->curve->GetNumValues(); - int i, time = 0; + int i; qglColor3f( 0.0f, 0.0f, 1.0f ); for ( i = 0; i < maxage; i++) { diff --git a/neo/tools/radiant/EditorEntity.cpp b/neo/tools/radiant/EditorEntity.cpp index 7d6e4922..be88b4c0 100644 --- a/neo/tools/radiant/EditorEntity.cpp +++ b/neo/tools/radiant/EditorEntity.cpp @@ -734,28 +734,28 @@ entity_t *Entity_PostParse(entity_t *ent, brush_t *pList) { } if (needsOrigin) { - idVec3 mins, maxs, mid; + idVec3 entmins, entmaxs, mid; int i; char text[32]; - mins[0] = mins[1] = mins[2] = 999999; - maxs[0] = maxs[1] = maxs[2] = -999999; + entmins[0] = entmins[1] = entmins[2] = 999999; + entmaxs[0] = entmaxs[1] = entmaxs[2] = -999999; // add in the origin for (b = ent->brushes.onext; b != &ent->brushes; b = b->onext) { Brush_Build(b, true, false, false); for (i = 0; i < 3; i++) { - if (b->mins[i] < mins[i]) { - mins[i] = b->mins[i]; + if (b->mins[i] < entmins[i]) { + entmins[i] = b->mins[i]; } - if (b->maxs[i] > maxs[i]) { - maxs[i] = b->maxs[i]; + if (b->maxs[i] > entmaxs[i]) { + entmaxs[i] = b->maxs[i]; } } } for (i = 0; i < 3; i++) { - ent->origin[i] = (mins[i] + ((maxs[i] - mins[i]) / 2)); + ent->origin[i] = (entmins[i] + ((entmaxs[i] - entmins[i]) / 2)); } sprintf(text, "%i %i %i", (int)ent->origin[0], (int)ent->origin[1], (int)ent->origin[2]); @@ -809,7 +809,6 @@ entity_t *Entity_Parse(bool onlypairs, brush_t *pList) { ent->brushes.onext = ent->brushes.oprev = &ent->brushes; ent->origin.Zero(); - int n = 0; do { if (!GetToken(true)) { Warning("ParseEntity: EOF without closing brace"); diff --git a/neo/tools/radiant/EditorMap.cpp b/neo/tools/radiant/EditorMap.cpp index aaa34f3a..63946f6e 100644 --- a/neo/tools/radiant/EditorMap.cpp +++ b/neo/tools/radiant/EditorMap.cpp @@ -51,14 +51,6 @@ entity_t *world_entity = NULL; // "classname" "worldspawn" ! void AddRegionBrushes(void); void RemoveRegionBrushes(void); -/* - ======================================================================================================================= - ======================================================================================================================= - */ -void DupLists() { - DWORD dw = GetTickCount(); -} - /* * Cross map selection saving this could mess this up if you have only part of a * complex entity selected... diff --git a/neo/tools/radiant/EntityDlg.cpp b/neo/tools/radiant/EntityDlg.cpp index 782e8993..ead5d104 100644 --- a/neo/tools/radiant/EntityDlg.cpp +++ b/neo/tools/radiant/EntityDlg.cpp @@ -940,7 +940,7 @@ void CEntityDlg::OnCbnDblclkComboClass() // ======================================================================================================================= // void CEntityDlg::CreateEntity() { - entity_t *petNew; + entity_t *petNew = NULL; bool forceFixed = false; // check to make sure we have a brush diff --git a/neo/tools/radiant/GLWidget.cpp b/neo/tools/radiant/GLWidget.cpp index 70f0063b..558a6d1c 100644 --- a/neo/tools/radiant/GLWidget.cpp +++ b/neo/tools/radiant/GLWidget.cpp @@ -465,8 +465,8 @@ void idGLDrawableMaterial::draw(int x, int y, int w, int h) { refdef.time = eventLoop->Milliseconds(); world->RenderScene( &refdef ); - int frontEnd, backEnd; - renderSystem->EndFrame( &frontEnd, &backEnd ); + int rsFrontEnd, rsBackEnd; + renderSystem->EndFrame( &rsFrontEnd, &rsBackEnd ); qglMatrixMode( GL_MODELVIEW ); qglLoadIdentity(); diff --git a/neo/tools/radiant/LightDlg.cpp b/neo/tools/radiant/LightDlg.cpp index 31cf2d17..219d5641 100644 --- a/neo/tools/radiant/LightDlg.cpp +++ b/neo/tools/radiant/LightDlg.cpp @@ -179,6 +179,8 @@ void CLightInfo::ToDictWriteAllInfo( idDict *e ) { if (strTexture.GetLength() > 0 ) { e->Set("texture", strTexture); + } else { + e->Set("texture", ""); } idVec3 temp = color; @@ -940,19 +942,19 @@ void CLightDlg::OnCheckParallel() { //jhefty - only apply settings that are different void CLightDlg::OnApplyDifferences () { - idDict differences, modified, original; + idDict differences, modifiedlight, originallight; UpdateLightInfoFromDialog(); - lightInfo.ToDict( &modified ); - lightInfoOriginal.ToDictWriteAllInfo( &original ); + lightInfo.ToDict( &modifiedlight); + lightInfoOriginal.ToDictWriteAllInfo( &originallight); - differences = modified; + differences = modifiedlight; // jhefty - compile a set of modified values to apply - for ( int i = 0; i < modified.GetNumKeyVals (); i ++ ) { - const idKeyValue* valModified = modified.GetKeyVal ( i ); - const idKeyValue* valOriginal = original.FindKey ( valModified->GetKey() ); + for ( int i = 0; i < modifiedlight.GetNumKeyVals (); i ++ ) { + const idKeyValue* valModified = modifiedlight.GetKeyVal ( i ); + const idKeyValue* valOriginal = originallight.FindKey ( valModified->GetKey() ); //if it hasn't changed, remove it from the list of values to apply if ( !valOriginal || ( valModified->GetValue() == valOriginal->GetValue() ) ) { @@ -962,7 +964,7 @@ void CLightDlg::OnApplyDifferences () { SaveLightInfo( &differences ); - lightInfoOriginal.FromDict( &modified ); + lightInfoOriginal.FromDict( &modifiedlight); Sys_UpdateWindows( W_ALL ); } diff --git a/neo/tools/radiant/MainFrm.cpp b/neo/tools/radiant/MainFrm.cpp index 28dcd4ce..5c6b1a33 100644 --- a/neo/tools/radiant/MainFrm.cpp +++ b/neo/tools/radiant/MainFrm.cpp @@ -728,7 +728,7 @@ static UINT indicators[] = { ======================================================================================================================= */ void CMainFrame::OnDisplayChange( WPARAM wp, LPARAM lp ) { - int n = wp; +// int n = wp; } /* @@ -1025,7 +1025,6 @@ MFCCreate */ void MFCCreate( HINSTANCE hInstance ) { - HMENU hMenu = NULL; int i = sizeof(g_qeglobals.d_savedinfo); long l = i; @@ -1079,8 +1078,8 @@ void MFCCreate( HINSTANCE hInstance ) // old size was smaller, reload original prefs if (nOldSize > 0 && nOldSize < sizeof(g_qeglobals.d_savedinfo)) { - long l = nOldSize; - LoadRegistryInfo("radiant_SavedInfo", &g_qeglobals.d_savedinfo, &l); + long lOldSize = nOldSize; + LoadRegistryInfo("radiant_SavedInfo", &g_qeglobals.d_savedinfo, &lOldSize); } } } @@ -2134,7 +2133,7 @@ This is the new all-internal bsp ============ */ void RunBsp (const char *command) { - char sys[2048]; + char system[2048]; char name[2048]; char *in; @@ -2182,28 +2181,28 @@ void RunBsp (const char *command) { ::GetModuleFileName(AfxGetApp()->m_hInstance, buff, sizeof(buff)); if (strlen(command) > strlen("bspext")) { - idStr::snPrintf( sys, sizeof(sys), "%s %s +set r_fullscreen 0 +dmap editorOutput %s %s +quit", buff, paths.c_str(), command + strlen("bspext"), in ); + idStr::snPrintf( system, sizeof(system), "%s %s +set r_fullscreen 0 +dmap editorOutput %s %s +quit", buff, paths.c_str(), command + strlen("bspext"), in ); } else { - idStr::snPrintf( sys, sizeof(sys), "%s %s +set r_fullscreen 0 +dmap editorOutput %s +quit", buff, paths.c_str(), in ); + idStr::snPrintf( system, sizeof(system), "%s %s +set r_fullscreen 0 +dmap editorOutput %s +quit", buff, paths.c_str(), in ); } ::GetStartupInfo (&startupinfo); - if (!CreateProcess(NULL, sys, NULL, NULL, FALSE, 0, NULL, NULL, &startupinfo, &ProcessInformation)) { + if (!CreateProcess(NULL, system, NULL, NULL, FALSE, 0, NULL, NULL, &startupinfo, &ProcessInformation)) { common->Printf("Could not start bsp process %s %s/n", buff, sys); } g_pParentWnd->SetFocus(); } else { // assumes bsp is the command if (strlen(command) > strlen("bsp")) { - idStr::snPrintf( sys, sizeof(sys), "dmap %s %s", command + strlen("bsp"), in ); + idStr::snPrintf( system, sizeof(system), "dmap %s %s", command + strlen("bsp"), in ); } else { - idStr::snPrintf( sys, sizeof(sys), "dmap %s", in ); + idStr::snPrintf( system, sizeof(system), "dmap %s", in ); } cmdSystem->BufferCommandText( CMD_EXEC_NOW, "disconnect\n" ); // issue the bsp command - Dmap_f( idCmdArgs( sys, false ) ); + Dmap_f( idCmdArgs( system, false ) ); } } @@ -2743,8 +2742,8 @@ LPCSTR String_ToLower(LPCSTR psString) bool FindNextBrush(brush_t* pPrevFoundBrush) // can be NULL for fresh search { bool bFoundSomething = false; - entity_t *pLastFoundEnt; - brush_t *pLastFoundBrush; + entity_t *pLastFoundEnt = NULL; + brush_t *pLastFoundBrush = NULL; CWaitCursor waitcursor; @@ -3007,8 +3006,7 @@ void CMainFrame::OnMiscSetViewPos() if (iArgsFound == 3) { // try for an optional 4th (note how this wasn't part of the sscanf() above, so I can check 1st-3, not just any 3) - // - int iArgsFound = sscanf(psNewCoords,"%f %f %f %f", &v3Viewpos[0], &v3Viewpos[1], &v3Viewpos[2], &fYaw); + iArgsFound = sscanf(psNewCoords,"%f %f %f %f", &v3Viewpos[0], &v3Viewpos[1], &v3Viewpos[2], &fYaw); if (iArgsFound != 4) { fYaw = 0; // jic diff --git a/neo/tools/radiant/PMESH.CPP b/neo/tools/radiant/PMESH.CPP index 9decaab4..5943978e 100644 --- a/neo/tools/radiant/PMESH.CPP +++ b/neo/tools/radiant/PMESH.CPP @@ -59,9 +59,6 @@ patchMesh_t * MakeNewPatch( int width,int height ) { void Patch_AdjustSize( patchMesh_t *p,int wadj,int hadj ) { idDrawVert *newverts = reinterpret_cast< idDrawVert*>(Mem_ClearedAlloc(sizeof(idDrawVert) * (p->width + wadj) * (p->height + hadj))); - int copyWidth = (wadj < 0) ? p->width + wadj : p->width; - int copyHeight = (hadj < 0) ? p->height + hadj : p->height; - int copysize = copyWidth *copyHeight * sizeof(idDrawVert); for ( int i = 0; i < p->width; i++ ) { for ( int j = 0; j < p->height; j++ ) { @@ -1325,7 +1322,6 @@ brush_t * CapSpecial( patchMesh_t *pParent,int nType,bool bFirst ) { vMin[0] = vMin[1] = vMin[2] = 99999; vMax[0] = vMax[1] = vMax[2] = -99999; - int nSize = pParent->width; int nIndex = (bFirst) ? 0 : pParent->height - 1; // parent bounds are used for some things @@ -1506,8 +1502,8 @@ void Patch_CapCurrent( bool bInvertedBevel,bool bInvertedEndcap ) { //FIXME: Table drive all this crap // void GenerateEndCaps( brush_t *brushParent,bool bBevel,bool bEndcap,bool bInverted ) { - brush_t *b, *b2; - patchMesh_t *p, *p2, *pParent; + brush_t *b; + patchMesh_t *p, *pParent; idVec3 vTemp, vMin, vMax; int i, j; @@ -1549,6 +1545,7 @@ void GenerateEndCaps( brush_t *brushParent,bool bBevel,bool bEndcap,bool bInvert Select_Brush(p->pSymbiot); return; +#if 0 bool bCreated = false; if ( bInverted ) { @@ -1712,7 +1709,7 @@ void GenerateEndCaps( brush_t *brushParent,bool bBevel,bool bEndcap,bool bInvert Select_Delete(); } //Select_Brush(brushParent); - +#endif } @@ -2207,9 +2204,7 @@ DrawPatchMesh //FIXME: this routine needs to be reorganized.. should be about 1/4 the size and complexity void DrawPatchMesh( patchMesh_t *pm,bool bPoints,int *list,bool bShade = false ) { int i, j; - bool bOverlay = pm->bOverlay; - int nDrawMode = g_pParentWnd->GetCamera()->Camera().draw_mode; // patches use two display lists, one for camera one for xy if ( *list <= 0 ) { @@ -3145,9 +3140,9 @@ void Parse2DMatrix( int y,int x,float *p ) { GetToken(true); // ) } -void Parse3DMatrix( int z,int y,int x,float *p ) { +void Parse3DMatrix( int _z,int y,int x,float *p ) { GetToken(true); // ( - for ( int i = 0; i < z; i++ ) { + for ( int i = 0; i < _z; i++ ) { Parse2DMatrix(y, x, p + i * (x * MAX_PATCH_HEIGHT)); } GetToken(true); // ) @@ -3904,11 +3899,11 @@ void _Write2DMatrix( FILE *f,int y,int x,float *m ) { } -void _Write3DMatrix( FILE *f,int z,int y,int x,float *m ) { +void _Write3DMatrix( FILE *f,int _z,int y,int x,float *m ) { int i; fprintf(f, "(\n"); - for ( i = 0 ; i < z ; i++ ) { + for ( i = 0 ; i < _z ; i++ ) { _Write2DMatrix(f, y, x, m + i * (x * MAX_PATCH_HEIGHT)); } fprintf(f, ")\n"); @@ -3940,11 +3935,11 @@ void _Write2DMatrix( CMemFile *f,int y,int x,float *m ) { } -void _Write3DMatrix( CMemFile *f,int z,int y,int x,float *m ) { +void _Write3DMatrix( CMemFile *f,int _z,int y,int x,float *m ) { int i; MemFile_fprintf(f, "(\n"); - for ( i = 0 ; i < z ; i++ ) { + for ( i = 0 ; i < _z ; i++ ) { _Write2DMatrix(f, y, x, m + i * (x * MAX_PATCH_HEIGHT)); } MemFile_fprintf(f, ")\n"); @@ -4381,11 +4376,6 @@ void Patch_FromTriangle( idVec5 vx,idVec5 vy,idVec5 vz ) { p->ctrl(2, 1).st[1] = vMidYZ[4]; p->ctrl(2, 2).st[0] = vz[3]; p->ctrl(2, 2).st[1] = vz[4]; - - - //Patch_Naturalize(p); - - brush_t *b = AddBrushForPatch(p); } diff --git a/neo/tools/radiant/PreviewDlg.cpp b/neo/tools/radiant/PreviewDlg.cpp index ad80b989..e067cddc 100644 --- a/neo/tools/radiant/PreviewDlg.cpp +++ b/neo/tools/radiant/PreviewDlg.cpp @@ -147,9 +147,9 @@ void CPreviewDlg::AddCommentedItems() { if (fileSystem->ReadFile(path, (void**)&buffer, NULL) && buffer) { src.LoadMemory(buffer, strlen(buffer), path); if (src.IsLoaded()) { - idToken token, tok1, tok2, tok3; - while( src.ReadToken( &token ) ) { - if (token == "{") { + idToken commenttoken, tok1, tok2, tok3; + while( src.ReadToken( &commenttoken) ) { + if (commenttoken == "{") { // start a new commented item CommentedItem ci; if (src.ReadToken(&tok1) && src.ReadToken(&tok2) && src.ReadToken(&tok3)) { @@ -278,7 +278,6 @@ void CPreviewDlg::AddStrList( const char *root, const idStrList &list, int id ) void CPreviewDlg::OnTvnSelchangedTreeMedia(NMHDR *pNMHDR, LRESULT *pResult) { - LPNMTREEVIEW pNMTreeView = reinterpret_cast(pNMHDR); HTREEITEM item = treeMedia.GetSelectedItem(); mediaName = ""; CWnd *add = GetDlgItem(IDC_BUTTON_ADD); diff --git a/neo/tools/radiant/WIN_QE3.CPP b/neo/tools/radiant/WIN_QE3.CPP index e234c228..0ac00ae0 100644 --- a/neo/tools/radiant/WIN_QE3.CPP +++ b/neo/tools/radiant/WIN_QE3.CPP @@ -281,11 +281,6 @@ void Error(char *error, ...) { void Warning(char *error, ...) { va_list argptr; char text[1024]; - int err; - - err = GetLastError(); - - int i = qglGetError(); va_start(argptr, error); vsprintf(text, error, argptr); @@ -320,7 +315,7 @@ static char szFilter[260] = /* filter string */ static char szProjectFilter[260] = /* filter string */ "Q3Radiant project (*.qe4, *.prj)\0*.qe4\0*.prj\0\0"; static char chReplace; /* string separator for szFilter */ -static int i, cbString; /* integer count variables */ +static int cbString; /* integer count variables */ static HANDLE hf; /* file handle */ /* diff --git a/neo/tools/radiant/XYWnd.cpp b/neo/tools/radiant/XYWnd.cpp index 7f4c28cc..86759582 100644 --- a/neo/tools/radiant/XYWnd.cpp +++ b/neo/tools/radiant/XYWnd.cpp @@ -1870,8 +1870,6 @@ void CreateSmartEntity(CXYWnd *pWnd, int x, int y, const char *pName) { void FinishSmartCreation() { CPtrArray array; HideInfoDialog(); - - brush_t *pEntities = NULL; if (g_strSmartEntity.Find("Smart_Train") >= 0) { g_bScreenUpdates = false; CreateRightClickEntity(g_pParentWnd->ActiveXY(), g_nSmartX, g_nSmartY, "func_train"); @@ -2098,7 +2096,7 @@ bool MergeMenu(CMenu * pMenuDestination, const CMenu * pMenuAdd, bool bTopLevel HMENU hNewMenu = NewPopupMenu.GetSafeHmenu(); if (pMenuDestination->InsertMenu(iInsertPosDefault, MF_BYPOSITION | MF_POPUP | MF_ENABLED, - (UINT)hNewMenu, sMenuAddString )) + (UINT_PTR)hNewMenu, sMenuAddString )) { // don't forget to correct the item count iMenuDestItemCount++; @@ -2169,7 +2167,7 @@ void CXYWnd::HandleDrop() { if (pChild) { pMakeEntityPop->AppendMenu ( MF_POPUP, - reinterpret_cast < unsigned int > (pChild->GetSafeHmenu()), + reinterpret_cast (pChild->GetSafeHmenu()), strActive ); g_ptrMenus.Add(pChild); @@ -2188,7 +2186,7 @@ void CXYWnd::HandleDrop() { if (pChild) { pMakeEntityPop->AppendMenu ( MF_POPUP, - reinterpret_cast < unsigned int > (pChild->GetSafeHmenu()), + reinterpret_cast (pChild->GetSafeHmenu()), strActive ); g_ptrMenus.Add(pChild); @@ -2204,7 +2202,7 @@ void CXYWnd::HandleDrop() { if ( pMakeEntityPop != &m_mnuDrop ) { m_mnuDrop.AppendMenu ( MF_POPUP, - reinterpret_cast < unsigned int > (pMakeEntityPop->GetSafeHmenu()), + reinterpret_cast (pMakeEntityPop->GetSafeHmenu()), "Make Entity" ); } @@ -2874,8 +2872,6 @@ void CXYWnd::XY_DrawGrid() { // glColor4f(0, 0, 0, 0); qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT].ToFloatPtr()); - float lastRaster = xb; - for (x = xb; x < xe; x += stepSize) { qglRasterPos2f(x, m_vOrigin[nDim2] + h - 10 / m_fScale); sprintf(text, "%i", (int)x); @@ -3330,7 +3326,7 @@ void DrawPathLines(void) { num_entities = 0; for (te = entities.next; te != &entities && num_entities != MAX_MAP_ENTITIES; te = te->next) { - for (int i = 0; i < 2048; i++) { + for (i = 0; i < 2048; i++) { if (i == 0) { ent_target[num_entities] = ValueForKey(te, "target"); } else { @@ -4260,9 +4256,7 @@ bool CXYWnd::UndoAvailable() { void CXYWnd::Paste() { #if 1 - CWaitCursor WaitCursor; - bool bPasted = false; UINT nClipboard = ::RegisterClipboardFormat("RadiantClippings"); if (nClipboard > 0 && OpenClipboard() && ::IsClipboardFormatAvailable(nClipboard)) { HANDLE h = ::GetClipboardData(nClipboard); @@ -4285,7 +4279,7 @@ void CXYWnd::Paste() int nLen = g_Clipboard.GetLength(); char *pBuffer = new char[nLen + 1]; - memset(pBuffer, 0, sizeof(*pBuffer) * (nLen + 1)); + memset(pBuffer, 0, nLen + 1); g_Clipboard.Read(pBuffer, nLen); pBuffer[nLen] = '\0'; Map_ImportBuffer(pBuffer, !(GetAsyncKeyState(VK_SHIFT) & 0x8000)); @@ -4505,8 +4499,7 @@ BOOL CXYWnd::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) void CXYWnd::DrawPrecisionCrosshair( void ) { // FIXME: m_mouseX, m_mouseY, m_axisHoriz, m_axisVert, etc... are never set - return; - +#if 0 idVec3 mouse3dPos (0.0f, 0.0f, 0.0f); float x, y; idVec4 crossEndColor (1.0f, 0.0f, 1.0f, 1.0f); // the RGBA color of the precision crosshair at its ends @@ -4566,4 +4559,5 @@ void CXYWnd::DrawPrecisionCrosshair( void ) // Radiant was in opaque, flat-shaded mode by default; restore this to prevent possible slowdown qglShadeModel( GL_FLAT ); qglDisable( GL_BLEND ); +#endif } diff --git a/neo/tools/radiant/splines.cpp b/neo/tools/radiant/splines.cpp index 4c5b6d65..c67a6158 100644 --- a/neo/tools/radiant/splines.cpp +++ b/neo/tools/radiant/splines.cpp @@ -403,7 +403,6 @@ idSplineList::buildSpline ================ */ void idSplineList::buildSpline() { - int start = Sys_Milliseconds(); clearSpline(); for(int i = 3; i < controlPoints.Num(); i++) { for (float tension = 0.0f; tension < 1.001f; tension += granularity) { @@ -419,7 +418,6 @@ void idSplineList::buildSpline() { } } dirty = false; - //common->Printf("Spline build took %f seconds\n", (float)(Sys_Milliseconds() - start) / 1000); } /* @@ -792,7 +790,6 @@ idCameraDef::addTarget ================ */ void idCameraDef::addTarget(const char *name, idCameraPosition::positionType type) { - const char *text = (name == NULL) ? va("target0%d", numTargets()+1) : name; idCameraPosition *pos = newFromType(type); if (pos) { pos->setName(name); @@ -1080,7 +1077,6 @@ idCameraDef::buildCamera void idCameraDef::buildCamera() { int i; - int lastSwitch = 0; idList waits; idList targets; @@ -1089,7 +1085,6 @@ void idCameraDef::buildCamera() { // we have a base time layout for the path and the target path // now we need to layer on any wait or speed changes for (i = 0; i < events.Num(); i++) { - idCameraEvent *ev = events[i]; events[i]->setTriggered(false); switch (events[i]->getType()) { case idCameraEvent::EVENT_TARGET : { @@ -1673,11 +1668,6 @@ idInterpolatedPosition::getPosition */ const idVec3 *idInterpolatedPosition::getPosition( long t ) { static idVec3 interpolatedPos; - - if (t - startTime > 6000) { - int i = 0; - } - float velocity = getVelocity(t); float timePassed = t - lastTime; lastTime = t; @@ -1685,10 +1675,6 @@ const idVec3 *idInterpolatedPosition::getPosition( long t ) { // convert to seconds timePassed /= 1000; - if (velocity != getBaseVelocity()) { - int i = 0; - } - float distToTravel = timePassed * velocity; idVec3 temp = startPos; @@ -2021,7 +2007,7 @@ const idVec3 *idSplinePosition::getPosition(long t) { idVec3 v1 = *target.getSegmentPoint(i - 1); idVec3 v2 = *target.getSegmentPoint(i); - double percent = (lastDistance2 - targetDistance) / (lastDistance2 - lastDistance1); + percent = (lastDistance2 - targetDistance) / (lastDistance2 - lastDistance1); v2 *= (1.0f - percent); v1 *= percent; v2 += v1; diff --git a/neo/tools/sound/DialogSound.cpp b/neo/tools/sound/DialogSound.cpp index 6949c101..42b1cc6d 100644 --- a/neo/tools/sound/DialogSound.cpp +++ b/neo/tools/sound/DialogSound.cpp @@ -635,7 +635,6 @@ void CDialogSound::SetWaveSize( const char *p ) { void CDialogSound::OnSelchangedTreeSounds(NMHDR* pNMHDR, LRESULT* pResult) { - NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; HTREEITEM item = treeSounds.GetSelectedItem(); SetWaveSize(); if (item) {