/* Copyright (c) 2002-2012 Croteam Ltd. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ // DlgMarkLinkedSurfaces.cpp : implementation file // #include "stdafx.h" #ifdef _DEBUG #undef new #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CDlgMarkLinkedSurfaces dialog CDlgMarkLinkedSurfaces::CDlgMarkLinkedSurfaces( CWnd* pParent /*=NULL*/) : CDialog(CDlgMarkLinkedSurfaces::IDD, pParent) { //{{AFX_DATA_INIT(CDlgMarkLinkedSurfaces) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT m_listSurfaces.m_pdlgParentDialog = this; } void CDlgMarkLinkedSurfaces::DoDataExchange(CDataExchange* pDX) { CModelerDoc* pDoc = theApp.GetDocument(); if( pDoc == NULL) return; CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDlgMarkLinkedSurfaces) DDX_Control(pDX, IDC_SURFACE_LIST, m_listSurfaces); //}}AFX_DATA_MAP // if dialog is giving data if( pDX->m_bSaveAndValidate != FALSE) { // for all surfaces added to list of surfaces for( INDEX iEntry=0; iEntryms_ulRenderingFlags |= SRF_SELECTED; else pms->ms_ulRenderingFlags &= ~SRF_SELECTED; } theApp.m_chGlobal.MarkChanged(); } } BEGIN_MESSAGE_MAP(CDlgMarkLinkedSurfaces, CDialog) //{{AFX_MSG_MAP(CDlgMarkLinkedSurfaces) ON_BN_CLICKED(ID_CLEAR_SELECTION, OnClearSelection) ON_BN_CLICKED(ID_SELECT_ALL, OnSelectAll) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDlgMarkLinkedSurfaces message handlers BOOL CDlgMarkLinkedSurfaces::OnInitDialog() { CDialog::OnInitDialog(); CModelerDoc* pDoc = theApp.GetDocument(); // get cont of surfaces INDEX ctSurfaces = pDoc->GetCountOfSelectedSurfaces(); ModelMipInfo &mmi = pDoc->m_emEditModel.edm_md.md_MipInfos[ pDoc->m_iCurrentMip]; for( INDEX iSurface=0; iSurface