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,306 @@
#include "Options/Specif/SubMapPs.h"
void GAM_fn_vCreateListOfLevel(void)
{
unsigned long i;
FIL_tdxHandleToFileNameListElement hFileNameListElement,hNextFileNameListElement;
char szFileName[MAX_PATH];
sprintf(szFileName,"%s/*",fn_szGetLevelsDataPath());
g_stEngineStructure.hLevelNameList=FIL_fn_hSearchFile(szFileName,_A_SUBDIR);
if (LST2_M_DynamicGetNumberOfElements(&g_stEngineStructure.hLevelNameList->hFileNameListAnchor))
{
LST2_M_DynamicForEachMovingElementOf(&g_stEngineStructure.hLevelNameList->hFileNameListAnchor,hFileNameListElement,hNextFileNameListElement,i)
{
sprintf(szFileName,"%s/%s/%s.%s",fn_szGetLevelsDataPath(),hFileNameListElement->szFileName,hFileNameListElement->szFileName,C_ScriptDescriptionSuffixe);
if (!FIL_fn_bIsFileExist(szFileName))
{
FIL_fn_vDestroyOnElementInFileNameList(hFileNameListElement);
}
}
}
else
{ /* try to find levels on CDROM*/
sprintf(szFileName,"%c:\\%s/*",g_cCDROM,fn_szGetLevelsDataPath());
g_stEngineStructure.hLevelNameList=FIL_fn_hSearchFile(szFileName,_A_SUBDIR);
LST2_M_DynamicForEachMovingElementOf(&g_stEngineStructure.hLevelNameList->hFileNameListAnchor,hFileNameListElement,hNextFileNameListElement,i)
{
sprintf(szFileName,"%c:\\%s/%s/%s.%s",g_cCDROM,fn_szGetLevelsDataPath(),hFileNameListElement->szFileName,hFileNameListElement->szFileName,C_ScriptDescriptionSuffixe);
if (!FIL_fn_bIsFileExist(szFileName))
{
FIL_fn_vDestroyOnElementInFileNameList(hFileNameListElement);
}
}
}
/* ANNECY MT - 07/09/98 {*/
g_stEngineStructure.lSubMapNumber = GAM_M_MakeSubMapNumber(255,255);
/* END ANNECY MT }*/
}
/*===================================================
Functions for thr choice of preferences
===================================================*/
tdstPreferences g_stPreferences;
void GAM_fn_vReadPreferences(void)
{
char szTemp[_MAX_PATH];
char szCurrentDir[_MAX_PATH];
GetCurrentDirectory(_MAX_PATH, szCurrentDir);
strcat(szCurrentDir,"\\StartPrg.ini");
GetPrivateProfileString("Start","AskAtEachTime","0",szTemp,255,szCurrentDir);
g_stPreferences.cAsk = (char) atoi(szTemp);
/* Get if you want to use binary data*/
GetPrivateProfileString("Start","UseBinaryData","0",szTemp,_MAX_PATH,szCurrentDir);
g_stPreferences.cBinary = (char) atoi(szTemp);
/* Want to use binary dsc (game.dsb, level.dsb) instead of script dsc ?*/
GetPrivateProfileString("Start","DscCreated","0",szTemp,_MAX_PATH,szCurrentDir);
g_stPreferences.cBinaryDsc = (char) atoi(szTemp);
#ifdef _DEBUG
GetPrivateProfileString("Start","GDDebugBin","",g_stPreferences.szBinaryDirectory,64,szCurrentDir);
#else
GetPrivateProfileString("Start","GDReleaseBin","",g_stPreferences.szBinaryDirectory,64,szCurrentDir);
#endif /*_DEBUG*/
}
void GAM_fn_vSavePreferences(void)
{
char szTemp[_MAX_PATH];
char szCurrentDir[_MAX_PATH];
GetCurrentDirectory(_MAX_PATH, szCurrentDir);
strcat(szCurrentDir,"\\StartPrg.ini");
sprintf(szTemp,"%d",g_stPreferences.cAsk);
WritePrivateProfileString("Start","AskAtEachTime",szTemp,szCurrentDir);
sprintf(szTemp,"%d",g_stPreferences.cBinary);
WritePrivateProfileString("Start","UseBinaryData",szTemp,szCurrentDir);
sprintf(szTemp,"%d",g_stPreferences.cBinaryDsc);
WritePrivateProfileString("Start","DscCreated",szTemp,szCurrentDir);
}
/*===================================================
Functions for the choice of the gamedata directory
===================================================*/
void GAM_fn_vGetDataDirectoryInStartPrgIni(void)
{
#ifdef ACTIVE_EDITOR
strcpy(g_a64_cGameDataDirectory,"GameData");
#else
char szTemp[255];
char cUseBinaryData=0;
char cAskAtEachTime=0;
char cBinIsOk=0;
char szCurrentDir[_MAX_PATH];
if (g_cMemMode < 2)
/* Test if we are in a data binarisation pass*/
{
GetCurrentDirectory(_MAX_PATH, szCurrentDir);
strcat(szCurrentDir,"\\StartPrg.ini");
if (_access("StartPrg.ini", 0) != 0)
{
strcpy(g_a64_cGameDataDirectory,"GameData");
return;
}
#ifdef _DEBUG
GetPrivateProfileString("Start","BinDebugIsOk","0",szTemp,255,szCurrentDir);
#else
GetPrivateProfileString("Start","BinReleaseIsOk","0",szTemp,255,szCurrentDir);
#endif /*_DEBUG*/
cBinIsOk = (char) atoi(szTemp);
/* ANNECY OA - 20/07/99 { */
GetPrivateProfileString("Start", "CDDrive", "", szTemp, 255, szCurrentDir);
g_cCDROM = *szTemp;
/* END ANNECY OA } */
if (cBinIsOk) /* Data are binarized*/
{
GAM_fn_vReadPreferences();
if (g_stPreferences.cAsk)
{
fn_vChoicePreferences();
}
if (g_stPreferences.cBinary)
{
g_cMemMode = 1;
SNA_fn_vSetLoadType( SNA_LOAD_SNAPSHOT );
strcpy(g_a64_cGameDataDirectory,g_stPreferences.szBinaryDirectory);
}
else
{
SNA_fn_vSetLoadType( SNA_LOAD_SCRIPT );
strcpy(g_a64_cGameDataDirectory,"GameData");
}
/* Test if the load/save dsc has already been set (by command line)*/
if( SNA_fn_ucGetLoadDscType() == SNA_C_LoadScriptDsc )
{
/* If not, set it from user preference*/
if( g_stPreferences.cBinaryDsc )
{
SNA_fn_vSetLoadDscType( SNA_C_LoadBinaryDsc );
}
}
}
else
{
SNA_fn_vSetLoadType( SNA_LOAD_SCRIPT );
strcpy(g_a64_cGameDataDirectory,"GameData");
}
GetPrivateProfileString("Start","UsesBigFile","No",szTemp,255,szCurrentDir);
SNA_fn_vSetBigFile( ( unsigned char ) strcmp(szTemp , "No") );
}
else
{
/* pass of binarization*/
SNA_fn_vSetLoadType( SNA_LOAD_SCRIPT );
SNA_fn_vSetBigFile( FALSE );
strcpy(g_a64_cGameDataDirectory,"GameData");
}
#endif /* ACTIVE_EDITOR*/
}
/*===================================================
Functions for the choice of the gamedata directory
===================================================*/
#if !defined(RETAIL)
ACP_tdxBool TEST_g_bAutomaticTest;
char TEST_g_cChangeMapWithRestart;
char TEST_g_cAllMaps;
char TEST_g_cWriteLogFile;
long TEST_g_lWaitBeforeChangeLevel;
long TEST_g_lWaitMin;
long TEST_g_lWaitMax;
long TEST_g_lNbChangeMapBeforeExit;
long TEST_g_lAnimStack;
long TEST_g_lNbMapInSequence;
char TEST_g_a_szMapSequence[200][50];
void GAM_fn_vReadFileTestIni()
{
#ifdef ACTIVE_EDITOR
TEST_g_bAutomaticTest = FALSE;
#else
char szTemp[256];
char szCurrentDir[_MAX_PATH];
GetCurrentDirectory(_MAX_PATH, szCurrentDir);
strcat(szCurrentDir,"\\Test.ini");
if (_access(szCurrentDir, 04) != 0)
{
TEST_g_bAutomaticTest = FALSE;
return;
}
/* As soon as there is a test.ini file, we activate autotest.
* even if the file is empty (default values will apply) */
TEST_g_bAutomaticTest=TRUE;
/* Default value is ALLMAPSONLY */
TEST_g_cAllMaps = 1;
GetPrivateProfileString("TEST","MODE","ALLMAPSONLY",szTemp,255,szCurrentDir);
if (strcmp(szTemp, "RANDOM") == 0)
{
TEST_g_cAllMaps = 0;
}
else if (strcmp(szTemp, "ALLMAPSONLY") == 0)
{
TEST_g_cAllMaps = 1;
}
else if (strcmp(szTemp, "SEQUENCE") == 0)
{
TEST_g_cAllMaps = 2;
}
else if (strcmp(szTemp, "RESTARTONLY") == 0)
{
TEST_g_cAllMaps = 3;
}
GetPrivateProfileString("TEST","WITHRESTART","0",szTemp,255,szCurrentDir);
TEST_g_cChangeMapWithRestart = (char) atoi(szTemp);
GetPrivateProfileString("TEST","STAT","1",szTemp,255,szCurrentDir);
TEST_g_cWriteLogFile = (char) atoi(szTemp);
if( TEST_g_cWriteLogFile )
{
DeleteFile("Test.log" );
}
GetPrivateProfileString("TEST","WAITMIN","60",szTemp,255,szCurrentDir);
TEST_g_lWaitMin = (long) atoi(szTemp);
GetPrivateProfileString("TEST","WAITMAX","200",szTemp,255,szCurrentDir);
TEST_g_lWaitMax= (long) atoi(szTemp);
GetPrivateProfileString("TEST","ANIMSTACK","0",szTemp,255,szCurrentDir);
TEST_g_lAnimStack= (long) atoi(szTemp);
TEST_g_lWaitBeforeChangeLevel = TEST_g_lWaitMin;
GetPrivateProfileString("TEST","NBCHANGEMAP","-1",szTemp,255,szCurrentDir);
TEST_g_lNbChangeMapBeforeExit= (long) atoi(szTemp);
{ /* Read entries SEQUENCE1=... to SEQUENCE10=... */
int i, iMapNameLength;
char szKeyName[50];
char szMapList[500];
char *p_szMap;
TEST_g_lNbMapInSequence = 0;
for( i=1; i<=10; i++ )
{
/* Get one sequence */
sprintf( szKeyName, "SEQUENCE%i", i );
GetPrivateProfileString("TEST", szKeyName,"", szMapList, 500, szCurrentDir);
/* Get first map of sequence */
p_szMap = strtok( szMapList, " \t" );
while( p_szMap != NULL )
{
/* Copy its name to array of map */
iMapNameLength = strlen( p_szMap );
if( iMapNameLength > 2 && iMapNameLength < _MAX_NAME_LEVEL )
strcpy( TEST_g_a_szMapSequence[TEST_g_lNbMapInSequence++], p_szMap );
/* Get next map of sequence */
p_szMap = strtok( NULL, " \t" );
}
}
}
#endif /* ACTIVE_EDITOR*/
}
#endif
/*************************************************************************/
void GAM_fn_vSetSlotName(short _wSlotdId, char *_szSlotName)
{
/*if we could rename the data file*/
if ( fn_bRenameSaveGameSlot(g_stGameOptions.a_szSlotNames[_wSlotdId], _szSlotName) )
{
/* change the name in the slot database as well*/
/* strcpy(g_stGameOptions.a_szSlotNames[_wSlotdId], _szSlotName);*/
memcpy( g_stGameOptions.a_szSlotNames[_wSlotdId], _szSlotName, C_ucSaveGameSlotNameLength );
}
}
/*************************************************************************/
char *GAM_fn_szGetSlotName(short _wSlotId)
{
return g_stGameOptions.a_szSlotNames[_wSlotId];
}

View File

@@ -0,0 +1,177 @@
#include "ToolsCPA.h"
#include "INO.h"
#include "specif\DS_TouchPanel.h"
//For Stylet Rotation
unsigned long ulSavedTime_R, ulSavedTime_L;
unsigned char i_IDX_R, i_IDX_L ;
unsigned char TAB_IDxNextSector_L[4],TAB_IDxNextSector_R[4];
//For Stylet Grattage
MTH3D_tdstVector g_stStyletPos ;
unsigned long g_ulTimeAction, g_ulTimeInactif;
#define TP_WITH_LEFTBUTTON
#ifdef TP_WITH_LEFTBUTTON
#define TP_PRESSED INO_fn_wLeftMouseButtonDown
#define TP_JUST_PRESSED INO_fn_wLeftMouseButtonJustDown
#define TP_JUST_RELEASED INO_fn_wLeftMouseButtonJustUp
#define TP_RELEASED() C_MouseTrue
#else
#define TP_PRESSED INO_fn_wRightMouseButtonDown
#define TP_JUST_PRESSED INO_fn_wRightMouseButtonJustDown
#define TP_JUST_RELEASED INO_fn_wRightMouseButtonJustUp
#define TP_RELEASED() C_MouseTrue
#endif
//================================================================//
BOOL DS_bTPGetPosition(int *X,int *Y)
{
if(INO_fn_wGetMousePosition(X, Y)==C_wMouseTrue)
return TRUE;
else
return FALSE;
}
//================================================================//
BOOL DS_bTPPressed()
{
return (TP_PRESSED()==C_wMouseTrue);
}
//================================================================//
BOOL DS_bTPJustPressed()
{
return (TP_JUST_PRESSED()==C_wMouseTrue);
}
//================================================================//
BOOL DS_bTPReleased()
{
return (TP_JUST_RELEASED()==C_wMouseTrue);
}
//================================================================//
BOOL DS_bTPJustReleased()
{
return (TP_JUST_RELEASED()==C_wMouseTrue);
}
//================================================================//
void fn_InitStyletRotationDATA(MTH3D_tdstVector stCentre, MTH3D_tdstVector stStyletPos, BOOL b_Right)
{
if( b_Right )
{
ulSavedTime_R = g_stEngineStructure.stEngineTimer.ulCurrentTimerCount;
i_IDX_R = 0;
if ( stStyletPos.xX > stCentre.xX)
{
if ( stStyletPos.xY < stCentre.xY)
{
TAB_IDxNextSector_R[0] = 2;
TAB_IDxNextSector_R[1] = 3;
TAB_IDxNextSector_R[2] = 4;
TAB_IDxNextSector_R[3] = 1;
}
else
{
TAB_IDxNextSector_R[0] = 3;
TAB_IDxNextSector_R[1] = 4;
TAB_IDxNextSector_R[2] = 1;
TAB_IDxNextSector_R[3] = 2;
}
}
else
{
if ( stStyletPos.xY > stCentre.xY)
{
TAB_IDxNextSector_R[0] = 4;
TAB_IDxNextSector_R[1] = 1;
TAB_IDxNextSector_R[2] = 2;
TAB_IDxNextSector_R[3] = 3;
}
else
{
TAB_IDxNextSector_R[0] = 1;
TAB_IDxNextSector_R[1] = 2;
TAB_IDxNextSector_R[2] = 3;
TAB_IDxNextSector_R[3] = 4;
}
}
}
else
{
ulSavedTime_L = g_stEngineStructure.stEngineTimer.ulCurrentTimerCount;
i_IDX_L = 0;
if ( stStyletPos.xX > stCentre.xX)
{
if ( stStyletPos.xY < stCentre.xY)
{
TAB_IDxNextSector_L[0] = 4;
TAB_IDxNextSector_L[1] = 3;
TAB_IDxNextSector_L[2] = 2;
TAB_IDxNextSector_L[3] = 1;
}
else
{
TAB_IDxNextSector_L[0] = 1;
TAB_IDxNextSector_L[1] = 4;
TAB_IDxNextSector_L[2] = 3;
TAB_IDxNextSector_L[3] = 2;
}
}
else
{
if ( stStyletPos.xY > stCentre.xY)
{
TAB_IDxNextSector_L[0] = 2;
TAB_IDxNextSector_L[1] = 1;
TAB_IDxNextSector_L[2] = 4;
TAB_IDxNextSector_L[3] = 3;
}
else
{
TAB_IDxNextSector_L[0] = 3;
TAB_IDxNextSector_L[1] = 2;
TAB_IDxNextSector_L[2] = 1;
TAB_IDxNextSector_L[3] = 4;
}
}
}
}
int fni_GetStyletCurrentSector(MTH3D_tdstVector stCentre, MTH3D_tdstVector stStyletPos)
{
if ( stStyletPos.xX > stCentre.xX)
{
if ( stStyletPos.xY < stCentre.xY)
return 1;
else
return 2;
}
else
{
if ( stStyletPos.xY > stCentre.xY)
return 3;
else
return 4;
}
}
//================================================================//

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,190 @@
/*=========================================================================
* SubMapPs.c : This module contain all submap positions functions
* This is a part of the Game project.
*
* Version 1.0
* Creation date 08/09/98
* Revision date
*
*
* (c) Ubi Studios 1998
*=======================================================================*/
/*******************************************************/
/**** For the structures and variables declarations ****/
/*******************************************************/
#include "Options/Options.h"
#include "GAM/Header.h"
#include "ToolsCPA.h"
#include "ZeMem.h"
#include "GAM\Options\Specif\SubMapPs.h"
#include "Macros.h"
/*******************************************************/
/**** For the structures and variables declarations ****/
/*******************************************************/
tdstSubMapPosition *gs_hFirstSubMapPosition;
/*******************************************************/
extern long fn_lAToI(char *szString);
SCR_tde_Anl_ReturnValue GAM_fn_eCallBackLoadSubMapPosition(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType);
SCR_tde_Anl_ReturnValue GAM_fn_eCallBackLoadSuperObject(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType);
/*******************************************************/
/*****/
/*******************************************************/
void GAM_fn_vAddSubMapPosition(long _lSubMapNumber , long _lEntryNumber , POS_tdxHandleToPosition _hPosition)
{
tdstSubMapPosition *hSubMapPosition;
hSubMapPosition = (tdstSubMapPosition *)M_p_GameMallocInHLM(sizeof(struct tdstSubMapPosition_));
hSubMapPosition -> lSubMap = GAM_M_MakeSubMapNumber(_lSubMapNumber,_lEntryNumber);
hSubMapPosition -> hPosition = _hPosition;
if(gs_hFirstSubMapPosition == NULL)
{
hSubMapPosition -> p_stNextPosition = NULL;
}
else
{
hSubMapPosition -> p_stNextPosition = gs_hFirstSubMapPosition;
}
gs_hFirstSubMapPosition = hSubMapPosition;
}
/*******************************************************/
/*****/
/*******************************************************/
POS_tdxHandleToPosition GAM_fn_hGetSubMapPosition(long _lSubMapNumber , long _lEntryNumber)
{
tdstSubMapPosition *hSubMapPosition;
long lAbsolute;
lAbsolute = GAM_M_MakeSubMapNumber(_lSubMapNumber,_lEntryNumber);
hSubMapPosition = gs_hFirstSubMapPosition;
while(hSubMapPosition)
{
if(hSubMapPosition -> lSubMap == lAbsolute)
return hSubMapPosition -> hPosition;
hSubMapPosition = hSubMapPosition -> p_stNextPosition;
}
return NULL;
}
/*******************************************************/
/*****/
/*******************************************************/
void GAM_fn_vInitSubMapPositionList()
{
gs_hFirstSubMapPosition = NULL;
}
/*******************************************************/
/*****/
/*******************************************************/
void GAM_fn_vClearSubMapPositionList()
{
tdstSubMapPosition *hSubMapPosition,*hNextSubMapPosition;
hSubMapPosition = gs_hFirstSubMapPosition;
while(hSubMapPosition)
{
hNextSubMapPosition = hSubMapPosition -> p_stNextPosition;
POS_M_GameFree(hSubMapPosition -> hPosition);
M_GameFreeInHLM(hSubMapPosition);
hSubMapPosition = hNextSubMapPosition;
}
gs_hFirstSubMapPosition = NULL;
}
/*******************************************************/
/*****/
/*******************************************************/
void GAM_fn_vLoadSubMapPositions(char *_szFileName)
{
SCR_tdst_Anl_Callback *p_stCallBackSuperObject;
SCR_tdpfn_Anl_Callback pfn_CallBackSuperObject;
SCR_tdst_Anl_Callback *p_stCallBackSubMapSection;
SCR_tdpfn_Anl_Callback pfn_CallBackSubMapSection;
if(SCR_fn_c_RdL0_IsSectionExists(_szFileName))
{
/* unregister callback*/
p_stCallBackSuperObject = SCR_fnp_st_RdL0_GetRegisterCallback( "SuperObject", SCR_CRC_c_RdL0_ForSection );
pfn_CallBackSuperObject = p_stCallBackSuperObject -> pfn_eCallback;
/**/
p_stCallBackSubMapSection = SCR_fnp_st_RdL0_GetRegisterCallback( "CreateSubMaps", SCR_CRC_c_RdL0_ForSection );
pfn_CallBackSubMapSection = p_stCallBackSubMapSection -> pfn_eCallback;
/* register new callback*/
p_stCallBackSuperObject -> pfn_eCallback = GAM_fn_eCallBackLoadSuperObject;
p_stCallBackSubMapSection -> pfn_eCallback = GAM_fn_eCallBackLoadSubMapPosition;
/**/
SCR_fnp_st_RdL0_AnalyseSection( _szFileName, SCR_CDF_uw_Anl_Normal);
SCR_fn_v_RdL0_DeleteOpenSection( _szFileName, SCR_CDR_c_RdL0_Contains ); /* ???*/
/* restore callback*/
p_stCallBackSuperObject -> pfn_eCallback = pfn_CallBackSuperObject;
p_stCallBackSubMapSection -> pfn_eCallback = pfn_CallBackSubMapSection;
}
}
/*******************************************************/
/*****/
/*******************************************************/
SCR_tde_Anl_ReturnValue GAM_fn_eCallBackLoadSubMapPosition(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
{
POS_tdstCompletePosition *p_stMatrix;
long lSubMapNumber,lEntryNumber;
switch (cType)
{
case SCR_EA_Anl_BeginSection:
break;
case SCR_EA_Anl_Entry:
break;
case SCR_EA_Anl_BeginSubSection:
break;
case SCR_EA_Anl_EndSubSection:
if(strcmpi(szParams[0],"Matrix")==0)
{
/* get matrix*/
SCR_M_RdL0_GetContextLong(1,0,POS_tdstCompletePosition *,p_stMatrix);
/* get SubMap Number*/
lSubMapNumber = fn_lAToI(szAction + strlen("submap"));
/* get Entry Number*/
lEntryNumber = fn_lAToI(szParams[1] + strlen("Position"));
/* add position*/
GAM_fn_vAddSubMapPosition( lSubMapNumber , lEntryNumber , p_stMatrix );
}
break;
case C_SCRIPT_EndSection:
break;
}
return R_SCRIPT_NormalReturn;
}
SCR_tde_Anl_ReturnValue GAM_fn_eCallBackLoadSuperObject(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
{
return R_SCRIPT_NormalReturn;
}

View File

@@ -0,0 +1,83 @@
/*----------------------------------------------------------------------------
-- Description : GAM_fn_ucGetMorphAmount
-- Get the morph amount into the array of morphing data of an animation
------------------------------------------------------------------------------
-- Methods : Nothing to say
------------------------------------------------------------------------------
-- Input : _p_stAnim : Pointer to the morphed animation
-- _ulChannelNumber : Number of the channel
-- _uwFrameNumber : Number of the frame
-- Output : the amount of morphing
------------------------------------------------------------------------------
-- Creation date : Mar 97 Author: Alain Robin
------------------------------------------------------------------------------
-- Modifications :
-- Modification date : Modification author :
----------------------------------------------------------------------------*/
unsigned char GAM_fn_ucGetMorphAmount(tdstAnim3d *_p_stAnim, unsigned long _ulChannelNumber, unsigned short _uwFrameNumber)
{
/* We suppose that we have already tested that _p_stAnim->d_stMorphDataArray isn't NULL*/
return _p_stAnim->d_stMorphDataArray[_uwFrameNumber*_p_stAnim->ucMaxNumberOfElements+_ulChannelNumber].ucMorphingAmount;
}
/*----------------------------------------------------------------------------
-- Description : GAM_fn_ucGetMorphTarget
-- Get the morph amount into the array of morphing data of an animation
------------------------------------------------------------------------------
-- Methods : Nothing to say
------------------------------------------------------------------------------
-- Input : _p_stAnim : Pointer to the morphed animation
-- _ulChannelNumber : Number of the channel
-- _uwFrameNumber : Number of the frame
-- Output : the target of morphing
------------------------------------------------------------------------------
-- Creation date : Mar 97 Author: Alain Robin
------------------------------------------------------------------------------
-- Modifications :
-- Modification date : Modification author :
----------------------------------------------------------------------------*/
unsigned char GAM_fn_ucGetMorphTarget(tdstAnim3d *_p_stAnim, unsigned long _ulChannelNumber, unsigned short _uwFrameNumber)
{
/* We suppose that we have already tested that _p_stAnim->d_stMorphDataArray isn't NULL*/
return _p_stAnim->d_stMorphDataArray[_uwFrameNumber*_p_stAnim->ucMaxNumberOfElements+_ulChannelNumber].ucTarget;
}
/*----------------------------------------------------------------------------
-- Description : GAM_fn_p_stGetMorphData
-- Get the morph data into the array of morphing data of an animation
------------------------------------------------------------------------------
-- Methods : Nothing to say
------------------------------------------------------------------------------
-- Input : _p_stAnim : Pointer to the morphed animation
-- _ulChannelNumber : Number of the channel
-- _uwFrameNumber : Number of the frame
-- Output : the target of morphing
------------------------------------------------------------------------------
-- Creation date : Jun 98 Author: Alain Robin
------------------------------------------------------------------------------
-- Modifications :
-- Modification date : Modification author :
----------------------------------------------------------------------------*/
tdstMorphData* GAM_fn_p_stGetMorphData(tdstAnim3d *_p_stAnim, unsigned long _ulChannelNumber, unsigned short _uwFrameNumber)
{
return &_p_stAnim->d_stMorphDataArray[_uwFrameNumber*_p_stAnim->ucMaxNumberOfElements+_ulChannelNumber];
}
/*
// Animation is a interpolated animation
tdstA3dGENERAL *p_stCurrentA3dGENERAL;
long i;
#ifdef A3X_CUT
p_stCurrentA3dGENERAL= fn_p_GetA3dGENERAL( p_uwLastA3dGENERAL[_p_stAnim->uwNumOfA3dGENERAL], _uwFrameNumber );
#else
p_stCurrentA3dGENERAL= fn_p_GetA3dGENERAL( _p_stAnim->uwNumOfA3dGENERAL, _uwFrameNumber );
#endif
_p_stAnim->d_stMorphDataArray=&p_stMorphData[p_stCurrentA3dGENERAL->uwNumOfFirstMorphData];
for(i=0;i<p_stCurrentA3dGENERAL->uwNumberOfMorphData;++i)
if((_p_stAnim->d_stMorphDataArray[i].uwChannelNumber==_ulChannelNumber)&&(_p_stAnim->d_stMorphDataArray[i].uwFrameNumber==_uwFrameNumber))
return &(_p_stAnim->d_stMorphDataArray[i]);
return NULL;
}
*/

File diff suppressed because it is too large Load Diff