Add rayman2 source files

This commit is contained in:
2024-09-18 02:33:44 +08:00
parent bcc093f8ed
commit fb036c54fd
14339 changed files with 2596224 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
[Local]
DataRootPath = "C:\Rayman2\N64\CD5\cpa\exe\MAIN\GameData"
RootForSection = "C:\Rayman2\N64\CD5\cpa\exe\MAIN\"
[FileType]
a3b=0
a3d=0
bmp=0
wav=0
xls=0
tga=0
sif=0
sit=0
pk=0
rrr=0
csb=1
mid=0
lcb=0
lcb_=0
txt=0
aif=0
bak=0
snd=0
trn=0
sem=0
log=0
vsd=0
lnk=0
eit=0
edt=0
ert=0
sav=0
cfg=0
emo=0
psd=0
exe=0
jbf=0
bnm=0
mp2=0
act=1
acz=1
alw=1
_3m=1

View File

@@ -0,0 +1,3 @@
Just for information
\-> The module : [SCR V5.4.6 : 'Scripts Module' of Sep 12 1997] is initialized with the id #0

View File

@@ -0,0 +1,47 @@
// ChkData.h : main header file for the CHKDATA application
//
#if !defined(AFX_CHKDATA_H__51552986_281B_11D1_8F25_00609736731A__INCLUDED_)
#define AFX_CHKDATA_H__51552986_281B_11D1_8F25_00609736731A__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
/////////////////////////////////////////////////////////////////////////////
// CChkDataApp:
// See ChkData.cpp for the implementation of this class
//
class CChkDataApp : public CWinApp
{
public:
CChkDataApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChkDataApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CChkDataApp)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHKDATA_H__51552986_281B_11D1_8F25_00609736731A__INCLUDED_)

View File

@@ -0,0 +1,339 @@
//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
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 217, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About ChkData"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "ChkData Version 1.0",IDC_STATIC,40,10,119,8,SS_NOPREFIX
LTEXT "Copyright (C) 1997",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "OK",IDOK,178,7,32,14,WS_GROUP
END
IDD_CHKDATA_DIALOG DIALOGEX 0, 0, 600, 490
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Check Script Data"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "Quit",IDCANCEL,545,290,50,14
LISTBOX IDC_LIST_FILETYPE,5,150,90,155,LBS_SORT |
LBS_OWNERDRAWFIXED | LBS_HASSTRINGS |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Section type",IDC_BUTTON_PROCESS,545,155,50,14
LISTBOX IDC_LIST_FILE,5,5,590,101,LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
LTEXT "Number of files : ",IDC_STATIC_NUMBEROFFILES,455,111,
140,12,SS_SUNKEN | WS_BORDER
PUSHBUTTON "Build File list",IDC_BUTTON_BUILDFILELIST,545,135,50,14
LISTBOX IDC_LIST_SECTIONS,100,150,120,155,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL |
WS_TABSTOP
LTEXT "Section types :",IDC_STATIC_NUMBEROFSECTIONTYPES,100,
135,120,12,SS_SUNKEN | WS_BORDER
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",NOT
WS_VISIBLE | WS_BORDER,5,111,590,12
LTEXT "Entries",IDC_STATIC_NUMBEROFENTRIES,225,135,120,12,
SS_SUNKEN | WS_BORDER
LISTBOX IDC_LIST_ENTRIES,225,150,120,60,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL |
WS_TABSTOP
LTEXT "",IDC_STATIC_ENTRYSAMPLE,225,215,120,30,SS_SUNKEN |
WS_BORDER
CONTROL "0",IDC_CHECK_PARAM0,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,235,265,20,10
CONTROL "1",IDC_CHECK_PARAM1,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,255,265,20,10
CONTROL "2",IDC_CHECK_PARAM2,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,275,265,20,10
CONTROL "3",IDC_CHECK_PARAM3,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,295,265,20,10
CONTROL "4",IDC_CHECK_PARAM4,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,315,265,20,10
CONTROL "5",IDC_CHECK_PARAM5,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,235,275,20,10
CONTROL "6",IDC_CHECK_PARAM6,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,255,275,20,10
CONTROL "7",IDC_CHECK_PARAM7,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,275,275,20,10
CONTROL "8",IDC_CHECK_PARAM8,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,295,275,20,10
CONTROL "9",IDC_CHECK_PARAM9,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,315,275,20,10
CONTROL "10",IDC_CHECK_PARAM10,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,235,285,20,10
CONTROL "11",IDC_CHECK_PARAM11,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,255,285,20,10
CONTROL "12",IDC_CHECK_PARAM12,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,275,285,20,10
CONTROL "13",IDC_CHECK_PARAM13,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,295,285,20,10
CONTROL "14",IDC_CHECK_PARAM14,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,315,285,20,10
CONTROL "15",IDC_CHECK_PARAM15,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,235,295,20,10
CONTROL "16",IDC_CHECK_PARAM16,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,255,295,20,10
CONTROL "17",IDC_CHECK_PARAM17,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,275,295,20,10
CONTROL "18",IDC_CHECK_PARAM18,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,295,295,20,10
CONTROL "19",IDC_CHECK_PARAM19,"Button",BS_AUTO3STATE |
BS_PUSHLIKE | WS_TABSTOP,315,295,20,10
LTEXT "Param that are references",IDC_STATIC_PARAM,225,250,120,
12,SS_SUNKEN | WS_BORDER
PUSHBUTTON "Save",IDC_BUTTON_SAVE,545,175,50,14
PUSHBUTTON "Section && Refs",IDC_BUTTON_SECTIONANDREFS,545,220,50,
14
LISTBOX IDC_LIST_BADREF,5,325,590,100,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL |
WS_TABSTOP
LTEXT "Bad references",IDC_STATIC_BADREF,5,310,118,12,
SS_SUNKEN | WS_BORDER
LISTBOX IDC_LIST_SECTIONWITHBADREF,5,430,590,55,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL |
WS_TABSTOP
CTEXT "Last op. time",IDC_STATIC_LASTOPTIME,545,260,50,20,
SS_SUNKEN | WS_BORDER
PUSHBUTTON "Stat",IDC_BUTTON_STAT,545,200,50,14
LTEXT "File types :",IDC_STATIC_FILETYPE,5,135,90,12,SS_SUNKEN |
WS_BORDER
EDITTEXT IDC_EDIT_STAT,350,135,180,170,ES_MULTILINE |
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY
PUSHBUTTON "Mod statistics",IDC_BUTTON_MODSTAT,545,240,50,14
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", "ChkData MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "ChkData\0"
VALUE "LegalCopyright", "Copyright (C) 1997\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "ChkData.EXE\0"
VALUE "ProductName", "ChkData 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, 210
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
IDD_CHKDATA_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 5
RIGHTMARGIN, 595
TOPMARGIN, 5
BOTTOMMARGIN, 485
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_ABOUTBOX "&About ChkData..."
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// French (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DIALOG_WAIT DIALOG DISCARDABLE 0, 0, 227, 190
STYLE DS_MODALFRAME | WS_POPUP
FONT 8, "MS Sans Serif"
BEGIN
CONTROL 187,-1,"Static",SS_BITMAP,7,7,213,148
LTEXT "Project",IDC_STATIC_PROJECT,7,161,213,22
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_DIALOG_WAIT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 220
TOPMARGIN, 7
BOTTOMMARGIN, 183
END
END
#endif // APSTUDIO_INVOKED
#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\r\n"
"//#include ""..\\res\\ChkData.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#endif\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\\ChkData.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_BITMAP_BTROUGE BITMAP DISCARDABLE "..\\res\\BtRouge.bmp"
IDB_BITMAP_BTVERT BITMAP DISCARDABLE "..\\res\\btvert.bmp"
IDB_BITMAP_MAIDEN BITMAP DISCARDABLE "..\\res\\Maiden.bmp"
#endif // French (France) 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
//#include "..\res\ChkData.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,110 @@
/*
=======================================================================================
Name : ChkDataDlg.h
Author : vincent lhullier Date :09/09/97
Description : main dialgo box
=======================================================================================
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#if !defined(AFX_CHKDATADLG_H__51552988_281B_11D1_8F25_00609736731A__INCLUDED_)
#define AFX_CHKDATADLG_H__51552988_281B_11D1_8F25_00609736731A__INCLUDED_
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#include "ProgBar.h"
#include "Scr_fct.h"
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*
=======================================================================================
CChkDataDlg dialog box
=======================================================================================
*/
class CChkDataDlg : public CDialog
{
// data members
private:
HICON m_hIcon;
CBitmap m_hBtRougeBmp;
CBitmap m_hBtVertBmp;
long m_lNumberOfFiles;
/* ==> dialog control */
CMyProgressBar m_oProgress;
CListBox *m_p_oLBFiles;
CListBox *m_p_oLBFileType;
CListBox *m_p_oLBSectionType;
CListBox *m_p_oLBEntry;
CListBox *m_p_oLBBadRef;
CListBox *m_p_oLBSectionWithBadRef;
CButton *m_a_poBtParam[ 20 ];
SCR_tdst_Link_Value *m_p_stCurrentSectionType;
tdstEntry *m_p_stCurrentEntry;
SCR_tdst_Link_Value *m_p_stCurrentBadRef;
// Construction
public:
CChkDataDlg(CWnd* pParent = NULL); // standard constructor
~CChkDataDlg();
// Dialog Data
//{{AFX_DATA(CChkDataDlg)
enum { IDD = IDD_CHKDATA_DIALOG };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChkDataDlg)
//}}AFX_VIRTUAL
// Implementation
protected:
void m_fn_vInitProgessBar ( int _iStart, int _iEnd );
void m_fn_vFillSectionTypeList ( void );
void m_fn_vFillListEntry ( void );
void m_fn_vShowCurrentEntry ( void );
void m_fn_vDumpSectionAndRefsListInFile( char *_szFileName );
void fn_vFillBadReferenceList ( void );
void fn_vFillSectionWithBadReferenceList ( void );
void m_fn_vDisplayLastOperationTime( long _lTime );
// Generated message map functions
//{{AFX_MSG(CChkDataDlg)
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
virtual BOOL OnInitDialog();
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDIS);
afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
afx_msg void OnDblclkListFiletype();
afx_msg void OnButtonProcess();
afx_msg void OnButtonBuildfilelist();
afx_msg void OnSelchangeListSections();
afx_msg void OnSelchangeListEntries();
afx_msg void OnButtonSave();
afx_msg void OnButtonSectionandrefs();
afx_msg void OnButtonStat();
afx_msg void OnSelchangeListBadref();
afx_msg void OnDblclkListSectionwithbadref();
afx_msg void OnButtonModstat();
//}}AFX_MSG
afx_msg void OnButtonParam( UINT nID );
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHKDATADLG_H__51552988_281B_11D1_8F25_00609736731A__INCLUDED_)

View File

@@ -0,0 +1,23 @@
/*
*=======================================================================================
* Name :constant.h
*
* Author : VL Date :16/07/97
*
* Description :constant for vss data manager
*=======================================================================================
* Modification -> Author : Date :
* Description :
*=======================================================================================
*/
#ifndef __CONSTANT_H__
#define __CONSTANT_H__
/*
* constant for main window min size
*/
#define C_iMainMinWidth 300
#define C_iMainMinHeight 300
#endif /*__CONSTANT_H__*/

View File

@@ -0,0 +1,153 @@
/*
=======================================================================================
Name :IniData.h
Author :Vincent lhullier Date :21/07/97
Description :function for initial value (saving, loading, ... ) Header file
=======================================================================================
Modification -> Author : Date :
Description :
=======================================================================================
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#ifndef __INIDATA_H__
#define __INIDATA_H__
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#include <afxdisp.h>
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
typedef struct tdstProject_ tdstProject;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*
=======================================================================================
Constants
=======================================================================================
*/
/*
* Ini file
*/
#define C_szIniFile "ChkData.ini"
/*
=======================================================================================
Structures
=======================================================================================
*/
typedef struct tdstAvailablePaths_
{
char szGraphicsBanks [ MAX_PATH ]; // ("GameData\World\Graphics\Objects\Banks")
char szLevels [ MAX_PATH ]; // ("GameData\World\Levels")
char szFamilies [ MAX_PATH ]; // ("GameData\World\Levels\_Common\Families")
char szTexture [ MAX_PATH ]; // ("GameData\World\Graphics\Textures")
char szGameData [ MAX_PATH ]; // ("GameData")
char szWorld [ MAX_PATH ]; // ("GameData\World")
char szAnimations [ MAX_PATH ]; // ("GameData\World\Graphics\Anims")
char szGraphicsClasses [ MAX_PATH ]; // ("GameData\World\Graphics\Objects\Classes")
char szMechanics [ MAX_PATH ]; // ("GameData\World\Libraries\Mechanics")
char szSound [ MAX_PATH ]; // ("GameData\World\Sound")
char szVisuals [ MAX_PATH ]; // ("GameData\World\Graphics\Visuals")
char szMaterials [ MAX_PATH ]; // ("GameData\World\Libraries\Materials")
char szEnvironment [ MAX_PATH ]; // ("GameData\World\Libraries\Environment")
char szSaveGame [ MAX_PATH ]; // ("GameData\SaveGame")
char szVignettes [ MAX_PATH ]; // ("GameData\Vignette")
char szOptions [ MAX_PATH ]; // ("GameData\Options")
char szZdx [ MAX_PATH ]; // ("GameData\World\Levels")
char szCharacters [ MAX_PATH ]; // ("GameData\World\Levels")
} tdstAvailablePaths;
typedef struct tdstDirectoryType_
{
char *szPath;
char szName[ 16 ];
}tdstDirectoryType;
/*
* structure to store config of file list information
*/
typedef struct tdstFileListConfig_
{
char szKey[20]; // congfing entry in vss entry
char cIndex; // current config index
char szId[20]; // current config id
char szName[40]; // current config name
long lNumberOfFiles; // number of file in current config
char **d_szFile; // list of file name in current config
} tdstFileListConfig;
/*
* structure to store program information
*/
typedef struct tdstIniData_
{
char szLocalPath[MAX_PATH]; // name of local data path
char szRootForSection[ MAX_PATH ];
long lRootForSectionLength;
char szResultFile[MAX_PATH]; // name of file that contains result
char szSectionFile[MAX_PATH];
char cNumberOfConfigs; // number of config found in ini file
tdstFileListConfig stCheckConfig;
tdstAvailablePaths stAvailablePaths;
char cNumberOfDataPaths;
tdstDirectoryType a_stDataPath[18];
} tdstIniData;
/*
* structure to store Window preference and options
*/
typedef struct tdstWindowsPref_
{
RECT stMainPos; // main window position and size
}tdstWindowsPref;
/*
=======================================================================================
GLOBALS
=======================================================================================
*/
extern tdstIniData g_stIniData; // initial data
extern tdstWindowsPref g_stWinPref; // program options
/*
=======================================================================================
FUNCTIONS
=======================================================================================
*/
/*
* specific function for file list configuration
*/
void fn_IniD_vFreeFileList( tdstFileListConfig *_p_stFileList );
void fn_IniD_vWriteFileList( tdstFileListConfig *_p_stFileList );
BOOL fn_IniD_bGetFileList( tdstFileListConfig *_p_stFileList, char _cConfig );
void fn_IniD_vSetSingleFileList( tdstFileListConfig *_p_stFileList, char *_szFileName );
char fn_IniD_cGetIndexFromId( char *_szId );
char fn_IniD_cGetNumberOfConfig( void );
void fn_IniD_vGetConfigName( char _cConfig, char *_szName );
/*
* function to get/set single initial data
*/
BOOL fn_IniD_bGetFileTypeConsiderStatus( char *_szExt );
void fn_IniD_vSetFileTypeConsiderStatus( char *_szExt, BOOL _bConsider );
void fn_IniD_vSetLocalPath( char *_szPath );
void fn_IniD_vSetResultFile( char *_szFileName );
/*
* function for windows preference data
*/
void fn_IniD_vGetWindowPreference( void );
void fn_IniD_vWriteWindowPreference( void );
/*
* function for all ini data
*/
void fn_IniD_vGetAllFromIniFile( BOOL _bFirst );
#endif //__INIDATA_H__

View File

@@ -0,0 +1,94 @@
/*
*=======================================================================================
* Name :progbar.h
*
* Author :Vincent lhullier Date :15/07/97
*
* Description :a beautiful progress bar
*=======================================================================================
* Modification -> Author : Date :
* Description :
*=======================================================================================
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#if !defined(AFX_PROGBAR_H__9367697B_F92A_11D0_8EF0_00609736731A__INCLUDED_)
#define AFX_PROGBAR_H__9367697B_F92A_11D0_8EF0_00609736731A__INCLUDED_
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*
=======================================================================================
CMyProgressBar window
=======================================================================================
*/
class CMyProgressBar : public CProgressCtrl
{
// Construction
public:
CMyProgressBar();
// Attributes
public:
BOOL m_bInit;
int m_iStart;
int m_iEnd;
CDC m_oDC;
CBitmap m_oBitmap;
CDC m_oAnimDC;
CBitmap m_oAnimBitmap;
char m_cNumberOfFrames;
char m_cFrameWidth;
char m_cCurrentFrame;
COLORREF m_xBackgroundColor;
COLORREF m_xForegroundColor;
// Operations
public:
void m_fn_vSetRange( int _iStart, int _iEnd );
void m_fn_vReinit( void );
void m_fn_vInitDC( void );
void m_fn_vInitDrawing( COLORREF _xBackground = 0);
void m_fn_vInitDrawing( int _iRed, int _iGreen, int _iBlue, COLORREF _xBackground = 0);
void m_fn_vInitDrawing( UINT _uiBitmap, COLORREF _xForeground, COLORREF _xBackground = 0);
void m_fn_vInitAnim( UINT _uiBitmap, char _cFrame, char _cFrameWidht );
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyProgressBar)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMyProgressBar();
// Generated message map functions
protected:
//{{AFX_MSG(CMyProgressBar)
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PROGBAR_H__9367697B_F92A_11D0_8EF0_00609736731A__INCLUDED_)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

View File

@@ -0,0 +1,143 @@
/*
=======================================================================================
Name : Scr_Fct.h
Author : vincent lhullier Date :08/09/97
Description : script functions
=======================================================================================
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#ifndef __SCR_FCT_H__
#define __SCR_FCT_H__
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#include "SCR.h"
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*
=======================================================================================
Structures
=======================================================================================
*/
/*
* structure to save a reference that own to a section
*/
typedef struct tdstReference_
{
SCR_tdst_DyAr_Header stHeader; /* Header of element */
SCR_tdst_Link_Value *p_stRef;
unsigned int uiLine;
} tdstReference;
/*
* structure to store data about an entry
*/
typedef struct tdstEntry_
{
SCR_tdst_DyAr_Header stHeader; /* Header of element */
char *szName;
char *szSample;
char cNumberOfParams;
char cNumberOfRefs;
char a_cIsRef[20];
} tdstEntry;
/*
* structure to store computed script stat
*/
typedef struct tdstScriptStat_
{
unsigned long ulNbFiles;
char szBiggestFile[MAX_PATH];
unsigned long ulMaxSize;
unsigned long ulNbChars;
unsigned long ulNbLines;
unsigned long ulNbDirectiveLines;
unsigned long ulNbBeginSectionLines;
unsigned long ulNbEntryLines;
unsigned long ulNbEndSectionLines;
unsigned long ulNbMaxSectionInAFile;
char szFileWithMaxSection[ SCR_CV_ui_Cfg_MaxLenWord ];
unsigned long ulSectionNameMinLength;
char szSectionNameMin[ SCR_CV_ui_Cfg_MaxLenWord ];
unsigned long ulSectionNameMaxLength;
char szSectionNameMax[ SCR_CV_ui_Cfg_MaxLenWord ];
unsigned long ulSectionExtMaxLength;
char szSectionExtMax[ SCR_CV_ui_Cfg_MaxLenWord ];
float fSectionExtAverageLength;
unsigned long ulEntryMinLength;
char szEntryMin[ SCR_CV_ui_Cfg_MaxLenWord ];
unsigned long ulEntryMaxLength;
char szEntryMax[ SCR_CV_ui_Cfg_MaxLenWord ];
unsigned long ulFormatMaxLength;
char cMaxParams;
unsigned long ulParamsMaxLength;
} tdstScriptStat;
/*
* structure to store statistic on mod files
*/
typedef struct
{
unsigned long ulNumber;
unsigned long ulMaxPoints;
unsigned long ulMinPoints;
unsigned long ulMaxEdges;
unsigned long ulMinEdges;
unsigned long ulMinElement;
unsigned long ulMaxElement;
unsigned long ulNumberOfITElement;
unsigned long ulMinTriangles;
unsigned long ulMaxTriangles;
unsigned long ulMinUV;
unsigned long ulMaxUV;
} tdstModStat;
/*
=======================================================================================
Globals
=======================================================================================
*/
extern SCR_tdst_Link_Table g_stSectionTypeLinkTable;
extern SCR_tdst_Link_Table g_stSectionLinkTable;
extern SCR_tdst_Link_Table g_stRefLinkTable;
extern SCR_tdst_Link_Table g_stFileLinkTable;
/*
=======================================================================================
Functions
=======================================================================================
*/
void fn_Scr_vSaveSectionTypes( void );
void fn_Scr_vLoadSectionTypes( void );
tdstEntry *fn_Scr_p_stFindEntry( SCR_tdst_DyAr_Description *_p_stSectionEntryDyAr, char *_szEntryName );
void fn_Scr_vAddEntryToSection( SCR_tdst_DyAr_Description *_p_stSectionEntryDyAr, SCR_tdst_Cxt_Description *_p_stContext );
void fn_Scr_vResetUsedCounters( void );
void fn_Scr_vComputeSectionTypeHasRef( void );
void fn_Scr_vFreeSectionTypeList( void );
void fn_Scr_vFreeSectionList( void );
void fn_Scr_vFreeLTFile( void );
void fn_Scr_vParseFileToBuildListOfSectionTypes(char *_p_szFileName);
void fn_Scr_vParseFileToBuildListOfSectionsAndRefs(char *_p_szFileName);
void fn_Scr_vNewParseFileToBuildListOfSectionsAndRefs( char *_szFileName, SCR_tdst_Link_Value *_p_stLVFile );
void fn_Scr_vInitStat( tdstScriptStat *_stStat );
void fn_Scr_vParseFileForStat(char *_p_szFileName, tdstScriptStat *_stStat );
void fn_Scr_vInitModStat( tdstModStat *_pst_Stat );
void fn_Scr_vParseFileToCountModData( char *_sz_FileName, tdstModStat *_pst_Stat );
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#endif /* __SCR_FCT_H__ */

View File

@@ -0,0 +1,57 @@
/*
=======================================================================================
Name : SpecRef.h
Author : vincent lhullier Date :10/09/97
Description : functions to transform special references
=======================================================================================
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#ifndef __SPECREF_H__
#define __SPECREF_H__
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*
=======================================================================================
Typedef & struct
=======================================================================================
*/
typedef void (* tdpfn_Scr_TransformSpecialRef)(char *);
typedef struct tdstSpecialReference_
{
char szSectionType[512];
char szEntry[512];
char cParam;
tdpfn_Scr_TransformSpecialRef pfn_vTransform;
} tdstSpecialReference;
/*
=======================================================================================
constants
=======================================================================================
*/
#define C_lNumberOfSpecialRefs 1
/*
=======================================================================================
globals
=======================================================================================
*/
extern tdstSpecialReference g_a_stSpecialRef[ C_lNumberOfSpecialRefs ];
/*
=======================================================================================
functions
=======================================================================================
*/
void fn_SpRef_vTransformSpecialRef( char *_szSectionType, char *_szEntryName, char _cParam, char *_szRef );
/* special ref transformation */
void fn_vTransformCSRef( char *_szRef );
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#endif

View File

@@ -0,0 +1,25 @@
// 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__5155298A_281B_11D1_8F25_00609736731A__INCLUDED_)
#define AFX_STDAFX_H__5155298A_281B_11D1_8F25_00609736731A__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
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__5155298A_281B_11D1_8F25_00609736731A__INCLUDED_)

View File

@@ -0,0 +1,131 @@
/*
=======================================================================================
Name : Tree_Fct.h
Author : vincent lhullier Date :04/09/97
Description : header file for tree of project or file functions
=======================================================================================
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#ifndef __VSSFUNCT_H__
#define __VSSFUNCT_H__
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
typedef struct tdstFileListConfig_ tdstFileListConfig;
typedef struct tdstSection_ tdstSection;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*
=======================================================================================
STRUCTURES
=======================================================================================
*/
/*
* structure to store info about project tree
*/
typedef struct tdstFile_
{
char *szName;
BOOL bGet;
HTREEITEM hTreeItem;
} tdstFile;
typedef struct tdstProject_
{
char *szName;
BOOL bGet;
BOOL bRecurse;
long lNumberOfSubProjects;
struct tdstProject_ *d_stSubProject;
long lNumberOfFiles;
tdstFile *d_stFile;
HTREEITEM hTreeItem;
} tdstProject;
/*
* structure to describe a file type
*/
typedef struct tdstFileType_
{
char szExt[8];
long lUsed;
BOOL bConsider;
// long lNumberOfSections;
// tdstSection *d_stSection;
} tdstFileType;
/*
=======================================================================================
CONSTANT
=======================================================================================
*/
#define C_cVssProject 0
#define C_cLocalProject 1
/*
=======================================================================================
GLOBALS
=======================================================================================
*/
extern tdstProject *g_p_stRootProject;
extern long g_lNumberOfFileTypes;
extern long g_lNumberMaxOfFileTypes;
extern tdstFileType *g_d_stFileType;
/*
=======================================================================================
FUNCTIONS
=======================================================================================
*/
/*
=======================================================================================
File type functions
=======================================================================================
*/
void fn_Tree_vFreeFileTypeList ( void );
tdstFileType *fn_Tree_p_stIsAFileType ( char *_szFileType );
tdstFileType *fn_Tree_p_stAddFileType ( char *_szFileType );
void fn_Tree_vAddFileTypeFromFile ( char *_szFile );
BOOL fn_Tree_bConsiderFile ( char *_szFile );
void fn_Tree_vInitProject ( tdstProject *_p_stProj, char *_szName );
void fn_Tree_vInitProjectWithPointerName ( tdstProject *_p_stProj, char *_szName );
void fn_Tree_vInitFile ( tdstFile *_p_stFile, char *_szName );
void fn_Tree_vInitFileWithPointerName ( tdstFile *_p_stFile, char *_szName );
tdstProject *fn_Tree_p_stGetProject ( tdstProject *_p_stInProj, char *_szName );
tdstFile *fn_Tree_p_stGetFile ( tdstProject *_p_stInProj, char *_szName );
void fn_Tree_vFreeProject ( tdstProject *_p_stProj, BOOL _bDelete );
void fn_Tree_vFreeProjectTree ( tdstProject *_p_stProj, BOOL _bDelete);
void fn_Tree_vFreeProjectFileList ( tdstProject *_p_stProj );
void fn_Tree_vGetNothing ( tdstProject *_p_stProj);
void fn_Tree_vRefreshWithFileList ( tdstProject *_p_stProj, tdstFileListConfig *_p_stFileList );
void fn_Tree_vGetNumberOfFilesOrProjectsToGet( tdstProject *_p_stProj, long *_p_lNbFiles );
void fn_Tree_vGetFilesOrProjectToGet ( tdstProject *_p_stProj, long *_p_lNbFiles, char **_d_szFile );
void fn_Tree_vGetNumberOfFilesToGet ( tdstProject *_p_stProj, long *_p_lNbFiles, BOOL _bAll );
void fn_Tree_vGetFilesToGet ( tdstProject *_p_stProj, long *_p_lNbFiles, char **_d_szFile, BOOL _bAll );
long fn_Tree_lBuildListOfFilesToGet ( tdstProject *_p_stProj, char ***_ppp_szFile );
void fn_Tree_vFreeListOfFilesToGet ( long _lNumberOfFiles, char **_pp_szFile );
BOOL fn_TREE_bGetFileList ( tdstProject *_p_stProj, tdstFileListConfig *_p_stFileList, char _cConfig, char *_szFileListName );
/*
=======================================================================================
Function for local tree
=======================================================================================
*/
BOOL fn_Tree_bBuildFromDisk ( tdstProject **_pp_stRootProject, char *_szRootName, HWND _hProjectWindow );
#endif //__VSSFUNCT_H__

View File

@@ -0,0 +1,67 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by ChkData.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_CHKDATA_DIALOG 102
#define IDR_MAINFRAME 128
#define IDB_BITMAP_BTROUGE 129
#define IDB_BITMAP_BTVERT 130
#define IDD_DIALOG_WAIT 152
#define IDB_BITMAP_MAIDEN 187
#define IDC_LIST_FILETYPE 1000
#define IDC_BUTTON_PROCESS 1001
#define IDC_LIST_FILE 1002
#define IDC_STATIC_NUMBEROFFILES 1003
#define IDC_BUTTON_BUILDFILELIST 1004
#define IDC_LIST_SECTIONS 1005
#define IDC_STATIC_NUMBEROFSECTIONTYPES 1006
#define IDC_PROGRESS 1007
#define IDC_STATIC_NUMBEROFENTRIES 1008
#define IDC_LIST_ENTRIES 1009
#define IDC_STATIC_ENTRYSAMPLE 1010
#define IDC_CHECK_PARAM0 1011
#define IDC_CHECK_PARAM1 1012
#define IDC_CHECK_PARAM2 1013
#define IDC_CHECK_PARAM3 1014
#define IDC_CHECK_PARAM4 1015
#define IDC_CHECK_PARAM5 1016
#define IDC_CHECK_PARAM6 1017
#define IDC_CHECK_PARAM7 1018
#define IDC_CHECK_PARAM8 1019
#define IDC_CHECK_PARAM9 1020
#define IDC_CHECK_PARAM10 1021
#define IDC_CHECK_PARAM11 1022
#define IDC_CHECK_PARAM12 1023
#define IDC_CHECK_PARAM13 1024
#define IDC_CHECK_PARAM14 1025
#define IDC_CHECK_PARAM15 1026
#define IDC_CHECK_PARAM16 1027
#define IDC_CHECK_PARAM17 1028
#define IDC_CHECK_PARAM18 1029
#define IDC_CHECK_PARAM19 1030
#define IDC_STATIC_PARAM 1031
#define IDC_BUTTON_SAVE 1032
#define IDC_BUTTON_SECTIONANDREFS 1033
#define IDC_LIST_BADREF 1034
#define IDC_STATIC_PROJECT 1034
#define IDC_STATIC_BADREF 1035
#define IDC_LIST_SECTIONWITHBADREF 1036
#define IDC_STATIC_LASTOPTIME 1037
#define IDC_BUTTON_STAT 1038
#define IDC_STATIC_FILETYPE 1039
#define IDC_EDIT_STAT 1040
#define IDC_BUTTON_MODSTAT 1041
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 131
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1041
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -0,0 +1,220 @@
# Microsoft Developer Studio Project File - Name="ChkData" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=ChkData - 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 "ChkData.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 "ChkData.mak" CFG="ChkData - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ChkData - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "ChkData - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""$/CPA_Func/Appli/ChkData", GEKAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "ChkData - 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 "Release"
# 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 /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x40c /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x40c /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)" == "ChkData - 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 "Out\debug"
# PROP Intermediate_Dir "Out\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 /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\inc" /I "x:\cpa\public" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "SCR_DM_OptCFiles" /YX /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x40c /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0x40c /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 /out:"..\ChkData.exe" /pdbtype:sept
!ENDIF
# Begin Target
# Name "ChkData - Win32 Release"
# Name "ChkData - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\Src\ChkData.cpp
# End Source File
# Begin Source File
SOURCE=X:\Cpa\Appli\ChkData\Inc\ChkData.rc
!IF "$(CFG)" == "ChkData - Win32 Release"
!ELSEIF "$(CFG)" == "ChkData - Win32 Debug"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\Src\ChkDataDlg.cpp
# End Source File
# Begin Source File
SOURCE=X:\Cpa\Appli\ChkData\Src\IniData.cpp
# End Source File
# Begin Source File
SOURCE=..\Src\ProgBar.cpp
# End Source File
# Begin Source File
SOURCE=X:\Cpa\Appli\ChkData\Src\Scr_Fct.cpp
# End Source File
# Begin Source File
SOURCE=..\Src\SpecRef.cpp
# End Source File
# Begin Source File
SOURCE=..\Src\StdAfx.cpp
# End Source File
# Begin Source File
SOURCE=X:\Cpa\Appli\ChkData\Src\Tree_Fct.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\Inc\ChkData.h
# End Source File
# Begin Source File
SOURCE=..\Inc\ChkDataDlg.h
# End Source File
# Begin Source File
SOURCE=X:\Cpa\Appli\ChkData\Inc\Constant.h
# End Source File
# Begin Source File
SOURCE=X:\Cpa\Appli\ChkData\Inc\IniData.h
# End Source File
# Begin Source File
SOURCE=..\Inc\ProgBar.h
# End Source File
# Begin Source File
SOURCE=..\Inc\Resource.h
# End Source File
# Begin Source File
SOURCE=..\Inc\Scr_Fct.h
# End Source File
# Begin Source File
SOURCE=..\Inc\SpecRef.h
# End Source File
# Begin Source File
SOURCE=..\Inc\StdAfx.h
# End Source File
# Begin Source File
SOURCE=X:\Cpa\Appli\ChkData\Inc\Tree_Fct.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=X:\Cpa\Appli\ChkData\res\BtRouge.bmp
# End Source File
# Begin Source File
SOURCE=X:\Cpa\Appli\ChkData\res\btvert.bmp
# End Source File
# Begin Source File
SOURCE=X:\Cpa\Appli\ChkData\res\ChkData.ico
# End Source File
# Begin Source File
SOURCE=.\res\ChkData.rc2
# End Source File
# Begin Source File
SOURCE=..\res\Maiden.bmp
# End Source File
# End Group
# Begin Group "Libs"
# PROP Default_Filter "lib"
# Begin Source File
SOURCE=X:\Cpa\Lib\ERMP5_vd.lib
# End Source File
# Begin Source File
SOURCE=X:\Cpa\Lib\MMGP5_vd.lib
# End Source File
# Begin Source File
SOURCE=X:\Cpa\Lib\SCRP5_vd.lib
# End Source File
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,377 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="ChkData"
ProjectGUID="{A9F4DF6B-A096-4E48-ADFB-0C01C58573CB}"
SccProjectName="&quot;$/CPA_Func/Appli/ChkData&quot;, GEKAAAAA"
SccLocalPath="."
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="3"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Release/ChkData.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile=".\Release/ChkData.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\Release/ChkData.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/ChkData.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1036"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Out\debug"
IntermediateDirectory=".\Out\Debug"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\inc,x:\cpa\public"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;SCR_DM_OptCFiles"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Out\Debug/ChkData.pch"
AssemblerListingLocation=".\Out\Debug/"
ObjectFile=".\Out\Debug/"
ProgramDataBaseFileName=".\Out\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="..\ChkData.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Out\debug/ChkData.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Out\debug/ChkData.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1036"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="..\Src\ChkData.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="X:\Cpa\Appli\ChkData\Inc\ChkData.rc">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="X:\Cpa\Appli\ChkData\Inc"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="X:\Cpa\Appli\ChkData\Inc"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Src\ChkDataDlg.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="X:\Cpa\Appli\ChkData\Src\IniData.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Src\ProgBar.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="X:\Cpa\Appli\ChkData\Src\Scr_Fct.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Src\SpecRef.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\Src\StdAfx.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="X:\Cpa\Appli\ChkData\Src\Tree_Fct.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\Inc\ChkData.h">
</File>
<File
RelativePath="..\Inc\ChkDataDlg.h">
</File>
<File
RelativePath="X:\Cpa\Appli\ChkData\Inc\Constant.h">
</File>
<File
RelativePath="X:\Cpa\Appli\ChkData\Inc\IniData.h">
</File>
<File
RelativePath="..\Inc\ProgBar.h">
</File>
<File
RelativePath="..\Inc\Resource.h">
</File>
<File
RelativePath="..\Inc\Scr_Fct.h">
</File>
<File
RelativePath="..\Inc\SpecRef.h">
</File>
<File
RelativePath="..\Inc\StdAfx.h">
</File>
<File
RelativePath="X:\Cpa\Appli\ChkData\Inc\Tree_Fct.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe">
<File
RelativePath="X:\Cpa\Appli\ChkData\res\BtRouge.bmp">
</File>
<File
RelativePath="X:\Cpa\Appli\ChkData\res\btvert.bmp">
</File>
<File
RelativePath="X:\Cpa\Appli\ChkData\res\ChkData.ico">
</File>
<File
RelativePath="res\ChkData.rc2">
</File>
<File
RelativePath="..\res\Maiden.bmp">
</File>
</Filter>
<Filter
Name="Libs"
Filter="lib">
<File
RelativePath="X:\Cpa\Lib\ERMP5_vd.lib">
</File>
<File
RelativePath="X:\Cpa\Lib\MMGP5_vd.lib">
</File>
<File
RelativePath="X:\Cpa\Lib\SCRP5_vd.lib">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,5 @@
SCC = This is a Source Code Control file
[ChkData.dsp]
SCC_Aux_Path = "\\srvprojets-ma\Rayman4_DS\Versions\Rayman4DS\Tools"
SCC_Project_Name = "$/CPA/Appli/ChkData/Make", LFAAAAAA

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,11 @@
End of line is not correct, attempt for a return or eof.
Error was raised in source file "X:\Cpa\TempGrp\SCR\SCR_Pars.c" at line "583".
----------
Parser stopped in file "C:\Rayman2\N64\CD5\cpa\exe\MAIN\GameData\World\Graphics\anims\3bebe_globox\A3D.DIR" at line "1".
----------------(:-)----------------
<** Context 0 **>
File : C:\Rayman2\N64\CD5\cpa\exe\MAIN\GameData\World\Graphics\anims\3bebe_globox\A3D.DIR
Section : C:\Rayman2\N64\CD5\cpa\exe\MAIN\GameData\World\Graphics\anims\3bebe_globox\A3D.DIR

View File

@@ -0,0 +1,170 @@
/*
=======================================================================================
Name : ChkData.cpp
Author : vincent lhullier Date :08/09/97
Description : main Application
=======================================================================================
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#include "stdafx.h"
#include "SCR.h"
#include "ChkData.h"
#include "ChkDataDlg.h"
#include "IniData.h"
#include "Tree_fct.h"
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*
=======================================================================================
The one and only CChkDataApp object
=======================================================================================
*/
CChkDataApp theApp;
/*
=======================================================================================
CChkDataApp
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : message map
----------------------------------------------------------------------------------------
*/
BEGIN_MESSAGE_MAP(CChkDataApp, CWinApp)
//{{AFX_MSG_MAP(CChkDataApp)
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/*
----------------------------------------------------------------------------------------
Description : constructor
----------------------------------------------------------------------------------------
*/
CChkDataApp::CChkDataApp()
{
}
/*
---------------------------------------------------------------------------------------
call back for wait dialog
---------------------------------------------------------------------------------------
*/
BOOL CALLBACK fn_bWaitDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
static UINT uiTimer;
static char cInit;
BOOL bResult;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
switch (uMsg)
{
case WM_INITDIALOG:
SetWindowText(hwndDlg, "Load files infos" );
cInit = 1;
return TRUE;
case WM_SHOWWINDOW:
if (cInit)
{
cInit = 0;
uiTimer = SetTimer( hwndDlg, 1, 100, NULL );
}
break;
case WM_TIMER:
KillTimer( hwndDlg, uiTimer );
bResult = fn_Tree_bBuildFromDisk( &g_p_stRootProject, g_stIniData.szLocalPath, GetDlgItem( hwndDlg, IDC_STATIC_PROJECT ) );
EndDialog( hwndDlg, bResult?1:0 );
break;
}
return FALSE;
}
/*
----------------------------------------------------------------------------------------
Description : CChkDataApp initialization
----------------------------------------------------------------------------------------
*/
BOOL CChkDataApp::InitInstance()
{
// Standard initialization
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
/*
* Init script and memory module
*/
Mmg_fn_vFirstInitMmgModule(1);
SCR_fn_v_RdL0_Init();
SCR_fn_v_Link_InitTable( &g_stSectionTypeLinkTable );
SCR_fn_v_Link_InitTable( &g_stSectionLinkTable );
SCR_fn_v_Link_InitTable( &g_stRefLinkTable );
SCR_fn_v_Link_InitTable( &g_stFileLinkTable );
fn_IniD_vGetAllFromIniFile( TRUE );
fn_IniD_vGetWindowPreference();
int iResult = DialogBox( AfxGetInstanceHandle(), MAKEINTRESOURCE( IDD_DIALOG_WAIT ), ::GetDesktopWindow(), fn_bWaitDialogProc );
if ( iResult != 1)
{
AfxMessageBox("Can't read file and disk information", MB_OK, MB_ICONSTOP );
return FALSE;
}
strcpy( g_p_stRootProject->szName, g_stIniData.szLocalPath + g_stIniData.lRootForSectionLength );
if (_access( g_stIniData.szSectionFile, 0) == 0)
fn_Scr_vLoadSectionTypes();
CChkDataDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
fn_Tree_vFreeFileTypeList();
fn_Tree_vFreeProjectTree( g_p_stRootProject, TRUE );
fn_IniD_vFreeFileList( &g_stIniData.stCheckConfig );
fn_Scr_vFreeSectionTypeList();
SCR_fn_v_Link_CloseTable( &g_stSectionTypeLinkTable );
fn_Scr_vFreeSectionList();
SCR_fn_v_Link_CloseTable( &g_stSectionLinkTable );
SCR_fn_v_Link_CloseTable( &g_stRefLinkTable );
fn_Scr_vFreeLTFile();
SCR_fn_v_Link_CloseTable( &g_stFileLinkTable );
/*
* close memory and script module
*/
SCR_fn_v_RdL0_Close();
Mmg_fn_vStopMmgModule();
return FALSE;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,521 @@
/*
=======================================================================================
Name :IniData.cpp
Author : VL Date :16/07/97
Description :function to get ini data, check this data, write them ...
=======================================================================================
Modification -> Author : Date :
Description :
=======================================================================================
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#include "stdafx.h"
#include <io.h>
#include <sys/stat.H>
#include "constant.h"
#include "IniData.h"
#include "Tree_Fct.h"
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*
=======================================================================================
Globals
=======================================================================================
*/
tdstWindowsPref g_stWinPref;
tdstIniData g_stIniData; // data in ini file
tdstIniData g_stDefaultData = // default value for data
{
"X:\\CPA\\Exe\\Main\\Gamedata",
"X:\\CPA\\Exe\\Main\\",
0,
"chkData.log",
"SectType.txt",
0,
{ "CheckFileList", -1, "NoFileListConfig", "", 0, NULL },
{
"GameData\\World\\Graphics\\Textures",
"GameData",
"GameData\\World",
"GameData\\World\\Levels",
"GameData\\World\\Levels\\_Common\\Families",
"GameData\\World\\Levels",
"GameData\\World\\Graphics\\Anims",
"GameData\\World\\Graphics\\Objects\\Classes",
"GameData\\World\\Graphics\\Objects\\Banks",
"GameData\\World\\Libraries\\Mechanics",
"GameData\\World\\Sound",
"GameData\\World\\Graphics\\Visuals",
"GameData\\World\\Libraries\\Materials",
"GameData\\World\\Libraries\\Environment",
"GameData\\SaveGame",
"GameData\\Vignette",
"GameData\\Options",
"GameData\\World\\Levels"
},
18,
{
{g_stIniData.stAvailablePaths.szGraphicsBanks, "GraphicsBanks"},
{g_stIniData.stAvailablePaths.szLevels, "Levels"},
{g_stIniData.stAvailablePaths.szFamilies, "Families"},
{g_stIniData.stAvailablePaths.szTexture, "Texture" } ,
{g_stIniData.stAvailablePaths.szGameData, "GameData"} ,
{g_stIniData.stAvailablePaths.szWorld, "World"},
{g_stIniData.stAvailablePaths.szCharacters, "Characters"},
{g_stIniData.stAvailablePaths.szAnimations, "Animations"},
{g_stIniData.stAvailablePaths.szGraphicsClasses, "GraphicsClasses"},
{g_stIniData.stAvailablePaths.szMechanics, "Mechanics"},
{g_stIniData.stAvailablePaths.szSound, "Sound"},
{g_stIniData.stAvailablePaths.szVisuals, "Visuals"},
{g_stIniData.stAvailablePaths.szMaterials, "Materials"},
{g_stIniData.stAvailablePaths.szEnvironment, "Environment"},
{g_stIniData.stAvailablePaths.szSaveGame, "SaveGame"},
{g_stIniData.stAvailablePaths.szVignettes, "Vignettes"},
{g_stIniData.stAvailablePaths.szOptions, "Options"},
{g_stIniData.stAvailablePaths.szZdx, "Zdx"}
}
};
char g_szIniFile[MAX_PATH];
/*
=======================================================================================
Macros
=======================================================================================
*/
/*
* Macro to bound size of a rect
*/
#define M_vCheckRectSize( _p_stRect, _iMinWidth, _iMinHeight )\
{\
if (_p_stRect->right - _p_stRect->left + 1 < _iMinWidth )\
_p_stRect->right = _p_stRect->left + _iMinWidth ;\
if (_p_stRect->bottom - _p_stRect->top + 1 < _iMinHeight )\
_p_stRect->bottom = _p_stRect->top + _iMinHeight;\
}
/*
=======================================================================================
Functions to manage file list
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : free fileList in Init Data structure
----------------------------------------------------------------------------------------
*/
void fn_IniD_vFreeFileList( tdstFileListConfig *_p_stFileList )
{
int iFile;
if ( _p_stFileList == NULL)
return;
if (_p_stFileList->lNumberOfFiles != 0)
{
for (iFile = 0; iFile < _p_stFileList->lNumberOfFiles; iFile++)
free ( _p_stFileList->d_szFile[iFile] );
free ( _p_stFileList->d_szFile );
_p_stFileList->lNumberOfFiles = 0;
}
}
/*
----------------------------------------------------------------------------------------
Description : write file list config in ini file
----------------------------------------------------------------------------------------
*/
void fn_IniD_vWriteFileList( tdstFileListConfig *_p_stFileList )
{
int iOldFileNumber;
int iFile;
char szString[40];
if (_p_stFileList == NULL)
return;
/* set ini file in RW mode if in ReadOnly mode */
if (_access( g_szIniFile, 2) == -1)
_chmod ( g_szIniFile, _S_IWRITE );
iOldFileNumber = GetPrivateProfileInt( _p_stFileList->szId, "Number", 0, g_szIniFile );
if ( iOldFileNumber == 0 ) // new config
g_stIniData.cNumberOfConfigs++;
WritePrivateProfileString( "Vss", _p_stFileList->szKey, _p_stFileList->szId, g_szIniFile );
WritePrivateProfileString( _p_stFileList->szId, "Name", _p_stFileList->szName, g_szIniFile );
WritePrivateProfileString( _p_stFileList->szId, "Number", itoa( _p_stFileList->lNumberOfFiles, szString, 10 ), g_szIniFile );
for ( iFile = 0; iFile < _p_stFileList->lNumberOfFiles; iFile ++)
{
sprintf( szString, "File%04d", iFile );
WritePrivateProfileString( _p_stFileList->szId, szString, _p_stFileList->d_szFile[iFile], g_szIniFile );
}
for ( ;iFile < iOldFileNumber; iFile ++)
{
sprintf( szString, "File%04d", iFile );
WritePrivateProfileString( _p_stFileList->szId, szString, NULL, g_szIniFile );
}
}
/*
----------------------------------------------------------------------------------------
Description : get file list config from ini file
----------------------------------------------------------------------------------------
*/
BOOL fn_IniD_bGetFileList( tdstFileListConfig *_p_stFileList, char _cConfig )
{
long lNbFiles;
int iFile;
int iDeleteFile;
char szKey[10];
char **d_szFileName;
if (_p_stFileList == NULL)
return FALSE;
if ( (_cConfig < 0) || (_cConfig >= g_stIniData.cNumberOfConfigs) )
return FALSE;
sprintf( _p_stFileList->szId, "FileList-Config%02d", _cConfig );
/* get config name */
GetPrivateProfileString( _p_stFileList->szId, "Name", "No name", _p_stFileList->szName, 40, g_szIniFile);
/* get number of file */
lNbFiles = GetPrivateProfileInt( _p_stFileList->szId, "Number", 0, g_szIniFile);
if (lNbFiles == 0)
return FALSE;
/* allocate memory for pointer to file names */
d_szFileName = (char **) malloc ( lNbFiles * sizeof( char *) );
/* get each file name */
for (iFile = 0; iFile < lNbFiles; iFile ++)
{
d_szFileName[iFile] = (char *) malloc( _MAX_PATH );
sprintf( szKey, "File%04d", iFile );
GetPrivateProfileString( _p_stFileList->szId, szKey, "Error", d_szFileName[iFile], MAX_PATH, g_szIniFile );
if (strcmp( d_szFileName[iFile], "Error") == 0)
{
for (iDeleteFile = 0; iDeleteFile <= iFile; iDeleteFile ++)
free ( d_szFileName[iDeleteFile] );
free (d_szFileName);
return FALSE;
}
}
/* update ini data */
fn_IniD_vFreeFileList( _p_stFileList );
_p_stFileList->lNumberOfFiles = lNbFiles;
_p_stFileList->d_szFile = d_szFileName;
return TRUE;
}
/*
----------------------------------------------------------------------------------------
Set file list to default value
----------------------------------------------------------------------------------------
*/
void fn_IniD_vSetSingleFileList( tdstFileListConfig *_p_stFileList, char *_szFileName )
{
if ( _p_stFileList == NULL )
return;
fn_IniD_vFreeFileList( _p_stFileList );
_p_stFileList->lNumberOfFiles = 1;
_p_stFileList->d_szFile = (char **) malloc( sizeof( char *) );
_p_stFileList->d_szFile[0] = (char *) malloc( MAX_PATH );
sprintf( _p_stFileList->d_szFile[0], "-R %s", _szFileName );
}
/*
----------------------------------------------------------------------------------------
Description : get index of a config from id of the config
_szId -> string id of config
Returns (char ) index of config (-1 if not a valid string id
----------------------------------------------------------------------------------------
*/
char fn_IniD_cGetIndexFromId( char *_szId )
{
if ( strlen( _szId ) != 17 )
return -1;
if ( strncmp( _szId, "FileList-Config", 15 ) != 0)
return -1;
if ( !isdigit( _szId[15] ) || !isdigit( _szId[16] ) )
return -1;
return (_szId[15] - '0') * 10 + (_szId[16] - '0');
}
/*
----------------------------------------------------------------------------------------
get number of file list config
----------------------------------------------------------------------------------------
*/
char fn_IniD_cGetNumberOfConfig( void )
{
return g_stIniData.cNumberOfConfigs;
}
/*
----------------------------------------------------------------------------------------
get name of a config
----------------------------------------------------------------------------------------
*/
void fn_IniD_vGetConfigName( char _cConfig, char *_szName )
{
char szConfigId[20];
sprintf( szConfigId, "FileList-Config%02d", _cConfig );
GetPrivateProfileString( szConfigId, "Name", "Error", _szName, 40, g_szIniFile );
}
/*
=======================================================================================
function to get/set single initial data
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Get extensions status
----------------------------------------------------------------------------------------
*/
BOOL fn_IniD_bGetFileTypeConsiderStatus( char *_szExt )
{
int iResult;
iResult = GetPrivateProfileInt( "FileType", _szExt, 1, g_szIniFile );
return (iResult == 1);
}
/*
----------------------------------------------------------------------------------------
Set extensions status
----------------------------------------------------------------------------------------
*/
void fn_IniD_vSetFileTypeConsiderStatus( char *_szExt, BOOL _bConsider )
{
/* set ini file in RW mode if in ReadOnly mode */
if (_access( g_szIniFile, 2) == -1)
_chmod ( g_szIniFile, _S_IWRITE );
WritePrivateProfileString( "FileType", _szExt, _bConsider ? "1" : "0", g_szIniFile );
}
/*
----------------------------------------------------------------------------------------
set local path in ini file
----------------------------------------------------------------------------------------
*/
void fn_IniD_vSetLocalPath( char *_szPath )
{
/* set ini file in RW mode if in ReadOnly mode */
if (_access( g_szIniFile, 2) == -1)
_chmod ( g_szIniFile, _S_IWRITE );
WritePrivateProfileString( "Local", "DataRootPath", _szPath, g_szIniFile );
}
/*
----------------------------------------------------------------------------------------
set result file name
----------------------------------------------------------------------------------------
*/
void fn_IniD_vSetModifListFile( char *_szFileName )
{
/* set ini file in RW mode if in ReadOnly mode */
if (_access( g_szIniFile, 2) == -1)
_chmod ( g_szIniFile, _S_IWRITE );
WritePrivateProfileString( "Result", "File", _szFileName, g_szIniFile );
}
/*
----------------------------------------------------------------------------------------
Analyse string that describe a rect
----------------------------------------------------------------------------------------
*/
void fn_IniD_vAnalyseRectData( char *_szString, RECT *_p_stRect )
{
char *p_szValue[5], *p_szEnd;
char cVal;
memset( _p_stRect, 0, sizeof( RECT ) );
if ( (p_szValue[0] = strchr(_szString, '(' )) == NULL)
return;
if ( (p_szValue[1] = strchr (++p_szValue[0], ',')) == NULL)
return;
if ( (p_szValue[2] = strchr (++p_szValue[1], ',')) == NULL)
return;
if ( (p_szValue[3] = strchr (++p_szValue[2], ',')) == NULL)
return;
p_szValue[3] ++;
p_szValue[4] = _szString + strlen( _szString );
for (cVal = 0; cVal < 4; cVal ++)
{
while ( !isdigit(*p_szValue[cVal]) )
{
if (p_szValue[cVal] == p_szValue[cVal+1])
return;
p_szValue[cVal]++;
}
p_szEnd = p_szValue[cVal] + 1;
while ( isdigit(*p_szEnd))
{
if (p_szEnd == p_szValue[cVal+1])
return;
p_szEnd++;
}
*p_szEnd = 0;
}
_p_stRect->left = atoi( p_szValue[0] );
_p_stRect->top = atoi( p_szValue[1] );
_p_stRect->right = atoi( p_szValue[2] );
_p_stRect->bottom = atoi( p_szValue[3] );
}
/*
=======================================================================================
function for windows preference data
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : get position and size of windows
----------------------------------------------------------------------------------------
*/
void fn_IniD_vGetWindowPreference( void )
{
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
char szString[100];
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/* main window */
GetPrivateProfileString( "WinPref", "Main", "", szString, 100, g_szIniFile );
fn_IniD_vAnalyseRectData( szString, &g_stWinPref.stMainPos );
M_vCheckRectSize( (&g_stWinPref.stMainPos), C_iMainMinWidth, C_iMainMinHeight );
}
/*
----------------------------------------------------------------------------------------
Description : write position and size of windows
----------------------------------------------------------------------------------------
*/
void fn_IniD_vWriteWindowPreference( void )
{
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
char szValue[50];
RECT *p_stRect;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/* set ini file in RW mode if in ReadOnly mode */
if (_access( g_szIniFile, 2) == -1)
_chmod ( g_szIniFile, _S_IWRITE );
/* main window */
p_stRect = &g_stWinPref.stMainPos;
sprintf( szValue, "(%4d,%4d,%4d,%4d)", p_stRect->left, p_stRect->top, p_stRect->right, p_stRect->bottom );
WritePrivateProfileString( "WinPref", "Main ", szValue, g_szIniFile );
}
/*
*=======================================================================================
* function for all initial data
*=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
transform ini file to keep file compatible
----------------------------------------------------------------------------------------
*/
void fn_IniD_vTransformIniFileToBeCompatible( void )
{
}
/*
----------------------------------------------------------------------------------------
Description : read ini data to fill inidata structure
and set additional ini data
_bFirst -> indicate that it's the first initialisation
----------------------------------------------------------------------------------------
*/
void fn_IniD_vGetAllFromIniFile( BOOL _bFirst )
{
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
char szConfigId[20];
char szConfigName[40];
tdstFileListConfig *p_stConfig;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
if (_bFirst)
{
/*
* transform eventually ini file
*/
fn_IniD_vTransformIniFileToBeCompatible();
/*
* Build ini file
*/
GetCurrentDirectory( MAX_PATH, g_szIniFile );
if (g_szIniFile[strlen(g_szIniFile) - 1] != '\\')
strcat( g_szIniFile, "\\");
strcat( g_szIniFile, C_szIniFile );
memcpy ( &g_stIniData, &g_stDefaultData, sizeof( tdstIniData ) );
memset ( &g_stWinPref, 0, sizeof( tdstWindowsPref ) );
fn_IniD_vGetWindowPreference();
/* retrieve number of config */
g_stIniData.cNumberOfConfigs = 0;
while (1)
{
sprintf( szConfigId, "FileList-Config%02d", g_stIniData.cNumberOfConfigs);
GetPrivateProfileString( szConfigId, "Name", "Error", szConfigName, 40, g_szIniFile );
if (strcmp(szConfigName, "Error") == 0)
break;
g_stIniData.cNumberOfConfigs++;
}
}
GetPrivateProfileString( "Local", "DataRootPath", g_stDefaultData.szLocalPath, g_stIniData.szLocalPath, MAX_PATH, g_szIniFile );
GetPrivateProfileString( "Local", "RootForSection", g_stDefaultData.szRootForSection, g_stIniData.szRootForSection, MAX_PATH, g_szIniFile );
g_stIniData.lRootForSectionLength = strlen( g_stIniData.szRootForSection );
GetPrivateProfileString( "Result", "File", g_stDefaultData.szResultFile, g_stIniData.szResultFile, MAX_PATH, g_szIniFile );
/*
* get check file list Id
*/
p_stConfig = &g_stIniData.stCheckConfig;
GetPrivateProfileString( "Vss", p_stConfig->szKey, g_stDefaultData.stCheckConfig.szId, p_stConfig->szId, 20, g_szIniFile );
p_stConfig->cIndex = fn_IniD_cGetIndexFromId( p_stConfig->szId );
if (p_stConfig->cIndex != -1)
fn_IniD_bGetFileList( p_stConfig, p_stConfig->cIndex );
else
fn_IniD_vSetSingleFileList( p_stConfig, g_stIniData.szLocalPath + g_stIniData.lRootForSectionLength );
}

View File

@@ -0,0 +1,298 @@
/*
=======================================================================================
Name :progbar.cpp
Author :Vincent Lhullier Date :15/07/97
Description :A beautiful progress bar
=======================================================================================
Modification -> Author : Date :
Description :
=======================================================================================
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#include "stdafx.h"
#include "progbar.h"
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*
=======================================================================================
CMyProgressBar implementation
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : constructor
----------------------------------------------------------------------------------------
*/
CMyProgressBar::CMyProgressBar()
{
m_bInit = FALSE;
}
/*
----------------------------------------------------------------------------------------
Description : destructor
----------------------------------------------------------------------------------------
*/
CMyProgressBar::~CMyProgressBar()
{
}
/*
----------------------------------------------------------------------------------------
Description : message map
----------------------------------------------------------------------------------------
*/
BEGIN_MESSAGE_MAP(CMyProgressBar, CProgressCtrl)
//{{AFX_MSG_MAP(CMyProgressBar)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/*
=======================================================================================
CMyProgressBar message handlers
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : WM_PAINT Message
----------------------------------------------------------------------------------------
*/
void CMyProgressBar::OnPaint()
{
RECT stWinRect;
RECT stDrawRect;
int iCol;
// char szPercent[5];
CPaintDC dc(this); // device context for painting
GetClientRect( &stWinRect );
stDrawRect = stWinRect;
iCol = (stDrawRect.right * OffsetPos(0)) / (m_iEnd - m_iStart + 1);
if ( iCol > 256 )
{
stDrawRect.right = iCol - 257;
dc.FillSolidRect( &stDrawRect, m_xForegroundColor );
dc.BitBlt( iCol - 256, 0, 256, stDrawRect.bottom, &m_oDC, 0, 0, SRCCOPY );
}
else
{
dc.BitBlt( 0, 0, iCol, stDrawRect.bottom, &m_oDC, 256 - iCol, 0, SRCCOPY );
}
if ( m_cNumberOfFrames )
{
dc.BitBlt( iCol - m_cFrameWidth, 0, m_cFrameWidth, stDrawRect.bottom, &m_oAnimDC, m_cCurrentFrame * m_cFrameWidth, 0, SRCINVERT );
m_cCurrentFrame = (m_cCurrentFrame + 1) % m_cNumberOfFrames;
}
stDrawRect.left = iCol + 1;
stDrawRect.right = stWinRect.right;
dc.FillSolidRect( &stDrawRect, m_xBackgroundColor );
/*
itoa( (100 * OffsetPos(0)) / (m_iEnd - m_iStart + 1), szPercent, 10 );
strcat( szPercent, "%" );
dc.DrawState ( CPoint( stWinRect.right / 2 - 32, 0), CSize( 64, 16), (LPCTSTR) szPercent, DST_TEXT , TRUE, 0, (HBRUSH) NULL );
dc.DrawState ( CPoint( stWinRect.right / 2 + 32, 0), CSize( 64, 16), (LPCTSTR) szPercent, DST_TEXT | DSS_MONO, TRUE, 0, (HBRUSH) NULL );
dc.DrawState ( CPoint( stWinRect.right / 2 - 96, 0), CSize( 64, 16), (LPCTSTR) szPercent, DST_TEXT | DSS_NORMAL, TRUE, 0, (HBRUSH) NULL );
dc.DrawState ( CPoint( stWinRect.right / 2 + 96, 0), CSize( 64, 16), (LPCTSTR) szPercent, DST_TEXT | DSS_UNION, TRUE, 0, (HBRUSH) NULL );
*/
}
/*
=======================================================================================
Specific functions
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : set range of progression
_iStart -> beginning value
_iEnd -> end value
----------------------------------------------------------------------------------------
*/
void CMyProgressBar::m_fn_vSetRange( int _iStart, int _iEnd )
{
m_iStart = _iStart;
m_iEnd = _iEnd;
SetRange( _iStart, _iEnd );
}
/*
----------------------------------------------------------------------------------------
Description : initialize DC and bitmap to draw
----------------------------------------------------------------------------------------
*/
void CMyProgressBar::m_fn_vInitDC( void )
{
if (!m_bInit)
{
RECT stRect;
GetClientRect( &stRect );
m_oDC.CreateCompatibleDC( GetDC() );
m_oBitmap.CreateCompatibleBitmap( GetDC() , 256, stRect.bottom );
m_oDC.SelectObject( &m_oBitmap );
m_oAnimDC.CreateCompatibleDC( GetDC() );
m_oAnimBitmap.CreateCompatibleBitmap( GetDC() , 256, stRect.bottom );
m_oAnimDC.SelectObject( &m_oBitmap );
m_cNumberOfFrames = 0;
m_bInit = TRUE;
}
}
/*
----------------------------------------------------------------------------------------
Description : set position of progression to beginning value, change drawing type
----------------------------------------------------------------------------------------
*/
void CMyProgressBar::m_fn_vReinit( void )
{
SetPos( m_iStart );
}
/*
=======================================================================================
function to prepare drawing
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : colored bar with random color value
_xBackground -> background color
----------------------------------------------------------------------------------------
*/
void CMyProgressBar::m_fn_vInitDrawing( COLORREF _xBackground )
{
char cColor;
int a_iColor[3];
srand( (unsigned) time ( NULL ) );
for (cColor = 0; cColor < 3; cColor ++ )
{
a_iColor[ cColor ] = (rand() % 3) - 2;
if (a_iColor[ cColor ] == 0)
a_iColor[ cColor ] = rand() & 0xFF;
}
m_fn_vInitDrawing( a_iColor[0], a_iColor[1], a_iColor[2], _xBackground );
}
/*
----------------------------------------------------------------------------------------
Description : colored bar with given color
_iRed -> red value (-2 = increasing, -1 = decreasing)
_iGreen -> green value
_iBlue -> blue value
_xBackground -> background color
----------------------------------------------------------------------------------------
*/
void CMyProgressBar::m_fn_vInitDrawing( int _iRed, int _iGreen, int _iBlue, COLORREF _xBackground )
{
char cColor;
int iColor;
unsigned char ucColor[3];
int a_iColor[3];
RECT stRect;
a_iColor[0] = _iRed;
a_iColor[1] = _iGreen;
a_iColor[2] = _iBlue;
m_fn_vInitDC();
for (cColor = 0; cColor < 3; cColor ++ )
{
if (a_iColor[ cColor ] == -2)
ucColor[ cColor ] = (unsigned char) 0xFF;
else if (a_iColor[ cColor ] == -1)
ucColor[ cColor ] = (unsigned char) 0x7F;
else
ucColor[ cColor ] = (unsigned char) a_iColor[ cColor ];
}
m_xBackgroundColor = _xBackground;
m_xForegroundColor = RGB( ucColor[0], ucColor[1], ucColor[2] );
GetClientRect( &stRect );
stRect.left = 0;
stRect.right = 2;
for (iColor = 0; iColor < 128; iColor ++)
{
m_oDC.FillSolidRect( &stRect, RGB( ucColor[0], ucColor[1], ucColor[2] ) );
for (cColor = 0; cColor < 3; cColor++)
{
if (a_iColor[ cColor ] == -2)
ucColor[ cColor ]--;
else if (a_iColor[ cColor ] == -1)
ucColor[ cColor ]++;
}
stRect.left += 2;
stRect.right += 2;
}
}
/*
----------------------------------------------------------------------------------------
Description : draw a bitmap
uiBitmap -> id of bimap
_xForeground -> foreground color
_xBackground -> background color
----------------------------------------------------------------------------------------
*/
void CMyProgressBar::m_fn_vInitDrawing( UINT _uiBitmap, COLORREF _xForeground, COLORREF _xBackground )
{
m_fn_vInitDC();
m_oBitmap.DeleteObject();
m_oBitmap.LoadBitmap( _uiBitmap );
m_oDC.SelectObject( &m_oBitmap );
m_xBackgroundColor = _xBackground;
m_xForegroundColor = _xForeground;
}
void CMyProgressBar::m_fn_vInitAnim( UINT _uiBitmap, char _cFrame, char _cFrameWidth )
{
if ( (m_cNumberOfFrames = _cFrame) == 0)
return;
m_cFrameWidth = _cFrameWidth;
m_fn_vInitDC();
m_oAnimBitmap.DeleteObject();
m_oAnimBitmap.LoadBitmap( _uiBitmap );
m_oAnimDC.SelectObject( &m_oAnimBitmap );
m_cCurrentFrame = 0;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,87 @@
/*
=======================================================================================
Name : SpecRef.cpp
Author : vincent lhullier Date :10/09/97
Description : functions to transform special references
=======================================================================================
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#include "stdafx.h"
#include "SpecRef.h"
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*
=======================================================================================
globals
=======================================================================================
*/
tdstSpecialReference g_a_stSpecialRef[ C_lNumberOfSpecialRefs ] =
{
{ "PHY", "CS", 0, fn_vTransformCSRef }
};
/*
=======================================================================================
functions
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : called for a special reference
_szSectionType -> section type
_szEntryName -> entry name
_cParam -> parameter index
_szRef -> reference to transform
----------------------------------------------------------------------------------------
*/
void fn_SpRef_vTransformSpecialRef( char *_szSectionType, char *_szEntryName, char _cParam, char *_szRef )
{
char cSpecialRef;
tdstSpecialReference *p_stRef = g_a_stSpecialRef;
for (cSpecialRef = 0; cSpecialRef < C_lNumberOfSpecialRefs; cSpecialRef++, p_stRef++ )
{
if
(
( stricmp( _szSectionType, p_stRef->szSectionType) == 0)
&& ( stricmp( _szEntryName, p_stRef->szEntry ) == 0)
&& ( _cParam == p_stRef->cParam )
)
{
p_stRef->pfn_vTransform( _szRef );
return;
}
}
}
/*
----------------------------------------------------------------------------------------
Description : transform bad CS reference from
<filename>^CS:<name> to <filename>^AllCollideSets^CS:<Name>
_szRef -> bad reference : <filename>
----------------------------------------------------------------------------------------
*/
void fn_vTransformCSRef( char *_szRef )
{
char szEnd[ 100 ];
char *szSectionName;
if ((szSectionName = strchr( _szRef, '^' )) == NULL)
return;
szSectionName++;
if ( strnicmp( szSectionName, "CS", 2 ) == 0)
{
strcpy( szEnd, szSectionName );
strcpy( szSectionName, "AllCollideSets^" );
strcat( szSectionName, szEnd );
}
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

View File

@@ -0,0 +1,6 @@
// stdafx.cpp : source file that includes just the standard includes
// ChkData.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

View File

@@ -0,0 +1,859 @@
/*
=======================================================================================
Name : VssFunct.cpp
Author : vincent lhullier Date :27/07/97
Description : Manage vss tree, file of list to obtain
=======================================================================================
Modification -> Author : Date :
Description :
=======================================================================================
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#include "stdafx.h"
#include <io.h>
#include "Tree_Fct.h"
#include "IniData.h"
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*
=======================================================================================
GLOBALS
=======================================================================================
*/
tdstProject *g_p_stRootProject = NULL;
char g_szFullName[MAX_PATH];
char **gs_d_szFile;
char **gs_d_szProj;
/*
* globals for list of extension
*/
long g_lNumberOfFileTypes = 0;
long g_lNumberMaxOfFileTypes = 0;
tdstFileType *g_d_stFileType = NULL;
HWND g_hProjectWindow;
/*
=======================================================================================
File type functions
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : free list of file type
----------------------------------------------------------------------------------------
*/
void fn_Tree_vFreeFileTypeList( void )
{
if (g_lNumberMaxOfFileTypes != 0)
{
free ( g_d_stFileType );
g_d_stFileType = NULL;
g_lNumberOfFileTypes = 0;
g_lNumberMaxOfFileTypes = 0;
}
}
/*
----------------------------------------------------------------------------------------
Description : search if a file type is in list or not
----------------------------------------------------------------------------------------
*/
tdstFileType *fn_Tree_p_stIsAFileType( char *_szFileType )
{
long lFileType;
tdstFileType *p_stFT = g_d_stFileType;
for (lFileType = 0; lFileType < g_lNumberOfFileTypes; lFileType++, p_stFT++ )
{
if (stricmp( p_stFT->szExt, _szFileType) == 0)
return p_stFT;
}
return NULL;
}
/*
----------------------------------------------------------------------------------------
Description : add a file type in list
----------------------------------------------------------------------------------------
*/
tdstFileType *fn_Tree_p_stAddFileType( char *_szFileType )
{
tdstFileType *p_stFT;
char *p_szExt;
if ( (p_stFT = fn_Tree_p_stIsAFileType( _szFileType )) != NULL)
return p_stFT;
if (g_lNumberOfFileTypes == g_lNumberMaxOfFileTypes )
{
g_lNumberMaxOfFileTypes += 50;
if (g_lNumberMaxOfFileTypes == 50)
{
g_d_stFileType = (tdstFileType *) malloc (g_lNumberMaxOfFileTypes * sizeof( tdstFileType ) );
}
else
{
g_d_stFileType = (tdstFileType *) realloc( g_d_stFileType, g_lNumberMaxOfFileTypes * sizeof( tdstFileType ) );
}
}
p_stFT = &g_d_stFileType[ g_lNumberOfFileTypes++ ];
p_szExt = p_stFT->szExt;
while (*_szFileType != 0)
*p_szExt++ = tolower( *_szFileType++ );
*p_szExt = 0;
p_stFT->lUsed = 0;
p_stFT->bConsider = fn_IniD_bGetFileTypeConsiderStatus( p_stFT->szExt );
return p_stFT;
}
/*
----------------------------------------------------------------------------------------
Description : add the type of given file in list and increase used count of file type
----------------------------------------------------------------------------------------
*/
void fn_Tree_vAddFileTypeFromFile( char *_szFile )
{
char *szExt;
tdstFileType *p_stFT;
if ( (szExt = strrchr(_szFile, '.')) == NULL)
szExt = _szFile + strlen( _szFile );
else
szExt++;
p_stFT = fn_Tree_p_stAddFileType( szExt );
p_stFT->lUsed++;
}
/*
----------------------------------------------------------------------------------------
Description : get file type of a given file
_szFileName -> file name
Returns (tdstFileType ) file type
----------------------------------------------------------------------------------------
*/
tdstFileType *fn_Tree_p_stGetFileFileType( char *_szFileName )
{
char *szExt;
if ( (szExt = strrchr(_szFileName, '.')) == NULL)
szExt = _szFileName + strlen( _szFileName );
else
szExt++;
return fn_Tree_p_stIsAFileType( szExt );
}
/*
----------------------------------------------------------------------------------------
Description : return bConsider flag of extension of given file
_szFile -> file name
Returns (BOOL ) bConsider flag of extension
----------------------------------------------------------------------------------------
*/
BOOL fn_Tree_bConsiderFile( char *_szFile )
{
tdstFileType *p_stFT;
p_stFT = fn_Tree_p_stGetFileFileType( _szFile );
if (p_stFT == NULL)
return FALSE;
return p_stFT->bConsider;
}
/*
=======================================================================================
TREE FUNCTIONS
=======================================================================================
*/
/*
---------------------------------------------------------------------------------------
fill a tdstProject structure with name and describing an empty project
---------------------------------------------------------------------------------------
*/
void fn_Tree_vInitProject( tdstProject *_p_stProj, char *_szName )
{
_p_stProj->szName = (char *) malloc( strlen(_szName) + 1 );
strcpy( _p_stProj->szName, _szName );
_p_stProj->bGet = FALSE;
_p_stProj->bRecurse = FALSE;
_p_stProj->lNumberOfSubProjects = 0;
_p_stProj->d_stSubProject = NULL;
_p_stProj->lNumberOfFiles = 0;
_p_stProj->d_stFile = NULL;
}
/*
---------------------------------------------------------------------------------------
fill a tdstProject structure with pointer name and describing an empty project
---------------------------------------------------------------------------------------
*/
void fn_Tree_vInitProjectWithPointerName( tdstProject *_p_stProj, char *_szName )
{
_p_stProj->szName = _szName;
_p_stProj->bGet = FALSE;
_p_stProj->bRecurse = FALSE;
_p_stProj->lNumberOfSubProjects = 0;
_p_stProj->d_stSubProject = NULL;
_p_stProj->lNumberOfFiles = 0;
_p_stProj->d_stFile = NULL;
}
/*
---------------------------------------------------------------------------------------
fill a tdstFile structure with name
---------------------------------------------------------------------------------------
*/
void fn_Tree_vInitFile( tdstFile *_p_stFile, char *_szName )
{
_p_stFile->szName = (char *) malloc( strlen(_szName) + 1 );
strcpy( _p_stFile->szName, _szName );
_p_stFile->bGet = FALSE;
}
/*
---------------------------------------------------------------------------------------
fill a tdstFile structure with pointer name
---------------------------------------------------------------------------------------
*/
void fn_Tree_vInitFileWithPointerName( tdstFile *_p_stFile, char *_szName )
{
_p_stFile->szName = _szName;
_p_stFile->bGet = FALSE;
}
/*
---------------------------------------------------------------------------------------
retrieve a subproject
---------------------------------------------------------------------------------------
*/
tdstProject *fn_Tree_p_stGetProject( tdstProject *_p_stInProj, char *_szName )
{
char *p_cCur;
char *p_cNext;
tdstProject *p_stCurProj;
long lSubProj;
if (_p_stInProj == NULL)
return NULL;
p_cCur = _szName;
while (1)
{
p_cCur = strchr( p_cCur, '/' );
if (p_cCur == NULL)
break;
*p_cCur = '\\';
}
if ( strnicmp( _szName, _p_stInProj->szName, strlen( _p_stInProj->szName )) != 0)
return NULL;
p_cCur = _szName + strlen( _p_stInProj->szName );
p_stCurProj = _p_stInProj;
while (*p_cCur != 0)
{
p_cCur ++;
p_cNext = strchr(p_cCur, '\\');
if (p_cNext != NULL) *p_cNext = 0;
for (lSubProj = 0; lSubProj < p_stCurProj->lNumberOfSubProjects; lSubProj++)
{
if (stricmp( p_stCurProj->d_stSubProject[lSubProj].szName, p_cCur) == 0)
break;
}
if (lSubProj == p_stCurProj->lNumberOfSubProjects)
return NULL;
p_stCurProj = &p_stCurProj->d_stSubProject[lSubProj];
p_cCur += strlen( p_cCur );
if (p_cNext != NULL) *p_cNext = '\\';
}
return p_stCurProj;
}
/*
---------------------------------------------------------------------------------------
retrieve a file with name
---------------------------------------------------------------------------------------
*/
tdstFile *fn_Tree_p_stGetFile( tdstProject *_p_stInProj, char *_szName )
{
tdstProject *p_stProj;
tdstFile *p_stFile;
char *p_szShortName;
long lFile = 0;
p_szShortName = strrchr( _szName, '\\' );
*p_szShortName++ = 0;
p_stProj = fn_Tree_p_stGetProject( _p_stInProj, _szName );
*(p_szShortName - 1) = '\\';
if ( p_stProj == NULL)
return NULL;
for ( p_stFile = p_stProj->d_stFile; lFile < p_stProj->lNumberOfFiles; lFile++, p_stFile ++)
{
if (stricmp( p_szShortName, p_stFile->szName) == 0)
return p_stFile;
}
return NULL;
}
/*
---------------------------------------------------------------------------------------
free a project information
---------------------------------------------------------------------------------------
*/
void fn_Tree_vFreeProject( tdstProject *_p_stProj, BOOL _bDelete )
{
long lIndex;
/* free files */
if (_p_stProj == NULL)
return;
if (_p_stProj->d_stFile)
{
for (lIndex = 0; lIndex < _p_stProj->lNumberOfFiles; lIndex ++)
free ( _p_stProj->d_stFile[lIndex].szName );
free (_p_stProj->d_stFile );
_p_stProj->d_stFile = NULL;
_p_stProj->lNumberOfFiles = 0;
}
/* free sub project */
if (_p_stProj->d_stSubProject )
{
for (lIndex = 0; lIndex < _p_stProj->lNumberOfSubProjects; lIndex ++)
fn_Tree_vFreeProject( &_p_stProj->d_stSubProject[lIndex], TRUE );
free (_p_stProj->d_stSubProject );
_p_stProj->d_stSubProject = NULL;
_p_stProj->lNumberOfSubProjects = 0;
}
/* free project */
if (_bDelete)
free ( _p_stProj->szName );
}
/*
---------------------------------------------------------------------------------------
free a project information tree
---------------------------------------------------------------------------------------
*/
void fn_Tree_vFreeProjectTree( tdstProject *_p_stProj, BOOL _bDelete )
{
fn_Tree_vFreeProject( _p_stProj, _bDelete );
if (_bDelete)
{
free ( _p_stProj );
_p_stProj = NULL;
}
}
/*
----------------------------------------------------------------------------------------
Description : free list of file in a vss project structure
----------------------------------------------------------------------------------------
*/
void fn_Tree_vFreeProjectFileList( tdstProject *_p_stProj )
{
long lIndex;
if (_p_stProj->d_stFile)
{
for (lIndex = 0; lIndex < _p_stProj->lNumberOfFiles; lIndex ++)
free ( _p_stProj->d_stFile[lIndex].szName );
free (_p_stProj->d_stFile );
_p_stProj->d_stFile = NULL;
_p_stProj->lNumberOfFiles = 0;
}
}
/*
---------------------------------------------------------------------------------------
set all vss project to not obtain
---------------------------------------------------------------------------------------
*/
void fn_Tree_vGetNothing( tdstProject *_p_stProj)
{
long lSubProj;
long lFile = 0;
tdstFile *p_stFile = _p_stProj->d_stFile;
/*
* dont obtain current project
*/
_p_stProj->bGet = FALSE;
_p_stProj->bRecurse = FALSE;
/*
* dont obtain files
*/
for (; lFile < _p_stProj->lNumberOfFiles; lFile++, p_stFile ++)
{
p_stFile->bGet = FALSE;
}
/*
* dont obtain sub project
*/
for (lSubProj = 0; lSubProj < _p_stProj->lNumberOfSubProjects; lSubProj ++)
fn_Tree_vGetNothing( &_p_stProj->d_stSubProject[lSubProj] );
}
/*
---------------------------------------------------------------------------------------
refresh obtaining state for vss tree
---------------------------------------------------------------------------------------
*/
void fn_Tree_vRefreshWithFileList( tdstProject *_p_stProj, tdstFileListConfig *_p_stFileList )
{
int iFile;
char *szFileName;
tdstProject *p_stSubProj;
tdstFile *p_stFile;
BOOL bRecurse;
BOOL bFile;
fn_Tree_vGetNothing( _p_stProj );
for (iFile = 0; iFile < _p_stFileList->lNumberOfFiles; iFile ++)
{
szFileName = _p_stFileList->d_szFile[iFile];
if (*szFileName == '-')
{
switch( *(szFileName + 1) )
{
case 'R':
bRecurse = TRUE;
bFile = FALSE;
break;
case 'P':
bRecurse = FALSE;
bFile = FALSE;
break;
default:
bRecurse = FALSE;
bFile = FALSE;
}
szFileName += 3;
}
else
{
bRecurse = FALSE;
bFile = TRUE;
}
if (bFile)
{
if ( (p_stFile = fn_Tree_p_stGetFile( _p_stProj, szFileName ) ) != NULL)
p_stFile->bGet = TRUE;
}
else
{
if ( (p_stSubProj = fn_Tree_p_stGetProject( _p_stProj, szFileName ) ) != NULL)
{
p_stSubProj->bGet = TRUE;
p_stSubProj->bRecurse = bRecurse;
}
}
}
}
/*
---------------------------------------------------------------------------------------
count recursively number of file to get all folder name the user want to obtain
---------------------------------------------------------------------------------------
*/
void fn_Tree_vGetNumberOfFilesOrProjectsToGet( tdstProject *_p_stProj, long *_p_lNbFiles )
{
long lSubProj;
long lFile;
tdstFile *p_stFile;
if (_p_stProj->bGet)
{
(*_p_lNbFiles)++;
if (_p_stProj->bRecurse)
return;
}
else
{
for (lFile = 0, p_stFile = _p_stProj->d_stFile; lFile < _p_stProj->lNumberOfFiles; lFile++, p_stFile++ )
if (p_stFile->bGet)
(*_p_lNbFiles) ++;
}
for (lSubProj = 0; lSubProj < _p_stProj->lNumberOfSubProjects; lSubProj ++)
fn_Tree_vGetNumberOfFilesOrProjectsToGet( &_p_stProj->d_stSubProject[lSubProj], _p_lNbFiles );
}
/*
---------------------------------------------------------------------------------------
write recursively file to obtain in given array of string
---------------------------------------------------------------------------------------
*/
void fn_Tree_vGetFilesOrProjectToGet( tdstProject *_p_stProj, long *_p_lNbFiles, char **_d_szFile )
{
long lSubProj;
long lFile;
tdstFile *p_stFile;
if (_p_stProj->bGet)
{
strcpy ( _d_szFile[ *_p_lNbFiles ], (_p_stProj->bRecurse)?"-R ":"-P");
strcat( _d_szFile[ (*_p_lNbFiles)++ ], g_szFullName );
if (_p_stProj->bRecurse)
return;
}
else
{
for (lFile = 0, p_stFile = _p_stProj->d_stFile; lFile < _p_stProj->lNumberOfFiles; lFile++, p_stFile++ )
if (p_stFile->bGet)
sprintf(_d_szFile[ (*_p_lNbFiles)++ ], "%s\\%s", g_szFullName, p_stFile->szName );
}
for (lSubProj = 0; lSubProj < _p_stProj->lNumberOfSubProjects; lSubProj ++)
{
strcat( g_szFullName, "\\");
strcat( g_szFullName, _p_stProj->d_stSubProject[lSubProj].szName );
fn_Tree_vGetFilesOrProjectToGet( &_p_stProj->d_stSubProject[lSubProj], _p_lNbFiles, _d_szFile );
*strrchr( g_szFullName, '\\' ) = 0;
}
}
/*
---------------------------------------------------------------------------------------
count recursively all files to obtain (not project)
---------------------------------------------------------------------------------------
*/
void fn_Tree_vGetNumberOfFilesToGet( tdstProject *_p_stProj, long *_p_lNbFiles, BOOL _bAll )
{
long lFile = 0;
tdstProject *p_stSubProj = _p_stProj->d_stSubProject;
tdstFile *p_stFile = _p_stProj->d_stFile;
/*
* add number of obtained file in current project
*/
if (_p_stProj->bGet || _bAll)
(*_p_lNbFiles) += _p_stProj->lNumberOfFiles;
else
{
for ( ; lFile < _p_stProj->lNumberOfFiles; p_stFile++, lFile++ )
if (p_stFile->bGet)
(*_p_lNbFiles)++;
}
/*
* call recursively function for each sub project
*/
for (lFile = 0; lFile < _p_stProj->lNumberOfSubProjects; lFile++, p_stSubProj++)
{
fn_Tree_vGetNumberOfFilesToGet( p_stSubProj, _p_lNbFiles, (_p_stProj->bRecurse) || _bAll );
}
}
/*
---------------------------------------------------------------------------------------
write recursively file to obtain (no project) in given array of string
---------------------------------------------------------------------------------------
*/
void fn_Tree_vGetFilesToGet( tdstProject *_p_stProj, long *_p_lNbFiles, char **_d_szFile, BOOL _bAll )
{
long lFile = 0;
tdstProject *p_stSubProj = _p_stProj->d_stSubProject;
tdstFile *p_stFile = _p_stProj->d_stFile;
for ( ; lFile < _p_stProj->lNumberOfFiles; lFile++, p_stFile ++)
{
if ( _bAll || (_p_stProj->bGet) || (p_stFile->bGet) )
sprintf( _d_szFile[ (*_p_lNbFiles)++ ], "%s\\%s", g_szFullName, p_stFile->szName );
}
for (lFile = 0; lFile < _p_stProj->lNumberOfSubProjects; lFile ++, p_stSubProj++)
{
strcat( g_szFullName, "\\");
strcat( g_szFullName, p_stSubProj->szName );
fn_Tree_vGetFilesToGet( p_stSubProj, _p_lNbFiles, _d_szFile, _bAll || _p_stProj->bRecurse );
*strrchr( g_szFullName, '\\' ) = 0;
}
}
/*
----------------------------------------------------------------------------------------
Description : build list of files to get
_p_stProj -> project to look in
**_ppp_szFile -> pointer on a list that will be filled
Returns (long ) number of files in list
----------------------------------------------------------------------------------------
*/
long fn_Tree_lBuildListOfFilesToGet( tdstProject *_p_stProj, char ***_ppp_szFile )
{
long lNbFiles, lFile;
lNbFiles = 0;
fn_Tree_vGetNumberOfFilesToGet( _p_stProj, &lNbFiles, FALSE );
if (lNbFiles == 0)
return 0;
*_ppp_szFile = (char **) malloc (lNbFiles * sizeof ( char *) );
for (lFile = 0; lFile < lNbFiles; lFile ++)
(*_ppp_szFile)[lFile] = (char *) malloc ( MAX_PATH );
strcpy (g_szFullName, _p_stProj->szName );
lNbFiles = 0;
fn_Tree_vGetFilesToGet( _p_stProj, &lNbFiles, *_ppp_szFile, FALSE );
return lNbFiles;
}
/*
----------------------------------------------------------------------------------------
Description : free a list of files previously build with fn_TREE_lBuildListOfFilesToGet
function
_lNumberOfFiles -> number of files in list
*_pp_szFile -> list of file
----------------------------------------------------------------------------------------
*/
void fn_Tree_vFreeListOfFilesToGet( long _lNumberOfFiles, char **_pp_szFile )
{
long lFile;
if (_lNumberOfFiles == 0)
return;
for (lFile = 0; lFile < _lNumberOfFiles; lFile ++)
free( _pp_szFile[lFile] );
free( _pp_szFile );
}
/*
---------------------------------------------------------------------------------------
dump a list in a file
---------------------------------------------------------------------------------------
*/
void fn_TREE_vDumpListInFile( char *szTitle, long lNbFiles, char **d_szFileName )
{
FILE *hpFile;
long lFile;
CTime oTime = GetCurrentTime();
hpFile = fopen( "filelst.txt", "at" );
if (hpFile == NULL)
return;
fprintf( hpFile, "*********** %s (%d files) **************\n", (char*)(LPCTSTR) (oTime.Format( "%d/%m/%y %H:%M:%S" )), lNbFiles );
fprintf( hpFile, "%s\n\n", szTitle );
for ( lFile = 0; lFile < lNbFiles; lFile ++)
{
fprintf( hpFile, "%s\n", d_szFileName[ lFile ] );
}
fclose( hpFile );
}
/*
---------------------------------------------------------------------------------------
set new list of file from analysis of vss tree obtaining state
---------------------------------------------------------------------------------------
*/
BOOL fn_TREE_bGetFileList( tdstProject *_p_stProj, tdstFileListConfig *_p_stFileList, char _cConfig, char *_szFileListName )
{
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
char szFileListId[20];
long lNbFiles;
char **d_szFile;
long lFile;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
sprintf(szFileListId, "FileList-Config%02d", _cConfig);
lNbFiles = 0;
fn_Tree_vGetNumberOfFilesOrProjectsToGet( _p_stProj, &lNbFiles );
if (lNbFiles == 0)
return FALSE;
d_szFile = (char **) malloc (lNbFiles * sizeof ( char *) );
for (lFile = 0; lFile < lNbFiles; lFile ++)
d_szFile[lFile] = (char *) malloc ( MAX_PATH );
strcpy (g_szFullName, _p_stProj->szName );
lNbFiles = 0;
fn_Tree_vGetFilesOrProjectToGet( _p_stProj, &lNbFiles, d_szFile );
fn_IniD_vFreeFileList( _p_stFileList );
strcpy( _p_stFileList->szId, szFileListId );
strcpy( _p_stFileList->szName, _szFileListName );
_p_stFileList->lNumberOfFiles = lNbFiles;
_p_stFileList->d_szFile = d_szFile;
//fn_vUpdateFilesToObtainList();
return TRUE;
}
/*
=======================================================================================
Function for local tree
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : fill project with local content
_p_stProject -> project to fill
_szEndName -> end of current path which is a global var )
----------------------------------------------------------------------------------------
*/
void fn_Tree_vFillProjectFromDisk( tdstProject *_p_stProject, char *_szEndName )
{
long lNbFiles = 0;
long lNbProjs = 0;
tdstProject *p_stSubProj;
WIN32_FIND_DATA stFindData;
HANDLE hFind;
if (g_hProjectWindow != NULL)
SetWindowText( g_hProjectWindow, _p_stProject->szName );
strcpy( _szEndName, "*.*" );
hFind = FindFirstFile(g_szFullName, &stFindData );
*_szEndName = 0;
if( hFind != INVALID_HANDLE_VALUE)
{
do
{
if ( stFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
{
if ( *stFindData.cFileName != '.')
{
gs_d_szProj[ lNbProjs ] = (char *) malloc( strlen(stFindData.cFileName) + 1 );
strcpy ( gs_d_szProj[ lNbProjs ], stFindData.cFileName );
lNbProjs++;
}
}
else
{
gs_d_szFile[ lNbFiles ] = (char *) malloc( strlen(stFindData.cFileName) + 1 );
strcpy ( gs_d_szFile[ lNbFiles ], stFindData.cFileName );
lNbFiles++;
}
} while(FindNextFile( hFind, &stFindData ));
FindClose( hFind );
}
/*
* allocate memory for all files and all sub projects
*/
if (lNbProjs)
{
_p_stProject->lNumberOfSubProjects = lNbProjs;
_p_stProject->d_stSubProject = (tdstProject *) malloc ( lNbProjs * sizeof( tdstProject) );
for (lNbProjs = 0; lNbProjs < _p_stProject->lNumberOfSubProjects; lNbProjs ++)
fn_Tree_vInitProjectWithPointerName( &_p_stProject->d_stSubProject[ lNbProjs ], gs_d_szProj[lNbProjs] );
}
if ( lNbFiles )
{
if (lNbFiles > 2048)
AfxMessageBox( "more than 2048 files in a folder\r\nthere will soon be a big bug !!!\r\nContact me .\r\n", MB_ICONSTOP | MB_OK);
_p_stProject->lNumberOfFiles = lNbFiles;
_p_stProject->d_stFile = (tdstFile *) malloc ( lNbFiles * sizeof( tdstFile) );
for (lNbFiles = 0; lNbFiles < _p_stProject->lNumberOfFiles; lNbFiles ++)
{
fn_Tree_vInitFileWithPointerName( &_p_stProject->d_stFile[ lNbFiles ], gs_d_szFile[ lNbFiles ] );
fn_Tree_vAddFileTypeFromFile( gs_d_szFile[ lNbFiles ] );
}
}
/*
* construct sub project tree
*/
for (p_stSubProj = _p_stProject->d_stSubProject, lNbProjs = 0; lNbProjs < _p_stProject->lNumberOfSubProjects; lNbProjs ++, p_stSubProj++)
{
lNbFiles = sprintf( _szEndName, "%s\\", p_stSubProj->szName );
fn_Tree_vFillProjectFromDisk( p_stSubProj, _szEndName + lNbFiles );
*_szEndName = 0;
}
}
/*
----------------------------------------------------------------------------------------
Description : build local tree
_p_stRootProject -> project to fill (correspond to root project)
_szRootName -> project name (root)
Returns (BOOL ) TRUE if tree has been build, otherwise FALSE
----------------------------------------------------------------------------------------
*/
BOOL fn_Tree_bBuildFromDisk( tdstProject **_pp_stRootProject, char *_szRootName, HWND _hProjectWindow )
{
/*
* check existance of root project
*/
if (_access( _szRootName, 0) != 0 )
return FALSE;
if (*_pp_stRootProject != NULL)
fn_Tree_vFreeProjectTree(*_pp_stRootProject, TRUE );
fn_Tree_vFreeFileTypeList();
g_hProjectWindow = _hProjectWindow;
/*
* create and initialize root project
*/
*_pp_stRootProject = (tdstProject *) malloc( sizeof (tdstProject) );
fn_Tree_vInitProject( *_pp_stRootProject, _szRootName );
// allocate memory for name storage
gs_d_szFile = (char **) malloc ( 2048 * sizeof( char *) );
gs_d_szProj = (char **) malloc ( 2048 * sizeof( char *) );
// get recursively and from root project vss tree
sprintf( g_szFullName, "%s\\", _szRootName );
fn_Tree_vFillProjectFromDisk( *_pp_stRootProject, g_szFullName + strlen( g_szFullName) );
free( gs_d_szFile );
free( gs_d_szProj );
return TRUE;
}