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,61 @@
// CrapFile Maker.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "CrapFile Maker.h"
#include "CrapFile MakerDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCrapFileMakerApp
BEGIN_MESSAGE_MAP(CCrapFileMakerApp, CWinApp)
//{{AFX_MSG_MAP(CCrapFileMakerApp)
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCrapFileMakerApp construction
CCrapFileMakerApp::CCrapFileMakerApp()
{
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CCrapFileMakerApp object
CCrapFileMakerApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CCrapFileMakerApp initialization
BOOL CCrapFileMakerApp::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
CCrapFileMakerDlg 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,153 @@
# Microsoft Developer Studio Project File - Name="CrapFile Maker" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=CrapFile Maker - 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 "CrapFile Maker.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 "CrapFile Maker.mak" CFG="CrapFile Maker - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "CrapFile Maker - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "CrapFile Maker - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""$/cpa/Appli/ProtectTools/CrapFile Maker", NBPAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "CrapFile Maker - 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)" == "CrapFile Maker - 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 "Debug"
# PROP Intermediate_Dir "Debug"
# 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 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /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" /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 /pdbtype:sept
!ENDIF
# Begin Target
# Name "CrapFile Maker - Win32 Release"
# Name "CrapFile Maker - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=".\CrapFile Maker.cpp"
# End Source File
# Begin Source File
SOURCE=".\CrapFile Maker.rc"
# End Source File
# Begin Source File
SOURCE=".\CrapFile MakerDlg.cpp"
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=".\CrapFile Maker.h"
# End Source File
# Begin Source File
SOURCE=".\CrapFile MakerDlg.h"
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\res\Burns.bmp
# End Source File
# Begin Source File
SOURCE=".\res\CrapFile Maker.ico"
# End Source File
# Begin Source File
SOURCE=".\res\CrapFile Maker.rc2"
# End Source File
# Begin Source File
SOURCE=.\res\Dice.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon1.ico
# End Source File
# End Group
# End Target
# End Project

View File

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

View File

@@ -0,0 +1,17 @@
--------------------Configuration: CrapFile Maker - Win32 Debug--------------------
Begining build with project "D:\Workspaces\ProTools\CrapFile Maker\CrapFile Maker.dsp", at root.
Active configuration is Win32 (x86) Application (based on Win32 (x86) Application)
Project's tools are:
"32-bit C/C++ Compiler for 80x86" with flags "/nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Fp"Debug/CrapFile Maker.pch" /Yu"stdafx.h" /Fo"Debug/" /Fd"Debug/" /FD /c "
"OLE Type Library Maker" with flags "/nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 "
"Win32 Resource Compiler" with flags "/l 0x40c /fo"Debug/CrapFile Maker.res" /d "_DEBUG" /d "_AFXDLL" "
"Browser Database Maker" with flags "/nologo /o"Debug/CrapFile Maker.bsc" "
"COFF Linker for 80x86" with flags "/nologo /subsystem:windows /incremental:yes /pdb:"Debug/CrapFile Maker.pdb" /debug /machine:I386 /out:"Debug/CrapFile Maker.exe" /pdbtype:sept "
"Custom Build" with flags ""
"<Component 0xa>" with flags ""
CrapFile Maker.exe - 0 error(s), 0 warning(s)

View File

@@ -0,0 +1,239 @@
//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 CrapFile Maker"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "CrapFile Maker Version 3.1",IDC_STATIC,40,10,119,8,
SS_NOPREFIX
LTEXT "Copyright (C) 1998 - Marc Fascia",IDC_STATIC,40,25,119,
8
DEFPUSHBUTTON "OK",IDOK,178,7,32,14,WS_GROUP
END
IDD_CRAPFILEMAKER_DIALOG DIALOGEX 0, 0, 185, 124
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "CrapFile Maker"
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_SIZEFILE,7,18,115,14,ES_AUTOHSCROLL
EDITTEXT IDC_SEED,7,48,92,14,ES_AUTOHSCROLL
EDITTEXT IDC_FILE,7,78,148,14,ES_AUTOHSCROLL
DEFPUSHBUTTON "&Create",IDB_CREATE,128,103,50,14,0,WS_EX_STATICEDGE
PUSHBUTTON "Button1",IDB_DICE,104,48,18,14,BS_ICON | NOT WS_TABSTOP
PUSHBUTTON "Button1",IDB_FILESELECT,160,78,18,14,BS_ICON | NOT
WS_TABSTOP
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7,
103,115,14
PUSHBUTTON "",IDC_CREDITS,128,7,50,55,BS_BITMAP | BS_CENTER |
BS_VCENTER | BS_FLAT | NOT WS_TABSTOP,WS_EX_TRANSPARENT
LTEXT "Amount of Crap (in bytes)",IDC_STATIC,7,7,80,8
LTEXT "Seed",IDC_STATIC,7,37,18,8
LTEXT "File",IDC_STATIC,7,67,12,8
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,1,0,1
PRODUCTVERSION 3,1,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", "CrapFile Maker MFC Application\0"
VALUE "FileVersion", "3, 1, 0, 1\0"
VALUE "InternalName", "CrapFile Maker\0"
VALUE "LegalCopyright", "Copyright (C) 1998\0"
VALUE "OriginalFilename", "CrapFile Maker.EXE\0"
VALUE "ProductName", "CrapFile Maker Application\0"
VALUE "ProductVersion", "3, 1, 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_CRAPFILEMAKER_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 178
VERTGUIDE, 122
VERTGUIDE, 128
TOPMARGIN, 7
BOTTOMMARGIN, 117
HORZGUIDE, 62
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_ABOUTBOX "&About CrapFile Maker..."
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
#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\\CrapFile Maker.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\\CrapFile Maker.ico"
IDI_FILEOPEN ICON DISCARDABLE "res\\icon1.ico"
IDI_DICE ICON DISCARDABLE "res\\dice.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDBMP_IMAGE BITMAP DISCARDABLE "res\\Burns.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\CrapFile Maker.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,305 @@
// CrapFile MakerDlg.cpp : implementation file
//
#include "stdafx.h"
#include "CrapFile Maker.h"
#include "CrapFile MakerDlg.h"
#include <stdlib.h>
#include <math.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include <time.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCrapFileMakerDlg dialog
CCrapFileMakerDlg::CCrapFileMakerDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCrapFileMakerDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CCrapFileMakerDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
m_hFileIcon = AfxGetApp()->LoadIcon(IDI_FILEOPEN );
m_hDiceIcon = AfxGetApp()->LoadIcon(IDI_DICE );
m_bmAbout.LoadBitmap( IDBMP_IMAGE );
m_szFileName = "";
}
void CCrapFileMakerDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCrapFileMakerDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCrapFileMakerDlg, CDialog)
//{{AFX_MSG_MAP(CCrapFileMakerDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDB_CREATE, OnCreateFile)
ON_EN_CHANGE(IDC_FILE, OnChangeFile)
ON_BN_CLICKED(IDC_CREDITS, OnCredits)
ON_BN_CLICKED(IDB_FILESELECT, OnFileselect)
ON_BN_CLICKED(IDB_DICE, OnDice)
ON_EN_UPDATE(IDC_SEED, OnUpdateSeed)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCrapFileMakerDlg message handlers
BOOL CCrapFileMakerDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
((CButton *)GetDlgItem( IDB_FILESELECT ) )->SetIcon( m_hFileIcon );
((CButton *)GetDlgItem( IDB_DICE ) )->SetIcon( m_hDiceIcon );
((CButton *)GetDlgItem( IDC_CREDITS ))->SetBitmap( (HBITMAP) m_bmAbout );
OnDice();
return TRUE; // return TRUE unless you set the focus to a control
}
void CCrapFileMakerDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CCrapFileMakerDlg::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();
}
}
HCURSOR CCrapFileMakerDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CCrapFileMakerDlg::OnFileselect()
{
CFileDialog oFileDlg( TRUE );
oFileDlg.DoModal();
m_szFileName = oFileDlg.GetPathName();
GetDlgItem( IDC_FILE )->SetWindowText( m_szFileName );
}
void CCrapFileMakerDlg::OnChangeFile()
{
((CEdit*)GetDlgItem( IDC_FILE ))->GetWindowText( m_szFileName );
}
//--- Some Prime Numbers used as key generators
#define KEY_5 93179
#define KEY_6 212369
#define KEY_7 2735129
#define KEY_8 32452843
#define KEY_14 29996224274821
void CCrapFileMakerDlg::OnCreateFile()
{
FILE * pFile;
CProgressCtrl * pProgress;
char szSize[ 30 ];
long lSize, lCpt, lProgCpt;
unsigned char ucVal;
double dVal;
int iSeedDim;
CString szSeed;
//--- Init Random ---
srand( (int) m_iSeed );
((CEdit *)GetDlgItem(IDC_SEED))->GetWindowText(szSeed);
iSeedDim = szSeed.GetLength() + 1; //+1 for '#'
//--- Retrieve File Size ---
((CEdit *) GetDlgItem( IDC_SIZEFILE ))->GetWindowText( szSize, 30);
lSize = atoi( szSize ) - iSeedDim;
//--- Init progress bar ---
pProgress = ((CProgressCtrl *) GetDlgItem( IDC_PROGRESS ));
lProgCpt = (lSize / 1000000);
pProgress->SetRange( 0, lProgCpt );
lProgCpt = 0;
if( m_szFileName != "" )
{
pFile = fopen( m_szFileName, "wb" );
if( pFile && lSize )
{
fprintf( pFile, "%s#", szSeed );
for( lCpt = 0 ; lCpt < lSize ; lCpt ++ )
{
dVal = ((double) rand()) / ((double)0x7fff );
dVal = ( dVal * ((double)KEY_14) ) - floor( ( dVal * ((double)KEY_14) ) );
ucVal = ((unsigned char)(255.0 * dVal));
fputc( ucVal, pFile );
if( (lCpt % 1000000 ) == 0 )
{
MSG stMessage;
pProgress->SetPos( lProgCpt ++ );
_flushall();
if ( PeekMessage( &stMessage, NULL, 0, 0, PM_REMOVE ) )
DispatchMessage( &stMessage );
}
}
fclose( pFile );
pProgress->SetPos( 0 );
MessageBox( "File successfully created.", "Info", MB_OK | MB_ICONINFORMATION );
}
else
MessageBox( "Wrong size or file name.", "Error", MB_OK | MB_ICONERROR );
}
else
MessageBox( "Please enter a file name .", "Error", MB_OK | MB_ICONERROR );
}
void CCrapFileMakerDlg::OnCredits()
{
MessageBox( "(c) Marc Fascia - 1998", "Credits ...", MB_OK | MB_ICONINFORMATION );
}
void CCrapFileMakerDlg::OnDice()
{
time_t lTime;
char szValue[255];
time( &lTime );
m_iSeed = _rotl( lTime, (lTime % 31) );
sprintf( szValue, "%u", m_iSeed );
((CEdit *)GetDlgItem( IDC_SEED))->SetWindowText( szValue );
}
void CCrapFileMakerDlg::OnUpdateSeed()
{
CString szValue;
((CEdit *)GetDlgItem( IDC_SEED))->GetWindowText( szValue );
m_iSeed = atoi( szValue );
}

View File

@@ -0,0 +1,61 @@
// CrapFile MakerDlg.h : header file
//
#if !defined(AFX_CRAPFILEMAKERDLG_H__BA905555_1716_11D2_8891_00609771532D__INCLUDED_)
#define AFX_CRAPFILEMAKERDLG_H__BA905555_1716_11D2_8891_00609771532D__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
/////////////////////////////////////////////////////////////////////////////
// CCrapFileMakerDlg dialog
class CCrapFileMakerDlg : public CDialog
{
// Construction
public:
CCrapFileMakerDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CCrapFileMakerDlg)
enum { IDD = IDD_CRAPFILEMAKER_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCrapFileMakerDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
HICON m_hFileIcon;
HICON m_hDiceIcon;
CString m_szFileName;
CBitmap m_bmAbout;
int m_iSeed;
// Generated message map functions
//{{AFX_MSG(CCrapFileMakerDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnCreateFile();
afx_msg void OnChangeFile();
afx_msg void OnCredits();
afx_msg void OnFileselect();
afx_msg void OnDice();
afx_msg void OnUpdateSeed();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CRAPFILEMAKERDLG_H__BA905555_1716_11D2_8891_00609771532D__INCLUDED_)

View File

@@ -0,0 +1,6 @@
// stdafx.cpp : source file that includes just the standard includes
// CrapFile Maker.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__BA905557_1716_11D2_8891_00609771532D__INCLUDED_)
#define AFX_STDAFX_H__BA905557_1716_11D2_8891_00609771532D__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__BA905557_1716_11D2_8891_00609771532D__INCLUDED_)

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@@ -0,0 +1,31 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by CrapFile Maker.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_CRAPFILEMAKER_DIALOG 102
#define IDR_MAINFRAME 128
#define IDI_FILEOPEN 130
#define IDBMP_IMAGE 131
#define IDI_DICE 133
#define IDB_CREATE 1000
#define IDC_PROGRESS 1001
#define IDC_SIZEFILE 1002
#define IDC_FILE 1003
#define IDB_FILESELECT 1004
#define IDB_DICE 1006
#define IDC_CREDITS 1007
#define IDC_SEED 1008
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 134
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1010
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif