Add rayman2 source files
This commit is contained in:
parent
bcc093f8ed
commit
fb036c54fd
|
@ -0,0 +1,25 @@
|
||||||
|
echo off
|
||||||
|
echo ###################################
|
||||||
|
echo Anim binarization
|
||||||
|
echo ###################################
|
||||||
|
z:
|
||||||
|
cd rayman2\ds\cpa\appli\
|
||||||
|
echo.
|
||||||
|
echo Make anim
|
||||||
|
echo.
|
||||||
|
Z:\Rayman2\DS\CPA\Appli\binu64_a3d\release\makeanim.exe >NUL
|
||||||
|
echo.
|
||||||
|
echo split
|
||||||
|
echo.
|
||||||
|
Z:\Rayman2\DS\CPA\Appli\a3x.split\release\split.exe >NUL
|
||||||
|
echo.
|
||||||
|
echo Pack anim
|
||||||
|
echo.
|
||||||
|
Z:\Rayman2\DS\CPA\Appli\a3x.packanim\release\packanim.exe >NUL
|
||||||
|
echo.
|
||||||
|
echo pre bin
|
||||||
|
echo.
|
||||||
|
Z:\Rayman2\DS\CPA\Appli\prebin\release\prebin.exe /s:32 /q >Z:\Rayman2\DS\CPA\Appli\data.log >NUL
|
||||||
|
echo.
|
||||||
|
echo End Anim binarization
|
||||||
|
echo.
|
|
@ -0,0 +1,67 @@
|
||||||
|
@echo off
|
||||||
|
echo ##################################
|
||||||
|
echo Run CW Console
|
||||||
|
echo ##################################
|
||||||
|
"%CWFolder_NITRO%\bin\cmdide" /d "X:\Compile\bin\Make_ds.tcl"
|
||||||
|
IF ERRORLEVEL 0 GOTO code0
|
||||||
|
IF ERRORLEVEL 1 GOTO code1
|
||||||
|
IF ERRORLEVEL 2 GOTO code2
|
||||||
|
IF ERRORLEVEL 3 GOTO code3
|
||||||
|
IF ERRORLEVEL 4 GOTO code4
|
||||||
|
IF ERRORLEVEL 5 GOTO code5
|
||||||
|
IF ERRORLEVEL 6 GOTO code6
|
||||||
|
IF ERRORLEVEL 7 GOTO code7
|
||||||
|
IF ERRORLEVEL 8 GOTO code8
|
||||||
|
IF ERRORLEVEL 9 GOTO code9
|
||||||
|
IF ERRORLEVEL 10 GOTO code10
|
||||||
|
IF ERRORLEVEL 11 GOTO code11
|
||||||
|
IF ERRORLEVEL 12 GOTO code12
|
||||||
|
IF ERRORLEVEL 13 GOTO code13
|
||||||
|
IF ERRORLEVEL 14 GOTO code14
|
||||||
|
:code0
|
||||||
|
@echo Code 0 No error.
|
||||||
|
GOTO END
|
||||||
|
:code1
|
||||||
|
@echo Code 1 error opening file.
|
||||||
|
GOTO END
|
||||||
|
:code2
|
||||||
|
@echo Code 2 project not open.
|
||||||
|
GOTO END
|
||||||
|
:code3
|
||||||
|
@echo Code 3 IDE is already building.
|
||||||
|
GOTO END
|
||||||
|
:code4
|
||||||
|
@echo Code 4 invalid target name (for /t flag).
|
||||||
|
GOTO END
|
||||||
|
:code5
|
||||||
|
@echo Code 5 error changing current target.
|
||||||
|
GOTO END
|
||||||
|
:code6
|
||||||
|
@echo Code 6 error removing objects.
|
||||||
|
GOTO END
|
||||||
|
:code7
|
||||||
|
@echo Code 7 build was cancelled.
|
||||||
|
GOTO END
|
||||||
|
:code8
|
||||||
|
@echo Code 8 build failed.
|
||||||
|
GOTO END
|
||||||
|
:code9
|
||||||
|
@echo Code 9 process aborted.
|
||||||
|
GOTO END
|
||||||
|
:code10
|
||||||
|
@echo Code 10 error importing project.
|
||||||
|
GOTO END
|
||||||
|
:code11
|
||||||
|
@echo Code 11 error executing debug script.
|
||||||
|
GOTO END
|
||||||
|
:code12
|
||||||
|
@echo Code 12 attempted use of /d together with /b and/or /r.
|
||||||
|
GOTO END
|
||||||
|
:code13
|
||||||
|
@echo Code 13 licensing failed.
|
||||||
|
GOTO END
|
||||||
|
:code14
|
||||||
|
@echo Code 14 error executing extended command(s).
|
||||||
|
:END
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
z:
|
||||||
|
cd \rayman2\ds\cpa\appli\
|
||||||
|
xcopy x:\cpa\exe\main\gamedata\* z:\rayman2\ds\cpa\exe\main\gamedata\ /s/e/y/d/q
|
||||||
|
xcopy x:\cpa\exe\main\gamedn64\* z:\rayman2\ds\cpa\exe\main\gamedn64\ /s/e/y/d/q
|
|
@ -0,0 +1,6 @@
|
||||||
|
log s c:\\Logs\\dslog.txt
|
||||||
|
cd Z:\\Rayman2\\DS\\CPA\\TEMPGRP\\DS_R2
|
||||||
|
project -o ds_r2.mcp
|
||||||
|
config target "Nitro TS Release"
|
||||||
|
make
|
||||||
|
q
|
|
@ -0,0 +1,25 @@
|
||||||
|
@echo off
|
||||||
|
@echo #################################
|
||||||
|
@echo Delete Bin and obj
|
||||||
|
@echo #################################
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\Appli\data.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\Appli\fat.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\Appli\chunk.inf
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\Appli\anims.obj
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\Appli\DS\shanims.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\Appli\DS\a3dhead.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\Appli\DS\anims.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\Appli\DS\cuttable.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\TempGrp\DS_R2\files\shanims.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\TempGrp\DS_R2\files\a3dhead.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\TempGrp\DS_R2\files\anims.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\TempGrp\DS_R2\files\cuttable.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\Appli\scr2bin\data.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\Appli\scr2bin\fat.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\Appli\scr2bin\chunk.inf
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\tempgrp\ds_r2\files\data.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\tempgrp\ds_r2\files\fat.bin
|
||||||
|
del /F Z:\Rayman2\DS\Cpa\Appli\scr2bin\anims.obj
|
||||||
|
del /F/Q Z:\Rayman2\DS\CPA\TEMPGRP\DS_R2\bin\ARM9-TS\Debug\*.*
|
||||||
|
@echo.
|
||||||
|
@echo Del Complete
|
|
@ -0,0 +1,16 @@
|
||||||
|
z:
|
||||||
|
cd rayman2\ds\cpa\appli\
|
||||||
|
Z:\Rayman2\DS\Cpa\Appli\scr2bin\release\scr2bin.exe /s:32 /q /comp /file:data.log
|
||||||
|
copy Z:\Rayman2\DS\Cpa\Appli\data.bin Z:\Rayman2\DS\Cpa\Appli\scr2bin\data.bin
|
||||||
|
copy Z:\Rayman2\DS\Cpa\Appli\fat.bin Z:\Rayman2\DS\Cpa\Appli\scr2bin\fat.bin
|
||||||
|
copy Z:\Rayman2\DS\Cpa\Appli\chunk.inf Z:\Rayman2\DS\Cpa\Appli\scr2bin\chunk.inf
|
||||||
|
copy Z:\Rayman2\DS\Cpa\Appli\data.bin Z:\Rayman2\DS\Cpa\tempgrp\ds_r2\files
|
||||||
|
copy Z:\Rayman2\DS\Cpa\Appli\fat.bin Z:\Rayman2\DS\Cpa\tempgrp\ds_r2\files
|
||||||
|
copy Z:\Rayman2\DS\Cpa\Appli\anims.obj Z:\Rayman2\DS\Cpa\Appli\scr2bin\anims.obj
|
||||||
|
Z:\Rayman2\DS\Cpa\Appli\a3x.animobj\release\animsobj.exe comp >>data.log
|
||||||
|
|
||||||
|
|
||||||
|
copy Z:\Rayman2\DS\Cpa\Appli\DS\shanims.bin Z:\Rayman2\DS\Cpa\TempGrp\DS_R2\files
|
||||||
|
copy Z:\Rayman2\DS\Cpa\Appli\DS\a3dhead.bin Z:\Rayman2\DS\Cpa\TempGrp\DS_R2\files
|
||||||
|
copy Z:\Rayman2\DS\Cpa\Appli\DS\anims.bin Z:\Rayman2\DS\Cpa\TempGrp\DS_R2\files
|
||||||
|
copy Z:\Rayman2\DS\Cpa\Appli\DS\cuttable.bin Z:\Rayman2\DS\Cpa\TempGrp\DS_R2\files
|
|
@ -0,0 +1,8 @@
|
||||||
|
@echo copy X 2 Z
|
||||||
|
call X:\Compile\Kit\copyx2z.bat
|
||||||
|
@echo Del bin
|
||||||
|
call X:\Compile\Kit\del_bin.bat
|
||||||
|
@echo Build Anims
|
||||||
|
call X:\Compile\Kit\Build_Anims.bat
|
||||||
|
@echo Scripte 2 bin
|
||||||
|
call X:\Compile\Kit\src2bin.bat
|
|
@ -0,0 +1 @@
|
||||||
|
09/28/04 - 19:46:38
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,86 @@
|
||||||
|
// BigFileTool.cpp : Defines the class behaviors for the application.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "BigFileTool.h"
|
||||||
|
#include "BigFileToolDlg.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBigFileToolApp
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CBigFileToolApp, CWinApp)
|
||||||
|
//{{AFX_MSG_MAP(CBigFileToolApp)
|
||||||
|
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||||
|
// DO NOT EDIT what you see in these blocks of generated code!
|
||||||
|
//}}AFX_MSG
|
||||||
|
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBigFileToolApp construction
|
||||||
|
|
||||||
|
CBigFileToolApp::CBigFileToolApp()
|
||||||
|
{
|
||||||
|
// TODO: add construction code here,
|
||||||
|
// Place all significant initialization in InitInstance
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// The one and only CBigFileToolApp object
|
||||||
|
|
||||||
|
CBigFileToolApp theApp;
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBigFileToolApp initialization
|
||||||
|
|
||||||
|
BOOL CBigFileToolApp::InitInstance()
|
||||||
|
{
|
||||||
|
AfxEnableControlContainer();
|
||||||
|
|
||||||
|
// Standard initialization
|
||||||
|
// If you are not using these features and wish to reduce the size
|
||||||
|
// of your final executable, you should remove from the following
|
||||||
|
// the specific initialization routines you do not need.
|
||||||
|
|
||||||
|
#ifdef _AFXDLL
|
||||||
|
Enable3dControls(); // Call this when using MFC in a shared DLL
|
||||||
|
#else
|
||||||
|
Enable3dControlsStatic(); // Call this when linking to MFC statically
|
||||||
|
#endif
|
||||||
|
|
||||||
|
CBigFileToolDlg dlg;
|
||||||
|
m_pMainWnd = &dlg;
|
||||||
|
|
||||||
|
int nResponse = dlg.DoModal();
|
||||||
|
if (nResponse == IDOK)
|
||||||
|
{
|
||||||
|
// TODO: Place code here to handle when the dialog is
|
||||||
|
// dismissed with OK
|
||||||
|
iExitInstanceValue = 0;
|
||||||
|
}
|
||||||
|
else if (nResponse == IDCANCEL)
|
||||||
|
{
|
||||||
|
// TODO: Place code here to handle when the dialog is
|
||||||
|
// dismissed with Cancel
|
||||||
|
iExitInstanceValue = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Since the dialog has been closed, return FALSE so that we exit the
|
||||||
|
// application, rather than start the application's message pump.
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CBigFileToolApp::ExitInstance()
|
||||||
|
{
|
||||||
|
// TODO: Add your specialized code here and/or call the base class
|
||||||
|
|
||||||
|
CWinApp::ExitInstance();
|
||||||
|
|
||||||
|
return iExitInstanceValue;
|
||||||
|
}
|
|
@ -0,0 +1,155 @@
|
||||||
|
# Microsoft Developer Studio Project File - Name="BigFileTool" - Package Owner=<4>
|
||||||
|
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||||
|
# ** DO NOT EDIT **
|
||||||
|
|
||||||
|
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||||
|
|
||||||
|
CFG=BigFileTool - 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 "BigFileTool.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 "BigFileTool.mak" CFG="BigFileTool - Win32 Debug"
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE Possible choices for configuration are:
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE "BigFileTool - Win32 Release" (based on "Win32 (x86) Application")
|
||||||
|
!MESSAGE "BigFileTool - Win32 Debug" (based on "Win32 (x86) Application")
|
||||||
|
!MESSAGE
|
||||||
|
|
||||||
|
# Begin Project
|
||||||
|
# PROP Scc_ProjName ""$/cpa/Appli/BigFileTool", FIBBAAAA"
|
||||||
|
# PROP Scc_LocalPath "."
|
||||||
|
CPP=cl.exe
|
||||||
|
MTL=midl.exe
|
||||||
|
RSC=rc.exe
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BigFileTool - 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 Ignore_Export_Lib 0
|
||||||
|
# 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 x:\Cpa\Lib\SCRP5_vr.lib x:\Cpa\Lib\ERMP5_vr.lib x:\Cpa\Lib\MMGP5_vr.lib /nologo /subsystem:windows /machine:I386
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BigFileTool - 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 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 "X:/CPA/Public" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "USE_PROFILER" /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 x:\Cpa\Lib\SCRP5_vd.lib x:\Cpa\Lib\ERMP5_vd.lib x:\Cpa\Lib\MMGP5_vd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"LIBCD" /nodefaultlib:"MSVCRT" /pdbtype:sept
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# Begin Target
|
||||||
|
|
||||||
|
# Name "BigFileTool - Win32 Release"
|
||||||
|
# Name "BigFileTool - Win32 Debug"
|
||||||
|
# Begin Group "Source Files"
|
||||||
|
|
||||||
|
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\BigFileTool.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\BigFileTool.rc
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\BigFileToolDlg.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\Scripts.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=.\BigFileTool.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\BigFileToolDlg.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\Resource.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\Scripts.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\BigFileTool.ico
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\res\BigFileTool.rc2
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ReadMe.txt
|
||||||
|
# End Source File
|
||||||
|
# End Target
|
||||||
|
# End Project
|
|
@ -0,0 +1,37 @@
|
||||||
|
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||||
|
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
Project: "BigFileTool"=.\BigFileTool.dsp - Package Owner=<4>
|
||||||
|
|
||||||
|
Package=<5>
|
||||||
|
{{{
|
||||||
|
begin source code control
|
||||||
|
"$/cpa/Appli/BigFileTool", FIBBAAAA
|
||||||
|
.
|
||||||
|
end source code control
|
||||||
|
}}}
|
||||||
|
|
||||||
|
Package=<4>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
Global:
|
||||||
|
|
||||||
|
Package=<5>
|
||||||
|
{{{
|
||||||
|
begin source code control
|
||||||
|
"$/cpa/Appli/BigFileTool", FIBBAAAA
|
||||||
|
.
|
||||||
|
end source code control
|
||||||
|
}}}
|
||||||
|
|
||||||
|
Package=<3>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
// BigFileTool.h : main header file for the BIGFILETOOL application
|
||||||
|
//
|
||||||
|
|
||||||
|
#if !defined(AFX_BIGFILETOOL_H__CED7419A_E030_11D2_BB2B_00E02921BF64__INCLUDED_)
|
||||||
|
#define AFX_BIGFILETOOL_H__CED7419A_E030_11D2_BB2B_00E02921BF64__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
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBigFileToolApp:
|
||||||
|
// See BigFileTool.cpp for the implementation of this class
|
||||||
|
//
|
||||||
|
|
||||||
|
class CBigFileToolApp : public CWinApp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CBigFileToolApp();
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CBigFileToolApp)
|
||||||
|
public:
|
||||||
|
virtual BOOL InitInstance();
|
||||||
|
virtual int ExitInstance();
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
|
||||||
|
//{{AFX_MSG(CBigFileToolApp)
|
||||||
|
// NOTE - the ClassWizard will add and remove member functions here.
|
||||||
|
// DO NOT EDIT what you see in these blocks of generated code !
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int iExitInstanceValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_BIGFILETOOL_H__CED7419A_E030_11D2_BB2B_00E02921BF64__INCLUDED_)
|
|
@ -0,0 +1,237 @@
|
||||||
|
//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 BigFileTool"
|
||||||
|
FONT 8, "MS Sans Serif"
|
||||||
|
BEGIN
|
||||||
|
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
|
||||||
|
LTEXT "BigFileTool Version 1.0",IDC_STATIC,40,10,119,8,
|
||||||
|
SS_NOPREFIX
|
||||||
|
LTEXT "Copyright (C) 1999",IDC_STATIC,40,25,119,8
|
||||||
|
DEFPUSHBUTTON "OK",IDOK,178,7,32,14,WS_GROUP
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_BIGFILETOOL_DIALOG DIALOGEX 0, 0, 336, 396
|
||||||
|
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
|
||||||
|
EXSTYLE WS_EX_TOOLWINDOW | WS_EX_APPWINDOW
|
||||||
|
CAPTION "Big File Tool"
|
||||||
|
FONT 8, "MS Sans Serif"
|
||||||
|
BEGIN
|
||||||
|
DEFPUSHBUTTON "Exit",IDOK,279,375,50,14
|
||||||
|
LTEXT "Binary GameData Path",IDC_STATIC,7,39,73,8
|
||||||
|
EDITTEXT IDC_EDIT_DATAPATH,7,50,299,14,ES_AUTOHSCROLL
|
||||||
|
PUSHBUTTON "...",IDC_BUTTON_BROWSE,313,51,16,14
|
||||||
|
LTEXT "Size",IDC_STATIC,7,75,14,8
|
||||||
|
EDITTEXT IDC_EDIT_SIZE,26,72,40,14,ES_AUTOHSCROLL
|
||||||
|
CONTROL "Spin1",IDC_SPIN_SIZE,"msctls_updown32",UDS_SETBUDDYINT |
|
||||||
|
UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,58,73,7,
|
||||||
|
14
|
||||||
|
LISTBOX IDC_LIST_WORK,7,96,322,253,LBS_USETABSTOPS |
|
||||||
|
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||||
|
PUSHBUTTON "Run",IDC_BUTTON_RUN,7,375,50,14
|
||||||
|
LTEXT "Script GameData Path",IDC_STATIC,7,7,72,8
|
||||||
|
EDITTEXT IDC_EDIT_SCRIPTDATAPATH,7,18,299,14,ES_AUTOHSCROLL
|
||||||
|
PUSHBUTTON "...",IDC_BUTTON_BROWSESCRIPT,313,19,16,14
|
||||||
|
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",0x0,7,355,
|
||||||
|
322,14,WS_EX_CLIENTEDGE | WS_EX_STATICEDGE
|
||||||
|
LTEXT "Mo",IDC_STATIC,70,75,11,8
|
||||||
|
CONTROL "Delete rt* files",IDC_CHECK_DELETEFILES,"Button",
|
||||||
|
BS_AUTOCHECKBOX | WS_TABSTOP,269,75,59,10
|
||||||
|
CONTROL "Generate Info Files",IDC_CHECK_INFO,"Button",
|
||||||
|
BS_AUTOCHECKBOX | WS_TABSTOP,93,75,75,10
|
||||||
|
CONTROL "Update StartPrg.ini",IDC_CHECK_STARTPRG,"Button",
|
||||||
|
BS_AUTOCHECKBOX | WS_TABSTOP,181,75,75,10
|
||||||
|
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", "BigFileTool MFC Application\0"
|
||||||
|
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||||
|
VALUE "InternalName", "BigFileTool\0"
|
||||||
|
VALUE "LegalCopyright", "Copyright (C) 1999\0"
|
||||||
|
VALUE "LegalTrademarks", "\0"
|
||||||
|
VALUE "OriginalFilename", "BigFileTool.EXE\0"
|
||||||
|
VALUE "ProductName", "BigFileTool 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_BIGFILETOOL_DIALOG, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 7
|
||||||
|
RIGHTMARGIN, 329
|
||||||
|
TOPMARGIN, 7
|
||||||
|
BOTTOMMARGIN, 389
|
||||||
|
END
|
||||||
|
END
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// String Table
|
||||||
|
//
|
||||||
|
|
||||||
|
STRINGTABLE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
IDS_ABOUTBOX "&About BigFileTool..."
|
||||||
|
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\\BigFileTool.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\\BigFileTool.ico"
|
||||||
|
#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\BigFileTool.rc2" // non-Microsoft Visual C++ edited resources
|
||||||
|
#include "afxres.rc" // Standard components
|
||||||
|
#endif
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,114 @@
|
||||||
|
// BigFileToolDlg.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
#if !defined(AFX_BIGFILETOOLDLG_H__CED7419C_E030_11D2_BB2B_00E02921BF64__INCLUDED_)
|
||||||
|
#define AFX_BIGFILETOOLDLG_H__CED7419C_E030_11D2_BB2B_00E02921BF64__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
|
||||||
|
#include <afxtempl.h>
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
typedef struct tdstFileInfo_
|
||||||
|
{
|
||||||
|
char szFileName[64];
|
||||||
|
DWORD dwSize;
|
||||||
|
DWORD dwMapNumber;
|
||||||
|
} tdstFileInfo;
|
||||||
|
|
||||||
|
typedef struct tdstMixUpInfo_
|
||||||
|
{
|
||||||
|
POSITION xFileInfoPosition;
|
||||||
|
DWORD dwOccur;
|
||||||
|
DWORD dwOffSet;
|
||||||
|
DWORD dwSize;
|
||||||
|
DWORD dwMapNumber;
|
||||||
|
char *p_cFileName;
|
||||||
|
} tdstMixUpInfo;
|
||||||
|
|
||||||
|
typedef CList<tdstFileInfo*,tdstFileInfo*> CListOfFileInfo;
|
||||||
|
|
||||||
|
typedef struct tdstHeaderInfo_
|
||||||
|
{
|
||||||
|
DWORD dwOccur;
|
||||||
|
DWORD dwOffSet;
|
||||||
|
} tdstHeaderInfo;
|
||||||
|
|
||||||
|
typedef struct tdstBigFileInfo_
|
||||||
|
{
|
||||||
|
DWORD dwNbMap;
|
||||||
|
DWORD dwNbFile;
|
||||||
|
DWORD dwNbOccur;
|
||||||
|
DWORD dwMaxFileSize;
|
||||||
|
DWORD dwBigHeaderSize;
|
||||||
|
DWORD dwFirstHeaderSize;
|
||||||
|
DWORD dwHeaderSize;
|
||||||
|
DWORD dwHeaderStep;
|
||||||
|
DWORD dwTotalSize;
|
||||||
|
DWORD dwTotalSector;
|
||||||
|
} tdstBigFileInfo;
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBigFileToolDlg dialog
|
||||||
|
class CBigFileToolDlg : public CDialog
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
void WriteINIFile();
|
||||||
|
CBigFileToolDlg(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CBigFileToolDlg)
|
||||||
|
enum { IDD = IDD_BIGFILETOOL_DIALOG };
|
||||||
|
CProgressCtrl m_Ctrl_ProgressBar;
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CBigFileToolDlg)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
void UpdateStartPrg();
|
||||||
|
void InitWithCommandLine ();
|
||||||
|
void DeleteFiles (char *_szDataPath , CListOfFileInfo *_p_oList);
|
||||||
|
void ReadINIFile();
|
||||||
|
BOOL WriteFiles (char *_szDataPath , HANDLE hFile, CListOfFileInfo *_p_oFIList, tdstMixUpInfo *_a_MUITab, tdstBigFileInfo *p_stBFI);
|
||||||
|
BOOL WriteHeader (HANDLE hFile, CListOfFileInfo *_p_oFIList, tdstMixUpInfo *_a_MUITab, tdstBigFileInfo *p_stBFI);
|
||||||
|
BOOL MixUpFiles(DWORD _dwBigFileSize , CListOfFileInfo *_p_oFIList, tdstMixUpInfo **_a_MUITab, tdstBigFileInfo *p_stBFI);
|
||||||
|
void ReadListOfFiles(char *_szDataPath , CStringList *_p_oMapList , CListOfFileInfo *_p_oFIList);
|
||||||
|
BOOL Run ();
|
||||||
|
void OnBrowse(UINT nID);
|
||||||
|
void PeekAndPump();
|
||||||
|
|
||||||
|
BOOL MixUpFilesWithExplodedHeader(DWORD _dwBigFileSize , CListOfFileInfo *_p_oFIList , tdstMixUpInfo **_a_MUITab, tdstBigFileInfo *p_stBFI, tdstHeaderInfo **_a_HITab);
|
||||||
|
BOOL WriteBigFileWithExplodedHeader(char *_szDataPath , HANDLE hFile, CListOfFileInfo *_p_oFIList, tdstMixUpInfo *_a_MUITab, tdstBigFileInfo *p_stBFI, tdstHeaderInfo *_a_HITab);
|
||||||
|
|
||||||
|
HICON m_hIcon;
|
||||||
|
BOOL m_bGenerateInfoFiles;
|
||||||
|
BOOL m_bAutoRun;
|
||||||
|
BOOL m_bUpdateStartPrg;
|
||||||
|
CString m_csErrorMessage;
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CBigFileToolDlg)
|
||||||
|
virtual BOOL OnInitDialog();
|
||||||
|
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||||
|
afx_msg void OnPaint();
|
||||||
|
afx_msg HCURSOR OnQueryDragIcon();
|
||||||
|
afx_msg void OnButtonBrowse();
|
||||||
|
virtual void OnCancel();
|
||||||
|
virtual void OnOK();
|
||||||
|
afx_msg void OnButtonRun();
|
||||||
|
afx_msg void OnButtonBrowsescript();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_BIGFILETOOLDLG_H__CED7419C_E030_11D2_BB2B_00E02921BF64__INCLUDED_)
|
|
@ -0,0 +1,103 @@
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
//#include "GlobalData.h"
|
||||||
|
#include "/cpa/public/scr.h"
|
||||||
|
|
||||||
|
#define C_GrandChildSection ( 2)
|
||||||
|
#define C_ChildSection ( 1)
|
||||||
|
#define C_ThisSection ( 0)
|
||||||
|
#define C_ParentSection (-1)
|
||||||
|
#define C_GrandParentSection (-2)
|
||||||
|
|
||||||
|
#define C_GrandChildContext ( 2)
|
||||||
|
#define C_ChildContext ( 1)
|
||||||
|
#define C_ThisContext ( 0)
|
||||||
|
#define C_ParentContext (-1)
|
||||||
|
#define C_GrandParentContext (-2)
|
||||||
|
|
||||||
|
#define M_IsTitle (_eAction==SCR_EA_Anl_BeginSection)
|
||||||
|
#define M_IsEnd (_eAction==SCR_EA_Anl_EndSection)
|
||||||
|
#define M_IsBegSubSection (_eAction==SCR_EA_Anl_BeginSubSection)
|
||||||
|
#define M_IsEndSubSection (_eAction==SCR_EA_Anl_EndSubSection)
|
||||||
|
#define M_IsEntry (_eAction==SCR_EA_Anl_Entry)
|
||||||
|
#define M_ActionIs(szActionAsked) (!strcmpi(_p_szName,szActionAsked))
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// Callback function to analyse the section "LevelNames" in game.dsc
|
||||||
|
SCR_tde_Anl_ReturnValue fn_eScriptCallBackFirstLevel(SCR_tdst_File_Description *_p_stFile,char *_p_szName,char *_ap_szParams[],SCR_tde_Anl_Action _eAction)
|
||||||
|
{
|
||||||
|
SCR_tde_Anl_ReturnValue eReturnValue = SCR_ERV_Anl_NormalReturn;
|
||||||
|
CStringList *_p_oList;
|
||||||
|
|
||||||
|
_p_stFile=_p_stFile;
|
||||||
|
|
||||||
|
if (M_IsEntry)
|
||||||
|
{
|
||||||
|
SCR_M_RdL0_GetContextLong(C_ThisContext,0,CStringList*,_p_oList);
|
||||||
|
|
||||||
|
if (M_ActionIs("LevelName"))
|
||||||
|
{
|
||||||
|
char *p_cDelimiter = strchr( _ap_szParams[0], '$' );
|
||||||
|
if( p_cDelimiter ) *p_cDelimiter = 0;
|
||||||
|
_p_oList -> AddTail (_ap_szParams[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return(eReturnValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// Init acp modules for script parsing.
|
||||||
|
|
||||||
|
unsigned long g_SCR_a9MemTable[9] = {0,0,0,0,0,0,0,0,0};
|
||||||
|
|
||||||
|
void fn_vInitScr()
|
||||||
|
{
|
||||||
|
Erm_M_InitErrMsg(Erm);
|
||||||
|
Erm_M_InitErrMsg(Mmg);
|
||||||
|
Mmg_fn_vFirstInitMmgModule(10);
|
||||||
|
|
||||||
|
SCR_fn_v_RdL0_Init();
|
||||||
|
g_SCR_a9MemTable[1] = 1000000;
|
||||||
|
SCR_fn_v_Mem_InitWithMemLevel(g_SCR_a9MemTable);
|
||||||
|
SCR_fn_v_RdL0_RegisterCallback( "FirstLevelDescription", fn_eScriptCallBackFirstLevel, SCR_CRC_c_RdL0_ForSection );
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void fn_vDesinitScr()
|
||||||
|
{
|
||||||
|
// SCR_fn_v_RdL0_DeleteRegisterCallback( "FirstLevelDescription", SCR_CRC_c_RdL0_ForSection , );
|
||||||
|
SCR_fn_v_RdL0_Close();
|
||||||
|
Mmg_fn_vStopMmgModule();
|
||||||
|
MMG_fn_vDesinitMemoryRasterDeclaration ();
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// Analyse game.dsc
|
||||||
|
BOOL fn_bReadGameDsc(char *_szDataPath , CStringList *_p_oList)
|
||||||
|
{
|
||||||
|
char szText[1024];
|
||||||
|
char szFileName[512];
|
||||||
|
char szSectionName[512];
|
||||||
|
|
||||||
|
// Compute long name of game.dsc
|
||||||
|
sprintf( szFileName, "%sGame.dsc", _szDataPath );
|
||||||
|
|
||||||
|
// We need read acces on the file
|
||||||
|
if( _access( szFileName, 04 ) == -1 )
|
||||||
|
{
|
||||||
|
sprintf( szText, "Can't read level list: '%s' is not accessible !\n(Does not exist or no read permission)", szFileName );
|
||||||
|
AfxMessageBox( szText, MB_OK | MB_ICONSTOP );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Analyse only the section describing the list of levels
|
||||||
|
SCR_M_RdL0_SetContextLong(C_GrandChildContext, 0, (long)_p_oList);
|
||||||
|
sprintf( szSectionName, "%s^FirstLevelDescription", szFileName );
|
||||||
|
SCR_fnp_st_RdL0_AnalyseSection( szFileName, SCR_CDF_uw_Anl_ForceAnalyse );
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
#if !defined(_SCRIPTS_H_)
|
||||||
|
#define _SCRIPTS_H_
|
||||||
|
|
||||||
|
extern void fn_vInitScr();
|
||||||
|
extern void fn_vDesinitScr();
|
||||||
|
extern BOOL fn_bReadGameDsc(char *_szDataPath , CStringList *_p_oList);
|
||||||
|
|
||||||
|
#endif //_SCRIPTS_H_
|
|
@ -0,0 +1,6 @@
|
||||||
|
// stdafx.cpp : source file that includes just the standard includes
|
||||||
|
// BigFileTool.pch will be the pre-compiled header
|
||||||
|
// stdafx.obj will contain the pre-compiled type information
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
// 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__CED7419E_E030_11D2_BB2B_00E02921BF64__INCLUDED_)
|
||||||
|
#define AFX_STDAFX_H__CED7419E_E030_11D2_BB2B_00E02921BF64__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
|
||||||
|
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||||
|
|
||||||
|
#include <afxwin.h> // MFC core and standard components
|
||||||
|
#include <afxext.h> // MFC extensions
|
||||||
|
#include <afxdisp.h> // MFC OLE automation classes
|
||||||
|
#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__CED7419E_E030_11D2_BB2B_00E02921BF64__INCLUDED_)
|
|
@ -0,0 +1,5 @@
|
||||||
|
SCC = This is a Source Code Control file
|
||||||
|
|
||||||
|
[BigFileTool.dsp]
|
||||||
|
SCC_Aux_Path = "\\srvprojets-ma\Rayman4_DS\Versions\Rayman4DS\Tools"
|
||||||
|
SCC_Project_Name = "$/CPA/Appli/BigFileTool", XAAAAAAA
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -0,0 +1,13 @@
|
||||||
|
//
|
||||||
|
// BIGFILETOOL.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...
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
|
@ -0,0 +1,33 @@
|
||||||
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// Microsoft Developer Studio generated include file.
|
||||||
|
// Used by BigFileTool.rc
|
||||||
|
//
|
||||||
|
#define IDM_ABOUTBOX 0x0010
|
||||||
|
#define IDD_ABOUTBOX 100
|
||||||
|
#define IDS_ABOUTBOX 101
|
||||||
|
#define IDD_BIGFILETOOL_DIALOG 102
|
||||||
|
#define IDR_MAINFRAME 128
|
||||||
|
#define IDC_EDIT_DATAPATH 1000
|
||||||
|
#define IDC_BUTTON_BROWSE 1001
|
||||||
|
#define IDC_EDIT_SIZE 1002
|
||||||
|
#define IDC_SPIN_SIZE 1003
|
||||||
|
#define IDC_LIST_WORK 1004
|
||||||
|
#define IDC_BUTTON_RUN 1005
|
||||||
|
#define IDC_EDIT_SCRIPTDATAPATH 1006
|
||||||
|
#define IDC_BUTTON_BROWSESCRIPT 1007
|
||||||
|
#define IDC_PROGRESS 1008
|
||||||
|
#define IDC_EDIT_BIGFILENAME 1009
|
||||||
|
#define IDC_CHECK_DELETEFILES 1010
|
||||||
|
#define IDC_CHECK_INFO 1011
|
||||||
|
#define IDC_CHECK_STARTPRG 1012
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 129
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1013
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
#endif
|
||||||
|
#endif
|
|
@ -0,0 +1,238 @@
|
||||||
|
# Microsoft Developer Studio Project File - Name="BinaryTool" - Package Owner=<4>
|
||||||
|
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||||
|
# ** DO NOT EDIT **
|
||||||
|
|
||||||
|
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||||
|
|
||||||
|
CFG=BinaryTool - 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 "BinaryTool.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 "BinaryTool.mak" CFG="BinaryTool - Win32 Debug"
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE Possible choices for configuration are:
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE "BinaryTool - Win32 Release" (based on "Win32 (x86) Application")
|
||||||
|
!MESSAGE "BinaryTool - Win32 Debug" (based on "Win32 (x86) Application")
|
||||||
|
!MESSAGE
|
||||||
|
|
||||||
|
# Begin Project
|
||||||
|
# PROP Scc_ProjName ""$/cpa/Appli/BinaryTool", WROAAAAA"
|
||||||
|
# PROP Scc_LocalPath "."
|
||||||
|
CPP=cl.exe
|
||||||
|
MTL=midl.exe
|
||||||
|
RSC=rc.exe
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - 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 0x409 /d "NDEBUG" /d "_AFXDLL"
|
||||||
|
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
|
||||||
|
BSC32=bscmake.exe
|
||||||
|
# ADD BASE BSC32 /nologo
|
||||||
|
# ADD BSC32 /nologo
|
||||||
|
LINK32=link.exe
|
||||||
|
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
|
||||||
|
# ADD LINK32 /nologo /subsystem:windows /machine:I386
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - 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 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" /I "x:/cpa/public/gam/playanim/interpol" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "SCR_C_OptFiles" /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 0x409 /d "_DEBUG" /d "_AFXDLL"
|
||||||
|
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
|
||||||
|
BSC32=bscmake.exe
|
||||||
|
# ADD BASE BSC32 /nologo
|
||||||
|
# ADD BSC32 /nologo
|
||||||
|
LINK32=link.exe
|
||||||
|
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||||
|
# ADD LINK32 x:\Cpa\Lib\SCRP5_vd.lib x:\Cpa\Lib\ERMP5_vd.lib x:\Cpa\Lib\MMGP5_vd.lib x:\Cpa\Lib\FILP5_vd.lib x:\Cpa\Lib\TMPP5_vd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"LIBCD" /nodefaultlib:"MSVCRT" /out:"x:\cpa\exe\main\BinaryTool.exe" /pdbtype:sept /libpath:"x:\cpa\lib"
|
||||||
|
# SUBTRACT LINK32 /pdb:none
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# Begin Target
|
||||||
|
|
||||||
|
# Name "BinaryTool - Win32 Release"
|
||||||
|
# Name "BinaryTool - Win32 Debug"
|
||||||
|
# Begin Group "Source Files"
|
||||||
|
|
||||||
|
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\Anims.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\Binary.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\BinaryTool.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\BinaryTool.rc
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\DlgMain.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\DlgWarning.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\GIItem.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\GIType.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\IniData.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\l_global_v6.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\Levels.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\MainFrm.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\makeanim.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\StdAfx.cpp
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
|
# Begin Group "Header Files"
|
||||||
|
|
||||||
|
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\Anims.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\Binary.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\BinaryTool.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\DlgMain.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\DlgWarning.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\GIItem.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\GIType.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\IniData.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\l_global_v6.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\Levels.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\MainFrm.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\makeanim.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\Print.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\Resource.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\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\BinaryTool.ico
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\bmp132.bmp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\croix.bmp
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\BinaryTool.mak
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ReadMe.txt
|
||||||
|
# End Source File
|
||||||
|
# End Target
|
||||||
|
# End Project
|
|
@ -0,0 +1,29 @@
|
||||||
|
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||||
|
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
Project: "BinaryTool"=.\BinaryTool.dsp - Package Owner=<4>
|
||||||
|
|
||||||
|
Package=<5>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
Package=<4>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
Global:
|
||||||
|
|
||||||
|
Package=<5>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
Package=<3>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
[General directories]
|
||||||
|
DirNameSource=E:\cpa\exe\main\gamedata
|
||||||
|
DirNameDestBinDD3D=E:\cpa\Appli\BinaryTool\GameDataBinDD3D
|
||||||
|
DirNameDestBinRDFX=E:\cpa\Appli\BinaryTool\GameDataBinRDFX
|
||||||
|
DirNameDestBinDDFX=E:\cpa\Appli\BinaryTool\GameDataBinRD3D
|
||||||
|
DirNameDestBinRD3D=E:\cpa\Appli\BinaryTool\GameDataBinRD3D
|
||||||
|
[WinPref]
|
||||||
|
Main=( 262, 127, 782, 600)
|
||||||
|
[Mode]
|
||||||
|
Mode=Debug
|
||||||
|
[3DCard]
|
||||||
|
3DCard=D3D
|
|
@ -0,0 +1,34 @@
|
||||||
|
// **********************************************************************************
|
||||||
|
// * "Anims.h" *
|
||||||
|
// * Written by : Mihaela Tancu *
|
||||||
|
// **********************************************************************************
|
||||||
|
#ifndef ANIMS_H
|
||||||
|
#define ANIMS_H
|
||||||
|
|
||||||
|
#include "Scr.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Defines
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
#define M_CreateNewState "CreateNewState"
|
||||||
|
#define M_FichierSTA ".sta"
|
||||||
|
#define M_Animation "Animation"
|
||||||
|
|
||||||
|
typedef struct MLT_tdstAnim_
|
||||||
|
{
|
||||||
|
char sName[256];
|
||||||
|
char sAnimation[500];
|
||||||
|
} MLT_tdstAnim;
|
||||||
|
|
||||||
|
extern MLT_tdstAnim **g_hAnimInFile;
|
||||||
|
extern long g_lAnimIndex;
|
||||||
|
extern BOOL bUsed;
|
||||||
|
|
||||||
|
void MLT_vLoadSTAFileInLib(char *szFileName);
|
||||||
|
void MLT_vInitSTALoad();
|
||||||
|
SCR_tde_Anl_ReturnValue GLI_xLoadSTACallback(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType);
|
||||||
|
void MLT_vEraseSTALib();
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,64 @@
|
||||||
|
#ifndef BINARY_H
|
||||||
|
#define BINARY_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
DEFINES
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
#define C_BinPass1 "2"
|
||||||
|
#define C_BinPass2 "3"
|
||||||
|
#define C_TemporaryDirectory "TestCRB"
|
||||||
|
#define C_CRBExecutable "CRB.exe"
|
||||||
|
#define C_World "World"
|
||||||
|
#define C_Levels "Levels"
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
GLOBALS
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
extern char SAVE_g_szDirName[ _MAX_PATH ];
|
||||||
|
extern char SAVE_g_szTargetDirName[ _MAX_PATH ];
|
||||||
|
extern unsigned char g_ucChoice;
|
||||||
|
extern BOOL bYes;
|
||||||
|
extern BOOL bBatch;
|
||||||
|
extern BOOL bAll;
|
||||||
|
extern BOOL bTbl;
|
||||||
|
|
||||||
|
extern BOOL bBMP;
|
||||||
|
extern BOOL bTGA;
|
||||||
|
extern BOOL bConvert16;
|
||||||
|
extern BOOL bConvert32;
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
=======================================================================================
|
||||||
|
FUNCTIONS
|
||||||
|
=======================================================================================
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
//************************************************************************
|
||||||
|
void fn_vGetFileExtension( char *szFileName , char *a4_cExtend );
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Directory Functions
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
BOOL SAVE_fn_bCreateDirectory( char *szDirName );
|
||||||
|
BOOL fn_bDeleteTemporaryFiles( char *szDir, char *szLevelName );
|
||||||
|
BOOL fn_bCopyDirectory( BOOL _bRecursive, char *szExtendFile );
|
||||||
|
BOOL SAVE_fn_bCopyDirectory( char *szSourceDir, char *szTargetDir, BOOL _bRecursive, char *szExtendFile);
|
||||||
|
char fn_cExecuteGame(char *szProgramName, char *szLevelName, char *szPass);
|
||||||
|
char fn_cExecuteCRB(char *szProgramName, char *szLevelName);
|
||||||
|
char fn_cCopyAnyFilesOfADirectory(char *szSrcDirectory, char *szDestDirectory, char *szPass) ;
|
||||||
|
char fn_cCopyBinarizedFiles(char *szSrcDirectory, char *szDestDirectory, char *szLevel) ;
|
||||||
|
char fn_cExecuteGameFirst(char *szProgramName, char *szLevelName, char *szPass);
|
||||||
|
char fn_cExecuteMakeanim(char *szProgramName, BOOL b, BOOL a, BOOL z, char *szAnimName);
|
||||||
|
char fn_cExecuteConvImg(char *szProgramName, char * szSource, char *szDestBinDir, BOOL bBMP, BOOL bTGA, BOOL bConvert16, BOOL bConvert32, char *szTextureName);
|
||||||
|
BOOL fn_bMoveDirectory( BOOL _bRecursive, char *szExtendFile );
|
||||||
|
BOOL SAVE_fn_bMoveDirectory( char *szSourceDir, char *szTargetDir, BOOL _bRecursive, char *szExtendFile);
|
||||||
|
|
||||||
|
char fn_cExecuteConvImgOnDirectory( char *szProgramName, char *szSourceDir, char *szDestDir, BOOL bBMP, BOOL bTGA, BOOL bConvert16, BOOL bConvert32 );
|
||||||
|
void fn_vCopyTextures( char *_szBaseDir, char *_szDestinationDir, BOOL bConvertTextures );
|
||||||
|
|
||||||
|
#endif
|
Binary file not shown.
|
@ -0,0 +1,50 @@
|
||||||
|
// BinaryTool.h : main header file for the BinaryTool application
|
||||||
|
//
|
||||||
|
|
||||||
|
#if !defined(AFX_BinaryTool_H__6E893D47_5B46_11D1_A939_00A0245D4B6C__INCLUDED_)
|
||||||
|
#define AFX_BinaryTool_H__6E893D47_5B46_11D1_A939_00A0245D4B6C__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
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBinaryToolApp:
|
||||||
|
// See BinaryTool.cpp for the implementation of this class
|
||||||
|
//
|
||||||
|
|
||||||
|
class CBinaryToolApp : public CWinApp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CBinaryToolApp();
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CBinaryToolApp)
|
||||||
|
public:
|
||||||
|
virtual BOOL InitInstance();
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
|
||||||
|
//{{AFX_MSG(CBinaryToolApp)
|
||||||
|
afx_msg void OnAppAbout();
|
||||||
|
// NOTE - the ClassWizard will add and remove member functions here.
|
||||||
|
// DO NOT EDIT what you see in these blocks of generated code !
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_BinaryTool_H__6E893D47_5B46_11D1_A939_00A0245D4B6C__INCLUDED_)
|
|
@ -0,0 +1,195 @@
|
||||||
|
//Microsoft Developer Studio generated resource script.
|
||||||
|
//
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
|
//
|
||||||
|
#include "afxres.h"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// English (U.S.) resources
|
||||||
|
|
||||||
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
|
#ifdef _WIN32
|
||||||
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
#pragma code_page(1252)
|
||||||
|
#endif //_WIN32
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// TEXTINCLUDE
|
||||||
|
//
|
||||||
|
|
||||||
|
1 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"resource.h\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
2 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"#include ""afxres.h""\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
3 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Bitmap
|
||||||
|
//
|
||||||
|
|
||||||
|
IDB_BITMAP_CROIX BITMAP DISCARDABLE "bmp132.bmp"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Dialog
|
||||||
|
//
|
||||||
|
|
||||||
|
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 217, 55
|
||||||
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
|
CAPTION "About GraphInter"
|
||||||
|
FONT 8, "MS Sans Serif"
|
||||||
|
BEGIN
|
||||||
|
ICON 128,-1,11,17,20,20
|
||||||
|
LTEXT "GraphInter Version 1.0",-1,40,10,119,8,SS_NOPREFIX
|
||||||
|
LTEXT "Copyright (C) 1997",-1,40,25,119,8
|
||||||
|
DEFPUSHBUTTON "OK",1,178,7,32,14,WS_GROUP
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_DIALOGMAIN DIALOG DISCARDABLE 0, 0, 329, 252
|
||||||
|
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
||||||
|
CAPTION "Binary Converting Tool"
|
||||||
|
FONT 8, "MS Sans Serif"
|
||||||
|
BEGIN
|
||||||
|
PUSHBUTTON "Help",IDC_HELPBUTTON,191,231,50,14
|
||||||
|
PUSHBUTTON "Quit",IDC_QUIT,249,230,50,14
|
||||||
|
CONTROL "Debug",IDC_BUTTON_DEBUG,"Button",BS_AUTORADIOBUTTON |
|
||||||
|
WS_GROUP,81,79,55,15
|
||||||
|
CONTROL "Release",IDC_BUTTON_RELEASE,"Button",BS_AUTORADIOBUTTON,
|
||||||
|
181,79,55,15
|
||||||
|
GROUPBOX "Version",IDC_STATIC_VERS,31,70,251,25
|
||||||
|
CONTROL "Force binarisation of the Fix",IDC_BUTTON_FIX,"Button",
|
||||||
|
BS_AUTOCHECKBOX | WS_TABSTOP,121,38,155,25
|
||||||
|
LTEXT "Source directory",IDC_STATIC_GAME,42,137,68,12
|
||||||
|
GROUPBOX "Options",IDC_STATIC_GR1,31,34,251,25
|
||||||
|
CONTROL "Complete Binarization",IDC_BUTTON_BIN,"Button",
|
||||||
|
BS_AUTOCHECKBOX | WS_TABSTOP,121,106,80,15
|
||||||
|
GROUPBOX "Dsc",IDC_STATIC_DSC,31,98,251,25
|
||||||
|
PUSHBUTTON "...",IDC_BUTTON_BROWSE3,250,135,17,13
|
||||||
|
EDITTEXT IDC_EDIT_DESTBIND,119,166,125,13,ES_AUTOHSCROLL |
|
||||||
|
ES_READONLY
|
||||||
|
LTEXT "Destination directory",IDC_STATIC_RAW,43,168,64,20
|
||||||
|
PUSHBUTTON "...",IDC_BUTTON_BROWSE2,253,166,17,13
|
||||||
|
EDITTEXT IDC_EDIT_SOURCE,118,136,125,13,ES_AUTOHSCROLL |
|
||||||
|
ES_READONLY
|
||||||
|
GROUPBOX "General directories",IDC_STATIC_GR2,32,124,251,63
|
||||||
|
GROUPBOX "Executable File",IDC_STATIC_EXEC,31,190,251,35
|
||||||
|
PUSHBUTTON "...",IDC_BUTTON_CHANGE,252,201,17,13
|
||||||
|
EDITTEXT IDC_EDIT_EXEC,117,201,125,13,ES_AUTOHSCROLL |
|
||||||
|
ES_READONLY
|
||||||
|
LTEXT "Exe Filename",IDC_STATIC_EXEC1,43,201,64,20
|
||||||
|
LTEXT "Result",IDC_STATIC_RES,20,98,63,11
|
||||||
|
LTEXT "Commands",IDC_STATIC_COM,20,31,63,11
|
||||||
|
CONTROL "",IDC_STATIC_COMMANDEDIT,"Static",SS_WHITEFRAME |
|
||||||
|
SS_SUNKEN | NOT WS_VISIBLE | WS_BORDER,26,42,269,47
|
||||||
|
CONTROL "",IDC_STATIC_RESULTEDIT,"Static",SS_WHITEFRAME | NOT
|
||||||
|
WS_VISIBLE,26,114,269,89
|
||||||
|
CONTROL "Tab1",IDC_PANEL,"SysTabControl32",0x0,7,7,305,212
|
||||||
|
GROUPBOX "Selection",IDC_STATIC_GRALL,207,37,87,85
|
||||||
|
PUSHBUTTON "All",IDC_BUTTON_ALL,222,49,55,15
|
||||||
|
PUSHBUTTON "All in list",IDC_BUTTON_ALLINLIST,222,66,55,15
|
||||||
|
PUSHBUTTON "Clear",IDC_BUTTON_CLEAR,222,83,55,15
|
||||||
|
PUSHBUTTON "Clear all",IDC_BUTTON_CLEARALL,222,100,55,15
|
||||||
|
GROUPBOX "Options",IDC_STATIC_OPT,207,123,87,46
|
||||||
|
CONTROL "Binarize Animations",IDC_BUTTON_CONVANI,"Button",
|
||||||
|
BS_AUTOCHECKBOX | WS_TABSTOP,223,132,75,15
|
||||||
|
CONTROL "Binarize Textures",IDC_BUTTON_CONVTEX,"Button",
|
||||||
|
BS_AUTOCHECKBOX | WS_TABSTOP,223,143,75,15
|
||||||
|
CONTROL "Binarize Levels",IDC_BUTTON_CONVLEVEL,"Button",
|
||||||
|
BS_AUTOCHECKBOX | WS_TABSTOP,223,154,75,15
|
||||||
|
GROUPBOX "Makeanim options",IDC_STATIC_MOPT,207,170,87,47
|
||||||
|
CONTROL "Batch",IDC_BUTTON_USED,"Button",BS_AUTOCHECKBOX |
|
||||||
|
WS_TABSTOP,223,179,75,15
|
||||||
|
CONTROL "All",IDC_BUTTON_A,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||||
|
223,190,75,15
|
||||||
|
CONTROL "Tbl",IDC_BUTTON_Z,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||||
|
223,201,75,15
|
||||||
|
GROUPBOX "ConvImg options",IDC_STATIC_COPT,207,219,87,57
|
||||||
|
CONTROL "BMP",IDC_BUTTON_BMP,"Button",BS_AUTOCHECKBOX |
|
||||||
|
WS_TABSTOP,223,227,75,15
|
||||||
|
CONTROL "TGA",IDC_BUTTON_TGA,"Button",BS_AUTOCHECKBOX |
|
||||||
|
WS_TABSTOP,223,238,75,15
|
||||||
|
CONTROL "Convert16",IDC_BUTTON_C16,"Button",BS_AUTOCHECKBOX |
|
||||||
|
WS_TABSTOP,223,249,75,15
|
||||||
|
CONTROL "Convert32",IDC_BUTTON_C32,"Button",BS_AUTOCHECKBOX |
|
||||||
|
WS_TABSTOP,223,260,75,15
|
||||||
|
PUSHBUTTON "Generate auto.ini",IDC_BUTTON_AUTO,222,278,67,15
|
||||||
|
PUSHBUTTON "Binarize",IDC_BUTTON_CONVERT,222,296,55,15
|
||||||
|
LISTBOX IDC_LIST1,25,37,77,161,LBS_SORT | LBS_OWNERDRAWFIXED |
|
||||||
|
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
||||||
|
WS_TABSTOP
|
||||||
|
LISTBOX IDC_LIST2,107,37,94,161,LBS_SORT | LBS_OWNERDRAWFIXED |
|
||||||
|
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL |
|
||||||
|
WS_VSCROLL | WS_GROUP | WS_TABSTOP
|
||||||
|
LTEXT "There are no datas to convert! \n\n Please, select another Source Directory!",
|
||||||
|
IDC_STATIC_LIST1,25,37,177,161
|
||||||
|
LTEXT "BinaryTool Version",IDC_STATIC_VERS1,82,225,100,14
|
||||||
|
CONTROL "",IDC_STATIC_PROGRESS,"msctls_progress32",WS_BORDER,231,
|
||||||
|
210,87,15
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_DIALOGWARNING DIALOG DISCARDABLE 0, 0, 179, 74
|
||||||
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
|
CAPTION "Family Conversion : Specific / Common"
|
||||||
|
FONT 8, "MS Sans Serif"
|
||||||
|
BEGIN
|
||||||
|
DEFPUSHBUTTON "Yes",IDOK,4,55,80,14
|
||||||
|
PUSHBUTTON "No",IDCANCEL,93,55,80,14
|
||||||
|
LTEXT "",IDC_STATICWARNING,7,7,172,44
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// DESIGNINFO
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
GUIDELINES DESIGNINFO DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
IDD_DIALOGWARNING, DIALOG
|
||||||
|
BEGIN
|
||||||
|
BOTTOMMARGIN, 73
|
||||||
|
END
|
||||||
|
END
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
#endif // English (U.S.) resources
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
|
@ -0,0 +1,262 @@
|
||||||
|
#if !defined(AFX_DLGMAIN_H__C3B78329_60A7_11D1_A944_00A0245D4B6C__INCLUDED_)
|
||||||
|
#define AFX_DLGMAIN_H__C3B78329_60A7_11D1_A944_00A0245D4B6C__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: DlgMain.h : header file
|
||||||
|
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
Description: File containing functions for main window
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
#include "GIItem.h"
|
||||||
|
#include <afxtempl.h>
|
||||||
|
#include "GIType.h"
|
||||||
|
#include "shlobj.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
* for writing a normal line or an error line in RichEdit result window
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
#define C_ComRes_cOkLine 0
|
||||||
|
#define C_ComRes_cErrorLine 1
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CDlgMain dialog
|
||||||
|
|
||||||
|
class CDlgMain : public CDialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CTabCtrl m_oPanel; //used for the tab controls
|
||||||
|
|
||||||
|
CListBox *m_oListType; //first list box with types
|
||||||
|
CListBox *m_oListObject; //second list box with objects
|
||||||
|
|
||||||
|
GI_Type *m_p_oTypeAnims; //the possible types in the first list box
|
||||||
|
GI_Type *m_p_oTypeTextures; //in this way is easy to know at one time with what type we are working
|
||||||
|
GI_Type *m_p_oTypeLevels;
|
||||||
|
|
||||||
|
int m_iCountOfSelections; //the number of all selections in all list associated with the types
|
||||||
|
CProgressCtrl m_oProgress;
|
||||||
|
BOOL m_bConversion;
|
||||||
|
|
||||||
|
BOOL m_bFirstShow; //used for displaying a cross in front of an active object in the second list
|
||||||
|
CDC m_oCrossDC;
|
||||||
|
CBitmap m_oCrossBitmap;
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
* window controls for resizing
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
UINT m_a_uiEditControls[6]; //used for the edit controls
|
||||||
|
int m_a_iSizeLeft[6];
|
||||||
|
char m_cNbEditBox;
|
||||||
|
|
||||||
|
UINT m_a_uiRightButtons[15]; //used for the right push buttons
|
||||||
|
char m_cNbRightButtons;
|
||||||
|
|
||||||
|
UINT m_a_uiRightBut[15]; //used for the right push buttons
|
||||||
|
char m_cNbRightBut;
|
||||||
|
|
||||||
|
UINT m_a_uiRadioButtons[15]; //used for the radio buttons
|
||||||
|
char m_cNbRadioButtons;
|
||||||
|
|
||||||
|
UINT m_a_uiGroupButtons[5]; //used for the group buttons
|
||||||
|
char m_cNbGroupButtons;
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
* result windows: Result and Command
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
CRichEditCtrl m_oRichEditRes; //used for the rich edit control Result
|
||||||
|
CHARFORMAT m_stCharFormatRes;
|
||||||
|
|
||||||
|
CRichEditCtrl m_oRichEditCom; //used for the rich edit control Command
|
||||||
|
CHARFORMAT m_stCharFormatCom;
|
||||||
|
|
||||||
|
BOOL m_bInit; // used for initialize
|
||||||
|
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CDlgMain(CWnd* pParent = NULL); // standard constructor
|
||||||
|
~CDlgMain(); // standard destructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CDlgMain)
|
||||||
|
enum { IDD = IDD_DIALOGMAIN };
|
||||||
|
// NOTE: the ClassWizard will add data members here
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CDlgMain)
|
||||||
|
protected:
|
||||||
|
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
protected:
|
||||||
|
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
private:
|
||||||
|
// when is selected the first panel show only its controls
|
||||||
|
void m_fn_TabC_vShowControlsPanelDir() ;
|
||||||
|
// when is selected the second panel show only its controls
|
||||||
|
void m_fn_TabC_vShowControlsPanelSel() ;
|
||||||
|
// when is selected the third panel show only its controls
|
||||||
|
void m_fn_TabC_vShowControlsPanelRes() ;
|
||||||
|
// set/reset the flag for convering or not the animations
|
||||||
|
void mfn_vConvAnim();
|
||||||
|
// set/reset the flag for convering or not the textures
|
||||||
|
void mfn_vConvTextures();
|
||||||
|
void mfn_vConvLevels();
|
||||||
|
// free the allocated memory
|
||||||
|
void mfn_vFreeMemory() ;
|
||||||
|
void mfn_vFreeMemoryForType(GI_Type **_p_oType) ;
|
||||||
|
// show the controls from the first panel
|
||||||
|
// according to the parameter bChange
|
||||||
|
void m_fn_TabC_vChangeShowControlsPanelDir(BOOL bChange) ;
|
||||||
|
// Show or hide the buttons from the second panel
|
||||||
|
// according to the parameter bChange
|
||||||
|
void m_fn_TabC_vChangeShowControlsPanelSel(BOOL bChange) ;
|
||||||
|
// Show or hide the buttons from the third panel
|
||||||
|
// according to the parameter bChange
|
||||||
|
void m_fn_TabC_vChangeShowControlsPanelRes(BOOL bChange) ;
|
||||||
|
|
||||||
|
// write a line in the rich edit control
|
||||||
|
// with different color (red or black) for Ok or for Error
|
||||||
|
void m_fn_ComRes_vWriteLine( char *szLine, char cLineType ,CRichEditCtrl *_oRichEdit,
|
||||||
|
CHARFORMAT *_stCharFormat);
|
||||||
|
// delete the content of the rich edit control
|
||||||
|
void m_fn_ComRes_vDeleteLines( CRichEditCtrl *_oRichEdit);
|
||||||
|
|
||||||
|
//test if exist the name of the executable file, the directories...
|
||||||
|
BOOL m_fn_bWarningUser();
|
||||||
|
//if the directories does not exist, inform the user
|
||||||
|
void m_fn_vShowPartialWarning(BOOL bSet, char *szPath, char *_szMessage, BOOL * bDisplay, int iID, char *szDir);
|
||||||
|
//only call the function m_fn_bWarningUser() (till now)
|
||||||
|
BOOL m_fn_vTestIniDatas();
|
||||||
|
//function used for start browsing from a directory specified (it applies for Textures and Default sub-directories of RawData directory)
|
||||||
|
void m_fn_vBrowseStartingFromDirectory(char *szPath, int *iResult) ;
|
||||||
|
//used for testing if in one directory exist some subdirectories (also the case for the RawData directory from which to select the sub-directories Textures and Default).
|
||||||
|
BOOL m_fn_bExistDirectories(char *szPath);
|
||||||
|
//obtained the structure needed for browsing
|
||||||
|
void m_fn_vBrowseDirectory(char* szPath, int *p_iResult, ITEMIDLIST *p_stItemRoot);
|
||||||
|
//returning a flag which tells if in the specified path exist files
|
||||||
|
BOOL m_fn_bGetFiles(char *szFile, HANDLE *hHandle, WIN32_FIND_DATA *stFindFileData);
|
||||||
|
//complete the list with objects associated with a type from the informations stored inthe directory
|
||||||
|
void m_fn_vGetDatas(char *szPath);
|
||||||
|
//setting all the variables to the directories, and obtained all the datas in the list box with objects
|
||||||
|
void m_fn_vGetAllTypes();
|
||||||
|
//calling the function m_fn_vGetDatas for all types
|
||||||
|
void m_fn_vGetSetDatasInList(char *szAnims, char *szTextures, char *szLevels);
|
||||||
|
//if the directory exist, add the corresponding type in the list box
|
||||||
|
void m_fn_vAddType(GI_Type * p_oType, char *szReturn, char *szType, char *szDir, int *iNumber);
|
||||||
|
//add objects to the list with objects
|
||||||
|
void m_fn_vCreateLists( CList<GI_Item *,GI_Item *> *_oListObject, char *szPath, char *szType, GI_Item * _p_oItem);
|
||||||
|
//for the selected type create the list with objects associated with it (upadate the second list box with objects)
|
||||||
|
void m_fn_vUpdateListBox(CList<GI_Item *,GI_Item *> *_oListObject,
|
||||||
|
char *szPath, char *szType);
|
||||||
|
//select the first type in the first list box with types and update the info's for the objects
|
||||||
|
void m_fn_vUpdateAll();
|
||||||
|
//make all the objects actives/inactives in the list, modify corresponding the global and local number of selections
|
||||||
|
void m_fn_vSelectAllInList(GI_Type * _p_oType, BOOL bSet) ;
|
||||||
|
//makes all the objects actives/inactives
|
||||||
|
void m_fn_vSelectAll(BOOL bSet) ;
|
||||||
|
//select a type, and for it call the function m_fn_vSelectAllInList
|
||||||
|
void m_fn_vSelectAllForType(BOOL bSet) ;
|
||||||
|
//it is not used anymore
|
||||||
|
int m_fn_iGetAllSelectionsInList(GI_Type * _p_oType) ;
|
||||||
|
//return the total number of objects in all lists
|
||||||
|
int m_fn_iGetAllObjects();
|
||||||
|
//modify the active/inactive state of the object(s)
|
||||||
|
BOOL m_fn_bOnChangeActivation(GI_Item *_p_oItem, int iIndexItem );
|
||||||
|
//depending on the flag bSet, modify the state of the object, and increment the total/local number of selections
|
||||||
|
void m_fn_vChange(GI_Item *p_oItem, GI_Type *p_oType, BOOL bSet );
|
||||||
|
//enable/disable the selections buttons in the second panel
|
||||||
|
void m_fn_vEnableButtons(BOOL bSet) ;
|
||||||
|
//enable/disable the selections buttons in the second panel
|
||||||
|
void m_fn_TabC_vDisableAllButtons() ;
|
||||||
|
void m_fn_TabC_vEnableButtons() ;
|
||||||
|
//enable/disable the buttons Convert and ClearAll
|
||||||
|
void m_fn_vEnableButtonConvert();
|
||||||
|
//enable/disable the button All
|
||||||
|
void m_fn_vEnableButtonAll() ;
|
||||||
|
//change the color of a type depending if it has no objects selected, some objects selected, all objects selected
|
||||||
|
void m_fn_vOnDrawItemListBoxType(LPDRAWITEMSTRUCT lpDIS);
|
||||||
|
//draw a cross in front of an active object
|
||||||
|
void m_fn_vOnDrawItemListBoxObject(LPDRAWITEMSTRUCT lpDIS);
|
||||||
|
//add a type in the list box with types, only if in the corresponding directory are the corresponding datas
|
||||||
|
int m_fn_iAddTestDirType(char *szFiles);
|
||||||
|
//set the global variable of the type to the new type if the number of the elements for that type is not zero
|
||||||
|
void m_fn_vSetTypeInList(GI_Type ** _p_oType, char *szType, int iNumber);
|
||||||
|
|
||||||
|
void m_fn_iGetAllFamilies(GI_Item * p_oItem);
|
||||||
|
void m_fn_iGetAllAnimations(GI_Item * p_oItem);
|
||||||
|
void m_fn_iGetAllTextures(GI_Item * p_oItem);
|
||||||
|
int m_fn_iInitBinGame(char *sString, GI_Item *p_oItem);
|
||||||
|
char m_fn_cExecuteGame(char *szProgramName, char *szDirName, char *szLevelName, char *szDebug, char *szVersion, char *szFirst);
|
||||||
|
void m_fn_vInitBinTextures( char *sString );
|
||||||
|
|
||||||
|
// void m_fn_vBrowseStartingFromDirectory(char* szPath, int *p_iResult);
|
||||||
|
// void m_fn_vBrowseDirectory(char* szPath, int *p_iResult, ITEMIDLIST *p_stItemRoot);
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CDlgMain)
|
||||||
|
afx_msg BOOL OnInitDialog();
|
||||||
|
afx_msg void OnDestroy();
|
||||||
|
afx_msg void OnPaint();
|
||||||
|
afx_msg void OnConvAnim();
|
||||||
|
afx_msg void OnConvTextures();
|
||||||
|
afx_msg void OnConvLevels();
|
||||||
|
afx_msg void OnGenerateAuto();
|
||||||
|
afx_msg void OnUsed();
|
||||||
|
afx_msg void OnAll();
|
||||||
|
afx_msg void OnTbl();
|
||||||
|
afx_msg void OnButtonFix();
|
||||||
|
afx_msg void OnBMP();
|
||||||
|
afx_msg void OnTGA();
|
||||||
|
afx_msg void OnConvert16();
|
||||||
|
afx_msg void OnConvert32();
|
||||||
|
afx_msg void OnSizing( UINT nSide, LPRECT lpRect );
|
||||||
|
afx_msg void OnSelchangePanel(NMHDR* pNMHDR, LRESULT* pResult);
|
||||||
|
afx_msg void OnHelp();
|
||||||
|
afx_msg void OnQuit();
|
||||||
|
afx_msg void OnSelectAll();
|
||||||
|
afx_msg void OnCheckZoo();
|
||||||
|
afx_msg void OnSelectAllInList();
|
||||||
|
afx_msg void OnClear();
|
||||||
|
afx_msg void OnClearAll();
|
||||||
|
afx_msg void OnButtonDebug();
|
||||||
|
afx_msg void OnButtonBin();
|
||||||
|
afx_msg void OnButtonRelease();
|
||||||
|
afx_msg void OnButtonBrowseDestBinD();
|
||||||
|
afx_msg void OnButtonBrowseSource();
|
||||||
|
afx_msg void OnButtonBrowseDestBinR();
|
||||||
|
afx_msg void OnBinarise();
|
||||||
|
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||||
|
afx_msg void OnSelchangeListType();
|
||||||
|
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDIS);
|
||||||
|
afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct) ;
|
||||||
|
afx_msg void OnSelchangeListObject();
|
||||||
|
afx_msg BOOL OnLButtonDownListBoxObject(MSG *pMsg);
|
||||||
|
afx_msg BOOL OnKeyDownListBoxObject(MSG *pMsg);
|
||||||
|
afx_msg void OnButtonBrowseExeFile();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_DLGMAIN_H__C3B78329_60A7_11D1_A944_00A0245D4B6C__INCLUDED_)
|
|
@ -0,0 +1,47 @@
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name : DLGWarning.h
|
||||||
|
|
||||||
|
Author : Mihaela Tancu
|
||||||
|
|
||||||
|
Description : Header file for about dialog box class
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
#include "Resource.h"
|
||||||
|
|
||||||
|
#ifndef __DLGWARNING_H__
|
||||||
|
#define __DLGWARNING_H__
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
CDlgWarning dialog class
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
class CDlgWarning : public CDialog
|
||||||
|
{
|
||||||
|
//data members
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CDlgWarning(CWnd* pParent = NULL); // standard constructor
|
||||||
|
CStatic *m_oStatic;
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CDlgWarning)
|
||||||
|
enum { IDD = IDD_DIALOGWARNING };
|
||||||
|
// NOTE: the ClassWizard will add data members here
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CDlgWarning)
|
||||||
|
virtual BOOL OnInitDialog();
|
||||||
|
afx_msg void OnDestroy();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /*__DLGWARNING_H__*/
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name : GIItem.h
|
||||||
|
|
||||||
|
Author : Mihaela Tancu
|
||||||
|
Description : Define the GI_Item class
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __GIITEM_H__
|
||||||
|
#define __GIITEM_H__
|
||||||
|
|
||||||
|
#include <afxtempl.h>
|
||||||
|
|
||||||
|
class GI_Item
|
||||||
|
{
|
||||||
|
// datas
|
||||||
|
public:
|
||||||
|
BOOL m_bActived; //boolean for telling if the object is active
|
||||||
|
//or inactive (in the list box is drawn a cross in front of an activ object
|
||||||
|
char m_szName[50]; //the name of the object
|
||||||
|
|
||||||
|
CList< char *, char *> m_oListOfFamilies;
|
||||||
|
CList< char *, char *> m_oListOfAnimations;
|
||||||
|
CList< char *, char *> m_oListOfTextures;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// methods
|
||||||
|
GI_Item(BOOL bAct, char *szName); //constructor
|
||||||
|
~GI_Item(); //destructor
|
||||||
|
|
||||||
|
char* m_fn_p_oGetName(void) { return m_szName; } //return the name of the object
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __GIITEM_H__
|
|
@ -0,0 +1,36 @@
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name : GIType.h
|
||||||
|
|
||||||
|
Author : Mihaela Tancu
|
||||||
|
Description : Define the GI_Type class
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __GITYPE_H__
|
||||||
|
#define __GITYPE_H__
|
||||||
|
|
||||||
|
#include <afxtempl.h>
|
||||||
|
#include "GIItem.h"
|
||||||
|
|
||||||
|
|
||||||
|
class GI_Type
|
||||||
|
{
|
||||||
|
// datas
|
||||||
|
public:
|
||||||
|
char m_szName[50]; //name of the type
|
||||||
|
int m_iSelected; //number of selected objects for the type
|
||||||
|
COLORREF m_xTextColor; //the text color of the type in list box
|
||||||
|
CList<GI_Item *,GI_Item *> m_oList; //the list of objects associated with the type
|
||||||
|
|
||||||
|
public:
|
||||||
|
// methods
|
||||||
|
GI_Type(char *szName, int _iSelected, COLORREF m_xTextColor); //contructor
|
||||||
|
~GI_Type(); //destructor
|
||||||
|
|
||||||
|
char* m_fn_p_oGetName(void) { return m_szName; } //return the name of type
|
||||||
|
int m_fn_iGetSelected(void) { return m_iSelected; } //return the number of objects selected for that type
|
||||||
|
void m_fn_iSetName(int _iSelected) { m_iSelected=_iSelected; } //set the number of selected objects
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __GITYPE_H__
|
|
@ -0,0 +1,136 @@
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name :IniData.h
|
||||||
|
|
||||||
|
Author : Mihaela Tancu
|
||||||
|
Description : File containing functions for saving, loading, ...
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __INIDATA_H__
|
||||||
|
#define __INIDATA_H__
|
||||||
|
|
||||||
|
#include <afxdisp.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Constants
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
static COLORREF gs_a_xLineColor[3] = { RGB( 255, 0,0), RGB( 0,0,0), RGB(0, 0, 255)};
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
constants for main window min size
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
#define C_iMainWindowWidth 520
|
||||||
|
#define C_iMainWindowHeight 583
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
File .ini
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
#define C_szIniFile "GIData.ini"
|
||||||
|
#define C_szStartPrgIniFile "StartPrg.ini"
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Structures
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct tdstInitialValue_
|
||||||
|
{
|
||||||
|
char szTempPath1[MAX_PATH]; // temporary path for the destination path
|
||||||
|
char szDestBinDD3D[MAX_PATH]; // name of
|
||||||
|
char szTempPath2[MAX_PATH]; // temporary path for
|
||||||
|
char szSource[MAX_PATH]; // name of
|
||||||
|
char szTempPath3[MAX_PATH]; // temporary path for
|
||||||
|
char szDestBinRD3D[MAX_PATH]; // name of
|
||||||
|
char szTempPath4[MAX_PATH]; // temporary for
|
||||||
|
char szMode[MAX_PATH]; // name of
|
||||||
|
char szTempPath5[MAX_PATH]; // temporary path for
|
||||||
|
char szDestBinDDFX[MAX_PATH]; // name of
|
||||||
|
char szTempPath6[MAX_PATH]; // temporary path for
|
||||||
|
char szDestBinRDFX[MAX_PATH]; // name of
|
||||||
|
/* char szTempPath7[MAX_PATH]; // temporary path
|
||||||
|
char sz3DCard[MAX_PATH]; // name of
|
||||||
|
*/
|
||||||
|
char szTempPath7[MAX_PATH]; // temporary path
|
||||||
|
char szFix[MAX_PATH]; // name of
|
||||||
|
|
||||||
|
char szTempPath8[MAX_PATH]; // temporary name for the exe file
|
||||||
|
char szExeFile[MAX_PATH]; // name of exe
|
||||||
|
} tdstInitialValue;
|
||||||
|
|
||||||
|
extern BOOL bDebug;
|
||||||
|
extern BOOL bConvAnim;
|
||||||
|
extern BOOL bConvTextures;
|
||||||
|
//extern BOOL b3DCard;
|
||||||
|
extern BOOL bConvLevels;
|
||||||
|
extern BOOL bDsc;
|
||||||
|
extern BOOL bFix1;
|
||||||
|
extern BOOL bAuto;
|
||||||
|
extern BOOL bStartPrg;
|
||||||
|
|
||||||
|
typedef struct tdstWindowsPosSize_
|
||||||
|
{
|
||||||
|
RECT stMainPos; // window dimension
|
||||||
|
}tdstWindowsPosSize;
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Globals
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
extern tdstInitialValue g_stInitialData; // initial data
|
||||||
|
extern char g_szIniFile[MAX_PATH]; // ini file
|
||||||
|
extern tdstWindowsPosSize g_stWinPosSize; // program options
|
||||||
|
extern char g_szStartPrgIniFile[MAX_PATH]; // ini file
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Functions
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetDestBinDD3D( char *_szPath );
|
||||||
|
void fn_IniData_vSetSource( char *_szPath );
|
||||||
|
void fn_IniData_vSetDestBinRD3D( char *_szPath );
|
||||||
|
void fn_IniData_vSetDestBinDDFX( char *_szPath );
|
||||||
|
void fn_IniData_vSetDestBinRDFX( char *_szPath );
|
||||||
|
//getting the position and size of the main window
|
||||||
|
void fn_IniData_vGetWindowPosSize( void );
|
||||||
|
//setting the position and size of the main window
|
||||||
|
void fn_IniData_vWriteWindowPosSize( void );
|
||||||
|
//function used for the getting the pos and size of the main window
|
||||||
|
void fn_IniData_vStudyRect( char *_szString, RECT *_p_stRect );
|
||||||
|
//obtaining all thbe ddatas in the .ini file for the executable name,
|
||||||
|
//for the local path of the executable file, the path for GameData,
|
||||||
|
//RawData, Textures and Default directories, and
|
||||||
|
//the position and size of the main windoow of the application
|
||||||
|
void fn_IniData_vGetDatasFromFile( BOOL _bFirst );
|
||||||
|
void fn_IniData_vSetMode( BOOL bSetIgnore);
|
||||||
|
void fn_IniData_vSet3DCard( BOOL bSetIgnore);
|
||||||
|
void fn_ComRes_vDeleteLines( CRichEditCtrl *_oRichEdit);
|
||||||
|
void fn_ComRes_vWriteLine( char *szLine, char cLineType ,CRichEditCtrl* _oRichEdit,
|
||||||
|
CHARFORMAT* _stCharFormat);
|
||||||
|
|
||||||
|
void fn_IniData_vSetGDDebugBin( char *_szPath );
|
||||||
|
void fn_IniData_vSetGDReleaseBin( char *_szPath );
|
||||||
|
|
||||||
|
void fn_IniData_vSetSPDebug( char *_szPath );
|
||||||
|
void fn_IniData_vSetSPRelease( char *_szPath );
|
||||||
|
void fn_IniData_vSetAskAtEachTime( char *_szPath );
|
||||||
|
void fn_IniData_vSetAskAtEachTime( int iValue );
|
||||||
|
void fn_IniData_vSetBinDebugIsOk( int iValue );
|
||||||
|
void fn_IniData_vSetBinReleaseIsOk( int iValue );
|
||||||
|
void fn_IniData_vSetBinUseBinaryData( int iValue );
|
||||||
|
void fn_IniData_vGetDatasFromStartFile( BOOL _bFirst );
|
||||||
|
void fn_IniData_vSetDscCreated(BOOL bDsc);
|
||||||
|
void fn_IniData_vSetFix( BOOL bFix );
|
||||||
|
void fn_IniData_vSetCompleteBinarization( BOOL bDsc );
|
||||||
|
|
||||||
|
#endif //__INIDATA_H__
|
|
@ -0,0 +1,79 @@
|
||||||
|
// **********************************************************************************
|
||||||
|
// * "Levels.h" *
|
||||||
|
// * Written by : Mihaela Tancu *
|
||||||
|
// **********************************************************************************
|
||||||
|
#ifndef LEVELS_H
|
||||||
|
#define LEVELS_H
|
||||||
|
|
||||||
|
#include "Scr.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Defines
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
#define M_InsertAlways "InsertAlways"
|
||||||
|
#define M_FichierALW ".alw"
|
||||||
|
#define M_LinkCharacter "LinkCharacter"
|
||||||
|
|
||||||
|
#define M_Texture "Texture"
|
||||||
|
#define M_FichierTEX ".tex"
|
||||||
|
#define M_LoadTexture "LoadTexture"
|
||||||
|
|
||||||
|
#define M_InsertCharacter "InsertCharacter"
|
||||||
|
#define M_FichierLVL ".lvl"
|
||||||
|
|
||||||
|
typedef char xString[256];
|
||||||
|
|
||||||
|
typedef struct MLT_tdstTextures_
|
||||||
|
{
|
||||||
|
xString sName;
|
||||||
|
xString sLoadTexture;
|
||||||
|
|
||||||
|
} MLT_tdstTextures;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct MLT_tdstAlways_
|
||||||
|
{
|
||||||
|
xString sName;
|
||||||
|
xString sLinkCharacter;
|
||||||
|
|
||||||
|
} MLT_tdstAlways;
|
||||||
|
|
||||||
|
typedef struct MLT_tdstInsertCharacter_
|
||||||
|
{
|
||||||
|
xString sName;
|
||||||
|
xString sLinkCharacter;
|
||||||
|
|
||||||
|
} MLT_tdstInsertCharacter;
|
||||||
|
|
||||||
|
extern MLT_tdstAlways **g_hAlwaysInFile;
|
||||||
|
extern long g_lAlwaysIndex;
|
||||||
|
|
||||||
|
void MLT_vLoadALWFileInLib(char *szFileName);
|
||||||
|
void MLT_vInitALWLoad();
|
||||||
|
SCR_tde_Anl_ReturnValue GLI_xLoadALWCallback(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType);
|
||||||
|
void MLT_vEraseALWLib();
|
||||||
|
void MLT_vInitSystem();
|
||||||
|
void MLT_vExitSystem();
|
||||||
|
|
||||||
|
extern MLT_tdstInsertCharacter **g_hInsertCharacterInFile;
|
||||||
|
extern long g_lInsertCharacterIndex;
|
||||||
|
|
||||||
|
void MLT_vLoadLVLFileInLib(char *szFileName);
|
||||||
|
void MLT_vInitLVLLoad();
|
||||||
|
SCR_tde_Anl_ReturnValue GLI_xLoadLVLCallback(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType);
|
||||||
|
void MLT_vEraseLVLLib();
|
||||||
|
|
||||||
|
extern MLT_tdstTextures **g_hTexturesInFile;
|
||||||
|
extern long g_lTexturesIndex;
|
||||||
|
|
||||||
|
void MLT_vLoadTEXFileInLib(char *szFileName);
|
||||||
|
void MLT_vInitTEXLoad();
|
||||||
|
SCR_tde_Anl_ReturnValue GLI_xLoadTEXCallback(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType);
|
||||||
|
void MLT_vEraseTEXLib();
|
||||||
|
|
||||||
|
char *MLT_p_cGetFileNameWithoutExt(char *_sFileName);
|
||||||
|
char *MLT_p_cGetFileNameWithoutPath(char *sFileName);
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,57 @@
|
||||||
|
// MainFrm.h : interface of the CMainFrame class
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#if !defined(AFX_MAINFRM_H__6E893D4B_5B46_11D1_A939_00A0245D4B6C__INCLUDED_)
|
||||||
|
#define AFX_MAINFRM_H__6E893D4B_5B46_11D1_A939_00A0245D4B6C__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
|
||||||
|
class CMainFrame : public CFrameWnd
|
||||||
|
{
|
||||||
|
protected: // create from serialization only
|
||||||
|
CMainFrame();
|
||||||
|
DECLARE_DYNCREATE(CMainFrame)
|
||||||
|
|
||||||
|
// Attributes
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Operations
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CMainFrame)
|
||||||
|
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
public:
|
||||||
|
virtual ~CMainFrame();
|
||||||
|
#ifdef _DEBUG
|
||||||
|
virtual void AssertValid() const;
|
||||||
|
virtual void Dump(CDumpContext& dc) const;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
protected: // control bar embedded members
|
||||||
|
CStatusBar m_wndStatusBar;
|
||||||
|
CToolBar m_wndToolBar;
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
protected:
|
||||||
|
//{{AFX_MSG(CMainFrame)
|
||||||
|
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||||
|
// NOTE - the ClassWizard will add and remove member functions here.
|
||||||
|
// DO NOT EDIT what you see in these blocks of generated code!
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_MAINFRM_H__6E893D4B_5B46_11D1_A939_00A0245D4B6C__INCLUDED_)
|
|
@ -0,0 +1,25 @@
|
||||||
|
// **********************************************************************************
|
||||||
|
// * "Print.h" *
|
||||||
|
// * Written by : Mihaela Tancu *
|
||||||
|
// **********************************************************************************
|
||||||
|
#ifndef PRINT_H
|
||||||
|
#define PRINT_H
|
||||||
|
|
||||||
|
extern char szDestBinDir[256];
|
||||||
|
extern char sInitialDir[256];
|
||||||
|
extern char szSource[256];
|
||||||
|
extern char sSource[256];
|
||||||
|
extern char sMes[50];
|
||||||
|
extern char sOK[50];
|
||||||
|
extern char sCancel[50];
|
||||||
|
|
||||||
|
#define C_ComRes_cOkLine 1
|
||||||
|
#define C_ComRes_cErrorLine 0
|
||||||
|
#define C_ComRes_cWarningLine 2
|
||||||
|
|
||||||
|
void fn_vAfxOutputStringRes( char* _szString, char _Line);
|
||||||
|
void fn_vAfxOutputStringCom( char* _szString, char _Line);
|
||||||
|
extern void MLT_vOutput( char cLineType, char *szFormat, ... );
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,84 @@
|
||||||
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// Microsoft Developer Studio generated include file.
|
||||||
|
// Used by BinaryTool.rc
|
||||||
|
//
|
||||||
|
#define IDS_SHEET_GRAPHIC 1
|
||||||
|
#define IDD_ABOUTBOX 100
|
||||||
|
#define IDD_MAX23DOS_DIALOG 101
|
||||||
|
#define IDC_RICHEDIT_COMMAND 102
|
||||||
|
#define IDC_RICHEDIT_RESULT 103
|
||||||
|
#define IDR_MAINFRAME 128
|
||||||
|
#define IDR_GRAPHITYPE 129
|
||||||
|
#define IDD_DIALOGMAIN 131
|
||||||
|
#define IDB_BITMAP_CROIX 132
|
||||||
|
#define IDD_DIALOGWARNING 133
|
||||||
|
#define IDC_BUTTON_ALL 1000
|
||||||
|
#define IDC_EDIT_DESTBIND 1001
|
||||||
|
#define IDC_EDIT_SOURCE 1002
|
||||||
|
#define IDC_BUTTON_BROWSE3 1003
|
||||||
|
#define IDC_EDIT_DESTBINR 1004
|
||||||
|
#define IDC_BUTTON_BROWSE4 1005
|
||||||
|
#define IDC_HELPBUTTON 1006
|
||||||
|
#define IDC_QUIT 1007
|
||||||
|
#define IDC_PANEL 1008
|
||||||
|
#define IDC_BUTTON_ALLINLIST 1009
|
||||||
|
#define IDC_BUTTON_CLEAR 1010
|
||||||
|
#define IDC_BUTTON_CLEARALL 1011
|
||||||
|
#define IDC_TAB1 1012
|
||||||
|
#define IDC_BUTTON_CONVERT 1013
|
||||||
|
#define IDC_STATIC_RESULTEDIT 1014
|
||||||
|
#define IDC_STATIC_COMMANDEDIT 1015
|
||||||
|
#define IDC_BUTTON_BROWSE2 1016
|
||||||
|
#define IDC_STATIC_GAME 1017
|
||||||
|
#define IDC_STATIC_TEXT 1018
|
||||||
|
#define IDC_STATIC_GR1 1019
|
||||||
|
#define IDC_STATIC_RAW 1020
|
||||||
|
#define IDC_STATIC_GR2 1021
|
||||||
|
#define IDC_STATIC_RES 1022
|
||||||
|
#define IDC_STATIC_COM 1023
|
||||||
|
#define IDC_STATIC_GRALL 1024
|
||||||
|
#define IDC_LIST1 1025
|
||||||
|
#define IDC_LIST2 1026
|
||||||
|
#define IDC_STATIC_LIST1 1027
|
||||||
|
#define IDC_BUTTON_DEBUG 1028
|
||||||
|
#define IDC_BUTTON_RELEASE 1029
|
||||||
|
#define IDC_BUTTON_CONVTEX 1030
|
||||||
|
#define IDC_BUTTON_CONVANI 1031
|
||||||
|
#define IDC_STATIC_OPT 1032
|
||||||
|
#define IDC_BUTTON_FIX 1033
|
||||||
|
//#define IDC_BUTTON_D3D 1033
|
||||||
|
//#define IDC_BUTTON_DFX 1034
|
||||||
|
#define IDC_STATIC_VERS 1035
|
||||||
|
#define IDC_BUTTON_ANIONLY 1036
|
||||||
|
#define IDC_BUTTON_USED 1037
|
||||||
|
#define IDC_STATIC_VERS1 1038
|
||||||
|
#define IDC_STATIC_PROGRESS 1039
|
||||||
|
#define IDC_BUTTON_CONVLEVEL 1040
|
||||||
|
#define IDC_STATIC_EXEC 1041
|
||||||
|
#define IDC_BUTTON_CHANGE 1042
|
||||||
|
#define IDC_EDIT_EXEC 1043
|
||||||
|
#define IDC_STATIC_EXEC1 1044
|
||||||
|
#define IDC_BUTTON_BIN 1045
|
||||||
|
#define IDC_STATIC_DSC 1046
|
||||||
|
#define IDC_BUTTON_A 1047
|
||||||
|
#define IDC_BUTTON_Z 1048
|
||||||
|
#define IDC_BUTTON_BMP 1049
|
||||||
|
#define IDC_BUTTON_TGA 1050
|
||||||
|
#define IDC_BUTTON_C16 1051
|
||||||
|
#define IDC_BUTTON_C32 1052
|
||||||
|
#define IDC_STATIC_COPT 1053
|
||||||
|
#define IDC_STATIC_MOPT 1054
|
||||||
|
#define IDC_BUTTON_AUTO 1055
|
||||||
|
#define IDC_STATICWARNING 1056
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_3D_CONTROLS 1
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 133
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1041
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
#endif
|
||||||
|
#endif
|
|
@ -0,0 +1,26 @@
|
||||||
|
// 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__6E893D49_5B46_11D1_A939_00A0245D4B6C__INCLUDED_)
|
||||||
|
#define AFX_STDAFX_H__6E893D49_5B46_11D1_A939_00A0245D4B6C__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
|
||||||
|
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||||
|
|
||||||
|
#include <afxwin.h> // MFC core and standard components
|
||||||
|
#include <afxext.h> // MFC extensions
|
||||||
|
#include <afxdisp.h> // MFC OLE automation classes
|
||||||
|
#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__6E893D49_5B46_11D1_A939_00A0245D4B6C__INCLUDED_)
|
|
@ -0,0 +1,159 @@
|
||||||
|
// **********************************************************************************
|
||||||
|
// * "l_global_v6.h" *
|
||||||
|
// * Written by : Sébastien Rubens *
|
||||||
|
// * Tabulations : 4 char *
|
||||||
|
// **********************************************************************************
|
||||||
|
#ifndef L_GLOBAL_V6_H
|
||||||
|
#define L_GLOBAL_V6_H
|
||||||
|
|
||||||
|
#include "a3x_glob.h"
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
// Enumerates values
|
||||||
|
enum
|
||||||
|
{ eNoKey,
|
||||||
|
eSimpleKey,
|
||||||
|
eDoubleKey
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{ eStackBinStrings,
|
||||||
|
eStackBinVertexes,
|
||||||
|
eStackBinQuaternions,
|
||||||
|
eStackBinA3dGENERAL,
|
||||||
|
eStackBinChannels,
|
||||||
|
eStackBinFrames,
|
||||||
|
eStackBinOnlyFrames,
|
||||||
|
eStackBinHierarchies,
|
||||||
|
eStackBinChannelNames,
|
||||||
|
|
||||||
|
eStackSavedVertexes,
|
||||||
|
eStackSavedQuaternions,
|
||||||
|
eStackSavedNTTO,
|
||||||
|
|
||||||
|
eStackFileA3dAnimationGENERAL,
|
||||||
|
eStackFileVertexes,
|
||||||
|
eStackFileQuaternions,
|
||||||
|
eStackFileHierarchy,
|
||||||
|
eStackFileNTTO,
|
||||||
|
eStackFileOnlyFrame,
|
||||||
|
eStackFileKeyFrame,
|
||||||
|
eStackFileFrame,
|
||||||
|
eStackFileChannel,
|
||||||
|
eStackFileEvent,
|
||||||
|
eStackBinMorphInformation,
|
||||||
|
|
||||||
|
eStackBinSndEventIdList,
|
||||||
|
eStackBinEvent,
|
||||||
|
|
||||||
|
eStackBinNbMax
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
// Macros definitions
|
||||||
|
|
||||||
|
#define D_BINSCR_LogOld 0
|
||||||
|
#define D_BINSCR_LogNew 1
|
||||||
|
|
||||||
|
#define M_GetStackAlloc( NumStack ) (tdstStacks[(NumStack)].slPosAlloc)
|
||||||
|
#define M_GetStackPos( NumStack ) (tdstStacks[(NumStack)].slStackPos)
|
||||||
|
|
||||||
|
#define ReadUChar( Num ) ( (unsigned char) atoi(_ap_SzParam[(Num)]) )
|
||||||
|
#define ReadSChar( Num ) ( (signed char) atoi(_ap_SzParam[(Num)]) )
|
||||||
|
#define ReadUShort( Num ) ( (unsigned short) atoi(_ap_SzParam[(Num)]) )
|
||||||
|
#define ReadSShort( Num ) ( (signed short) atoi(_ap_SzParam[(Num)]) )
|
||||||
|
#define ReadULong( Num ) ( (unsigned long) atol(_ap_SzParam[(Num)]) )
|
||||||
|
#define ReadSLong( Num ) ( (signed long) atol(_ap_SzParam[(Num)]) )
|
||||||
|
#define ReadFloat( Num ) ( (float) atof(_ap_SzParam[(Num)]) )
|
||||||
|
#define ReadDouble( Num ) ( (double) atof(_ap_SzParam[(Num)]) )
|
||||||
|
#define ReadSebReal( Num ) ( (SEB_xReal) atof(_ap_SzParam[(Num)]) )
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
// Types definitions
|
||||||
|
|
||||||
|
typedef struct tdstBinStackInfos_
|
||||||
|
{
|
||||||
|
signed long slPosAlloc;
|
||||||
|
signed long slStackPos;
|
||||||
|
signed long slMaxPos;
|
||||||
|
} tdstBinStackInfos;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct tdstSndEventId_
|
||||||
|
{
|
||||||
|
char sName[200];
|
||||||
|
unsigned long ulVal1;
|
||||||
|
unsigned long ulVal2;
|
||||||
|
} tdstSndEventId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
// Extern datas definitions
|
||||||
|
extern tdstBinStackInfos tdstStacks [];
|
||||||
|
extern tdFileName ax_xStrings [];
|
||||||
|
extern tdxVector3 axa3_xVertexes [];
|
||||||
|
extern tdxQuater4 axa4_xBinQuaternions [];
|
||||||
|
extern tdstBinA3dAnimationGENERAL ax_tdstA3dGENERAL [];
|
||||||
|
extern tdstBinChannel ax_tdstChannels [];
|
||||||
|
extern tdstBinFrame ax_tdstFrames [];
|
||||||
|
extern tdstBinOnlyFrame ax_tdstOnlyFrames [];
|
||||||
|
extern tdstBinHierarchy ax_tdstHierarchies [];
|
||||||
|
extern tdFileName ax_xChannelNames [];
|
||||||
|
extern tdstSndEventId ax_tdstSndEventId [];
|
||||||
|
extern tdstBinEvent ax_tdstEvents [];
|
||||||
|
extern tdstBinMorphData ax_tdstBinMorphInfos [];
|
||||||
|
|
||||||
|
extern tdxVector3 ax_tdxSavedVertexes [];
|
||||||
|
extern tdxQuater4 ax_tdxSavedQuaternions [];
|
||||||
|
extern tdstNTTO ax_tdstSavedNTTO [];
|
||||||
|
|
||||||
|
extern tdstFileA3dAnimationGENERAL ax_tdstFileA3dGENERAL [];
|
||||||
|
extern tdxULongVector3 ax_tdxFileVertexes [];
|
||||||
|
extern tdxSShortQuater4 ax_tdxFileQuaternions [];
|
||||||
|
extern tdstFileHierarchy ax_tdstFileHierarchy [];
|
||||||
|
extern tdstNTTO ax_tdstFileNTTO [];
|
||||||
|
extern tdstFileOnlyFrame ax_tdstFileOnlyFrame [];
|
||||||
|
extern tdstFileKeyFrame ax_tdstFileKeyFrame [];
|
||||||
|
extern tdstFileFrame ax_tdstFileFrame [];
|
||||||
|
extern tdstFileChannel ax_tdstFileChannel [];
|
||||||
|
extern tdstFileEvent ax_tdstFileEvent [];
|
||||||
|
extern tdstFileMorphData ax_tdstFileMorphInfos []; //AR980305
|
||||||
|
|
||||||
|
extern unsigned short uwOkAnimationFile; // Flag
|
||||||
|
|
||||||
|
extern tdxVector3 a3_xVector0;
|
||||||
|
extern tdxVector3 a3_xVector1;
|
||||||
|
extern tdxQuater4 a4_xQuater0;
|
||||||
|
extern tdxQuater4 a4_xQuater1;
|
||||||
|
extern FILE *ErrorFile, *SizeOut, *EventFile;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef L_GLOBAL_V6_C
|
||||||
|
// **********************************************************************************
|
||||||
|
// Extern fonctions definitions
|
||||||
|
extern void fn_v_AllocateOnStack( unsigned short uwNumStack,
|
||||||
|
signed long slWantedSize );
|
||||||
|
extern void fn_v_DeAllocateOnStack( unsigned short uwNumStack,
|
||||||
|
signed long slSize );
|
||||||
|
extern void fn_v_ResetStacks( void );
|
||||||
|
|
||||||
|
extern void fn_v_LogSectionBegin( int _bFlagNew,
|
||||||
|
char *_szType,
|
||||||
|
char *_szString );
|
||||||
|
extern void fn_v_LogSectionEnd( void );
|
||||||
|
|
||||||
|
extern void fn_v_InitMemV6i( void );
|
||||||
|
extern void fn_v_KillMem( void );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,25 @@
|
||||||
|
// **********************************************************************************
|
||||||
|
// * "scr2bin.h" *
|
||||||
|
// * Written by : Sébastien Rubens *
|
||||||
|
// * Tabulations : 4 char *
|
||||||
|
// **********************************************************************************
|
||||||
|
#ifndef MAKEANIM_H
|
||||||
|
#define MAKEANIM_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
extern char szFamilyName[];
|
||||||
|
|
||||||
|
extern unsigned short uwNumOfAnim, uwAnalysedAnim;
|
||||||
|
extern tdFileName TabShortFileName[];
|
||||||
|
extern char TabValidAnimations[];
|
||||||
|
extern char LongActorName[];
|
||||||
|
extern char LongFileName[];
|
||||||
|
extern char AnimationName[];
|
||||||
|
|
||||||
|
extern void fn_vAnimationsOnly(char *szFamName);
|
||||||
|
extern void fn_vTextures(char *szLevelName);
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
#endif
|
|
@ -0,0 +1,5 @@
|
||||||
|
SCC = This is a Source Code Control file
|
||||||
|
|
||||||
|
[BinaryTool.dsp]
|
||||||
|
SCC_Aux_Path = "\\srvprojets-ma\Rayman4_DS\Versions\Rayman4DS\Tools"
|
||||||
|
SCC_Project_Name = "$/CPA/Appli/BinaryTool", NBAAAAAA
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -0,0 +1,162 @@
|
||||||
|
// **********************************************************************************
|
||||||
|
// * "Anims.c" *
|
||||||
|
// * Written by : Mihaela Tancu *
|
||||||
|
// **********************************************************************************
|
||||||
|
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <direct.h>
|
||||||
|
|
||||||
|
#include "Anims.h"
|
||||||
|
|
||||||
|
MLT_tdstAnim **g_hAnimInFile;
|
||||||
|
long g_lAnimIndex;
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_xLoadAnim
|
||||||
|
Description:
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
SCR_tde_Anl_ReturnValue MLT_xLoadAnim(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
|
||||||
|
{
|
||||||
|
MLT_tdstAnim *p_stAnim;
|
||||||
|
|
||||||
|
switch (cType)
|
||||||
|
{
|
||||||
|
case SCR_EA_Anl_BeginSection:
|
||||||
|
p_stAnim=(MLT_tdstAnim*)malloc(sizeof(MLT_tdstAnim));
|
||||||
|
SCR_M_RdL0_SetSectionLong(0,0,(long)p_stAnim);
|
||||||
|
SCR_M_RdL0_SetContextLong(0,0,(long)p_stAnim);
|
||||||
|
sprintf(p_stAnim->sName,"%s",SCR_M_RdL0_GetCompleteSectionNameR(0));
|
||||||
|
strcpy(p_stAnim->sAnimation,"");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_Entry:
|
||||||
|
SCR_M_RdL0_GetContextLong(0,0,MLT_tdstAnim*,p_stAnim);
|
||||||
|
|
||||||
|
// Loading of object's Anim
|
||||||
|
if (strcmp(szAction,M_Animation)==0)
|
||||||
|
{
|
||||||
|
sprintf(p_stAnim->sAnimation,"%s",szParams[0]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_EndSection:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return SCR_ERV_Anl_NormalReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: GLI_xLoadSTACallback
|
||||||
|
Description:
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
SCR_tde_Anl_ReturnValue GLI_xLoadSTACallback(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
|
||||||
|
{
|
||||||
|
MLT_tdstAnim **p_xAnimInFile;
|
||||||
|
long xNbAnim;
|
||||||
|
|
||||||
|
switch (cType)
|
||||||
|
{
|
||||||
|
case SCR_EA_Anl_BeginSection:
|
||||||
|
p_xAnimInFile = (MLT_tdstAnim**)malloc(sizeof(MLT_tdstAnim*));
|
||||||
|
|
||||||
|
SCR_M_RdL0_SetContextLong(0,0,(long)p_xAnimInFile);
|
||||||
|
SCR_M_RdL0_SetContextLong(0,1,(long)0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_EndSubSection:
|
||||||
|
if (strcmp(szParams[0],M_CreateNewState)==0)
|
||||||
|
{
|
||||||
|
MLT_tdstAnim *hAnim;
|
||||||
|
|
||||||
|
SCR_M_RdL0_GetContextLong(0,0,MLT_tdstAnim**,p_xAnimInFile);
|
||||||
|
SCR_M_RdL0_GetContextLong(0,1,long,xNbAnim);
|
||||||
|
|
||||||
|
p_xAnimInFile = (MLT_tdstAnim**)realloc(p_xAnimInFile,(++xNbAnim)*sizeof(MLT_tdstAnim*));
|
||||||
|
|
||||||
|
SCR_M_RdL0_GetSectionLong(1,0,MLT_tdstAnim*,hAnim);
|
||||||
|
p_xAnimInFile[xNbAnim-1]=hAnim;
|
||||||
|
|
||||||
|
SCR_M_RdL0_SetContextLong(0,0,(long)p_xAnimInFile);
|
||||||
|
SCR_M_RdL0_SetContextLong(0,1,(long)xNbAnim);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_EndSection:
|
||||||
|
SCR_M_RdL0_GetContextLong(0,0,MLT_tdstAnim**,p_xAnimInFile);
|
||||||
|
SCR_M_RdL0_GetContextLong(0,1,long,xNbAnim);
|
||||||
|
SCR_M_RdL0_SetSectionLong(0,0,(long)p_xAnimInFile);
|
||||||
|
SCR_M_RdL0_SetSectionLong(0,1,(long)xNbAnim);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return SCR_ERV_Anl_NormalReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: GLI_xLoadSTACallback
|
||||||
|
Description: init for loading an STA file
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vInitSTALoad()
|
||||||
|
{
|
||||||
|
// Init des scripts et lecture du fichier
|
||||||
|
SCR_fn_v_RdL0_RegisterCallback(M_CreateNewState,MLT_xLoadAnim, SCR_CRC_c_RdL0_ForSection);
|
||||||
|
SCR_fn_v_RdL0_RegisterCallback(M_FichierSTA,GLI_xLoadSTACallback, SCR_CRC_c_RdL0_ForFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vLoadSTAFileInLib
|
||||||
|
Description: Load Sta file in a lib
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vLoadSTAFileInLib(char *szFileName)
|
||||||
|
{
|
||||||
|
SCR_tdst_Cxt_Values *p_stVal;
|
||||||
|
|
||||||
|
if(SCR_fn_c_RdL0_IsSectionExists(szFileName))
|
||||||
|
{
|
||||||
|
p_stVal = SCR_fnp_st_RdL0_AnalyseSection(szFileName, SCR_CDF_uw_Anl_ForceAnalyse);
|
||||||
|
|
||||||
|
g_hAnimInFile = (MLT_tdstAnim **)SCR_M_ul_RdL0_ExtractLongValue(p_stVal,0);
|
||||||
|
g_lAnimIndex = (long)SCR_M_ul_RdL0_ExtractLongValue(p_stVal,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vEraseSTALib
|
||||||
|
Description: free all the object in the list
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vEraseSTALib()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if(g_hAnimInFile == NULL) return;
|
||||||
|
|
||||||
|
for(i=0; i<g_lAnimIndex; i++)
|
||||||
|
{
|
||||||
|
if(g_hAnimInFile[i] == NULL) continue;
|
||||||
|
free(g_hAnimInFile[i]);
|
||||||
|
}
|
||||||
|
g_lAnimIndex = 0;
|
||||||
|
free(g_hAnimInFile);
|
||||||
|
g_hAnimInFile = NULL;
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,224 @@
|
||||||
|
// **********************************************************************************
|
||||||
|
// * "BinaryTool.c" *
|
||||||
|
// * Written by : Mihaela Tancu *
|
||||||
|
// **********************************************************************************
|
||||||
|
|
||||||
|
|
||||||
|
// BinaryTool.cpp : Defines the class behaviors for the application.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "BinaryTool.h"
|
||||||
|
|
||||||
|
//Mihaela Tancu
|
||||||
|
#include "MainFrm.h"
|
||||||
|
#include "DlgMain.h"
|
||||||
|
#include "IniData.h"
|
||||||
|
#include <io.h>
|
||||||
|
//Mihaela Tancu
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBinaryToolApp
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CBinaryToolApp, CWinApp)
|
||||||
|
//{{AFX_MSG_MAP(CBinaryToolApp)
|
||||||
|
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
|
||||||
|
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||||
|
// DO NOT EDIT what you see in these blocks of generated code!
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBinaryToolApp construction
|
||||||
|
|
||||||
|
CBinaryToolApp::CBinaryToolApp()
|
||||||
|
{
|
||||||
|
// TODO: add construction code here,
|
||||||
|
// Place all significant initialization in InitInstance
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// The one and only CBinaryToolApp object
|
||||||
|
|
||||||
|
//Mihaela Tancu
|
||||||
|
CBinaryToolApp theApp;
|
||||||
|
|
||||||
|
CRichEditCtrl* p_oRichEditRes;
|
||||||
|
CHARFORMAT* p_stCharFormatRes;
|
||||||
|
CRichEditCtrl* p_oRichEditCom;
|
||||||
|
CHARFORMAT* p_stCharFormatCom;
|
||||||
|
CWinThread* p_ThMain;
|
||||||
|
|
||||||
|
char sConfFile[50];
|
||||||
|
char sInitialDir1[50];
|
||||||
|
extern BOOL bDsc;
|
||||||
|
char sRead[256];
|
||||||
|
|
||||||
|
void fn_vAfxOutputStringRes( char* _szString, char _Line)
|
||||||
|
{
|
||||||
|
fn_ComRes_vWriteLine( _szString, _Line ,p_oRichEditRes, p_stCharFormatRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
void fn_vAfxOutputStringCom( char* _szString, char _Line)
|
||||||
|
{
|
||||||
|
fn_ComRes_vWriteLine( _szString, _Line ,p_oRichEditCom, p_stCharFormatCom);
|
||||||
|
}
|
||||||
|
//Mihaela Tancu
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBinaryToolApp initialization
|
||||||
|
|
||||||
|
BOOL CBinaryToolApp::InitInstance()
|
||||||
|
{
|
||||||
|
AfxEnableControlContainer();
|
||||||
|
|
||||||
|
// Standard initialization
|
||||||
|
// If you are not using these features and wish to reduce the size
|
||||||
|
// of your final executable, you should remove from the following
|
||||||
|
// the specific initialization routines you do not need.
|
||||||
|
|
||||||
|
#ifdef _AFXDLL
|
||||||
|
Enable3dControls(); // Call this when using MFC in a shared DLL
|
||||||
|
#else
|
||||||
|
Enable3dControlsStatic(); // Call this when linking to MFC statically
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
//Mihaela Tancu - New auto
|
||||||
|
/* GetCurrentDirectory(256, sInitialDir1);
|
||||||
|
strcpy(sConfFile, sInitialDir1);
|
||||||
|
strcat(sConfFile, "\\Auto.ini");
|
||||||
|
FILE *f;
|
||||||
|
if (_access( sConfFile, 0) != -1) // if the configuration file exists
|
||||||
|
{
|
||||||
|
bDsc = TRUE;
|
||||||
|
// read the file
|
||||||
|
f = fopen(sConfFile, "r");
|
||||||
|
while(fgets(sRead, 256, f) != NULL)
|
||||||
|
{
|
||||||
|
if (strstr(sRead, "ExeFile"))
|
||||||
|
{
|
||||||
|
strcpy(g_stInitialData.szExeFile, sRead+8);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strstr(sRead, "SourceDir"))
|
||||||
|
{
|
||||||
|
strcpy(g_stInitialData.szSource, sRead+10);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strstr(sRead, "DestDir"))
|
||||||
|
{
|
||||||
|
// strcpy(szDestBinDir, sRead+10);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strstr(sRead, "Maps"))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!strcmp(sRead, "END")) //it is the end of the sequence
|
||||||
|
{
|
||||||
|
//get all data
|
||||||
|
// convert the levels
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
*/
|
||||||
|
//Mihaela Tancu - New auto
|
||||||
|
|
||||||
|
|
||||||
|
// create the dialog for the application
|
||||||
|
CDlgMain dlg;
|
||||||
|
m_pMainWnd = &dlg;
|
||||||
|
|
||||||
|
p_oRichEditCom = &dlg.m_oRichEditCom;
|
||||||
|
p_stCharFormatCom = &dlg.m_stCharFormatCom;
|
||||||
|
p_oRichEditRes = &dlg.m_oRichEditRes;
|
||||||
|
p_stCharFormatRes = &dlg.m_stCharFormatRes;
|
||||||
|
int nResponse = dlg.DoModal();
|
||||||
|
//Mihaela Tancu
|
||||||
|
if (nResponse == IDOK)
|
||||||
|
{
|
||||||
|
// TODO: Place code here to handle when the dialog is
|
||||||
|
// dismissed with OK
|
||||||
|
}
|
||||||
|
else if (nResponse == IDCANCEL)
|
||||||
|
{
|
||||||
|
// TODO: Place code here to handle when the dialog is
|
||||||
|
// dismissed with Cancel
|
||||||
|
}
|
||||||
|
|
||||||
|
// Since the dialog has been closed, return FALSE so that we exit the
|
||||||
|
// application, rather than start the application's message pump.
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CAboutDlg dialog used for App About
|
||||||
|
|
||||||
|
class CAboutDlg : public CDialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CAboutDlg();
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CAboutDlg)
|
||||||
|
enum { IDD = IDD_ABOUTBOX };
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CAboutDlg)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
//{{AFX_MSG(CAboutDlg)
|
||||||
|
// No message handlers
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CAboutDlg)
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CAboutDlg)
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CAboutDlg)
|
||||||
|
// No message handlers
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
// App command to run the dialog
|
||||||
|
void CBinaryToolApp::OnAppAbout()
|
||||||
|
{
|
||||||
|
CAboutDlg aboutDlg;
|
||||||
|
aboutDlg.DoModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBinaryToolApp commands
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,83 @@
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name : DlgWarning.cpp
|
||||||
|
|
||||||
|
Author : Mihaela Tancu
|
||||||
|
|
||||||
|
Description : implementation of dialog
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
#include "DlgWarning.h"
|
||||||
|
#include "Print.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
CDlgWarning dialog
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
---------------------------------------------------------------------------------------
|
||||||
|
Description : constructor
|
||||||
|
---------------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
CDlgWarning::CDlgWarning(CWnd* pParent /*=NULL*/) : CDialog(CDlgWarning::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CDlgWarning)
|
||||||
|
// NOTE: the ClassWizard will add member initialization here
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
---------------------------------------------------------------------------------------
|
||||||
|
Description : message map
|
||||||
|
---------------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
BEGIN_MESSAGE_MAP(CDlgWarning, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CDlgWarning)
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
CDlgWarning message handlers
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
---------------------------------------------------------------------------------------
|
||||||
|
Description : WM_INITDIALOG
|
||||||
|
---------------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
BOOL CDlgWarning::OnInitDialog()
|
||||||
|
{
|
||||||
|
CDialog::OnInitDialog();
|
||||||
|
|
||||||
|
m_oStatic=(CStatic *)GetDlgItem(IDC_STATICWARNING);
|
||||||
|
m_oStatic->SetWindowText(sMes);
|
||||||
|
GetDlgItem(IDOK)->SetWindowText(sOK);
|
||||||
|
GetDlgItem(IDCANCEL)->SetWindowText(sCancel);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
---------------------------------------------------------------------------------------
|
||||||
|
Description : WM_DESTROY
|
||||||
|
---------------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
void CDlgWarning::OnDestroy()
|
||||||
|
{
|
||||||
|
CDialog::OnDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: GIItem.cpp : Implementation of the GI_Item class
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
Date: 2 June 1998
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "GIItem.h"
|
||||||
|
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Description : constructor
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
GI_Item::GI_Item(BOOL bAct, char *szName)
|
||||||
|
{
|
||||||
|
m_bActived = bAct;
|
||||||
|
strcpy(m_szName, szName);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Description : destructor
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
GI_Item::~GI_Item()
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: GIType.cpp : Implementation of the GI_Type class
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
Date: 2 June 1998
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "GIType.h"
|
||||||
|
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Description : constructor
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
GI_Type::GI_Type(char *szName, int _iSelected, COLORREF _xTextColor)
|
||||||
|
{
|
||||||
|
strcpy(m_szName, szName);
|
||||||
|
m_iSelected = _iSelected;
|
||||||
|
m_xTextColor = _xTextColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Description : destructor
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
GI_Type::~GI_Type()
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,744 @@
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: IniData.cpp : implementation file(functions for getting ini data, check this data, write them ...)
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
Date: 2 June 1998
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "io.h"
|
||||||
|
#include "IniData.h"
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <conio.h>
|
||||||
|
|
||||||
|
#include "Scr.h"
|
||||||
|
#include "Print.h"
|
||||||
|
|
||||||
|
BOOL bDebug;
|
||||||
|
BOOL bConvAnim = FALSE;
|
||||||
|
BOOL bConvTextures = FALSE;
|
||||||
|
BOOL bConvLevels = TRUE;
|
||||||
|
BOOL bFix1;
|
||||||
|
BOOL bStartPrg = TRUE;
|
||||||
|
//BOOL b3DCard;
|
||||||
|
//BOOL bUsed = TRUE;
|
||||||
|
BOOL bDsc = FALSE;
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
* Macro to bound size of a rect
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
#define M_vVerifyRect( _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;\
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Globals
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
tdstInitialValue g_stInitialData; // data in ini file
|
||||||
|
tdstInitialValue g_stDefaultData = // default value for data
|
||||||
|
{
|
||||||
|
"d:\\cpa\\appli\\BinaryTool\\GameDataBinDD3D", // default temp path for game data debug(computed)
|
||||||
|
"none", // default game data path (computed if none)
|
||||||
|
"d:\\cpa\\appli\\BinaryTool\\GameData", // default temp path for source directory (computed)
|
||||||
|
"none", // default source directory path (computed if none)
|
||||||
|
"d:\\cpa\\appli\\BinaryTool\\GameDataBinRD3D", // default temp path for game data release(computed)
|
||||||
|
"none", // default game data release path (computed if none)
|
||||||
|
"d:\\cpa\\appli\\BinaryTool\\GameDataBinDDFX", // default temp path for game data release(computed)
|
||||||
|
"none", // default game data release path (computed if none)
|
||||||
|
"d:\\cpa\\appli\\BinaryTool\\GameDataBinRDFX", // default temp path for game data release(computed)
|
||||||
|
"none", // default game data release path (computed if none)
|
||||||
|
"Debug", // default temp for debug
|
||||||
|
"none", // default
|
||||||
|
"D3D", // default temp for debug
|
||||||
|
"none", // default
|
||||||
|
"MainWinR.exe", // default temp for exe file
|
||||||
|
"none", // default
|
||||||
|
};
|
||||||
|
|
||||||
|
char g_szIniFile[MAX_PATH];
|
||||||
|
tdstWindowsPosSize g_stWinPosSize;
|
||||||
|
char g_szStartPrgIniFile[MAX_PATH];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetDestBinDD3D
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetDestBinDD3D( char *_szPath )
|
||||||
|
{
|
||||||
|
if (_access( g_szIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szIniFile, _S_IWRITE );
|
||||||
|
WritePrivateProfileString( "General directories", "DirNameDestBinDD3D", _szPath, g_szIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vOutput
|
||||||
|
Description: Write a string in the rich edit
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vOutput( char cLineType, char *szFormat, ... )
|
||||||
|
{
|
||||||
|
va_list argptr;
|
||||||
|
char szLine[256];
|
||||||
|
|
||||||
|
va_start( argptr, szFormat );
|
||||||
|
vsprintf( szLine, szFormat, argptr );
|
||||||
|
va_end( argptr );
|
||||||
|
|
||||||
|
#ifndef _WINDOWS
|
||||||
|
cLineType = cLineType; // to avoid warning
|
||||||
|
fprintf( stderr, szLine );
|
||||||
|
#else
|
||||||
|
fn_vAfxOutputStringRes( szLine, cLineType);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetSPDebug
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetSPDebug( char *_szPath )
|
||||||
|
{
|
||||||
|
if (_access( g_szStartPrgIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szStartPrgIniFile, _S_IWRITE );
|
||||||
|
WritePrivateProfileString( "Glide", "Debug", _szPath, g_szStartPrgIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetSPRelease
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetSPRelease( char *_szPath )
|
||||||
|
{
|
||||||
|
if (_access( g_szStartPrgIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szStartPrgIniFile, _S_IWRITE );
|
||||||
|
WritePrivateProfileString( "Glide", "Release", _szPath, g_szStartPrgIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetAskAtEachTime
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetAskAtEachTime( char *_szPath )
|
||||||
|
{
|
||||||
|
if (_access( g_szStartPrgIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szStartPrgIniFile, _S_IWRITE );
|
||||||
|
WritePrivateProfileString( "Start", "AskAtEachTime", _szPath, g_szStartPrgIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetAskAtEachTime
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetAskAtEachTime( int iValue )
|
||||||
|
{
|
||||||
|
char szValue[2];
|
||||||
|
|
||||||
|
if (_access( g_szStartPrgIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szStartPrgIniFile, _S_IWRITE );
|
||||||
|
|
||||||
|
if (iValue)
|
||||||
|
strcpy( szValue, "1");
|
||||||
|
else
|
||||||
|
strcpy( szValue, "0");
|
||||||
|
|
||||||
|
WritePrivateProfileString( "Start", "AskAtEachTime", szValue, g_szStartPrgIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetBinDebugIsOk
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetBinDebugIsOk( int iValue )
|
||||||
|
{
|
||||||
|
char szValue[2];
|
||||||
|
|
||||||
|
if (_access( g_szStartPrgIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szStartPrgIniFile, _S_IWRITE );
|
||||||
|
|
||||||
|
if (iValue)
|
||||||
|
strcpy( szValue, "1");
|
||||||
|
else
|
||||||
|
strcpy( szValue, "0");
|
||||||
|
|
||||||
|
WritePrivateProfileString( "Start", "BinDebugIsOk", szValue, g_szStartPrgIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetBinReleaseIsOk
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetBinReleaseIsOk( int iValue )
|
||||||
|
{
|
||||||
|
char szValue[2];
|
||||||
|
|
||||||
|
if (_access( g_szStartPrgIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szStartPrgIniFile, _S_IWRITE );
|
||||||
|
|
||||||
|
if (iValue)
|
||||||
|
strcpy( szValue, "1");
|
||||||
|
else
|
||||||
|
strcpy( szValue, "0");
|
||||||
|
|
||||||
|
WritePrivateProfileString( "Start", "BinReleaseIsOk", szValue, g_szStartPrgIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetUseBinaryData
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetBinUseBinaryData( int iValue )
|
||||||
|
{
|
||||||
|
char szValue[2];
|
||||||
|
|
||||||
|
if (_access( g_szStartPrgIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szStartPrgIniFile, _S_IWRITE );
|
||||||
|
|
||||||
|
if (iValue)
|
||||||
|
strcpy( szValue, "1");
|
||||||
|
else
|
||||||
|
strcpy( szValue, "0");
|
||||||
|
|
||||||
|
WritePrivateProfileString( "Start", "UseBinaryData", szValue, g_szStartPrgIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetGDDebugBin
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetGDDebugBin( char *_szPath )
|
||||||
|
{
|
||||||
|
if (_access( g_szStartPrgIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szStartPrgIniFile, _S_IWRITE );
|
||||||
|
WritePrivateProfileString( "Start", "GDDebugBin", _szPath, g_szStartPrgIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetGDReleaseBin
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetGDReleaseBin( char *_szPath )
|
||||||
|
{
|
||||||
|
if (_access( g_szStartPrgIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szStartPrgIniFile, _S_IWRITE );
|
||||||
|
WritePrivateProfileString( "Start", "GDReleaseBin", _szPath, g_szStartPrgIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetSource
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
(write the path for RawData Directory in the .ini file)
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetSource( char *_szPath )
|
||||||
|
{
|
||||||
|
if (_access( g_szIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szIniFile, _S_IWRITE );
|
||||||
|
WritePrivateProfileString( "General directories", "DirNameSource", _szPath, g_szIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetDestBinR
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
(write the path for Textures Sub-directory in the .ini file)
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetDestBinRD3D( char *_szPath )
|
||||||
|
{
|
||||||
|
if (_access( g_szIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szIniFile, _S_IWRITE );
|
||||||
|
WritePrivateProfileString( "General directories", "DirNameDestBinRD3D", _szPath, g_szIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetGameData
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
(write the path for Game Data Directory in the .ini file)
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetDestBinDDFX( char *_szPath )
|
||||||
|
{
|
||||||
|
if (_access( g_szIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szIniFile, _S_IWRITE );
|
||||||
|
WritePrivateProfileString( "General directories", "DirNameDestBinDDFX", _szPath, g_szIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetDestBinR
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
(write the path for Textures Sub-directory in the .ini file)
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetDestBinRDFX( char *_szPath )
|
||||||
|
{
|
||||||
|
if (_access( g_szIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szIniFile, _S_IWRITE );
|
||||||
|
WritePrivateProfileString( "General directories", "DirNameDestBinRDFX", _szPath, g_szIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vGetDatasFromStartFile
|
||||||
|
Description: Get all datas saved in the .ini file
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vGetDatasFromStartFile( BOOL _bFirst )
|
||||||
|
{
|
||||||
|
|
||||||
|
if (_bFirst)
|
||||||
|
{
|
||||||
|
// GetCurrentDirectory( MAX_PATH, g_szStartPrgIniFile );
|
||||||
|
strcpy(g_szStartPrgIniFile, sInitialDir);
|
||||||
|
if (g_szStartPrgIniFile[strlen(g_szStartPrgIniFile) - 1] != '\\')
|
||||||
|
strcat( g_szStartPrgIniFile, "\\");
|
||||||
|
strcat( g_szStartPrgIniFile, C_szStartPrgIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bDebug)
|
||||||
|
GetPrivateProfileString( "Glide", "Debug", g_stDefaultData.szExeFile, g_stInitialData.szExeFile, MAX_PATH, g_szStartPrgIniFile );
|
||||||
|
else
|
||||||
|
GetPrivateProfileString( "Glide", "Release", g_stDefaultData.szExeFile, g_stInitialData.szExeFile, MAX_PATH, g_szStartPrgIniFile );
|
||||||
|
|
||||||
|
|
||||||
|
HANDLE hHandle;
|
||||||
|
WIN32_FIND_DATA stFindFileData;
|
||||||
|
|
||||||
|
memset(&stFindFileData,0,sizeof(stFindFileData));
|
||||||
|
hHandle = FindFirstFile(g_szStartPrgIniFile, &stFindFileData);
|
||||||
|
//return a boolean for telling if some files *.* exists in the directory or not
|
||||||
|
if( hHandle == INVALID_HANDLE_VALUE)
|
||||||
|
{ char _szMessage[50];
|
||||||
|
sprintf(_szMessage, "The %s file does not exist, so the datas will be taken from the Default structure!", g_szStartPrgIniFile);
|
||||||
|
bStartPrg=FALSE;
|
||||||
|
AfxMessageBox( _szMessage, MB_OK | MB_ICONSTOP );
|
||||||
|
}
|
||||||
|
FindClose(hHandle);
|
||||||
|
|
||||||
|
if (strcmp( g_stInitialData.szExeFile, g_stDefaultData.szExeFile) == 0)
|
||||||
|
strcpy( g_stInitialData.szExeFile, g_stInitialData.szTempPath8);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vGetDatasFromFile
|
||||||
|
Description: Get all datas saved in the .ini file
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vGetDatasFromFile( BOOL _bFirst )
|
||||||
|
{
|
||||||
|
char szCompleteBinarization[10];
|
||||||
|
|
||||||
|
if (_bFirst)
|
||||||
|
{
|
||||||
|
GetCurrentDirectory( MAX_PATH, g_szIniFile );
|
||||||
|
if (g_szIniFile[strlen(g_szIniFile) - 1] != '\\')
|
||||||
|
strcat( g_szIniFile, "\\");
|
||||||
|
strcat( g_szIniFile, C_szIniFile );
|
||||||
|
/*
|
||||||
|
* set all ini data with default data
|
||||||
|
*/
|
||||||
|
memcpy( &g_stInitialData, &g_stDefaultData, sizeof( tdstInitialValue ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* get the informations for name of the executable, local path, game data, rawdata, textures and default directories
|
||||||
|
*/
|
||||||
|
GetPrivateProfileString( "General directories", "DirNameDestBinDD3D", g_stDefaultData.szDestBinDD3D, g_stInitialData.szDestBinDD3D, MAX_PATH, g_szIniFile );
|
||||||
|
GetPrivateProfileString( "General directories", "DirNameSource", g_stDefaultData.szSource, g_stInitialData.szSource, MAX_PATH, g_szIniFile );
|
||||||
|
GetPrivateProfileString( "General directories", "DirNameDestBinRD3D", g_stDefaultData.szDestBinRD3D, g_stInitialData.szDestBinRD3D, MAX_PATH, g_szIniFile );
|
||||||
|
GetPrivateProfileString( "General directories", "DirNameDestBinDDFX", g_stDefaultData.szDestBinDDFX, g_stInitialData.szDestBinDDFX, MAX_PATH, g_szIniFile );
|
||||||
|
GetPrivateProfileString( "General directories", "DirNameDestBinRDFX", g_stDefaultData.szDestBinRDFX, g_stInitialData.szDestBinRDFX, MAX_PATH, g_szIniFile );
|
||||||
|
GetPrivateProfileString( "Mode", "Mode", g_stDefaultData.szMode, g_stInitialData.szMode, MAX_PATH, g_szIniFile );
|
||||||
|
GetPrivateProfileString( "Fix", "Fix", g_stDefaultData.szFix, g_stInitialData.szFix, MAX_PATH, g_szIniFile );
|
||||||
|
GetPrivateProfileString( "Mode", "CompleteBinarization", "1", szCompleteBinarization, 10, g_szIniFile );
|
||||||
|
|
||||||
|
// GetPrivateProfileString( "Executable File", "Executable File", g_stDefaultData.szExeFile, g_stInitialData.szExeFile, MAX_PATH, g_szIniFile );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* set executable name, local path...
|
||||||
|
*/
|
||||||
|
HANDLE hHandle;
|
||||||
|
WIN32_FIND_DATA stFindFileData;
|
||||||
|
|
||||||
|
memset(&stFindFileData,0,sizeof(stFindFileData));
|
||||||
|
hHandle = FindFirstFile(g_szIniFile, &stFindFileData);
|
||||||
|
//return a boolean for telling if some files *.* exists in the directory or not
|
||||||
|
if( hHandle == INVALID_HANDLE_VALUE)
|
||||||
|
{ char _szMessage[50];
|
||||||
|
sprintf(_szMessage, "The %s file does not exist, so the datas will be taken from the Default structure!", g_szIniFile);
|
||||||
|
AfxMessageBox( _szMessage, MB_OK | MB_ICONSTOP );
|
||||||
|
}
|
||||||
|
FindClose(hHandle);
|
||||||
|
|
||||||
|
if (strcmp( g_stInitialData.szDestBinDD3D, g_stDefaultData.szDestBinDD3D) == 0)
|
||||||
|
strcpy( g_stInitialData.szDestBinDD3D, g_stInitialData.szTempPath1);
|
||||||
|
if (strcmp( g_stInitialData.szSource, g_stDefaultData.szSource) == 0)
|
||||||
|
strcpy( g_stInitialData.szSource, g_stInitialData.szTempPath2);
|
||||||
|
if (strcmp( g_stInitialData.szDestBinRD3D, g_stDefaultData.szDestBinRD3D) == 0)
|
||||||
|
strcpy( g_stInitialData.szDestBinRD3D, g_stInitialData.szTempPath3);
|
||||||
|
if (strcmp( g_stInitialData.szMode, g_stDefaultData.szMode) == 0)
|
||||||
|
strcpy( g_stInitialData.szMode, g_stInitialData.szTempPath4);
|
||||||
|
if (strcmp( g_stInitialData.szDestBinDDFX, g_stDefaultData.szDestBinDDFX) == 0)
|
||||||
|
strcpy( g_stInitialData.szDestBinDDFX, g_stInitialData.szTempPath5);
|
||||||
|
if (strcmp( g_stInitialData.szDestBinRDFX, g_stDefaultData.szDestBinRDFX) == 0)
|
||||||
|
strcpy( g_stInitialData.szDestBinRDFX, g_stInitialData.szTempPath6);
|
||||||
|
if (strcmp( g_stInitialData.szFix, g_stDefaultData.szFix) == 0)
|
||||||
|
strcpy( g_stInitialData.szFix, g_stInitialData.szTempPath7);
|
||||||
|
|
||||||
|
// if (strcmp( g_stInitialData.szExeFile, g_stDefaultData.szExeFile) == 0)
|
||||||
|
// strcpy( g_stInitialData.szExeFile, g_stInitialData.szTempPath8);
|
||||||
|
|
||||||
|
strcpy(szSource, g_stInitialData.szSource);
|
||||||
|
strcpy(sSource, g_stInitialData.szSource);
|
||||||
|
|
||||||
|
if (!stricmp(g_stInitialData.szMode, "Debug"))
|
||||||
|
bDebug = TRUE;
|
||||||
|
else
|
||||||
|
bDebug = FALSE;
|
||||||
|
|
||||||
|
if (!stricmp(g_stInitialData.szFix, "0"))
|
||||||
|
bFix1 = FALSE;
|
||||||
|
else
|
||||||
|
bFix1 = TRUE;
|
||||||
|
|
||||||
|
if (!stricmp(szCompleteBinarization, "0"))
|
||||||
|
bDsc = FALSE;
|
||||||
|
else
|
||||||
|
bDsc = TRUE;
|
||||||
|
/*
|
||||||
|
* Get the position and the size of the main window
|
||||||
|
*/
|
||||||
|
fn_IniData_vGetWindowPosSize();
|
||||||
|
|
||||||
|
if (!bAuto)
|
||||||
|
fn_IniData_vGetDatasFromStartFile(TRUE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetMode
|
||||||
|
Description: Set the entry in the .ini file for Version
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetMode( BOOL bSetIgnore )
|
||||||
|
{
|
||||||
|
char szValue[9];
|
||||||
|
if (_access( g_szIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szIniFile, _S_IWRITE );
|
||||||
|
|
||||||
|
if (bSetIgnore)
|
||||||
|
strcpy( szValue, "Debug");
|
||||||
|
else
|
||||||
|
strcpy( szValue, "Release");
|
||||||
|
|
||||||
|
WritePrivateProfileString( "Mode", "Mode", szValue, g_szIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetFix
|
||||||
|
Description: Set the entry in the .ini file for Fix
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetFix( BOOL bFix )
|
||||||
|
{
|
||||||
|
char szValue[9];
|
||||||
|
if (_access( g_szIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szIniFile, _S_IWRITE );
|
||||||
|
|
||||||
|
if (bFix)
|
||||||
|
strcpy( szValue, "1");
|
||||||
|
else
|
||||||
|
strcpy( szValue, "0");
|
||||||
|
|
||||||
|
WritePrivateProfileString( "Fix", "Fix", szValue, g_szIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetCompleteBinarization
|
||||||
|
Description: Change the rights of the file to write
|
||||||
|
Set the entry in the .ini file for Complete binarization (=generation of dsb files)
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetCompleteBinarization( BOOL bDsc )
|
||||||
|
{
|
||||||
|
if (_access( g_szIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szIniFile, _S_IWRITE );
|
||||||
|
if( bDsc )
|
||||||
|
WritePrivateProfileString( "Mode", "CompleteBinarization", "1", g_szIniFile );
|
||||||
|
else
|
||||||
|
WritePrivateProfileString( "Mode", "CompleteBinarization", "0", g_szIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSet3DCard
|
||||||
|
Description: Set the entry in the .ini file for Version
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSet3DCard( BOOL bSetIgnore )
|
||||||
|
{
|
||||||
|
char szValue[9];
|
||||||
|
if (_access( g_szIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szIniFile, _S_IWRITE );
|
||||||
|
|
||||||
|
if (bSetIgnore)
|
||||||
|
strcpy( szValue, "D3D");
|
||||||
|
else
|
||||||
|
strcpy( szValue, "DFX");
|
||||||
|
|
||||||
|
WritePrivateProfileString( "3DCard", "3DCard", szValue, g_szIniFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vSetDscCreated
|
||||||
|
Description:
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vSetDscCreated(BOOL bDsc)
|
||||||
|
{
|
||||||
|
char szValue[2];
|
||||||
|
if (_access( g_szStartPrgIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szStartPrgIniFile, _S_IWRITE );
|
||||||
|
|
||||||
|
if (bDsc)
|
||||||
|
strcpy( szValue, "1");
|
||||||
|
else
|
||||||
|
strcpy( szValue, "0");
|
||||||
|
|
||||||
|
WritePrivateProfileString( "Start", "DscCreated", szValue, g_szStartPrgIniFile );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vGetWindowPosSize
|
||||||
|
Description: Get the position andd the size of the main window from the .ini file
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vGetWindowPosSize( void )
|
||||||
|
{
|
||||||
|
char szString[100];
|
||||||
|
|
||||||
|
GetPrivateProfileString( "WinPref", "Main", "", szString, 100, g_szIniFile );
|
||||||
|
fn_IniData_vStudyRect( szString, &g_stWinPosSize.stMainPos );
|
||||||
|
M_vVerifyRect( (&g_stWinPosSize.stMainPos), C_iMainWindowWidth, C_iMainWindowHeight );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vWriteWindowPosSize
|
||||||
|
Description: Save the new position and size of the main window
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vWriteWindowPosSize( void )
|
||||||
|
{
|
||||||
|
char szValue[50];
|
||||||
|
RECT *p_stRect;
|
||||||
|
|
||||||
|
if (_access( g_szIniFile, 2) == -1)
|
||||||
|
_chmod ( g_szIniFile, _S_IWRITE );
|
||||||
|
|
||||||
|
//writing the new values for the position and size of the main window
|
||||||
|
p_stRect = &g_stWinPosSize.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 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_IniData_vStudyRect
|
||||||
|
Description: Verify that the values are correct (can be integers)
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_IniData_vStudyRect( char *_szString, RECT *_p_stRect )
|
||||||
|
{
|
||||||
|
char *p_szValue[5], *p_szEnd;
|
||||||
|
char cVal;
|
||||||
|
|
||||||
|
//study if the values can be integers
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
//convert to integer the ascii values
|
||||||
|
_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] );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_ComRes_vDeleteLines
|
||||||
|
Description: Delete all the text in the rich edir box control
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_ComRes_vDeleteLines( CRichEditCtrl *_oRichEdit)
|
||||||
|
{
|
||||||
|
//delete the content of the rich edit control (result and command)
|
||||||
|
_oRichEdit->SetWindowText( "" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_ComRes_vWriteLine
|
||||||
|
Description: Write a line in a rich edit
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_ComRes_vWriteLine( char *szLine, char cLineType ,CRichEditCtrl* _oRichEdit,
|
||||||
|
CHARFORMAT* _stCharFormat)
|
||||||
|
{
|
||||||
|
long lOldLength;
|
||||||
|
long lNewLength;
|
||||||
|
long lSize;
|
||||||
|
|
||||||
|
_stCharFormat->crTextColor = gs_a_xLineColor[ cLineType ];
|
||||||
|
_stCharFormat->dwEffects = 0;
|
||||||
|
|
||||||
|
// write a line in the rich edit control
|
||||||
|
// with different color (red or black) for Ok or for Error
|
||||||
|
lOldLength = _oRichEdit->GetTextLength();
|
||||||
|
lNewLength = lOldLength + strlen( szLine );
|
||||||
|
lSize = _oRichEdit->GetLimitText();
|
||||||
|
if (lNewLength > lSize)
|
||||||
|
{
|
||||||
|
lSize += 10000;
|
||||||
|
_oRichEdit->LimitText( lSize );
|
||||||
|
}
|
||||||
|
_oRichEdit->ReplaceSel( szLine );
|
||||||
|
|
||||||
|
_oRichEdit->SetSel( lOldLength, -1 );
|
||||||
|
_oRichEdit->SetSelectionCharFormat( *_stCharFormat );
|
||||||
|
_oRichEdit->SetSel( lNewLength, lNewLength );
|
||||||
|
_oRichEdit->RedrawWindow(NULL,NULL, RDW_INVALIDATE |RDW_FRAME| RDW_UPDATENOW );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,566 @@
|
||||||
|
// **********************************************************************************
|
||||||
|
// * "Levels.c" *
|
||||||
|
// * Written by : Mihaela Tancu *
|
||||||
|
// **********************************************************************************
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <direct.h>
|
||||||
|
|
||||||
|
#include "Levels.h"
|
||||||
|
#include "Anims.h"
|
||||||
|
|
||||||
|
|
||||||
|
MLT_tdstAlways **g_hAlwaysInFile;
|
||||||
|
long g_lAlwaysIndex;
|
||||||
|
|
||||||
|
MLT_tdstInsertCharacter **g_hInsertCharacterInFile;
|
||||||
|
long g_lInsertCharacterIndex;
|
||||||
|
|
||||||
|
MLT_tdstTextures **g_hTexturesInFile;
|
||||||
|
long g_lTexturesIndex;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vInitSystem
|
||||||
|
Description: Init the system
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vInitSystem()
|
||||||
|
{
|
||||||
|
Mmg_fn_vFirstInitMmgModule(1);
|
||||||
|
SCR_fn_v_RdL0_Init();
|
||||||
|
|
||||||
|
MLT_vInitALWLoad();
|
||||||
|
MLT_vInitLVLLoad();
|
||||||
|
MLT_vInitSTALoad();
|
||||||
|
MLT_vInitTEXLoad();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vExitSystem
|
||||||
|
Description: close and erase
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vExitSystem()
|
||||||
|
{
|
||||||
|
SCR_fn_v_RdL0_Close();
|
||||||
|
|
||||||
|
MLT_vEraseALWLib();
|
||||||
|
MLT_vEraseLVLLib();
|
||||||
|
MLT_vEraseSTALib();
|
||||||
|
MLT_vEraseTEXLib();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_xLoadAlways
|
||||||
|
Description: Load section from script file
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
SCR_tde_Anl_ReturnValue MLT_xLoadAlways(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
|
||||||
|
{
|
||||||
|
MLT_tdstAlways *p_stAlways;
|
||||||
|
char *p_Char, *p_Char1;
|
||||||
|
char szString[256];
|
||||||
|
|
||||||
|
switch (cType)
|
||||||
|
{
|
||||||
|
case SCR_EA_Anl_BeginSection:
|
||||||
|
p_stAlways=(MLT_tdstAlways*)malloc(sizeof(MLT_tdstAlways));
|
||||||
|
SCR_M_RdL0_SetSectionLong(0,0,(long)p_stAlways);
|
||||||
|
SCR_M_RdL0_SetContextLong(0,0,(long)p_stAlways);
|
||||||
|
sprintf(p_stAlways->sName,"%s",SCR_M_RdL0_GetCompleteSectionNameR(0));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_Entry:
|
||||||
|
// Recuperation du LoadGeometric a remplir
|
||||||
|
SCR_M_RdL0_GetContextLong(0,0,MLT_tdstAlways*,p_stAlways);
|
||||||
|
|
||||||
|
// Loading of object's Always
|
||||||
|
if (strcmp(szAction,M_LinkCharacter)==0)
|
||||||
|
{
|
||||||
|
sprintf(p_stAlways->sLinkCharacter,"%s",szParams[0]);
|
||||||
|
p_Char = strstr(p_stAlways->sLinkCharacter, "Families");
|
||||||
|
strcpy(szString, p_Char+9);
|
||||||
|
p_Char1 = strchr(szString, '\\');
|
||||||
|
szString[strlen(szString) - strlen(p_Char1)]='\0';
|
||||||
|
strcpy(p_stAlways->sLinkCharacter, szString);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_EndSection:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return SCR_ERV_Anl_NormalReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: GLI_xLoadALWCallback
|
||||||
|
Description: Load ALW file
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
SCR_tde_Anl_ReturnValue GLI_xLoadALWCallback(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
|
||||||
|
{
|
||||||
|
MLT_tdstAlways **p_xAlwaysInFile;
|
||||||
|
long xNbAlways;
|
||||||
|
|
||||||
|
switch (cType)
|
||||||
|
{
|
||||||
|
case SCR_EA_Anl_BeginSection:
|
||||||
|
p_xAlwaysInFile = (MLT_tdstAlways**)malloc(sizeof(MLT_tdstAlways*));
|
||||||
|
|
||||||
|
SCR_M_RdL0_SetContextLong(0,0,(long)p_xAlwaysInFile);
|
||||||
|
SCR_M_RdL0_SetContextLong(0,1,(long)0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_EndSubSection:
|
||||||
|
if (strcmp(szParams[0],M_InsertAlways)==0)
|
||||||
|
{
|
||||||
|
MLT_tdstAlways *hAlways;
|
||||||
|
|
||||||
|
SCR_M_RdL0_GetContextLong(0,0,MLT_tdstAlways**,p_xAlwaysInFile);
|
||||||
|
SCR_M_RdL0_GetContextLong(0,1,long,xNbAlways);
|
||||||
|
|
||||||
|
p_xAlwaysInFile = (MLT_tdstAlways**)realloc(p_xAlwaysInFile,(++xNbAlways)*sizeof(MLT_tdstAlways*));
|
||||||
|
|
||||||
|
SCR_M_RdL0_GetSectionLong(1,0,MLT_tdstAlways*,hAlways);
|
||||||
|
p_xAlwaysInFile[xNbAlways-1]=hAlways;
|
||||||
|
|
||||||
|
SCR_M_RdL0_SetContextLong(0,0,(long)p_xAlwaysInFile);
|
||||||
|
SCR_M_RdL0_SetContextLong(0,1,(long)xNbAlways);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_EndSection:
|
||||||
|
SCR_M_RdL0_GetContextLong(0,0,MLT_tdstAlways**,p_xAlwaysInFile);
|
||||||
|
SCR_M_RdL0_GetContextLong(0,1,long,xNbAlways);
|
||||||
|
SCR_M_RdL0_SetSectionLong(0,0,(long)p_xAlwaysInFile);
|
||||||
|
SCR_M_RdL0_SetSectionLong(0,1,(long)xNbAlways);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return SCR_ERV_Anl_NormalReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vInitALWLoad
|
||||||
|
Description: init for loading an ALW file
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vInitALWLoad()
|
||||||
|
{
|
||||||
|
// Init des scripts et lecture du fichier
|
||||||
|
SCR_fn_v_RdL0_RegisterCallback(M_InsertAlways,MLT_xLoadAlways, SCR_CRC_c_RdL0_ForSection);
|
||||||
|
SCR_fn_v_RdL0_RegisterCallback(M_FichierALW,GLI_xLoadALWCallback, SCR_CRC_c_RdL0_ForFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vLoadALWFileInLib
|
||||||
|
Description: load ALW file in a lib
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vLoadALWFileInLib(char *szFileName)
|
||||||
|
{
|
||||||
|
SCR_tdst_Cxt_Values *p_stVal;
|
||||||
|
|
||||||
|
if(SCR_fn_c_RdL0_IsSectionExists(szFileName))
|
||||||
|
{
|
||||||
|
p_stVal = SCR_fnp_st_RdL0_AnalyseSection(szFileName, SCR_CDF_uw_Anl_ForceAnalyse);
|
||||||
|
|
||||||
|
g_hAlwaysInFile = (MLT_tdstAlways **)SCR_M_ul_RdL0_ExtractLongValue(p_stVal,0);
|
||||||
|
g_lAlwaysIndex = (long)SCR_M_ul_RdL0_ExtractLongValue(p_stVal,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vEraseALWLib
|
||||||
|
Description: free all the object in the list
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vEraseALWLib()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if(g_hAlwaysInFile == NULL) return;
|
||||||
|
|
||||||
|
for(i=0; i<g_lAlwaysIndex; i++)
|
||||||
|
{
|
||||||
|
if(g_hAlwaysInFile[i] == NULL) continue;
|
||||||
|
free(g_hAlwaysInFile[i]);
|
||||||
|
}
|
||||||
|
g_lAlwaysIndex = 0;
|
||||||
|
free(g_hAlwaysInFile);
|
||||||
|
g_hAlwaysInFile = NULL;
|
||||||
|
}
|
||||||
|
//Mihaela Tancu - ALW
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Mihaela Tancu - LVL
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_xLoadInsertCharacter
|
||||||
|
Description: load section in script file
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
SCR_tde_Anl_ReturnValue MLT_xLoadInsertCharacter(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
|
||||||
|
{
|
||||||
|
MLT_tdstInsertCharacter *p_stInsertCharacter;
|
||||||
|
char *p_Char, *p_Char1;
|
||||||
|
char szString[256];
|
||||||
|
|
||||||
|
switch (cType)
|
||||||
|
{
|
||||||
|
case SCR_EA_Anl_BeginSection:
|
||||||
|
p_stInsertCharacter=(MLT_tdstInsertCharacter*)malloc(sizeof(MLT_tdstInsertCharacter));
|
||||||
|
SCR_M_RdL0_SetSectionLong(0,0,(long)p_stInsertCharacter);
|
||||||
|
SCR_M_RdL0_SetContextLong(0,0,(long)p_stInsertCharacter);
|
||||||
|
sprintf(p_stInsertCharacter->sName,"%s",SCR_M_RdL0_GetCompleteSectionNameR(0));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_Entry:
|
||||||
|
SCR_M_RdL0_GetContextLong(0,0,MLT_tdstInsertCharacter*,p_stInsertCharacter);
|
||||||
|
|
||||||
|
// Loading of object's InsertCharacter
|
||||||
|
if (strcmp(szAction,M_LinkCharacter)==0)
|
||||||
|
{
|
||||||
|
sprintf(p_stInsertCharacter->sLinkCharacter,"%s",szParams[0]);
|
||||||
|
p_Char = strstr(p_stInsertCharacter->sLinkCharacter, "Families");
|
||||||
|
strcpy(szString, p_Char+9);
|
||||||
|
p_Char1 = strchr(szString, '\\');
|
||||||
|
szString[strlen(szString) - strlen(p_Char1)]='\0';
|
||||||
|
strcpy(p_stInsertCharacter->sLinkCharacter, szString);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_EndSection:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return SCR_ERV_Anl_NormalReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: GLI_xLoadLVLCallback
|
||||||
|
Description: load LVL file
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
SCR_tde_Anl_ReturnValue GLI_xLoadLVLCallback(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
|
||||||
|
{
|
||||||
|
MLT_tdstInsertCharacter **p_xInsertCharacterInFile;
|
||||||
|
long xNbInsertCharacter;
|
||||||
|
|
||||||
|
switch (cType)
|
||||||
|
{
|
||||||
|
case SCR_EA_Anl_BeginSection:
|
||||||
|
p_xInsertCharacterInFile = (MLT_tdstInsertCharacter**)malloc(sizeof(MLT_tdstInsertCharacter*));
|
||||||
|
|
||||||
|
SCR_M_RdL0_SetContextLong(0,0,(long)p_xInsertCharacterInFile);
|
||||||
|
SCR_M_RdL0_SetContextLong(0,1,(long)0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_EndSubSection:
|
||||||
|
if (strcmp(szParams[0],M_InsertCharacter)==0)
|
||||||
|
{
|
||||||
|
MLT_tdstInsertCharacter *hInsertCharacter;
|
||||||
|
|
||||||
|
SCR_M_RdL0_GetContextLong(0,0,MLT_tdstInsertCharacter**,p_xInsertCharacterInFile);
|
||||||
|
SCR_M_RdL0_GetContextLong(0,1,long,xNbInsertCharacter);
|
||||||
|
|
||||||
|
p_xInsertCharacterInFile = (MLT_tdstInsertCharacter**)realloc(p_xInsertCharacterInFile,(++xNbInsertCharacter)*sizeof(MLT_tdstInsertCharacter*));
|
||||||
|
|
||||||
|
SCR_M_RdL0_GetSectionLong(1,0,MLT_tdstInsertCharacter*,hInsertCharacter);
|
||||||
|
p_xInsertCharacterInFile[xNbInsertCharacter-1]=hInsertCharacter;
|
||||||
|
|
||||||
|
SCR_M_RdL0_SetContextLong(0,0,(long)p_xInsertCharacterInFile);
|
||||||
|
SCR_M_RdL0_SetContextLong(0,1,(long)xNbInsertCharacter);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_EndSection:
|
||||||
|
SCR_M_RdL0_GetContextLong(0,0,MLT_tdstInsertCharacter**,p_xInsertCharacterInFile);
|
||||||
|
SCR_M_RdL0_GetContextLong(0,1,long,xNbInsertCharacter);
|
||||||
|
SCR_M_RdL0_SetSectionLong(0,0,(long)p_xInsertCharacterInFile);
|
||||||
|
SCR_M_RdL0_SetSectionLong(0,1,(long)xNbInsertCharacter);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return SCR_ERV_Anl_NormalReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vInitLVLLoad
|
||||||
|
Description: init for loading an LVL file
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vInitLVLLoad()
|
||||||
|
{
|
||||||
|
// Init des scripts et lecture du fichier
|
||||||
|
SCR_fn_v_RdL0_RegisterCallback(M_InsertCharacter,MLT_xLoadInsertCharacter, SCR_CRC_c_RdL0_ForSection);
|
||||||
|
SCR_fn_v_RdL0_RegisterCallback(M_FichierLVL,GLI_xLoadLVLCallback, SCR_CRC_c_RdL0_ForFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vLoadLVLFileInLib
|
||||||
|
Description: loading an LVL file in lib
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vLoadLVLFileInLib(char *szFileName)
|
||||||
|
{
|
||||||
|
SCR_tdst_Cxt_Values *p_stVal;
|
||||||
|
|
||||||
|
if(SCR_fn_c_RdL0_IsSectionExists(szFileName))
|
||||||
|
{
|
||||||
|
p_stVal = SCR_fnp_st_RdL0_AnalyseSection(szFileName, SCR_CDF_uw_Anl_ForceAnalyse);
|
||||||
|
|
||||||
|
g_hInsertCharacterInFile = (MLT_tdstInsertCharacter **)SCR_M_ul_RdL0_ExtractLongValue(p_stVal,0);
|
||||||
|
g_lInsertCharacterIndex = (long)SCR_M_ul_RdL0_ExtractLongValue(p_stVal,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vEraseLVLLib
|
||||||
|
Description: free all the object in the list
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vEraseLVLLib()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if(g_hInsertCharacterInFile == NULL) return;
|
||||||
|
|
||||||
|
for(i=0; i<g_lInsertCharacterIndex; i++)
|
||||||
|
{
|
||||||
|
if(g_hInsertCharacterInFile[i] == NULL) continue;
|
||||||
|
free(g_hInsertCharacterInFile[i]);
|
||||||
|
}
|
||||||
|
g_lInsertCharacterIndex = 0;
|
||||||
|
free(g_hInsertCharacterInFile);
|
||||||
|
g_hInsertCharacterInFile = NULL;
|
||||||
|
}
|
||||||
|
//Mihaela Tancu - LVL
|
||||||
|
|
||||||
|
|
||||||
|
//Mihaela Tancu - TEX
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_xLoadTextures
|
||||||
|
Description: load section in script file
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
SCR_tde_Anl_ReturnValue MLT_xLoadTextures(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
|
||||||
|
{
|
||||||
|
MLT_tdstTextures *p_stTextures;
|
||||||
|
|
||||||
|
switch (cType)
|
||||||
|
{
|
||||||
|
case SCR_EA_Anl_BeginSection:
|
||||||
|
p_stTextures=(MLT_tdstTextures*)malloc(sizeof(MLT_tdstTextures));
|
||||||
|
SCR_M_RdL0_SetSectionLong(0,0,(long)p_stTextures);
|
||||||
|
SCR_M_RdL0_SetContextLong(0,0,(long)p_stTextures);
|
||||||
|
sprintf(p_stTextures->sName,"%s",SCR_M_RdL0_GetCompleteSectionNameR(0));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_Entry:
|
||||||
|
// Recuperation du LoadGeometric a remplir
|
||||||
|
SCR_M_RdL0_GetContextLong(0,0,MLT_tdstTextures*,p_stTextures);
|
||||||
|
|
||||||
|
// Loading of object's Textures
|
||||||
|
if (strcmp(szAction,M_LoadTexture)==0)
|
||||||
|
{
|
||||||
|
sprintf(p_stTextures->sLoadTexture,"%s",szParams[0]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_EndSection:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return SCR_ERV_Anl_NormalReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: GLI_xLoadTEXCallback
|
||||||
|
Description: load TEX file
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
SCR_tde_Anl_ReturnValue GLI_xLoadTEXCallback(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
|
||||||
|
{
|
||||||
|
MLT_tdstTextures **p_xTexturesInFile;
|
||||||
|
long xNbTextures;
|
||||||
|
|
||||||
|
switch (cType)
|
||||||
|
{
|
||||||
|
case SCR_EA_Anl_BeginSection:
|
||||||
|
p_xTexturesInFile = (MLT_tdstTextures**)malloc(sizeof(MLT_tdstTextures*));
|
||||||
|
|
||||||
|
SCR_M_RdL0_SetContextLong(0,0,(long)p_xTexturesInFile);
|
||||||
|
SCR_M_RdL0_SetContextLong(0,1,(long)0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_EndSubSection:
|
||||||
|
if (strcmp(szParams[0],M_Texture)==0)
|
||||||
|
{
|
||||||
|
MLT_tdstTextures *hTextures;
|
||||||
|
|
||||||
|
SCR_M_RdL0_GetContextLong(0,0,MLT_tdstTextures**,p_xTexturesInFile);
|
||||||
|
SCR_M_RdL0_GetContextLong(0,1,long,xNbTextures);
|
||||||
|
|
||||||
|
p_xTexturesInFile = (MLT_tdstTextures**)realloc(p_xTexturesInFile,(++xNbTextures)*sizeof(MLT_tdstTextures*));
|
||||||
|
|
||||||
|
SCR_M_RdL0_GetSectionLong(1,0,MLT_tdstTextures*,hTextures);
|
||||||
|
p_xTexturesInFile[xNbTextures-1]=hTextures;
|
||||||
|
|
||||||
|
SCR_M_RdL0_SetContextLong(0,0,(long)p_xTexturesInFile);
|
||||||
|
SCR_M_RdL0_SetContextLong(0,1,(long)xNbTextures);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCR_EA_Anl_EndSection:
|
||||||
|
SCR_M_RdL0_GetContextLong(0,0,MLT_tdstTextures**,p_xTexturesInFile);
|
||||||
|
SCR_M_RdL0_GetContextLong(0,1,long,xNbTextures);
|
||||||
|
SCR_M_RdL0_SetSectionLong(0,0,(long)p_xTexturesInFile);
|
||||||
|
SCR_M_RdL0_SetSectionLong(0,1,(long)xNbTextures);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return SCR_ERV_Anl_NormalReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vInitTEXLoad
|
||||||
|
Description: init for loading an TEX file
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vInitTEXLoad()
|
||||||
|
{
|
||||||
|
// Init des scripts et lecture du fichier
|
||||||
|
SCR_fn_v_RdL0_RegisterCallback(M_Texture,MLT_xLoadTextures, SCR_CRC_c_RdL0_ForSection);
|
||||||
|
SCR_fn_v_RdL0_RegisterCallback(M_FichierTEX,GLI_xLoadTEXCallback, SCR_CRC_c_RdL0_ForFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vLoadTEXFileInLib
|
||||||
|
Description: loading an TEX file in lib
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vLoadTEXFileInLib(char *szFileName)
|
||||||
|
{
|
||||||
|
SCR_tdst_Cxt_Values *p_stVal;
|
||||||
|
|
||||||
|
if(SCR_fn_c_RdL0_IsSectionExists(szFileName))
|
||||||
|
{
|
||||||
|
p_stVal = SCR_fnp_st_RdL0_AnalyseSection(szFileName, SCR_CDF_uw_Anl_ForceAnalyse);
|
||||||
|
|
||||||
|
g_hTexturesInFile = (MLT_tdstTextures **)SCR_M_ul_RdL0_ExtractLongValue(p_stVal,0);
|
||||||
|
g_lTexturesIndex = (long)SCR_M_ul_RdL0_ExtractLongValue(p_stVal,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_vEraseTEXLib
|
||||||
|
Description: free all the object in the list
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void MLT_vEraseTEXLib()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if(g_hTexturesInFile == NULL) return;
|
||||||
|
|
||||||
|
for(i=0; i<g_lTexturesIndex; i++)
|
||||||
|
{
|
||||||
|
if(g_hTexturesInFile[i] == NULL) continue;
|
||||||
|
free(g_hTexturesInFile[i]);
|
||||||
|
}
|
||||||
|
g_lTexturesIndex = 0;
|
||||||
|
free(g_hTexturesInFile);
|
||||||
|
g_hTexturesInFile = NULL;
|
||||||
|
}
|
||||||
|
//Mihaela Tancu - TEX
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_p_cGetFileNameWithoutExt
|
||||||
|
Description: return the file name whitout extension
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
char *MLT_p_cGetFileNameWithoutExt(char *_sFileName)
|
||||||
|
{
|
||||||
|
char *p_char;
|
||||||
|
static xString sFileName;
|
||||||
|
|
||||||
|
sprintf(sFileName, "%s", _sFileName);
|
||||||
|
p_char = sFileName;
|
||||||
|
if ((p_char=strstr(sFileName, "."))!=NULL)
|
||||||
|
*p_char = 0;
|
||||||
|
return sFileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: MLT_p_cGetFileNameWithoutPath
|
||||||
|
Description: return the file name whitout path
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
char *MLT_p_cGetFileNameWithoutPath(char *sFileName)
|
||||||
|
{
|
||||||
|
char *p_char;
|
||||||
|
|
||||||
|
p_char = sFileName + strlen(sFileName) - 1;
|
||||||
|
if (((p_char = strrchr( sFileName, '/')) != NULL) || ((p_char = strrchr( sFileName, '\\')) != NULL))
|
||||||
|
p_char++;
|
||||||
|
else
|
||||||
|
p_char = sFileName;
|
||||||
|
return p_char;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,107 @@
|
||||||
|
// MainFrm.cpp : implementation of the CMainFrame class
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "BinaryTool.h"
|
||||||
|
|
||||||
|
#include "MainFrm.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CMainFrame
|
||||||
|
|
||||||
|
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
|
||||||
|
//{{AFX_MSG_MAP(CMainFrame)
|
||||||
|
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||||
|
// DO NOT EDIT what you see in these blocks of generated code !
|
||||||
|
ON_WM_CREATE()
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
static UINT indicators[] =
|
||||||
|
{
|
||||||
|
ID_SEPARATOR, // status line indicator
|
||||||
|
ID_INDICATOR_CAPS,
|
||||||
|
ID_INDICATOR_NUM,
|
||||||
|
ID_INDICATOR_SCRL,
|
||||||
|
};
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CMainFrame construction/destruction
|
||||||
|
|
||||||
|
CMainFrame::CMainFrame()
|
||||||
|
{
|
||||||
|
// TODO: add member initialization code here
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CMainFrame::~CMainFrame()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||||
|
{
|
||||||
|
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (!m_wndToolBar.Create(this) ||
|
||||||
|
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
|
||||||
|
{
|
||||||
|
TRACE0("Failed to create toolbar\n");
|
||||||
|
return -1; // fail to create
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_wndStatusBar.Create(this) ||
|
||||||
|
!m_wndStatusBar.SetIndicators(indicators,
|
||||||
|
sizeof(indicators)/sizeof(UINT)))
|
||||||
|
{
|
||||||
|
TRACE0("Failed to create status bar\n");
|
||||||
|
return -1; // fail to create
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Remove this if you don't want tool tips or a resizeable toolbar
|
||||||
|
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
|
||||||
|
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
|
||||||
|
|
||||||
|
// TODO: Delete these three lines if you don't want the toolbar to
|
||||||
|
// be dockable
|
||||||
|
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
|
||||||
|
EnableDocking(CBRS_ALIGN_ANY);
|
||||||
|
DockControlBar(&m_wndToolBar);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
|
||||||
|
{
|
||||||
|
// TODO: Modify the Window class or styles here by modifying
|
||||||
|
// the CREATESTRUCT cs
|
||||||
|
|
||||||
|
return CFrameWnd::PreCreateWindow(cs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CMainFrame diagnostics
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
void CMainFrame::AssertValid() const
|
||||||
|
{
|
||||||
|
CFrameWnd::AssertValid();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMainFrame::Dump(CDumpContext& dc) const
|
||||||
|
{
|
||||||
|
CFrameWnd::Dump(dc);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //_DEBUG
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CMainFrame message handlers
|
|
@ -0,0 +1,6 @@
|
||||||
|
// stdafx.cpp : source file that includes just the standard includes
|
||||||
|
// BinaryTool.pch will be the pre-compiled header
|
||||||
|
// stdafx.obj will contain the pre-compiled type information
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
|
@ -0,0 +1,250 @@
|
||||||
|
// **********************************************************************************
|
||||||
|
// * "l_global_v6.c" *
|
||||||
|
// * Written by : Sébastien Rubens *
|
||||||
|
// * Tabulations : 4 char *
|
||||||
|
// **********************************************************************************
|
||||||
|
#define L_GLOBAL_V6_C
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
#define Details
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
// Included files
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "SCR.h"
|
||||||
|
|
||||||
|
#include "a3x_glob.h"
|
||||||
|
|
||||||
|
#include "makeanim.h"
|
||||||
|
#include "l_global_v6.h"
|
||||||
|
|
||||||
|
|
||||||
|
//Mihaela Tancu - Animations
|
||||||
|
#include "Print.h"
|
||||||
|
//Mihaela Tancu - Animations
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
// Globals datas
|
||||||
|
#define MaxInStringsTab 10000
|
||||||
|
#define MaxInVertexesTab 100000
|
||||||
|
#define MaxInQuaternionsTab 100000
|
||||||
|
#define MaxInA3dGENERALTab 2000
|
||||||
|
#define MaxInChannelsTab 5000
|
||||||
|
#define MaxInFramesTab 100000
|
||||||
|
#define MaxInFramesNTTOTab 100000
|
||||||
|
#define MaxInOnlyFramesTab 20000
|
||||||
|
#define MaxInHierarchiesTab 10000
|
||||||
|
#define MaxInChannelNamesTab 2000
|
||||||
|
#define MaxInSavedVertexesTab 50000
|
||||||
|
#define MaxInSavedQuaternionsTab 50000
|
||||||
|
#define MaxInSavedNTTOTab 5000
|
||||||
|
#define MaxInMorphTab 80000
|
||||||
|
|
||||||
|
#define MaxInFileA3dAnimationGENERALTab 500
|
||||||
|
#define MaxInFileVertexesTab 10000
|
||||||
|
#define MaxInFileQuaternionsTab 10000
|
||||||
|
#define MaxInFileHierarchyTab 500
|
||||||
|
#define MaxInFileNTTOTab 5000
|
||||||
|
#define MaxInFileEventTab 1000
|
||||||
|
#define MaxInFileOnlyFrameTab 1000
|
||||||
|
#define MaxInFileChannelTab 500
|
||||||
|
#define MaxInFileFrameTab 10000
|
||||||
|
#define MaxInFileKeyFrameTab 5000
|
||||||
|
#define MaxInSndEventIdTab 5000
|
||||||
|
#define MaxInEventTab 10000
|
||||||
|
#define MaxInFileEventTab 1000
|
||||||
|
#define MaxInFileMorphTab 5000
|
||||||
|
|
||||||
|
typedef char tdFileName[256];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
tdstBinStackInfos tdstStacks[eStackBinNbMax]=
|
||||||
|
{ { 0, 0, MaxInStringsTab }, // Strings
|
||||||
|
{ 0, 0, MaxInVertexesTab }, // Vertexes
|
||||||
|
{ 0, 0, MaxInQuaternionsTab }, // Quaternions
|
||||||
|
{ 0, 0, MaxInA3dGENERALTab }, // A3dGENERAL
|
||||||
|
{ 0, 0, MaxInChannelsTab }, // Channels
|
||||||
|
{ 0, 0, MaxInFramesTab }, // Frames
|
||||||
|
{ 0, 0, MaxInOnlyFramesTab }, // OnlyFrames
|
||||||
|
{ 0, 0, MaxInHierarchiesTab }, // Hierarchies
|
||||||
|
{ 0, 0, MaxInChannelNamesTab }, // ChannelNames
|
||||||
|
|
||||||
|
{ 0, 0, MaxInSavedVertexesTab }, // SavedVertexes
|
||||||
|
{ 0, 0, MaxInSavedQuaternionsTab}, // SavedQuaternions
|
||||||
|
{ 0, 0, MaxInSavedNTTOTab }, // Saved FrameNumber and TypeOfObject
|
||||||
|
|
||||||
|
{ 0, 0, MaxInFileA3dAnimationGENERALTab },
|
||||||
|
{ 0, 0, MaxInFileVertexesTab },
|
||||||
|
{ 0, 0, MaxInFileQuaternionsTab },
|
||||||
|
{ 0, 0, MaxInFileHierarchyTab },
|
||||||
|
{ 0, 0, MaxInFileNTTOTab },
|
||||||
|
{ 0, 0, MaxInFileOnlyFrameTab },
|
||||||
|
{ 0, 0, MaxInFileKeyFrameTab },
|
||||||
|
{ 0, 0, MaxInFileFrameTab },
|
||||||
|
{ 0, 0, MaxInFileChannelTab },
|
||||||
|
{ 0, 0, MaxInFileEventTab },
|
||||||
|
{ 0, 0, MaxInMorphTab },
|
||||||
|
|
||||||
|
{ 0, 0, MaxInSndEventIdTab },
|
||||||
|
{ 0, 0, MaxInEventTab }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
tdFileName ax_xStrings [MaxInStringsTab];
|
||||||
|
tdxVector3 axa3_xVertexes [MaxInVertexesTab];
|
||||||
|
tdxQuater4 axa4_xBinQuaternions [MaxInQuaternionsTab];
|
||||||
|
tdstBinA3dAnimationGENERAL ax_tdstA3dGENERAL [MaxInA3dGENERALTab];
|
||||||
|
tdstBinChannel ax_tdstChannels [MaxInChannelsTab];
|
||||||
|
tdstBinFrame ax_tdstFrames [MaxInFramesTab];
|
||||||
|
unsigned long ax_ulFramesNTTO [MaxInFramesNTTOTab];
|
||||||
|
tdstBinOnlyFrame ax_tdstOnlyFrames [MaxInOnlyFramesTab];
|
||||||
|
tdstBinHierarchy ax_tdstHierarchies [MaxInHierarchiesTab];
|
||||||
|
tdFileName ax_xChannelNames [MaxInChannelNamesTab];
|
||||||
|
|
||||||
|
tdxVector3 ax_tdxSavedVertexes [MaxInSavedVertexesTab];
|
||||||
|
tdxQuater4 ax_tdxSavedQuaternions [MaxInSavedQuaternionsTab];
|
||||||
|
tdstNTTO ax_tdstSavedNTTO [MaxInSavedNTTOTab];
|
||||||
|
|
||||||
|
tdstFileA3dAnimationGENERAL ax_tdstFileA3dGENERAL [MaxInFileA3dAnimationGENERALTab];
|
||||||
|
tdxULongVector3 ax_tdxFileVertexes [MaxInFileVertexesTab];
|
||||||
|
tdxSShortQuater4 ax_tdxFileQuaternions [MaxInFileQuaternionsTab];
|
||||||
|
tdstFileHierarchy ax_tdstFileHierarchy [MaxInFileHierarchyTab];
|
||||||
|
tdstNTTO ax_tdstFileNTTO [MaxInFileNTTOTab];
|
||||||
|
tdstFileOnlyFrame ax_tdstFileOnlyFrame [MaxInFileOnlyFrameTab];
|
||||||
|
tdstFileKeyFrame ax_tdstFileKeyFrame [MaxInFileKeyFrameTab];
|
||||||
|
tdstFileFrame ax_tdstFileFrame [MaxInFileFrameTab];
|
||||||
|
unsigned short ax_uwFramesNTTO [];
|
||||||
|
tdstFileChannel ax_tdstFileChannel [MaxInFileChannelTab];
|
||||||
|
tdstFileEvent ax_tdstFileEvent [MaxInFileEventTab];
|
||||||
|
tdstFileMorphData ax_tdstFileMorphInfos [MaxInFileMorphTab];
|
||||||
|
|
||||||
|
tdstSndEventId ax_tdstSndEventId [MaxInSndEventIdTab];
|
||||||
|
tdstBinEvent ax_tdstEvents [MaxInEventTab];
|
||||||
|
tdstBinMorphData ax_tdstBinMorphInfos [MaxInMorphTab];
|
||||||
|
|
||||||
|
tdxVector3 a3_xVector0= { 0, 0, 0 };
|
||||||
|
tdxVector3 a3_xVector1= { 1, 1, 1 };
|
||||||
|
tdxQuater4 a4_xQuater0= { 0, 0, 0, 0 };
|
||||||
|
tdxQuater4 a4_xQuater1= { 0, 0, 0, 1 };
|
||||||
|
FILE *ErrorFile, *SizeOut, *EventFile;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
void fn_v_AllocateOnStack( unsigned short uwNumStack,
|
||||||
|
signed long slWantedSize )
|
||||||
|
{
|
||||||
|
tdstStacks[uwNumStack].slStackPos+= slWantedSize;
|
||||||
|
|
||||||
|
if (tdstStacks[uwNumStack].slStackPos > tdstStacks[uwNumStack].slMaxPos)
|
||||||
|
{ fprintf( ErrorFile, "%s : Stack #%d is full (monty)...\n", AnimationName, uwNumStack );
|
||||||
|
tdstStacks[uwNumStack].slStackPos= tdstStacks[uwNumStack].slMaxPos - slWantedSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
tdstStacks[uwNumStack].slPosAlloc= tdstStacks[uwNumStack].slStackPos - slWantedSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
void fn_v_DeAllocateOnStack( unsigned short uwNumStack,
|
||||||
|
signed long slSize )
|
||||||
|
{
|
||||||
|
tdstStacks[uwNumStack].slStackPos-= slSize;
|
||||||
|
if (tdstStacks[uwNumStack].slStackPos < 0)
|
||||||
|
{ fprintf( ErrorFile, "%s : Stack #%d is over (2 be) free...\n", AnimationName, uwNumStack );
|
||||||
|
tdstStacks[uwNumStack].slStackPos= 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
void fn_v_ResetStacks( void )
|
||||||
|
{ unsigned short uwCnt;
|
||||||
|
|
||||||
|
for ( uwCnt=0 ; uwCnt<eStackBinNbMax ; uwCnt++ )
|
||||||
|
{ tdstStacks[uwCnt].slPosAlloc= 0;
|
||||||
|
tdstStacks[uwCnt].slStackPos= 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
static int gs_iPrintPos = 0;
|
||||||
|
|
||||||
|
void fn_v_LogSectionBegin( int _bFlagNew,
|
||||||
|
char *_szType,
|
||||||
|
char *_szString )
|
||||||
|
{ int iCnt;
|
||||||
|
char szTxt[1024];
|
||||||
|
|
||||||
|
for ( iCnt=0 ; iCnt<gs_iPrintPos ; iCnt++ )
|
||||||
|
putchar(' ');
|
||||||
|
|
||||||
|
gs_iPrintPos++;
|
||||||
|
|
||||||
|
if (_bFlagNew)
|
||||||
|
sprintf( szTxt, "New %s:%s", _szType, _szString );
|
||||||
|
else sprintf( szTxt, "Old %s:%s", _szType, _szString );
|
||||||
|
//Mihaela Tancu - Animations
|
||||||
|
// printf( "%s\n", szTxt );
|
||||||
|
MLT_vOutput( C_ComRes_cOkLine, " %s\n", szTxt);
|
||||||
|
//Mihaela Tancu - Animations
|
||||||
|
}
|
||||||
|
|
||||||
|
void fn_v_LogSectionEnd(void)
|
||||||
|
{ gs_iPrintPos--;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
void fn_v_InitMemV6i( void )
|
||||||
|
{
|
||||||
|
Erm_M_InitErrMsg(Erm);
|
||||||
|
Erm_M_InitErrMsg(Mmg);
|
||||||
|
Mmg_fn_vFirstInitMmgModule(10);
|
||||||
|
|
||||||
|
// For morphing datas -> reset !
|
||||||
|
memset(ax_tdstBinMorphInfos,0,MaxInMorphTab*sizeof(tdstBinMorphData));
|
||||||
|
|
||||||
|
SCR_fn_v_RdL0_Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
void fn_v_KillMem( void )
|
||||||
|
{//#ifndef SCR_DM_LightVersion
|
||||||
|
//fn_v_Anl_CloseModule(); // Destroy CallBack
|
||||||
|
fn_v_Cxt_CloseModule();
|
||||||
|
fn_v_Err_CloseModule();
|
||||||
|
//#endif /* SCR_DM_LightVersion */
|
||||||
|
|
||||||
|
fn_v_Link_CloseModule();
|
||||||
|
fn_v_File_CloseModule();
|
||||||
|
|
||||||
|
//#ifndef SCR_DM_LightVersion
|
||||||
|
fn_v_Ntfy_CloseModule();
|
||||||
|
fn_v_Sect_CloseModule();
|
||||||
|
fn_v_Vars_CloseModule();
|
||||||
|
//#endif /* SCR_DM_LightVersion */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
#undef L_GLOBAL_V6_C
|
|
@ -0,0 +1,197 @@
|
||||||
|
// **********************************************************************************
|
||||||
|
// * "makeanim.c" *
|
||||||
|
// * Written by : Mihaela Tancu *
|
||||||
|
// **********************************************************************************
|
||||||
|
|
||||||
|
#define MAKEANIM_C
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "afx.h"
|
||||||
|
#include "SCR.h"
|
||||||
|
|
||||||
|
#include "l_global_v6.h"
|
||||||
|
#include "makeanim.h"
|
||||||
|
|
||||||
|
#include "Print.h"
|
||||||
|
#include "Binary.h"
|
||||||
|
#include "Anims.h"
|
||||||
|
#include "Levels.h"
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
#define D_FIL_StructureDefine
|
||||||
|
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
|
#include "LST.h"
|
||||||
|
#include "TMP.h"
|
||||||
|
#include "ERM.h"
|
||||||
|
|
||||||
|
#define C_MakeanimVersion "1.0"
|
||||||
|
|
||||||
|
#define NombreDanimationsParDirectory 1000
|
||||||
|
#define FAMILY_NAME_LENGTH 32
|
||||||
|
|
||||||
|
#define NO_PROBLEMO 0
|
||||||
|
#define ERR_WRONG_PARAMETERS 1
|
||||||
|
#define ERR_NO_CHL_FILE 2
|
||||||
|
#define ERR_NO_TBL_FILE 3
|
||||||
|
|
||||||
|
unsigned short uwNumOfBank= 1;
|
||||||
|
unsigned short uwNumOfAnim, uwAnalysedAnim;
|
||||||
|
tdFileName TabShortFileName[NombreDanimationsParDirectory];
|
||||||
|
char TabValidAnimations[NombreDanimationsParDirectory];
|
||||||
|
char LongActorName[600];
|
||||||
|
char LongChannelName[600];
|
||||||
|
char LongFileName[600];
|
||||||
|
char AnimationName[600];
|
||||||
|
|
||||||
|
char szFamilyName[FAMILY_NAME_LENGTH];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_vAnimationsOnly
|
||||||
|
Description: binarize animations using alw and lvl files
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_vAnimationsOnly(char *szLevel)
|
||||||
|
{
|
||||||
|
char szFile[256], szCurrentDir[_MAX_PATH], szAnimDir[_MAX_PATH], szAnimDest[_MAX_PATH] ;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
strcpy(szSource, sSource);
|
||||||
|
sprintf(szFile, "%s\\World\\Levels\\%s\\%s.alw", szSource, szLevel, szLevel);
|
||||||
|
MLT_vLoadALWFileInLib(szFile);
|
||||||
|
for(i=0; i<g_lAlwaysIndex; i++)
|
||||||
|
{ GetCurrentDirectory(_MAX_PATH, szCurrentDir);
|
||||||
|
SetCurrentDirectory(sInitialDir);
|
||||||
|
fn_cExecuteMakeanim("Makeanim.exe", bBatch, bAll, bTbl, g_hAlwaysInFile[i]->sLinkCharacter);
|
||||||
|
if (bAll)
|
||||||
|
{ strcpy(szAnimDir, sInitialDir);
|
||||||
|
strcat(szAnimDir, "\\gamedata\\world\\graphics\\anims\\");
|
||||||
|
strcat(szAnimDir, g_hAlwaysInFile[i]->sLinkCharacter);
|
||||||
|
strcpy(szAnimDest, szDestBinDir);
|
||||||
|
strcat(szAnimDest, "\\world\\graphics\\anims\\");
|
||||||
|
strcat(szAnimDest, g_hAlwaysInFile[i]->sLinkCharacter);
|
||||||
|
SAVE_fn_bCopyDirectory(szAnimDir, szAnimDest, TRUE, "A3I");
|
||||||
|
}
|
||||||
|
if (bTbl)
|
||||||
|
{
|
||||||
|
strcpy(szAnimDir, sInitialDir);
|
||||||
|
strcat(szAnimDir, "\\gamedata\\world\\levels\\_common\\families\\");
|
||||||
|
strcat(szAnimDir, g_hAlwaysInFile[i]->sLinkCharacter);
|
||||||
|
strcpy(szAnimDest, szDestBinDir);
|
||||||
|
strcat(szAnimDest, "\\world\\levels\\_common\\families\\");
|
||||||
|
strcat(szAnimDest, g_hAlwaysInFile[i]->sLinkCharacter);
|
||||||
|
SAVE_fn_bCopyDirectory(szAnimDir, szAnimDest, TRUE, "TBL");
|
||||||
|
}
|
||||||
|
|
||||||
|
SetCurrentDirectory(szCurrentDir);
|
||||||
|
}
|
||||||
|
MLT_vEraseALWLib();
|
||||||
|
|
||||||
|
sprintf(szFile, "%s\\World\\Levels\\%s\\%s.lvl", szSource, szLevel, szLevel);
|
||||||
|
MLT_vLoadLVLFileInLib(szFile);
|
||||||
|
for(i=0; i<g_lInsertCharacterIndex; i++)
|
||||||
|
{ GetCurrentDirectory(_MAX_PATH, szCurrentDir);
|
||||||
|
SetCurrentDirectory(sInitialDir);
|
||||||
|
fn_cExecuteMakeanim("Makeanim.exe", bBatch, bAll, bTbl, g_hInsertCharacterInFile[i]->sLinkCharacter);
|
||||||
|
if (bAll)
|
||||||
|
{ strcpy(szAnimDir, sInitialDir);
|
||||||
|
strcat(szAnimDir, "\\gamedata\\world\\graphics\\anims\\");
|
||||||
|
strcat(szAnimDir, g_hInsertCharacterInFile[i]->sLinkCharacter);
|
||||||
|
strcpy(szAnimDest, szDestBinDir);
|
||||||
|
strcat(szAnimDest, "\\world\\graphics\\anims\\");
|
||||||
|
strcat(szAnimDest, g_hInsertCharacterInFile[i]->sLinkCharacter);
|
||||||
|
SAVE_fn_bCopyDirectory(szAnimDir, szAnimDest, TRUE, "A3I");
|
||||||
|
}
|
||||||
|
if (bTbl)
|
||||||
|
{
|
||||||
|
strcpy(szAnimDir, sInitialDir);
|
||||||
|
strcat(szAnimDir, "\\gamedata\\world\\levels\\_common\\families\\");
|
||||||
|
strcat(szAnimDir, g_hInsertCharacterInFile[i]->sLinkCharacter);
|
||||||
|
strcpy(szAnimDest, szDestBinDir);
|
||||||
|
strcat(szAnimDest, "\\world\\levels\\_common\\families\\");
|
||||||
|
strcat(szAnimDest, g_hInsertCharacterInFile[i]->sLinkCharacter);
|
||||||
|
SAVE_fn_bCopyDirectory(szAnimDir, szAnimDest, TRUE, "TBL");
|
||||||
|
}
|
||||||
|
|
||||||
|
SetCurrentDirectory(szCurrentDir);
|
||||||
|
}
|
||||||
|
MLT_vEraseLVLLib();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
=======================================================================================
|
||||||
|
Name: fn_vTextures
|
||||||
|
Description: binarize textures files using lvl and alw files, and .tex files
|
||||||
|
Author: Mihaela Tancu
|
||||||
|
=======================================================================================
|
||||||
|
*/
|
||||||
|
void fn_vTextures(char *szLevel)
|
||||||
|
{
|
||||||
|
char szFile[256], szCurrentDir[_MAX_PATH];
|
||||||
|
int i, j;
|
||||||
|
|
||||||
|
MLT_vInitALWLoad();
|
||||||
|
|
||||||
|
sprintf(szFile, "%s\\World\\Levels\\%s\\%s.alw", sSource, szLevel, szLevel);
|
||||||
|
MLT_vLoadALWFileInLib(szFile);
|
||||||
|
for(i=0; i<g_lAlwaysIndex; i++)
|
||||||
|
{ sprintf(szFile, "%s\\World\\Graphics\\Objects\\Banks\\%s\\%s.tex", sSource, g_hAlwaysInFile[i]->sLinkCharacter, g_hAlwaysInFile[i]->sLinkCharacter);
|
||||||
|
MLT_vInitTEXLoad();
|
||||||
|
MLT_vLoadTEXFileInLib(szFile);
|
||||||
|
for(j=0; j<g_lTexturesIndex; j++)
|
||||||
|
{ GetCurrentDirectory(_MAX_PATH, szCurrentDir);
|
||||||
|
SetCurrentDirectory(sInitialDir);
|
||||||
|
fn_cExecuteConvImg("ConvImg.exe", sSource, szDestBinDir, bBMP, bTGA, bConvert16, bConvert32, g_hTexturesInFile[j]->sLoadTexture);
|
||||||
|
SetCurrentDirectory(szCurrentDir);
|
||||||
|
}
|
||||||
|
MLT_vEraseTEXLib();
|
||||||
|
}
|
||||||
|
MLT_vEraseALWLib();
|
||||||
|
|
||||||
|
MLT_vInitLVLLoad();
|
||||||
|
|
||||||
|
sprintf(szFile, "%s\\World\\Levels\\%s\\%s.lvl", sSource, szLevel, szLevel);
|
||||||
|
MLT_vLoadLVLFileInLib(szFile);
|
||||||
|
for(i=0; i<g_lInsertCharacterIndex; i++)
|
||||||
|
{ sprintf(szFile, "%s\\World\\Graphics\\Objects\\Banks\\%s\\%s.tex", sSource, g_hInsertCharacterInFile[i]->sLinkCharacter, g_hInsertCharacterInFile[i]->sLinkCharacter);
|
||||||
|
MLT_vInitTEXLoad();
|
||||||
|
MLT_vLoadTEXFileInLib(szFile);
|
||||||
|
for(j=0; j<g_lTexturesIndex; j++)
|
||||||
|
{ GetCurrentDirectory(_MAX_PATH, szCurrentDir);
|
||||||
|
SetCurrentDirectory(sInitialDir);
|
||||||
|
fn_cExecuteConvImg("ConvImg.exe", sSource, szDestBinDir, bBMP, bTGA, bConvert16, bConvert32, g_hTexturesInFile[j]->sLoadTexture);
|
||||||
|
SetCurrentDirectory(szCurrentDir);
|
||||||
|
}
|
||||||
|
MLT_vEraseTEXLib();
|
||||||
|
}
|
||||||
|
|
||||||
|
MLT_vEraseLVLLib();
|
||||||
|
|
||||||
|
sprintf(szFile, "%s\\World\\Levels\\%s\\%s.tex", sSource, szLevel, szLevel);
|
||||||
|
MLT_vInitTEXLoad();
|
||||||
|
MLT_vLoadTEXFileInLib(szFile);
|
||||||
|
for(j=0; j<g_lTexturesIndex; j++)
|
||||||
|
{ GetCurrentDirectory(_MAX_PATH, szCurrentDir);
|
||||||
|
SetCurrentDirectory(sInitialDir);
|
||||||
|
fn_cExecuteConvImg("ConvImg.exe", sSource, szDestBinDir, bBMP, bTGA, bConvert16, bConvert32, g_hTexturesInFile[j]->sLoadTexture);
|
||||||
|
SetCurrentDirectory(szCurrentDir);
|
||||||
|
}
|
||||||
|
MLT_vEraseTEXLib();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// **********************************************************************************
|
||||||
|
#undef MAKEANIM_C
|
|
@ -0,0 +1,280 @@
|
||||||
|
# Microsoft Developer Studio Project File - Name="BinaryTool" - Package Owner=<4>
|
||||||
|
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||||
|
# ** DO NOT EDIT **
|
||||||
|
|
||||||
|
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||||
|
|
||||||
|
CFG=BinaryTool - 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 "BinaryTool.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 "BinaryTool.mak" CFG="BinaryTool - Win32 Debug"
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE Possible choices for configuration are:
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE "BinaryTool - Win32 Release" (based on "Win32 (x86) Application")
|
||||||
|
!MESSAGE "BinaryTool - Win32 Debug" (based on "Win32 (x86) Application")
|
||||||
|
!MESSAGE
|
||||||
|
|
||||||
|
# Begin Project
|
||||||
|
# PROP Scc_ProjName ""$/cpa/Appli/BinaryTool2", DYBBAAAA"
|
||||||
|
# PROP Scc_LocalPath "."
|
||||||
|
CPP=cl.exe
|
||||||
|
MTL=midl.exe
|
||||||
|
RSC=rc.exe
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - 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 Ignore_Export_Lib 0
|
||||||
|
# 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 /I "inc" /I "res" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /YX"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 x:\cpa\lib\scrp5_vr.lib x:\cpa\lib\mmgp5_vr.lib x:\cpa\lib\ermp5_vr.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"LIBC" /out:"x:\cpa\exe\main\BinaryTool.exe"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - 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 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 "res" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "USE_PROFILER" /YX"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 x:\cpa\lib\scrp5_vd.lib x:\cpa\lib\mmgp5_vd.lib x:\cpa\lib\ermp5_vd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"LIBCD" /nodefaultlib:"MSVCRT" /out:"x:\cpa\exe\main\BinaryTool.exe" /pdbtype:sept
|
||||||
|
# SUBTRACT LINK32 /nodefaultlib
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# Begin Target
|
||||||
|
|
||||||
|
# Name "BinaryTool - Win32 Release"
|
||||||
|
# Name "BinaryTool - Win32 Debug"
|
||||||
|
# Begin Group "Source Files"
|
||||||
|
|
||||||
|
# PROP Default_Filter ".c;.cpp"
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=".\src\BinaryTool.cpp"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\res\BinaryTool.rc
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=".\src\BinaryToolDlg.cpp"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\file.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\Panel.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\panelafter.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\PanelBeforeBin.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\PanelLevels.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\PanelResults.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\PanelSettings.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\Process.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\Scripts.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\StdAfx.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
# ADD CPP /YX
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\Tasks.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\ThreadAnim.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\ThreadBinarize.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\ThreadTextures.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\util.cpp
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
|
# Begin Group "Include Files"
|
||||||
|
|
||||||
|
# PROP Default_Filter ".h;.hpp"
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=".\inc\BinaryTool.h"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=".\inc\BinaryToolDlg.h"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\file.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\GlobalData.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\Panel.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\panelafter.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\PanelBeforeBin.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\PanelLevels.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\PanelResults.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\PanelSettings.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\Process.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\res\resource.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\Scripts.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\StdAfx.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\Tasks.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\Threads.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\inc\util.h
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
|
# Begin Group "Resources Files"
|
||||||
|
|
||||||
|
# PROP Default_Filter ""
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\res\BinaryTool.clw
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=".\res\BinaryTool.ico"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=".\res\BinaryTool.rc2"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\res\case_checked.bmp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\res\case_vide.bmp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\res\croix.bmp
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=".\BinaryTool.mak"
|
||||||
|
# End Source File
|
||||||
|
# End Target
|
||||||
|
# End Project
|
|
@ -0,0 +1,979 @@
|
||||||
|
# Microsoft Developer Studio Generated NMAKE File, Based on BinaryTool.dsp
|
||||||
|
!IF "$(CFG)" == ""
|
||||||
|
CFG=BinaryTool - Win32 Debug
|
||||||
|
!MESSAGE No configuration specified. Defaulting to BinaryTool - Win32 Debug.
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
!IF "$(CFG)" != "BinaryTool - Win32 Release" && "$(CFG)" !=\
|
||||||
|
"BinaryTool - Win32 Debug"
|
||||||
|
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||||
|
!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 "BinaryTool.mak" CFG="BinaryTool - Win32 Debug"
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE Possible choices for configuration are:
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE "BinaryTool - Win32 Release" (based on "Win32 (x86) Application")
|
||||||
|
!MESSAGE "BinaryTool - Win32 Debug" (based on "Win32 (x86) Application")
|
||||||
|
!MESSAGE
|
||||||
|
!ERROR An invalid configuration is specified.
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
!IF "$(OS)" == "Windows_NT"
|
||||||
|
NULL=
|
||||||
|
!ELSE
|
||||||
|
NULL=nul
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
OUTDIR=.\Release
|
||||||
|
INTDIR=.\Release
|
||||||
|
|
||||||
|
!IF "$(RECURSE)" == "0"
|
||||||
|
|
||||||
|
ALL : "..\..\exe\main\BinaryTool.exe"
|
||||||
|
|
||||||
|
!ELSE
|
||||||
|
|
||||||
|
ALL : "..\..\exe\main\BinaryTool.exe"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
CLEAN :
|
||||||
|
-@erase "$(INTDIR)\BinaryTool.obj"
|
||||||
|
-@erase "$(INTDIR)\BinaryTool.res"
|
||||||
|
-@erase "$(INTDIR)\BinaryToolDlg.obj"
|
||||||
|
-@erase "$(INTDIR)\file.obj"
|
||||||
|
-@erase "$(INTDIR)\Panel.obj"
|
||||||
|
-@erase "$(INTDIR)\panelafter.obj"
|
||||||
|
-@erase "$(INTDIR)\PanelBeforeBin.obj"
|
||||||
|
-@erase "$(INTDIR)\PanelLevels.obj"
|
||||||
|
-@erase "$(INTDIR)\PanelResults.obj"
|
||||||
|
-@erase "$(INTDIR)\PanelSettings.obj"
|
||||||
|
-@erase "$(INTDIR)\Process.obj"
|
||||||
|
-@erase "$(INTDIR)\Scripts.obj"
|
||||||
|
-@erase "$(INTDIR)\StdAfx.obj"
|
||||||
|
-@erase "$(INTDIR)\Tasks.obj"
|
||||||
|
-@erase "$(INTDIR)\ThreadAnim.obj"
|
||||||
|
-@erase "$(INTDIR)\ThreadBinarize.obj"
|
||||||
|
-@erase "$(INTDIR)\ThreadTextures.obj"
|
||||||
|
-@erase "$(INTDIR)\util.obj"
|
||||||
|
-@erase "$(INTDIR)\vc50.idb"
|
||||||
|
-@erase "..\..\exe\main\BinaryTool.exe"
|
||||||
|
|
||||||
|
"$(OUTDIR)" :
|
||||||
|
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||||
|
|
||||||
|
CPP=cl.exe
|
||||||
|
CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "inc" /I "res" /D "WIN32" /D "NDEBUG" /D\
|
||||||
|
"_WINDOWS" /D "_AFXDLL" /Fp"$(INTDIR)\BinaryTool.pch" /YX"stdafx.h"\
|
||||||
|
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||||
|
CPP_OBJS=.\Release/
|
||||||
|
CPP_SBRS=.
|
||||||
|
|
||||||
|
.c{$(CPP_OBJS)}.obj::
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_PROJ) $<
|
||||||
|
<<
|
||||||
|
|
||||||
|
.cpp{$(CPP_OBJS)}.obj::
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_PROJ) $<
|
||||||
|
<<
|
||||||
|
|
||||||
|
.cxx{$(CPP_OBJS)}.obj::
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_PROJ) $<
|
||||||
|
<<
|
||||||
|
|
||||||
|
.c{$(CPP_SBRS)}.sbr::
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_PROJ) $<
|
||||||
|
<<
|
||||||
|
|
||||||
|
.cpp{$(CPP_SBRS)}.sbr::
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_PROJ) $<
|
||||||
|
<<
|
||||||
|
|
||||||
|
.cxx{$(CPP_SBRS)}.sbr::
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_PROJ) $<
|
||||||
|
<<
|
||||||
|
|
||||||
|
MTL=midl.exe
|
||||||
|
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||||
|
RSC=rc.exe
|
||||||
|
RSC_PROJ=/l 0x40c /fo"$(INTDIR)\BinaryTool.res" /d "NDEBUG" /d "_AFXDLL"
|
||||||
|
BSC32=bscmake.exe
|
||||||
|
BSC32_FLAGS=/nologo /o"$(OUTDIR)\BinaryTool.bsc"
|
||||||
|
BSC32_SBRS= \
|
||||||
|
|
||||||
|
LINK32=link.exe
|
||||||
|
LINK32_FLAGS=x:\cpa\lib\scrp5_vr.lib x:\cpa\lib\mmgp5_vr.lib\
|
||||||
|
x:\cpa\lib\ermp5_vr.lib /nologo /subsystem:windows /incremental:no\
|
||||||
|
/pdb:"$(OUTDIR)\BinaryTool.pdb" /machine:I386 /nodefaultlib:"LIBC"\
|
||||||
|
/out:"x:\cpa\exe\main\BinaryTool.exe"
|
||||||
|
LINK32_OBJS= \
|
||||||
|
"$(INTDIR)\BinaryTool.obj" \
|
||||||
|
"$(INTDIR)\BinaryTool.res" \
|
||||||
|
"$(INTDIR)\BinaryToolDlg.obj" \
|
||||||
|
"$(INTDIR)\file.obj" \
|
||||||
|
"$(INTDIR)\Panel.obj" \
|
||||||
|
"$(INTDIR)\panelafter.obj" \
|
||||||
|
"$(INTDIR)\PanelBeforeBin.obj" \
|
||||||
|
"$(INTDIR)\PanelLevels.obj" \
|
||||||
|
"$(INTDIR)\PanelResults.obj" \
|
||||||
|
"$(INTDIR)\PanelSettings.obj" \
|
||||||
|
"$(INTDIR)\Process.obj" \
|
||||||
|
"$(INTDIR)\Scripts.obj" \
|
||||||
|
"$(INTDIR)\StdAfx.obj" \
|
||||||
|
"$(INTDIR)\Tasks.obj" \
|
||||||
|
"$(INTDIR)\ThreadAnim.obj" \
|
||||||
|
"$(INTDIR)\ThreadBinarize.obj" \
|
||||||
|
"$(INTDIR)\ThreadTextures.obj" \
|
||||||
|
"$(INTDIR)\util.obj"
|
||||||
|
|
||||||
|
"..\..\exe\main\BinaryTool.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||||
|
$(LINK32) @<<
|
||||||
|
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||||
|
<<
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
OUTDIR=.\Debug
|
||||||
|
INTDIR=.\Debug
|
||||||
|
|
||||||
|
!IF "$(RECURSE)" == "0"
|
||||||
|
|
||||||
|
ALL : "..\..\exe\main\BinaryTool.exe"
|
||||||
|
|
||||||
|
!ELSE
|
||||||
|
|
||||||
|
ALL : "..\..\exe\main\BinaryTool.exe"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
CLEAN :
|
||||||
|
-@erase "$(INTDIR)\BinaryTool.obj"
|
||||||
|
-@erase "$(INTDIR)\BinaryTool.res"
|
||||||
|
-@erase "$(INTDIR)\BinaryToolDlg.obj"
|
||||||
|
-@erase "$(INTDIR)\file.obj"
|
||||||
|
-@erase "$(INTDIR)\Panel.obj"
|
||||||
|
-@erase "$(INTDIR)\panelafter.obj"
|
||||||
|
-@erase "$(INTDIR)\PanelBeforeBin.obj"
|
||||||
|
-@erase "$(INTDIR)\PanelLevels.obj"
|
||||||
|
-@erase "$(INTDIR)\PanelResults.obj"
|
||||||
|
-@erase "$(INTDIR)\PanelSettings.obj"
|
||||||
|
-@erase "$(INTDIR)\Process.obj"
|
||||||
|
-@erase "$(INTDIR)\Scripts.obj"
|
||||||
|
-@erase "$(INTDIR)\StdAfx.obj"
|
||||||
|
-@erase "$(INTDIR)\Tasks.obj"
|
||||||
|
-@erase "$(INTDIR)\ThreadAnim.obj"
|
||||||
|
-@erase "$(INTDIR)\ThreadBinarize.obj"
|
||||||
|
-@erase "$(INTDIR)\ThreadTextures.obj"
|
||||||
|
-@erase "$(INTDIR)\util.obj"
|
||||||
|
-@erase "$(INTDIR)\vc50.idb"
|
||||||
|
-@erase "$(INTDIR)\vc50.pdb"
|
||||||
|
-@erase "$(OUTDIR)\BinaryTool.pdb"
|
||||||
|
-@erase "..\..\exe\main\BinaryTool.exe"
|
||||||
|
-@erase "..\..\exe\main\BinaryTool.ilk"
|
||||||
|
|
||||||
|
"$(OUTDIR)" :
|
||||||
|
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||||
|
|
||||||
|
CPP=cl.exe
|
||||||
|
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "inc" /I "res" /D "WIN32" /D\
|
||||||
|
"_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "USE_PROFILER"\
|
||||||
|
/Fp"$(INTDIR)\BinaryTool.pch" /YX"StdAfx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\"\
|
||||||
|
/FD /c
|
||||||
|
CPP_OBJS=.\Debug/
|
||||||
|
CPP_SBRS=.
|
||||||
|
|
||||||
|
.c{$(CPP_OBJS)}.obj::
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_PROJ) $<
|
||||||
|
<<
|
||||||
|
|
||||||
|
.cpp{$(CPP_OBJS)}.obj::
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_PROJ) $<
|
||||||
|
<<
|
||||||
|
|
||||||
|
.cxx{$(CPP_OBJS)}.obj::
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_PROJ) $<
|
||||||
|
<<
|
||||||
|
|
||||||
|
.c{$(CPP_SBRS)}.sbr::
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_PROJ) $<
|
||||||
|
<<
|
||||||
|
|
||||||
|
.cpp{$(CPP_SBRS)}.sbr::
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_PROJ) $<
|
||||||
|
<<
|
||||||
|
|
||||||
|
.cxx{$(CPP_SBRS)}.sbr::
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_PROJ) $<
|
||||||
|
<<
|
||||||
|
|
||||||
|
MTL=midl.exe
|
||||||
|
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||||
|
RSC=rc.exe
|
||||||
|
RSC_PROJ=/l 0x40c /fo"$(INTDIR)\BinaryTool.res" /d "_DEBUG" /d "_AFXDLL"
|
||||||
|
BSC32=bscmake.exe
|
||||||
|
BSC32_FLAGS=/nologo /o"$(OUTDIR)\BinaryTool.bsc"
|
||||||
|
BSC32_SBRS= \
|
||||||
|
|
||||||
|
LINK32=link.exe
|
||||||
|
LINK32_FLAGS=x:\cpa\lib\scrp5_vd.lib x:\cpa\lib\mmgp5_vd.lib\
|
||||||
|
x:\cpa\lib\ermp5_vd.lib /nologo /subsystem:windows /incremental:yes\
|
||||||
|
/pdb:"$(OUTDIR)\BinaryTool.pdb" /debug /machine:I386 /nodefaultlib:"LIBCD"\
|
||||||
|
/nodefaultlib:"MSVCRT" /out:"x:\cpa\exe\main\BinaryTool.exe" /pdbtype:sept
|
||||||
|
LINK32_OBJS= \
|
||||||
|
"$(INTDIR)\BinaryTool.obj" \
|
||||||
|
"$(INTDIR)\BinaryTool.res" \
|
||||||
|
"$(INTDIR)\BinaryToolDlg.obj" \
|
||||||
|
"$(INTDIR)\file.obj" \
|
||||||
|
"$(INTDIR)\Panel.obj" \
|
||||||
|
"$(INTDIR)\panelafter.obj" \
|
||||||
|
"$(INTDIR)\PanelBeforeBin.obj" \
|
||||||
|
"$(INTDIR)\PanelLevels.obj" \
|
||||||
|
"$(INTDIR)\PanelResults.obj" \
|
||||||
|
"$(INTDIR)\PanelSettings.obj" \
|
||||||
|
"$(INTDIR)\Process.obj" \
|
||||||
|
"$(INTDIR)\Scripts.obj" \
|
||||||
|
"$(INTDIR)\StdAfx.obj" \
|
||||||
|
"$(INTDIR)\Tasks.obj" \
|
||||||
|
"$(INTDIR)\ThreadAnim.obj" \
|
||||||
|
"$(INTDIR)\ThreadBinarize.obj" \
|
||||||
|
"$(INTDIR)\ThreadTextures.obj" \
|
||||||
|
"$(INTDIR)\util.obj"
|
||||||
|
|
||||||
|
"..\..\exe\main\BinaryTool.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||||
|
$(LINK32) @<<
|
||||||
|
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||||
|
<<
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release" || "$(CFG)" ==\
|
||||||
|
"BinaryTool - Win32 Debug"
|
||||||
|
SOURCE=".\src\BinaryTool.cpp"
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_BINAR=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\Scripts.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\BinaryTool.obj" : $(SOURCE) $(DEP_CPP_BINAR) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_BINAR=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\Scripts.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\BinaryTool.obj" : $(SOURCE) $(DEP_CPP_BINAR) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\res\BinaryTool.rc
|
||||||
|
DEP_RSC_BINARY=\
|
||||||
|
".\res\BinaryTool.ico"\
|
||||||
|
".\res\BinaryTool.rc2"\
|
||||||
|
".\res\case_checked.bmp"\
|
||||||
|
".\res\case_vide.bmp"\
|
||||||
|
".\res\croix.bmp"\
|
||||||
|
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\BinaryTool.res" : $(SOURCE) $(DEP_RSC_BINARY) "$(INTDIR)"
|
||||||
|
$(RSC) /l 0x40c /fo"$(INTDIR)\BinaryTool.res" /i "res" /d "NDEBUG" /d\
|
||||||
|
"_AFXDLL" $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\BinaryTool.res" : $(SOURCE) $(DEP_RSC_BINARY) "$(INTDIR)"
|
||||||
|
$(RSC) /l 0x40c /fo"$(INTDIR)\BinaryTool.res" /i "res" /d "_DEBUG" /d\
|
||||||
|
"_AFXDLL" $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=".\src\BinaryToolDlg.cpp"
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_BINARYT=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\panelafter.h"\
|
||||||
|
".\inc\PanelBeforeBin.h"\
|
||||||
|
".\inc\PanelLevels.h"\
|
||||||
|
".\inc\PanelResults.h"\
|
||||||
|
".\inc\PanelSettings.h"\
|
||||||
|
".\inc\Scripts.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\BinaryToolDlg.obj" : $(SOURCE) $(DEP_CPP_BINARYT) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_BINARYT=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\panelafter.h"\
|
||||||
|
".\inc\PanelBeforeBin.h"\
|
||||||
|
".\inc\PanelLevels.h"\
|
||||||
|
".\inc\PanelResults.h"\
|
||||||
|
".\inc\PanelSettings.h"\
|
||||||
|
".\inc\Scripts.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\BinaryToolDlg.obj" : $(SOURCE) $(DEP_CPP_BINARYT) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\file.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_FILE_=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\file.obj" : $(SOURCE) $(DEP_CPP_FILE_) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_FILE_=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\file.obj" : $(SOURCE) $(DEP_CPP_FILE_) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\Panel.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_PANEL=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\Panel.obj" : $(SOURCE) $(DEP_CPP_PANEL) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_PANEL=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\Panel.obj" : $(SOURCE) $(DEP_CPP_PANEL) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\panelafter.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_PANELA=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\panelafter.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\panelafter.obj" : $(SOURCE) $(DEP_CPP_PANELA) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_PANELA=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\panelafter.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\panelafter.obj" : $(SOURCE) $(DEP_CPP_PANELA) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\PanelBeforeBin.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_PANELB=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\PanelBeforeBin.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\Threads.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\PanelBeforeBin.obj" : $(SOURCE) $(DEP_CPP_PANELB) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_PANELB=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\PanelBeforeBin.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\Threads.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\PanelBeforeBin.obj" : $(SOURCE) $(DEP_CPP_PANELB) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\PanelLevels.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_PANELL=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\PanelLevels.h"\
|
||||||
|
".\inc\Scripts.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\Tasks.h"\
|
||||||
|
".\inc\Threads.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\PanelLevels.obj" : $(SOURCE) $(DEP_CPP_PANELL) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_PANELL=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\PanelLevels.h"\
|
||||||
|
".\inc\Scripts.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\Tasks.h"\
|
||||||
|
".\inc\Threads.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\PanelLevels.obj" : $(SOURCE) $(DEP_CPP_PANELL) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\PanelResults.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_PANELR=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\PanelResults.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\PanelResults.obj" : $(SOURCE) $(DEP_CPP_PANELR) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_PANELR=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\PanelResults.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\PanelResults.obj" : $(SOURCE) $(DEP_CPP_PANELR) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\PanelSettings.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_PANELS=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\PanelSettings.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\Tasks.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\PanelSettings.obj" : $(SOURCE) $(DEP_CPP_PANELS) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_PANELS=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\PanelSettings.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\Tasks.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\PanelSettings.obj" : $(SOURCE) $(DEP_CPP_PANELS) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\Process.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_PROCE=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\Process.obj" : $(SOURCE) $(DEP_CPP_PROCE) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_PROCE=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\Process.obj" : $(SOURCE) $(DEP_CPP_PROCE) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\Scripts.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_SCRIP=\
|
||||||
|
"..\..\public\cpa_dep.h"\
|
||||||
|
"..\..\public\cpa_std.h"\
|
||||||
|
"..\..\Public\ERM.h"\
|
||||||
|
"..\..\Public\Erm\CpaError.h"\
|
||||||
|
"..\..\public\mmg.h"\
|
||||||
|
"..\..\public\mmg\cpammg.h"\
|
||||||
|
"..\..\public\mmg\errmmg.h"\
|
||||||
|
"..\..\public\mmg\rastmmg.h"\
|
||||||
|
"..\..\public\scr.h"\
|
||||||
|
"..\..\public\scr\errscr.h"\
|
||||||
|
"..\..\public\scr\mmgscr.h"\
|
||||||
|
"..\..\public\scr\scr_anl.h"\
|
||||||
|
"..\..\public\scr\scr_bin.h"\
|
||||||
|
"..\..\public\scr\scr_cfg.h"\
|
||||||
|
"..\..\public\scr\scr_cfil.h"\
|
||||||
|
"..\..\public\scr\scr_cxt.h"\
|
||||||
|
"..\..\public\scr\scr_dbg.h"\
|
||||||
|
"..\..\public\scr\scr_dyar.h"\
|
||||||
|
"..\..\public\scr\scr_err.h"\
|
||||||
|
"..\..\public\scr\scr_file.h"\
|
||||||
|
"..\..\public\scr\scr_hash.h"\
|
||||||
|
"..\..\public\scr\scr_link.h"\
|
||||||
|
"..\..\public\scr\scr_mem.h"\
|
||||||
|
"..\..\public\scr\scr_ntfy.h"\
|
||||||
|
"..\..\public\scr\scr_page.h"\
|
||||||
|
"..\..\public\scr\scr_pars.h"\
|
||||||
|
"..\..\public\scr\scr_rdl0.h"\
|
||||||
|
"..\..\public\scr\scr_sect.h"\
|
||||||
|
"..\..\public\scr\scr_svl0.h"\
|
||||||
|
"..\..\public\scr\scr_svl1.h"\
|
||||||
|
"..\..\public\scr\scr_vars.h"\
|
||||||
|
"..\..\public\scr\scr_xxxx.h"\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\Scripts.obj" : $(SOURCE) $(DEP_CPP_SCRIP) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_SCRIP=\
|
||||||
|
"..\..\public\cpa_dep.h"\
|
||||||
|
"..\..\public\cpa_std.h"\
|
||||||
|
"..\..\Public\ERM.h"\
|
||||||
|
"..\..\Public\Erm\CpaError.h"\
|
||||||
|
"..\..\public\mmg.h"\
|
||||||
|
"..\..\public\mmg\cpammg.h"\
|
||||||
|
"..\..\public\mmg\errmmg.h"\
|
||||||
|
"..\..\public\mmg\rastmmg.h"\
|
||||||
|
"..\..\public\scr.h"\
|
||||||
|
"..\..\public\scr\errscr.h"\
|
||||||
|
"..\..\public\scr\mmgscr.h"\
|
||||||
|
"..\..\public\scr\scr_anl.h"\
|
||||||
|
"..\..\public\scr\scr_bin.h"\
|
||||||
|
"..\..\public\scr\scr_cfg.h"\
|
||||||
|
"..\..\public\scr\scr_cfil.h"\
|
||||||
|
"..\..\public\scr\scr_cxt.h"\
|
||||||
|
"..\..\public\scr\scr_dbg.h"\
|
||||||
|
"..\..\public\scr\scr_dyar.h"\
|
||||||
|
"..\..\public\scr\scr_err.h"\
|
||||||
|
"..\..\public\scr\scr_file.h"\
|
||||||
|
"..\..\public\scr\scr_hash.h"\
|
||||||
|
"..\..\public\scr\scr_link.h"\
|
||||||
|
"..\..\public\scr\scr_mem.h"\
|
||||||
|
"..\..\public\scr\scr_ntfy.h"\
|
||||||
|
"..\..\public\scr\scr_page.h"\
|
||||||
|
"..\..\public\scr\scr_pars.h"\
|
||||||
|
"..\..\public\scr\scr_rdl0.h"\
|
||||||
|
"..\..\public\scr\scr_sect.h"\
|
||||||
|
"..\..\public\scr\scr_svl0.h"\
|
||||||
|
"..\..\public\scr\scr_svl1.h"\
|
||||||
|
"..\..\public\scr\scr_vars.h"\
|
||||||
|
"..\..\public\scr\scr_xxxx.h"\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\Scripts.obj" : $(SOURCE) $(DEP_CPP_SCRIP) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\StdAfx.cpp
|
||||||
|
DEP_CPP_STDAF=\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
CPP_SWITCHES=/nologo /MD /W3 /GX /O2 /I "inc" /I "res" /D "WIN32" /D "NDEBUG"\
|
||||||
|
/D "_WINDOWS" /D "_AFXDLL" /Fp"$(INTDIR)\BinaryTool.pch" /YX"stdafx.h"\
|
||||||
|
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||||
|
|
||||||
|
"$(INTDIR)\StdAfx.obj" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)"
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_SWITCHES) $(SOURCE)
|
||||||
|
<<
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
CPP_SWITCHES=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "inc" /I "res" /D "WIN32" /D\
|
||||||
|
"_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "USE_PROFILER"\
|
||||||
|
/Fp"$(INTDIR)\BinaryTool.pch" /YX"StdAfx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\"\
|
||||||
|
/FD /c
|
||||||
|
|
||||||
|
"$(INTDIR)\StdAfx.obj" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)"
|
||||||
|
$(CPP) @<<
|
||||||
|
$(CPP_SWITCHES) $(SOURCE)
|
||||||
|
<<
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\Tasks.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_TASKS=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\Scripts.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\Threads.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\Tasks.obj" : $(SOURCE) $(DEP_CPP_TASKS) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_TASKS=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\Scripts.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\Threads.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\Tasks.obj" : $(SOURCE) $(DEP_CPP_TASKS) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\ThreadAnim.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_THREA=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\ThreadAnim.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_THREA=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\ThreadAnim.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\ThreadBinarize.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_THREAD=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\ThreadBinarize.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_THREAD=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\ThreadBinarize.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\ThreadTextures.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_THREADT=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\ThreadTextures.obj" : $(SOURCE) $(DEP_CPP_THREADT) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_THREADT=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\ThreadTextures.obj" : $(SOURCE) $(DEP_CPP_THREADT) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
SOURCE=.\src\util.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "BinaryTool - Win32 Release"
|
||||||
|
|
||||||
|
DEP_CPP_UTIL_=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\util.obj" : $(SOURCE) $(DEP_CPP_UTIL_) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "BinaryTool - Win32 Debug"
|
||||||
|
|
||||||
|
DEP_CPP_UTIL_=\
|
||||||
|
".\inc\BinaryTool.h"\
|
||||||
|
".\inc\BinaryToolDlg.h"\
|
||||||
|
".\inc\file.h"\
|
||||||
|
".\inc\GlobalData.h"\
|
||||||
|
".\inc\Panel.h"\
|
||||||
|
".\inc\StdAfx.h"\
|
||||||
|
".\inc\util.h"\
|
||||||
|
|
||||||
|
|
||||||
|
"$(INTDIR)\util.obj" : $(SOURCE) $(DEP_CPP_UTIL_) "$(INTDIR)"
|
||||||
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
// BinaryTool.h : main header file for the BINARY TOOL application
|
||||||
|
//
|
||||||
|
|
||||||
|
#if !defined(AFX_BINARYTOOL_H__6B8ECEAE_CC90_11D2_BB42_00E029219C3C__INCLUDED_)
|
||||||
|
#define AFX_BINARYTOOL_H__6B8ECEAE_CC90_11D2_BB42_00E029219C3C__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
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBinaryToolApp:
|
||||||
|
// See BinaryTool.cpp for the implementation of this class
|
||||||
|
//
|
||||||
|
|
||||||
|
class CBinaryToolApp : public CWinApp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CBinaryToolApp();
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CBinaryToolApp)
|
||||||
|
public:
|
||||||
|
virtual BOOL InitInstance();
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
|
||||||
|
//{{AFX_MSG(CBinaryToolApp)
|
||||||
|
// NOTE - the ClassWizard will add and remove member functions here.
|
||||||
|
// DO NOT EDIT what you see in these blocks of generated code !
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_BINARYTOOL_H__6B8ECEAE_CC90_11D2_BB42_00E029219C3C__INCLUDED_)
|
|
@ -0,0 +1,74 @@
|
||||||
|
// BinaryToolDlg.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
#if !defined(AFX_BINARYTOOLDLG_H__6B8ECEB0_CC90_11D2_BB42_00E029219C3C__INCLUDED_)
|
||||||
|
#define AFX_BINARYTOOLDLG_H__6B8ECEB0_CC90_11D2_BB42_00E029219C3C__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
|
||||||
|
#include "Panel.h"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBinaryToolDlg dialog
|
||||||
|
|
||||||
|
class CBinaryToolDlg : public CDialog
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CBinaryToolDlg(CWnd* pParent = NULL); // standard constructor
|
||||||
|
~CBinaryToolDlg();
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CBinaryToolDlg)
|
||||||
|
enum { IDD = IDD_BINARYTOOL_DIALOG };
|
||||||
|
CTabCtrl m_TabControl;
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
void m_fn_vNotifyStartOfWork();
|
||||||
|
void m_fn_vNotifyEndOfWork( BOOL _bKeepDisplayResultPanel );
|
||||||
|
void m_fn_vCancelStopWorkInProgress();
|
||||||
|
BOOL m_fn_bRefreshLevelList();
|
||||||
|
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CBinaryToolDlg)
|
||||||
|
public:
|
||||||
|
virtual BOOL DestroyWindow();
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
HICON m_hIcon;
|
||||||
|
CString m_csDlgTitle;
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CBinaryToolDlg)
|
||||||
|
virtual BOOL OnInitDialog();
|
||||||
|
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||||
|
afx_msg void OnPaint();
|
||||||
|
afx_msg HCURSOR OnQueryDragIcon();
|
||||||
|
afx_msg void OnSelchangeTabPanel(NMHDR* pNMHDR, LRESULT* pResult);
|
||||||
|
afx_msg void OnQuit();
|
||||||
|
afx_msg void OnClose();
|
||||||
|
afx_msg void OnStopWorkInProgress();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
|
||||||
|
// For panels management
|
||||||
|
CPanel *m_a_pPanels[10];
|
||||||
|
int m_iNumberOfPanels;
|
||||||
|
int m_iCurrentPanel;
|
||||||
|
int m_iPanelBeforeStartOfWork;
|
||||||
|
int m_iResultPanel;
|
||||||
|
|
||||||
|
void m_fn_vSetCurrentPanel( int _iNewPanel );
|
||||||
|
virtual void OnOK();
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_BINARYTOOLDLG_H__6B8ECEB0_CC90_11D2_BB42_00E029219C3C__INCLUDED_)
|
|
@ -0,0 +1,61 @@
|
||||||
|
|
||||||
|
#ifndef _GLOBALDATA_H_
|
||||||
|
#define _GLOBALDATA_H_
|
||||||
|
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
|
||||||
|
#include "BinaryTool.h"
|
||||||
|
#include "BinaryToolDlg.h"
|
||||||
|
|
||||||
|
typedef struct tdstGlobalData_
|
||||||
|
{
|
||||||
|
// Info on main window
|
||||||
|
CBinaryToolDlg *p_oMainDlg;
|
||||||
|
CEdit *p_oEditResults;
|
||||||
|
|
||||||
|
// Directory where Binary Tool was launched
|
||||||
|
CString csStartupDirectory;
|
||||||
|
|
||||||
|
// Event set when user wants to stop a work in progress
|
||||||
|
HANDLE hEventStop;
|
||||||
|
BOOL bStopWork; // Same thing as EventStop (set and reset at the same time)
|
||||||
|
|
||||||
|
// User settings
|
||||||
|
CString csBinDirectory; // Path of binary data directory (ex: x:\cpa\exe\main\Bindatas)
|
||||||
|
CString csMainDirectory; // Path of main directory (ex: x:\cpa\exe\main)
|
||||||
|
CString csExeName; // Name of game executable without path (ex: MainWinR.exe )
|
||||||
|
BOOL bDebugVersion; // True if debug, false if release
|
||||||
|
CString csTempTextureDirectory; // A temporary directory for texture bigfile.
|
||||||
|
|
||||||
|
// All possible executables (one per version (debug or release)
|
||||||
|
CStringArray csExecutableNames;
|
||||||
|
|
||||||
|
// From version.ini
|
||||||
|
CStringArray a_csVersionDirectories;
|
||||||
|
|
||||||
|
// From soundversion.ini
|
||||||
|
CStringArray a_csSoundVersionDirectories;
|
||||||
|
|
||||||
|
// From game.dsc
|
||||||
|
CStringArray a_csLevelNames;
|
||||||
|
|
||||||
|
// Binarized levels (array of booleans)
|
||||||
|
CByteArray a_cLevelsSelectedForBinarization;
|
||||||
|
CByteArray a_cBinarizedLevels;
|
||||||
|
|
||||||
|
// Used when binarizing :
|
||||||
|
BOOL bCommonFilesAreCopied; // The files common to all levels have been copied (vignettes, options and such)
|
||||||
|
BOOL bStopBinarizeOnError; // Stop if binarization fails on one map ?
|
||||||
|
BOOL bAutoTestMaps; // Launch automatic test after binarize ?
|
||||||
|
|
||||||
|
// When spawning programs.
|
||||||
|
BOOL bAutoDetectErrors; // Automaticaly close spawned programs on error.
|
||||||
|
|
||||||
|
} tdstGlobalData;
|
||||||
|
|
||||||
|
extern struct tdstGlobalData_ g_stTheGlobalData; // Defined in BinaryTool.cpp
|
||||||
|
|
||||||
|
#endif /* _GLOBALDATA_H_ */
|
|
@ -0,0 +1,60 @@
|
||||||
|
#if !defined(AFX_PANEL_H__89CC65A9_D186_11D2_BB48_00E029219C3C__INCLUDED_)
|
||||||
|
#define AFX_PANEL_H__89CC65A9_D186_11D2_BB48_00E029219C3C__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
// Panel.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CPanel dialog
|
||||||
|
|
||||||
|
class CPanel : public CDialog
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CPanel(UINT nIDTemplate, CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CPanel)
|
||||||
|
enum { IDD = IDD_ABOUTBOX };
|
||||||
|
// NOTE: the ClassWizard will add data members here
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
TCHAR m_szTitle[64];
|
||||||
|
|
||||||
|
virtual BOOL Create( CWnd* pParentWnd );
|
||||||
|
virtual void m_fn_vUpdateRegistry();
|
||||||
|
virtual void m_fn_vEnableAllControls( BOOL bEnable );
|
||||||
|
|
||||||
|
// Methods To control departure from and arrival to a panel
|
||||||
|
// Test if can leave this panel
|
||||||
|
virtual BOOL m_fn_bCanChangePanel();
|
||||||
|
// Called when we arrive in panel (just before displaying it).
|
||||||
|
virtual void m_fn_vOnDisplayPanel();
|
||||||
|
virtual void m_fn_vLevelListHasChanged( BOOL _bErrorWhileReadingGameDsc );
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CPanel)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CPanel)
|
||||||
|
// NOTE: the ClassWizard will add member functions here
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
|
||||||
|
virtual void OnOk();
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_PANEL_H__89CC65A9_D186_11D2_BB48_00E029219C3C__INCLUDED_)
|
|
@ -0,0 +1,59 @@
|
||||||
|
#if !defined(AFX_PANELBEFOREBIN_H__6B8ECEB8_CC90_11D2_BB42_00E029219C3C__INCLUDED_)
|
||||||
|
#define AFX_PANELBEFOREBIN_H__6B8ECEB8_CC90_11D2_BB42_00E029219C3C__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
// PanelBeforeBin.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "Panel.h"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CPanelBeforeBin dialog
|
||||||
|
|
||||||
|
class CPanelBeforeBin : public CPanel
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CPanelBeforeBin(CWnd* pParent=NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CPanelBeforeBin)
|
||||||
|
enum { IDD = IDD_DIALOG_BeforeBinarization };
|
||||||
|
CEdit m_oEditTempDirForTextures;
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
virtual BOOL Create( CWnd* pParentWnd );
|
||||||
|
virtual void m_fn_vUpdateRegistry();
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CPanelBeforeBin)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CPanelBeforeBin)
|
||||||
|
afx_msg void OnMakeSoundBanks();
|
||||||
|
virtual BOOL OnInitDialog();
|
||||||
|
afx_msg void OnCopySound();
|
||||||
|
afx_msg void OnMakeGF();
|
||||||
|
afx_msg void OnBrowseTempTextureDirectory();
|
||||||
|
afx_msg void OnMakeBigFile();
|
||||||
|
afx_msg void OnMakeA3i();
|
||||||
|
afx_msg void OnKillfocusEDITTempTextureDirectory();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
|
||||||
|
void m_fn_vValidateTempTextureDirectory();
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_PANELBEFOREBIN_H__6B8ECEB8_CC90_11D2_BB42_00E029219C3C__INCLUDED_)
|
|
@ -0,0 +1,116 @@
|
||||||
|
#if !defined(AFX_PANELLEVELS_H__90CBA234_D209_11D2_BB49_00E029219C3C__INCLUDED_)
|
||||||
|
#define AFX_PANELLEVELS_H__90CBA234_D209_11D2_BB49_00E029219C3C__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
// PanelLevels.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "Panel.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CListLevels window
|
||||||
|
|
||||||
|
class CListLevels : public CListBox
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CListLevels();
|
||||||
|
|
||||||
|
// Attributes
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Operations
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CListLevels)
|
||||||
|
public:
|
||||||
|
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
public:
|
||||||
|
virtual ~CListLevels();
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
protected:
|
||||||
|
//{{AFX_MSG(CListLevels)
|
||||||
|
// NOTE - the ClassWizard will add and remove member functions here.
|
||||||
|
//}}AFX_MSG
|
||||||
|
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CPanelLevels dialog
|
||||||
|
|
||||||
|
class CPanelLevels : public CPanel
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CPanelLevels(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CPanelLevels)
|
||||||
|
enum { IDD = IDD_DIALOG_Levels };
|
||||||
|
CButton m_CheckAutoTest;
|
||||||
|
CButton m_CheckStopOnError;
|
||||||
|
CListBox m_ListLevels;
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
virtual BOOL Create( CWnd* pParentWnd );
|
||||||
|
virtual void m_fn_vUpdateRegistry();
|
||||||
|
virtual void m_fn_vLevelListHasChanged( BOOL _bErrorWhileReadingGameDsc );
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CPanelLevels)
|
||||||
|
public:
|
||||||
|
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
///CByteArray m_oSelectedLevels;
|
||||||
|
|
||||||
|
// To display a cross in front of selected levels.
|
||||||
|
CDC m_oCrossDC;
|
||||||
|
CBitmap m_oCrossBitmap;
|
||||||
|
CBitmap m_oEmptyBoxBitmap;
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CPanelLevels)
|
||||||
|
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||||
|
afx_msg void OnSelectAllLevels();
|
||||||
|
afx_msg void OnClearAllLevels();
|
||||||
|
afx_msg void OnBinarize();
|
||||||
|
afx_msg void OnCHECKAutoTest();
|
||||||
|
afx_msg void OnTestMaps();
|
||||||
|
afx_msg void OnBUTTONRefreshLevelList();
|
||||||
|
afx_msg void OnCHECKStopOnError();
|
||||||
|
afx_msg void OnBUTTONEditGameDsc();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
|
||||||
|
BOOL m_fn_bOnLButtonDownListBoxLevels( MSG *pMsg );
|
||||||
|
BOOL m_fn_bOnKeyDownListBoxLevels( MSG *pMsg );
|
||||||
|
void m_fn_vOnDrawItemListBoxLevels( LPDRAWITEMSTRUCT lpDIS );
|
||||||
|
virtual void OnOk();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
|
||||||
|
#endif // !defined(AFX_PANELLEVELS_H__90CBA234_D209_11D2_BB49_00E029219C3C__INCLUDED_)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
#if !defined(AFX_PANELRESULTS_H__89CC65A8_D186_11D2_BB48_00E029219C3C__INCLUDED_)
|
||||||
|
#define AFX_PANELRESULTS_H__89CC65A8_D186_11D2_BB48_00E029219C3C__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
// PanelResults.h : header file
|
||||||
|
//
|
||||||
|
#include "Panel.h"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CPanelResults dialog
|
||||||
|
|
||||||
|
class CPanelResults : public CPanel
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CPanelResults(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CPanelResults)
|
||||||
|
enum { IDD = IDD_DIALOG_Results };
|
||||||
|
// NOTE: the ClassWizard will add data members here
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
virtual BOOL Create( CWnd* pParentWnd );
|
||||||
|
virtual void m_fn_vUpdateRegistry();
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CPanelResults)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CPanelResults)
|
||||||
|
// NOTE: the ClassWizard will add member functions here
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_PANELRESULTS_H__89CC65A8_D186_11D2_BB48_00E029219C3C__INCLUDED_)
|
|
@ -0,0 +1,72 @@
|
||||||
|
#if !defined(AFX_PANELSETTINGS_H__90CBA232_D209_11D2_BB49_00E029219C3C__INCLUDED_)
|
||||||
|
#define AFX_PANELSETTINGS_H__90CBA232_D209_11D2_BB49_00E029219C3C__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
// PanelSettings.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "Panel.h"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CPanelSettings dialog
|
||||||
|
|
||||||
|
class CPanelSettings : public CPanel
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CPanelSettings(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CPanelSettings)
|
||||||
|
enum { IDD = IDD_DIALOG_Settings };
|
||||||
|
CButton m_CheckAutoDetectErrors;
|
||||||
|
CEdit m_EditMainDirectory;
|
||||||
|
CEdit m_EditBinDirectory;
|
||||||
|
CEdit m_EditExeName;
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
BOOL Create( CWnd* pParentWnd );
|
||||||
|
virtual void m_fn_vUpdateRegistry();
|
||||||
|
BOOL m_fn_bCanChangePanel();
|
||||||
|
void m_fn_vOnDisplayPanel();
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CPanelSettings)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CPanelSettings)
|
||||||
|
afx_msg void OnBrowseMainDirectory();
|
||||||
|
afx_msg void OnBrowseBinaryDirectory();
|
||||||
|
afx_msg void OnBrowseExeName();
|
||||||
|
afx_msg void OnChangeMainDirectory();
|
||||||
|
afx_msg void OnChangeBinaryDirectory();
|
||||||
|
afx_msg void OnChangeExeName();
|
||||||
|
afx_msg void OnRADIODebugOrRelease();
|
||||||
|
afx_msg void OnDropFiles(HDROP hDropInfo);
|
||||||
|
afx_msg void OnCHECKAutoDetectErrors();
|
||||||
|
afx_msg void OnBUTTONMakeVersion();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
|
||||||
|
BOOL m_fn_bValidateMainDirectorySetting();
|
||||||
|
BOOL m_fn_bValidateBinDirectorySetting();
|
||||||
|
BOOL m_fn_bValidateGameExeSetting();
|
||||||
|
|
||||||
|
BOOL m_bMainDirectoryIsValid;
|
||||||
|
BOOL m_bBinDirectoryIsValid;
|
||||||
|
BOOL m_bGameExeIsValid;
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_PANELSETTINGS_H__90CBA232_D209_11D2_BB49_00E029219C3C__INCLUDED_)
|
|
@ -0,0 +1,23 @@
|
||||||
|
|
||||||
|
#ifndef _PROCESS_H_
|
||||||
|
#define _PROCESS_H_
|
||||||
|
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
// Launch a new process using CreateProcess and return immediatly
|
||||||
|
// return TRUE if process was created normally or FALSE if not.
|
||||||
|
// Also fill _p_Info with process informations (handle...)
|
||||||
|
// Display a dialog box to the user in case of error on CreateProcess.
|
||||||
|
BOOL fn_bSpawnProcess( char *_szExeName, char *_szCommandLine, LPPROCESS_INFORMATION _p_Info );
|
||||||
|
void fn_vCloseProcessHandles( LPPROCESS_INFORMATION _p_stProcess );
|
||||||
|
BOOL fn_bCloseSytemErrorDialogBox( char *_szExeName, BOOL bForceClose = FALSE );
|
||||||
|
|
||||||
|
tdeStatus fn_eWaitForMultipleProcesses( int _iNbProcesses, LPPROCESS_INFORMATION _pa_stInfo, LPCTSTR _szExeNames[], int *_p_iProcessesEnded );
|
||||||
|
tdeStatus fn_eSpawnAndWaitForProcess( char *_szExeName, char *_szCommandLine, HANDLE _hEventStop = INVALID_HANDLE_VALUE );
|
||||||
|
tdeStatus fn_eSpawnAndWaitForProcessWithInputEvents( char *_szExeName, char *_szCommandLine );
|
||||||
|
tdeStatus fn_eSpawnAndWaitForProcessWithTimeout( char *_szExeName, char *_szCommandLine, DWORD dwMilliseconds = INFINITE );
|
||||||
|
|
||||||
|
tdeStatus fn_eSpawnThreadAndWaitWithInputEvents( AFX_THREADPROC _p_fn_uiThread, LPVOID _p_vParamForThread );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
|
||||||
|
#ifndef _SCRIPTS_H_
|
||||||
|
#define _SCRIPTS_H_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
|
||||||
|
// Init acp modules for script parsing.
|
||||||
|
void fn_vInitScr();
|
||||||
|
void fn_vDesinitScr();
|
||||||
|
|
||||||
|
BOOL fn_bReadGameDsc();
|
||||||
|
|
||||||
|
#endif // _SCRIPTS_H_
|
|
@ -0,0 +1,27 @@
|
||||||
|
// stdafx.h : include file for standard system include files,
|
||||||
|
// or project specific include files that are used frequently, but
|
||||||
|
// are changed infrequently
|
||||||
|
//
|
||||||
|
|
||||||
|
#if !defined(AFX_STDAFX_H__6B8ECEB2_CC90_11D2_BB42_00E029219C3C__INCLUDED_)
|
||||||
|
#define AFX_STDAFX_H__6B8ECEB2_CC90_11D2_BB42_00E029219C3C__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
|
||||||
|
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||||
|
|
||||||
|
#include <afxwin.h> // MFC core and standard components
|
||||||
|
#include <afxext.h> // MFC extensions
|
||||||
|
#include <Afxdisp.h>
|
||||||
|
#include <afxmt.h>
|
||||||
|
#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__6B8ECEB2_CC90_11D2_BB42_00E029219C3C__INCLUDED_)
|
|
@ -0,0 +1,9 @@
|
||||||
|
#ifndef _TASKS_H_
|
||||||
|
#define _TASKS_H_
|
||||||
|
|
||||||
|
tdeStatus fn_e_TASK_Binarize( CByteArray &a_cSelectedLevels );
|
||||||
|
tdeStatus fn_e_TASK_TestBinarizedMaps( CByteArray &a_cBinarizedLevels );
|
||||||
|
tdeStatus fn_e_TASK_Version();
|
||||||
|
|
||||||
|
|
||||||
|
#endif // _TASKS_H_
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
#ifndef _THREAD_H_
|
||||||
|
#define _THREAD_H_
|
||||||
|
|
||||||
|
UINT fn_uiThreadBinarize( LPVOID _p_stParam );
|
||||||
|
UINT fn_uiThreadMakeGFTextures( LPVOID _p_vParam );
|
||||||
|
UINT fn_uiThreadMakeBigFileTextures( LPVOID _p_vParam );
|
||||||
|
UINT fn_uiThreadAnims( LPVOID _p_vParam );
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,53 @@
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _FILE_H_
|
||||||
|
#define _FILE_H_
|
||||||
|
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
tdeStatus fn_eCreateDirectory( const char *_szDirectory );
|
||||||
|
|
||||||
|
// Copy a file or a directory (no '\' at end of directory name !)
|
||||||
|
// Source may contain wilcards. Dest must be a path to a directory !
|
||||||
|
// If source is a directory, the copy is recursive.
|
||||||
|
tdeStatus fn_eCopyFileOrDirectory( const char *_szSource, const char *_szDest );
|
||||||
|
|
||||||
|
// Copy some files to a directory. Function will also search for files in sub-dirs of source.
|
||||||
|
// Source may contain wilcards. Dest must be a path to a directory !
|
||||||
|
tdeStatus fn_eRecursiveFileCopy( const char *_szSource, const char *_szDest );
|
||||||
|
|
||||||
|
|
||||||
|
// Moves file(s) or a directory (no '\' at end of directory name !)
|
||||||
|
// Source may contain wilcards. Dest must be a path to a directory !
|
||||||
|
tdeStatus fn_eMoveFileOrDirectory( const char *_szSource, const char *_szDest );
|
||||||
|
|
||||||
|
// Deletes file(s) or directory (no '\' at end of directory name !)
|
||||||
|
// Source may contain wilcards.
|
||||||
|
// If source is a directory, the delete is recursive.
|
||||||
|
tdeStatus fn_eDeleteFileOrDirectory( const char *_szSource );
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct tdstCopyFileContext_
|
||||||
|
{
|
||||||
|
CString csMainDirectory;
|
||||||
|
CString csBinDirectory;
|
||||||
|
CString csLevelName;
|
||||||
|
} tdstCopyFileContext;
|
||||||
|
|
||||||
|
// Execute copy/move/deletes/rename commands in given array
|
||||||
|
// See file.cpp for exemples.
|
||||||
|
// stContext contains strings used when replacing %bin%, %level%....
|
||||||
|
tdeStatus fn_eTreatArrayOfFiles( char *_a_szFileCommands[], tdstCopyFileContext *_p_stContext );
|
||||||
|
|
||||||
|
// The arrays for fn_bTreatArrayOfFiles
|
||||||
|
extern char *g_a_szCommonFiles[];
|
||||||
|
extern char *g_a_szFilesAfterFirstPass[];
|
||||||
|
extern char *g_a_szFilesAfterSecondPass[];
|
||||||
|
extern char *g_a_szFixFilesAfterCRB[];
|
||||||
|
extern char *g_a_szDeleteFixFilesAfterCRB[];
|
||||||
|
extern char *g_a_szLevelFilesAfterCRB[];
|
||||||
|
extern char *g_a_szFilesBeforeBinarize[];
|
||||||
|
extern char *g_a_szDeleteFilesAfterBinarize[];
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,53 @@
|
||||||
|
#if !defined(AFX_PANELAFTER_H__8AA7F79E_F23D_11D2_BB70_00E029219C3C__INCLUDED_)
|
||||||
|
#define AFX_PANELAFTER_H__8AA7F79E_F23D_11D2_BB70_00E029219C3C__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER >= 1000
|
||||||
|
// panelafter.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "Panel.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CPanelAfter dialog
|
||||||
|
|
||||||
|
class CPanelAfter : public CPanel
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CPanelAfter(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
virtual BOOL Create( CWnd* pParentWnd );
|
||||||
|
virtual void m_fn_vUpdateRegistry();
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CPanelAfter)
|
||||||
|
enum { IDD = IDD_DIALOG_AfterBinarization };
|
||||||
|
CEdit m_EditSizeOfBigFile;
|
||||||
|
CButton m_CheckDeleteRelocTables;
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CPanelAfter)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CPanelAfter)
|
||||||
|
afx_msg void OnBUTTONGenerateBigFile();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_PANELAFTER_H__8AA7F79E_F23D_11D2_BB70_00E029219C3C__INCLUDED_)
|
|
@ -0,0 +1,55 @@
|
||||||
|
|
||||||
|
#ifndef _UTIL_H_
|
||||||
|
#define _UTIL_H_
|
||||||
|
|
||||||
|
typedef enum tdeStatus_
|
||||||
|
{
|
||||||
|
STATUS_C_OK,
|
||||||
|
STATUS_C_Error,
|
||||||
|
STATUS_C_UserBreak
|
||||||
|
} tdeStatus;
|
||||||
|
|
||||||
|
|
||||||
|
// Ask the user to choose a directory and return the selected directory.
|
||||||
|
// Return an empty string if no dir selected.
|
||||||
|
// Parameter is the string that will be displayed in dlg box (ie: "Choose directory" )
|
||||||
|
CString fn_csBrowseDirectory( LPCTSTR _p_szTitle, LPCTSTR _p_szDefaultDir = NULL );
|
||||||
|
|
||||||
|
// Add a line of text in the CEdit control used for displaying results.
|
||||||
|
// Line must be terminated by "\r\n" for carriage return.
|
||||||
|
void fn_vOutputLine( const TCHAR *_p_szLine );
|
||||||
|
|
||||||
|
// Read version.ini file and update GlobalData
|
||||||
|
BOOL fn_bReadVersionFile();
|
||||||
|
|
||||||
|
// Read SoundVersion.ini file and update GlobalData
|
||||||
|
BOOL fn_bReadSoundVersionFile();
|
||||||
|
|
||||||
|
// Copy sound directories into bin directory
|
||||||
|
UINT fn_uiThreadCopySoundDirectory( LPVOID _p_stParam );
|
||||||
|
|
||||||
|
// Update the file startprg.ini
|
||||||
|
void fn_vUpdateStartPrg();
|
||||||
|
|
||||||
|
// Update the file startprg.ini
|
||||||
|
void fn_vUpdateStartPrg_old();
|
||||||
|
|
||||||
|
// Disable use of bigfile for relocation tables (in startprg.ini)
|
||||||
|
void fn_vDisableRelocTableBigFile();
|
||||||
|
|
||||||
|
|
||||||
|
// Find a substring in szString1.
|
||||||
|
// Comparaison is case INSENSITIVE.
|
||||||
|
const char *stristr( const char *szString, const char *szSubString );
|
||||||
|
|
||||||
|
BOOL fn_bCheckFileExistanceInStartupDir( CString csFileName );
|
||||||
|
BOOL fn_bValidateMainDirectorySetting();
|
||||||
|
BOOL fn_bValidateBinDirectorySetting();
|
||||||
|
BOOL fn_bValidateGameExeSetting();
|
||||||
|
|
||||||
|
void fn_vMakeSndParserCommandLine( char *szCommandLine );
|
||||||
|
void fn_vGetShortExeName( char *_szShortExeName, char *_szLongExeName );
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
SCC = This is a Source Code Control file
|
||||||
|
|
||||||
|
[BinaryTool.dsp]
|
||||||
|
SCC_Aux_Path = "\\srvprojets-ma\Rayman4_DS\Versions\Rayman4DS\Tools"
|
||||||
|
SCC_Project_Name = "$/CPA/Appli/BinaryTool2", ADAAAAAA
|
||||||
|
|
||||||
|
[BinaryTool.mak]
|
||||||
|
SCC_Aux_Path = "\\srvprojets-ma\Rayman4_DS\Versions\Rayman4DS\Tools"
|
||||||
|
SCC_Project_Name = "$/CPA/Appli/BinaryTool2", ADAAAAAA
|
|
@ -0,0 +1,194 @@
|
||||||
|
; CLW file contains information for the MFC ClassWizard
|
||||||
|
|
||||||
|
[General Info]
|
||||||
|
Version=1
|
||||||
|
LastClass=CPanelSettings
|
||||||
|
LastTemplate=CDialog
|
||||||
|
NewFileInclude1=#include "stdafx.h"
|
||||||
|
NewFileInclude2=#include "binarytool.h"
|
||||||
|
LastPage=0
|
||||||
|
|
||||||
|
ClassCount=8
|
||||||
|
Class1=CBinaryToolApp
|
||||||
|
Class2=CBinaryToolDlg
|
||||||
|
Class3=CPanel
|
||||||
|
Class4=CPanelBeforeBin
|
||||||
|
Class5=CPanelLevels
|
||||||
|
Class6=CPanelResults
|
||||||
|
Class7=CPanelSettings
|
||||||
|
Class8=CAboutDlg
|
||||||
|
|
||||||
|
ResourceCount=7
|
||||||
|
Resource1=IDD_ABOUTBOX (Neutral (Default))
|
||||||
|
Resource2=IDD_DIALOG_Results
|
||||||
|
Resource3=IDD_DIALOG_BeforeBinarization
|
||||||
|
Resource4=IDD_BINARYTOOL_DIALOG (Neutral (Default))
|
||||||
|
Resource5=IDD_DIALOG_Levels
|
||||||
|
Resource6=IDD_DIALOG_AfterBinarization
|
||||||
|
Resource7=IDD_DIALOG_Settings
|
||||||
|
|
||||||
|
[CLS:CBinaryToolApp]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CWinApp
|
||||||
|
HeaderFile=\cpa\Appli\BinaryTool2\inc\BinaryTool.h
|
||||||
|
ImplementationFile=\cpa\Appli\BinaryTool2\src\BinaryTool.cpp
|
||||||
|
LastObject=CBinaryToolApp
|
||||||
|
Filter=N
|
||||||
|
VirtualFilter=AC
|
||||||
|
|
||||||
|
[CLS:CBinaryToolDlg]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=\cpa\Appli\BinaryTool2\inc\BinaryToolDlg.h
|
||||||
|
ImplementationFile=\cpa\Appli\BinaryTool2\src\BinaryToolDlg.cpp
|
||||||
|
LastObject=CBinaryToolDlg
|
||||||
|
|
||||||
|
[CLS:CPanel]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=\cpa\Appli\BinaryTool2\inc\Panel.h
|
||||||
|
ImplementationFile=\cpa\Appli\BinaryTool2\src\Panel.cpp
|
||||||
|
LastObject=CPanel
|
||||||
|
|
||||||
|
[CLS:CPanelBeforeBin]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=\cpa\Appli\BinaryTool2\inc\PanelBeforeBin.h
|
||||||
|
ImplementationFile=\cpa\Appli\BinaryTool2\src\PanelBeforeBin.cpp
|
||||||
|
Filter=D
|
||||||
|
VirtualFilter=dWC
|
||||||
|
LastObject=CPanelBeforeBin
|
||||||
|
|
||||||
|
[CLS:CPanelLevels]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=\cpa\Appli\BinaryTool2\inc\PanelLevels.h
|
||||||
|
ImplementationFile=\cpa\Appli\BinaryTool2\src\PanelLevels.cpp
|
||||||
|
LastObject=CPanelLevels
|
||||||
|
Filter=D
|
||||||
|
VirtualFilter=dWC
|
||||||
|
|
||||||
|
[CLS:CPanelResults]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=\cpa\Appli\BinaryTool2\inc\PanelResults.h
|
||||||
|
ImplementationFile=\cpa\Appli\BinaryTool2\src\PanelResults.cpp
|
||||||
|
|
||||||
|
[CLS:CPanelSettings]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=\cpa\Appli\BinaryTool2\inc\PanelSettings.h
|
||||||
|
ImplementationFile=\cpa\Appli\BinaryTool2\src\PanelSettings.cpp
|
||||||
|
LastObject=CPanelSettings
|
||||||
|
Filter=D
|
||||||
|
VirtualFilter=dWC
|
||||||
|
|
||||||
|
[CLS:CAboutDlg]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=\cpa\Appli\BinaryTool2\src\BinaryToolDlg.cpp
|
||||||
|
ImplementationFile=\cpa\Appli\BinaryTool2\src\BinaryToolDlg.cpp
|
||||||
|
|
||||||
|
[DLG:IDD_BINARYTOOL_DIALOG]
|
||||||
|
Type=1
|
||||||
|
Class=CBinaryToolDlg
|
||||||
|
|
||||||
|
[DLG:IDD_ABOUTBOX]
|
||||||
|
Type=1
|
||||||
|
Class=CPanel
|
||||||
|
|
||||||
|
[DLG:IDD_DIALOG_BeforeBinarization]
|
||||||
|
Type=1
|
||||||
|
Class=CPanelBeforeBin
|
||||||
|
ControlCount=15
|
||||||
|
Control1=IDC_GROUPSoundBanks,button,1342177287
|
||||||
|
Control2=IDC_BUTTON_MakeSoundBanks,button,1342242816
|
||||||
|
Control3=IDC_BUTTON_CopySound,button,1342242816
|
||||||
|
Control4=IDC_GOUPTextures,button,1342177287
|
||||||
|
Control5=IDC_STATIC,static,1342308352
|
||||||
|
Control6=IDC_EDIT_TempTextureDirectory,edit,1350631552
|
||||||
|
Control7=IDC_BUTTON_BrowseTempTextureDirectory,button,1342242816
|
||||||
|
Control8=IDC_BUTTON_MakeGF,button,1342242816
|
||||||
|
Control9=IDC_BUTTON_MakeBigFile,button,1342242816
|
||||||
|
Control10=IDC_STATIC,button,1342177287
|
||||||
|
Control11=IDC_RADIO_OptimizedAnims,button,1342308361
|
||||||
|
Control12=IDC_RADIO_NonOptimizedAnims,button,1342177289
|
||||||
|
Control13=IDC_BUTTON_MakeA3i,button,1342242816
|
||||||
|
Control14=IDC_STATIC,static,1342308353
|
||||||
|
Control15=IDC_STATIC,static,1342308352
|
||||||
|
|
||||||
|
[DLG:IDD_DIALOG_Levels]
|
||||||
|
Type=1
|
||||||
|
Class=CPanelLevels
|
||||||
|
ControlCount=13
|
||||||
|
Control1=IDC_STATIC,static,1342308352
|
||||||
|
Control2=IDC_LIST_Levels,listbox,1352730961
|
||||||
|
Control3=IDC_STATIC,button,1342177287
|
||||||
|
Control4=IDC_BUTTON_SelectAll,button,1342242816
|
||||||
|
Control5=IDC_BUTTON_ClearAll,button,1342242816
|
||||||
|
Control6=IDC_STATIC,button,1342177287
|
||||||
|
Control7=IDC_CHECK_AutoTest,button,1342242819
|
||||||
|
Control8=IDC_CHECK_StopOnError,button,1342242819
|
||||||
|
Control9=IDC_BUTTON_Binarize,button,1342242817
|
||||||
|
Control10=IDC_BUTTON_TestMaps,button,1342242816
|
||||||
|
Control11=IDC_BUTTON_Refresh,button,1342242816
|
||||||
|
Control12=IDC_BUTTON_EditGameDsc,button,1342242816
|
||||||
|
Control13=IDC_STATIC,button,1342177287
|
||||||
|
|
||||||
|
[DLG:IDD_DIALOG_Results]
|
||||||
|
Type=1
|
||||||
|
Class=CPanelResults
|
||||||
|
ControlCount=1
|
||||||
|
Control1=IDC_EDIT_Results,edit,1352734788
|
||||||
|
|
||||||
|
[DLG:IDD_DIALOG_Settings]
|
||||||
|
Type=1
|
||||||
|
Class=CPanelSettings
|
||||||
|
ControlCount=15
|
||||||
|
Control1=IDC_STATIC,button,1342177287
|
||||||
|
Control2=IDC_STATIC,static,1342177280
|
||||||
|
Control3=IDC_EDIT_MainDirectory,edit,1350631552
|
||||||
|
Control4=IDC_BUTTON_BrowseMainDirectory,button,1342242816
|
||||||
|
Control5=IDC_STATIC,static,1342177280
|
||||||
|
Control6=IDC_EDIT_BinaryDirectory,edit,1350631552
|
||||||
|
Control7=IDC_BUTTON_BrowseBinaryDirectory,button,1342242816
|
||||||
|
Control8=IDC_EDIT_ExeName,edit,1350631552
|
||||||
|
Control9=IDC_BUTTON_BrowseExeName,button,1342242816
|
||||||
|
Control10=IDC_STATIC,button,1342177287
|
||||||
|
Control11=IDC_RADIO_Debug,button,1342308361
|
||||||
|
Control12=IDC_RADIO_Release,button,1342177289
|
||||||
|
Control13=IDC_CHECK_AutoDetectErrors,button,1342242819
|
||||||
|
Control14=IDC_STATIC,button,1342177287
|
||||||
|
Control15=IDC_BUTTON_MakeVersion,button,1342242816
|
||||||
|
|
||||||
|
[DLG:IDD_ABOUTBOX (Neutral (Default))]
|
||||||
|
Type=1
|
||||||
|
Class=?
|
||||||
|
ControlCount=6
|
||||||
|
Control1=IDC_STATIC,static,1342177283
|
||||||
|
Control2=IDC_STATIC,static,1342308480
|
||||||
|
Control3=IDC_STATIC,static,1342308352
|
||||||
|
Control4=IDOK,button,1342373889
|
||||||
|
Control5=IDC_STATIC,static,1342308352
|
||||||
|
Control6=IDC_STATIC,static,1342308352
|
||||||
|
|
||||||
|
[DLG:IDD_BINARYTOOL_DIALOG (Neutral (Default))]
|
||||||
|
Type=1
|
||||||
|
Class=?
|
||||||
|
ControlCount=4
|
||||||
|
Control1=ID_BOUTON_Quit,button,1342242816
|
||||||
|
Control2=IDC_TAB_Panel,SysTabControl32,1342242816
|
||||||
|
Control3=IDC_STATIC_Version,static,1342308352
|
||||||
|
Control4=ID_BUTTON_Stop,button,1073807360
|
||||||
|
|
||||||
|
[DLG:IDD_DIALOG_AfterBinarization]
|
||||||
|
Type=1
|
||||||
|
Class=?
|
||||||
|
ControlCount=6
|
||||||
|
Control1=IDC_STATIC,button,1342177287
|
||||||
|
Control2=IDC_EDIT_SizeOfBigFile,edit,1350639744
|
||||||
|
Control3=IDC_STATIC,static,1342308352
|
||||||
|
Control4=IDC_STATIC,static,1342308352
|
||||||
|
Control5=IDC_CHECK_DeleteRelocTables,button,1342242851
|
||||||
|
Control6=IDC_BUTTON_GenerateBigFile,button,1342242816
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 766 B |
|
@ -0,0 +1,414 @@
|
||||||
|
//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
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Neutral (Default) resources
|
||||||
|
|
||||||
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD)
|
||||||
|
#ifdef _WIN32
|
||||||
|
LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT
|
||||||
|
#pragma code_page(1252)
|
||||||
|
#endif //_WIN32
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Dialog
|
||||||
|
//
|
||||||
|
|
||||||
|
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 217, 87
|
||||||
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
|
CAPTION "About BinaryTool"
|
||||||
|
FONT 8, "MS Sans Serif"
|
||||||
|
BEGIN
|
||||||
|
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
|
||||||
|
LTEXT "BinaryTool Version 2.40",IDC_STATIC,40,10,119,8,
|
||||||
|
SS_NOPREFIX
|
||||||
|
LTEXT "Copyright (C)Ubi Simulation 1999",IDC_STATIC,40,25,119,
|
||||||
|
8
|
||||||
|
DEFPUSHBUTTON "OK",IDOK,178,7,32,14,WS_GROUP
|
||||||
|
LTEXT "E-mail: gsouchet@ubisoft.fr",IDC_STATIC,40,62,87,8
|
||||||
|
LTEXT "By Mihaela Tancu && Guillaume Souchet",IDC_STATIC,40,38,
|
||||||
|
126,8
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_BINARYTOOL_DIALOG DIALOGEX 0, 0, 314, 290
|
||||||
|
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||||
|
WS_SYSMENU
|
||||||
|
EXSTYLE WS_EX_ACCEPTFILES | WS_EX_CONTROLPARENT | WS_EX_APPWINDOW
|
||||||
|
CAPTION "Binary Converting Tool"
|
||||||
|
FONT 8, "MS Sans Serif"
|
||||||
|
BEGIN
|
||||||
|
PUSHBUTTON "Quit",ID_BOUTON_Quit,239,269,50,14
|
||||||
|
CONTROL "Tab1",IDC_TAB_Panel,"SysTabControl32",WS_TABSTOP,7,7,
|
||||||
|
300,254,WS_EX_ACCEPTFILES
|
||||||
|
LTEXT "BinaryTool v2.40",IDC_STATIC_Version,72,272,60,8
|
||||||
|
PUSHBUTTON "Stop !",ID_BUTTON_Stop,163,269,50,14,NOT WS_VISIBLE
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// DESIGNINFO
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
GUIDELINES DESIGNINFO DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
IDD_ABOUTBOX, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 7
|
||||||
|
RIGHTMARGIN, 210
|
||||||
|
TOPMARGIN, 7
|
||||||
|
BOTTOMMARGIN, 80
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_BINARYTOOL_DIALOG, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 7
|
||||||
|
RIGHTMARGIN, 307
|
||||||
|
TOPMARGIN, 7
|
||||||
|
BOTTOMMARGIN, 283
|
||||||
|
END
|
||||||
|
END
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Bitmap
|
||||||
|
//
|
||||||
|
|
||||||
|
IDB_BITMAP_VIDE BITMAP DISCARDABLE "case_vide.bmp"
|
||||||
|
IDB_BITMAP_CHECK BITMAP DISCARDABLE "case_checked.bmp"
|
||||||
|
#endif // Neutral (Default) resources
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// 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
|
||||||
|
|
||||||
|
#ifndef _MAC
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Version
|
||||||
|
//
|
||||||
|
|
||||||
|
VS_VERSION_INFO VERSIONINFO
|
||||||
|
FILEVERSION 1,0,0,1
|
||||||
|
PRODUCTVERSION 2,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", "BinaryTool MFC Application\0"
|
||||||
|
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||||
|
VALUE "InternalName", "BinaryTool\0"
|
||||||
|
VALUE "LegalCopyright", "Copyright (C) 1999\0"
|
||||||
|
VALUE "OriginalFilename", "BinaryTool.EXE\0"
|
||||||
|
VALUE "ProductName", "BinaryTool Application\0"
|
||||||
|
VALUE "ProductVersion", "2, 0, 0, 1\0"
|
||||||
|
END
|
||||||
|
END
|
||||||
|
BLOCK "VarFileInfo"
|
||||||
|
BEGIN
|
||||||
|
VALUE "Translation", 0x409, 1200
|
||||||
|
END
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // !_MAC
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// String Table
|
||||||
|
//
|
||||||
|
|
||||||
|
STRINGTABLE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
IDS_ABOUTBOX "&About BinaryTool..."
|
||||||
|
IDS_Registry "Ubi Simulation"
|
||||||
|
IDS_AppTitle "Binary Converting Tool"
|
||||||
|
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_BeforeBinarization DIALOGEX 0, 0, 300, 236
|
||||||
|
STYLE WS_CHILD
|
||||||
|
EXSTYLE WS_EX_CONTROLPARENT
|
||||||
|
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||||
|
BEGIN
|
||||||
|
GROUPBOX "Sound Banks",IDC_GROUPSoundBanks,22,11,262,41
|
||||||
|
PUSHBUTTON "Make sound banks",IDC_BUTTON_MakeSoundBanks,36,28,85,14
|
||||||
|
PUSHBUTTON "Copy sound directory",IDC_BUTTON_CopySound,160,28,85,14
|
||||||
|
GROUPBOX "Textures",IDC_GOUPTextures,22,68,260,72
|
||||||
|
LTEXT "Temporary directory for bigfile",IDC_STATIC,35,84,93,8
|
||||||
|
EDITTEXT IDC_EDIT_TempTextureDirectory,35,95,155,14,
|
||||||
|
ES_AUTOHSCROLL
|
||||||
|
PUSHBUTTON "Browse...",IDC_BUTTON_BrowseTempTextureDirectory,197,95,
|
||||||
|
50,14
|
||||||
|
PUSHBUTTON "Make GF textures",IDC_BUTTON_MakeGF,52,119,74,14
|
||||||
|
PUSHBUTTON "Make bigfile",IDC_BUTTON_MakeBigFile,154,119,74,14
|
||||||
|
GROUPBOX "Animations (optional)",IDC_STATIC,22,155,260,46
|
||||||
|
CONTROL "Optimized",IDC_RADIO_OptimizedAnims,"Button",
|
||||||
|
BS_AUTORADIOBUTTON | WS_GROUP,40,168,62,10
|
||||||
|
CONTROL "Non Optimized",IDC_RADIO_NonOptimizedAnims,"Button",
|
||||||
|
BS_AUTORADIOBUTTON,40,182,62,10
|
||||||
|
PUSHBUTTON "Make all a3i",IDC_BUTTON_MakeA3i,154,172,74,14
|
||||||
|
CTEXT "Or",IDC_STATIC,135,122,8,8
|
||||||
|
LTEXT "then",IDC_STATIC,133,31,15,8
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_DIALOG_Results DIALOGEX 0, 0, 300, 242
|
||||||
|
STYLE WS_CHILD
|
||||||
|
EXSTYLE WS_EX_CONTROLPARENT
|
||||||
|
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||||
|
BEGIN
|
||||||
|
EDITTEXT IDC_EDIT_Results,7,7,286,228,ES_MULTILINE |
|
||||||
|
ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN |
|
||||||
|
WS_VSCROLL
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_DIALOG_Settings DIALOGEX 0, 0, 300, 239
|
||||||
|
STYLE WS_CHILD
|
||||||
|
EXSTYLE WS_EX_ACCEPTFILES | WS_EX_CONTROLPARENT
|
||||||
|
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||||
|
BEGIN
|
||||||
|
GROUPBOX "Locations",IDC_STATIC,17,14,269,145
|
||||||
|
LTEXT "Main directory",IDC_STATIC,31,33,45,8,NOT WS_GROUP
|
||||||
|
EDITTEXT IDC_EDIT_MainDirectory,34,47,174,14,ES_AUTOHSCROLL,
|
||||||
|
WS_EX_ACCEPTFILES
|
||||||
|
PUSHBUTTON "Browse...",IDC_BUTTON_BrowseMainDirectory,215,47,50,14
|
||||||
|
LTEXT "Directory of binary data",IDC_STATIC,31,72,74,8,NOT
|
||||||
|
WS_GROUP
|
||||||
|
EDITTEXT IDC_EDIT_BinaryDirectory,34,84,174,14,ES_AUTOHSCROLL,
|
||||||
|
WS_EX_ACCEPTFILES
|
||||||
|
PUSHBUTTON "Browse...",IDC_BUTTON_BrowseBinaryDirectory,215,84,50,
|
||||||
|
14
|
||||||
|
EDITTEXT IDC_EDIT_ExeName,93,119,115,14,ES_AUTOHSCROLL,
|
||||||
|
WS_EX_ACCEPTFILES
|
||||||
|
PUSHBUTTON "Browse...",IDC_BUTTON_BrowseExeName,215,118,50,14
|
||||||
|
GROUPBOX "Engine",IDC_STATIC,28,106,246,44
|
||||||
|
CONTROL "Debug",IDC_RADIO_Debug,"Button",BS_AUTORADIOBUTTON |
|
||||||
|
WS_GROUP,35,118,49,12
|
||||||
|
CONTROL "Release",IDC_RADIO_Release,"Button",BS_AUTORADIOBUTTON,
|
||||||
|
35,132,49,12
|
||||||
|
CONTROL "Autodetect errors when executing others programs",
|
||||||
|
IDC_CHECK_AutoDetectErrors,"Button",BS_AUTOCHECKBOX |
|
||||||
|
WS_TABSTOP,35,177,174,10
|
||||||
|
GROUPBOX "General options",IDC_STATIC,17,162,269,36
|
||||||
|
PUSHBUTTON "Make Version",IDC_BUTTON_MakeVersion,124,206,50,14
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_DIALOG_Levels DIALOGEX 0, 0, 300, 239
|
||||||
|
STYLE WS_CHILD
|
||||||
|
EXSTYLE WS_EX_CONTROLPARENT
|
||||||
|
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||||
|
BEGIN
|
||||||
|
LTEXT "List of levels in game.dsc",IDC_STATIC,14,15,80,8
|
||||||
|
LISTBOX IDC_LIST_Levels,17,24,141,196,LBS_OWNERDRAWFIXED |
|
||||||
|
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL |
|
||||||
|
WS_VSCROLL | WS_TABSTOP
|
||||||
|
GROUPBOX "Level selection",IDC_STATIC,166,11,121,56
|
||||||
|
PUSHBUTTON "Select all",IDC_BUTTON_SelectAll,194,25,66,14
|
||||||
|
PUSHBUTTON "Clear all",IDC_BUTTON_ClearAll,194,47,66,14
|
||||||
|
GROUPBOX "Options",IDC_STATIC,165,130,121,45
|
||||||
|
CONTROL "Auto test map(s) after binarize",IDC_CHECK_AutoTest,
|
||||||
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,142,109,10
|
||||||
|
CONTROL "Stop binarize on error",IDC_CHECK_StopOnError,"Button",
|
||||||
|
BS_AUTOCHECKBOX | WS_TABSTOP,173,157,83,10
|
||||||
|
DEFPUSHBUTTON "Binarize !",IDC_BUTTON_Binarize,193,180,66,14
|
||||||
|
PUSHBUTTON "Test maps",IDC_BUTTON_TestMaps,193,206,66,14
|
||||||
|
PUSHBUTTON "Refresh level list",IDC_BUTTON_Refresh,194,108,66,14
|
||||||
|
PUSHBUTTON "Edit Game.dsc",IDC_BUTTON_EditGameDsc,194,86,66,14
|
||||||
|
GROUPBOX "Game.dsc",IDC_STATIC,167,73,119,54
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_DIALOG_AfterBinarization DIALOGEX 0, 0, 300, 236
|
||||||
|
STYLE WS_CHILD
|
||||||
|
EXSTYLE WS_EX_CONTROLPARENT
|
||||||
|
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||||
|
BEGIN
|
||||||
|
GROUPBOX "BigFile for relocation tables",IDC_STATIC,18,20,262,66
|
||||||
|
EDITTEXT IDC_EDIT_SizeOfBigFile,130,31,40,14,ES_AUTOHSCROLL |
|
||||||
|
ES_NUMBER
|
||||||
|
LTEXT "Size of bigfile",IDC_STATIC,49,35,42,8
|
||||||
|
LTEXT "Mo",IDC_STATIC,174,34,11,8
|
||||||
|
CONTROL "Delete relocation tables",IDC_CHECK_DeleteRelocTables,
|
||||||
|
"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,49,
|
||||||
|
50,90,10
|
||||||
|
PUSHBUTTON "Generate BigFile",IDC_BUTTON_GenerateBigFile,198,65,64,
|
||||||
|
14
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// DESIGNINFO
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
GUIDELINES DESIGNINFO DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
IDD_DIALOG_BeforeBinarization, DIALOG
|
||||||
|
BEGIN
|
||||||
|
RIGHTMARGIN, 291
|
||||||
|
BOTTOMMARGIN, 226
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_DIALOG_Results, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 7
|
||||||
|
RIGHTMARGIN, 293
|
||||||
|
TOPMARGIN, 7
|
||||||
|
BOTTOMMARGIN, 235
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_DIALOG_Settings, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 7
|
||||||
|
RIGHTMARGIN, 293
|
||||||
|
TOPMARGIN, 7
|
||||||
|
BOTTOMMARGIN, 232
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_DIALOG_Levels, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 7
|
||||||
|
RIGHTMARGIN, 293
|
||||||
|
TOPMARGIN, 7
|
||||||
|
BOTTOMMARGIN, 232
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_DIALOG_AfterBinarization, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 7
|
||||||
|
RIGHTMARGIN, 293
|
||||||
|
TOPMARGIN, 7
|
||||||
|
BOTTOMMARGIN, 229
|
||||||
|
END
|
||||||
|
END
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Bitmap
|
||||||
|
//
|
||||||
|
|
||||||
|
IDB_BITMAP_CROIX BITMAP DISCARDABLE "croix.bmp"
|
||||||
|
|
||||||
|
#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 ""BinaryTool.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 "BinaryTool.ico"
|
||||||
|
#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 "BinaryTool.rc2" // non-Microsoft Visual C++ edited resources
|
||||||
|
#include "afxres.rc" // Standard components
|
||||||
|
#endif
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
//
|
||||||
|
// BINARY TOOL.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...
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
|
@ -0,0 +1,71 @@
|
||||||
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// Microsoft Developer Studio generated include file.
|
||||||
|
// Used by BinaryTool.rc
|
||||||
|
//
|
||||||
|
#define IDM_ABOUTBOX 0x0010
|
||||||
|
#define IDD_ABOUTBOX 100
|
||||||
|
#define IDS_ABOUTBOX 101
|
||||||
|
#define IDD_BINARYTOOL_DIALOG 102
|
||||||
|
#define IDS_Registry 102
|
||||||
|
#define IDS_AppTitle 104
|
||||||
|
#define IDR_MAINFRAME 128
|
||||||
|
#define IDD_DIALOG_BeforeBinarization 129
|
||||||
|
#define IDD_DIALOG_Results 130
|
||||||
|
#define IDD_DIALOG_Settings 131
|
||||||
|
#define IDD_DIALOG_Levels 132
|
||||||
|
#define IDB_BITMAP_VIDE 135
|
||||||
|
#define IDB_BITMAP_CROIX 136
|
||||||
|
#define IDB_BITMAP_CHECK 138
|
||||||
|
#define IDB_BITMAP_TRUC 139
|
||||||
|
#define IDD_DIALOG_AfterBinarization 142
|
||||||
|
#define IDC_TAB_Panel 1000
|
||||||
|
#define IDC_GROUPSoundBanks 1001
|
||||||
|
#define IDC_BUTTON_MakeSoundBanks 1002
|
||||||
|
#define IDC_GOUPTextures 1003
|
||||||
|
#define IDC_EDIT_TempTextureDirectory 1005
|
||||||
|
#define IDC_BUTTON_BrowseTempTextureDirectory 1007
|
||||||
|
#define IDC_BUTTON_MakeGF 1008
|
||||||
|
#define IDC_BUTTON_MakeBigFile 1009
|
||||||
|
#define IDC_RADIO_OptimizedAnims 1010
|
||||||
|
#define IDC_RADIO_NonOptimizedAnims 1011
|
||||||
|
#define IDC_BUTTON_MakeA3i 1012
|
||||||
|
#define IDC_STATIC_TabZone 1013
|
||||||
|
#define IDC_STATIC_Version 1019
|
||||||
|
#define IDC_EDIT_Results 1020
|
||||||
|
#define IDC_BUTTON_CopySound 1021
|
||||||
|
#define IDC_EDIT_MainDirectory 1022
|
||||||
|
#define IDC_EDIT_BinaryDirectory 1023
|
||||||
|
#define IDC_EDIT_ExeName 1024
|
||||||
|
#define IDC_BUTTON_BrowseMainDirectory 1025
|
||||||
|
#define ID_BOUTON_Quit 1026
|
||||||
|
#define IDC_BUTTON_BrowseBinaryDirectory 1027
|
||||||
|
#define IDC_BUTTON_BrowseExeName 1028
|
||||||
|
#define IDC_LIST_Levels 1028
|
||||||
|
#define IDC_BUTTON_SelectAll 1029
|
||||||
|
#define IDC_BUTTON_AutoIni 1030
|
||||||
|
#define IDC_BUTTON_Binarize 1031
|
||||||
|
#define IDC_BUTTON_ClearAll 1032
|
||||||
|
#define IDC_CHECK_AutoTest 1033
|
||||||
|
#define IDC_CHECK_StopOnError 1034
|
||||||
|
#define ID_BUTTON_Stop 1035
|
||||||
|
#define IDC_RADIO_Debug 1037
|
||||||
|
#define IDC_RADIO_Release 1038
|
||||||
|
#define IDC_BUTTON_TestMaps 1039
|
||||||
|
#define IDC_CHECK_AutoDetectErrors 1040
|
||||||
|
#define IDC_BUTTON_Refresh 1041
|
||||||
|
#define IDC_EDIT_SizeOfBigFile 1043
|
||||||
|
#define IDC_CHECK_DeleteRelocTables 1044
|
||||||
|
#define IDC_BUTTON_GenerateBigFile 1045
|
||||||
|
#define IDC_BUTTON_MakeVersion 1046
|
||||||
|
#define IDC_BUTTON_EditGameDsc 1047
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 143
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1048
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
#endif
|
||||||
|
#endif
|
|
@ -0,0 +1,103 @@
|
||||||
|
// BinaryTool.cpp : Defines the class behaviors for the application.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "BinaryTool.h"
|
||||||
|
#include "BinaryToolDlg.h"
|
||||||
|
#include "GlobalData.h"
|
||||||
|
#include "Scripts.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBinaryToolApp
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CBinaryToolApp, CWinApp)
|
||||||
|
//{{AFX_MSG_MAP(CBinaryToolApp)
|
||||||
|
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||||
|
// DO NOT EDIT what you see in these blocks of generated code!
|
||||||
|
//}}AFX_MSG
|
||||||
|
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBinaryToolApp construction
|
||||||
|
|
||||||
|
CBinaryToolApp::CBinaryToolApp()
|
||||||
|
{
|
||||||
|
// TODO: add construction code here,
|
||||||
|
// Place all significant initialization in InitInstance
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// The one and only CBinaryToolApp object
|
||||||
|
|
||||||
|
CBinaryToolApp theApp;
|
||||||
|
|
||||||
|
struct tdstGlobalData_ g_stTheGlobalData;
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CBinaryToolApp initialization
|
||||||
|
|
||||||
|
BOOL CBinaryToolApp::InitInstance()
|
||||||
|
{
|
||||||
|
AfxEnableControlContainer();
|
||||||
|
|
||||||
|
// Standard initialization
|
||||||
|
// If you are not using these features and wish to reduce the size
|
||||||
|
// of your final executable, you should remove from the following
|
||||||
|
// the specific initialization routines you do not need.
|
||||||
|
|
||||||
|
#ifdef _AFXDLL
|
||||||
|
Enable3dControls(); // Call this when using MFC in a shared DLL
|
||||||
|
#else
|
||||||
|
Enable3dControlsStatic(); // Call this when linking to MFC statically
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Set up base registry key
|
||||||
|
CString csReg;
|
||||||
|
csReg.LoadString( IDS_Registry );
|
||||||
|
SetRegistryKey( csReg );
|
||||||
|
|
||||||
|
g_stTheGlobalData.hEventStop = CreateEvent( NULL, TRUE, FALSE, NULL );
|
||||||
|
g_stTheGlobalData.bCommonFilesAreCopied = FALSE;
|
||||||
|
|
||||||
|
// Setup initial directory
|
||||||
|
GetCurrentDirectory( _MAX_PATH, g_stTheGlobalData.csStartupDirectory.GetBuffer(_MAX_PATH) );
|
||||||
|
g_stTheGlobalData.csStartupDirectory.ReleaseBuffer();
|
||||||
|
|
||||||
|
// If event can't be created, display an error and exit
|
||||||
|
if( g_stTheGlobalData.hEventStop == NULL )
|
||||||
|
{
|
||||||
|
AfxMessageBox( "Can't create event ressource.\nInitialisation failed !", MB_OK | MB_ICONEXCLAMATION );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Init module scr for script parsing.
|
||||||
|
fn_vInitScr();
|
||||||
|
|
||||||
|
// Display main dialog.
|
||||||
|
CBinaryToolDlg dlg;
|
||||||
|
m_pMainWnd = &dlg;
|
||||||
|
int nResponse = dlg.DoModal();
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (nResponse == IDOK)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else if (nResponse == IDCANCEL)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
fn_vDesinitScr();
|
||||||
|
|
||||||
|
// Since the dialog has been closed, return FALSE so that we exit the
|
||||||
|
// application, rather than start the application's message pump.
|
||||||
|
return FALSE;
|
||||||
|
}
|
|
@ -0,0 +1,419 @@
|
||||||
|
// BinaryToolDlg.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "BinaryTool.h"
|
||||||
|
#include "BinaryToolDlg.h"
|
||||||
|
#include "GlobalData.h"
|
||||||
|
#include "PanelBeforeBin.h"
|
||||||
|
#include "PanelResults.h"
|
||||||
|
#include "PanelSettings.h"
|
||||||
|
#include "PanelLevels.h"
|
||||||
|
#include "PanelAfter.h"
|
||||||
|
#include "scripts.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()
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CBinaryToolDlg Creation and initialisation
|
||||||
|
|
||||||
|
CBinaryToolDlg::CBinaryToolDlg(CWnd* pParent /*=NULL*/)
|
||||||
|
: CDialog(CBinaryToolDlg::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CBinaryToolDlg)
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
|
||||||
|
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
|
||||||
|
|
||||||
|
memset( m_a_pPanels, 0, sizeof(m_a_pPanels) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CBinaryToolDlg::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CBinaryToolDlg)
|
||||||
|
DDX_Control(pDX, IDC_TAB_Panel, m_TabControl);
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CBinaryToolDlg, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CBinaryToolDlg)
|
||||||
|
ON_WM_SYSCOMMAND()
|
||||||
|
ON_WM_PAINT()
|
||||||
|
ON_WM_QUERYDRAGICON()
|
||||||
|
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB_Panel, OnSelchangeTabPanel)
|
||||||
|
ON_BN_CLICKED(ID_BOUTON_Quit, OnQuit)
|
||||||
|
ON_WM_CLOSE()
|
||||||
|
ON_BN_CLICKED(ID_BUTTON_Stop, OnStopWorkInProgress)
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
BOOL CBinaryToolDlg::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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the icon for this dialog. The framework does this automatically
|
||||||
|
// when the application's main window is not a dialog
|
||||||
|
SetIcon(m_hIcon, TRUE); // Set big icon
|
||||||
|
SetIcon(m_hIcon, FALSE); // Set small icon
|
||||||
|
|
||||||
|
|
||||||
|
m_csDlgTitle.LoadString( IDS_AppTitle );
|
||||||
|
SetWindowText( m_csDlgTitle );
|
||||||
|
// Init part of GlobalData struct
|
||||||
|
g_stTheGlobalData.p_oMainDlg = this;
|
||||||
|
|
||||||
|
// Create all panels for tabcontrol :
|
||||||
|
|
||||||
|
// Get rectangle for tabcontrol
|
||||||
|
RECT stPanelRectangle;
|
||||||
|
TC_ITEM TabCtrlItem;
|
||||||
|
|
||||||
|
m_TabControl.GetWindowRect( &stPanelRectangle );
|
||||||
|
|
||||||
|
stPanelRectangle.right -= 10;
|
||||||
|
stPanelRectangle.bottom -= 30;
|
||||||
|
|
||||||
|
m_iNumberOfPanels = 0;
|
||||||
|
|
||||||
|
m_a_pPanels[m_iNumberOfPanels++] = new CPanelSettings( this );
|
||||||
|
m_a_pPanels[m_iNumberOfPanels++] = new CPanelBeforeBin( this );
|
||||||
|
m_a_pPanels[m_iNumberOfPanels++] = new CPanelLevels( this );
|
||||||
|
m_a_pPanels[m_iNumberOfPanels++] = new CPanelAfter( this );
|
||||||
|
m_a_pPanels[m_iNumberOfPanels++] = new CPanelResults( this ); // This panel must be the last one
|
||||||
|
|
||||||
|
m_iResultPanel = m_iNumberOfPanels - 1;
|
||||||
|
m_iPanelBeforeStartOfWork = 0;
|
||||||
|
m_iCurrentPanel = 0;
|
||||||
|
|
||||||
|
for( int i=0; i<m_iNumberOfPanels; i++ )
|
||||||
|
{
|
||||||
|
// Create the tab panel
|
||||||
|
m_a_pPanels[i]->Create( this );
|
||||||
|
m_a_pPanels[i]->MoveWindow( &stPanelRectangle, FALSE );
|
||||||
|
|
||||||
|
// Insert it in the tab control
|
||||||
|
TabCtrlItem.mask = TCIF_TEXT;
|
||||||
|
TabCtrlItem.pszText = m_a_pPanels[i]->m_szTitle;
|
||||||
|
m_TabControl.InsertItem( i, &TabCtrlItem );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_a_pPanels[m_iCurrentPanel]->ShowWindow( SW_SHOW );
|
||||||
|
|
||||||
|
DragAcceptFiles( TRUE );
|
||||||
|
|
||||||
|
if( stristr( GetCommandLine(), "-MakeVersion" ) )
|
||||||
|
{
|
||||||
|
m_a_pPanels[0]->PostMessage(
|
||||||
|
WM_COMMAND,
|
||||||
|
MAKEWPARAM(IDC_BUTTON_MakeVersion,BN_CLICKED),
|
||||||
|
(LPARAM)m_a_pPanels[0]->GetDlgItem(IDC_BUTTON_MakeVersion)->m_hWnd );
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE; // return TRUE unless you set the focus to a control
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
CBinaryToolDlg::~CBinaryToolDlg()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
BOOL CBinaryToolDlg::DestroyWindow()
|
||||||
|
{
|
||||||
|
for( int i=0; i<m_iNumberOfPanels; i++ )
|
||||||
|
{
|
||||||
|
if( m_a_pPanels[i] )
|
||||||
|
{
|
||||||
|
m_a_pPanels[i]->m_fn_vUpdateRegistry();
|
||||||
|
m_a_pPanels[i]->DestroyWindow();
|
||||||
|
delete m_a_pPanels[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return CDialog::DestroyWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CBinaryToolDlg message handlers
|
||||||
|
|
||||||
|
void CBinaryToolDlg::OnOK()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CBinaryToolDlg::OnQuit()
|
||||||
|
{
|
||||||
|
|
||||||
|
CDialog::OnOK();
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CBinaryToolDlg::OnClose()
|
||||||
|
{
|
||||||
|
CDialog::OnClose();
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CBinaryToolDlg::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 CBinaryToolDlg::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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// The system calls this to obtain the cursor to display while the user drags
|
||||||
|
// the minimized window.
|
||||||
|
HCURSOR CBinaryToolDlg::OnQueryDragIcon()
|
||||||
|
{
|
||||||
|
return (HCURSOR) m_hIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CBinaryToolDlg::OnSelchangeTabPanel(NMHDR* pNMHDR, LRESULT* pResult)
|
||||||
|
{
|
||||||
|
if( m_a_pPanels[m_iCurrentPanel]->m_fn_bCanChangePanel() )
|
||||||
|
{
|
||||||
|
int iNextPanel = m_TabControl.GetCurSel();
|
||||||
|
m_a_pPanels[iNextPanel]->m_fn_vOnDisplayPanel();
|
||||||
|
m_fn_vSetCurrentPanel( iNextPanel );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_TabControl.SetCurSel( m_iCurrentPanel );
|
||||||
|
|
||||||
|
*pResult = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CBinaryToolDlg user methods
|
||||||
|
|
||||||
|
// When a new job begin, display the result panel
|
||||||
|
// and disable all controls
|
||||||
|
void CBinaryToolDlg::m_fn_vNotifyStartOfWork()
|
||||||
|
{
|
||||||
|
m_iPanelBeforeStartOfWork = m_iCurrentPanel;
|
||||||
|
m_fn_vSetCurrentPanel( m_iResultPanel );
|
||||||
|
|
||||||
|
GetDlgItem( IDC_TAB_Panel ) -> EnableWindow( FALSE );
|
||||||
|
GetDlgItem( ID_BOUTON_Quit ) -> EnableWindow( FALSE );
|
||||||
|
|
||||||
|
ResetEvent( g_stTheGlobalData.hEventStop );
|
||||||
|
g_stTheGlobalData.bStopWork = FALSE;
|
||||||
|
|
||||||
|
// Show the button stop.
|
||||||
|
GetDlgItem( ID_BUTTON_Stop ) -> EnableWindow( TRUE );
|
||||||
|
GetDlgItem( ID_BUTTON_Stop ) -> ShowWindow( SW_SHOW );
|
||||||
|
|
||||||
|
// Change title
|
||||||
|
TCHAR szTitle[256];
|
||||||
|
_stprintf( szTitle, "%s - Working...", (LPCTSTR)m_csDlgTitle );
|
||||||
|
SetWindowText( szTitle );
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// When a job is finished, restore control and panel
|
||||||
|
// (except if caller wish to keep the result panel on, in case of error for example)
|
||||||
|
void CBinaryToolDlg::m_fn_vNotifyEndOfWork( BOOL _bKeepDisplayResultPanel )
|
||||||
|
{
|
||||||
|
if( ! _bKeepDisplayResultPanel )
|
||||||
|
{
|
||||||
|
m_fn_vSetCurrentPanel( m_iPanelBeforeStartOfWork );
|
||||||
|
}
|
||||||
|
|
||||||
|
ResetEvent( g_stTheGlobalData.hEventStop );
|
||||||
|
g_stTheGlobalData.bStopWork = FALSE;
|
||||||
|
|
||||||
|
GetDlgItem( IDC_TAB_Panel ) -> EnableWindow( TRUE );
|
||||||
|
GetDlgItem( ID_BOUTON_Quit ) -> EnableWindow( TRUE );
|
||||||
|
|
||||||
|
// Hide the button stop.
|
||||||
|
GetDlgItem( ID_BUTTON_Stop ) -> ShowWindow( SW_HIDE );
|
||||||
|
|
||||||
|
SetWindowText( m_csDlgTitle );
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// Button stop is pressed : user wants to stop a job in progress.
|
||||||
|
void CBinaryToolDlg::OnStopWorkInProgress()
|
||||||
|
{
|
||||||
|
// Tell to other threads to stop.
|
||||||
|
SetEvent( g_stTheGlobalData.hEventStop );
|
||||||
|
g_stTheGlobalData.bStopWork = TRUE;
|
||||||
|
|
||||||
|
// Gray the button stop
|
||||||
|
GetDlgItem( ID_BUTTON_Stop ) -> EnableWindow( FALSE );
|
||||||
|
|
||||||
|
// Change title
|
||||||
|
TCHAR szTitle[256];
|
||||||
|
_stprintf( szTitle, "%s - Stopping...", (LPCTSTR)m_csDlgTitle );
|
||||||
|
SetWindowText( szTitle );
|
||||||
|
}
|
||||||
|
|
||||||
|
// The user doesn't want to stop work in progress anymore
|
||||||
|
void CBinaryToolDlg::m_fn_vCancelStopWorkInProgress()
|
||||||
|
{
|
||||||
|
ResetEvent( g_stTheGlobalData.hEventStop );
|
||||||
|
g_stTheGlobalData.bStopWork = FALSE;
|
||||||
|
|
||||||
|
// Enable the button stop
|
||||||
|
GetDlgItem( ID_BUTTON_Stop ) -> EnableWindow( TRUE );
|
||||||
|
|
||||||
|
// Change title
|
||||||
|
TCHAR szTitle[256];
|
||||||
|
_stprintf( szTitle, "%s - Working...", (LPCTSTR)m_csDlgTitle );
|
||||||
|
SetWindowText( szTitle );
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CBinaryToolDlg::m_fn_vSetCurrentPanel( int _iNewPanel )
|
||||||
|
{
|
||||||
|
if( _iNewPanel != m_iCurrentPanel )
|
||||||
|
{
|
||||||
|
m_a_pPanels[m_iCurrentPanel]->ShowWindow( SW_HIDE );
|
||||||
|
m_iCurrentPanel = _iNewPanel;
|
||||||
|
m_a_pPanels[m_iCurrentPanel]->ShowWindow( SW_SHOW );
|
||||||
|
|
||||||
|
m_TabControl.SetCurSel( _iNewPanel );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
BOOL CBinaryToolDlg::m_fn_bRefreshLevelList()
|
||||||
|
{
|
||||||
|
// Read game.dsc
|
||||||
|
BOOL bResult = fn_bReadGameDsc();
|
||||||
|
|
||||||
|
// Tell the panels that level list was refreshed
|
||||||
|
for( int i=0; i<m_iNumberOfPanels; i++ )
|
||||||
|
{
|
||||||
|
// Create the tab panel
|
||||||
|
m_a_pPanels[i]->m_fn_vLevelListHasChanged( ! bResult );
|
||||||
|
}
|
||||||
|
|
||||||
|
return bResult;
|
||||||
|
}
|
|
@ -0,0 +1,94 @@
|
||||||
|
// Panel.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "binarytool.h"
|
||||||
|
#include "Panel.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CPanel dialog
|
||||||
|
|
||||||
|
|
||||||
|
CPanel::CPanel(UINT nIDTemplate, CWnd* pParent /*=NULL*/)
|
||||||
|
: CDialog(nIDTemplate, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CPanel)
|
||||||
|
// NOTE: the ClassWizard will add member initialization here
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CPanel::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CPanel)
|
||||||
|
// NOTE: the ClassWizard will add DDX and DDV calls here
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CPanel, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CPanel)
|
||||||
|
// NOTE: the ClassWizard will add message map macros here
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CPanel user methods
|
||||||
|
// Here are the default behaviour for every panels
|
||||||
|
// Override these function for custom behaviour
|
||||||
|
|
||||||
|
// This function MUST be overridden.
|
||||||
|
BOOL CPanel::Create( CWnd* pParentWnd )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called at end of program, to allow a panel to store infos in registry
|
||||||
|
void CPanel::m_fn_vUpdateRegistry()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// By default, a panel does nothing when enter is hit.
|
||||||
|
// Moreover, it should NOT call EndDialog()
|
||||||
|
void CPanel::OnOk()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// called when user wants to leave the panel to go to another one.
|
||||||
|
BOOL CPanel::m_fn_bCanChangePanel()
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called just before the panel is displayed (when user click on it's title)
|
||||||
|
void CPanel::m_fn_vOnDisplayPanel()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// To enable/disable all controls of a panel.
|
||||||
|
void CPanel::m_fn_vEnableAllControls( BOOL bEnable )
|
||||||
|
{
|
||||||
|
CWnd *p_Win = GetTopWindow();
|
||||||
|
|
||||||
|
while( p_Win )
|
||||||
|
{
|
||||||
|
p_Win -> EnableWindow( bEnable );
|
||||||
|
p_Win = p_Win -> GetNextWindow( GW_HWNDNEXT );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called after game.dsc has been read for list of map.
|
||||||
|
void CPanel::m_fn_vLevelListHasChanged( BOOL _bErrorWhileReadingGameDsc )
|
||||||
|
{
|
||||||
|
_bErrorWhileReadingGameDsc = _bErrorWhileReadingGameDsc;
|
||||||
|
}
|
|
@ -0,0 +1,267 @@
|
||||||
|
// PanelBeforeBin.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "BinaryTool.h"
|
||||||
|
#include "PanelBeforeBin.h"
|
||||||
|
|
||||||
|
#include "GlobalData.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "file.h"
|
||||||
|
#include "Process.h"
|
||||||
|
#include "Threads.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CPanelBeforeBin creation and initialisation
|
||||||
|
|
||||||
|
|
||||||
|
CPanelBeforeBin::CPanelBeforeBin(CWnd* pParent /*=NULL*/ )
|
||||||
|
: CPanel(IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CPanelBeforeBin)
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
|
||||||
|
_tcscpy( m_szTitle, _T("Preparation") );
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelBeforeBin::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CPanelBeforeBin)
|
||||||
|
DDX_Control(pDX, IDC_EDIT_TempTextureDirectory, m_oEditTempDirForTextures);
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CPanelBeforeBin, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CPanelBeforeBin)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_MakeSoundBanks, OnMakeSoundBanks)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_CopySound, OnCopySound)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_MakeGF, OnMakeGF)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_BrowseTempTextureDirectory, OnBrowseTempTextureDirectory)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_MakeBigFile, OnMakeBigFile)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_MakeA3i, OnMakeA3i)
|
||||||
|
ON_EN_KILLFOCUS(IDC_EDIT_TempTextureDirectory, OnKillfocusEDITTempTextureDirectory)
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
BOOL CPanelBeforeBin::Create( CWnd* pParentWnd )
|
||||||
|
{
|
||||||
|
return CDialog::Create( IDD, pParentWnd );
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
BOOL CPanelBeforeBin::OnInitDialog()
|
||||||
|
{
|
||||||
|
CDialog::OnInitDialog();
|
||||||
|
|
||||||
|
// Read registry
|
||||||
|
CWinApp *p_oApp = AfxGetApp();
|
||||||
|
CString csSection = m_szTitle;
|
||||||
|
|
||||||
|
m_oEditTempDirForTextures.SetWindowText( p_oApp -> GetProfileString( csSection, _T("TmpDir"), NULL ) );
|
||||||
|
m_fn_vValidateTempTextureDirectory();
|
||||||
|
|
||||||
|
BOOL bOptimizedAnims = p_oApp -> GetProfileInt( csSection, _T("OptimizedAnims"), 1 );
|
||||||
|
((CButton *)GetDlgItem( IDC_RADIO_OptimizedAnims ))->SetCheck( bOptimizedAnims );
|
||||||
|
((CButton *)GetDlgItem( IDC_RADIO_NonOptimizedAnims ))->SetCheck( ! bOptimizedAnims );
|
||||||
|
|
||||||
|
|
||||||
|
return TRUE; // return TRUE unless you set the focus to a control
|
||||||
|
// EXCEPTION: OCX Property Pages should return FALSE
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CPanelBeforeBin message handlers
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelBeforeBin::OnMakeSoundBanks()
|
||||||
|
{
|
||||||
|
char szSndParserExeName[512];
|
||||||
|
char szCommandLine[1024];
|
||||||
|
|
||||||
|
// Notify main dlg for beginning of work
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyStartOfWork();
|
||||||
|
|
||||||
|
fn_vOutputLine( "Making sound banks...\r\n" );
|
||||||
|
sprintf( szSndParserExeName, "%s\\rm2SndParser.exe", (const char *)g_stTheGlobalData.csStartupDirectory );
|
||||||
|
fn_vMakeSndParserCommandLine( szCommandLine );
|
||||||
|
switch( fn_eSpawnAndWaitForProcessWithInputEvents( szSndParserExeName, szCommandLine ) )
|
||||||
|
{
|
||||||
|
case STATUS_C_Error:
|
||||||
|
fn_vOutputLine( "\tBreak on error.\r\n" );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
fn_vOutputLine( "\r\n" );
|
||||||
|
|
||||||
|
// Notify main dlg for end of work
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyEndOfWork( FALSE );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelBeforeBin::OnCopySound()
|
||||||
|
{
|
||||||
|
// MSG stMsg;
|
||||||
|
|
||||||
|
// Notify main dlg for beginning of work
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyStartOfWork();
|
||||||
|
|
||||||
|
fn_eSpawnThreadAndWaitWithInputEvents( fn_uiThreadCopySoundDirectory, NULL );
|
||||||
|
|
||||||
|
// Notify main dlg for end of work
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyEndOfWork( FALSE );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelBeforeBin::OnBrowseTempTextureDirectory()
|
||||||
|
{
|
||||||
|
CString csTextureDir;
|
||||||
|
m_oEditTempDirForTextures.GetWindowText( csTextureDir );
|
||||||
|
|
||||||
|
CString csNewDir = fn_csBrowseDirectory( "Select temp directory", csTextureDir );
|
||||||
|
|
||||||
|
if( ! csNewDir.IsEmpty() )
|
||||||
|
{
|
||||||
|
m_oEditTempDirForTextures.SetWindowText( csNewDir );
|
||||||
|
m_fn_vValidateTempTextureDirectory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelBeforeBin::OnMakeGF()
|
||||||
|
{
|
||||||
|
BOOL bKeepDisplayResults;
|
||||||
|
|
||||||
|
// Notify main dlg for beginning of work
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyStartOfWork();
|
||||||
|
|
||||||
|
if( fn_eSpawnThreadAndWaitWithInputEvents( fn_uiThreadMakeGFTextures, NULL ) == STATUS_C_Error )
|
||||||
|
bKeepDisplayResults = TRUE;
|
||||||
|
|
||||||
|
// Notify main dlg for end of work
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyEndOfWork( bKeepDisplayResults );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelBeforeBin::OnMakeBigFile()
|
||||||
|
{
|
||||||
|
BOOL bKeepDisplayResults = FALSE;
|
||||||
|
CString csTextureDir;
|
||||||
|
|
||||||
|
// Notify main dlg for beginning of work
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyStartOfWork();
|
||||||
|
|
||||||
|
m_oEditTempDirForTextures.GetWindowText( csTextureDir );
|
||||||
|
|
||||||
|
if( fn_eSpawnThreadAndWaitWithInputEvents( fn_uiThreadMakeBigFileTextures, (void *)(LPCTSTR)csTextureDir ) == STATUS_C_Error )
|
||||||
|
bKeepDisplayResults = TRUE;
|
||||||
|
|
||||||
|
// Notify main dlg for end of work
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyEndOfWork( bKeepDisplayResults );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelBeforeBin::OnMakeA3i()
|
||||||
|
{
|
||||||
|
BOOL bKeepDisplayResults = FALSE;
|
||||||
|
CString csTextureDir;
|
||||||
|
|
||||||
|
// Notify main dlg for beginning of work
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyStartOfWork();
|
||||||
|
|
||||||
|
BOOL bOptimizedAnims = ((CButton *)GetDlgItem( IDC_RADIO_OptimizedAnims ))->GetCheck();
|
||||||
|
if( fn_eSpawnThreadAndWaitWithInputEvents( fn_uiThreadAnims, (LPVOID)&bOptimizedAnims ) == STATUS_C_Error )
|
||||||
|
bKeepDisplayResults = TRUE;
|
||||||
|
|
||||||
|
// Notify main dlg for end of work
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyEndOfWork( bKeepDisplayResults );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelBeforeBin::OnKillfocusEDITTempTextureDirectory()
|
||||||
|
{
|
||||||
|
m_fn_vValidateTempTextureDirectory();
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// User methods
|
||||||
|
|
||||||
|
void CPanelBeforeBin::m_fn_vUpdateRegistry()
|
||||||
|
{
|
||||||
|
CWinApp *p_oApp = AfxGetApp();
|
||||||
|
CString csSection = m_szTitle;
|
||||||
|
|
||||||
|
p_oApp -> WriteProfileString( csSection, _T("TmpDir"), g_stTheGlobalData.csTempTextureDirectory );
|
||||||
|
|
||||||
|
BOOL bOptimizedAnims = ((CButton *)GetDlgItem( IDC_RADIO_OptimizedAnims ))->GetCheck();
|
||||||
|
p_oApp -> WriteProfileInt( csSection, _T("OptimizedAnims"), bOptimizedAnims );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelBeforeBin::m_fn_vValidateTempTextureDirectory()
|
||||||
|
{
|
||||||
|
CString csTextureDir;
|
||||||
|
|
||||||
|
m_oEditTempDirForTextures.GetWindowText( csTextureDir );
|
||||||
|
|
||||||
|
if( csTextureDir.Compare( g_stTheGlobalData.csTempTextureDirectory ) == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// If temp path is not found get the window temp path
|
||||||
|
if( csTextureDir.IsEmpty() )
|
||||||
|
{
|
||||||
|
DWORD dwRes = GetTempPath( _MAX_PATH, csTextureDir.GetBuffer( _MAX_PATH ) );
|
||||||
|
|
||||||
|
csTextureDir.ReleaseBuffer();
|
||||||
|
if( dwRes== 0 )
|
||||||
|
{
|
||||||
|
csTextureDir.Empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove trailing '\'
|
||||||
|
int iLength = csTextureDir.GetLength() - 1;
|
||||||
|
if( iLength > 0 && csTextureDir[iLength] == '\\' )
|
||||||
|
csTextureDir.SetAt( iLength, 0 );
|
||||||
|
|
||||||
|
g_stTheGlobalData.csTempTextureDirectory = csTextureDir;
|
||||||
|
m_oEditTempDirForTextures.SetWindowText( csTextureDir );
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,447 @@
|
||||||
|
// PanelLevels.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "binarytool.h"
|
||||||
|
#include "PanelLevels.h"
|
||||||
|
#include "GlobalData.h"
|
||||||
|
#include "Scripts.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "Threads.h"
|
||||||
|
#include "Process.h"
|
||||||
|
#include "Tasks.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CPanelLevels dialog
|
||||||
|
|
||||||
|
|
||||||
|
CPanelLevels::CPanelLevels(CWnd* pParent /*=NULL*/)
|
||||||
|
: CPanel(CPanelLevels::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CPanelLevels)
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
|
||||||
|
_tcscpy( m_szTitle, _T("Binarization") );
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelLevels::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CPanelLevels)
|
||||||
|
DDX_Control(pDX, IDC_CHECK_AutoTest, m_CheckAutoTest);
|
||||||
|
DDX_Control(pDX, IDC_CHECK_StopOnError, m_CheckStopOnError);
|
||||||
|
DDX_Control(pDX, IDC_LIST_Levels, m_ListLevels);
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CPanelLevels, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CPanelLevels)
|
||||||
|
ON_WM_DRAWITEM()
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_SelectAll, OnSelectAllLevels)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_ClearAll, OnClearAllLevels)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_Binarize, OnBinarize)
|
||||||
|
ON_BN_CLICKED(IDC_CHECK_AutoTest, OnCHECKAutoTest)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_TestMaps, OnTestMaps)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_Refresh, OnBUTTONRefreshLevelList)
|
||||||
|
ON_BN_CLICKED(IDC_CHECK_StopOnError, OnCHECKStopOnError)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_EditGameDsc, OnBUTTONEditGameDsc)
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
BOOL CPanelLevels::Create( CWnd* pParentWnd )
|
||||||
|
{
|
||||||
|
BOOL bResult = CDialog::Create( IDD, pParentWnd );
|
||||||
|
|
||||||
|
if( bResult )
|
||||||
|
{
|
||||||
|
// Init bitmap
|
||||||
|
m_oCrossDC.CreateCompatibleDC( NULL );
|
||||||
|
m_oCrossBitmap.LoadBitmap( IDB_BITMAP_CHECK );
|
||||||
|
m_oEmptyBoxBitmap.LoadBitmap( IDB_BITMAP_VIDE );
|
||||||
|
|
||||||
|
// Read registry, update controls
|
||||||
|
CWinApp *p_oApp = AfxGetApp();
|
||||||
|
CString csSection = m_szTitle;
|
||||||
|
|
||||||
|
m_CheckAutoTest.SetCheck( p_oApp -> GetProfileInt( csSection, _T("AutoTest"), 0 ) );
|
||||||
|
g_stTheGlobalData.bAutoTestMaps = m_CheckAutoTest.GetCheck();
|
||||||
|
m_CheckStopOnError.SetCheck( p_oApp -> GetProfileInt( csSection, _T("StopOnError"), 1 ) );
|
||||||
|
OnCHECKStopOnError();
|
||||||
|
}
|
||||||
|
|
||||||
|
return bResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelLevels::m_fn_vUpdateRegistry()
|
||||||
|
{
|
||||||
|
CWinApp *p_oApp = AfxGetApp();
|
||||||
|
CString csSection = m_szTitle;
|
||||||
|
|
||||||
|
p_oApp -> WriteProfileInt( csSection, _T("AutoTest"), m_CheckAutoTest.GetCheck() );
|
||||||
|
p_oApp -> WriteProfileInt( csSection, _T("StopOnError"), m_CheckStopOnError.GetCheck() );
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CPanelLevels message handlers
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelLevels::OnOk()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
BOOL CPanelLevels::PreTranslateMessage(MSG* pMsg)
|
||||||
|
{
|
||||||
|
if( pMsg->hwnd == m_ListLevels.m_hWnd )
|
||||||
|
{
|
||||||
|
switch ( pMsg->message )
|
||||||
|
{
|
||||||
|
case WM_LBUTTONDOWN:
|
||||||
|
if( m_fn_bOnLButtonDownListBoxLevels( pMsg ) ) return TRUE;
|
||||||
|
break;
|
||||||
|
case WM_KEYDOWN:
|
||||||
|
if( m_fn_bOnKeyDownListBoxLevels( pMsg ) ) return TRUE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( pMsg->message == WM_KEYDOWN && (int)pMsg -> wParam == VK_RETURN )
|
||||||
|
{
|
||||||
|
OnBinarize();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return CDialog::PreTranslateMessage(pMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelLevels::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
|
||||||
|
{
|
||||||
|
if( nIDCtl == IDC_LIST_Levels )
|
||||||
|
m_fn_vOnDrawItemListBoxLevels( lpDrawItemStruct );
|
||||||
|
else
|
||||||
|
CDialog::OnDrawItem(nIDCtl, lpDrawItemStruct);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelLevels::OnSelectAllLevels()
|
||||||
|
{
|
||||||
|
int iNb = m_ListLevels.GetCount();
|
||||||
|
|
||||||
|
for( int i=0; i<iNb; i++ )
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.a_cLevelsSelectedForBinarization.SetAt( i, 1 );
|
||||||
|
}
|
||||||
|
m_ListLevels.Invalidate( FALSE );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelLevels::OnClearAllLevels()
|
||||||
|
{
|
||||||
|
int iNb = m_ListLevels.GetCount();
|
||||||
|
|
||||||
|
for( int i=0; i<iNb; i++ )
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.a_cLevelsSelectedForBinarization.SetAt( i, 0 );
|
||||||
|
}
|
||||||
|
m_ListLevels.Invalidate( FALSE );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelLevels::OnBinarize()
|
||||||
|
{
|
||||||
|
// Count the number of selected levels
|
||||||
|
BOOL bAtLeastOneLevel = FALSE;
|
||||||
|
int iNb = m_ListLevels.GetCount();
|
||||||
|
|
||||||
|
for( int i=0; i<iNb; i++ )
|
||||||
|
{
|
||||||
|
if( g_stTheGlobalData.a_cLevelsSelectedForBinarization[i] )
|
||||||
|
{
|
||||||
|
bAtLeastOneLevel = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( bAtLeastOneLevel )
|
||||||
|
{
|
||||||
|
|
||||||
|
// Display result panel, button stop, etc...
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyStartOfWork();
|
||||||
|
|
||||||
|
// Start binarization
|
||||||
|
if( fn_e_TASK_Binarize( g_stTheGlobalData.a_cLevelsSelectedForBinarization ) == STATUS_C_OK )
|
||||||
|
// Then, if we must test the maps, test them.
|
||||||
|
if( g_stTheGlobalData.bAutoTestMaps )
|
||||||
|
{
|
||||||
|
fn_e_TASK_TestBinarizedMaps( g_stTheGlobalData.a_cBinarizedLevels );
|
||||||
|
}
|
||||||
|
|
||||||
|
// For binarization of levels, always keep the result screen displayed.
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyEndOfWork( TRUE );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AfxMessageBox( "Please select at least one level to binarize.", MB_OK | MB_ICONSTOP );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CPanelLevels user methods
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelLevels::m_fn_vLevelListHasChanged( BOOL _bErrorWhileReadingGameDsc )
|
||||||
|
{
|
||||||
|
m_ListLevels.ResetContent();
|
||||||
|
if( ! _bErrorWhileReadingGameDsc )
|
||||||
|
{
|
||||||
|
int iSize = g_stTheGlobalData.a_csLevelNames.GetSize();
|
||||||
|
for( int i=0; i<iSize; i++ )
|
||||||
|
{
|
||||||
|
m_ListLevels.AddString( g_stTheGlobalData.a_csLevelNames[i] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
BOOL CPanelLevels::m_fn_bOnKeyDownListBoxLevels( MSG *pMsg )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
BOOL CPanelLevels::m_fn_bOnLButtonDownListBoxLevels( MSG *pMsg )
|
||||||
|
{
|
||||||
|
POINT xPos;
|
||||||
|
CRect oRect;
|
||||||
|
BOOL bOutside;
|
||||||
|
int iIndex;
|
||||||
|
CUIntArray oSelectedItems;
|
||||||
|
UINT uiNbSelectedItems;
|
||||||
|
BOOL bSelect;
|
||||||
|
|
||||||
|
// Get the x and y coordinates
|
||||||
|
xPos.x = LOWORD( pMsg->lParam );
|
||||||
|
xPos.y = HIWORD( pMsg->lParam );
|
||||||
|
|
||||||
|
// Determine the object under the cursor in front of which the user clicked
|
||||||
|
iIndex = m_ListLevels.ItemFromPoint( xPos, bOutside );
|
||||||
|
|
||||||
|
if( bOutside )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
m_ListLevels.GetItemRect ( iIndex , &oRect );
|
||||||
|
if( (oRect.PtInRect( xPos )) && (xPos.x < 16) )
|
||||||
|
{
|
||||||
|
oSelectedItems.SetSize( m_ListLevels.GetCount() );
|
||||||
|
|
||||||
|
// Get list of selected items
|
||||||
|
uiNbSelectedItems = m_ListLevels.GetSelItems( m_ListLevels.GetCount(), (int *)oSelectedItems.GetData() );
|
||||||
|
|
||||||
|
// Determine if we must select or deselect the items.
|
||||||
|
bSelect = ( g_stTheGlobalData.a_cLevelsSelectedForBinarization.GetAt( iIndex ) == 0);
|
||||||
|
|
||||||
|
BOOL bClickedItemIsSelected = FALSE;
|
||||||
|
for( UINT i=0; i<uiNbSelectedItems; i++ )
|
||||||
|
if( oSelectedItems[i] == (BYTE)iIndex )
|
||||||
|
{
|
||||||
|
bClickedItemIsSelected = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( bClickedItemIsSelected )
|
||||||
|
{
|
||||||
|
// Select or deselect the items.
|
||||||
|
// Note: the cross in front of the item will be drawn by OnDrawItem
|
||||||
|
for( UINT i=0; i<uiNbSelectedItems; i++ )
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.a_cLevelsSelectedForBinarization.SetAt( oSelectedItems.GetAt(i), (BYTE)bSelect );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.a_cLevelsSelectedForBinarization.SetAt( iIndex, (BYTE)bSelect );
|
||||||
|
}
|
||||||
|
m_ListLevels.Invalidate( FALSE );
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelLevels::m_fn_vOnDrawItemListBoxLevels( LPDRAWITEMSTRUCT lpDIS )
|
||||||
|
{
|
||||||
|
CDC *pDC = CDC::FromHandle( lpDIS->hDC );
|
||||||
|
BOOL bSelected = (lpDIS->itemState & ODS_SELECTED );
|
||||||
|
CString csItem;
|
||||||
|
|
||||||
|
pDC->FillSolidRect( &lpDIS->rcItem, GetSysColor( COLOR_WINDOW ));
|
||||||
|
|
||||||
|
if( lpDIS->itemID < (UINT)m_ListLevels.GetCount() )
|
||||||
|
{
|
||||||
|
m_ListLevels.GetText( lpDIS->itemID, csItem );
|
||||||
|
|
||||||
|
|
||||||
|
// if item is selected, draw a cross, else draw an empty box
|
||||||
|
if( g_stTheGlobalData.a_cLevelsSelectedForBinarization[lpDIS->itemID] )
|
||||||
|
m_oCrossDC.SelectObject( m_oCrossBitmap );
|
||||||
|
else
|
||||||
|
m_oCrossDC.SelectObject( m_oEmptyBoxBitmap );
|
||||||
|
|
||||||
|
pDC->BitBlt( lpDIS->rcItem.left + 2, lpDIS->rcItem.top + 1, 12, 12, &m_oCrossDC, 0, 0, SRCAND );
|
||||||
|
|
||||||
|
pDC->SetBkMode( TRANSPARENT);
|
||||||
|
pDC->SetTextColor( GetSysColor( COLOR_WINDOWTEXT ) );
|
||||||
|
|
||||||
|
lpDIS->rcItem.left += 16;
|
||||||
|
pDC->DrawText( csItem, &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER );
|
||||||
|
|
||||||
|
// Invert item if selected
|
||||||
|
if (bSelected)
|
||||||
|
{
|
||||||
|
lpDIS->rcItem.left -= 1;
|
||||||
|
pDC->InvertRect( &lpDIS->rcItem );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelLevels::OnCHECKAutoTest()
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.bAutoTestMaps = m_CheckAutoTest.GetCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelLevels::OnCHECKStopOnError()
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.bStopBinarizeOnError = m_CheckStopOnError.GetCheck();
|
||||||
|
|
||||||
|
// If user wants the binarization to continue on error, we need to detect errors !
|
||||||
|
if( ! g_stTheGlobalData.bStopBinarizeOnError )
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.bAutoDetectErrors = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelLevels::OnBUTTONRefreshLevelList()
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_bRefreshLevelList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelLevels::OnTestMaps()
|
||||||
|
{
|
||||||
|
BOOL bAtLeastOneLevel = FALSE;
|
||||||
|
int iNb = m_ListLevels.GetCount();
|
||||||
|
|
||||||
|
for( int i=0; i<iNb; i++ )
|
||||||
|
{
|
||||||
|
if( g_stTheGlobalData.a_cLevelsSelectedForBinarization[i] )
|
||||||
|
{
|
||||||
|
bAtLeastOneLevel = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( bAtLeastOneLevel )
|
||||||
|
{
|
||||||
|
|
||||||
|
// Display result panel, button stop, etc...
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyStartOfWork();
|
||||||
|
|
||||||
|
// Start test
|
||||||
|
fn_e_TASK_TestBinarizedMaps( g_stTheGlobalData.a_cLevelsSelectedForBinarization );
|
||||||
|
|
||||||
|
// For test on levels, always keep the result screen displayed.
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyEndOfWork( TRUE );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AfxMessageBox( "Please select at least one level to test.", MB_OK | MB_ICONSTOP );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelLevels::OnBUTTONEditGameDsc()
|
||||||
|
{
|
||||||
|
PROCESS_INFORMATION stProcess;
|
||||||
|
char szExeName[512], szCommandLine[512];
|
||||||
|
UINT uiLength;
|
||||||
|
|
||||||
|
uiLength = GetSystemDirectory( szExeName, 512 );
|
||||||
|
if( uiLength == 0 )
|
||||||
|
{
|
||||||
|
AfxMessageBox( "Can't get system directory !!.", MB_OK | MB_ICONSTOP );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( szExeName[uiLength-1] != '\\' )
|
||||||
|
{
|
||||||
|
szExeName[uiLength++] = '\\';
|
||||||
|
szExeName[uiLength++] = 0;
|
||||||
|
}
|
||||||
|
strcpy( &szExeName[uiLength-1], "notepad.exe" );
|
||||||
|
|
||||||
|
sprintf( szCommandLine, "notepad.exe %s\\Gamedata\\Game.dsc", (LPCTSTR)g_stTheGlobalData.csMainDirectory );
|
||||||
|
fn_bSpawnProcess( szExeName, szCommandLine, &stProcess );
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
// PanelResults.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "binarytool.h"
|
||||||
|
#include "PanelResults.h"
|
||||||
|
#include "GlobalData.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CPanelResults creation and initialisation
|
||||||
|
|
||||||
|
|
||||||
|
CPanelResults::CPanelResults(CWnd* pParent /*=NULL*/)
|
||||||
|
: CPanel(CPanelResults::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CPanelResults)
|
||||||
|
// NOTE: the ClassWizard will add member initialization here
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
|
||||||
|
_tcscpy( m_szTitle, _T("Results") );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelResults::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CPanelResults)
|
||||||
|
// NOTE: the ClassWizard will add DDX and DDV calls here
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CPanelResults, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CPanelResults)
|
||||||
|
// NOTE: the ClassWizard will add message map macros here
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
BOOL CPanelResults::Create( CWnd* pParentWnd )
|
||||||
|
{
|
||||||
|
BOOL bResult = CDialog::Create( IDD, pParentWnd );
|
||||||
|
|
||||||
|
if( bResult )
|
||||||
|
g_stTheGlobalData.p_oEditResults = (CEdit *)GetDlgItem( IDC_EDIT_Results );
|
||||||
|
|
||||||
|
return bResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CPanelResults message handlers
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CPanelResults user methods
|
||||||
|
|
||||||
|
void CPanelResults::m_fn_vUpdateRegistry()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,316 @@
|
||||||
|
// PanelSettings.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include <io.h>
|
||||||
|
#include "binarytool.h"
|
||||||
|
#include "PanelSettings.h"
|
||||||
|
#include "GlobalData.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "file.h"
|
||||||
|
#include "Tasks.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CPanelSettings creation and initialisation
|
||||||
|
|
||||||
|
|
||||||
|
CPanelSettings::CPanelSettings(CWnd* pParent /*=NULL*/)
|
||||||
|
: CPanel(CPanelSettings::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CPanelSettings)
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
|
||||||
|
_tcscpy( m_szTitle, _T("Settings") );
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelSettings::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CPanelSettings)
|
||||||
|
DDX_Control(pDX, IDC_CHECK_AutoDetectErrors, m_CheckAutoDetectErrors);
|
||||||
|
DDX_Control(pDX, IDC_EDIT_MainDirectory, m_EditMainDirectory);
|
||||||
|
DDX_Control(pDX, IDC_EDIT_BinaryDirectory, m_EditBinDirectory);
|
||||||
|
DDX_Control(pDX, IDC_EDIT_ExeName, m_EditExeName);
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CPanelSettings, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CPanelSettings)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_BrowseMainDirectory, OnBrowseMainDirectory)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_BrowseBinaryDirectory, OnBrowseBinaryDirectory)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_BrowseExeName, OnBrowseExeName)
|
||||||
|
ON_EN_CHANGE(IDC_EDIT_MainDirectory, OnChangeMainDirectory)
|
||||||
|
ON_EN_CHANGE(IDC_EDIT_BinaryDirectory, OnChangeBinaryDirectory)
|
||||||
|
ON_EN_CHANGE(IDC_EDIT_ExeName, OnChangeExeName)
|
||||||
|
ON_BN_CLICKED(IDC_RADIO_Release, OnRADIODebugOrRelease)
|
||||||
|
ON_WM_DROPFILES()
|
||||||
|
ON_BN_CLICKED(IDC_CHECK_AutoDetectErrors, OnCHECKAutoDetectErrors)
|
||||||
|
ON_BN_CLICKED(IDC_RADIO_Debug, OnRADIODebugOrRelease)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON_MakeVersion, OnBUTTONMakeVersion)
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
BOOL CPanelSettings::Create( CWnd* pParentWnd )
|
||||||
|
{
|
||||||
|
BOOL bResult = CDialog::Create( IDD, pParentWnd );
|
||||||
|
|
||||||
|
if( bResult )
|
||||||
|
{
|
||||||
|
CWinApp *p_oApp = AfxGetApp();
|
||||||
|
CString csSection = m_szTitle;
|
||||||
|
|
||||||
|
// Read registry, update global data and controls
|
||||||
|
m_CheckAutoDetectErrors.SetCheck( p_oApp -> GetProfileInt( csSection, _T("AutoDetectErrors"), 1 ) );
|
||||||
|
g_stTheGlobalData.bAutoDetectErrors = m_CheckAutoDetectErrors.GetCheck();
|
||||||
|
|
||||||
|
g_stTheGlobalData.bDebugVersion = p_oApp -> GetProfileInt( csSection, _T("Version"), (int)FALSE );
|
||||||
|
((CButton *)GetDlgItem( IDC_RADIO_Debug ))->SetCheck( g_stTheGlobalData.bDebugVersion );
|
||||||
|
((CButton *)GetDlgItem( IDC_RADIO_Release ))->SetCheck( ! g_stTheGlobalData.bDebugVersion );
|
||||||
|
|
||||||
|
g_stTheGlobalData.csMainDirectory = p_oApp -> GetProfileString( csSection, _T("MainDirectory"), NULL );
|
||||||
|
g_stTheGlobalData.csBinDirectory = p_oApp -> GetProfileString( csSection, _T("BinDirectory"), NULL );
|
||||||
|
|
||||||
|
g_stTheGlobalData.csExecutableNames.SetSize(2);
|
||||||
|
g_stTheGlobalData.csExecutableNames[0] = p_oApp -> GetProfileString( csSection, _T("ExeRelease"), NULL );
|
||||||
|
g_stTheGlobalData.csExecutableNames[1] = p_oApp -> GetProfileString( csSection, _T("ExeDebug"), NULL );
|
||||||
|
|
||||||
|
if( g_stTheGlobalData.csExecutableNames[0].IsEmpty() )
|
||||||
|
g_stTheGlobalData.csExecutableNames[0] = "MainWinR.exe";
|
||||||
|
if( g_stTheGlobalData.csExecutableNames[1].IsEmpty() )
|
||||||
|
g_stTheGlobalData.csExecutableNames[1] = "MainWinD.exe";
|
||||||
|
|
||||||
|
|
||||||
|
g_stTheGlobalData.csExeName = g_stTheGlobalData.bDebugVersion ? g_stTheGlobalData.csExecutableNames[1] : g_stTheGlobalData.csExecutableNames[0];
|
||||||
|
|
||||||
|
m_EditExeName.SetWindowText( g_stTheGlobalData.csExeName );
|
||||||
|
m_EditMainDirectory.SetWindowText( g_stTheGlobalData.csMainDirectory );
|
||||||
|
m_EditBinDirectory.SetWindowText( g_stTheGlobalData.csBinDirectory );
|
||||||
|
|
||||||
|
m_bMainDirectoryIsValid = FALSE;
|
||||||
|
m_bBinDirectoryIsValid = FALSE;
|
||||||
|
m_bGameExeIsValid = FALSE;
|
||||||
|
|
||||||
|
DragAcceptFiles( TRUE );
|
||||||
|
}
|
||||||
|
|
||||||
|
return bResult;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelSettings::m_fn_vUpdateRegistry()
|
||||||
|
{
|
||||||
|
CWinApp *p_oApp = AfxGetApp();
|
||||||
|
CString csSection = m_szTitle;
|
||||||
|
|
||||||
|
p_oApp -> WriteProfileInt( csSection, _T("AutoDetectErrors"), g_stTheGlobalData.bAutoDetectErrors );
|
||||||
|
|
||||||
|
p_oApp -> WriteProfileInt( csSection, _T("Version"), g_stTheGlobalData.bDebugVersion );
|
||||||
|
p_oApp -> WriteProfileString( csSection, _T("MainDirectory"), g_stTheGlobalData.csMainDirectory );
|
||||||
|
p_oApp -> WriteProfileString( csSection, _T("BinDirectory"), g_stTheGlobalData.csBinDirectory );
|
||||||
|
p_oApp -> WriteProfileString( csSection, _T("ExeRelease"), g_stTheGlobalData.csExecutableNames[0] );
|
||||||
|
p_oApp -> WriteProfileString( csSection, _T("ExeDebug"), g_stTheGlobalData.csExecutableNames[1] );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CPanelSettings message handlers
|
||||||
|
|
||||||
|
|
||||||
|
void CPanelSettings::OnBrowseMainDirectory()
|
||||||
|
{
|
||||||
|
CString csNewDir = fn_csBrowseDirectory( "Select main directory", g_stTheGlobalData.csMainDirectory );
|
||||||
|
|
||||||
|
if( ! csNewDir.IsEmpty() )
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.csMainDirectory = csNewDir;
|
||||||
|
m_EditMainDirectory.SetWindowText( csNewDir );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelSettings::OnBrowseBinaryDirectory()
|
||||||
|
{
|
||||||
|
CString csNewDir = fn_csBrowseDirectory( "Select binary directory", g_stTheGlobalData.csBinDirectory );
|
||||||
|
|
||||||
|
if( ! csNewDir.IsEmpty() )
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.csBinDirectory = csNewDir;
|
||||||
|
m_EditBinDirectory.SetWindowText( csNewDir );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelSettings::OnBrowseExeName()
|
||||||
|
{
|
||||||
|
CString csBaseDir;
|
||||||
|
CFileDialog *p_oFileDlg =
|
||||||
|
new CFileDialog(
|
||||||
|
TRUE, NULL, "MainWinR.exe",
|
||||||
|
OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST|OFN_LONGNAMES|OFN_EXPLORER|OFN_HIDEREADONLY,
|
||||||
|
"Exe files (*.exe)|*.exe|All files|*||", NULL );
|
||||||
|
|
||||||
|
m_EditMainDirectory.GetWindowText( csBaseDir );
|
||||||
|
if( ! csBaseDir.IsEmpty() && _access( csBaseDir, 04 ) != -1 )
|
||||||
|
{
|
||||||
|
p_oFileDlg->m_ofn.lpstrInitialDir = csBaseDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( p_oFileDlg->DoModal() == IDOK )
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.csExeName = p_oFileDlg->GetFileName();
|
||||||
|
m_EditExeName.SetWindowText( p_oFileDlg->GetFileName() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelSettings::OnChangeMainDirectory()
|
||||||
|
{
|
||||||
|
m_bMainDirectoryIsValid = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelSettings::OnChangeBinaryDirectory()
|
||||||
|
{
|
||||||
|
m_bBinDirectoryIsValid = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelSettings::OnChangeExeName()
|
||||||
|
{
|
||||||
|
m_bGameExeIsValid = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelSettings::OnRADIODebugOrRelease()
|
||||||
|
{
|
||||||
|
if( g_stTheGlobalData.bDebugVersion )
|
||||||
|
m_EditExeName.GetWindowText( g_stTheGlobalData.csExecutableNames[1] );
|
||||||
|
else
|
||||||
|
m_EditExeName.GetWindowText( g_stTheGlobalData.csExecutableNames[0] );
|
||||||
|
|
||||||
|
g_stTheGlobalData.bDebugVersion = ((CButton *)GetDlgItem( IDC_RADIO_Debug ))->GetCheck();
|
||||||
|
if( g_stTheGlobalData.bDebugVersion )
|
||||||
|
m_EditExeName.SetWindowText( g_stTheGlobalData.csExecutableNames[1] );
|
||||||
|
else
|
||||||
|
m_EditExeName.SetWindowText( g_stTheGlobalData.csExecutableNames[0] );
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// user drag and drop file(s) on dialog...
|
||||||
|
void CPanelSettings::OnDropFiles(HDROP hDropInfo)
|
||||||
|
{
|
||||||
|
char szFile[256];
|
||||||
|
|
||||||
|
// get first dropped file
|
||||||
|
DragQueryFile( hDropInfo, 0, szFile, 256 );
|
||||||
|
|
||||||
|
// If file is not a directory => set exe
|
||||||
|
if( ! (GetFileAttributes( szFile ) & FILE_ATTRIBUTE_DIRECTORY) )
|
||||||
|
{
|
||||||
|
m_EditExeName.SetWindowText( szFile );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Else
|
||||||
|
|
||||||
|
|
||||||
|
CDialog::OnDropFiles(hDropInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void CPanelSettings::OnCHECKAutoDetectErrors()
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.bAutoDetectErrors = m_CheckAutoDetectErrors.GetCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
// CPanelSettings user methods
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// When user wants to go to another panel, we make sure all settings are valid.
|
||||||
|
BOOL CPanelSettings::m_fn_bCanChangePanel()
|
||||||
|
{
|
||||||
|
|
||||||
|
if( ! m_bMainDirectoryIsValid )
|
||||||
|
{
|
||||||
|
m_EditMainDirectory.GetWindowText( g_stTheGlobalData.csMainDirectory );
|
||||||
|
if( ! (m_bMainDirectoryIsValid = fn_bValidateMainDirectorySetting()) )
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ! m_bBinDirectoryIsValid )
|
||||||
|
{
|
||||||
|
m_EditBinDirectory.GetWindowText( g_stTheGlobalData.csBinDirectory );
|
||||||
|
if( ! (m_bBinDirectoryIsValid = fn_bValidateBinDirectorySetting()) )
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ! m_bGameExeIsValid )
|
||||||
|
{
|
||||||
|
m_EditExeName.GetWindowText( g_stTheGlobalData.csExeName );
|
||||||
|
if( ! (m_bGameExeIsValid = fn_bValidateGameExeSetting()) )
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
// When displaying panel, we update the state of error autodetection
|
||||||
|
// because it can be changed from another panel.
|
||||||
|
void CPanelSettings::m_fn_vOnDisplayPanel()
|
||||||
|
{
|
||||||
|
m_CheckAutoDetectErrors.SetCheck( g_stTheGlobalData.bAutoDetectErrors );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
// Here, the user wants binarytool to make the whole version by itself
|
||||||
|
// (what a lasy user !)
|
||||||
|
// We launch rm2sndparser, textures and binarisation....
|
||||||
|
void CPanelSettings::OnBUTTONMakeVersion()
|
||||||
|
{
|
||||||
|
// Notify main dlg for beginning of work
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyStartOfWork();
|
||||||
|
|
||||||
|
// Do all the work
|
||||||
|
fn_e_TASK_Version();
|
||||||
|
|
||||||
|
// Empty the map list => it will be filled when displaying panel levels.
|
||||||
|
g_stTheGlobalData.a_csLevelNames.SetSize( 0 );
|
||||||
|
|
||||||
|
// End of work ! We keep the result screen displayed.
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vNotifyEndOfWork( TRUE );
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,710 @@
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "GlobalData.h"
|
||||||
|
#include "Process.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
#define C_szUserBreakString "\tUser break.\r\n"
|
||||||
|
#define C_lTimeIntervalForErrorChecking 2000
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// Launch a new process using CreateProcess and return immediatly
|
||||||
|
// _szExeName contains the name of the executable with FULL PATH.
|
||||||
|
// Note: _szCommandLine can be NULL.
|
||||||
|
// return TRUE if process was created normally or FALSE if not.
|
||||||
|
// Also fill _p_Info with process informations (handle...)
|
||||||
|
// Display a dialog box to the user in case of error on CreateProcess.
|
||||||
|
BOOL fn_bSpawnProcess( char *_szExeName, char *_szCommandLine, LPPROCESS_INFORMATION _p_Info )
|
||||||
|
{
|
||||||
|
STARTUPINFO stWinInfo;
|
||||||
|
char szDirectory[512];
|
||||||
|
CString csMessage;
|
||||||
|
int iPathLength;
|
||||||
|
|
||||||
|
// Spawn process
|
||||||
|
GetStartupInfo( &stWinInfo );
|
||||||
|
|
||||||
|
// Get path of executable
|
||||||
|
iPathLength = strrchr( _szExeName, '\\' ) - _szExeName;
|
||||||
|
strncpy( szDirectory, _szExeName, iPathLength );
|
||||||
|
szDirectory[iPathLength] = 0;
|
||||||
|
|
||||||
|
// Create process.
|
||||||
|
if( ! CreateProcess( _szExeName, _szCommandLine, NULL, NULL, FALSE, 0, NULL, szDirectory, &stWinInfo, _p_Info ) )
|
||||||
|
{
|
||||||
|
csMessage = _T("Can't execute '");
|
||||||
|
csMessage += _szExeName;
|
||||||
|
csMessage += _T("' !\nMake sure path is correct and executable does exist.");
|
||||||
|
AfxMessageBox( csMessage, MB_OK | MB_ICONSTOP );
|
||||||
|
|
||||||
|
ZeroMemory( _p_Info, sizeof(_p_Info) );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
void fn_vCloseProcessHandles( LPPROCESS_INFORMATION _p_stProcess )
|
||||||
|
{
|
||||||
|
if( _p_stProcess->hProcess )
|
||||||
|
CloseHandle( _p_stProcess->hProcess );
|
||||||
|
if( _p_stProcess->hThread )
|
||||||
|
CloseHandle( _p_stProcess->hThread );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
tdeStatus fn_eSpawnAndWaitForProcess( char *_szExeName, char *_szCommandLine, HANDLE _hEventStop /*= INVALID_HANDLE_VALUE*/ )
|
||||||
|
{
|
||||||
|
HANDLE a_hObjectsToWaitFor[2];
|
||||||
|
int iNbObjectsToWaitFor;
|
||||||
|
DWORD dwWaitReturn, dwExitCode;
|
||||||
|
char szMessage[1024];
|
||||||
|
PROCESS_INFORMATION stProcess;
|
||||||
|
char szShortExeName[128];
|
||||||
|
|
||||||
|
fn_vGetShortExeName( szShortExeName, _szExeName );
|
||||||
|
|
||||||
|
// spawn process
|
||||||
|
if( ! fn_bSpawnProcess( _szExeName, _szCommandLine, &stProcess ) )
|
||||||
|
{
|
||||||
|
sprintf( szMessage, "\tError launching %s\r\n", _szExeName );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prepare to wait for end of process
|
||||||
|
iNbObjectsToWaitFor = 0;
|
||||||
|
a_hObjectsToWaitFor[iNbObjectsToWaitFor++] = stProcess.hProcess;
|
||||||
|
|
||||||
|
// Test if we must wait for abort event too.
|
||||||
|
if( _hEventStop != INVALID_HANDLE_VALUE )
|
||||||
|
a_hObjectsToWaitFor[iNbObjectsToWaitFor++] = _hEventStop;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// Wait for process or abort
|
||||||
|
dwWaitReturn = WaitForMultipleObjects( iNbObjectsToWaitFor, a_hObjectsToWaitFor, FALSE, C_lTimeIntervalForErrorChecking );
|
||||||
|
|
||||||
|
// Test if user wants to stop (=abort)
|
||||||
|
if( iNbObjectsToWaitFor > 1 && (dwWaitReturn == WAIT_OBJECT_0+1 || dwWaitReturn == WAIT_ABANDONED_0+1) )
|
||||||
|
{
|
||||||
|
// Ask for confirmation
|
||||||
|
sprintf( szMessage, "Are you sure you want to terminate '%s' ?", _szExeName );
|
||||||
|
if( AfxMessageBox( szMessage, MB_YESNO | MB_ICONQUESTION ) == IDYES )
|
||||||
|
{
|
||||||
|
// Abort is confirmed, we kill the process
|
||||||
|
PostThreadMessage( stProcess.dwThreadId, WM_QUIT, 0, NULL );
|
||||||
|
dwWaitReturn = WaitForSingleObject( stProcess.hProcess, 3500 );
|
||||||
|
if( dwWaitReturn == WAIT_TIMEOUT )
|
||||||
|
TerminateProcess( stProcess.hProcess, 199 );
|
||||||
|
|
||||||
|
// We exit if process was killed
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
fn_vOutputLine( C_szUserBreakString );
|
||||||
|
|
||||||
|
fn_bCloseSytemErrorDialogBox( szShortExeName, TRUE );
|
||||||
|
return STATUS_C_UserBreak;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vCancelStopWorkInProgress();
|
||||||
|
|
||||||
|
// User does not want to stop anymore, we go for another wait.
|
||||||
|
ResetEvent( _hEventStop );
|
||||||
|
}
|
||||||
|
else if( dwWaitReturn == WAIT_OBJECT_0 || dwWaitReturn == WAIT_ABANDONED_0 )
|
||||||
|
{
|
||||||
|
GetExitCodeProcess( stProcess.hProcess, &dwExitCode );
|
||||||
|
if( dwExitCode != 0 )
|
||||||
|
{
|
||||||
|
sprintf( szMessage, "\t'%s' has exited with error code %i\r\n", _szExeName, dwExitCode );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
// Process has exited normally. We exit the wait loop.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if( dwWaitReturn == WAIT_TIMEOUT )
|
||||||
|
{
|
||||||
|
// Here, the time has come to check if an error occured.
|
||||||
|
// We try to find and close any system error dialog box related with the exe
|
||||||
|
if( fn_bCloseSytemErrorDialogBox( szShortExeName ) )
|
||||||
|
{
|
||||||
|
// if we found one of these boxes, we kill the process and exit.
|
||||||
|
TerminateProcess( stProcess.hProcess, 199 );
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
sprintf( szMessage, "\tError detected with '%s'\r\n", _szExeName );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We found nothing... We go for another wait.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Error.
|
||||||
|
fn_vOutputLine( "\r\n\tInternal error: Error on WaitForMultipleObjects !!!\r\n" );
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
} while( 1 );
|
||||||
|
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
|
||||||
|
// we deal we an enventual dialog box (saying "access violation" or whatever)
|
||||||
|
if( fn_bCloseSytemErrorDialogBox( szShortExeName ) )
|
||||||
|
{
|
||||||
|
// If there was an error dialog box, we return an error.
|
||||||
|
sprintf( szMessage, "\tError detected with '%s'\r\n", _szExeName );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_C_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
tdeStatus fn_eWaitForMultipleProcesses( int _iNbProcesses, LPPROCESS_INFORMATION _pa_stInfo, LPCTSTR _szExeNames[], int *_p_iProcessesEnded )
|
||||||
|
{
|
||||||
|
HANDLE a_hObjectsToWaitFor[64];
|
||||||
|
int i;
|
||||||
|
DWORD dwWaitReturn, dwExitCode;
|
||||||
|
char szMessage[1024];
|
||||||
|
|
||||||
|
|
||||||
|
// Prepare to wait for end of process
|
||||||
|
for( i=0; i<_iNbProcesses; i ++ )
|
||||||
|
{
|
||||||
|
a_hObjectsToWaitFor[i] = _pa_stInfo[i].hProcess;
|
||||||
|
}
|
||||||
|
// we must also wait for abort event.
|
||||||
|
a_hObjectsToWaitFor[_iNbProcesses] = g_stTheGlobalData.hEventStop;
|
||||||
|
|
||||||
|
// Wait for the end of one process or abort
|
||||||
|
dwWaitReturn = WaitForMultipleObjects( _iNbProcesses+1, a_hObjectsToWaitFor, FALSE, INFINITE );
|
||||||
|
|
||||||
|
// Test if user wants to stop (=abort)
|
||||||
|
if( dwWaitReturn == WAIT_OBJECT_0+_iNbProcesses || dwWaitReturn == WAIT_ABANDONED_0+_iNbProcesses )
|
||||||
|
{
|
||||||
|
// Abort is confirmed, we kill the process
|
||||||
|
for( i=0; i<_iNbProcesses; i ++ )
|
||||||
|
{
|
||||||
|
PostThreadMessage( _pa_stInfo[i].dwThreadId, WM_QUIT, 0, NULL );
|
||||||
|
}
|
||||||
|
dwWaitReturn = WaitForMultipleObjects( _iNbProcesses, a_hObjectsToWaitFor, TRUE, 3500 );
|
||||||
|
if( dwWaitReturn == WAIT_TIMEOUT )
|
||||||
|
{
|
||||||
|
for( i=0; i<_iNbProcesses; i ++ )
|
||||||
|
TerminateProcess( _pa_stInfo[i].hProcess, 199 );
|
||||||
|
}
|
||||||
|
|
||||||
|
// We exit if processes were killed
|
||||||
|
for( i=0; i<_iNbProcesses; i ++ )
|
||||||
|
fn_vCloseProcessHandles( &_pa_stInfo[i] );
|
||||||
|
fn_vOutputLine( C_szUserBreakString );
|
||||||
|
return STATUS_C_UserBreak;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for( i=0; i<_iNbProcesses; i ++ )
|
||||||
|
{
|
||||||
|
if( dwWaitReturn == WAIT_OBJECT_0+i )
|
||||||
|
{
|
||||||
|
// Mark witch process has exited.
|
||||||
|
*_p_iProcessesEnded = i;
|
||||||
|
GetExitCodeProcess( _pa_stInfo[i].hProcess, &dwExitCode );
|
||||||
|
fn_vCloseProcessHandles( &_pa_stInfo[i] );
|
||||||
|
if( dwExitCode != 0 )
|
||||||
|
{
|
||||||
|
sprintf( szMessage, "\t'%s' has exited with error code %i\r\n", _szExeNames[i], dwExitCode );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( i == _iNbProcesses )
|
||||||
|
{
|
||||||
|
// Error.
|
||||||
|
fn_vOutputLine( "\r\n\tInternal error: Error on WaitForMultipleObjects !!!\r\n" );
|
||||||
|
for( i=0; i<_iNbProcesses; i ++ )
|
||||||
|
fn_vCloseProcessHandles( &_pa_stInfo[i] );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_C_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
tdeStatus fn_eSpawnAndWaitForProcessWithTimeout( char *_szExeName, char *_szCommandLine, DWORD _dwMilliseconds /*=INFINITE*/ )
|
||||||
|
{
|
||||||
|
HANDLE a_hObjectsToWaitFor[2];
|
||||||
|
DWORD dwWaitReturn, dwExitCode;
|
||||||
|
char szMessage[1024];
|
||||||
|
PROCESS_INFORMATION stProcess;
|
||||||
|
DWORD dwStartTime = GetTickCount();
|
||||||
|
DWORD dwElapsedTime = 0;
|
||||||
|
char szShortExeName[128];
|
||||||
|
|
||||||
|
fn_vGetShortExeName( szShortExeName, _szExeName );
|
||||||
|
|
||||||
|
// spawn process
|
||||||
|
if( ! fn_bSpawnProcess( _szExeName, _szCommandLine, &stProcess ) )
|
||||||
|
{
|
||||||
|
sprintf( szMessage, "\tError launching %s\r\n", _szExeName );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prepare to wait for end of process
|
||||||
|
a_hObjectsToWaitFor[0] = stProcess.hProcess;
|
||||||
|
a_hObjectsToWaitFor[1] = g_stTheGlobalData.hEventStop;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// Wait for process, abort or timeout
|
||||||
|
// We wait for 1500 millisecond, then we check for a system error dialog box.
|
||||||
|
dwWaitReturn = WaitForMultipleObjects( 2, a_hObjectsToWaitFor, FALSE, C_lTimeIntervalForErrorChecking );
|
||||||
|
|
||||||
|
|
||||||
|
dwElapsedTime = GetTickCount() - dwStartTime;
|
||||||
|
// If total time is greater than user timeout, we kill the process
|
||||||
|
if( dwElapsedTime >= _dwMilliseconds )
|
||||||
|
{
|
||||||
|
fn_vOutputLine( "\t*** Timeout! Killing process...***\r\n" );
|
||||||
|
PostThreadMessage( stProcess.dwThreadId, WM_QUIT, 0, NULL );
|
||||||
|
dwWaitReturn = WaitForSingleObject( stProcess.hProcess, 1500 );
|
||||||
|
if( dwWaitReturn == WAIT_TIMEOUT )
|
||||||
|
TerminateProcess( stProcess.hProcess, 199 );
|
||||||
|
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
|
||||||
|
// Ok, now we deal we an enventual dialog box (saying "acces violation" or whatever)
|
||||||
|
fn_bCloseSytemErrorDialogBox( szShortExeName, TRUE );
|
||||||
|
|
||||||
|
// We exit
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test if user wants to stop (=abort)
|
||||||
|
if( dwWaitReturn == WAIT_OBJECT_0+1 || dwWaitReturn == WAIT_ABANDONED_0+1 )
|
||||||
|
{
|
||||||
|
// Ask for confirmation
|
||||||
|
sprintf( szMessage, "Are you sure you want to terminate '%s' ?", _szExeName );
|
||||||
|
if( AfxMessageBox( szMessage, MB_YESNO | MB_ICONQUESTION ) == IDYES )
|
||||||
|
{
|
||||||
|
// Abort is confirmed, we kill the process
|
||||||
|
PostThreadMessage( stProcess.dwThreadId, WM_QUIT, 0, NULL );
|
||||||
|
dwWaitReturn = WaitForSingleObject( stProcess.hProcess, 3500 );
|
||||||
|
if( dwWaitReturn == WAIT_TIMEOUT )
|
||||||
|
TerminateProcess( stProcess.hProcess, 199 );
|
||||||
|
|
||||||
|
// We exit if process was killed
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
fn_vOutputLine( C_szUserBreakString );
|
||||||
|
// we deal we an enventual dialog box (saying "acces violation" or whatever)
|
||||||
|
fn_bCloseSytemErrorDialogBox( szShortExeName, TRUE );
|
||||||
|
return STATUS_C_UserBreak;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vCancelStopWorkInProgress();
|
||||||
|
|
||||||
|
// User does not want to stop anymore, we go for another wait.
|
||||||
|
ResetEvent( g_stTheGlobalData.hEventStop );
|
||||||
|
}
|
||||||
|
else if( dwWaitReturn == WAIT_OBJECT_0 || dwWaitReturn == WAIT_ABANDONED_0 )
|
||||||
|
{
|
||||||
|
GetExitCodeProcess( stProcess.hProcess, &dwExitCode );
|
||||||
|
if( dwExitCode != 0 )
|
||||||
|
{
|
||||||
|
sprintf( szMessage, "\t'%s' has exited with error code %i\r\n", _szExeName, dwExitCode );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
// we deal we an enventual dialog box (saying "acces violation" or whatever)
|
||||||
|
fn_bCloseSytemErrorDialogBox( szShortExeName );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
// Process has exited normally. We exit the wait loop.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if( dwWaitReturn == WAIT_TIMEOUT )
|
||||||
|
{
|
||||||
|
// Here, the time has come to check if an error occured.
|
||||||
|
// We try to find and close any system error dialog box related with the exe
|
||||||
|
if( fn_bCloseSytemErrorDialogBox( szShortExeName ) )
|
||||||
|
{
|
||||||
|
// if we found one of these boxes, we kill the process and exit.
|
||||||
|
TerminateProcess( stProcess.hProcess, 199 );
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
sprintf( szMessage, "\tError detected with '%s'\r\n", _szExeName );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We found nothing... We go for another wait.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Error.
|
||||||
|
fn_vOutputLine( "\r\n\tInternal error: Error on WaitForMultipleObjects !!!\r\n" );
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
} while( 1 );
|
||||||
|
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
|
||||||
|
// we deal we an enventual dialog box (saying "access violation" or whatever)
|
||||||
|
if( fn_bCloseSytemErrorDialogBox( szShortExeName ) )
|
||||||
|
{
|
||||||
|
// If there was an error dialog box, we return an error.
|
||||||
|
sprintf( szMessage, "\tError detected with '%s'\r\n", _szExeName );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_C_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
tdeStatus fn_eSpawnAndWaitForProcessWithInputEvents( char *_szExeName, char *_szCommandLine )
|
||||||
|
{
|
||||||
|
HANDLE a_hObjectsToWaitFor[32];
|
||||||
|
DWORD dwWaitReturn, dwExitCode;
|
||||||
|
char szMessage[1024];
|
||||||
|
PROCESS_INFORMATION stProcess;
|
||||||
|
MSG stMsg;
|
||||||
|
char szShortExeName[128];
|
||||||
|
|
||||||
|
fn_vGetShortExeName( szShortExeName, _szExeName );
|
||||||
|
|
||||||
|
// spawn process
|
||||||
|
if( ! fn_bSpawnProcess( _szExeName, _szCommandLine, &stProcess ) )
|
||||||
|
{
|
||||||
|
sprintf( szMessage, "\tError launching %s\r\n", _szExeName );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prepare to wait for end of process
|
||||||
|
a_hObjectsToWaitFor[0] = stProcess.hProcess;
|
||||||
|
a_hObjectsToWaitFor[1] = g_stTheGlobalData.hEventStop;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// Wait for process or abort
|
||||||
|
dwWaitReturn = MsgWaitForMultipleObjects( 2, a_hObjectsToWaitFor, FALSE, C_lTimeIntervalForErrorChecking, QS_ALLINPUT );
|
||||||
|
|
||||||
|
// Test if user wants to stop (=abort)
|
||||||
|
if( dwWaitReturn == WAIT_OBJECT_0+1 || dwWaitReturn == WAIT_ABANDONED_0+1 )
|
||||||
|
{
|
||||||
|
// Ask for confirmation
|
||||||
|
sprintf( szMessage, "Are you sure you want to terminate '%s' ?", _szExeName );
|
||||||
|
if( AfxMessageBox( szMessage, MB_YESNO | MB_ICONQUESTION ) == IDYES )
|
||||||
|
{
|
||||||
|
// Abort is confirmed, we kill the process
|
||||||
|
PostThreadMessage( stProcess.dwThreadId, WM_QUIT, 0, NULL );
|
||||||
|
dwWaitReturn = WaitForSingleObject( stProcess.hProcess, 3500 );
|
||||||
|
if( dwWaitReturn == WAIT_TIMEOUT )
|
||||||
|
TerminateProcess( stProcess.hProcess, 199 );
|
||||||
|
|
||||||
|
// We exit if process was killed
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
fn_bCloseSytemErrorDialogBox( szShortExeName, TRUE );
|
||||||
|
fn_vOutputLine( C_szUserBreakString );
|
||||||
|
return STATUS_C_UserBreak;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
g_stTheGlobalData.p_oMainDlg -> m_fn_vCancelStopWorkInProgress();
|
||||||
|
|
||||||
|
// User does not want to stop anymore, we go for another wait.
|
||||||
|
ResetEvent( g_stTheGlobalData.hEventStop );
|
||||||
|
}
|
||||||
|
else if( dwWaitReturn == WAIT_OBJECT_0 || dwWaitReturn == WAIT_ABANDONED_0 )
|
||||||
|
{
|
||||||
|
GetExitCodeProcess( stProcess.hProcess, &dwExitCode );
|
||||||
|
if( dwExitCode != 0 )
|
||||||
|
{
|
||||||
|
sprintf( szMessage, "\t'%s' has exited with error code %i\r\n", _szExeName, dwExitCode );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
// Process has exited normally. We exit the wait loop.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if( dwWaitReturn == WAIT_OBJECT_0 + 2 )
|
||||||
|
{
|
||||||
|
// Else, a user event has arrived: treat it.
|
||||||
|
while( PeekMessage( &stMsg, g_stTheGlobalData.p_oMainDlg -> m_hWnd, 0, 0, PM_REMOVE ) )
|
||||||
|
if( ! g_stTheGlobalData.p_oMainDlg -> PreTranslateMessage( &stMsg ) )
|
||||||
|
DispatchMessage( &stMsg );
|
||||||
|
}
|
||||||
|
else if( dwWaitReturn == WAIT_TIMEOUT )
|
||||||
|
{
|
||||||
|
// Here, the time has come to check if an error occured.
|
||||||
|
// We try to find and close any system error dialog box related with the exe
|
||||||
|
if( fn_bCloseSytemErrorDialogBox( szShortExeName ) )
|
||||||
|
{
|
||||||
|
// if we found one of these boxes, we kill the process and exit.
|
||||||
|
TerminateProcess( stProcess.hProcess, 199 );
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
sprintf( szMessage, "\tError detected with '%s'\r\n", _szExeName );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We found nothing... We go for another wait.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Error.
|
||||||
|
fn_vOutputLine( "\r\n\tInternal error: Error on MsgWaitForMultipleObjects !!!\r\n" );
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
} while( 1 );
|
||||||
|
|
||||||
|
fn_vCloseProcessHandles( &stProcess );
|
||||||
|
|
||||||
|
// we deal we an enventual dialog box (saying "access violation" or whatever)
|
||||||
|
if( fn_bCloseSytemErrorDialogBox( szShortExeName ) )
|
||||||
|
{
|
||||||
|
// If there was an error dialog box, we return an error.
|
||||||
|
sprintf( szMessage, "\tError detected with '%s'\r\n", _szExeName );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_C_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
tdeStatus fn_eSpawnThreadAndWaitWithInputEvents( AFX_THREADPROC _p_fn_uiThread, LPVOID _p_vParamForThread )
|
||||||
|
{
|
||||||
|
HANDLE a_hEvents[64];
|
||||||
|
DWORD dwWaitReturn;
|
||||||
|
MSG stMessage;
|
||||||
|
DWORD dwExitCode = 0;
|
||||||
|
CWinThread *p_oThread = AfxBeginThread( _p_fn_uiThread, _p_vParamForThread );
|
||||||
|
|
||||||
|
if( p_oThread == NULL )
|
||||||
|
{
|
||||||
|
AfxMessageBox( "Unable to create thread !.", MB_OK | MB_ICONEXCLAMATION );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable autodelete (to use handle to thread after it is terminated).
|
||||||
|
p_oThread->m_bAutoDelete = FALSE;
|
||||||
|
|
||||||
|
// Now, we enter wait loop that wait either for thread end or for input message
|
||||||
|
a_hEvents[0] = p_oThread->m_hThread;
|
||||||
|
|
||||||
|
while( 1 )
|
||||||
|
{
|
||||||
|
dwWaitReturn = MsgWaitForMultipleObjects( 1, a_hEvents, FALSE, INFINITE, QS_ALLINPUT );
|
||||||
|
|
||||||
|
// If an input event has arrived, we dispatch it.
|
||||||
|
if( dwWaitReturn == WAIT_OBJECT_0 + 1 )
|
||||||
|
{
|
||||||
|
while( PeekMessage( &stMessage, g_stTheGlobalData.p_oMainDlg->m_hWnd, 0, 0, PM_REMOVE ) )
|
||||||
|
if( g_stTheGlobalData.p_oMainDlg -> PreTranslateMessage( &stMessage ) == 0 )
|
||||||
|
DispatchMessage( &stMessage );
|
||||||
|
}
|
||||||
|
// if thread has exited
|
||||||
|
else if( dwWaitReturn == WAIT_OBJECT_0 || dwWaitReturn == WAIT_ABANDONED_0 )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Error.
|
||||||
|
TCHAR szMessage[1024];
|
||||||
|
::FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM,
|
||||||
|
NULL, GetLastError(),
|
||||||
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||||
|
szMessage, 1024, NULL );
|
||||||
|
fn_vOutputLine( "\r\n\tInternal error: Error on MsgWaitForMultipleObjects :\r\n\t" );
|
||||||
|
fn_vOutputLine( szMessage );
|
||||||
|
fn_vOutputLine( "\r\n" );
|
||||||
|
delete p_oThread;
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GetExitCodeThread( p_oThread->m_hThread, &dwExitCode );
|
||||||
|
// if( dwExitCode == STATUS_C_UserBreak )
|
||||||
|
// fn_vOutputLine( C_szUserBreakString );
|
||||||
|
|
||||||
|
delete p_oThread;
|
||||||
|
|
||||||
|
return (tdeStatus)dwExitCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
typedef struct tdstEnumWinStruct_
|
||||||
|
{
|
||||||
|
char *p_szExeName;
|
||||||
|
BOOL bActionDone;
|
||||||
|
UINT uiNumberOfButton;
|
||||||
|
} tdstEnumWinStruct;
|
||||||
|
|
||||||
|
// Callback to enumerate all controls in a window.
|
||||||
|
BOOL CALLBACK EnumChildWindowProc( HWND _hwnd, LPARAM _p_stParam )
|
||||||
|
{
|
||||||
|
char szTitle[512];
|
||||||
|
tdstEnumWinStruct *p_stEnumChild = (tdstEnumWinStruct *)_p_stParam;
|
||||||
|
DWORD dwID = GetClassLong( _hwnd, GCW_ATOM );
|
||||||
|
|
||||||
|
// We only check statics
|
||||||
|
switch( dwID )
|
||||||
|
{
|
||||||
|
case 0xC01B :
|
||||||
|
GetWindowText( _hwnd, szTitle, 512 );
|
||||||
|
// Check if caption contains the name of the exe
|
||||||
|
if( stristr( szTitle, p_stEnumChild->p_szExeName ) != NULL )
|
||||||
|
{
|
||||||
|
// Name is detected
|
||||||
|
p_stEnumChild->bActionDone = TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 0xC015:
|
||||||
|
p_stEnumChild->uiNumberOfButton++;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL fn_bCheckWindow( HWND _hMessageBox, char *_szString, UINT *_p_uiNbButtons = NULL )
|
||||||
|
{
|
||||||
|
tdstEnumWinStruct stEnumChild;
|
||||||
|
|
||||||
|
stEnumChild.p_szExeName = _szString;
|
||||||
|
stEnumChild.bActionDone = FALSE;
|
||||||
|
stEnumChild.uiNumberOfButton = 0;
|
||||||
|
|
||||||
|
// Search in controls if one of them contains the given string
|
||||||
|
EnumChildWindows( _hMessageBox, EnumChildWindowProc, (LPARAM)&stEnumChild );
|
||||||
|
if( _p_uiNbButtons )
|
||||||
|
*_p_uiNbButtons = stEnumChild.uiNumberOfButton;
|
||||||
|
return stEnumChild.bActionDone;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// Callback to enumerate all windows.
|
||||||
|
// (called by fn_bCloseSytemErrorDialogBox)
|
||||||
|
BOOL CALLBACK EnumWindowProc( HWND _hwnd, LPARAM _p_stParam )
|
||||||
|
{
|
||||||
|
char szTitle[512];
|
||||||
|
DWORD dwID = GetClassLong( _hwnd, GCW_ATOM );
|
||||||
|
tdstEnumWinStruct *p_stEnumWin = (tdstEnumWinStruct *)_p_stParam;
|
||||||
|
UINT uiNbButtons;
|
||||||
|
|
||||||
|
GetWindowText( _hwnd, szTitle, 512 );
|
||||||
|
|
||||||
|
// If window is a dialog box
|
||||||
|
if( dwID == 0x8002 )
|
||||||
|
{
|
||||||
|
// Check if it's an "application error" box.
|
||||||
|
if( stristr( szTitle, p_stEnumWin->p_szExeName )
|
||||||
|
&& (stristr( szTitle, "erreur d'application" ) || stristr( szTitle, "application error" )) )
|
||||||
|
{
|
||||||
|
// Now, we close that box !
|
||||||
|
::PostMessage( _hwnd, WM_CLOSE, 0, 0 );
|
||||||
|
p_stEnumWin->bActionDone = TRUE;
|
||||||
|
// Return FALSE to stop enumeration
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
// Else, it may be an assert box.
|
||||||
|
else if( (stristr( szTitle, "Debug Lib" ) || stristr( szTitle, "Runtime Lib" ))
|
||||||
|
&& fn_bCheckWindow( _hwnd, "??" )
|
||||||
|
&& fn_bCheckWindow( _hwnd, p_stEnumWin->p_szExeName, &uiNbButtons )
|
||||||
|
&& uiNbButtons == 3 )
|
||||||
|
{
|
||||||
|
::PostMessage( _hwnd, WM_CLOSE, 0, 0 );
|
||||||
|
p_stEnumWin->bActionDone = TRUE;
|
||||||
|
// Return FALSE to stop enumeration
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
// Check if it's an "illegal operation" box.
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char *p_szExtension = strrchr( p_stEnumWin->p_szExeName, '.' );
|
||||||
|
if( p_szExtension ) *p_szExtension = 0;
|
||||||
|
|
||||||
|
if( stristr( szTitle, p_stEnumWin->p_szExeName )
|
||||||
|
&& fn_bCheckWindow( _hwnd, "Opération non conforme", &uiNbButtons )
|
||||||
|
&& uiNbButtons >= 2 && uiNbButtons < 4 )
|
||||||
|
{
|
||||||
|
// Now, we close that box !
|
||||||
|
::PostMessage( _hwnd, WM_CLOSE, 0, 0 );
|
||||||
|
p_stEnumWin->bActionDone = TRUE;
|
||||||
|
// Return FALSE to stop enumeration
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if( p_szExtension ) *p_szExtension = '.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// We also handle dr watson's windows...
|
||||||
|
else if( stristr( szTitle, "Watson" ) != NULL )
|
||||||
|
{
|
||||||
|
// Check if this dr. Watson's window talks about us !
|
||||||
|
if( fn_bCheckWindow( _hwnd, p_stEnumWin->p_szExeName ) )
|
||||||
|
{
|
||||||
|
::PostMessage( _hwnd, WM_CLOSE, 0, 0 );
|
||||||
|
p_stEnumWin->bActionDone = TRUE;
|
||||||
|
// Return FALSE to stop enumeration
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Window not found, we continue
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// Get all windows, check if this is a system or dr. watson's window
|
||||||
|
// and it is related to ExeName, then eventually close it.
|
||||||
|
// Return TRUE if a window was closed, FALSE otherwise.
|
||||||
|
BOOL fn_bCloseSytemErrorDialogBox( char *_szExeName, BOOL bForceClose /*=FALSE*/)
|
||||||
|
{
|
||||||
|
tdstEnumWinStruct stEnumWin;
|
||||||
|
|
||||||
|
if( ! g_stTheGlobalData.bAutoDetectErrors && ! bForceClose )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
stEnumWin.p_szExeName = _szExeName;
|
||||||
|
stEnumWin.bActionDone = FALSE;
|
||||||
|
|
||||||
|
EnumWindows( EnumWindowProc, (LPARAM)&stEnumWin );
|
||||||
|
return stEnumWin.bActionDone;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,118 @@
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "GlobalData.h"
|
||||||
|
#include "/cpa/public/scr.h"
|
||||||
|
|
||||||
|
#define M_IsTitle (_eAction==SCR_EA_Anl_BeginSection)
|
||||||
|
#define M_IsEnd (_eAction==SCR_EA_Anl_EndSection)
|
||||||
|
#define M_IsBegSubSection (_eAction==SCR_EA_Anl_BeginSubSection)
|
||||||
|
#define M_IsEndSubSection (_eAction==SCR_EA_Anl_EndSubSection)
|
||||||
|
#define M_IsEntry (_eAction==SCR_EA_Anl_Entry)
|
||||||
|
#define M_ActionIs(szActionAsked) (!strcmpi(_p_szName,szActionAsked))
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// Callback function to analyse the section "LevelNames" in game.dsc
|
||||||
|
SCR_tde_Anl_ReturnValue fn_eScriptCallBackFirstLevel(SCR_tdst_File_Description *_p_stFile,char *_p_szName,char *_ap_szParams[],SCR_tde_Anl_Action _eAction)
|
||||||
|
{
|
||||||
|
SCR_tde_Anl_ReturnValue eReturnValue = SCR_ERV_Anl_NormalReturn;
|
||||||
|
|
||||||
|
_p_stFile=_p_stFile;
|
||||||
|
|
||||||
|
if (M_IsTitle)
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.a_csLevelNames.RemoveAll();
|
||||||
|
g_stTheGlobalData.a_csLevelNames.SetSize( 0, 50 );
|
||||||
|
}
|
||||||
|
if (M_IsEntry)
|
||||||
|
{
|
||||||
|
if (M_ActionIs("LevelName"))
|
||||||
|
{
|
||||||
|
char *p_cDelimiter = strchr( _ap_szParams[0], '$' );
|
||||||
|
if( p_cDelimiter ) *p_cDelimiter = 0;
|
||||||
|
g_stTheGlobalData.a_csLevelNames.Add( _ap_szParams[0] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( M_IsEnd )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
return(eReturnValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// Init acp modules for script parsing.
|
||||||
|
|
||||||
|
unsigned long g_SCR_a9MemTable[9] = {0,0,0,0,0,0,0,0,0};
|
||||||
|
|
||||||
|
void fn_vInitScr()
|
||||||
|
{
|
||||||
|
Erm_M_InitErrMsg(Erm);
|
||||||
|
Erm_M_InitErrMsg(Mmg);
|
||||||
|
Mmg_fn_vFirstInitMmgModule(10);
|
||||||
|
|
||||||
|
SCR_fn_v_RdL0_Init();
|
||||||
|
g_SCR_a9MemTable[1] = 1000000;
|
||||||
|
SCR_fn_v_Mem_InitWithMemLevel(g_SCR_a9MemTable);
|
||||||
|
SCR_fn_v_RdL0_RegisterCallback( "FirstLevelDescription", fn_eScriptCallBackFirstLevel, SCR_CRC_c_RdL0_ForSection );
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
void fn_vDesinitScr()
|
||||||
|
{
|
||||||
|
// SCR_fn_v_RdL0_DeleteRegisterCallback( "FirstLevelDescription", SCR_CRC_c_RdL0_ForSection , );
|
||||||
|
SCR_fn_v_RdL0_Close();
|
||||||
|
Mmg_fn_vStopMmgModule();
|
||||||
|
MMG_fn_vDesinitMemoryRasterDeclaration ();
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// Analyse game.dsc
|
||||||
|
BOOL fn_bReadGameDsc()
|
||||||
|
{
|
||||||
|
char szText[1024];
|
||||||
|
char szFileName[512];
|
||||||
|
char szSectionName[512];
|
||||||
|
|
||||||
|
// Compute long name of game.dsc
|
||||||
|
sprintf( szFileName, "%s\\Gamedata\\Game.dsc", (const char *)g_stTheGlobalData.csMainDirectory );
|
||||||
|
|
||||||
|
g_stTheGlobalData.a_cLevelsSelectedForBinarization.RemoveAll();
|
||||||
|
g_stTheGlobalData.a_cBinarizedLevels.RemoveAll();
|
||||||
|
|
||||||
|
// We need read acces on the file
|
||||||
|
if( _access( szFileName, 04 ) == -1 )
|
||||||
|
{
|
||||||
|
sprintf( szText, "Can't read level list: '%s' is not accessible !\n(Does not exist or no read permission)", szFileName );
|
||||||
|
AfxMessageBox( szText, MB_OK | MB_ICONSTOP );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Analyse only the section describing the list of levels
|
||||||
|
sprintf( szSectionName, "%s^FirstLevelDescription", szFileName );
|
||||||
|
SCR_fnp_st_RdL0_AnalyseSection( szSectionName, SCR_CDF_uw_Anl_ForceAnalyse );
|
||||||
|
SCR_fn_v_RdL0_DeleteOpenSection( szSectionName, SCR_CDR_c_RdL0_Match );
|
||||||
|
|
||||||
|
int iSize = g_stTheGlobalData.a_csLevelNames.GetSize();
|
||||||
|
g_stTheGlobalData.a_cLevelsSelectedForBinarization.SetSize( iSize );
|
||||||
|
g_stTheGlobalData.a_cBinarizedLevels.SetSize( iSize );
|
||||||
|
for( iSize--; iSize >= 0; iSize-- )
|
||||||
|
{
|
||||||
|
// clear the list of selected levels.
|
||||||
|
g_stTheGlobalData.a_cLevelsSelectedForBinarization.SetAt( iSize, 0 );
|
||||||
|
// clear the list of binarized levels.
|
||||||
|
g_stTheGlobalData.a_cBinarizedLevels.SetAt( iSize, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// If no level found, print a warning.
|
||||||
|
if( g_stTheGlobalData.a_csLevelNames.GetSize() == 0 )
|
||||||
|
{
|
||||||
|
sprintf( szText, "The list of level in '%s' is empty !", szFileName );
|
||||||
|
AfxMessageBox( szText, MB_OK | MB_ICONEXCLAMATION );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
// stdafx.cpp : source file that includes just the standard includes
|
||||||
|
// BinaryTool.pch will be the pre-compiled header
|
||||||
|
// stdafx.obj will contain the pre-compiled type information
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
|
@ -0,0 +1,230 @@
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
//#include <stdio.h>
|
||||||
|
#include "util.h"
|
||||||
|
#include "GlobalData.h"
|
||||||
|
#include "file.h"
|
||||||
|
#include "Process.h"
|
||||||
|
#include "Threads.h"
|
||||||
|
#include "scripts.h"
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
tdeStatus fn_e_TASK_Binarize( CByteArray &a_cSelectedLevels )
|
||||||
|
{
|
||||||
|
if( ! fn_bCheckFileExistanceInStartupDir( "crb.exe" ) )
|
||||||
|
return STATUS_C_Error;
|
||||||
|
|
||||||
|
// Reset list of binarized levels
|
||||||
|
for( int i=g_stTheGlobalData.a_cBinarizedLevels.GetSize()-1; i>=0; i-- )
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.a_cBinarizedLevels.SetAt( i, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Before binarizing, we disable BigFile for reloc tables,
|
||||||
|
// because user must regenerate it after binarizing
|
||||||
|
fn_vDisableRelocTableBigFile();
|
||||||
|
|
||||||
|
// Start binarization !
|
||||||
|
tdeStatus eStatus = fn_eSpawnThreadAndWaitWithInputEvents( fn_uiThreadBinarize, &a_cSelectedLevels );
|
||||||
|
|
||||||
|
|
||||||
|
if( eStatus == STATUS_C_OK )
|
||||||
|
{
|
||||||
|
// If no error, update startprg.ini
|
||||||
|
// fn_vUpdateStartPrg();
|
||||||
|
fn_vUpdateStartPrg_old();
|
||||||
|
}
|
||||||
|
|
||||||
|
return eStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
tdeStatus fn_e_TASK_TestBinarizedMaps( CByteArray &a_cBinarizedLevels )
|
||||||
|
{
|
||||||
|
CString csOutput, csSequence;
|
||||||
|
BOOL bAllMaps;
|
||||||
|
int iSequenceNumber, iSizeOfSequence;
|
||||||
|
int iNumberOfMap=0, iFirstMap=-1;
|
||||||
|
CString csFileName = g_stTheGlobalData.csMainDirectory + "\\Test.ini";
|
||||||
|
tdeStatus eStatus;
|
||||||
|
|
||||||
|
fn_vOutputLine( "Testing levels...\r\n" );
|
||||||
|
|
||||||
|
bAllMaps = TRUE;
|
||||||
|
iSequenceNumber = 1;
|
||||||
|
iSizeOfSequence = 0;
|
||||||
|
csSequence = "SEQUENCE1=";
|
||||||
|
for( int i=0; i<a_cBinarizedLevels.GetSize(); i++ )
|
||||||
|
{
|
||||||
|
if( a_cBinarizedLevels[i] != 0 )
|
||||||
|
{
|
||||||
|
iNumberOfMap++;
|
||||||
|
if( iFirstMap == -1 )
|
||||||
|
{
|
||||||
|
// Get first map number.
|
||||||
|
iFirstMap = i;
|
||||||
|
|
||||||
|
csOutput = "\t" + g_stTheGlobalData.a_csLevelNames[i] + "\r\n";
|
||||||
|
fn_vOutputLine( csOutput );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Insert level into a sequence (except the first one)
|
||||||
|
if( iSizeOfSequence > 250 )
|
||||||
|
{
|
||||||
|
char szSeq[5];
|
||||||
|
iSequenceNumber ++;
|
||||||
|
iSizeOfSequence = 0;
|
||||||
|
sprintf( szSeq, "%i", iSequenceNumber );
|
||||||
|
csSequence += "\nSEQUENCE";
|
||||||
|
csSequence += szSeq;
|
||||||
|
csSequence += "=";
|
||||||
|
}
|
||||||
|
|
||||||
|
csSequence += g_stTheGlobalData.a_csLevelNames[i] + " ";
|
||||||
|
iSizeOfSequence += g_stTheGlobalData.a_csLevelNames[i].GetLength() + 1;
|
||||||
|
|
||||||
|
csOutput = "\t" + g_stTheGlobalData.a_csLevelNames[i] + "\r\n";
|
||||||
|
fn_vOutputLine( csOutput );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
bAllMaps = FALSE;
|
||||||
|
}
|
||||||
|
csSequence += "\n";
|
||||||
|
|
||||||
|
// if nothing to do...
|
||||||
|
if( iNumberOfMap == 0 )
|
||||||
|
return STATUS_C_OK;
|
||||||
|
|
||||||
|
// if there is only one map, no test.ini
|
||||||
|
if( iNumberOfMap > 1 )
|
||||||
|
{
|
||||||
|
CStdioFile fTestIni;
|
||||||
|
|
||||||
|
// Generate Test.ini
|
||||||
|
if( ! fTestIni.Open( csFileName, CFile::modeWrite | CFile::modeCreate ) )
|
||||||
|
{
|
||||||
|
csOutput = "\tError: Can't create '" + csFileName + "'";
|
||||||
|
fn_vOutputLine( csOutput );
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( bAllMaps )
|
||||||
|
fTestIni.WriteString( "[TEST]\nMODE=ALLMAPSONLY\nWAITMIN=35\nWAITMAX=45\nWITHRESTART=0\nSTAT=1\n" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fTestIni.WriteString( "[TEST]\nMODE=SEQUENCE\nWAITMIN=35\nWAITMAX=45\nWITHRESTART=0\nSTAT=1\n" );
|
||||||
|
fTestIni.WriteString( csSequence );
|
||||||
|
}
|
||||||
|
|
||||||
|
fTestIni.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
char szExe[512];
|
||||||
|
char szCommandLine[128];
|
||||||
|
|
||||||
|
sprintf( szExe, "%s\\%s", g_stTheGlobalData.csMainDirectory, g_stTheGlobalData.csExeName );
|
||||||
|
sprintf( szCommandLine, "%s -level:%s", szExe, g_stTheGlobalData.a_csLevelNames[iFirstMap] );
|
||||||
|
|
||||||
|
eStatus = fn_eSpawnAndWaitForProcessWithInputEvents( szExe, szCommandLine );
|
||||||
|
|
||||||
|
if( iNumberOfMap > 1 )
|
||||||
|
DeleteFile( csFileName );
|
||||||
|
|
||||||
|
if( eStatus == STATUS_C_OK )
|
||||||
|
{
|
||||||
|
fn_vOutputLine( "\tTest is sucessful !\r\n\r\n" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fn_vOutputLine( "\r\n" );
|
||||||
|
}
|
||||||
|
|
||||||
|
return eStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
tdeStatus fn_e_TASK_Version()
|
||||||
|
{
|
||||||
|
char szExeName[512];
|
||||||
|
char szCommandLine[1024];
|
||||||
|
int i;
|
||||||
|
tdeStatus eStatus = STATUS_C_OK;
|
||||||
|
|
||||||
|
fn_vOutputLine( "\r\n* * Making version * * * * * * * * * * * * * * * \r\n" );
|
||||||
|
|
||||||
|
if( ! fn_bCheckFileExistanceInStartupDir( "rm2sndparser.exe" )
|
||||||
|
|| ! fn_bCheckFileExistanceInStartupDir( "convimg.exe" )
|
||||||
|
|| ! fn_bCheckFileExistanceInStartupDir( "concat.exe" )
|
||||||
|
|| ! fn_bCheckFileExistanceInStartupDir( "crb.exe" ) )
|
||||||
|
return STATUS_C_Error;
|
||||||
|
|
||||||
|
if( ! fn_bValidateMainDirectorySetting() )
|
||||||
|
return STATUS_C_Error;
|
||||||
|
|
||||||
|
if( ! fn_bValidateBinDirectorySetting() )
|
||||||
|
return STATUS_C_Error;
|
||||||
|
|
||||||
|
if( ! fn_bValidateGameExeSetting() )
|
||||||
|
return STATUS_C_Error;
|
||||||
|
|
||||||
|
// Select all levels for binarization.
|
||||||
|
int iSize = g_stTheGlobalData.a_csLevelNames.GetSize();
|
||||||
|
for( i=0; i<iSize; i++ )
|
||||||
|
{
|
||||||
|
g_stTheGlobalData.a_cLevelsSelectedForBinarization.SetAt( i, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now it's time to make the sound banks.
|
||||||
|
fn_vOutputLine( "Making sound banks...\r\n" );
|
||||||
|
sprintf( szExeName, "%s\\rm2SndParser.exe", (LPCTSTR)g_stTheGlobalData.csStartupDirectory );
|
||||||
|
|
||||||
|
fn_vMakeSndParserCommandLine( szCommandLine );
|
||||||
|
strcat( szCommandLine, " -ParseAllMaps -ParseFix -GenerateBanks" );
|
||||||
|
|
||||||
|
eStatus = fn_eSpawnAndWaitForProcessWithInputEvents( szExeName, szCommandLine );
|
||||||
|
if( eStatus != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
|
||||||
|
// Then, we copy the sound directory
|
||||||
|
eStatus = fn_eSpawnThreadAndWaitWithInputEvents( fn_uiThreadCopySoundDirectory, NULL );
|
||||||
|
|
||||||
|
if( eStatus != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
|
||||||
|
// Texture time...
|
||||||
|
eStatus = fn_eSpawnThreadAndWaitWithInputEvents(
|
||||||
|
fn_uiThreadMakeBigFileTextures,
|
||||||
|
(void *)(LPCTSTR)g_stTheGlobalData.csTempTextureDirectory );
|
||||||
|
|
||||||
|
if( eStatus != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
|
||||||
|
|
||||||
|
// Now we binarize all levels.
|
||||||
|
eStatus = fn_e_TASK_Binarize( g_stTheGlobalData.a_cLevelsSelectedForBinarization );
|
||||||
|
if( eStatus != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
|
||||||
|
// Now we test the binarized maps.
|
||||||
|
if( g_stTheGlobalData.bAutoTestMaps )
|
||||||
|
{
|
||||||
|
fn_e_TASK_TestBinarizedMaps( g_stTheGlobalData.a_cBinarizedLevels );
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_C_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -0,0 +1,111 @@
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include <io.h>
|
||||||
|
#include "util.h"
|
||||||
|
#include "file.h"
|
||||||
|
#include "process.h"
|
||||||
|
#include "globaldata.h"
|
||||||
|
|
||||||
|
|
||||||
|
UINT fn_uiThreadAnims( LPVOID _p_vParam )
|
||||||
|
{
|
||||||
|
BOOL bOptimizedAnims;
|
||||||
|
HANDLE hFindhandle;
|
||||||
|
WIN32_FIND_DATA stFindData;
|
||||||
|
CString csFind;
|
||||||
|
tdeStatus eStatus;
|
||||||
|
char szMakeAnimExeName[512];
|
||||||
|
char szMakeAnimCommandLine[512];
|
||||||
|
char szTblName[512];
|
||||||
|
int iNbProcesses = 0;
|
||||||
|
PROCESS_INFORMATION a2_stMakeanimProcesses[2];
|
||||||
|
const char *a_szProcessNames[] = { "Makeanim", "Makeanim" };
|
||||||
|
int iWaitReturn;
|
||||||
|
|
||||||
|
|
||||||
|
bOptimizedAnims = *(BOOL *)_p_vParam;
|
||||||
|
|
||||||
|
fn_vOutputLine( "Making all anims...\r\n" );
|
||||||
|
|
||||||
|
sprintf( szMakeAnimExeName, "%s\\makeanim.exe", (LPCTSTR)g_stTheGlobalData.csMainDirectory );
|
||||||
|
|
||||||
|
// No families found, nothing to do...
|
||||||
|
csFind = g_stTheGlobalData.csMainDirectory + "\\Gamedata\\World\\Levels\\_Common\\Families\\*.*";
|
||||||
|
if( (hFindhandle = FindFirstFile( csFind, &stFindData )) == INVALID_HANDLE_VALUE )
|
||||||
|
return STATUS_C_OK;
|
||||||
|
|
||||||
|
// For each family in gamedata, we execute makeanim on it.
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// Skip . and ..
|
||||||
|
if( (stFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||||
|
&& ( (strcmp( stFindData.cFileName, ".") == 0)
|
||||||
|
|| strcmp( stFindData.cFileName, "..") == 0) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if( (stFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
|
||||||
|
{
|
||||||
|
csFind = "\t";
|
||||||
|
csFind += stFindData.cFileName;
|
||||||
|
csFind += "\r\n";
|
||||||
|
fn_vOutputLine( csFind );
|
||||||
|
for( int i=0; i<g_stTheGlobalData.a_csVersionDirectories.GetSize(); i++ )
|
||||||
|
{
|
||||||
|
sprintf(
|
||||||
|
szTblName,
|
||||||
|
"%s\\%s\\World\\Levels\\_Common\\Families\\%s\\%s.tbl",
|
||||||
|
(LPCTSTR)g_stTheGlobalData.csMainDirectory,
|
||||||
|
(LPCTSTR)g_stTheGlobalData.a_csVersionDirectories[i],
|
||||||
|
stFindData.cFileName,
|
||||||
|
stFindData.cFileName );
|
||||||
|
|
||||||
|
if( GetFileAttributes( szTblName ) != 0xffffffff )
|
||||||
|
{
|
||||||
|
if( bOptimizedAnims )
|
||||||
|
sprintf( szMakeAnimCommandLine, "Makeanim.exe -z -b %s", stFindData.cFileName );
|
||||||
|
else
|
||||||
|
sprintf( szMakeAnimCommandLine, "Makeanim.exe -b %s", stFindData.cFileName );
|
||||||
|
|
||||||
|
// Spawn process Makeanim
|
||||||
|
if( ! fn_bSpawnProcess( szMakeAnimExeName, szMakeAnimCommandLine, &a2_stMakeanimProcesses[iNbProcesses] ) )
|
||||||
|
{
|
||||||
|
FindClose( hFindhandle );
|
||||||
|
AfxEndThread( STATUS_C_Error );
|
||||||
|
}
|
||||||
|
|
||||||
|
// increment spawned process count
|
||||||
|
iNbProcesses++;
|
||||||
|
|
||||||
|
// If we have 2 processes running, wait for end of one of them.
|
||||||
|
if( iNbProcesses > 1 )
|
||||||
|
{
|
||||||
|
if( (eStatus =
|
||||||
|
fn_eWaitForMultipleProcesses( iNbProcesses, a2_stMakeanimProcesses, a_szProcessNames, &iWaitReturn ) )
|
||||||
|
!= STATUS_C_OK )
|
||||||
|
{
|
||||||
|
FindClose( hFindhandle );
|
||||||
|
AfxEndThread( eStatus );
|
||||||
|
}
|
||||||
|
iNbProcesses--;
|
||||||
|
if( iWaitReturn == 0 )
|
||||||
|
{
|
||||||
|
a2_stMakeanimProcesses[0] = a2_stMakeanimProcesses[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} while( FindNextFile( hFindhandle, &stFindData ) );
|
||||||
|
|
||||||
|
FindClose( hFindhandle );
|
||||||
|
|
||||||
|
fn_vOutputLine( "\tMakeAnim complete !\r\n" );
|
||||||
|
|
||||||
|
AfxEndThread( STATUS_C_OK );
|
||||||
|
return STATUS_C_OK;
|
||||||
|
}
|
|
@ -0,0 +1,215 @@
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "GlobalData.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "file.h"
|
||||||
|
#include "process.h"
|
||||||
|
|
||||||
|
// Timeout is 10 min for engine
|
||||||
|
#define C_TimeOutForEngine (1000 * 60 * 10)
|
||||||
|
//#define C_TimeOutForEngine (1000 * 15)
|
||||||
|
// Timeout is 1 min for crb
|
||||||
|
#define C_TimeOutForCRB (1000 * 60 * 1)
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
tdeStatus fn_eBinarizeOneLevel( CString _csLevelName, BOOL _bTakeCareOfFix )
|
||||||
|
{
|
||||||
|
char szExe[512];
|
||||||
|
char szCommandLine[512];
|
||||||
|
tdeStatus eStatus;
|
||||||
|
tdstCopyFileContext stCopyContext;
|
||||||
|
CString csOutput;
|
||||||
|
|
||||||
|
csOutput = "Starting binarize level '" + _csLevelName + "'\r\n";
|
||||||
|
fn_vOutputLine( csOutput );
|
||||||
|
|
||||||
|
// Will be used by fn_bTreatArrayOfFiles
|
||||||
|
stCopyContext.csMainDirectory = g_stTheGlobalData.csMainDirectory;
|
||||||
|
stCopyContext.csBinDirectory = g_stTheGlobalData.csBinDirectory;
|
||||||
|
stCopyContext.csLevelName = _csLevelName;
|
||||||
|
|
||||||
|
// Clean main directory and bin level directory
|
||||||
|
if( (eStatus = fn_eTreatArrayOfFiles( g_a_szFilesBeforeBinarize, &stCopyContext )) != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
|
||||||
|
csOutput = "\tFirst pass for " + g_stTheGlobalData.csExeName + "\r\n";
|
||||||
|
fn_vOutputLine( csOutput );
|
||||||
|
|
||||||
|
sprintf( szExe, "%s\\%s", (const char *)g_stTheGlobalData.csMainDirectory, (const char *)g_stTheGlobalData.csExeName );
|
||||||
|
sprintf(
|
||||||
|
szCommandLine,
|
||||||
|
"%s -bin:2 -dsc:2 -mem:2 -level:%s",
|
||||||
|
(const char *)g_stTheGlobalData.csExeName,
|
||||||
|
(const char *)_csLevelName );
|
||||||
|
|
||||||
|
// First pass for engine
|
||||||
|
// Wait for end of engine or for user break.
|
||||||
|
eStatus = fn_eSpawnAndWaitForProcessWithTimeout( szExe, szCommandLine, C_TimeOutForEngine );
|
||||||
|
|
||||||
|
if( eStatus != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
|
||||||
|
// Here, everything went ok, so we continue.
|
||||||
|
|
||||||
|
// fn_vOutputLine( "\tCopying binarized files from first pass\r\n" );
|
||||||
|
if( (eStatus = fn_eTreatArrayOfFiles( g_a_szFilesAfterFirstPass, &stCopyContext )) != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
|
||||||
|
// Second pass for engine.
|
||||||
|
csOutput = "\tSecond pass for " + g_stTheGlobalData.csExeName + "\r\n";
|
||||||
|
fn_vOutputLine( csOutput );
|
||||||
|
|
||||||
|
sprintf(
|
||||||
|
szCommandLine,
|
||||||
|
"%s -bin:2 -dsc:2 -mem:3 -level:%s",
|
||||||
|
(const char *)g_stTheGlobalData.csExeName,
|
||||||
|
(const char *)_csLevelName );
|
||||||
|
|
||||||
|
if( (eStatus = fn_eSpawnAndWaitForProcessWithTimeout( szExe, szCommandLine, C_TimeOutForEngine )) != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
|
||||||
|
// fn_vOutputLine( "\tCopying binarized files from second pass\r\n" );
|
||||||
|
if( (eStatus = fn_eTreatArrayOfFiles( g_a_szFilesAfterSecondPass, &stCopyContext )) != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
|
||||||
|
if( _bTakeCareOfFix )
|
||||||
|
{
|
||||||
|
// Now, execute CRB on fix.
|
||||||
|
fn_vOutputLine( "\tBuild relocation table for Fix\r\n" );
|
||||||
|
sprintf( szExe, "%s\\crb.exe", (const char *)g_stTheGlobalData.csMainDirectory );
|
||||||
|
if( (eStatus = fn_eSpawnAndWaitForProcessWithTimeout( szExe, "crb.exe FIX -s", C_TimeOutForCRB )) != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
|
||||||
|
// fn_vOutputLine( "\tCopying fix files to bin directory\r\n" );
|
||||||
|
if( (eStatus = fn_eTreatArrayOfFiles( g_a_szFixFilesAfterCRB, &stCopyContext )) != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( (eStatus = fn_eTreatArrayOfFiles( g_a_szDeleteFixFilesAfterCRB, &stCopyContext )) != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now, execute CRB on level.
|
||||||
|
fn_vOutputLine( "\tBuild relocation table for Level\r\n" );
|
||||||
|
sprintf( szExe, "%s\\crb.exe", (const char *)g_stTheGlobalData.csMainDirectory );
|
||||||
|
sprintf( szCommandLine, "crb.exe %s -s", (const char *)_csLevelName );
|
||||||
|
if( (eStatus = fn_eSpawnAndWaitForProcessWithTimeout( szExe, szCommandLine, C_TimeOutForCRB )) != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
|
||||||
|
// fn_vOutputLine( "\tCopying level files to bin directory\r\n" );
|
||||||
|
if( (eStatus = fn_eTreatArrayOfFiles( g_a_szLevelFilesAfterCRB, &stCopyContext )) != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
|
||||||
|
if( (eStatus = fn_eTreatArrayOfFiles( g_a_szDeleteFilesAfterBinarize, &stCopyContext )) != STATUS_C_OK )
|
||||||
|
return eStatus;
|
||||||
|
|
||||||
|
csOutput = "\tBinarization is finished for level '" + _csLevelName + "'\r\n\r\n";
|
||||||
|
fn_vOutputLine( csOutput );
|
||||||
|
return STATUS_C_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// Thread for binarization ;
|
||||||
|
// Launch MainWinX two times (with different parameters)
|
||||||
|
// then execute crb two times
|
||||||
|
// then move binary files to destination directory.
|
||||||
|
UINT fn_uiThreadBinarize( LPVOID _p_stParam )
|
||||||
|
{
|
||||||
|
CByteArray *p_oSelectedLevels = (CByteArray *)_p_stParam;
|
||||||
|
CString csOutput;
|
||||||
|
tdeStatus eBinarizationOK;
|
||||||
|
BOOL bALevelHasBeenSkipped = FALSE;
|
||||||
|
BOOL bALevelWasBinarizedOK = FALSE;
|
||||||
|
tdstCopyFileContext stCopyContext;
|
||||||
|
BOOL bTakeCareOfFix = TRUE;
|
||||||
|
|
||||||
|
|
||||||
|
fn_vOutputLine( "\r\n=== New binarization task =======================\r\n" );
|
||||||
|
|
||||||
|
stCopyContext.csMainDirectory = g_stTheGlobalData.csMainDirectory;
|
||||||
|
stCopyContext.csBinDirectory = g_stTheGlobalData.csBinDirectory;
|
||||||
|
stCopyContext.csLevelName = "";
|
||||||
|
|
||||||
|
if( ! g_stTheGlobalData.bCommonFilesAreCopied )
|
||||||
|
{
|
||||||
|
if( (eBinarizationOK = fn_eTreatArrayOfFiles( g_a_szCommonFiles, &stCopyContext )) != STATUS_C_OK )
|
||||||
|
return eBinarizationOK;
|
||||||
|
g_stTheGlobalData.bCommonFilesAreCopied = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for( int i=0; i<p_oSelectedLevels->GetSize(); i++ )
|
||||||
|
{
|
||||||
|
// if level is not selected for binarization, go to next one.
|
||||||
|
if( (*p_oSelectedLevels)[i] == 0 )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
|
||||||
|
eBinarizationOK = fn_eBinarizeOneLevel( g_stTheGlobalData.a_csLevelNames[i], bTakeCareOfFix );
|
||||||
|
|
||||||
|
// We build reloc tables for fix for first level only.
|
||||||
|
if( eBinarizationOK == STATUS_C_OK )
|
||||||
|
bTakeCareOfFix = FALSE;
|
||||||
|
|
||||||
|
// if an error accured during binarization,
|
||||||
|
// test if we have to continue with binarization.
|
||||||
|
if( eBinarizationOK != STATUS_C_OK )
|
||||||
|
{
|
||||||
|
if( eBinarizationOK == STATUS_C_UserBreak )
|
||||||
|
{
|
||||||
|
fn_vOutputLine( "\tBinarization aborted by user.\r\n\r\n\r\n" );
|
||||||
|
// If we don't continue, exit binarization processs.
|
||||||
|
AfxEndThread( (UINT)STATUS_C_UserBreak );
|
||||||
|
}
|
||||||
|
else // eBinarizationOK == STATUS_C_Error
|
||||||
|
{
|
||||||
|
if( g_stTheGlobalData.bStopBinarizeOnError )
|
||||||
|
{
|
||||||
|
fn_vOutputLine( "\r\nBinarization aborted.\r\n\r\n\r\n" );
|
||||||
|
// If we don't continue, exit binarization processs.
|
||||||
|
AfxEndThread( (UINT)STATUS_C_Error );
|
||||||
|
}
|
||||||
|
// Else, go with next level.
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fn_vOutputLine( "\tSkipping level....\r\n" );
|
||||||
|
bALevelHasBeenSkipped = TRUE;
|
||||||
|
// Before we go for next level, wait for a few moments
|
||||||
|
// to allow program to terminate.
|
||||||
|
SleepEx( 1250, FALSE );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // eBinarizationOK == STATUS_C_OK
|
||||||
|
{
|
||||||
|
// Level was binarized, we deselect it.
|
||||||
|
p_oSelectedLevels->SetAt( i, 0 );
|
||||||
|
|
||||||
|
// and we add it to the list of binarized levels
|
||||||
|
g_stTheGlobalData.a_cBinarizedLevels.SetAt( i, 1 );
|
||||||
|
|
||||||
|
bALevelWasBinarizedOK = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn_vOutputLine( "\r\n" );
|
||||||
|
} // End for each level
|
||||||
|
|
||||||
|
if( bALevelHasBeenSkipped )
|
||||||
|
{
|
||||||
|
fn_vOutputLine( "\r\nWarning : At least one level was not binarized because of errors.\r\n" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fn_vOutputLine( "\r\nThe binarization is successful !.\r\n" );
|
||||||
|
}
|
||||||
|
|
||||||
|
fn_vOutputLine( "\r\n" );
|
||||||
|
|
||||||
|
if( bALevelWasBinarizedOK )
|
||||||
|
return (UINT)STATUS_C_OK;
|
||||||
|
else
|
||||||
|
return STATUS_C_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue