Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS

Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
This commit is contained in:
Cyd
2026-06-24 21:28:16 -05:00
commit 2b8ca921cb
66341 changed files with 7923174 additions and 0 deletions
@@ -0,0 +1,125 @@
// DepDlg.cpp : implementation file
//
#include "stdafx.h"
#include "ResourceBrowser.h"
#include "DepDlg.h"
#include <MW4\MW4.hpp>
using namespace MechWarrior4;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDepDlg dialog
CDepDlg::CDepDlg(const char *resname,CWnd* pParent /*=NULL*/)
: CDialog(CDepDlg::IDD, pParent)
{
ResName=resname;
//{{AFX_DATA_INIT(CDepDlg)
//}}AFX_DATA_INIT
}
void CDepDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDepDlg)
DDX_Control(pDX, IDC_DEPTREE, m_DepTree);
DDX_Control(pDX, IDC_CALLTREE, m_CallTree);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDepDlg, CDialog)
//{{AFX_MSG_MAP(CDepDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDepDlg message handlers
BOOL CDepDlg::OnInitDialog()
{
CDialog::OnInitDialog();
FillDeps(ResName);
FillCallers(ResName);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDepDlg::FillDeps(const char *resname,HTREEITEM par)
{
HTREEITEM itm=m_DepTree.InsertItem(resname,par);
short rfilenum;
for(rfilenum=0;rfilenum<FreeId;rfilenum++)
{
ResourceFile *rfile=ResourceManager::Instance->GetResourceFile(rfilenum);
Resource res(resname,rfile);
if(res.DoesResourceExist())
{
FileDependencies deps;
res.GetFileDependencies(&deps);
deps.m_fileNameStream.Rewind();
deps.m_fileNameStream.AdvancePointer(strlen((char *)deps.m_fileNameStream.GetPointer())+1);
while(deps.m_fileNameStream.GetBytesRemaining())
{
const char *ptr=(const char *)deps.m_fileNameStream.GetPointer();
FillDeps(ptr,itm);
deps.m_fileNameStream.AdvancePointer(strlen(ptr)+1);
}
}
}
}
void CDepDlg::FillCallers(const char *resname,HTREEITEM par)
{
HTREEITEM itm=m_CallTree.InsertItem(resname,par);
Resource res(resname);
if(res.DoesResourceExist())
{
Resource curres;
curres.First(NULL);
while(curres.ReadAndNext())
{
if(curres.GetResourceID().GetFileID()==TexturesResourceFileID ||
curres.GetResourceID().GetFileID()==CoreResourceFileID ||
curres.GetResourceID().GetFileID()==PropsResourceFileID
)
{
FileDependencies deps;
curres.GetFileDependencies(&deps);
deps.m_fileNameStream.Rewind();
if(deps.m_fileNameStream.GetBytesRemaining())
{
char *cresname=(char *)deps.m_fileNameStream.GetPointer();
deps.m_fileNameStream.AdvancePointer(strlen(cresname)+1);
while(deps.m_fileNameStream.GetBytesRemaining())
{
const char *ptr=(const char *)deps.m_fileNameStream.GetPointer();
if(!strcmpi(ptr,resname))
FillCallers(cresname,itm);
deps.m_fileNameStream.AdvancePointer(strlen(ptr)+1);
}
}
}
}
}
}
@@ -0,0 +1,56 @@
#if !defined(AFX_DEPDLG_H__2393D30C_03E0_4D62_B957_393A1EC1C9F8__INCLUDED_)
#define AFX_DEPDLG_H__2393D30C_03E0_4D62_B957_393A1EC1C9F8__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DepDlg.h : header file
//
#include <Adept\Adept.hpp>
#include <Stuff\Stuff.hpp>
using namespace Stuff;
using namespace Adept;
/////////////////////////////////////////////////////////////////////////////
// CDepDlg dialog
class CDepDlg : public CDialog
{
// Construction
public:
CDepDlg(const char *resname,CWnd* pParent = NULL); // standard constructor
CString ResName;
void FillDeps(const char *resname,HTREEITEM itm=TVI_ROOT );
void FillCallers(const char *resname,HTREEITEM itm=TVI_ROOT );
// Dialog Data
//{{AFX_DATA(CDepDlg)
enum { IDD = IDD_DEPDLG };
CTreeCtrl m_DepTree;
CTreeCtrl m_CallTree;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDepDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDepDlg)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DEPDLG_H__2393D30C_03E0_4D62_B957_393A1EC1C9F8__INCLUDED_)
@@ -0,0 +1,101 @@
// FileNode.cpp: implementation of the FileNode class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ResourceBrowser.h"
#include "FileNode.h"
#include <Adept\Adept.hpp>
#include <Stuff\Stuff.hpp>
using namespace Stuff;
using namespace Adept;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
FileNode::FileNode(const char *fname)
{
FileName=fname;
Parent=NULL;
Children.SetLength(8);
ChildTot=0;
IsSorted=true;
}
void FileNode::AddChild(FileNode *new_child)
{
if(new_child->GetParent()) new_child->GetParent()->RemoveChild(new_child);
new_child->Parent=this;
if(Children.GetLength()<=ChildTot) Children.SetLength(Children.GetLength()+Children.GetLength()/2);
Children[ChildTot++]=new_child;
IsSorted=false;
}
void FileNode::RemoveChild(int loc)
{
Verify(loc>=0 && loc<ChildTot);
Children[loc]->Parent=NULL;
int i;
for(i=loc;i<(ChildTot-1);i++) Children[i]=Children[i+1];
}
int FileNode::FindChild(FileNode *child)
{
Verify(child->GetParent()==this);
int i;
for(i=0;i<ChildTot;i++) if(Children[i]==child) return i;
return -1;
}
void FileNode::OrganizeTree()
{
int i;
for(i=0;i<ChildTot;i++)
if(Children[i]) Children[i]->OrganizeTree(this);
}
void FileNode::OrganizeTree(FileNode *root_node)
{
Resource res(FileName);
if(res.DoesResourceExist())
{
Stuff::FileDependencies deps;
res.GetFileDependencies(&deps);
deps.m_fileNameStream.Rewind();
while(deps.m_fileNameStream.GetBytesRemaining())
{
char *ptr=(char *)deps.m_fileNameStream.GetPointer();
deps.m_fileNameStream.AdvancePointer(strlen(ptr)+1);
Resource childres(ptr);
if(childres.DoesResourceExist())
{
//Remove From MasterList
//Add To This
STOP(("Unimplemented"));
}
else
{
AddChild(new FileNode(ptr));
}
}
}
}
FileNode::~FileNode()
{
}
@@ -0,0 +1,40 @@
// FileNode.h: interface for the FileNode class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_FILENODE_H__E0A7188F_D467_4033_AF12_9402FF6B791E__INCLUDED_)
#define AFX_FILENODE_H__E0A7188F_D467_4033_AF12_9402FF6B791E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <Stuff\Stuff.hpp>
using namespace Stuff;
class FileNode
{
protected:
FileNode *Parent;
DynamicArrayOf<FileNode *> Children;
void RemoveChild(int loc);
void OrganizeTree(FileNode *root_node);
int ChildTot;
bool IsSorted;
const char *FileName;
public:
const char *GetName() {return FileName;}
FileNode *GetParent() {return Parent;}
void AddChild(FileNode *new_child);
void RemoveChild(FileNode *child) { RemoveChild(FindChild(child));}
void OrganizeTree();
int FindChild(FileNode *child);
FileNode(const char *fname);
virtual ~FileNode();
};
#endif // !defined(AFX_FILENODE_H__E0A7188F_D467_4033_AF12_9402FF6B791E__INCLUDED_)
@@ -0,0 +1,118 @@
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "ResourceBrowser.h"
#include "ResourceBrowserView.h"
#include "ResTreeView.h"
#include "MainFrm.h"
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if (!m_wndSplitter.CreateStatic(this,1,2))
{
TRACE0("Failed to create split bar ");
return FALSE; // failed to create
}
if(!m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CResTreeView),CSize(200,10),pContext))
{
TRACE0("Failed to create CResTreeView ");
return FALSE; // failed to create
}
if(!m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CResourceBrowserView),CSize(200,10),pContext))
{
TRACE0("Failed to create CResourceBrowserView ");
return FALSE; // failed to create
}
return TRUE;
}
@@ -0,0 +1,58 @@
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__BED507DF_506D_4D39_B459_1E436507817B__INCLUDED_)
#define AFX_MAINFRM_H__BED507DF_506D_4D39_B459_1E436507817B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
// Generated message map functions
protected:
CSplitterWnd m_wndSplitter;
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__BED507DF_506D_4D39_B459_1E436507817B__INCLUDED_)
@@ -0,0 +1,80 @@
// ReportDlg.cpp : implementation file
//
#include "stdafx.h"
#include "resourcebrowser.h"
#include "ReportDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CReportDlg dialog
CReportDlg::CReportDlg(CWnd* pParent /*=NULL*/)
: CDialog(CReportDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CReportDlg)
m_DPath = _T("UnResourced.report");
m_TList = 0;
//}}AFX_DATA_INIT
}
void CReportDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CReportDlg)
DDX_Text(pDX, IDC_DPATH, m_DPath);
DDX_CBIndex(pDX, IDC_TYPELIST, m_TList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CReportDlg, CDialog)
//{{AFX_MSG_MAP(CReportDlg)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
ON_CBN_SELCHANGE(IDC_TYPELIST, OnSelchangeTypelist)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CReportDlg message handlers
BOOL CReportDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CReportDlg::OnBrowse()
{
// TODO: Add your control notification handler code here
CFileDialog dlg1(FALSE,"Resource Reports",m_DPath,OFN_NOCHANGEDIR,"Reports (*.report)|*.report||",this);
if(dlg1.DoModal()==IDOK)
{
m_DPath=dlg1.GetPathName();
UpdateData(FALSE);
}
}
void CReportDlg::OnSelchangeTypelist()
{
UpdateData(TRUE);
switch(m_TList)
{
case 0: m_DPath="UnResourced.report"; break;
case 1: m_DPath="MultipleResourced.report"; break;
}
UpdateData(FALSE);
}
@@ -0,0 +1,49 @@
#if !defined(AFX_REPORTDLG_H__64CCBDEE_B119_472E_B105_80A3E0C73C87__INCLUDED_)
#define AFX_REPORTDLG_H__64CCBDEE_B119_472E_B105_80A3E0C73C87__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ReportDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CReportDlg dialog
class CReportDlg : public CDialog
{
// Construction
public:
CReportDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CReportDlg)
enum { IDD = IDD_REPORTDLG };
CString m_DPath;
int m_TList;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CReportDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CReportDlg)
virtual BOOL OnInitDialog();
afx_msg void OnBrowse();
afx_msg void OnSelchangeTypelist();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_REPORTDLG_H__64CCBDEE_B119_472E_B105_80A3E0C73C87__INCLUDED_)
@@ -0,0 +1,268 @@
// ResTreeView.cpp : implementation file
//
#include "stdafx.h"
#include "ResourceBrowser.h"
#include "ResourceBrowserDoc.h"
#include "ResTreeView.h"
#include "ReportDlg.h"
#include <Adept\Adept.hpp>
#include <Stuff\Stuff.hpp>
#include <MW4\MW4.hpp>
using namespace Stuff;
using namespace Adept;
using namespace MechWarrior4;
/////////////////////////////////////////////////////////////////////////////
// CResTreeView
IMPLEMENT_DYNCREATE(CResTreeView, CTreeView)
CResTreeView::CResTreeView()
{
m_dwDefaultStyle |= TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;
}
CResTreeView::~CResTreeView()
{
}
BEGIN_MESSAGE_MAP(CResTreeView, CTreeView)
//{{AFX_MSG_MAP(CResTreeView)
ON_NOTIFY_REFLECT(TVN_SELCHANGED, OnSelchanged)
ON_COMMAND(ID_TOOLS_UNRESOURCEIFIEDREPORT, OnToolsUnresourceifiedreport)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResTreeView drawing
void CResTreeView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CResTreeView diagnostics
#ifdef _DEBUG
void CResTreeView::AssertValid() const
{
CTreeView::AssertValid();
}
void CResTreeView::Dump(CDumpContext& dc) const
{
CTreeView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CResTreeView message handlers
BOOL CResTreeView::OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult)
{
// TODO: Add your specialized code here and/or call the base class
return CTreeView::OnChildNotify(message, wParam, lParam, pLResult);
}
void CResTreeView::OnInitialUpdate()
{
CTreeView::OnInitialUpdate();
char path[MAX_PATH];
GetCurrentDirectory(MAX_PATH,path);
AddDirectory(CString(path),CString("Content"));
}
void CResTreeView::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
CResourceBrowserDoc *doc=(CResourceBrowserDoc *)GetDocument();
doc->m_CurPath="";
BuildPath(doc->m_CurPath,pNMTreeView->itemNew.hItem);
doc->UpdateAllViews(this);
*pResult = 0;
}
void CResTreeView::AddDirectory(CString &basepath,CString &dir,HTREEITEM par)
{
HTREEITEM itm;
itm=GetTreeCtrl().InsertItem(dir,par);
WIN32_FIND_DATA file_data;
HANDLE file_find;
file_find=FindFirstFile(basepath+"\\"+dir+"\\*.*",&file_data);
if(file_find != INVALID_HANDLE_VALUE)
{
CString dir_name;
do
{
dir_name=file_data.cFileName;
if(file_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY &&
dir_name!="." && dir_name!=".." )
{
AddDirectory(basepath+"\\"+dir,dir_name,itm);
}
}
while (FindNextFile(file_find,&file_data));
}
}
void CResTreeView::BuildPath(CString &str, HTREEITEM itm)
{
if(itm!=NULL)
{
str=GetTreeCtrl().GetItemText(itm)+"\\"+str;
BuildPath(str,GetTreeCtrl().GetParentItem(itm));
}
}
void CResTreeView::UnResReportOnDir(NotationFile *note_file,CString dir)
{
Page *page=NULL;
WIN32_FIND_DATA file_data;
HANDLE file_find;
file_find=FindFirstFile(dir+"*.*",&file_data);
CString file_name;
if(file_find != INVALID_HANDLE_VALUE)
{
do
{
file_name=file_data.cFileName;
int count = 0;
if(!(file_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) &&
file_name.CompareNoCase("vssver.scc") &&
!InResources(dir+file_name))
{
if(!page) page=note_file->AddPage(dir);
page->SetEntry(dir+file_name,"no");
}
}
while (FindNextFile(file_find,&file_data));
}
file_find=FindFirstFile(dir+"*.*",&file_data);
if(file_find != INVALID_HANDLE_VALUE)
{
do
{
file_name=file_data.cFileName;
int count = 0;
if(file_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY && file_name!="." && file_name!="..")
{
UnResReportOnDir(note_file,dir+file_name+"\\");
}
}
while (FindNextFile(file_find,&file_data));
}
}
void CResTreeView::OnToolsUnresourceifiedreport()
{
CReportDlg rdlg;
if(rdlg.DoModal()==IDOK)
{
NotationFile report;
report.DeleteAllPages();
switch(rdlg.m_TList)
{
case 0: UnResReportOnDir(&report,"Content\\"); break;
case 1: MultiResReport(&report); break;
}
report.SaveAs(rdlg.m_DPath);
MessageBox("Report Complete","All Done",MB_OK);
}
}
void CResTreeView::MultiResReport(Stuff::NotationFile *note_file)
{
if(Adept::ResourceManager::Instance==NULL) return;
Adept::Resource curres;
curres.First(NULL);
Page *statpage=note_file->SetPage("FINAL STATS");
CString res_name,base_name,dir_name;
int totaldups=0;
int totaldupsize=0;
int totaldupcomsize=0;
while(curres.ReadAndNext())
{
const char *resname=curres.GetName();
short rfilenum;
CString FirstDep;
int count=0;
CString filename;
for(rfilenum=0;rfilenum<FreeId;rfilenum++)
{
ResourceFile *rfile=ResourceManager::Instance->GetResourceFile(rfilenum);
Resource res(resname,rfile);
if(res.DoesResourceExist())
{
filename=ResFileNames[rfilenum];
count++;
if(count==1)
{
if(res.GetResourceID()!=curres.GetResourceID()) break;
FirstDep=filename;
}
else if(count==2)
{
totaldups++;
Page *page=note_file->SetPage(resname);
page->SetEntry(FirstDep,(int)res.GetSize());
}
if(count>1)
{
totaldupsize+=res.GetSize();
totaldupcomsize+=res.GetCompressedSize();
Page *page=note_file->SetPage(resname);
page->SetEntry(filename,(int)res.GetSize());
}
}
}
}
statpage->SetEntry("Duplicate files",totaldups);
statpage->SetEntry("Duplicate bytes(uncompressed)",totaldupsize);
statpage->SetEntry("Duplicate bytes(On Disk)",totaldupcomsize);
statpage->SetEntry("Compression Ratio",(Scalar)totaldupsize/totaldupcomsize);
}
bool CResTreeView::InResources(CString &str)
{
Adept::Resource res(str);
return res.DoesResourceExist();
}
@@ -0,0 +1,62 @@
#if !defined(AFX_RESTREEVIEW_H__8C224D5C_8AE2_4006_B9D9_17C4A16328C9__INCLUDED_)
#define AFX_RESTREEVIEW_H__8C224D5C_8AE2_4006_B9D9_17C4A16328C9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ResTreeView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CResTreeView view
class CResTreeView : public CTreeView
{
protected:
CResTreeView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CResTreeView)
// Attributes
public:
// Operations
public:
void BuildPath(CString &str,HTREEITEM itm);
void AddDirectory(CString &basepath,CString &dir,HTREEITEM par=TVI_ROOT);
void UnResReportOnDir(Stuff::NotationFile *note_file,CString dir);
void MultiResReport(Stuff::NotationFile *note_file);
bool InResources(CString &str);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CResTreeView)
public:
virtual BOOL OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult);
virtual void OnInitialUpdate();
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CResTreeView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CResTreeView)
afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnToolsUnresourceifiedreport();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RESTREEVIEW_H__8C224D5C_8AE2_4006_B9D9_17C4A16328C9__INCLUDED_)
@@ -0,0 +1,271 @@
// ResourceBrowser.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "ResourceBrowser.h"
#include "MainFrm.h"
#include "ResourceBrowserDoc.h"
#include "ResourceBrowserView.h"
#include <Stuff\Stuff.hpp>
#include <DLLPlatform\DLLPlatform.hpp>
#include <Adept\Adept.hpp>
#include <Compost\Compost.hpp>
#include <gosfx\gosfx.hpp>
#include <elementrenderer\elementrenderer.hpp>
#include <GameOS\ToolOS.hpp>
#include <Adept\Resource.hpp>
#include <buildnum\buildnum.h>
#include <MW4\MW4.hpp>
HGOSHEAP Heap;
BOOL CTCL_IsConsole()
{
return FALSE;
}
using namespace Adept;
using namespace MechWarrior4;
void __stdcall InitializeGameEngine()
{
Stuff::InitializeClasses();
MidLevelRenderer::InitializeClasses(NULL, 2048*8);
Compost::InitializeClasses();
gosFX::InitializeClasses();
ElementRenderer::InitializeClasses();
Adept::InitializeClasses();
Adept::ResourceManager::Instance = new Adept::ResourceManager;
Check_Object(Adept::ResourceManager::Instance);
ResourceManager::Instance->OpenResourceFile(
"Resource\\textures.mw4",
"Resource\\textures.dep",
TexturesResourceFileID,
VER_CONTENTVERSION,
true,
false
);
ResourceManager::Instance->OpenResourceFile(
"Resource\\core.mw4",
"Resource\\core.dep",
CoreResourceFileID,
VER_CONTENTVERSION,
true,
false
);
ResourceManager::Instance->OpenResourceFile(
"Resource\\props.mw4",
"Resource\\props.dep",
PropsResourceFileID,
VER_CONTENTVERSION,
true,
false
);
ResFileNames[TexturesResourceFileID]="Resource\\textures.mw4";
ResFileNames[CoreResourceFileID]="Resource\\core.mw4";
ResFileNames[PropsResourceFileID]="Resource\\props.mw4";
::Heap = gos_CreateMemoryHeap("Default");
Check_Pointer(::Heap);
gos_PushCurrentHeap(::Heap);
}
int FreeId=FirstNonCoreResourceFileID;
CString ResFileNames[1024];
void CResourceBrowserApp::OpenFilesInPath(CString &str)
{
WIN32_FIND_DATA file_data;
HANDLE file_find;
file_find=FindFirstFile(str+"\\*.mw4",&file_data);
CString base_file_name;
if(file_find != INVALID_HANDLE_VALUE)
{
do
{
base_file_name=str+"\\"+file_data.cFileName;
base_file_name=base_file_name.Left(base_file_name.ReverseFind('.'));
ResFileNames[FreeId]=base_file_name+".mw4";
ResourceManager::Instance->OpenResourceFile(
base_file_name+".mw4",
base_file_name+".dep",
FreeId++,
VER_CONTENTVERSION,
false,
false
);
}
while (FindNextFile(file_find,&file_data));
}
}
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserApp
BEGIN_MESSAGE_MAP(CResourceBrowserApp, CWinApp)
//{{AFX_MSG_MAP(CResourceBrowserApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserApp construction
CResourceBrowserApp::CResourceBrowserApp()
{
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CResourceBrowserApp object
CResourceBrowserApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserApp initialization
BOOL CResourceBrowserApp::InitInstance()
{
InitGameOS(NULL, NULL, "");
InitializeGameEngine();
AfxEnableControlContainer();
// Standard initialization
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register document templates
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CResourceBrowserDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CResourceBrowserView));
AddDocTemplate(pDocTemplate);
OpenFilesInPath(CString("Resource\\Missions"));
OpenFilesInPath(CString("Resource\\Maps"));
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CResourceBrowserApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserApp message handlers
void __stdcall TerminateGameEngine()
{
Stuff::TerminateClasses();
}
void __stdcall GetGameOSEnvironment(char* CommandLine)
{
// Environment.UpdateRenderers = UpdateDisplay;
// Environment.DoGameLogic = DoGameLogic;
Environment.InitializeGameEngine = InitializeGameEngine;
Environment.TerminateGameEngine = TerminateGameEngine;
}
int CResourceBrowserApp::ExitInstance()
{
Adept::ResourceManager::Instance->CloseAllButCore();
delete Adept::ResourceManager::Instance;
Adept::ResourceManager::Instance=NULL;
ExitGameOS();
return CWinApp::ExitInstance();
}
@@ -0,0 +1,225 @@
# Microsoft Developer Studio Project File - Name="ResourceBrowser" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=ResourceBrowser - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "ResourceBrowser.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "ResourceBrowser.mak" CFG="ResourceBrowser - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ResourceBrowser - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "ResourceBrowser - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE "ResourceBrowser - Win32 Profile" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "ResourceBrowser - Win32 Release"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../rel.bin"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /G6 /Zp4 /MD /W3 /GX /O2 /I "..\..\Code" /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "USE_PROTOTYPES" /D "STRICT" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "ResourceBrowser - Win32 Debug"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../dbg.bin"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /G6 /Zp4 /MDd /W3 /Gm /GR /GX /ZI /Od /I "..\..\Code" /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "LAB_ONLY" /D "USE_PROTOTYPES" /D "STRICT" /D "_ARMOR" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "WIN32" /D "_DEBUG" /Yu"stdafx.h" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ELSEIF "$(CFG)" == "ResourceBrowser - Win32 Profile"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Profile"
# PROP BASE Intermediate_Dir "Profile"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../pro.bin"
# PROP Intermediate_Dir "Profile"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /Zp4 /MD /W3 /GX /O2 /I "..\..\Code" /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /G6 /Zp4 /MD /W3 /GX /Zi /O2 /I "..\..\Code" /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "LAB_ONLY" /D "USE_PROTOTYPES" /D "STRICT" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 /nologo /subsystem:windows /machine:I386
!ENDIF
# Begin Target
# Name "ResourceBrowser - Win32 Release"
# Name "ResourceBrowser - Win32 Debug"
# Name "ResourceBrowser - Win32 Profile"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\DepDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\FileNode.cpp
# End Source File
# Begin Source File
SOURCE=.\MainFrm.cpp
# End Source File
# Begin Source File
SOURCE=.\ReportDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\ResourceBrowser.cpp
# End Source File
# Begin Source File
SOURCE=.\ResourceBrowser.rc
# End Source File
# Begin Source File
SOURCE=.\ResourceBrowserDoc.cpp
# End Source File
# Begin Source File
SOURCE=.\ResourceBrowserView.cpp
# End Source File
# Begin Source File
SOURCE=.\ResTreeView.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\DepDlg.h
# End Source File
# Begin Source File
SOURCE=.\FileNode.h
# End Source File
# Begin Source File
SOURCE=.\MainFrm.h
# End Source File
# Begin Source File
SOURCE=.\ReportDlg.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\ResourceBrowser.h
# End Source File
# Begin Source File
SOURCE=.\ResourceBrowserDoc.h
# End Source File
# Begin Source File
SOURCE=.\ResourceBrowserView.h
# End Source File
# Begin Source File
SOURCE=.\ResTreeView.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\res\ResourceBrowser.ico
# End Source File
# Begin Source File
SOURCE=.\res\ResourceBrowser.rc2
# End Source File
# Begin Source File
SOURCE=.\res\ResourceBrowserDoc.ico
# End Source File
# Begin Source File
SOURCE=.\res\Toolbar.bmp
# End Source File
# End Group
# End Target
# End Project
@@ -0,0 +1,50 @@
// ResourceBrowser.h : main header file for the RESOURCEBROWSER application
//
#if !defined(AFX_RESOURCEBROWSER_H__454EE3F2_D8A5_4AD7_A648_A5C28A931969__INCLUDED_)
#define AFX_RESOURCEBROWSER_H__454EE3F2_D8A5_4AD7_A648_A5C28A931969__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
extern int FreeId;
extern CString ResFileNames[];
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserApp:
// See ResourceBrowser.cpp for the implementation of this class
//
class CResourceBrowserApp : public CWinApp
{
public:
CResourceBrowserApp();
void OpenFilesInPath(CString &str);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CResourceBrowserApp)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CResourceBrowserApp)
afx_msg void OnAppAbout();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RESOURCEBROWSER_H__454EE3F2_D8A5_4AD7_A648_A5C28A931969__INCLUDED_)
@@ -0,0 +1,462 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\ResourceBrowser.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#include ""afxprint.rc"" // printing/print preview resources\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\\ResourceBrowser.ico"
IDR_RESOURTYPE ICON DISCARDABLE "res\\ResourceBrowserDoc.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//
IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 15
BEGIN
BUTTON ID_FILE_NEW
BUTTON ID_FILE_OPEN
BUTTON ID_FILE_SAVE
SEPARATOR
BUTTON ID_EDIT_CUT
BUTTON ID_EDIT_COPY
BUTTON ID_EDIT_PASTE
SEPARATOR
BUTTON ID_FILE_PRINT
SEPARATOR
BUTTON ID_APP_ABOUT
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE
MENUITEM "Save &As...", ID_FILE_SAVE_AS
MENUITEM SEPARATOR
MENUITEM "&Print...\tCtrl+P", ID_FILE_PRINT
MENUITEM "Print Pre&view", ID_FILE_PRINT_PREVIEW
MENUITEM "P&rint Setup...", ID_FILE_PRINT_SETUP
MENUITEM SEPARATOR
MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_APP_EXIT
END
POPUP "&Edit"
BEGIN
MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO
MENUITEM SEPARATOR
MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT
MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
END
POPUP "Tools"
BEGIN
MENUITEM "Generate Report", ID_TOOLS_UNRESOURCEIFIEDREPORT
END
POPUP "&Help"
BEGIN
MENUITEM "&About ResourceBrowser...", ID_APP_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
BEGIN
"N", ID_FILE_NEW, VIRTKEY, CONTROL
"O", ID_FILE_OPEN, VIRTKEY, CONTROL
"S", ID_FILE_SAVE, VIRTKEY, CONTROL
"P", ID_FILE_PRINT, VIRTKEY, CONTROL
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT
VK_F6, ID_NEXT_PANE, VIRTKEY
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About ResourceBrowser"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "ResourceBrowser Version 1.0",IDC_STATIC,40,10,119,8,
SS_NOPREFIX
LTEXT "Copyright (C) 2000",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
END
IDD_DEPDLG DIALOG DISCARDABLE 0, 0, 352, 249
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dependancies"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,7,228,50,14
PUSHBUTTON "Cancel",IDCANCEL,295,228,50,14
CONTROL "Tree1",IDC_DEPTREE,"SysTreeView32",TVS_HASBUTTONS |
TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP,
7,16,338,98
CONTROL "Tree2",IDC_CALLTREE,"SysTreeView32",TVS_HASBUTTONS |
TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP,
7,127,338,94
LTEXT "Dependancies:",IDC_STATIC,7,7,49,8
LTEXT "Callers:",IDC_STATIC,7,116,24,8
END
IDD_REPORTDLG DIALOG DISCARDABLE 0, 0, 263, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Report Options"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,7,61,50,14
PUSHBUTTON "Cancel",IDCANCEL,206,61,50,14
LTEXT "DestPath:",IDC_STATIC,7,42,32,8
EDITTEXT IDC_DPATH,41,40,158,14,ES_AUTOHSCROLL
PUSHBUTTON "Browse",IDC_BROWSE,203,39,50,14
COMBOBOX IDC_TYPELIST,17,17,194,62,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "ResourceBrowser MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "ResourceBrowser\0"
VALUE "LegalCopyright", "Copyright (C) 2000\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "ResourceBrowser.EXE\0"
VALUE "ProductName", "ResourceBrowser Application\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 228
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
IDD_DEPDLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 345
TOPMARGIN, 7
BOTTOMMARGIN, 242
END
IDD_REPORTDLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 256
TOPMARGIN, 7
BOTTOMMARGIN, 75
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Dialog Info
//
IDD_REPORTDLG DLGINIT
BEGIN
IDC_TYPELIST, 0x403, 18, 0
0x6e55, 0x6572, 0x6f73, 0x7275, 0x6563, 0x2064, 0x6946, 0x656c, 0x0073,
IDC_TYPELIST, 0x403, 26, 0
0x754d, 0x746c, 0x7069, 0x656c, 0x5220, 0x6665, 0x7265, 0x6e65, 0x6563,
0x2064, 0x6946, 0x656c, 0x0073,
0
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
IDR_MAINFRAME "ResourceBrowser\n\nResour\n\n\nResourceBrowser.Document\nResour Document"
END
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
AFX_IDS_APP_TITLE "ResourceBrowser"
AFX_IDS_IDLEMESSAGE "Ready"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_INDICATOR_EXT "EXT"
ID_INDICATOR_CAPS "CAP"
ID_INDICATOR_NUM "NUM"
ID_INDICATOR_SCRL "SCRL"
ID_INDICATOR_OVR "OVR"
ID_INDICATOR_REC "REC"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_NEW "Create a new document\nNew"
ID_FILE_OPEN "Open an existing document\nOpen"
ID_FILE_CLOSE "Close the active document\nClose"
ID_FILE_SAVE "Save the active document\nSave"
ID_FILE_SAVE_AS "Save the active document with a new name\nSave As"
ID_FILE_PAGE_SETUP "Change the printing options\nPage Setup"
ID_FILE_PRINT_SETUP "Change the printer and printing options\nPrint Setup"
ID_FILE_PRINT "Print the active document\nPrint"
ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_MRU_FILE1 "Open this document"
ID_FILE_MRU_FILE2 "Open this document"
ID_FILE_MRU_FILE3 "Open this document"
ID_FILE_MRU_FILE4 "Open this document"
ID_FILE_MRU_FILE5 "Open this document"
ID_FILE_MRU_FILE6 "Open this document"
ID_FILE_MRU_FILE7 "Open this document"
ID_FILE_MRU_FILE8 "Open this document"
ID_FILE_MRU_FILE9 "Open this document"
ID_FILE_MRU_FILE10 "Open this document"
ID_FILE_MRU_FILE11 "Open this document"
ID_FILE_MRU_FILE12 "Open this document"
ID_FILE_MRU_FILE13 "Open this document"
ID_FILE_MRU_FILE14 "Open this document"
ID_FILE_MRU_FILE15 "Open this document"
ID_FILE_MRU_FILE16 "Open this document"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_EDIT_CLEAR "Erase the selection\nErase"
ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy"
ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
ID_EDIT_FIND "Find the specified text\nFind"
ID_EDIT_PASTE "Insert Clipboard contents\nPaste"
ID_EDIT_REPEAT "Repeat the last action\nRepeat"
ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
ID_EDIT_UNDO "Undo the last action\nUndo"
ID_EDIT_REDO "Redo the previously undone action\nRedo"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar"
ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCSIZE "Change the window size"
AFX_IDS_SCMOVE "Change the window position"
AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCRESTORE "Restore the window to normal size"
AFX_IDS_SCTASKLIST "Activate Task List"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_PREVIEW_CLOSE "Close print preview mode\nCancel Preview"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\ResourceBrowser.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#include "afxprint.rc" // printing/print preview resources
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
@@ -0,0 +1,75 @@
// ResourceBrowserDoc.cpp : implementation of the CResourceBrowserDoc class
//
#include "stdafx.h"
#include "ResourceBrowser.h"
#include "ResourceBrowserDoc.h"
#include <Adept\Adept.hpp>
#include <Stuff\Stuff.hpp>
using namespace Stuff;
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserDoc
IMPLEMENT_DYNCREATE(CResourceBrowserDoc, CDocument)
BEGIN_MESSAGE_MAP(CResourceBrowserDoc, CDocument)
//{{AFX_MSG_MAP(CResourceBrowserDoc)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserDoc construction/destruction
CResourceBrowserDoc::CResourceBrowserDoc()
{
}
CResourceBrowserDoc::~CResourceBrowserDoc()
{
}
BOOL CResourceBrowserDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserDoc serialization
void CResourceBrowserDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
}
else
{
}
}
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserDoc diagnostics
#ifdef _DEBUG
void CResourceBrowserDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CResourceBrowserDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserDoc commands
@@ -0,0 +1,56 @@
// ResourceBrowserDoc.h : interface of the CResourceBrowserDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_RESOURCEBROWSERDOC_H__E06FEA8B_73FA_4ECA_B4CF_81D3E868952F__INCLUDED_)
#define AFX_RESOURCEBROWSERDOC_H__E06FEA8B_73FA_4ECA_B4CF_81D3E868952F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include"FileNode.h"
class CResourceBrowserDoc : public CDocument
{
protected: // create from serialization only
CResourceBrowserDoc();
DECLARE_DYNCREATE(CResourceBrowserDoc)
// Attributes
public:
CString m_CurPath;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CResourceBrowserDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CResourceBrowserDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CResourceBrowserDoc)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RESOURCEBROWSERDOC_H__E06FEA8B_73FA_4ECA_B4CF_81D3E868952F__INCLUDED_)
@@ -0,0 +1,371 @@
// ResourceBrowserView.cpp : implementation of the CResourceBrowserView class
//
#include "stdafx.h"
#include "ResourceBrowser.h"
#include "ResourceBrowserDoc.h"
#include "ResourceBrowserView.h"
#include "DepDlg.h"
#include <Adept\Adept.hpp>
#include <Stuff\Stuff.hpp>
using namespace Stuff;
#define NAME_COLUMN 0
#define BUILD_COLUMN 1
#define RESID_COLUMN 2
#define SIZE_COLUMN 3
int ColumnArray[4];
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserView
IMPLEMENT_DYNCREATE(CResourceBrowserView, CListView)
BEGIN_MESSAGE_MAP(CResourceBrowserView, CListView)
//{{AFX_MSG_MAP(CResourceBrowserView)
ON_WM_CREATE()
ON_WM_SIZE()
ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnclick)
ON_NOTIFY_REFLECT(NM_DBLCLK, OnDblclk)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CListView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CListView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CListView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserView construction/destruction
CResourceBrowserView::CResourceBrowserView()
{
m_dwDefaultStyle |= ( LVS_REPORT|LVS_SHOWSELALWAYS);//|LVS_SHAREIMAGELISTS );
}
CResourceBrowserView::~CResourceBrowserView()
{
}
BOOL CResourceBrowserView::PreCreateWindow(CREATESTRUCT& cs)
{
return CListView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserView drawing
void CResourceBrowserView::OnDraw(CDC* pDC)
{
CResourceBrowserDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
}
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserView printing
BOOL CResourceBrowserView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CResourceBrowserView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
}
void CResourceBrowserView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
}
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserView diagnostics
#ifdef _DEBUG
void CResourceBrowserView::AssertValid() const
{
CListView::AssertValid();
}
void CResourceBrowserView::Dump(CDumpContext& dc) const
{
CListView::Dump(dc);
}
CResourceBrowserDoc* CResourceBrowserView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CResourceBrowserDoc)));
return (CResourceBrowserDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CResourceBrowserView message handlers
void CResourceBrowserView::OnInitialUpdate()
{
CListView::OnInitialUpdate();
int col=0;
ColumnArray[NAME_COLUMN] =GetListCtrl().InsertColumn( col++, "FileName", LVCFMT_LEFT, 200);
ColumnArray[BUILD_COLUMN] =GetListCtrl().InsertColumn( col++, "InBuild", LVCFMT_LEFT, 100);
ColumnArray[RESID_COLUMN] =GetListCtrl().InsertColumn( col++, "ResourceID", LVCFMT_LEFT, 100);
ColumnArray[SIZE_COLUMN] =GetListCtrl().InsertColumn( col++, "Size", LVCFMT_LEFT, 100);
}
int CResourceBrowserView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CListView::OnCreate(lpCreateStruct) == -1)
return -1;
// GetListCtrl().Set.Create(WS_CHILD|LVS_REPORT|LVS_SHOWSELALWAYS|LVS_SHAREIMAGELISTS,CRect(0,0,200,200),this,NULL);
// GetListCtrl().ShowWindow(SW_SHOW);
return 0;
}
void CResourceBrowserView::OnSize(UINT nType, int cx, int cy)
{
CListView::OnSize(nType, cx, cy);
}
static int CALLBACK
CompName(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
// lParamSort contains a pointer to the list view control.
// The lParam of an item is just its index.
CListCtrl* pListCtrl = (CListCtrl*) lParamSort;
CString strItem1 = pListCtrl->GetItemText(lParam1, NAME_COLUMN);
CString strItem2 = pListCtrl->GetItemText(lParam2, NAME_COLUMN);
return strItem1.CompareNoCase(strItem2);
}
static int CALLBACK
CompBuild(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
// lParamSort contains a pointer to the list view control.
// The lParam of an item is just its index.
CListCtrl* pListCtrl = (CListCtrl*) lParamSort;
CString strItem1 = pListCtrl->GetItemText(lParam1, BUILD_COLUMN);
CString strItem2 = pListCtrl->GetItemText(lParam2, BUILD_COLUMN);
return strItem1.CompareNoCase(strItem2);
}
static int CALLBACK
CompResID(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
// lParamSort contains a pointer to the list view control.
// The lParam of an item is just its index.
CListCtrl* pListCtrl = (CListCtrl*) lParamSort;
CString strItem1 = pListCtrl->GetItemText(lParam1, RESID_COLUMN);
CString strItem2 = pListCtrl->GetItemText(lParam2, RESID_COLUMN);
int val1a,val2a;
int val1b,val2b;
val1a=atoi(strItem1.Left(strItem1.Find(':')));
val1b=atoi(strItem1.Mid(strItem1.Find(':')+1));
val2a=atoi(strItem2.Left(strItem1.Find(':')));
val2b=atoi(strItem2.Mid(strItem1.Find(':')+1));
if(val1a==val2a)
return val1b>val2b;
else
return val1a>val2a;
}
static int CALLBACK
CompSize(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
// lParamSort contains a pointer to the list view control.
// The lParam of an item is just its index.
CListCtrl* pListCtrl = (CListCtrl*) lParamSort;
return atoi(pListCtrl->GetItemText(lParam1, SIZE_COLUMN))>atoi(pListCtrl->GetItemText(lParam2, SIZE_COLUMN));
}
void CResourceBrowserView::OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
for(int i=0;i<GetListCtrl().GetItemCount();i++)
GetListCtrl().SetItemData(i,i);
switch(pNMListView->iSubItem)
{
case NAME_COLUMN:
GetListCtrl().SortItems(CompName, (LPARAM) &GetListCtrl());
break;
case BUILD_COLUMN:
GetListCtrl().SortItems(CompBuild, (LPARAM) &GetListCtrl());
break;
case RESID_COLUMN:
GetListCtrl().SortItems(CompResID, (LPARAM) &GetListCtrl());
break;
case SIZE_COLUMN:
GetListCtrl().SortItems(CompSize, (LPARAM) &GetListCtrl());
break;
}
*pResult = 0;
}
void CResourceBrowserView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
if(pSender!=this)
{
CResourceBrowserDoc *doc=(CResourceBrowserDoc *)GetDocument();
GetListCtrl().DeleteAllItems();
WIN32_FIND_DATA file_data;
HANDLE file_find;
file_find=FindFirstFile(doc->m_CurPath+"*.*",&file_data);
CString file_name;
if(file_find != INVALID_HANDLE_VALUE)
{
do
{
file_name=file_data.cFileName;
int count = 0;
if(!(file_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && file_name.CompareNoCase("vssver.scc") )
{
int item = GetListCtrl().InsertItem( count++,file_name );
GetListCtrl().SetItemText(item,ColumnArray[BUILD_COLUMN],GetResultString(doc->m_CurPath+file_name));
GetListCtrl().SetItemText(item,ColumnArray[RESID_COLUMN],GetResID(doc->m_CurPath+file_name));
GetListCtrl().SetItemText(item,ColumnArray[SIZE_COLUMN],GetResSize(doc->m_CurPath+file_name));
}
}
while (FindNextFile(file_find,&file_data));
}
}
}
#define EXTMAX 6
char *UnknownExts[EXTMAX]={".obb",".armature",".table",".data",".raw",".defines"};
const char *CResourceBrowserView::GetResultString(CString str)
{
if(!str.CompareNoCase("vssver.scc")) return "N\\A";
bool inres=InResources(str);
if(inres) return "Yes";
if(!str.Right(strlen(".build")).CompareNoCase(".build")) return "N\\A";
for(int i=0;i<EXTMAX;i++)
if(!str.Right(strlen(UnknownExts[i])).CompareNoCase(UnknownExts[i]))
{
return "Unknown";
}
return "No";
}
bool CResourceBrowserView::InResources(CString &str)
{
Adept::Resource res(str);
return res.DoesResourceExist();
}
CString CResourceBrowserView::GetResID(CString str)
{
Adept::Resource res(str);
if(res.DoesResourceExist())
{
CString fstr;
Adept::ResourceID res_id = res.GetResourceID();
fstr.Format("%d:%d", res_id.m_fileID, res_id.m_recordID);
return fstr;
}
else return ("N/A");
}
CString CResourceBrowserView::GetResSize(CString str)
{
Adept::Resource res(str);
if(res.DoesResourceExist())
{
CString data_size;
data_size.Format("%d", res.GetSize());
return data_size;
}
else return ("N/A");
}
bool CResourceBrowserView::ReferencedInFile(CString str2,CString str)
{
NotationFile note_file(str);
NotationFile::PageIterator *pages=note_file.MakePageIterator();
Page *page;
while(page=pages->ReadAndNext())
{
Page::NoteIterator *notes=page->MakeNoteIterator();
Note *note;
const char *ccs;
while(note=notes->ReadAndNext())
{
note->GetEntry(&ccs);
if(!str2.CompareNoCase(ccs)) return true;
}
}
return false;
}
void CResourceBrowserView::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
{
NMITEMACTIVATE *dat=(NMITEMACTIVATE *)pNMHDR;
if(dat->iItem>=0)
{
ShowDependancies(GetListCtrl().GetItemText((dat->iItem),ColumnArray[NAME_COLUMN]));
}
*pResult = 0;
}
void CResourceBrowserView::ShowDependancies(CString str)
{
CResourceBrowserDoc *doc=(CResourceBrowserDoc *)GetDocument();
CDepDlg dlg(doc->m_CurPath+str,this);
dlg.DoModal();
}
@@ -0,0 +1,80 @@
// ResourceBrowserView.h : interface of the CResourceBrowserView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_RESOURCEBROWSERVIEW_H__81511040_5E26_4A3B_889E_BD35823719B1__INCLUDED_)
#define AFX_RESOURCEBROWSERVIEW_H__81511040_5E26_4A3B_889E_BD35823719B1__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CResourceBrowserDoc;
#include <Stuff\Stuff.hpp>
using namespace Stuff;
class CResourceBrowserView : public CListView
{
protected: // create from serialization only
CResourceBrowserView();
DECLARE_DYNCREATE(CResourceBrowserView)
// Attributes
public:
CResourceBrowserDoc* GetDocument();
bool InResources(CString &str);
const char *GetResultString(CString str);
CString GetResID(CString str);
CString GetResSize(CString str);
void ShowDependancies(CString str);
bool ReferencedInFile(CString str2,CString str);
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CResourceBrowserView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnInitialUpdate();
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CResourceBrowserView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CResourceBrowserView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in ResourceBrowserView.cpp
inline CResourceBrowserDoc* CResourceBrowserView::GetDocument()
{ return (CResourceBrowserDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RESOURCEBROWSERVIEW_H__81511040_5E26_4A3B_889E_BD35823719B1__INCLUDED_)
@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// ResourceBrowser.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
@@ -0,0 +1,27 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__D75B7698_2C09_4616_8987_88C6D8815FA9__INCLUDED_)
#define AFX_STDAFX_H__D75B7698_2C09_4616_8987_88C6D8815FA9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxcview.h>
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__D75B7698_2C09_4616_8987_88C6D8815FA9__INCLUDED_)
@@ -0,0 +1,13 @@
//
// RESOURCEBROWSER.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////
Binary file not shown.
@@ -0,0 +1,27 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by ResourceBrowser.rc
//
#define IDD_ABOUTBOX 100
#define IDR_MAINFRAME 128
#define IDR_RESOURTYPE 129
#define IDD_DEPDLG 130
#define IDD_REPORTDLG 131
#define IDC_DEPTREE 1001
#define IDC_CALLTREE 1002
#define IDC_DPATH 1003
#define IDC_BROWSE 1004
#define IDC_TYPELIST 1005
#define ID_TOOLS_UNRESOURCEIFIEDREPORT 32771
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 133
#define _APS_NEXT_COMMAND_VALUE 32772
#define _APS_NEXT_CONTROL_VALUE 1006
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif