Add rayman2 source files

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

View File

@@ -0,0 +1,150 @@
#if !defined(__RND_ERR_H_)
#define __RND_ERR_H_
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
#include "RND_Ver.h"
/***************************************/
/**** Error macros (using ACPerror) ****/
/***************************************/
#define M_RNDFatalError(ErrorNum) \
{ \
if (ErrorNum>E_uwRNDFatalErr&&ErrorNum<E_uwRNDStartOfWarning) \
{ \
Erm_M_ClearLastError(C_ucErmDefaultChannel);\
Erm_M_UpdateLastError(RND,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
} \
else \
{ \
Erm_M_ClearLastError(C_ucErmDefaultChannel);\
Erm_M_UpdateLastError(RND,C_ucErmDefaultChannel,E_uwRNDFatalErrorNotAFatalError,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
} \
}
#define M_RNDInformationError(ErrorNum) \
{ \
if (ErrorNum>E_uwRNDStartOfInformationWarning&&ErrorNum<E_uwRNDErrNumber) \
{ \
Erm_M_UpdateLastError(RND,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmNoOpenInfoWindow,C_ucNeverStopForDebug, NULL);\
Erm_M_ClearLastError(C_ucErmDefaultChannel);\
} \
else \
{ \
M_RNDFatalError(E_uwRNDInformationErrorIsNotAInformationError); \
} \
}
#define M_RNDWarningError(ErrorNum) \
{ \
if (ErrorNum>E_uwRNDStartOfWarning&&ErrorNum<E_uwRNDStartOfInformationWarning) \
{ \
Erm_M_UpdateLastError(RND,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
} \
else \
{ \
M_RNDFatalError(E_uwRNDWarningErrorIsNotAWarningError); \
} \
}
#define __FATAL_ERR_INPUT__
#define __INFORMATION_ERR_INPUT__ /**** Treat as a level 1 warning ****/
#define __WARNING_ERR_INPUT__ /**** Treat as a level 2 warning ****/
enum e_uwRNDErrNumber
{
E_uwRNDFatalErr,
#if defined(__FATAL_ERR_INPUT__)
/**** Error's errors ****/
E_uwRNDFatalErrorNotAFatalError,
E_uwRNDInformationErrorIsNotAInformationError,
E_uwRNDWarningErrorIsNotAWarningError,
/**** Script's errors ****/
E_uwRNDScriptBadNumberOfArg,
/**** Random's errors ****/
E_uwRNDIncreaseRND_C_MaxIndex,
E_uwRNDHandleNotAllowed,
#endif /*__FATAL_ERR_INPUT__*/
E_uwRNDStartOfWarning,
#if defined(__WARNING_ERR_INPUT__)
#endif /*__WARNING_ERR_INPUT__*/
E_uwRNDStartOfInformationWarning,
#if defined(__INFORMATION_ERR_INPUT__)
#endif /*__INFORMATION_ERR_INPUT__*/
E_uwRNDErrNumber,
};
/*------------------*/
/* Global Variables*/
/*------------------*/
#undef EXTERN
#undef extern
#undef LOCAL
#if !defined(D_RND_Input_VariableDefine)
#define EXTERN extern /*external declaration*/
#define LOCAL /*replace by nothing : we have to declare*/
#else /* D_RND_Input_VariableDefine */
#define EXTERN /*replace by nothing : we have to declare*/
#define LOCAL /*replace by nothing : we have to declare*/
#endif /* D_RND_Input_VariableDefine */
EXTERN unsigned char g_ucRNDModuleId /* number of identification of the Game module*/
#if defined(D_RND_Input_VariableDefine)
= C_ucModuleNotInitialized
#endif /* D_RND_Input_VariableDefine */
;
#if defined(__ERROR_STRINGS__)
EXTERN CPA_EXPORT char * g_a_szRNDInformationModule []
#if defined(D_RND_Input_VariableDefine) && !defined(CPA_WANTS_IMPORT)
= {C_szRNDVersion, C_szRNDFullName, C_szRNDDate}
#endif /* D_RND_Input_VariableDefine && CPA_WANTS_IMPORT */
;
EXTERN char * g_szRNDModuleName /* Obliged syntax 'sz'+[Abbreviation of ModuleName]+'ModuleName'*/
#if defined(D_RND_Input_VariableDefine)
= {"Input"}
#endif /* D_RND_Input_VariableDefine */
;
EXTERN tdstErrorMsg g_a_stRNDTabErr[] /* Obliged syntax 'a_sz'+[Abbreviation of ModuleName]+'TabErr'*/
#if defined(D_RND_Input_VariableDefine)
=
{
#if defined(__FATAL_ERR_INPUT__)
/**** Error's errors ****/
E_uwRNDFatalErrorNotAFatalError,"M_RNDFatalError : Try to raise a warning or an information",
E_uwRNDInformationErrorIsNotAInformationError,"M_RNDInformationError : Try to raise a fatal or a warning",
E_uwRNDWarningErrorIsNotAWarningError,"M_RNDWarningError : Try to raise a fatal or a information",
/**** Script's errors ****/
E_uwRNDScriptBadNumberOfArg,"Bad number of argument",
/**** Random's errors ****/
E_uwRNDIncreaseRND_C_MaxIndex,"fn_hReserveAnNewHandleIndex : Increase the max number of handle (RND_C_MaxIndex)",
E_uwRNDHandleNotAllowed,"fn_hReserveAnNewHandleIndex : Increase the max number of handle (RND_C_MaxIndex)",
#endif /*__FATAL_ERR_INPUT__*/
#ifdef __WARNING_ERR_INPUT__
#endif /*__WARNING_ERR_INPUT__*/
#ifdef __INFORMATION_ERR_INPUT__
#endif /*__INFORMATION_ERR_INPUT__*/
0xffff,"\0"/*fin*/
}
#endif /* D_RND_Input_VariableDefine */
;
#endif /* __ERROR_STRINGS__ */
#undef EXTERN
#undef extern
#endif /* !__RND_ERR_H_ */

View File

@@ -0,0 +1,37 @@
#ifndef __RND_MEM_H__
#define __RND_MEM_H__
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
enum e_ucRNDStaticBlocks
{
E_ucRNDMemoryBlock,
E_ucRNDMaxBlocksNb
};
#undef EXTERN
#undef extern
#if !defined(D_RND_Input_VariableDefine)
#define EXTERN extern
#else
#define EXTERN
#endif /* D_RND_Input_VariableDefine */
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
EXTERN tdstBlockInfo g_a_stRNDBlocksInfo[E_ucRNDMaxBlocksNb];
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
#ifdef __DYNAMIC_MALLOC_ALLOWED__
#ifdef __DEBUG_MALLOC_MODE__
EXTERN tdstDynInfo g_stRNDDynInfo;
#endif /* __DEBUG_MALLOC_MODE__ */
#endif /* __DYNAMIC_MALLOC_ALLOWED__ */
#undef EXTERN
#undef extern
#endif /* __RND_MEM_H__ */

View File

@@ -0,0 +1,36 @@
#if !defined(__RND_CPA_H__)
#define __RND_CPA_H__
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
/****************************************
* Here is the list of disabled WARNING *
****************************************/
#if defined(VISUAL)
#pragma warning(disable:4010) /** single-line comment contains line-continuation character **/
#pragma warning(disable:4115) /** named type definition in parentheses **/
#pragma warning(disable:4127) /** conditional expression is constant **/
#pragma warning(disable:4201) /** nonstandard extension used : nameless struct/union **/
#pragma warning(disable:4214) /** nonstandard extension used : bit field types other than int **/
#pragma warning(disable:4514) /** unreferenced inline function has been removed **/
#pragma warning(disable:4711) /** selected for automatic inline expansion **/
#endif /*VISUAL*/
#if defined (WIN32)
#include "wtypes.h"
#include "winuser.h"
#include "string.h"
#endif /* WIN32 */
#include "ACP_Base.h"
#include "SCR.h"
#include "MTH.h"
#include "MMG.h"
#include "ERM.h"
#endif /* __RND_CPA_H__ */

View File

@@ -0,0 +1,75 @@
/*=========================================================================
* RND_Main.c :
* Variables declaration and init function
*
* (c) Ubi Studios 1997
*=======================================================================*/
#if !defined (__RND_Main_H__)
#define __RND_Main_H__
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
/****************************************/
#if !defined(CPA_EXPORT)
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif /*CPA_WANTS_IMPORT || CPA_WANTS_EXPORT*/
#endif /*CPA_EXPORT*/
/****************************************/
typedef unsigned long RND_tdxHandleToRandomIndex;
#undef EXTERN
#undef extern
#if !defined(D_RND_Input_VariableDefine)
#define EXTERN extern
#else
#define EXTERN
#endif /* D_RND_Input_VariableDefine*/
#if defined (__cplusplus)
extern "C"
{
#endif /* __cplusplus */
extern CPA_EXPORT void RND_fn_vFirstInitRandom(void);
extern CPA_EXPORT void RND_fn_vInitRandom(void);
extern CPA_EXPORT void RND_fn_vDesinitRandom(void);
extern CPA_EXPORT void RND_PrintUsedStaticMemory(void);
extern CPA_EXPORT RND_tdxHandleToRandomIndex RND_fn_hReserveANewHandleIndex(void);
extern CPA_EXPORT void RND_fn_vReadRandomScript(char *_szName);
extern CPA_EXPORT void RND_fn_vComputeRandomTable(void);
extern CPA_EXPORT void RND_fn_vReinitRandomTable(void);
extern CPA_EXPORT unsigned long RND_fn_ulGetUnsignedLongRandomValue(RND_tdxHandleToRandomIndex _lIndexNumber,unsigned long _ulMin,unsigned long _ulMax);
extern CPA_EXPORT unsigned char RND_fn_ulGetUnsignedCharRandomValue(RND_tdxHandleToRandomIndex _lIndexNumber,unsigned char _ucMin,unsigned char _ucMax);
extern CPA_EXPORT void RDN_fn_vSetRandomSeed(RND_tdxHandleToRandomIndex _lIndexNumber, long _lNewSeed); /*ANNECY BBB*/
extern CPA_EXPORT long RND_fn_lGetLongRandomValue(RND_tdxHandleToRandomIndex _lIndexNumber,long _lMin,long _lMax);
extern CPA_EXPORT MTH_tdxReal RND_fn_xGetRealRandomValue(RND_tdxHandleToRandomIndex _lIndexNumber,MTH_tdxReal _xMin,MTH_tdxReal _xMax);
extern CPA_EXPORT struct MTH3D_tdstVector_ *RND_fn_p_stGetVectorRandomValue(RND_tdxHandleToRandomIndex _lIndexNumber,struct MTH3D_tdstVector_ *_p_stMin,struct MTH3D_tdstVector_ *_p_stMax,struct MTH3D_tdstVector_ *_p_stReturnedVector);
extern CPA_EXPORT struct MTH3D_tdstMatrix_ *RND_fn_p_stGetMatrixRandomValue(RND_tdxHandleToRandomIndex _lIndexNumber,struct MTH3D_tdstMatrix_ *_p_stMin,struct MTH3D_tdstMatrix_ *_p_stMax,struct MTH3D_tdstMatrix_ *_p_stReturnedMatrix);
void RND_fn_vRemapRandomTable(void);
unsigned long RND_fn_ulGetRandomValue(RND_tdxHandleToRandomIndex _lIndexNumber);
void RND_fn_vIncIndex(RND_tdxHandleToRandomIndex _lIndexNumber);
#if defined (__cplusplus)
}
#endif /* __cplusplus */
#undef EXTERN
#undef extern
#endif /* __RND_Main_H__ */

View File

@@ -0,0 +1,72 @@
/*=========================================================================
* RND_Scpt.h :
* Script read
*
* (c) Ubi Studios 1997
*=======================================================================*/
#if !defined(__RND_SCPT_H__)
#define __RND_SCPT_H__
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
/****************************************/
#if !defined(CPA_EXPORT)
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif /*CPA_WANTS_IMPORT || CPA_WANTS_EXPORT*/
#endif /*CPA_EXPORT*/
/****************************************/
#undef EXTERN
#undef extern
#if !defined(D_RND_Input_VariableDefine)
#define EXTERN extern
#else
#define EXTERN
#endif /* D_RND_Input_VariableDefine*/
/**** Macros definitions ****/
#define C_GrandChildSection ( 2)
#define C_ChildSection ( 1)
#define C_ThisSection ( 0)
#define C_ParentSection (-1)
#define C_GrandParentSection (-2)
#define C_GrandChildContext ( 2)
#define C_ChildContext ( 1)
#define C_ThisContext ( 0)
#define C_ParentContext (-1)
#define C_GrandParentContext (-2)
#define M_IsTitle (_eAction==SCR_EA_Anl_BeginSection)
#define M_IsEnd (_eAction==SCR_EA_Anl_EndSection)
#define M_IsBegSubSection (_eAction==SCR_EA_Anl_BeginSubSection)
#define M_IsEndSubSection (_eAction==SCR_EA_Anl_EndSubSection)
#define M_IsEntry (_eAction==SCR_EA_Anl_Entry)
#define M_ActionIs(szActionAsked) (!strcmpi(_p_szName,szActionAsked))
#define M_CheckScriptParamNumber(ulNumber) \
{ \
if (SCR_fn_uc_RdL0_GetNumberOfParameters(_ap_szParams)!=ulNumber) \
M_RNDFatalError(E_uwRNDScriptBadNumberOfArg); \
}
/**** Functions definitions ****/
#if !defined(U64)
SCR_tde_Anl_ReturnValue RND_fn_eRandomScriptCallBack(SCR_tdst_File_Description *_p_stFile,char *_p_szName,char *_ap_szParams[],SCR_tde_Anl_Action _eAction);
#endif /* U64 */
#undef EXTERN
#undef extern
#endif /* __RND_SCPT_H__ */

View File

@@ -0,0 +1,64 @@
/*=========================================================================
* RND_Str.h : Structure des fonctions d'entr<74>es
*
* Version 1.0
* Creation date 01/04/97
* Revision date
*
* (c) Ubi Studios 1997
*=======================================================================*/
#if !defined(__RND_Str_H__)
#define __RND_Str_H__
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
/****************************************/
#if !defined(CPA_EXPORT)
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif /* CPA_WANTS_IMPORT || CPA_WANTS_EXPORT */
#endif /* CPA_EXPORT */
/****************************************/
#define RND_C_MaxIndex 50
/***********************/
/**** Handle define ****/
/***********************/
#if defined(D_RND_Input_StructureDefine)
struct RND_tdstRandom_
{
unsigned long ulSizeOfTable;
unsigned long a_ulIndex[RND_C_MaxIndex];
RND_tdxHandleToRandomIndex hLastUsedIndex;
unsigned long ulMaxValueInTable;
/*MTH_tdxReal xMaxValueInTable;*/
MTH_tdxReal xInverseMaxValueInTable;
unsigned long *p_ulTable;
};
#endif /* D_RND_Input_StructureDefine */
#undef EXTERN
#undef extern
#if !defined(D_RND_Input_VariableDefine)
#define EXTERN extern
#else
#define EXTERN
#endif /* D_RND_Input_VariableDefine*/
EXTERN struct RND_tdstRandom_ RND_g_stRandomStructure;
#undef EXTERN
#undef extern
#endif /* __RND_Str_H__ */

View File

@@ -0,0 +1,3 @@
#define C_szRNDVersion "RND V5.0.1" /* The format is XXX Va.b.c with Xxx is the Tag of the module */
#define C_szRNDFullName "Random" /* the complete and clear name of the module */
#define C_szRNDDate "Mai 5 1997" /* The format is "Mmm dd yyyy".You can use __DATE__ but be careful that you have the control of the compilation*/