// DlgMapFileInfo.cpp : implementation file // #include "stdafx.h" #include "worldcreator.h" #include "DlgMapFileInfo.h" #include "BaseDataDefine.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CDlgMapFileInfo dialog CDlgMapFileInfo::CDlgMapFileInfo(CWnd* pParent /*=NULL*/) : CDialog(CDlgMapFileInfo::IDD, pParent) { //{{AFX_DATA_INIT(CDlgMapFileInfo) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CDlgMapFileInfo::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDlgMapFileInfo) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDlgMapFileInfo, CDialog) //{{AFX_MSG_MAP(CDlgMapFileInfo) ON_BN_CLICKED(IDC_BUTTON_DELFILE, OnButtonDelfile) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDlgMapFileInfo message handlers void CDlgMapFileInfo::OnButtonDelfile() { // TODO: Add your control notification handler code here char strPath[256]; GetCurrentDirectory(256,strPath); sprintf(strPath,"%s\\Zone_01.z3s",strPath); FindUsedFileList(strPath); } void CDlgMapFileInfo::FindUsedFileList(char *strFilename) { FILE *fp=fopen(strFilename,"rb"); if(fp==NULL) return; char strRead[256]; fread(strRead,sizeof(char)*256,1,fp); long ReadTemp; fread(&ReadTemp,sizeof(long),1,fp); fread(&ReadTemp,sizeof(long),1,fp); fread(&ReadTemp,sizeof(long),1,fp); fread(&ReadTemp,sizeof(long),1,fp); int cSavedHeightData=0; fread(&cSavedHeightData,sizeof(int),1,fp); for(int cHeightData=0;cHeightData FileList; List TextureList; WIN32_FIND_DATA wfd = {0}; char strPath[256]; GetCurrentDirectory(256,strPath); char filename[256]; sprintf(filename,"%s\\Objects\\House\\*.*",strPath); HANDLE hFind = FindFirstFile(filename, &wfd); if(INVALID_HANDLE_VALUE == hFind) return; CString strFilePathname; while(1) { strFilePathname.Format("%s%s",filename,wfd.cFileName); FileList.Add(strFilePathname); if(FindNextFile(hFind, &wfd)==FALSE) break; } sprintf(filename,"%s\\Objects\\Object\\*.*",strPath); hFind = FindFirstFile(filename, &wfd); while(1) { strFilePathname.Format("%s%s",filename,wfd.cFileName); FileList.Add(strFilePathname); if(FindNextFile(hFind, &wfd)==FALSE) break; } sprintf(filename,"%s\\Texture\\WideTexture\\*.*",strPath); hFind = FindFirstFile(filename, &wfd); while(1) { strFilePathname.Format("%s%s",filename,wfd.cFileName); FileList.Add(strFilePathname); if(FindNextFile(hFind, &wfd)==FALSE) break; } sprintf(filename,"%s\\Texture\\Lightmap\\*.*",strPath); hFind = FindFirstFile(filename, &wfd); while(1) { strFilePathname.Format("%s%s",filename,wfd.cFileName); FileList.Add(strFilePathname); if(FindNextFile(hFind, &wfd)==FALSE) break; } sprintf(filename,"%s\\Texture\\Object\\*.*",strPath); hFind = FindFirstFile(filename, &wfd); while(1) { strFilePathname.Format("%s%s",filename,wfd.cFileName); FileList.Add(strFilePathname); if(FindNextFile(hFind, &wfd)==FALSE) break; } for(int i=0;i