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,26 @@
*************************************************
* Version Manager *
*************************************************
Nom de l'executable : VersMngr.exe
Cet utilitaire permet de r<>cup<75>rer les versions
de sauvegarde de s<>curit<69> cr<63><72>es par les <20>diteurs.
Ces versions de sauvegardes se trouvent dans des
r<EFBFBD>pertoires GameData.XXX (avec XXX num<75>ro de version)
plac<EFBFBD>s au m<>me niveau que le r<>pertoire GameData.
L'utilitaire doit <20>tre lanc<6E> <20> partir du r<>pertoire
contenant ces r<>pertoires de sauvegarde. i.e. <20> l'endroit
ou se trouve l'<27>x<EFBFBD>cutable des <20>diteurs.
Il affiche la liste des versions trouv<75>es sur le disque
dans le r<>pertoire de lancement. Pour r<>cup<75>rer une version
il suffit de la s<>lectionner dans la liste et de cliquer
sur le bouton Restore.
Pour tout probl<62>me contacter
Vincent Lhullier
04-50-52-90-84
vlhullier@annecy.ubisoft.fr

View File

@@ -0,0 +1,467 @@
/*
=======================================================================================
Name :SaveMngr.cpp
Author :Vincent Lhullier Date :11/07/97
Description :manage save of data before modification
Create a copy of GameData tree with all file that would be modified. That will allow
someone to recuperate previous version if save generate some problem in data.
=======================================================================================
Modification -> Author : Date :
Description :
=======================================================================================
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#include "stdafx.h"
#include <io.h>
#include <sys/stat.h>
#include "SaveMngr.h"
//#include "acp_base.h"
//#include "itf/CPAProj.hpp"
//#include "DPT.h"
//#include "SCR.h"
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*
=======================================================================================
GLOBALS
=======================================================================================
*/
static char SAVE_g_szDirName[ _MAX_PATH ];
static char SAVE_g_szTargetDirName[ _MAX_PATH ];
/*
=======================================================================================
=======================================================================================
FUNCTIONS
=======================================================================================
=======================================================================================
*/
char *fn_szGetGameDataPath( void )
{
return "GameData";
}
/*
=======================================================================================
Directory Functions
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Don't call this function directly, it is used by SAVE_fn_bDeleteTree
Description : delete recursively a directory
Returns (BOOL ) true if success
----------------------------------------------------------------------------------------
*/
BOOL fn_bDeleteTree( void )
{
WIN32_FIND_DATA stFindData;
HANDLE hFind;
char *p_szEndDirName;
p_szEndDirName = SAVE_g_szDirName + strlen( SAVE_g_szDirName );
strcpy( p_szEndDirName, "\\*.*" );
if( (hFind = FindFirstFile(SAVE_g_szDirName, &stFindData )) == INVALID_HANDLE_VALUE)
return TRUE;
*p_szEndDirName = 0;
do
{
*p_szEndDirName = '\\';
strcpy( p_szEndDirName + 1, stFindData.cFileName );
if ( stFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
{
if ( *stFindData.cFileName != '.')
{
if ( !fn_bDeleteTree() )
return FALSE;
}
}
else
{
if (_access( SAVE_g_szDirName, 2) == -1 )
_chmod( SAVE_g_szDirName, _S_IWRITE );
if ( !DeleteFile( SAVE_g_szDirName ) )
return FALSE;
}
*p_szEndDirName = 0;
} while(FindNextFile( hFind, &stFindData ));
FindClose( hFind );
return RemoveDirectory( SAVE_g_szDirName );
}
/*
----------------------------------------------------------------------------------------
Description : delete completely a directory
szDirName -> name of dir to delete
Returns (BOOL ) true if success
----------------------------------------------------------------------------------------
*/
BOOL SAVE_fn_bDeleteTree( char *szDirName )
{
strcpy( SAVE_g_szDirName, szDirName );
return fn_bDeleteTree();
}
/*
----------------------------------------------------------------------------------------
Description : create a directory
szDirName -> name of directory
Returns (BOOL ) true if sucess
----------------------------------------------------------------------------------------
*/
BOOL SAVE_fn_bCreateDirectory( char *szDirName )
{
if ( (!CreateDirectory( szDirName, NULL )) && (GetLastError() != ERROR_ALREADY_EXISTS) )
{
char *p_szCur;
p_szCur = strchr( szDirName, '\\');
while (p_szCur != NULL)
{
*p_szCur = 0;
if ((!CreateDirectory (szDirName, NULL)) && (GetLastError() != ERROR_ALREADY_EXISTS) )
{
char szMessage[ 512 ];
sprintf( szMessage, "Can't create local path %s", szDirName );
SAVE_fn_vErrorMessage( szMessage );
return FALSE;
}
*p_szCur++ = '\\';
p_szCur = strchr( p_szCur, '\\');
};
if ((!CreateDirectory (szDirName, NULL)) && (GetLastError() != ERROR_ALREADY_EXISTS) )
{
char szMessage[ 512 ];
sprintf( szMessage, "Can't create local path %s", szDirName );
SAVE_fn_vErrorMessage( szMessage );
return FALSE;
}
}
return TRUE;
}
/*
----------------------------------------------------------------------------------------
Description : move directory (source and target dir names are stored in global var
SAVE_g_szDirName and SAVE_g_szTargetDirName )
Returns (BOOL ) true if success
----------------------------------------------------------------------------------------
*/
BOOL fn_bMoveDirectory( void )
{
WIN32_FIND_DATA stFindData;
HANDLE hFind;
char *p_szEndSource;
char *p_szEndTarget;
if ( _access( SAVE_g_szTargetDirName, 0) != 0)
return MoveFile( SAVE_g_szDirName , SAVE_g_szTargetDirName );
p_szEndSource = SAVE_g_szDirName + strlen( SAVE_g_szDirName );
p_szEndTarget = SAVE_g_szTargetDirName + strlen( SAVE_g_szTargetDirName );
strcpy( p_szEndSource, "\\*.*" );
if( (hFind = FindFirstFile(SAVE_g_szDirName, &stFindData )) == INVALID_HANDLE_VALUE)
return TRUE;
*p_szEndSource = 0;
do
{
*p_szEndTarget = *p_szEndSource = '\\';
strcpy( p_szEndSource + 1, stFindData.cFileName );
strcpy( p_szEndTarget + 1, stFindData.cFileName );
if ( stFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
{
if ( *stFindData.cFileName != '.')
{
if ( !fn_bMoveDirectory() )
return FALSE;
}
}
else
{
if (_access( SAVE_g_szTargetDirName, 0) == 0)
{
if (_access( SAVE_g_szTargetDirName, 2) == -1 )
_chmod( SAVE_g_szTargetDirName, _S_IWRITE );
if ( !DeleteFile( SAVE_g_szTargetDirName ) )
return FALSE;
}
if ( !MoveFile( SAVE_g_szDirName, SAVE_g_szTargetDirName ) )
return FALSE;
}
*p_szEndSource = *p_szEndTarget = 0;
} while(FindNextFile( hFind, &stFindData ));
FindClose( hFind );
return RemoveDirectory( SAVE_g_szDirName );
}
/*
----------------------------------------------------------------------------------------
Description : move a directory into another one
szSourceDir -> source directory
szTargetDir -> target directory
Returns (BOOL ) true if success
----------------------------------------------------------------------------------------
*/
BOOL SAVE_fn_bMoveDirectory( char *szSourceDir, char *szTargetDir )
{
strcpy( SAVE_g_szTargetDirName, szTargetDir );
strcpy( SAVE_g_szDirName, szSourceDir );
return fn_bMoveDirectory();
}
/*
=======================================================================================
Error functions
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : display an error message
_szMessage -> message to display
----------------------------------------------------------------------------------------
*/
void SAVE_fn_vErrorMessage( char *_szMessage )
{
char szError[1024];
char *p_szError = szError;
p_szError += sprintf( p_szError, "Error saving current version before saving new data\n" );
p_szError += sprintf( p_szError, "You will not be able to get local previous version\n" );
p_szError += sprintf( p_szError, "---------------------------------------------------\n" );
p_szError += sprintf( p_szError, "%s\n\n", _szMessage );
p_szError += sprintf( p_szError, " Save anyway ?" );
//SAVE_g_bContinue = AfxMessageBox( szError, MB_ICONSTOP | MB_YESNO );
}
/*
=======================================================================================
Version functions
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description :
_szSavedDirectoryName -> name of directory from which function extract version number
Returns (long ) version number if it's a valid directory, -1 else
----------------------------------------------------------------------------------------
*/
long SAVE_fn_lGetVersionNumberFromDirExt( char *_szSavedDirectoryName )
{
char *p_szExt;
long lVersionNumber = -1;
p_szExt = strchr( _szSavedDirectoryName, '.' );
if (p_szExt != NULL)
{
if ( strlen( ++p_szExt ) == 3)
{
lVersionNumber = 0;
while (*p_szExt != 0)
{
if ( !isdigit (*p_szExt) )
return -1;
lVersionNumber = lVersionNumber * 10 + (*p_szExt++ - '0');
}
}
}
return lVersionNumber;
}
/*
----------------------------------------------------------------------------------------
Description : return name of directory used to store data for a given version
lVersion -> version number
szVersionDirName -> to put dir name (assumed to be long enough )
----------------------------------------------------------------------------------------
*/
void SAVE_fn_vGetVersionDirName( long _lVersion, char *_szVersionDirName )
{
sprintf( _szVersionDirName, "%s.%03d", fn_szGetGameDataPath(), _lVersion );
}
/*
----------------------------------------------------------------------------------------
Description : delete a version directory
_lVersion -> number of version
Returns (BOOL ) true if success
----------------------------------------------------------------------------------------
*/
BOOL SAVE_fn_bDeleteVersion( long _lVersion )
{
char szVersionName[ _MAX_PATH ];
SAVE_fn_vGetVersionDirName( _lVersion, szVersionName );
if (!SAVE_fn_bDeleteTree( szVersionName ))
{
char szMessage[100];
sprintf( szMessage, "Can't delete old %s version directory", szVersionName );
SAVE_fn_vErrorMessage( szMessage );
return FALSE;
}
return TRUE;
}
/*
----------------------------------------------------------------------------------------
Description : rename a version
_lOldVersion -> old version number
_lNewVersion -> new version number
Returns (BOOL )
----------------------------------------------------------------------------------------
*/
BOOL SAVE_fn_bRenameVersion( long _lOldVersion, long _lNewVersion )
{
char szOldVersion[ _MAX_PATH ];
char szNewVersion[ _MAX_PATH ];
SAVE_fn_vGetVersionDirName( _lOldVersion, szOldVersion );
SAVE_fn_vGetVersionDirName( _lNewVersion, szNewVersion );
if ( !MoveFile( szOldVersion, szNewVersion) )
{
char szMessage[100];
sprintf( szMessage, "Can't rename old %s version to new version %s ", szOldVersion, szNewVersion );
SAVE_fn_vErrorMessage( szMessage );
return FALSE;
}
return TRUE;
}
/*
----------------------------------------------------------------------------------------
Description : analyse the current version that are on disk
a_cVersion -> array of 1000 char that will be filled
each case is a flag that indicate if a version number is used or not
return (long) number of used version
----------------------------------------------------------------------------------------
*/
long SAVE_fn_lGetUsedVersion( char *a_cVersion, SYSTEMTIME *a_stTime )
{
WIN32_FIND_DATA stFindData;
HANDLE hFind;
char szFilter[ _MAX_PATH ];
long lNumberOfVersions = 0;
long lVersion;
FILETIME stLocalFileTime;
/*
* set all version as unused
*/
memset ( a_cVersion , 0, 1000 );
sprintf( szFilter, "%s.*", fn_szGetGameDataPath() );
if( (hFind = FindFirstFile(szFilter, &stFindData )) == INVALID_HANDLE_VALUE)
return 0;
do
{
if ( stFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
{
lVersion = SAVE_fn_lGetVersionNumberFromDirExt( stFindData.cFileName );
if (lVersion != -1)
{
a_cVersion[ lVersion ] = 1;
if (a_stTime != NULL)
{
FileTimeToLocalFileTime( &stFindData.ftCreationTime, &stLocalFileTime );
FileTimeToSystemTime( &stLocalFileTime, &a_stTime[ lVersion ] );
}
lNumberOfVersions++ ;
}
}
} while(FindNextFile( hFind, &stFindData ));
FindClose( hFind );
return lNumberOfVersions;
}
/*
----------------------------------------------------------------------------------------
Description : analyse the current version that are on disk
----------------------------------------------------------------------------------------
*/
long SAVE_fn_lAnalyseCurrentUsedVersion( char *a_cVersion, SYSTEMTIME *a_stTime )
{
long lNumberOfVersions;
long lVersion;
long lVersionIndex;
long lLastUnusedVersion = -1;
/*
* get used versions
*/
lNumberOfVersions = SAVE_fn_lGetUsedVersion( a_cVersion, a_stTime );
if (lNumberOfVersions == 0)
return 0;
/*
* check for hole in version number
*/
lVersion = 0;
for (lVersionIndex = 0; lVersion < lNumberOfVersions; lVersionIndex ++)
{
if (a_cVersion[ lVersionIndex ])
lVersion ++;
else
lLastUnusedVersion = lVersionIndex;
}
if (lLastUnusedVersion == -1)
return lNumberOfVersions;
for (lVersionIndex = 0; lVersionIndex < lLastUnusedVersion; lVersionIndex++)
{
if (a_cVersion[ lVersionIndex ])
{
if (!SAVE_fn_bDeleteVersion( lVersionIndex ))
return 0;
}
}
lVersion = 0;
for (lVersionIndex = lLastUnusedVersion + 1; a_cVersion[ lVersionIndex ]; lVersionIndex ++)
{
if (!SAVE_fn_bRenameVersion( lVersionIndex, lVersion ))
return 0;
a_cVersion[lVersion] = 1;
if (a_stTime != NULL)
a_stTime[lVersion] = a_stTime[lVersionIndex];
lVersion ++;
}
return lVersion;
}

View File

@@ -0,0 +1,54 @@
/*
=======================================================================================
Name :SaveMngr.h
Author :Vincent Lhullier Date :11/07/97
Description :manage save of data before modification
Create a copy of GameData tree with all file that would be modified. That will allow
someone to recuperate previous version if save generate some problem in data.
=======================================================================================
Modification -> Author : Date :
Description :
=======================================================================================
*/
#ifndef __SAVEMNGR_H__
#define __SAVEMNGR_H__
/*
=======================================================================================
Directory Functions
=======================================================================================
*/
BOOL SAVE_fn_bDeleteTree( char *szDirName );
BOOL SAVE_fn_bCreateDirectory( char *szDirName );
BOOL SAVE_fn_bMoveDirectory( char *szSourceDir, char *szTargetDir );
/*
=======================================================================================
Error functions
=======================================================================================
*/
void SAVE_fn_vErrorMessage( char *_szMessage );
/*
=======================================================================================
Version functions
=======================================================================================
*/
long SAVE_fn_lGetVersionNumberFromDirExt( char *_szSavedDirectoryName );
void SAVE_fn_vGetVersionDirName( long _lVersion, char *_szVersionDirName );
BOOL SAVE_fn_bDeleteVersion( long _lVersion );
BOOL SAVE_fn_bRenameVersion( long _lOldVersion, long _lNewVersion );
long SAVE_fn_lGetUsedVersion( char *a_cVersion, SYSTEMTIME *a_stTime = NULL );
long SAVE_fn_lAnalyseCurrentUsedVersion( char *a_cVersion, SYSTEMTIME *a_stTime = NULL );
#endif /*__SAVEMNGR_H__*/

View File

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

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__71CD33CB_FD57_11D0_B656_991CBF4ECB25__INCLUDED_)
#define AFX_STDAFX_H__71CD33CB_FD57_11D0_B656_991CBF4ECB25__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__71CD33CB_FD57_11D0_B656_991CBF4ECB25__INCLUDED_)

View File

@@ -0,0 +1,61 @@
// VersMngr.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "VersMngr.h"
#include "VersMngrDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CVersMngrApp
BEGIN_MESSAGE_MAP(CVersMngrApp, CWinApp)
//{{AFX_MSG_MAP(CVersMngrApp)
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CVersMngrApp construction
CVersMngrApp::CVersMngrApp()
{
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CVersMngrApp object
CVersMngrApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CVersMngrApp initialization
BOOL CVersMngrApp::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
CVersMngrDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}

View File

@@ -0,0 +1,177 @@
# Microsoft Developer Studio Project File - Name="VersMngr" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=VersMngr - 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 "VersMngr.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 "VersMngr.mak" CFG="VersMngr - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "VersMngr - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "VersMngr - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""$/CPA_Func/Appli/VersMngr", KOJAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "VersMngr - Win32 Release"
# PROP BASE Use_MFC 5
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 5
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /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"
# ADD RSC /l 0x40c /d "NDEBUG"
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)" == "VersMngr - Win32 Debug"
# PROP BASE Use_MFC 5
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 5
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu"stdafx.h" /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"
# ADD RSC /l 0x40c /d "_DEBUG"
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:"VersMngr.exe" /pdbtype:sept
!ENDIF
# Begin Target
# Name "VersMngr - Win32 Release"
# Name "VersMngr - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\SaveMngr.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# Begin Source File
SOURCE=.\VersMngr.cpp
# End Source File
# Begin Source File
SOURCE=.\VersMngr.rc
!IF "$(CFG)" == "VersMngr - Win32 Release"
!ELSEIF "$(CFG)" == "VersMngr - Win32 Debug"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\VersMngrDlg.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\SaveMngr.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# Begin Source File
SOURCE=.\VersMngr.h
# End Source File
# Begin Source File
SOURCE=.\VersMngrDlg.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=.\res\nothing.bmp
# End Source File
# Begin Source File
SOURCE=.\res\suzy.bmp
# End Source File
# Begin Source File
SOURCE=.\res\VersMngr.ico
# End Source File
# Begin Source File
SOURCE=.\res\VersMngr.rc2
# End Source File
# End Group
# Begin Group "Exe Files"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\Readme.txt
# End Source File
# Begin Source File
SOURCE=.\VersMngr.exe
# End Source File
# End Group
# End Target
# End Project

View File

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

View File

@@ -0,0 +1,184 @@
//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
/////////////////////////////////////////////////////////////////////////////
// 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
#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_FRA)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 12, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif\r\n"
"#include ""res\\VersMngr.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""l.fra\\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\\VersMngr.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_VERSMNGR_DIALOG DIALOGEX 0, 0, 241, 186
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Security Version Manager"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "Close",IDOK,115,165,50,14
LISTBOX IDC_LIST_VERSIONS,7,7,156,135,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Restore",IDC_BUTTON_RESTORE,7,165,50,14
CONTROL 129,IDC_STATIC,"Static",SS_BITMAP,167,7,67,172
CONTROL 130,IDC_PICTURE_NOTHING,"Static",SS_BITMAP,33,27,100,92
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 "040C04B0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "Application MFC VersMngr\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "VersMngr\0"
VALUE "LegalCopyright", "Copyright (C) 1997\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "VersMngr.EXE\0"
VALUE "ProductName", "Application VersMngr\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Traduction", 0x40c, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_VERSMNGR_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 234
TOPMARGIN, 7
BOTTOMMARGIN, 179
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_BITMAP_SUZY BITMAP DISCARDABLE "res\\suzy.bmp"
IDB_BITMAP_NOTHING BITMAP DISCARDABLE "res\\nothing.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_FRA)
#ifdef _WIN32
LANGUAGE 12, 1
#pragma code_page(1252)
#endif
#include "res\VersMngr.rc2" // non-Microsoft Visual C++ edited resources
#include "l.fra\afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,292 @@
/*
=======================================================================================
Name :VersMngrDlg.cpp
Author :Vincent Lhullier Date :16/07/97
Description :dialog box to restore old security saved version
=======================================================================================
Modification -> Author : Date :
Description :
=======================================================================================
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#include "stdafx.h"
#include "VersMngr.h"
#include "VersMngrDlg.h"
#include "SaveMngr.h"
#include <io.h>
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*
=======================================================================================
CVersMngrDlg dialog
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : constructor
pParent -> Parent window
----------------------------------------------------------------------------------------
*/
CVersMngrDlg::CVersMngrDlg(CWnd* pParent) : CDialog(CVersMngrDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CVersMngrDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
/*
----------------------------------------------------------------------------------------
Description : Data exchange
----------------------------------------------------------------------------------------
*/
void CVersMngrDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CVersMngrDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
/*
----------------------------------------------------------------------------------------
Description : Message map
----------------------------------------------------------------------------------------
*/
BEGIN_MESSAGE_MAP(CVersMngrDlg, CDialog)
//{{AFX_MSG_MAP(CVersMngrDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON_RESTORE, OnButtonRestore)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/*
=======================================================================================
CVersMngrDlg message handlers
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : WM_INITDIALOG
----------------------------------------------------------------------------------------
*/
BOOL CVersMngrDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
/*
* Init version list
*/
m_fn_vRefreshVersionList();
return TRUE; // return TRUE unless you set the focus to a control
}
/*
----------------------------------------------------------------------------------------
Description : WM_PAINT
----------------------------------------------------------------------------------------
*/
void CVersMngrDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
/*
----------------------------------------------------------------------------------------
Description : WM_QUERYDRAGICON
----------------------------------------------------------------------------------------
*/
HCURSOR CVersMngrDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
/*
----------------------------------------------------------------------------------------
Description : BN_CLICKED on IDC_BUTTON_RESTORE
----------------------------------------------------------------------------------------
*/
void CVersMngrDlg::OnButtonRestore()
{
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
CListBox *p_oLB = (CListBox *) GetDlgItem( IDC_LIST_VERSIONS );
long lIndex = p_oLB->GetCurSel();
long lCount = p_oLB->GetCount();
long lVersion;
char szGameData[_MAX_PATH];
char szVersionDir[_MAX_PATH];
char szFileName[ _MAX_PATH ], *p_szEndFileName, *p_szEnd;
FILE *hpDelFile;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
if (lIndex != LB_ERR)
{
strcpy( szGameData, "GameData" );
for (lVersion = lCount - 1; lVersion >= lIndex; lVersion --)
{
SAVE_fn_vGetVersionDirName( lVersion, szVersionDir );
/*
* delete all files that was created in current version
*/
/*
p_szEndFileName = szFileName + sprintf( szFileName, "%s\\", szGameData );
strcpy( p_szEndFileName,"delete.lst" );
*/
sprintf(szFileName, "%s\\delete.lst", szVersionDir );
if ( _access( szFileName, 0) == 0)
{
if ( (hpDelFile = fopen( szFileName, "rt" )) != NULL)
{
p_szEndFileName = szFileName + sprintf( szFileName, "%s\\", szGameData );
while (fgets(p_szEndFileName, MAX_PATH, hpDelFile) != NULL)
{
if ((p_szEnd = strrchr( p_szEndFileName, '\n')) != NULL)
*p_szEnd = 0;
if ((p_szEnd = strrchr( p_szEndFileName, '\r')) != NULL)
*p_szEnd = 0;
DeleteFile( szFileName );
}
fclose (hpDelFile );
}
sprintf(szFileName, "%s\\delete.lst", szVersionDir );
DeleteFile ( szFileName );
}
/*
* watch if modiflst.txt exist in Gamedata dir and not in version dir
*/
/*
if (lVersion == lIndex)
{
char szModifFileName[ _MAX_PATH ];
/*
* check if modiflst.txt doesn't exist in version dir
*/
/*
sprintf( szModifFileName, "%s\\modiflst.txt", szVersionDir );
if (_access( szModifFileName, 0) != 0)
{
sprintf( szModifFileName, "%s\\modiflst.txt", szGameData );
if (_access( szModifFileName, 0) == 0)
{
DeleteFile( szModifFileName );
}
}
}
*/
if ( !SAVE_fn_bMoveDirectory( szVersionDir, szGameData ) )
{
LPVOID lpMsgBuf;
FormatMessage
(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
MessageBox( (char *) lpMsgBuf, "GetLastError", MB_OK|MB_ICONINFORMATION );
LocalFree( lpMsgBuf );
}
}
}
m_fn_vRefreshVersionList();
}
/*
=======================================================================================
Specific functions
=======================================================================================
*/
/*
----------------------------------------------------------------------------------------
Description : fill list of versions
----------------------------------------------------------------------------------------
*/
void CVersMngrDlg::m_fn_vRefreshVersionList( void )
{
char a_cVersion[1000];
SYSTEMTIME a_stTime[1000];
long lNumberOfVersions;
long lVersion;
char szLine[ 256 ];
CListBox *p_oLB = (CListBox *) GetDlgItem (IDC_LIST_VERSIONS);
p_oLB->ResetContent();
lNumberOfVersions = SAVE_fn_lAnalyseCurrentUsedVersion( a_cVersion, a_stTime );
p_oLB->ShowWindow( lNumberOfVersions != 0 );
GetDlgItem( IDC_PICTURE_NOTHING)->ShowWindow( lNumberOfVersions == 0);
GetDlgItem( IDC_BUTTON_RESTORE)->EnableWindow( lNumberOfVersions != 0 );
for (lVersion = 0; lVersion < lNumberOfVersions; lVersion ++ )
{
sprintf
(
szLine,
"%03d -> %02d/%02d/%d %02d:%02d:%02d",
lVersion,
a_stTime[lVersion].wDay,
a_stTime[lVersion].wMonth,
a_stTime[lVersion].wYear,
a_stTime[lVersion].wHour,
a_stTime[lVersion].wMinute,
a_stTime[lVersion].wSecond
);
p_oLB->AddString( szLine );
}
p_oLB->SetCurSel( lNumberOfVersions - 1 );
}

View File

@@ -0,0 +1,51 @@
// VersMngrDlg.h : header file
//
#if !defined(AFX_VERSMNGRDLG_H__71CD33C9_FD57_11D0_B656_991CBF4ECB25__INCLUDED_)
#define AFX_VERSMNGRDLG_H__71CD33C9_FD57_11D0_B656_991CBF4ECB25__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
/////////////////////////////////////////////////////////////////////////////
// CVersMngrDlg dialog
class CVersMngrDlg : public CDialog
{
// Construction
public:
CVersMngrDlg(CWnd* pParent = NULL); // standard constructor
void m_fn_vRefreshVersionList( void );
// Dialog Data
//{{AFX_DATA(CVersMngrDlg)
enum { IDD = IDD_VERSMNGR_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CVersMngrDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CVersMngrDlg)
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnButtonRestore();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_VERSMNGRDLG_H__71CD33C9_FD57_11D0_B656_991CBF4ECB25__INCLUDED_)

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,13 @@
//
// VERSMNGR.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,22 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by VersMngr.rc
//
#define IDD_VERSMNGR_DIALOG 102
#define IDR_MAINFRAME 128
#define IDB_BITMAP_SUZY 129
#define IDB_BITMAP_NOTHING 130
#define IDC_LIST_VERSIONS 1000
#define IDC_BUTTON_RESTORE 1001
#define IDC_PICTURE_NOTHING 1002
// 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 1003
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif