Add rayman2 source files
This commit is contained in:
238
Rayman_X/cpa/Appli/BinaryTool/BinaryTool.dsp
Normal file
238
Rayman_X/cpa/Appli/BinaryTool/BinaryTool.dsp
Normal file
@@ -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
|
29
Rayman_X/cpa/Appli/BinaryTool/BinaryTool.dsw
Normal file
29
Rayman_X/cpa/Appli/BinaryTool/BinaryTool.dsw
Normal file
@@ -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>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
12
Rayman_X/cpa/Appli/BinaryTool/GIData.ini
Normal file
12
Rayman_X/cpa/Appli/BinaryTool/GIData.ini
Normal file
@@ -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
|
34
Rayman_X/cpa/Appli/BinaryTool/inc/Anims.h
Normal file
34
Rayman_X/cpa/Appli/BinaryTool/inc/Anims.h
Normal file
@@ -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
|
64
Rayman_X/cpa/Appli/BinaryTool/inc/Binary.h
Normal file
64
Rayman_X/cpa/Appli/BinaryTool/inc/Binary.h
Normal file
@@ -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
|
BIN
Rayman_X/cpa/Appli/BinaryTool/inc/BinaryTool.aps
Normal file
BIN
Rayman_X/cpa/Appli/BinaryTool/inc/BinaryTool.aps
Normal file
Binary file not shown.
50
Rayman_X/cpa/Appli/BinaryTool/inc/BinaryTool.h
Normal file
50
Rayman_X/cpa/Appli/BinaryTool/inc/BinaryTool.h
Normal file
@@ -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_)
|
195
Rayman_X/cpa/Appli/BinaryTool/inc/BinaryTool.rc
Normal file
195
Rayman_X/cpa/Appli/BinaryTool/inc/BinaryTool.rc
Normal file
@@ -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
|
||||
|
262
Rayman_X/cpa/Appli/BinaryTool/inc/DlgMain.h
Normal file
262
Rayman_X/cpa/Appli/BinaryTool/inc/DlgMain.h
Normal file
@@ -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_)
|
47
Rayman_X/cpa/Appli/BinaryTool/inc/DlgWarning.h
Normal file
47
Rayman_X/cpa/Appli/BinaryTool/inc/DlgWarning.h
Normal file
@@ -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__*/
|
35
Rayman_X/cpa/Appli/BinaryTool/inc/GIItem.h
Normal file
35
Rayman_X/cpa/Appli/BinaryTool/inc/GIItem.h
Normal file
@@ -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__
|
36
Rayman_X/cpa/Appli/BinaryTool/inc/GIType.h
Normal file
36
Rayman_X/cpa/Appli/BinaryTool/inc/GIType.h
Normal file
@@ -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__
|
136
Rayman_X/cpa/Appli/BinaryTool/inc/IniData.h
Normal file
136
Rayman_X/cpa/Appli/BinaryTool/inc/IniData.h
Normal file
@@ -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__
|
79
Rayman_X/cpa/Appli/BinaryTool/inc/Levels.h
Normal file
79
Rayman_X/cpa/Appli/BinaryTool/inc/Levels.h
Normal file
@@ -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
|
57
Rayman_X/cpa/Appli/BinaryTool/inc/MainFrm.h
Normal file
57
Rayman_X/cpa/Appli/BinaryTool/inc/MainFrm.h
Normal file
@@ -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_)
|
25
Rayman_X/cpa/Appli/BinaryTool/inc/Print.h
Normal file
25
Rayman_X/cpa/Appli/BinaryTool/inc/Print.h
Normal file
@@ -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
|
84
Rayman_X/cpa/Appli/BinaryTool/inc/Resource.h
Normal file
84
Rayman_X/cpa/Appli/BinaryTool/inc/Resource.h
Normal file
@@ -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
|
26
Rayman_X/cpa/Appli/BinaryTool/inc/StdAfx.h
Normal file
26
Rayman_X/cpa/Appli/BinaryTool/inc/StdAfx.h
Normal file
@@ -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_)
|
159
Rayman_X/cpa/Appli/BinaryTool/inc/l_global_v6.h
Normal file
159
Rayman_X/cpa/Appli/BinaryTool/inc/l_global_v6.h
Normal file
@@ -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
|
25
Rayman_X/cpa/Appli/BinaryTool/inc/makeanim.h
Normal file
25
Rayman_X/cpa/Appli/BinaryTool/inc/makeanim.h
Normal file
@@ -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
|
5
Rayman_X/cpa/Appli/BinaryTool/mssccprj.scc
Normal file
5
Rayman_X/cpa/Appli/BinaryTool/mssccprj.scc
Normal file
@@ -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
|
BIN
Rayman_X/cpa/Appli/BinaryTool/res/GraphInter.ico
Normal file
BIN
Rayman_X/cpa/Appli/BinaryTool/res/GraphInter.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
162
Rayman_X/cpa/Appli/BinaryTool/src/Anims.cpp
Normal file
162
Rayman_X/cpa/Appli/BinaryTool/src/Anims.cpp
Normal file
@@ -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;
|
||||
}
|
1073
Rayman_X/cpa/Appli/BinaryTool/src/Binary.cpp
Normal file
1073
Rayman_X/cpa/Appli/BinaryTool/src/Binary.cpp
Normal file
File diff suppressed because it is too large
Load Diff
224
Rayman_X/cpa/Appli/BinaryTool/src/BinaryTool.cpp
Normal file
224
Rayman_X/cpa/Appli/BinaryTool/src/BinaryTool.cpp
Normal file
@@ -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
|
4544
Rayman_X/cpa/Appli/BinaryTool/src/DlgMain.cpp
Normal file
4544
Rayman_X/cpa/Appli/BinaryTool/src/DlgMain.cpp
Normal file
File diff suppressed because it is too large
Load Diff
83
Rayman_X/cpa/Appli/BinaryTool/src/DlgWarning.cpp
Normal file
83
Rayman_X/cpa/Appli/BinaryTool/src/DlgWarning.cpp
Normal file
@@ -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();
|
||||
}
|
||||
|
||||
|
28
Rayman_X/cpa/Appli/BinaryTool/src/GIItem.cpp
Normal file
28
Rayman_X/cpa/Appli/BinaryTool/src/GIItem.cpp
Normal file
@@ -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()
|
||||
{
|
||||
}
|
28
Rayman_X/cpa/Appli/BinaryTool/src/GIType.cpp
Normal file
28
Rayman_X/cpa/Appli/BinaryTool/src/GIType.cpp
Normal file
@@ -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()
|
||||
{
|
||||
}
|
744
Rayman_X/cpa/Appli/BinaryTool/src/IniData.cpp
Normal file
744
Rayman_X/cpa/Appli/BinaryTool/src/IniData.cpp
Normal file
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
566
Rayman_X/cpa/Appli/BinaryTool/src/Levels.cpp
Normal file
566
Rayman_X/cpa/Appli/BinaryTool/src/Levels.cpp
Normal file
@@ -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;
|
||||
}
|
||||
|
||||
|
107
Rayman_X/cpa/Appli/BinaryTool/src/MainFrm.cpp
Normal file
107
Rayman_X/cpa/Appli/BinaryTool/src/MainFrm.cpp
Normal file
@@ -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
|
6
Rayman_X/cpa/Appli/BinaryTool/src/StdAfx.cpp
Normal file
6
Rayman_X/cpa/Appli/BinaryTool/src/StdAfx.cpp
Normal file
@@ -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"
|
||||
|
250
Rayman_X/cpa/Appli/BinaryTool/src/l_global_v6.cpp
Normal file
250
Rayman_X/cpa/Appli/BinaryTool/src/l_global_v6.cpp
Normal file
@@ -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
|
197
Rayman_X/cpa/Appli/BinaryTool/src/makeanim.cpp
Normal file
197
Rayman_X/cpa/Appli/BinaryTool/src/makeanim.cpp
Normal file
@@ -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
|
Reference in New Issue
Block a user